git:20260421.f8fcc07 to git:20260510.4797c84

19 added, 20 removed. Audit A to A.

---
name: ticket-context
- description: Fetch structured context from Jira issues, Confluence pages, and GitHub issues/PRs. Auto-loads when a prompt or argument references a ticket key (e.g. PROJ-123), an atlassian.net URL, a Confluence wiki URL, or a GitHub issue/PR URL or `#NNN`. Produces title, description, acceptance criteria, links, and recent comments so downstream work (design, refactor, review, debug) has the full spec.
+ description: Fetch ticket context from Jira (PROJ-123), Confluence, or GitHub (`#NNN`). Auto-loads on ticket references. Returns title, summary, acceptance criteria, links, and recent activity.
---
- You resolve ticket references into structured context that downstream work can consume. You do not interpret, critique, or act on the ticket — you fetch and format.
-
## When to invoke
- The caller (command body, subagent, or user) references one or more of:
+ Auto-loads when the caller references:
- - **Jira key**: `[A-Z][A-Z0-9]+-\d+` — e.g. `PROJ-123`, `ENG-4567`.
+ - **Jira key**: `[A-Z][A-Z0-9]+-\d+` — e.g. `PROJ-123`.
- **Atlassian Jira URL**: `*.atlassian.net/browse/<KEY>`.
- **Confluence URL**: `*.atlassian.net/wiki/spaces/...` or `*.atlassian.net/wiki/pages/...`.
- **GitHub issue/PR URL**: `github.com/<owner>/<repo>/(issues|pull)/\d+`.
- - **GitHub short ref**: `#\d+` with clear current-repo context.
+ - **GitHub short ref**: `#\d+` with current-repo context.
- If no reference is present, exit cleanly — the caller proceeds without ticket context.
+ If no reference is present, exit cleanly.
## Fetch recipes
### Jira issue
- Before the first Jira fetch in a session, call `mcp__atlassian__getAccessibleAtlassianResources` to resolve the `cloudId`; cache it for subsequent calls. Then `mcp__atlassian__getJiraIssue` with the key. Extract: summary, issuetype, status, priority, description, labels, components, acceptance-criteria (custom field name varies by org — check the description body if a dedicated field is absent), linked issues via `mcp__atlassian__getJiraIssueRemoteIssueLinks`, and the most recent 5 comments.
+ First fetch in session: call `mcp__atlassian__getAccessibleAtlassianResources` for `cloudId` (cache for session). Then `mcp__atlassian__getJiraIssue` with the key. Extract: summary, issuetype, status, priority, description, labels, components, acceptance-criteria (check description body if no dedicated field), linked issues via `mcp__atlassian__getJiraIssueRemoteIssueLinks`, last 5 comments.
### Confluence page
- Parse the numeric page ID from the URL path (`/pages/<ID>/` or `/pages/<ID>`). Use `mcp__atlassian__getConfluencePage` with the ID. If the URL shape doesn't yield a clear ID, fall back to `mcp__atlassian__fetch` with the raw URL. Extract: title, version, body (rendered text, not storage XML), recent footer comments via `mcp__atlassian__getConfluencePageFooterComments` if any.
+ Extract page ID from `/pages/<ID>` in the URL. Use `mcp__atlassian__getConfluencePage`; fall back to `mcp__atlassian__fetch` with raw URL if ID unclear. Extract: title, version, body (rendered text), footer comments via `mcp__atlassian__getConfluencePageFooterComments` if any.
### GitHub issue or PR
Use Bash:
- Issue: `gh issue view <number> --repo <owner>/<repo> --json title,body,state,labels,assignees,comments,url`
- PR: `gh pr view <number> --repo <owner>/<repo> --json title,body,state,labels,files,comments,url`
For `#NNN` short refs in the current repo, omit `--repo`.
## Output format
- One structured block per reference, prepended to the caller's context:
+ One block per reference, prepended to caller context:
```
## Ticket context: <KEY or #NUM or short URL>
**Title:** ...
**Type / Status:** ...
- **Summary:** ... (1–3 sentences from description)
+ **Summary:** ... (1–3 sentences)
**Acceptance criteria / Definition of done:** ... (bulleted if present, otherwise "not specified")
- **Linked references:** ... (issue keys, PR numbers, Confluence page titles)
- **Recent activity:** ... (last 2–3 comments, compressed)
+ **Linked references:** ...
+ **Recent activity:** ...
**Source:** <URL>
```
## Degradation
- - Atlassian MCP unavailable → attempt `mcp__atlassian__fetch` with the raw URL; if still failing, emit `ticket-context: Atlassian MCP unavailable; proceeding without context.` and return control to the caller.
- - `gh` CLI missing → emit `ticket-context: gh CLI unavailable; proceeding without context.` and return.
- - Auth error → surface the raw error message. Never fabricate content.
- - Reference pattern matches but fetch returns empty/404 → say so; do not guess at content.
+ | Condition | Action |
+ |---|---|
+ | Atlassian MCP unavailable | Try `mcp__atlassian__fetch` with raw URL; if still failing, emit `ticket-context: Atlassian MCP unavailable; proceeding without context.` |
+ | `gh` CLI missing | Emit `ticket-context: gh CLI unavailable; proceeding without context.` |
+ | Auth error | Surface the raw error; never fabricate. |
+ | Fetch returns empty or 404 | Say so; do not guess. |
## Absolute rules
- - Never invent ticket content. If a fetch fails, say so and return.
- Strip secrets and PII (API tokens, email addresses in comments) before returning.
- - Cap output at ~400 words per reference. Summarize longer descriptions; do not truncate mid-sentence.
- - Do not editorialize. Output the ticket; the downstream subagent interprets it.
+ - Cap at ~400 words per reference; summarize long descriptions without truncating mid-sentence.
+ - Do not editorialize. Output the ticket; downstream agents interpret it.