@groupby/ai-dev 0.5.15 → 0.5.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/package.json +1 -1
  2. package/teams/fhr-orchestration/skills/create-jira/SKILL.md +47 -0
  3. package/teams/fhr-orchestration/skills/create-jira/TEMPLATE.md +10 -0
  4. package/teams/fhr-orchestration/skills/create-plan/SKILL.md +48 -0
  5. package/teams/fhr-orchestration/skills/create-plan/TEMPLATE.md +13 -0
  6. package/teams/fhr-orchestration/skills/init-harness/SKILL.md +164 -0
  7. package/teams/fhr-orchestration/skills/init-harness/assets/TEMPLATE.CLAUDE.md +88 -0
  8. package/teams/fhr-orchestration/skills/init-harness/assets/TEMPLATE.architecture.md +152 -0
  9. package/teams/fhr-orchestration/skills/init-harness/assets/TEMPLATE.coding-guidelines.md +320 -0
  10. package/teams/fhr-orchestration/skills/init-harness/assets/TEMPLATE.glossary.md +55 -0
  11. package/teams/fhr-orchestration/skills/init-harness/assets/TEMPLATE.harness-gap-log.md +59 -0
  12. package/teams/fhr-orchestration/skills/use-case-writer/SKILL.md +123 -0
  13. package/teams/fhr-orchestration/skills/use-case-writer/TEMPLATE.md +39 -0
  14. package/teams/fhr-orchestration/skills/write-spec/SKILL.md +56 -0
  15. package/teams/fhr-orchestration/skills/write-spec/TEMPLATE.md +29 -0
  16. package/teams/firstspirit-caas/mcp/jira-tools.py +2122 -0
  17. package/teams/firstspirit-caas/mcp/test_bamboo_artifacts.py +315 -0
  18. package/teams/firstspirit-caas/mcp/test_jira_links.py +192 -0
  19. package/teams/firstspirit-caas/mcp/test_update_jira_ticket.py +161 -0
  20. package/teams/firstspirit-caas/resources/mcp-setup.md +57 -0
  21. package/teams/firstspirit-caas/skills/chronicle/SKILL.md +105 -0
  22. package/teams/firstspirit-caas/skills/create-jira-ticket/SKILL.md +183 -0
  23. package/teams/firstspirit-caas/skills/get-jira-ticket/SKILL.md +125 -0
  24. package/teams/firstspirit-caas/skills/handle-red-cve-plan/SKILL.md +316 -0
  25. package/teams/firstspirit-caas/skills/handle-red-cve-plan/references/suppression.md +79 -0
  26. package/teams/firstspirit-caas/skills/handle-red-cve-plan/scripts/gen_suppression.py +116 -0
  27. package/teams/firstspirit-caas/skills/handle-red-cve-plan/scripts/parse_json_report.py +183 -0
  28. package/teams/firstspirit-caas/skills/handle-red-cve-plan/scripts/parse_report.py +255 -0
  29. package/teams/firstspirit-caas/skills/handle-red-cve-plan/scripts/test_gen_suppression.py +171 -0
  30. package/teams/firstspirit-caas/skills/handle-red-cve-plan/scripts/test_parse_json_report.py +244 -0
  31. package/teams/firstspirit-caas/skills/handle-red-cve-plan/scripts/test_parse_report.py +464 -0
  32. package/teams/firstspirit-caas/skills/handle-red-cve-plan/scripts/testdata/sample-report.html +39 -0
  33. package/teams/firstspirit-caas/skills/handle-red-cve-plan/scripts/testdata/sample-report.json +76 -0
  34. package/teams/firstspirit-caas/skills/handle-weekly-cve-plans/SKILL.md +238 -0
  35. package/teams/firstspirit-caas/skills/retrospect/SKILL.md +94 -0
  36. package/teams/firstspirit-caas/skills/retrospect/extract_prompts.py +392 -0
  37. package/teams/firstspirit-caas/skills/review/SKILL.md +131 -0
  38. package/teams/firstspirit-caas/skills/review-finalize/SKILL.md +103 -0
  39. package/teams/firstspirit-caas/skills/specify/SKILL.md +239 -0
  40. package/teams/firstspirit-caas/skills/summarise-for-jira-comment/SKILL.md +162 -0
  41. package/teams/firstspirit-caas/skills/write-releasenotes/SKILL.md +177 -0
@@ -0,0 +1,57 @@
1
+ # FirstSpirit CaaS — jira-tools MCP setup
2
+
3
+ Most FirstSpirit CaaS skills (`get-jira-ticket`, `create-jira-ticket`, `review`,
4
+ `handle-red-cve-plan`, `write-releasenotes`, and others) call tools served by a
5
+ local **`jira-tools`** MCP server. The server code ships in this team's `mcp/`
6
+ folder and installs to `docs/ai/mcp/jira-tools.py`.
7
+
8
+ > This team was ported from a Claude Code plugin
9
+ > (`crownpeak-claudecode-marketplace/plugins/planetexpress`). The plugin
10
+ > registered the MCP server automatically via `.mcp.json` and collected tokens
11
+ > via `plugin.json` `userConfig`. The `ai-dev` CLI only copies files — it does
12
+ > **not** register MCP servers or prompt for tokens. Register the server
13
+ > yourself using the config below before using the Jira/Bamboo/Bitbucket skills.
14
+
15
+ ## Requirements
16
+
17
+ - `python3` on PATH.
18
+ - Access tokens for Jira, Bitbucket (Server/Data Center), and Bamboo.
19
+
20
+ ### Tokens
21
+
22
+ | Env var | How to create |
23
+ | --- | --- |
24
+ | `JIRA_TOKEN` | `<Jira>/secure/ViewProfile.jspa` → Personal Access Tokens (Bearer auth). |
25
+ | `BITBUCKET_TOKEN` | `<Bitbucket>/plugins/servlet/access-tokens/manage`. Needs at least Repository read + Pull request write. |
26
+ | `BAMBOO_TOKEN` | `<Bamboo>/users/createPersonalAccessToken.action` (Bearer auth). Used to read CI build/job/log details and download artifacts. |
27
+
28
+ Keep tokens out of source control. Supply them via your MCP client's secret
29
+ handling or the shell environment.
30
+
31
+ ## Register the server
32
+
33
+ Point the command at wherever the server was installed
34
+ (`docs/ai/mcp/jira-tools.py` by default). Adjust base URLs for your instances.
35
+
36
+ ```json
37
+ {
38
+ "mcpServers": {
39
+ "jira-tools": {
40
+ "type": "stdio",
41
+ "command": "python3",
42
+ "args": ["docs/ai/mcp/jira-tools.py"],
43
+ "env": {
44
+ "JIRA_BASE_URL": "https://jira.crownpeak.com",
45
+ "JIRA_TOKEN": "<your jira token>",
46
+ "BITBUCKET_BASE_URL": "https://git.e-spirit.de",
47
+ "BITBUCKET_TOKEN": "<your bitbucket token>",
48
+ "BAMBOO_BASE_URL": "https://ci.e-spirit.de",
49
+ "BAMBOO_TOKEN": "<your bamboo token>"
50
+ }
51
+ }
52
+ }
53
+ }
54
+ ```
55
+
56
+ Once registered, the server exposes the `jira-tools` toolset the skills expect
57
+ (Jira issues/comments/transitions, Bitbucket PRs, Bamboo builds/artifacts).
@@ -0,0 +1,105 @@
1
+ ---
2
+ name: chronicle
3
+ description: Use when the user asks to keep, start, update, or read a running high-level summary of the work done this session — phrases like "chronicle this session", "update the chronicle", "keep a chronicle", "session chronicle", "where are we on this", "what have we done so far". Triggers on requests for a living, high-level record of session work written to ./.claude/plans/.
4
+ ---
5
+
6
+ # Chronicle
7
+
8
+ ## Overview
9
+
10
+ Maintains a **living, high-level chronicle** of the work done in a session, stored as
11
+ markdown in `./.claude/plans/`. The chronicle reflects the **net current state** of the
12
+ work — not a chronological log, and not steps that were later undone. No code-line detail.
13
+
14
+ **Core principle:** The chronicle is a *living summary edited to match the present*, not an
15
+ append-only log. When work is superseded or reverted, the entry is rewritten or removed —
16
+ never struck through, never preserved as history.
17
+
18
+ **Describe the work, not the workflow.** Record what the system/code now does, what was
19
+ decided, and what is still missing — as if describing the state of the product to someone who
20
+ does not care how it got there. Never record process/meta: "ticket specified", "plan written",
21
+ "task N complete", "reviewed / review passed", commit counts or ranges, plan/PR/branch
22
+ bookkeeping. Those are how the work happened, not what the work is.
23
+
24
+ ## When to Use
25
+
26
+ - User asks to chronicle / start / update / refresh a session summary.
27
+ - User asks "where are we" / "what have we done so far" and wants it persisted.
28
+ - After the skill has been invoked once in a session: re-update the chronicle following any
29
+ *later* prompt that significantly changes state (see Hybrid upkeep).
30
+
31
+ **Not for:** JIRA ticket comments (use `summarise-for-jira-comment`), session
32
+ retrospectives (use `retrospect`), or mechanical step-by-step plans (write those directly to
33
+ `./.claude/plans/`).
34
+
35
+ ## Chronicle file
36
+
37
+ Path: `./.claude/plans/<TICKET>-chronicle.md`
38
+
39
+ - `<TICKET>` = JIRA key matched in the current branch (`git rev-parse --abbrev-ref HEAD`)
40
+ via `[A-Z][A-Z0-9]+-[0-9]+`.
41
+ - `issue/HP-1234` → `HP-1234-chronicle.md`
42
+ - `feature/HP-1234-foo-bar` → `HP-1234-chronicle.md`
43
+ - No JIRA key → sanitized branch name (slashes → dashes): `feature-spike-chronicle.md`.
44
+
45
+ ## Workflow on invoke
46
+
47
+ 1. **Resolve path** — read the branch, derive `<TICKET>` or branch fallback.
48
+ 2. **Gather state** — from two sources only:
49
+ - the conversation already in context (asked / decided / done);
50
+ - git: `git status`, recent commits on the branch, `git diff --stat`.
51
+
52
+ Do not parse the transcript `.jsonl`. Do not run a script.
53
+ 3. **Build or reconcile:**
54
+ - File absent → write a fresh best-effort summary.
55
+ - File present → **reconcile to current state**: rewrite changed entries, delete entries
56
+ for undone/superseded work, add newly-significant work. Edit toward the present — never
57
+ append blindly.
58
+ 4. **Write** the file and report its path.
59
+
60
+ ## File structure
61
+
62
+ ```markdown
63
+ # Chronicle: <TICKET or branch>
64
+
65
+ _Last updated: <YYYY-MM-DD>_
66
+
67
+ ## Goal
68
+ <one or two lines: what this work is trying to achieve>
69
+
70
+ ## Current state
71
+ <what the system/code now does — capabilities and behavior, not tasks completed>
72
+
73
+ ## Key decisions
74
+ <notable choices and why — high level>
75
+
76
+ ## Open / in-progress
77
+ <what the system cannot yet do — missing capabilities, not unmerged/unreviewed work>
78
+ ```
79
+
80
+ Omit any section that is empty.
81
+
82
+ ## Hybrid upkeep
83
+
84
+ Once invoked in a session, re-update the chronicle after any *subsequent* prompt that
85
+ **significantly changes state**:
86
+
87
+ - **Significant** — a feature/fix completed, a design decision made, scope changed, a new
88
+ area of work started.
89
+ - **Skip** — typos, formatting, read-only exploration, dead-ends tried and removed.
90
+
91
+ This upkeep is best-effort. The authoritative refresh is always a fresh invocation, which
92
+ re-reconciles against git + context.
93
+
94
+ ## Common mistakes
95
+
96
+ | Mistake | Fix |
97
+ |---|---|
98
+ | Logging process/meta: "ticket specified", "plan written", "task N done", "review passed", "16 commits on branch" | Describe the work, not the workflow. State what the system now does / decided / missing. |
99
+ | Naming plan/PR/branch artifacts or commit ranges | Drop them — the chronicle describes the product, not the bookkeeping. |
100
+ | "Open" listing unmerged / no-PR-raised status | Open = missing capabilities, not integration bookkeeping. |
101
+ | Appending every change as a dated log entry | Reconcile to current state; rewrite/remove superseded entries. |
102
+ | Including `file:line`, code blocks, command lists | High level only — net outcomes, not mechanics. |
103
+ | Keeping entries for work that was reverted | Delete them. The chronicle shows the present, not history. |
104
+ | Parsing the session `.jsonl` transcript | Use in-context conversation + git only. |
105
+ | Writing to the wrong file each session | Path is derived from the branch ticket — same ticket, same file. |
@@ -0,0 +1,183 @@
1
+ ---
2
+ name: create-jira-ticket
3
+ description: Use when the user asks to create, file, open, or raise a JIRA ticket — phrases like "create a HP ticket for X", "file a ticket", "open a JIRA for Y", "ticket this up", "make a Story for Z". Triggers on requests to create a new ticket via the JIRA MCP tool.
4
+ ---
5
+
6
+ # Create JIRA Ticket
7
+
8
+ ## Overview
9
+
10
+ Drafts a high-level ticket (what + why), presents the full fields for explicit approval, and creates the ticket via `mcp__plugin_planetexpress_jira-tools__create_jira_ticket`. When the conversation makes an explicit relationship to another ticket clear, it also proposes issue links — shown together with the description, and created after the ticket via `mcp__plugin_planetexpress_jira-tools__link_jira_issues`, using only relationship types fetched from `get_jira_link_types`.
11
+
12
+ **Core principle:** A ticket says what needs to happen and why. Strong defaults exclude file paths, code blocks, counts, acceptance criteria, and step-by-step plans. Implementation belongs in the PR; mechanical task lists belong in `./.claude/plans/`; the ticket is the *why* and the *what*, nothing more.
13
+
14
+ ## When to use
15
+
16
+ - User asks to create / file / open / raise a JIRA ticket, story, task, bug, or sub-task
17
+ - User says "ticket this up", "make a JIRA for X", "create a HP- for Y", or similar
18
+
19
+ ## When NOT to use
20
+
21
+ - User wants a written *plan* in the workspace — that is a `./.claude/plans/*.md` file, not a JIRA ticket
22
+ - User wants to comment on an existing ticket — use `mcp__plugin_planetexpress_jira-tools__add_jira_comment` directly
23
+ - User wants to summarise completed work for a ticket — use `summarise-for-jira-comment`
24
+ - User wants to update an existing ticket's description — use `specify`
25
+
26
+ ## Workflow
27
+
28
+ 1. **Identify the project key**
29
+ - Default: parse the leading `[A-Z]+` of the ticket key in the current branch name (e.g., `feature/HP-1615-...` → `HP`)
30
+ - Override: an explicit project key in the user's message
31
+ - Unclear or multiple plausible projects: ask before drafting
32
+
33
+ 2. **Identify summary, issue type, and any fields the user named**
34
+ - **Summary:** one short imperative line. Match the project's prevailing style if visible from recent ticket fetches. No trailing punctuation.
35
+ - **Issue type:** by default choose between `Story` and `Escaped Bug` — pick whichever fits the ask (new work → Story; defect that slipped past release → Escaped Bug). Only use other types (Task, Bug, Sub-task, etc.) when the user explicitly names them. If Story vs Escaped Bug is genuinely ambiguous, ask.
36
+ - **Parent** (required for Sub-task), **priority**, **labels**, **assignee**: only set when the user named them. Do not invent labels or guess priority.
37
+
38
+ 3. **Gather just enough context for the description**
39
+ - Read the conversation. If the user pointed at code, branches, plans, or other tickets, pull that context.
40
+ - Stop as soon as you can write *why* and *what*. Do not enumerate files, count imports, or read the whole codebase to "be thorough".
41
+
42
+ 4. **Identify issue-link candidates (explicit relationships only)**
43
+ - Scan only what is already in context — the conversation, the branch ticket, already-fetched tickets / dev-info, referenced plans. **Never search JIRA** to find tickets to link.
44
+ - Propose a link only when the relationship is *explicitly clear* from that context (e.g. the user said "this follows on from HP-100", a plan notes it is blocked by HP-200, the branch continues prior work). A bare ticket mention or mere topical overlap is **not** a link.
45
+ - Direction is from the new ticket's perspective: `from_issue = (new ticket)`, `to_issue = <context ticket>`, `relationship = <phrase as stated>`.
46
+ - **Fetch-then-restrict:** if (and only if) you have at least one candidate, call `mcp__plugin_planetexpress_jira-tools__get_jira_link_types` **before presenting**, and keep a candidate only if its relationship matches a known type's `outward` or `inward` phrase. If a clearly-stated relationship has no matching type, do **not** invent one — tell the user and show the available phrases so they can choose. With no candidates, skip the fetch entirely.
47
+
48
+ 5. **Draft** in the default voice and shape (see next section).
49
+
50
+ 6. **Present in chat** — show all ticket fields verbatim, exactly as they will be sent, followed by the proposed links:
51
+
52
+ ```
53
+ Project: HP
54
+ Issue type: Story
55
+ Summary: <one-line title>
56
+ Priority: <only if set>
57
+ Labels: <only if set>
58
+ Assignee: <only if set>
59
+ Parent: <only if Sub-task>
60
+
61
+ Description:
62
+ <body, exactly as it will appear in JIRA, in JIRA wiki markup>
63
+
64
+ Links:
65
+ - (new ticket) <relationship> <TICKET-KEY>
66
+ - (new ticket) <relationship> <TICKET-KEY>
67
+ ```
68
+
69
+ The new ticket has no key yet, so its side reads `(new ticket)`. When there are no qualifying links, show `Links: (none — tell me if you want to add one)`. Then end with:
70
+ > Reply 'create' to file the ticket (and its links), or give edits.
71
+
72
+ 7. **Wait for explicit approval (strict gate + edits)**
73
+ - Affirmative-and-explicit ("create", "yes, create", "file it", "go ahead and create", "ship it") → create the ticket and its links
74
+ - Edits ("shorter", "drop that bullet", "drop the HP-100 link", "make it relates to", "change type to Bug") → revise, re-present **all fields and links** verbatim, wait again
75
+ - Anything else (silence, questions, "looks good", mixed feedback) → do **not** create; treat as edits or a question
76
+ - The strict gate covers links too: never create a link the user did not explicitly approve in the presented block.
77
+
78
+ 8. **Create**
79
+ - Call `mcp__plugin_planetexpress_jira-tools__create_jira_ticket` with the approved fields; capture the new ticket key.
80
+ - For each approved link, call `mcp__plugin_planetexpress_jira-tools__link_jira_issues` with `from_issue = <new key>`, `to_issue = <target>`, `relationship = <phrase>`.
81
+ - Report the ticket key/URL **and** each link's outcome. A link can still fail server-side (e.g. missing target); report that failure verbatim, do **not** claim it succeeded, and offer to retry. The ticket is never rolled back.
82
+
83
+ ## Voice & format
84
+
85
+ **Default shape (use this unless something forces otherwise):**
86
+
87
+ - 1–3 sentences of context / *why*
88
+ - 1–2 sentences of *what* needs to happen
89
+ - *Optionally:* a short bulleted list of **non-obvious gotchas** — file or class names are allowed here, but only when the gotcha is specifically about that piece of code
90
+
91
+ That is the whole template. No `Scope` / `Out of scope` / `Acceptance criteria` / `Risks` / `Reference` headers. No estimates. No counts.
92
+
93
+ **Voice:** neutral, factual, present/imperative tense. Describes the work, not the author. Not first person.
94
+
95
+ **Markup:** JIRA wiki markup. Use `*bold*`, `_italics_`, `-` for bullets, `{{monospace}}` for the rare inline identifier. Do not paste fenced code blocks unless code is genuinely the point of the ticket.
96
+
97
+ **Strong defaults — exclude unless they are the actual point of the ticket:**
98
+
99
+ - Code blocks or inline code
100
+ - File counts, import counts, line counts ("102 files import…", "66 production + 36 test")
101
+ - Exhaustive lists of affected files / classes / methods / packages
102
+ - Mechanical sub-tasks ("rename `X.java` → `Y.java`", "drop annotation `Z`", "promote `compileOnly` to `implementation`")
103
+ - Acceptance criteria, "out of scope" sections, risk lists, build-command checks
104
+ - Time / effort estimates
105
+ - Links to plan files in `./.claude/plans/` (those are not deliverables and are not committed)
106
+
107
+ **Exception clause:** include any of the above when the work *is* about that specific thing — a ticket whose whole point is "rip out `FooService`" can name it; a ticket about "fix the off-by-one in `BarController#paginate`" can point at it.
108
+
109
+ **Length:** if the description scrolls in the chat, it is wrong. Most descriptions land in under 12 lines.
110
+
111
+ ### Example pair
112
+
113
+ Hypothetical work: *finish the Jackson 3 migration after Spring Boot 4 lands*.
114
+
115
+ **❌ Bad (a plan, not a ticket — taken from a real prior session):**
116
+
117
+ > Drop the `spring-boot-jackson2` shim and migrate the codebase from Jackson 2 (`com.fasterxml.jackson.*`) to Jackson 3 (`tools.jackson.*`). Estimated 2–3 days for one engineer.
118
+ >
119
+ > *Scope (mechanical, ~80%):*
120
+ > - 102 Java files import `com.fasterxml.jackson.*` (66 production + 36 test). Pure prefix rename.
121
+ > - Top-affected: `databind.ObjectMapper` (66 files), `annotation.JsonProperty` (12), `core.JsonProcessingException` (9)…
122
+ >
123
+ > *Real semantic work:*
124
+ > - 20 files instantiate `new ObjectMapper()` — Jackson 3 mappers are immutable; migrate to `JsonMapper.builder()...build()`.
125
+ > - 18 test files using `Jackson2Tester` — swap to whatever Boot 4 ships natively.
126
+ > - 1 `Jackson2ObjectMapperBuilderCustomizer` in `datagenerator/.../DatageneratorSpringConfiguration.java` → `JsonMapperBuilderCustomizer`.
127
+ > - …
128
+ >
129
+ > *Build / config:* drop `spring-boot-jackson2` from `:main`, `:datagenerator`, `:server`, `:api-gateway`. Rename `spring.jackson2.*` → `spring.jackson.*`.
130
+ >
131
+ > *Acceptance criteria:* `./gradlew build` green, `:server:bootRun` and `:api-gateway:bootRun` start cleanly, zero `import com.fasterxml.jackson` in sources.
132
+ >
133
+ > *Risks:* Jackson 3's `JsonMapper` is immutable. Boot 4 BOM may have shifted property prefixes. The XML artifact may have a different group ID.
134
+ >
135
+ > *Reference:* HP-1615 branch, `.claude/plans/spring-boot-4-changes-summary.md`.
136
+
137
+ **✅ Good (high-level — what + why + the actually non-obvious bits):**
138
+
139
+ > The Spring Boot 4 upgrade kept Jackson 2 alive via the `{{spring-boot-jackson2}}` shim so Jackson regressions and Boot/Tomcat regressions wouldn't have to be bisected from the same PR. With Boot 4 stable, complete the move to Jackson 3 and drop the shim. Behaviour should be unchanged.
140
+ >
141
+ > Two non-obvious bits to watch:
142
+ >
143
+ > - {{CrawlerConfig}} carries a dual-resolver bridge (Jackson 2 + Jackson 3 `@JsonTypeIdResolver` annotations) added during HP-1615 specifically as a hand-off for this ticket. Jackson 3 becomes the only resolver.
144
+ > - {{HaupiaZookeeperClient}} is the central JSON-serialisation site for ZK. Verify a real round-trip — write a `PreparedSearch` under the shim, read it back under Jackson 3 — green unit tests are not enough on their own.
145
+
146
+ ## Edge cases
147
+
148
+ | Situation | Behaviour |
149
+ |---|---|
150
+ | No project key resolvable from branch or message | Ask the user; do not guess |
151
+ | Branch ticket has multiple `[A-Z]+` matches or unusual format | Ask which project before drafting |
152
+ | The *what* in the user's request is vague | Ask one focused clarifying question, then draft |
153
+ | Issue type unstated | Default to `Story` or `Escaped Bug` based on the ask (Escaped Bug = defect that escaped release; everything else = Story). Use other types only if the user explicitly names them. |
154
+ | Sub-task without a parent key | Ask for the parent key before drafting |
155
+ | User asks for fields the tool does not accept (component, fix-version, sprint, epic-link) | Surface the limitation; offer to add a label or a comment after creation |
156
+ | `create_jira_ticket` returns an error | Surface the error verbatim; do not retry silently or claim success |
157
+ | Creation succeeds but the user immediately asks for changes the tool can't make | Offer to add a comment or open a follow-up ticket |
158
+ | User says "create the ticket" referring to a draft already in chat | Confirm that draft is the one to file, present full fields verbatim, then wait for explicit approval |
159
+ | Context implies an explicit relationship to another ticket | Propose it as a link (after calling `get_jira_link_types`), shown in the `Links:` block — don't bury it only in the description |
160
+ | A clearly-stated relationship has no matching link type | Don't fabricate one; tell the user and show the available phrases from `get_jira_link_types` |
161
+ | A referenced ticket key is malformed or you're unsure it's real | Skip the link and mention it; do not guess a key |
162
+ | No qualifying link candidates in context | Show `Links: (none — tell me if you want to add one)`; never search JIRA for candidates |
163
+ | `link_jira_issues` errors after the ticket was created | Report it verbatim, keep the created ticket, offer to retry the link |
164
+
165
+ ## Red flags — STOP and reconsider
166
+
167
+ These thoughts mean the draft is drifting. Catch one, revise before presenting.
168
+
169
+ | Thought | Reality |
170
+ |---|---|
171
+ | "I should list every affected file so the assignee knows where to look" | The assignee greps the codebase. The ticket is the *why*, not the *where*. |
172
+ | "Acceptance criteria will help reviewers know when it's done" | Most tickets do not need them. The *what* already implies done. Add only if there is a non-obvious done-condition that wouldn't be discovered while doing the work. |
173
+ | "Counts (102 files, 66 imports, 2–3 days) make the scope concrete" | Counts age fast and add no decision value. Estimates are not the AI's call. Drop them. |
174
+ | "Let me include the mechanical steps so the assignee can just follow along" | A bullet list of mechanical steps is a plan. Plans go in `./.claude/plans/`, not JIRA. |
175
+ | "The plan file in `.claude/plans/` already covers this — link to it" | Plans are not committed and not deliverables. Inline the *why* and the non-obvious bits; drop the rest. |
176
+ | "I'll add Out of scope / Risks sections to be thorough" | Those are plan sections, not ticket sections. The default shape has none of them on purpose. |
177
+ | "User said 'looks good' — that's approval" | Strict gate: needs an explicit "create" / "yes, create" / "file it" / "go ahead and create". Anything else means wait. |
178
+ | "I'll re-use the draft the user approved earlier in the session" | Each ticket creation needs its own approval against the exact final fields. Edits invalidate prior approval. |
179
+ | "The description is long because the work is genuinely complex" | Long descriptions almost always indicate plan-leakage, not genuine complexity. Most genuinely complex tickets still fit in under 12 lines of *why* + *what*. |
180
+ | "Let me search JIRA for related tickets to link" | No. Link candidates come only from what's already in context. Never search. |
181
+ | "These two are in the same area, I'll add a relates-to link" | Topical overlap is not an explicit relationship. Link only when the relationship is clearly stated in context. |
182
+ | "I'll suggest a relationship phrase without checking the valid types" | Always call `get_jira_link_types` first; suggest only phrases that match a known type. |
183
+ | "User said 'looks good' — I'll create the ticket and the links" | Strict gate covers links too. Needs an explicit "create" against the presented block. |
@@ -0,0 +1,125 @@
1
+ ---
2
+ name: get-jira-ticket
3
+ description: 'Use when the user asks to get, fetch, load, or view a JIRA ticket — phrases like "get HP-1234", "fetch the ticket", "show me this ticket", "what does HP-1234 say". Also triggers on expansion requests within an ongoing conversation: "also get the linked issues", "fetch the attachments too", "expand the blocked-by tickets".'
4
+ ---
5
+
6
+ # Get JIRA Ticket
7
+
8
+ ## Overview
9
+
10
+ Loads JIRA ticket data into conversation context in a controlled way — fetching the base ticket first, then expanding to linked issues, attachments, or dev info only with explicit user approval. Prevents over-crawling irrelevant information.
11
+
12
+ **Core principle:** Context is for Claude, summaries are for the user. Fetch eagerly only what is approved; ask before following anything linked.
13
+
14
+ ## When to use
15
+
16
+ - User asks to get / fetch / load / view a JIRA ticket
17
+ - User asks to expand already-loaded ticket data ("also get the linked issues", "fetch the attachments")
18
+ - Any time JIRA ticket data is needed and has not yet been fetched in this conversation
19
+
20
+ ## When NOT to use
21
+
22
+ - User wants to update or enrich a ticket — use `specify`
23
+ - User wants to post a comment — use `summarise-for-jira-comment`
24
+
25
+ ## Workflow
26
+
27
+ ### Detect mode
28
+
29
+ Read conversation history to determine whether this is an **initial fetch** or a **re-invocation** (ticket data already in context).
30
+
31
+ ```
32
+ Ticket already in context?
33
+ ├── Yes → Re-invocation mode (see below)
34
+ └── No → Initial fetch mode (see below)
35
+ ```
36
+
37
+ ---
38
+
39
+ ### Initial fetch mode
40
+
41
+ **1. Identify the ticket key**
42
+
43
+ - Default: parse `[A-Z]+-\d+` from the current branch name
44
+ - Override: explicit key in user message
45
+ - Unresolvable or ambiguous: ask before proceeding
46
+
47
+ **2. Fetch base ticket**
48
+
49
+ Call `mcp__plugin_planetexpress_jira-tools__get_jira_ticket`. Capture all fields: summary, description, status, issuetype, assignee, reporter, priority, linked issues list, attachments list.
50
+
51
+ **3. Acknowledge and summarise**
52
+
53
+ Always emit the brief acknowledgment:
54
+ > "Loaded HP-1234 into context."
55
+
56
+ If the user asked a specific question alongside the fetch (e.g., "get the ticket — is the spec complete?"), answer that question directly from the fetched data. Otherwise, no unprompted dump of ticket fields.
57
+
58
+ **4. Offer expansions**
59
+
60
+ Inspect what is available but not yet fetched. If any of the following exist, present them and ask which (if any) to load:
61
+
62
+ - Linked issues — list them by key + summary; if more than 3, present the list and ask which ones specifically (never "fetch all" as default)
63
+ - Attachments — list names and types; never download without user approval
64
+ - Dev info (branches, commits, PRs) — offer as a single option
65
+
66
+ If none of the above exist, stop here.
67
+
68
+ ---
69
+
70
+ ### Re-invocation mode
71
+
72
+ **1. State what is already in context**
73
+
74
+ Open with a brief note of what is already loaded, including when:
75
+ > "HP-1234 was loaded earlier in this conversation (base ticket + dev info)."
76
+
77
+ **2. Staleness check**
78
+
79
+ If the base ticket was fetched in this conversation, note when and ask before re-fetching:
80
+ > "Base ticket was loaded N minutes ago — refresh?"
81
+
82
+ If the user confirms, re-fetch via `get_jira_ticket` and replace prior data in context.
83
+
84
+ **3. Fetch new expansions**
85
+
86
+ Fetch only what the user has now requested or approved. Apply the same per-resource gates as initial fetch mode (linked issues: list first if >3; attachments: show name/type before downloading).
87
+
88
+ **4. Acknowledge additions**
89
+
90
+ One-liner per resource fetched:
91
+ > "Added dev info to context — 2 open PRs on feature/HP-1234."
92
+ > "Added linked issue HP-999 (Bug — 'Null pointer in auth flow') to context."
93
+
94
+ ---
95
+
96
+ ## Expansion resources
97
+
98
+ | Resource | Tool | Gate |
99
+ |---|---|---|
100
+ | Linked issues | `get_jira_ticket` per issue | List all; if >3, ask which ones; never auto-fetch all |
101
+ | Attachments | `download_jira_attachment` per file | Show name + type before each download |
102
+ | Dev info | `get_jira_dev_info` | Single approval covers all dev info |
103
+
104
+ ## Edge cases
105
+
106
+ | Situation | Behaviour |
107
+ |---|---|
108
+ | No ticket key resolvable | Ask the user; do not guess |
109
+ | Multiple ticket keys in branch name | Ask which one; do not pick |
110
+ | `get_jira_ticket` returns 404 | Confirm key with user; do not continue with bad key |
111
+ | Linked issue returns 404 | Surface it, skip that issue, continue with others |
112
+ | >3 linked issues | Present the list; ask which to fetch; never fetch all by default |
113
+ | Attachment is large or binary | Show file size if available; let user decide |
114
+ | Base ticket already in context, user asks to "get it again" | Staleness check: note when it was loaded, ask "refresh?" before re-fetching |
115
+ | Dev info already fetched, user asks to "get the PRs" | Already in context — surface relevant PR data from existing context rather than re-fetching |
116
+
117
+ ## Red flags — STOP and reconsider
118
+
119
+ | Thought | Reality |
120
+ |---|---|
121
+ | "I'll fetch all linked issues to be thorough" | Ask which ones. Linked issues can be numerous and unrelated. |
122
+ | "The attachment name is obvious enough — I'll just download it" | Always show name and type first. Downloads are irreversible bandwidth. |
123
+ | "I already have the ticket in context so I'll answer from memory" | Stale context is real. Check when it was loaded; offer refresh if meaningful time has passed. |
124
+ | "User said 'get the ticket' — I'll also pull dev info since it's usually useful" | Only fetch what was asked. Offer expansions after the base fetch. |
125
+ | "There are 8 linked issues — I'll ask 'fetch all?'" | List them individually. "Fetch all" as a default option bypasses the over-crawling guardrail. |