agentleFS
FuDesign2008FuDesign2008/open-skills/skills/jira-read/SKILL.md

jira-read

Skill6 starsChanged 6 days agoMITView on GitHub

Read Jira issue data from local cache or API, and download attachments via script (never into context). Triggers when user says "jira-read [JIRA-ID]", 「读取 Jira」「查看 Jira」「下载 Jira」「下载附件」 (read/view/download Jira / download attachments), or needs to fetch Jira issue data. Requires $JIRA_CACHE_DIR (e.g. ~/.cache/jira).

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Default: call jira_get_issue(issue_key="{JIRA-ID}", fields="*all", comment_limit=50) → on success, format and save, then continue.

    line 62
  2. Distinctive:

    Read Markdown → parse YAML front matter and body → output as structured Markdown.

    line 69
  3. Distinctive:

    Attachment handling: Never read attachment content into the Agent context.

    line 73
  4. Very specific:

    Run this chain before MCP/jira_get_issue, --live/--force, and attachment download.

    line 81
  5. Very specific:

    After env or the file has a token: do not paste the PAT into chat, argv, or command previews.

    line 88
  6. Very specific:

    Do not teach a manual curl that interpolates the PAT (no “equivalent curl from the Authentication table”).

    line 90
  7. Very specific:

    Always download attachments to local disk via the skill scripts — never read attachment content into the Agent context.

    line 94

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Jira Read — Execution Rules

Quickly read downloaded Jira data from local cache — no network access required.

Configuration

Set the cache directory environment variable before use (recommend adding to .zshrc / .bashrc):

export JIRA_CACHE_DIR="$HOME/.cache/jira"

Defaults to ~/.cache/jira/ if not set.

Triggers & Parameters

Primary trigger: jira-read [JIRA-ID] — case-insensitive (auto-converted to uppercase)

UsageBehaviorOutput Mode
jira-read {ID}Read local cache; auto-fetch from API if missingSummary
jira-read {ID} --liveSkip cache, fetch from API and update cacheSummary
jira-read {ID} --forceForce API fetch, overwrite local cacheSummary
jira-read {ID} --no-downloadLocal only; prompt if missingSummary
jira-read {ID} --fullSame as default, output full content including all commentsFull
jira-read {ID} --metaSame as default, output YAML front matter onlyMetadata
jira-read ID1 ID2 ID3Batch read from local cacheSummary
jira-read --live ID1 ID2 ID3Batch fetch from API and cacheSummary
jira-read --force ID1 ID2 ID3Batch force re-fetch (overwrite local cache)Summary
jira-read --list / -lList all local cache entriesList

Storage Paths

  • Main file: $JIRA_CACHE_DIR/{JIRA-ID}.md
  • Field mapping cache: $JIRA_CACHE_DIR/.field-mapping.json

On first use, automatically calls jira_search_fields to build field ID mapping; subsequent reads use the cache directly. --force refreshes the mapping.


Execution Flow

Step 1: Parse Jira ID

Extract (regex: ([A-Za-z]+-\d+)) and convert to uppercase, build the local file path.

Step 2: Check File Existence

File exists: continue to step 3

File does not exist:

  • Resolve the PAT via the credential chain (below) before any API call
  • Default: call jira_get_issue(issue_key="{JIRA-ID}", fields="*all", comment_limit=50) → on success, format and save, then continue; on failure, classify per Error Handling
  • --no-download: prompt only, don't auto-download
  • --live: skip local check, fetch from API and update cache
  • --force: fetch from API and overwrite local cache

Step 3: Read, Parse, Output

Read Markdown → parse YAML front matter and body → output as structured Markdown.

Parsed fields: jira_id, title, priority, status, reporter, assignee, created_at, updated_at, downloaded_at, source_url; body contains issue description, reproduction steps, expected/actual results, comment history.

Attachment handling: Never read attachment content into the Agent context. If the issue has attachments (logs, screenshots), note them at the end of the output. When the user needs the actual attachment (logs), follow the "Attachment Download" section below.

Output format examples for each scenario: see reference.md


Credential resolution (before any live fetch)

Run this chain before MCP/jira_get_issue, --live/--force, and attachment download. mcp-atlassian is an optional way to populate step 1; it is not required.

  1. Env JIRA_PERSONAL_TOKEN (canonical)
  2. Else env JIRA_PAT (alias; copy into JIRA_PERSONAL_TOKEN for the rest of the session)
  3. Else file ~/.config/jira-certs/jira-pat.txt (Windows: %USERPROFILE%\.config\jira-certs\jira-pat.txt) — first line, trimmed, single-line secret
  4. Else ask the user once for a PAT and ask whether to write it to that file. Do not live-fetch until a token exists.

After env or the file has a token: do not paste the PAT into chat, argv, or command previews; do not echo it in replies or logs; do not cat the file into the conversation. Scripts read env or the file themselves.

Do not teach a manual curl that interpolates the PAT (no “equivalent curl from the Authentication table”). That fallback is forbidden (supersedes the older attachment-download delta if it is still open).

Attachment Download

Always download attachments to local disk via the skill scripts — never read attachment content into the Agent context. To inspect log contents, extract only the relevant lines with grep/head/tail.

Authentication (Internal Jira)

ElementSourceNotes
PAT (Bearer)Credential chain aboveCanonical env JIRA_PERSONAL_TOKEN; alias JIRA_PAT; file jira-pat.txt
mTLS client certJIRA_CLIENT_CERT / JIRA_CLIENT_KEYDefault ~/.config/jira-certs/client.crt + client.key
SSLJIRA_SSL_VERIFY=falseInternal self-signed cert → curl -k / node rejectUnauthorized: false

Credentials (recipe field): store the PAT as one line in ~/.config/jira-certs/jira-pat.txt (same directory as the mTLS pair; not in any git repo). Format: single-line secret, no quotes. Rotation: replace the file contents and any exported env, then retry. mcp-atlassian may inject JIRA_PERSONAL_TOKEN instead of the file.

Attachment URL

Take it directly from attachment[].url returned by jira_get_issue, e.g.: https://jira.example.com/secure/attachment/{attachmentId}/{filename}

Download Script

Probe curl -V first. If the output contains Schannel (typical Windows) or PEM --cert/--key is unavailable, MUST use the node sidecar. Otherwise the bash script is allowed.

# Node (Windows / Schannel curl)
node scripts/download_jira_attachments.mjs 100001 app-log-1700000000000.zip /tmp/logs/PROJ-1234.zip

# Bash + OpenSSL curl (PEM --cert/--key)
scripts/download_jira_attachments.sh 100001 app-log-1700000000000.zip /tmp/logs/PROJ-1234.zip

Both resolve the PAT from the credential chain (Bearer, Basic fallback). Override cert paths with JIRA_CLIENT_CERT / JIRA_CLIENT_KEY. Set JIRA_URL (e.g. https://jira.example.com). Never put the PAT on the command line.

Download & Archive Flow

  1. Resolve credentials (chain above), then call jira_get_issue(issue_key=..., fields="summary,description,attachment,status,priority") for attachment[].id / filename / url
  2. Download to a temp dir via the selected script — download 1 first to verify auth, then batch
  3. unzip -l to preview the zip structure; confirm it is flat before extracting
  4. Archive into the project at issues/{type}/jira-bug/{JIRA-ID}-app-log/, writing {JIRA-ID}.md to record the ticket info + attachment list

Download result report format: see reference.md § 7


Cache Freshness Prompts

Cache AgePrompt
< 1 hourNone
1–24 hours"Cached X hours ago"
1–7 days"Cached X days ago, recommend updating"
> 7 days"Cache expired (X days ago), strongly recommend updating"

Error Handling

Error ScenarioHandling
Invalid Jira ID formatPrompt correct format
File not foundAuto-fetch from API (prompt only with --no-download)
Credential chain empty (env + alias + file)Ask-and-persist (do not treat as 401)
mcp-atlassian unavailableOptional injector missing: still use the credential chain; if issue JSON is needed, try cache / jira-read --live after resolving PAT; do not abort only because MCP is missing
HTTP 401 / 403 with a resolved tokenToken invalid or revoked — rotate it and update jira-pat.txt (and env if set)
TLS handshake / client certCheck client.crt / client.key and TLS 1.3; on Windows do not use Schannel curl for PEM mTLS — use the node sidecar
Issue not foundPrompt that Jira ID may be incorrect
File parse failureOutput raw file content

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.