
Fetching Work Item
- 10 installs
- 1 repo stars
- Updated August 5, 2026
- b-mendoza/agent-skills
Fetching Work Item is a skill that retrieves a Jira ticket or GitHub issue into a read-only, validated Markdown snapshot for downstream workflow phases.
About
Fetching Work Item retrieves a Jira ticket or a GitHub issue into a docs/<KEY>.md file as a read-only, validated Markdown snapshot. A developer uses it as the Phase 1 fetch step of a larger work-item orchestration workflow, either from an orchestrator or directly. It detects the platform from the input and loads the matching playbook, then stops after producing the snapshot and a structured handoff.
- Fetches a Jira ticket or GitHub issue into docs/<KEY>.md as a read-only snapshot
- Detects the platform from the input and loads the matching playbook just-in-time
- Phase 1 fetch-work-item step for a larger orchestration workflow
Fetching Work Item by the numbers
- 10 all-time installs (skills.sh)
- Ranked #2,198 of 3,282 Productivity & Planning skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
fetching-work-item capabilities & compatibility
- Works with
- jira · github
- Use cases
- project management · orchestration
What fetching-work-item says it does
Retrieves a Jira ticket or a GitHub issue into docs/<KEY>.md as a read-only, validated Markdown snapshot for downstream workflow phases.
Detects the platform from the input and loads the matching playbook just-in-time.
Workflow role: this is the Phase 1 fetch-work-item step for the
npx skills add https://github.com/b-mendoza/agent-skills --skill fetching-work-itemAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 10 |
|---|---|
| repo stars | ★ 1 |
| Last updated | August 5, 2026 |
| Repository | b-mendoza/agent-skills ↗ |
What it does
Pull a Jira ticket or GitHub issue into a local, validated Markdown snapshot to seed a multi-phase implementation workflow.
When should I use this skill?
A Jira URL, a GitHub issue URL, or owner/repo/number coordinates need the Phase 1 fetch-work-item step.
What you get
A validated read-only Markdown snapshot of the work item plus a structured handoff for later phases.
- Read-only validated Markdown snapshot at docs/<KEY>.md
- Structured handoff summary for downstream phases
Files
Fetching Work Item
You are a work-item retrieval coordinator. Keep the coordinator context small: detect the platform, derive the work-item identity per the active playbook, dispatch work-item-retriever, retain only its structured summary, and report the handoff state.
This skill is standalone. Bundled files define the workflow, contracts, and templates. Public URLs in ./references/external-sources.md are optional just-in-time sources for current platform syntax or progressive-disclosure rationale; normal execution still works from local files when web access is unavailable.
Workflow role: this is the Phase 1 fetch-work-item step for the orchestration workflow. It may be invoked by a top-level orchestrator or directly by a user, but it stops after producing the validated snapshot and structured handoff. Later task planning, child-item creation, later-phase validation, and platform mutations stay with downstream workflow skills.
Platform Detection
Detect the platform from the input and load the matching playbook for every per-platform decision:
| Signal | Platform | Playbook |
|---|---|---|
JIRA_URL matching https://<workspace>.atlassian.net/browse/<KEY> | jira | `./references/jira-playbook.md` |
ISSUE_URL matching https://<host>/<owner>/<repo>/issues/<N> (including GitHub Enterprise), or OWNER+REPO+ISSUE_NUMBER | github | `./references/github-playbook.md` |
If the input matches neither pattern, ask one targeted clarification question before dispatching the retriever. The active playbook's Inputs and Identifier section defines the primary inputs and how the work-item identifier <KEY> is derived (TICKET_KEY for Jira, ISSUE_SLUG for GitHub).
Inputs
Primary inputs live in each playbook. Pass the platform inputs the active playbook names straight through to the retriever; it derives <KEY> and writes docs/<KEY>.md.
Subagent Registry
| Subagent | Path | Purpose |
|---|---|---|
work-item-retriever | ./subagents/work-item-retriever.md | Reads platform data via the playbook-supplied transport, writes and validates docs/<KEY>.md, returns a compact fetch summary |
Read the subagent file only when dispatching it.
Progressive Disclosure Map
| Need | Load |
|---|---|
| Coordinate routing and dispatch | This SKILL.md |
| Jira platform contract (inputs, transport, capture, sections, summary fields, rate limits, URLs) | ./references/jira-playbook.md |
| GitHub platform contract (inputs, transport, capture, sections, summary fields, rate limits, URLs) | ./references/github-playbook.md |
| Status semantics, exact summary lines, report phrasing | ./references/fetch-contract.md |
| Shared retrieval procedure and validation gate | ./references/retrieval-playbook.md inside work-item-retriever |
| Markdown snapshot shape | The active playbook's snapshot-template file, only during assembly |
| Current public docs or source-backed rationale | ./references/external-sources.md, then fetch only the relevant URL |
| Retriever behavior | ./subagents/work-item-retriever.md only when dispatching |
The coordinator passes reference paths and the active playbook path to the retriever instead of loading detailed playbooks or raw platform data. Keep only identifiers, the artifact path, structured statuses, counts, warnings, and fatal reasons.
Dispatch Pattern
PLAYBOOK_PATH: ../references/<platform>-playbook.md
<primary inputs named in the active playbook's Inputs and Identifier section>
FETCH_CONTRACT_PATH: ../references/fetch-contract.md
RETRIEVAL_PLAYBOOK_PATH: ../references/retrieval-playbook.md
EXTERNAL_SOURCES_PATH: ../references/external-sources.mdThese dispatch paths are relative to ./subagents/work-item-retriever.md, the file that consumes them.
The retriever reads the snapshot-template path from the active playbook's Snapshot Sections section at assembly time.
Branch on the structured summary, not prose:
| Summary state | Coordinator action |
|---|---|
FETCH: PASS with Validation: PASS | Report success and continue |
FETCH: PARTIAL with Validation: PASS | Report success with visible warnings; continue only if downstream phases tolerate partial context |
Validation: FAIL | Stop and report the contract failure |
FETCH: FAIL | Stop and report Failure category plus Reason |
FETCH: ERROR | Stop and report the unexpected failure |
If a returned status pairing is inconsistent, load ./references/fetch-contract.md and treat the run as an error unless that contract defines a safer action.
Output Contract
The retriever writes at most one local workflow snapshot:
docs/<KEY>.mdTreat the snapshot as a workflow-state handoff for later phases, not implementation history. Leave it in place and unstaged for resumability. Load ./references/fetch-contract.md only when you need exact summary ordering, count semantics, heading order, lifecycle rules, or final report phrasing. The active playbook's Snapshot Sections section defines the platform-specific heading list.
Escalation
Stop and surface the retriever's structured failure when the summary reports BAD_INPUT, NOT_FOUND, AUTH, TOOLS_MISSING, RATE_LIMIT, UNEXPECTED, or Validation: FAIL. Ask the user for input only when the failure is actionable by the user, such as a malformed URL, missing coordinates, or missing authentication.
Examples
<example> Input: JIRA_URL=https://workspace.atlassian.net/browse/PROJ-1234
Detect jira, load ./references/jira-playbook.md, derive PROJ-1234, dispatch work-item-retriever, receive FETCH: PASS and Validation: PASS, then report docs/PROJ-1234.md, the work-item identity, counts, warnings, and that the platform was not modified. If called by the orchestrator, this 12-line summary and file path are the Phase 1 handoff. </example>
<example> Input: ISSUE_URL=https://github.com/acme/app/issues/42
Detect github, load ./references/github-playbook.md, derive ISSUE_SLUG=acme-app-42, dispatch work-item-retriever, receive FETCH: PARTIAL and Validation: PASS, then report docs/acme-app-42.md and the warning. Continue only with the warning visible to downstream phases. </example>
Fetching Work Item
The coordinator is the workflow's Phase 1 fetch-work-item step. It detects the platform from the combined platform input, loads the matching playbook, and derives the work-item identity per that playbook. Its authority is bounded: the coordinator reads this skill package and talks to the user, dispatches a single delegated work-item-retriever, interprets only the retriever's structured 12-line summary, and reports handoff state — raw platform payloads stay out of coordinator context. The trust model treats the active playbook as authoritative for platform-specific transport, capture rules, snapshot sections, summary fields, and rate-limit header names; the fetch contract as authoritative for summary semantics and the locked 12-line shape; and the shared retrieval playbook as authoritative for the pipeline and validation gate. Mutation limits are strict: read-only platform queries only, exactly one unstaged docs/<KEY>.md written, no platform mutations, no later workflow phases, and no local staging or commits.
flowchart TD
START(["Start: JIRA_URL or ISSUE_URL/OWNER+REPO+ISSUE_NUMBER provided"]) --> DETECT["Detect platform and load matching playbook"]
DETECT --> INPUT_CHECK{Valid work-item reference?}
INPUT_CHECK -->|missing or malformed| BAD_INPUT(["FETCH: FAIL - BAD_INPUT - Validation: NOT_RUN"])
INPUT_CHECK -->|yes| DERIVE["Derive work-item identity per active playbook"]
DERIVE --> ARTIFACT_ID["Set work-item identifier and target docs/<KEY>.md"]
ARTIFACT_ID --> DISPATCH["Dispatch work-item-retriever with playbook path, platform inputs, and reference paths"]
subgraph RETRIEVER [Delegated work-item-retriever boundary]
RETRIEVER_ENTRY["work-item-retriever starts"] --> PRECHECK{Read path available per active playbook?}
PRECHECK -->|auth missing| AUTH_STOP(["FETCH: FAIL - AUTH - Validation: NOT_RUN"])
PRECHECK -->|tools missing| TOOLS_STOP(["FETCH: FAIL - TOOLS_MISSING - Validation: NOT_RUN"])
PRECHECK -->|rate limited| RATE_HANDLE["Inspect platform rate-limit metadata"]
PRECHECK -->|unexpected error| ERROR_STOP(["FETCH: ERROR - UNEXPECTED - Validation: NOT_RUN"])
PRECHECK -->|yes| READ["Run read-only platform queries"]
RATE_HANDLE --> RATE_META{Playbook-named retry guidance available?}
RATE_META -->|retry headers present| RATE_WAIT["Honor playbook-named retry timing"]
RATE_META -->|no explicit timing| LOCAL_RETRY{Local retry budget remains?}
RATE_WAIT --> LOCAL_RETRY
LOCAL_RETRY -->|yes| READ
LOCAL_RETRY -->|no| RATE_STOP(["FETCH: FAIL - RATE_LIMIT - Validation: NOT_RUN"])
READ --> FOUND{Work item found and readable?}
FOUND -->|not found| NOT_FOUND(["FETCH: FAIL - NOT_FOUND - Validation: NOT_RUN"])
FOUND -->|rate limited| RATE_HANDLE
FOUND -->|unexpected error| ERROR_STOP
FOUND -->|yes| COLLECT["Collect parent and related items per active playbook capture rules and relationships"]
COLLECT --> NORMALIZE_MD["Rewrite platform-authored ATX headings levels 1-6 outside code fences before assembly"]
NORMALIZE_MD --> ASSEMBLE["Assemble docs/<KEY>.md from active playbook snapshot template"]
ASSEMBLE --> WRITE["Write one unstaged local snapshot"]
WRITE --> VALIDATE["Validate against fetch contract, shared retrieval playbook, and playbook snapshot sections"]
VALIDATE --> VALIDATION{Validation pass?}
VALIDATION -->|no after 3-pass repair loop| VALIDATION_FAIL(["FETCH: ERROR - UNEXPECTED - Validation: FAIL"])
VALIDATION -->|yes| DISCOVERY{Required discovery complete?}
DISCOVERY -->|yes| PASS(["FETCH: PASS - Validation: PASS"])
DISCOVERY -->|partial but valid| PARTIAL(["FETCH: PARTIAL - Validation: PASS"])
end
DISPATCH --> RETRIEVER_ENTRY
BAD_INPUT --> SUMMARY["12-line fetch summary carries FETCH, Validation, Failure category, File written, identifier, status or state, comments, children, linked items, attachments, warnings, and reason"]
AUTH_STOP --> SUMMARY
TOOLS_STOP --> SUMMARY
RATE_STOP --> SUMMARY
ERROR_STOP --> SUMMARY
NOT_FOUND --> SUMMARY
VALIDATION_FAIL --> SUMMARY
PASS --> SUMMARY
PARTIAL --> SUMMARY
SUMMARY --> COORDINATOR["Coordinator interprets structured summary without raw platform payloads"]
COORDINATOR --> RESULT_STATUS{Result status?}
RESULT_STATUS -->|FETCH: PASS with Validation: PASS| REPORT["Report path, identity, counts, warnings, and platform-not-modified confirmation"]
RESULT_STATUS -->|FETCH: PARTIAL with Validation: PASS| DOWNSTREAM{Downstream phase tolerates partial context?}
RESULT_STATUS -->|FETCH: FAIL with Validation: NOT_RUN| FAILURE_REPORT["Report failure category, reason, recovery action, and platform not modified"]
RESULT_STATUS -->|FETCH: ERROR or Validation: FAIL| FAILURE_REPORT
RESULT_STATUS -->|inconsistent status pairing| CONTRACT_CHECK["Consult fetch-contract.md before reporting error"]
CONTRACT_CHECK --> FAILURE_REPORT
DOWNSTREAM -->|yes| REPORT
DOWNSTREAM -->|no| PARTIAL_REPORT["Report partial context warning and stop reason"]
FAILURE_REPORT --> STOP(["Stopped for user recovery"])
PARTIAL_REPORT --> STOP
REPORT --> DONE(["Ready for downstream workflow"])
classDef check fill:#e7f1ff,stroke:#0b5ed7,color:#000;
classDef decision fill:#f8f9fa,stroke:#495057,color:#000;
classDef output fill:#e8f5e9,stroke:#2e7d32,color:#000;
classDef success fill:#e8f5e9,stroke:#2e7d32,color:#000;
classDef stop fill:#fdecea,stroke:#b02a37,color:#000;
class INPUT_CHECK,PRECHECK,RATE_META,LOCAL_RETRY,FOUND,VALIDATION,DISCOVERY,RESULT_STATUS,DOWNSTREAM decision;
class DETECT,DERIVE,ARTIFACT_ID,DISPATCH,RETRIEVER_ENTRY,RATE_HANDLE,RATE_WAIT,READ,COLLECT,NORMALIZE_MD,ASSEMBLE,WRITE,VALIDATE,COORDINATOR,CONTRACT_CHECK check;
class SUMMARY,FAILURE_REPORT,REPORT,PARTIAL_REPORT output;
class PASS,PARTIAL,DONE success;
class BAD_INPUT,AUTH_STOP,TOOLS_STOP,RATE_STOP,ERROR_STOP,NOT_FOUND,VALIDATION_FAIL,STOP stop;Readiness rule: continue only after FETCH: PASS with Validation: PASS, or after FETCH: PARTIAL with Validation: PASS when the next workflow phase explicitly tolerates partial context.
Boundary rule: platform mutations, local staging, and commits are out of scope; route them to a separate approved workflow.
External Sources
Read this file only to choose public URLs for just-in-time retrieval.
Static background and current API details live here as links instead of in
always-loaded prompts. The skill is usable without web access; bundled
routing, contracts, capture rules, and templates cover normal execution.
The active playbook's External-Source Routing section names which groupbelow to use for the detected platform.
Fetch Policy
1. Apply the bundled playbook and shared retrieval playbook first. Fetch a URL only when exact API/CLI syntax, auth behavior, pagination, rate limiting, rich-text or sub-issue/project behavior, or progressive-disclosure rationale could change the next action. 2. Fetch only URLs listed in the Source Routing tables. Treat links inside a fetched page as out of scope unless their destination is also listed. 3. Use at most two fetched pages per retrieval pass. Summarize the relevant detail in one or two sentences before applying it. 4. If fetching fails, proceed from bundled references when safe and record the uncertainty under Warnings if it affects completeness. 5. Keep Phase 1 handoff rules local: external URLs may clarify platform mechanics, but they do not replace fetch-contract.md or the snapshot template.
Shared Concepts and Skill Docs
| Reference key | URL | Use when |
|---|---|---|
agent-skills-overview | https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview | The skill loading model or staged file access needs source-backed context |
agent-skills-best-practices | https://docs.claude.com/en/docs/agents-and-tools/agent-skills/best-practices | Maintaining this package's concise SKILL.md, one-hop references, or examples |
context-engineering | https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents | Context-window and just-in-time retrieval rationale is needed |
progressive-disclosure-skill | https://skills.sh/flpbalada/fb-skills/progressive-disclosure | Maintaining or explaining staged loading in this skill |
progressive-disclosure-ux | https://www.nngroup.com/articles/progressive-disclosure/ | A short public explanation of revealing only needed information would help |
Jira Source Routing
| Reference key | URL | Use when |
|---|---|---|
jira-rest-intro | https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/ | Authentication, status codes, pagination, expansions, or timestamp behavior is unclear |
jira-get-issue | https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-get | Parent or related issue field retrieval syntax is unclear |
jira-bulk-fetch | https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-bulkfetch-post | Multiple related issues should be fetched efficiently by key or ID |
jira-comments | https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-comments/ | Comment pagination or comment payload shape is unclear |
jira-issue-search | https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-search/ | JQL search is needed to verify relationships or hydrate related issues |
jira-issue-links | https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-links/ | Linked issue payloads or link-type semantics are unclear |
jira-attachments | https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-attachments/ | Attachment metadata fields or binary-download boundaries are unclear |
jira-fields | https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-fields/ | Custom field names or field metadata are unclear |
jira-adf | https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/ | Jira rich-text description or textarea field content needs normalization |
jira-rate-limits | https://developer.atlassian.com/cloud/jira/platform/rate-limiting/ | Retry or rate-limit classification is unclear |
GitHub Source Routing
| Reference key | URL | Use when |
|---|---|---|
gh-issue-view | https://cli.github.com/manual/gh_issue_view | Parent issue command flags or JSON fields are unclear |
gh-api | https://cli.github.com/manual/gh_api | REST, GraphQL, pagination, headers, host, or jq behavior through gh api is unclear |
gh-auth-status | https://cli.github.com/manual/gh_auth_status | Non-interactive authentication checks are unclear |
github-rest-issues | https://docs.github.com/en/rest/issues/issues#get-an-issue | REST issue fields, status codes, or media types are unclear |
github-rest-comments | https://docs.github.com/en/rest/issues/comments#list-issue-comments | Issue comment pagination or payload shape is unclear |
github-rest-timeline | https://docs.github.com/en/rest/issues/timeline#list-timeline-events-for-an-issue | Linked issue discovery through timeline events is unclear |
github-rest-sub-issues | https://docs.github.com/en/rest/issues/sub-issues#list-sub-issues | Child issue discovery or sub-issue endpoint support is unclear |
github-rest-pagination | https://docs.github.com/en/rest/using-the-rest-api/using-pagination-in-the-rest-api | REST pagination behavior is unclear |
github-rest-rate-limits | https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api | Retry or rate-limit classification is unclear |
github-graphql | https://docs.github.com/en/graphql | Project membership or fields require GraphQL syntax |
github-projects | https://docs.github.com/en/issues/planning-and-tracking-with-projects | Project membership concepts or limitations are unclear |
When Network Is Unavailable
Continue with bundled references. Do not claim version-specific platform API or CLI facts that were not verified. Use FETCH: PARTIAL when unavailable source material prevents verifying related-item discovery after the parent work item was retrieved.
Fetch Contract
Load this file when interpreting the retriever summary, formatting the
coordinator report, or checking the artifact contract. Keep raw platform
payloads inside the retriever. Platform-specific summary fields, the
snapshot section list, and the attachment-count definition come from the
active playbook.
Contents
- Orchestration handoff role
- Summary semantics
- Count rules
- Locked summary line order
- Artifact contract
- Coordinator report phrasing
<KEY> below is the work-item identifier the active playbook derives (TICKET_KEY for Jira, ISSUE_SLUG for GitHub).
For shared orchestration handoffs, pass the derived <KEY> value under the parameter name TICKET_KEY. In GitHub workflows, the value shape remains the GitHub ISSUE_SLUG; only the downstream alias changes.
Orchestration Handoff Role
This contract defines the complete Phase 1 handoff. The coordinator and any top-level orchestrator retain the locked 12-line summary, the written file path, warnings, and fatal reason. Raw platform payloads and full artifact contents stay inside work-item-retriever.
docs/<KEY>.md is a workflow-state snapshot for downstream phases. Leave it on disk and unstaged; do not treat it as implementation history.
Summary Semantics
| Field | Meaning |
|---|---|
FETCH: PASS | Retrieval and validation succeeded with no known gaps |
FETCH: PARTIAL | A valid artifact was written, but comments, related items, or discovery are incomplete (the active playbook enumerates the platform's partial-eligible sections) |
FETCH: FAIL | Deterministic blocker: bad input, not found, auth, missing tools, or rate limit |
FETCH: ERROR | Unexpected tool, schema, environment, or validation failure |
Validation: PASS | Written artifact satisfies the template contract |
Validation: FAIL | Artifact violates the contract after repair attempts |
Validation: NOT_RUN | Retrieval stopped before assembly or validation |
Failure categories: NONE, BAD_INPUT, NOT_FOUND, AUTH, TOOLS_MISSING, RATE_LIMIT, UNEXPECTED.
Count Rules
0/0— verified empty section.<retrieved>/UNKNOWN— parent work item retrieved, but discovery for that
section could not be verified; classify the run as FETCH: PARTIAL.
N/A— parent work item was not retrieved, so downstream reads did not run.Attachments: <N>counts per the active playbook'sSummary Fields
definition; binaries are not downloaded.
Locked Summary Line Order
Lines 5, 6, and 8 are platform-specific; the active playbook's Summary Fields section supplies them.
FETCH: <PASS | PARTIAL | FAIL | ERROR>
Validation: <PASS | FAIL | NOT_RUN>
Failure category: <NONE | BAD_INPUT | NOT_FOUND | AUTH | TOOLS_MISSING | RATE_LIMIT | UNEXPECTED>
File written: <docs/<KEY>.md | None>
<playbook identifier line: e.g. "Ticket: <KEY>: <Summary>" / "Issue: <owner>/<repo>#<N>: <Title>">
<playbook status/state line: e.g. "Status: <s> | Type: <t>" / "State: <OPEN|CLOSED|Unknown>">
Comments: <retrieved>/<found | N/A>
<playbook children line: e.g. "Subtasks: ..." / "Child issues: ...">
Linked issues: <retrieved>/<found | UNKNOWN | N/A>
Attachments: <N | N/A>
Warnings: <None | semicolon-separated warnings>
Reason: <None | fatal reason><example> FETCH: PASS Validation: PASS Failure category: NONE File written: docs/PROJ-1234.md Ticket: PROJ-1234: Implement dark mode toggle Status: In Progress | Type: Story Comments: 4/4 Subtasks: 3/3 Linked issues: 1/1 Attachments: 2 Warnings: None Reason: None </example>
<example> FETCH: FAIL Validation: NOT_RUN Failure category: NOT_FOUND File written: None Issue: acme/app#892: Unknown State: Unknown Comments: N/A Child issues: N/A Linked issues: N/A Attachments: N/A Warnings: None Reason: GitHub issue acme/app#892 was not found (404) </example>
Artifact Contract
Primary artifact: docs/<KEY>.md. It is the Phase 1 workflow-state snapshot consumed by later orchestration phases. The active playbook's Snapshot Sections section defines the required top-level heading order (stable when empty), and its named snapshot-template file defines the full fenced shape, conditional rules, and placeholders.
Shared rules across platforms:
- The preamble includes
Retrieved on, aSourceline, and the platform
identity line from the snapshot template.
- Repeated nested headings appear only when the section has material or a
required Not retrieved placeholder.
- Use
_None_for verified empty sections; use the template's_Unknown..._
markers when related-item or discovery results are unverified after the parent work item was retrieved.
Coordinator Report Phrasing
For PASS or PARTIAL, report the file path, work-item identity, status/state, comment count, related-item counts, attachment count, warnings, and that the platform was not modified. When invoked by the top-level workflow, this report is the Phase 1 decision input before artifact validation. For FAIL, ERROR, or Validation: FAIL, report the failure category and reason without inspecting raw payloads.
<example> Work item fetched to docs/PROJ-1234.md. PROJ-1234: Implement dark mode toggle is In Progress (Story). Retrieved 4/4 comments, 3/3 subtasks, 1/1 linked issues, and 2 attachments. Retrieval only; the platform was not modified. </example>
<example> Work item fetched to docs/acme-app-7001.md with retrieval warnings. acme/app#7001: Audit webhook retries is OPEN. Retrieved 2/2 comments, 0/UNKNOWN child issues, 1/1 linked issues, and 0 attachments. Warning: Child issue discovery unavailable: sub_issues endpoint unsupported on this host. Retrieval only; the platform was not modified. </example>
GitHub Fetch Playbook
Read this file only after detecting the GitHub platform. It is the
per-platform fetch contract. Shared fetch policy lives in
./fetch-contract.mdand./retrieval-playbook.md.
Inputs and Identifier
| Input | Required | Example |
|---|---|---|
ISSUE_URL | Preferred | https://github.com/acme/app/issues/42 |
OWNER / REPO / ISSUE_NUMBER | When URL absent | acme / app / 42 |
Derive owner/repo/number from ISSUE_URL when present; lowercase owner and repo. `ISSUE_SLUG = <owner>-<repo>-<number>` is the <KEY> that names docs/<KEY>.md. If coordinates are missing or the URL is not an issue path, return FETCH: FAIL with Failure category: BAD_INPUT.
Transport / Read Path
GitHub reads use gh by default (gh api for paginated REST/GraphQL). Use --repo owner/repo when not passing a full URL; preserve a non-github.com host for gh api/GraphQL.
| Operation | Required capability |
|---|---|
| Parent issue | gh issue view by URL or number with explicit repo scope |
| Comments | Inline comments JSON or paginated issue-comments REST |
| Child issues | REST sub-issues endpoint or documented GraphQL equivalent |
| Linked issues | Timeline events, cross-references, or documented relationship source |
| Projects | gh issue view project fields or a small GraphQL query |
Return AUTH for missing/inadequate auth; TOOLS_MISSING when no read path covers parent issue retrieval.
Capture Rules
Capture non-empty values among: title, body, state, author, URL, number; created, updated, closed; labels (name + description); assignees (login + name); milestone (title + due) when set; project membership when verifiable; parent comments chronologically; explicit upload/binary asset URLs in bodies. Preserve useful Markdown (lists, tables, code fences, links).
Relationships
Capture per child/linked issue: title, state, URL, description, comments; relation type for linked issues. Deduplicate linked issues by owner/repo#number. Order child issues by number, linked issues by relation then owner/repo#number, labels by name, assignees by login.
Snapshot Sections
docs/<ISSUE_SLUG>.md heading order (stable when empty): ## Metadata, ## Description, ## Acceptance Criteria, ## Comments, ## Retrieval Warnings, ## Child Issues, ## Linked Issues, ## Labels, ## Assignees, ## Milestone, ## Projects, ## Attachments. Full template: ./github-snapshot-template.md (read at assembly).
Summary Fields
Lines 5, 6, and 8 of the shared 12-line summary:
Issue: <owner>/<repo>#<N>: <Title | Unknown>
State: <OPEN | CLOSED | Unknown>
Child issues: <retrieved>/<found | UNKNOWN | N/A>Attachments: counts explicit upload/binary asset references in issue or comment bodies; binaries are not downloaded. Unverified project membership is a FETCH: PARTIAL trigger.
Rate-Limit Specifics
Honor retry-after or x-ratelimit-reset; preserve the rate-limit message. For a secondary limit with no explicit timing, wait at least 60s. Then apply the shared retry budget.
External-Source Routing
Use the GitHub group in ./external-sources.md (gh-issue-view, gh-api, github-rest-issues, github-rest-comments, github-rest-timeline, github-rest-sub-issues, github-graphql, github-rest-rate-limits, etc.).
Example Invocation
ISSUE_URL: https://github.com/acme/app/issues/42GitHub Snapshot Template
Read this file only during document assembly, and only when the active
platform is GitHub. Copy the fenced Markdown shape below into
docs/<ISSUE_SLUG>.md. Prose outside the fence is retriever instruction,not output content.
Contents
- Snapshot shape
- Conditional rules
- Missing child issue placeholder
- Missing linked issue placeholder
Every top-level heading in the fenced block is required. Repeated nested headings are shapes for items that exist or required Not retrieved placeholders. Write _None_ for verified empty sections. Use the _Unknown..._ markers from Conditional Rules when child-issue, linked-issue, or project discovery is unverified after the parent issue was retrieved. The rendered file is a Phase 1 workflow-state handoff for downstream orchestration phases and should remain unstaged.
# <ISSUE_SLUG>: <Issue title>
> Retrieved on: <YYYY-MM-DD HH:MM UTC>
> Source: <ISSUE_URL or owner/repo#N>
> Repository: <owner>/<repo> | Issue: #<N>
## Metadata
| Field | Value |
| ----- | ----- |
| ISSUE_SLUG | ... |
| Repository | ... |
| Issue number | ... |
| State | ... |
| Author | ... |
| Created | ... |
| Updated | ... |
| Closed | ... |
| URL | ... |
## Description
<full issue body after acceptance-criteria extraction, or _None_>
## Acceptance Criteria
<acceptance criteria, or _None_>
## Comments
### Comment 1 - <Author> (<YYYY-MM-DD HH:MM UTC>)
<body>
### Comment 2 - ...
## Retrieval Warnings
- <warning text>
## Child Issues
### <owner>/<repo>#<N>: <Title>
- **State:** ...
- **URL:** ...
#### Description
<body or _None_>
#### Comments
##### Comment 1 - <Author> (<YYYY-MM-DD HH:MM UTC>)
<body>
## Linked Issues
### <RELATION_OR_CONTEXT>: <owner>/<repo>#<N> - <Title>
- **State:** ...
- **URL:** ...
#### Description
<body or _None_>
#### Comments
##### Comment 1 - <Author> (<YYYY-MM-DD HH:MM UTC>)
<body>
## Labels
| Name | Description |
| ---- | ----------- |
| ... | ... |
## Assignees
| Login | Name or _None_ |
| ----- | -------------- |
| ... | ... |
## Milestone
<title and due date if any, or _None_>
## Projects
<table, bullet list of project membership, _Unknown. Project membership not determined: <reason>_, or _None_ when absence was verified>
## Attachments
_None_ or a short bullet list of explicitly linked upload or binary asset URLs found in issue or comment bodies.Conditional Rules
## Commentswith no parent comments:_None_.## Retrieval Warningswith no warnings:_None_.## Child Issueswith no verified child issues:_None_.## Child Issueswith unverified discovery:
_Unknown. Child issue discovery unavailable: <reason>_ plus a matching warning under ## Retrieval Warnings.
## Linked Issueswith no verified links:_None_.## Linked Issueswith unverified discovery:
_Unknown. Linked issue discovery unavailable: <reason>_ plus a matching warning under ## Retrieval Warnings.
## Projectswhen membership cannot be determined:
_Unknown. Project membership not determined: <reason>_ plus a matching warning under ## Retrieval Warnings.
- A retrieved child or linked issue with no description:
_None_ under its #### Description.
- A retrieved child or linked issue with no comments:
_None_ under its #### Comments.
## Labelsand## Assignees: render the table only when at least one
row exists; otherwise write _None_.
Missing Child Issue Placeholder
### <owner>/<repo>#<N>: Not retrieved
- **State:** Unknown
- **URL:** _None_
- **Retrieval Status:** Not retrieved
- **Reason:** <reason>
#### Description
_None_
#### Comments
_None_Missing Linked Issue Placeholder
### <RELATION_OR_CONTEXT>: <owner>/<repo>#<N> - Not retrieved
- **State:** Unknown
- **URL:** _None_
- **Retrieval Status:** Not retrieved
- **Reason:** <reason>
#### Description
_None_
#### Comments
_None_Jira Fetch Playbook
Read this file only after detecting the Jira platform. It is the
per-platform fetch contract. Shared fetch policy lives in
./fetch-contract.mdand./retrieval-playbook.md.
Inputs and Identifier
| Input | Required | Example |
|---|---|---|
JIRA_URL | Yes | https://workspace.atlassian.net/browse/PROJ-1234 |
Workspace = subdomain before .atlassian.net. Project = prefix before the dash. `TICKET_KEY` = the final URL path segment and the <KEY> that names docs/<KEY>.md. If the URL is malformed or the key is not a Jira PROJECT-1234 shape, return FETCH: FAIL with Failure category: BAD_INPUT.
Transport / Read Path
Jira reads use read-only Jira tools (Jira MCP or equivalent). Prefer the most specific read-only tool per operation, then keep the mapping stable.
| Operation | Required capability |
|---|---|
| Parent issue | Read one Jira issue by key with fields and relationships |
| Comments | Read parent and related-item comments with pagination |
| Related issues | Retrieve subtasks and linked issues by key, parent fields, or verified search |
| Metadata | Resolve field names, attachment metadata, and custom fields without downloading binaries |
Return AUTH on denied access; TOOLS_MISSING when no Jira-capable read path covers the required operations.
Capture Rules
Capture non-empty values among: key, summary; status, resolution, type, priority; assignee, reporter; labels, components, sprint, epic, fix/affects versions; created, updated, due; full description (formatting preserved); acceptance criteria; parent comments chronologically; attachment metadata; non-empty custom fields sorted by name. Serialize arrays as alphabetical comma-separated strings; structured custom-field values as compact JSON with sorted keys.
For acceptance criteria, use a dedicated Jira acceptance-criteria field first when Jira field metadata exposes one and it is non-empty. If no dedicated field is available, apply the shared precedence in ./retrieval-playbook.md against the description. Do not duplicate a dedicated acceptance-criteria field under ## Custom Fields after using it for ## Acceptance Criteria.
Relationships
Capture per subtask/linked issue: key, summary, status, assignee, type, full description, comments, and link type for linked issues (blocks, is blocked by, relates). Order subtasks by key, linked issues by link type then key, attachments by filename, custom fields by field name.
Snapshot Sections
docs/<TICKET_KEY>.md heading order (stable when empty): ## Metadata, ## Description, ## Acceptance Criteria, ## Comments, ## Retrieval Warnings, ## Subtasks, ## Linked Issues, ## Attachments, ## Custom Fields. Full template: ./jira-snapshot-template.md (read at assembly).
Summary Fields
Lines 5, 6, and 8 of the shared 12-line summary:
Ticket: <TICKET_KEY>: <Summary/Title | Unknown>
Status: <status | Unknown> | Type: <type | Unknown>
Subtasks: <retrieved>/<found | UNKNOWN | N/A>Attachments: counts metadata rows only; binaries are not downloaded.
Rate-Limit Specifics
Honor Retry-After or X-RateLimit-Reset; preserve RateLimit-Reason in warnings or the fatal reason. Then apply the shared retry budget.
External-Source Routing
Use the Jira group in ./external-sources.md (jira-rest-intro, jira-get-issue, jira-comments, jira-issue-links, jira-fields, jira-adf, jira-rate-limits, etc.).
Example Invocation
JIRA_URL: https://workspace.atlassian.net/browse/PROJ-1234Jira Snapshot Template
Read this file only during document assembly, and only when the active
platform is Jira. Copy the fenced Markdown shape below into
docs/<TICKET_KEY>.md. Prose outside the fence is retriever instruction,not output content.
Contents
- Snapshot shape
- Conditional rules
- Missing subtask placeholder
- Missing linked issue placeholder
Every top-level heading in the fenced block is required. Repeated nested headings are shapes for items that exist or required Not retrieved placeholders. Write _None_ for verified empty sections. Use the _Unknown..._ markers from Conditional Rules when subtask or linked-issue discovery is unverified after the parent ticket was retrieved. The rendered file is a Phase 1 workflow-state handoff for downstream orchestration phases and should remain unstaged.
# <TICKET_KEY>: <Summary>
> Retrieved on: <YYYY-MM-DD HH:MM UTC>
> Source: <JIRA_URL>
> Workspace: <workspace> | Project: <project> | Ticket: <TICKET_KEY>
## Metadata
| Field | Value |
| --------------- | ----- |
| Ticket Key | ... |
| Workspace | ... |
| Project | ... |
| Status | ... |
| Resolution | ... |
| Type | ... |
| Priority | ... |
| Assignee | ... |
| Reporter | ... |
| Labels | ... |
| Components | ... |
| Sprint | ... |
| Epic | ... |
| Fix Version | ... |
| Affects Version | ... |
| Created | ... |
| Updated | ... |
| Due Date | ... |
| URL | ... |
## Description
<full description body after acceptance-criteria extraction, or _None_>
## Acceptance Criteria
<acceptance criteria, or _None_>
## Comments
### Comment 1 - <Author> (<YYYY-MM-DD HH:MM UTC>)
<body>
### Comment 2 - ...
## Retrieval Warnings
- <warning text>
## Subtasks
### <SUBTASK_KEY>: <Summary>
- **Status:** ...
- **Assignee:** ...
- **Type:** ...
#### Description
<body or _None_>
#### Comments
##### Comment 1 - <Author> (<YYYY-MM-DD HH:MM UTC>)
<body>
## Linked Issues
### <LINK_TYPE>: <ISSUE_KEY> - <Summary>
- **Status:** ...
- **Assignee:** ...
- **Type:** ...
#### Description
<body or _None_>
#### Comments
##### Comment 1 - <Author> (<YYYY-MM-DD HH:MM UTC>)
<body>
## Attachments
| Filename | Type | Size |
| -------- | ---- | ---- |
| ... | ... | ... |
## Custom Fields
| Field Name | Value |
| ---------- | ----- |
| ... | ... |Conditional Rules
## Commentswith no parent comments:_None_.## Retrieval Warningswith no warnings:_None_.## Subtaskswith no verified subtasks:_None_.## Subtaskswith unverified discovery:
_Unknown. Subtask discovery unavailable: <reason>_ plus a matching warning under ## Retrieval Warnings.
## Linked Issueswith no verified links:_None_.## Linked Issueswith unverified discovery:
_Unknown. Linked issue discovery unavailable: <reason>_ plus a matching warning under ## Retrieval Warnings.
- A retrieved subtask or linked issue with no description:
_None_ under its #### Description.
- A retrieved subtask or linked issue with no comments:
_None_ under its #### Comments.
## Attachmentsand## Custom Fields: render the table only when at
least one row exists; otherwise write _None_.
Missing Subtask Placeholder
### <SUBTASK_KEY>: Not retrieved
- **Status:** Unknown
- **Assignee:** Unknown
- **Type:** Unknown
- **Retrieval Status:** Not retrieved
- **Reason:** <reason>
#### Description
_None_
#### Comments
_None_Missing Linked Issue Placeholder
### <LINK_TYPE>: <ISSUE_KEY> - Not retrieved
- **Status:** Unknown
- **Assignee:** Unknown
- **Type:** Unknown
- **Retrieval Status:** Not retrieved
- **Reason:** <reason>
#### Description
_None_
#### Comments
_None_Retrieval Playbook (Shared)
Load this file inside work-item-retriever before platform reads. It holdsthe shared retrieval pipeline, acceptance-criteria precedence, partial-result
behavior, assembly rules, the validation gate, and the shared retry budget.
Platform-specific read-path operations, capture rules, relationship
vocabulary, snapshot sections, summary fields, and rate-limit header names
come from the active playbook (<platform>-playbook.md). The orchestratordoes not load this file.
Contents
- Stage pipeline
- Acceptance criteria precedence
- Partial comment retrieval
- Assembly
- Validation gate
- Shared retry budget
<KEY> below is the work-item identifier the active playbook derives.
Stage Pipeline
Use this six-stage pipeline for every retrieval run. The stages are platform-neutral; the active playbook supplies the read-path operations, capture rules, and relationship vocabulary each stage uses.
| Stage | Name | Exit condition |
|---|---|---|
| 1 | Validate the input and establish identifiers | The active playbook's identifier (<KEY>) and any required coordinates are known, or BAD_INPUT is returned |
| 2 | Establish the tracker read path | A supported read-only path covers the playbook's read-path operations, or AUTH/TOOLS_MISSING/RATE_LIMIT is returned |
| 3 | Retrieve the parent work item | Parent fields, description, comments, and the playbook's parent-capture set are retrieved or the run stops with a deterministic failure |
| 4 | Retrieve related items | The playbook's related-item totals are verified, hydrated, marked unknown, or recorded as partial |
| 5 | Assemble the document | docs/<KEY>.md is written from the playbook's snapshot template |
| 6 | Post-write validation gate: validate, repair, and re-check | Artifact satisfies the contract or validation fails after the repair limit |
Apply the active playbook's Transport / Read Path, Capture Rules, and Relationships sections inside stages 2–4. Determine related-item totals before claiming full success: use 0/0 only when absence is verified; when discovery cannot be verified after the parent was retrieved, render the template's unknown marker, add the same warning under ## Retrieval Warnings, report <retrieved>/UNKNOWN, and return FETCH: PARTIAL.
Heading rewrite (shared). Outside fenced code blocks, rewrite platform-authored ATX Markdown headings (#–######) as bold labels so body content cannot collide with reserved snapshot headings. Example: ## Steps becomes **Steps**.
Acceptance Criteria Precedence
Use the platform's dedicated acceptance-criteria field first when one exists and is non-empty (see the active playbook's Capture Rules). Otherwise scan the description/body in this label order:
1. Acceptance Criteria 2. AC 3. Definition of Done or Definition of Done (DoD)
Use only sections matching the highest-precedence label found. If multiple sections share that label, keep them in source order, prefix each block with **Source:** <label>, and remove the winning blocks from ## Description. If no criteria exist, write _None_ under ## Acceptance Criteria and keep the full description/body under ## Description.
Partial Comment Retrieval
When parent or related-item comments are partial, keep retrieved comments, append _Partial comment retrieval: <retrieved>/<found>. Reason: <reason>_ to that comment section, record the same warning under ## Retrieval Warnings, and return FETCH: PARTIAL.
Assembly
Read the active playbook's snapshot-template file only at assembly time. Before filling the template, normalize all retrieved Markdown body content with the shared heading-rewrite rule. Copy the fenced shape into docs/<KEY>.md and fill it from retrieved data. Top-level headings are always required. For empty scalar metadata values, write _None_. Normalize timestamps with times to YYYY-MM-DD HH:MM UTC; keep date-only values as YYYY-MM-DD. Leave the artifact in place and unstaged as the Phase 1 workflow-state handoff.
Validation Gate
After writing, re-read the artifact and verify:
- Every required top-level heading from the playbook's
Snapshot Sections
exists in template order.
- The title and preamble match the snapshot template (identity line,
Retrieved on, Source).
- The metadata table has the required rows in template order.
## Descriptionand## Acceptance Criteriafollow the precedence rules.- Parent comment count matches retrieved parent comments.
- Related-item sections match discovered identities, placeholders, or
unknown markers; each unretrieved related item has both a warning and a placeholder.
- Active snapshot-template rendering rules are satisfied, including unknown
markers, required warnings, empty-state text, and table shape for platform-specific sections such as GitHub projects, labels, and assignees or Jira attachments and custom fields.
- Heading-like body lines outside code fences were rewritten as bold labels.
- Repeated sections follow the playbook's deterministic ordering.
If validation fails, fix only the missing or mismatched portions, rewrite, and re-check. Max 3 repair passes. After the limit, return FETCH: ERROR, Validation: FAIL, and Failure category: UNEXPECTED.
Shared Retry Budget
Honor the platform's rate-limit timing first (the active playbook's Rate-Limit Specifics names the header fields and any secondary-limit wait). Then apply this shared budget: at most 2 retries with 1s then 3s backoff and jitter. Classify exhausted limits as FETCH: FAIL with Failure category: RATE_LIMIT.
Work Item Retriever
You are a work-item retrieval specialist. Collect the context the workflow needs, write one stable Markdown snapshot, validate it, and return a compact status summary that keeps raw platform payloads out of the caller's context. You are the only Phase 1 component that may inspect raw platform payloads or write the snapshot artifact.
The retrieval procedure is platform-neutral. The active playbook (PLAYBOOK_PATH) supplies every platform-specific detail: primary inputs, identifier derivation, transport and read-path operations, capture rules, relationship vocabulary, snapshot sections and snapshot-template path, summary fields, and rate-limit header names. Do not assume a specific platform, transport, or vocabulary beyond what the playbook states.
Return only the structured summary. Load detailed references just in time:
the active playbook and shared retrieval playbook before reads, external
sources only for exact syntax checks, the snapshot template only at
assembly, and the fetch contract only when validating the final summary
shape.
Inputs
| Input | Required | Default |
|---|---|---|
PLAYBOOK_PATH | Yes | — |
Platform inputs named in the active playbook's Inputs and Identifier section | Yes | — |
FETCH_CONTRACT_PATH | No | ../references/fetch-contract.md |
RETRIEVAL_PLAYBOOK_PATH | No | ../references/retrieval-playbook.md |
EXTERNAL_SOURCES_PATH | No | ../references/external-sources.md |
Bundled paths above are relative to this subagent file.
Read PLAYBOOK_PATH first. Derive the work-item identifier <KEY> per its Inputs and Identifier section. If the primary input is malformed or the identifier cannot be formed, return FETCH: FAIL with Failure category: BAD_INPUT.
Instructions
1. Read PLAYBOOK_PATH and establish <KEY> and any required coordinates. 2. Read RETRIEVAL_PLAYBOOK_PATH. It is the source of truth for the six-stage pipeline, acceptance-criteria precedence, partial-result behavior, assembly, the validation gate, and the shared retry budget. 3. Read EXTERNAL_SOURCES_PATH only when exact platform syntax, auth, pagination, rate limiting, or normalization could change the current action; use the active playbook's External-Source Routing section to pick the smallest relevant public page. 4. Map the available environment to the operations in the playbook's Transport / Read Path table. Prefer the most specific read-only tool for each operation and keep the mapping stable for the run. 5. Retrieve the parent work item and the related items the playbook's Capture Rules and Relationships sections name. Continue after retrievable related-item failures and make each gap explicit as partial retrieval. 6. At assembly, read the snapshot-template file named in the playbook's Snapshot Sections section and write docs/<KEY>.md using the fenced shape as the literal artifact contract. 7. Run the post-write validation gate from the shared retrieval playbook. Repair only missing or mismatched portions and re-check; max 3 repair passes. 8. Read FETCH_CONTRACT_PATH only for exact summary ordering and count semantics, combine it with the playbook's Summary Fields for lines 5, 6, and 8, then return the locked 12-line summary with no prose.
Apply the playbook's Rate-Limit Specifics for explicit platform retry timing, then the shared retry budget. Classify exhausted limits as FETCH: FAIL with Failure category: RATE_LIMIT.
Output Format
Return no prose. Emit the 12-line summary from the fetch contract's Locked Summary Line Order, filling lines 5, 6, and 8 from the active playbook's Summary Fields. Use the contract's count rules to resolve PASS, PARTIAL, FAIL, and ERROR states.
Scope
Read platform data through read-only platform tools, preserve useful tracker content, write one snapshot, validate it, surface missing or unverified data, and return the summary above. Comments, transitions, edits, downstream phase invocation, and any other mutation are out of scope.
Escalation
| Status | When |
|---|---|
FETCH: FAIL | Deterministic blocker: malformed input, missing parent work item, auth/permission failure, missing read capability, or rate-limit exhaustion |
FETCH: PARTIAL | Main artifact is valid but comments, related items, or discovery are incomplete |
FETCH: ERROR (Failure category: UNEXPECTED) | Crashes, schema/tool mismatches, environment failures, or validation failure after the repair loop |