@jaybeeuu/agent-cortex 1.38.1 → 1.39.0

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 (62) hide show
  1. package/AGENTS.md +3 -1
  2. package/CHANGELOG.md +30 -0
  3. package/README.md +34 -16
  4. package/agents/README.md +7 -5
  5. package/agents/ralph-plan/agent.md +1 -1
  6. package/agents/ralph-plan.agent.md +1 -1
  7. package/bin/agent-cortex.mjs +13 -5
  8. package/bin/installers/claude.mjs +129 -15
  9. package/claude/.claude-plugin/plugin.json +1 -1
  10. package/claude/agents/ralph-plan.md +1 -1
  11. package/docs/ideas/extension-manifests.md +75 -0
  12. package/docs/ideas/record-ideas-as-beads.md +115 -0
  13. package/docs/ideas/subagent-visibility.md +72 -0
  14. package/docs/ideas/task-session-context.md +89 -0
  15. package/docs/research/skill-design-research.md +4 -4
  16. package/docs/research/skill-improvements-analysis.md +1 -1
  17. package/docs/skills/skill-anatomy.md +38 -2
  18. package/docs/technical-direction/migration-execution-labels.md +132 -0
  19. package/lib/cli.mjs +9 -3
  20. package/package.json +2 -2
  21. package/plugin.json +1 -1
  22. package/pnpm-workspace.yaml +1 -1
  23. package/skills/engineering/design-an-interface/SKILL.md +78 -58
  24. package/skills/engineering/grill-with-docs/REFERENCE.md +78 -0
  25. package/skills/engineering/grill-with-docs/SKILL.md +66 -63
  26. package/skills/engineering/improve-codebase-architecture/SKILL.md +66 -48
  27. package/skills/engineering/technical-direction/FORMAT.md +38 -0
  28. package/skills/engineering/technical-direction/SKILL.md +70 -77
  29. package/skills/planning/classify-bead/SKILL.md +59 -35
  30. package/skills/planning/create-task/REFERENCE.md +40 -0
  31. package/skills/planning/create-task/SKILL.md +70 -66
  32. package/skills/planning/create-task/scripts/create-chores.ts +6 -1
  33. package/skills/planning/create-task/scripts/node_modules/.bin/tsc +21 -0
  34. package/skills/planning/create-task/scripts/node_modules/.bin/tsserver +21 -0
  35. package/skills/planning/create-task/scripts/node_modules/.bin/tsx +21 -0
  36. package/skills/planning/prd-to-tasks/REFERENCE.md +66 -0
  37. package/skills/planning/prd-to-tasks/SKILL.md +86 -170
  38. package/skills/planning/record-idea/FORMAT.md +44 -0
  39. package/skills/planning/record-idea/SKILL.md +70 -53
  40. package/skills/planning/request-refactor-plan/FORMAT.md +45 -0
  41. package/skills/planning/request-refactor-plan/SKILL.md +57 -46
  42. package/skills/planning/write-a-prd/FORMAT.md +54 -0
  43. package/skills/planning/write-a-prd/SKILL.md +49 -48
  44. package/skills/planning/write-a-ticket/SKILL.md +68 -53
  45. package/skills/productivity/handoff/SKILL.md +12 -0
  46. package/skills/productivity/init-beads/SKILL.md +48 -40
  47. package/skills/productivity/validate-agent-dir/scripts/node_modules/.bin/tsc +21 -0
  48. package/skills/productivity/validate-agent-dir/scripts/node_modules/.bin/tsserver +21 -0
  49. package/skills/productivity/validate-agent-dir/scripts/node_modules/.bin/tsx +21 -0
  50. package/skills/productivity/write-a-skill/SKILL.md +2 -1
  51. package/skills/review/maintain-agent-docs/SKILL.md +71 -51
  52. package/skills/workflow/hitl-collab/SKILL.md +86 -17
  53. package/skills/workflow/ralph/REFERENCE.md +22 -17
  54. package/skills/workflow/ralph/SKILL.md +88 -74
  55. package/skills/workflow/run-pipeline-stage/REFERENCE.md +22 -0
  56. package/skills/workflow/run-pipeline-stage/SKILL.md +91 -93
  57. package/skills/workflow/run-pipeline-stage/scripts/generate-progress.test.ts +6 -107
  58. package/skills/workflow/run-pipeline-stage/scripts/node_modules/.bin/tsc +21 -0
  59. package/skills/workflow/run-pipeline-stage/scripts/node_modules/.bin/tsserver +21 -0
  60. package/skills/workflow/run-pipeline-stage/scripts/node_modules/.bin/tsx +21 -0
  61. package/test/claude-installer.test.mjs +248 -0
  62. package/token-map.README.md +5 -3
@@ -1,73 +1,84 @@
1
1
  ---
2
2
  name: request-refactor-plan
3
- description: Create a detailed refactor plan with tiny commits via user interview, then file it as a bead. Use when user wants to plan a refactor, create a refactoring RFC, or break a refactor into safe incremental steps.
3
+ description: Create a detailed refactor plan via user interview, split into tiny commits, then file it as a bead. Use when planning a refactor, writing a refactoring RFC, or splitting a refactor into safe steps.
4
4
  ---
5
5
 
6
- This skill will be invoked when the user wants to create a refactor request. You should go through the steps below. You may skip steps if you don't consider them necessary.
6
+ # Request Refactor Plan
7
7
 
8
- 1. Ask the user for a long, detailed description of the problem they want to solve and any potential ideas for solutions.
8
+ ## When to use
9
9
 
10
- 2. Explore the repo to verify their assertions and understand the current state of the codebase.
10
+ - The user asks to "plan a refactor", "write a refactoring RFC", or "break this into safe incremental steps".
11
+ - A refactor is too big or risky to execute without a commit-level plan.
12
+ - You need a detailed, interview-derived implementation plan filed as a tracked task.
11
13
 
12
- 3. Ask whether they have considered other options, and present other options to them.
14
+ ## When NOT to use
13
15
 
14
- 4. Interview the user about the implementation. Be extremely detailed and thorough.
16
+ - Trivial one-shot edits that need no plan — make the change directly.
17
+ - Product- or feature-level planning — use `write-a-prd`.
18
+ - A refactor plan already exists — file or execute it; do not re-plan.
19
+ - An early-stage idea not ready for planning — record it with `record-idea`.
15
20
 
16
- 5. Hammer out the exact scope of the implementation. Work out what you plan to change and what you plan not to change.
21
+ ## Workflow
17
22
 
18
- 6. Look in the codebase to check for test coverage of this area of the codebase. If there is insufficient test coverage, ask the user what their plans for testing are.
19
-
20
- 7. Break the implementation into a plan of tiny commits. Remember Martin Fowler's advice to "make each refactoring step as small as possible, so that you can always see the program working."
21
-
22
- 8. Create a bead with the refactor plan. Invoke the `create-task` skill, passing:
23
+ 1. Interview the user for a long, detailed description of the problem and any potential solution ideas. Capture their words — the plan must encode the user's decisions, not your assumptions.
24
+ 2. Explore the repo to verify their assertions and understand the current state of the codebase. Codebases drift, so check rather than trust.
25
+ 3. Ask whether they have considered other options, and present alternatives yourself.
26
+ 4. Interview the user about the implementation in detail. Make every decision the plan needs now, while context is fresh.
27
+ 5. Hammer out the exact scope: what the plan will change and what it will not change.
28
+ 6. Check test coverage of the affected area. If coverage is insufficient, ask what the testing plans are.
29
+ 7. Break the implementation into a plan of tiny commits. Follow Martin Fowler: make each refactoring step as small as possible so you can always see the program working. Each commit must leave the codebase in a working state.
30
+ 8. Invoke the `create-task` skill to file the bead, passing:
23
31
  - **title**: a concise name for the refactor
24
- - **description**: the refactor plan formatted using the template below
32
+ - **description**: the refactor plan formatted with the template in `FORMAT.md`
25
33
  - **priority**: P2
26
34
 
27
- **Always use `create-task`** — never call `bd create` directly for tasks. `create-task` classifies the bead and expands AFK tasks into pipeline stage children that ralph can execute.
28
-
29
- <refactor-plan-template>
30
-
31
- ## Problem Statement
32
-
33
- The problem that the developer is facing, from the developer's perspective.
34
-
35
- ## Solution
36
-
37
- The solution to the problem, from the developer's perspective.
35
+ Always invoke `create-task` — never `bd create` directly. `create-task` classifies the bead and expands AFK tasks into pipeline stage beads for ralph.
38
36
 
39
- ## Commits
37
+ ## Red Flags
40
38
 
41
- A LONG, detailed implementation plan. Write the plan in plain English, breaking down the implementation into the tiniest commits possible. Each commit should leave the codebase in a working state.
39
+ - Skipping the interview because the request seems clear. The interview surfaces decisions only the user knows; a plan built on assumptions will not match reality.
40
+ - Adding file paths or code snippets to the Decision Document. Implementation detail goes stale quickly and misdirects the executor.
41
+ - Planning commits too big to verify in isolation. If a step cannot leave the program visibly working, split it further.
42
42
 
43
- ## Decision Document
43
+ ## Common Rationalizations
44
44
 
45
- A list of implementation decisions that were made. This can include:
45
+ | Rationalization | Rebuttal |
46
+ |---|---|
47
+ | "The user already told me what they want — the interview is unnecessary" | The interview collects decisions, not descriptions. Without it the plan is guesswork. |
48
+ | "I know this codebase — exploring again is a waste" | Codebases drift. Verifying assertions is cheap and prevents planning against stale assumptions. |
49
+ | "File paths in the decision doc make it more useful" | File paths go stale quickly. Keep decisions in the doc, paths out. |
50
+ | "This refactor is small — one or two commits will do" | Each step stays as small as possible so you can always see the program working. Small commits also keep reviews tractable. |
46
51
 
47
- - The modules that will be built/modified
48
- - The interfaces of those modules that will be modified
49
- - Technical clarifications from the developer
50
- - Architectural decisions
51
- - Schema changes
52
- - API contracts
53
- - Specific interactions
52
+ ## Philosophy / rationale
54
53
 
55
- Do NOT include specific file paths or code snippets. They may end up being outdated very quickly.
54
+ - **Interview-first.** The plan encodes the user's decisions, made while context is fresh, not the agent's guesses.
55
+ - **Tiny commits.** Fowler's rule — each step as small as possible so you can always see the program working — makes regressions localisable and reviews tractable.
56
+ - **Decisions without paths.** A document that names files ages overnight; one that names decisions survives the implementation.
56
57
 
57
- ## Testing Decisions
58
+ ## Phase-gate checklist
58
59
 
59
- A list of testing decisions that were made. Include:
60
+ - [ ] Phase 1 complete: problem and ideas captured, assertions verified in the repo.
61
+ - [ ] Phase 2 complete: alternatives discussed, scope and testing plan agreed.
62
+ - [ ] Phase 3 complete: commit plan written with every step leaving the codebase working.
63
+ - [ ] Phase 4 complete: bead filed via `create-task` with priority P2.
60
64
 
61
- - A description of what makes a good test (only test external behavior, not implementation details)
62
- - Which modules will be tested
63
- - Prior art for the tests (i.e. similar types of tests in the codebase)
65
+ ## Cross-skill references
64
66
 
65
- ## Out of Scope
67
+ - `create-task` — files the plan bead and expands it into pipeline stages. Mandatory; never call `bd create` directly.
68
+ - `write-a-prd` — product-level planning that is not a code refactor.
69
+ - `record-idea` — early-stage refactor ideas not ready for a full plan.
66
70
 
67
- A description of the things that are out of scope for this refactor.
71
+ ## Examples
68
72
 
69
- ## Further Notes (optional)
73
+ Input: "I want to refactor how config validation is wired in this repo"
74
+ Output: a P2 bead filed via `create-task` whose description follows the `FORMAT.md` template: Problem Statement, Solution, a commit-by-commit plan (each leaving the repo working), a Decision Document with decisions only, Testing Decisions, and Out of Scope.
70
75
 
71
- Any further notes about the refactor.
76
+ ## Verification checklist
72
77
 
73
- </refactor-plan-template>
78
+ - [ ] Interview covered problem, solution ideas, alternatives, and implementation details.
79
+ - [ ] User's assertions verified against the actual codebase; nothing assumed unverified.
80
+ - [ ] Scope agreed: what will change and what will not.
81
+ - [ ] Test coverage assessed; testing plan recorded when coverage is insufficient.
82
+ - [ ] Commit plan written with every commit leaving the codebase working.
83
+ - [ ] Decision Document contains decisions only — no file paths or code snippets.
84
+ - [ ] Bead filed via `create-task` with concise title, `FORMAT.md`-formatted description, priority P2.
@@ -0,0 +1,54 @@
1
+ # PRD Template
2
+
3
+ Render this template in full when completing step 5 of `write-a-prd`. Keep every section;
4
+ omit a section only when the user agrees it does not apply.
5
+
6
+ ## Problem Statement
7
+
8
+ The problem that the user is facing, from the user's perspective.
9
+
10
+ ## Solution
11
+
12
+ The solution to the problem, from the user's perspective.
13
+
14
+ ## User Stories
15
+
16
+ A LONG, numbered list of user stories. Each user story should be in the format of:
17
+
18
+ 1. As an <actor>, I want a <feature>, so that <benefit>
19
+
20
+ <user-story-example>
21
+ 1. As a mobile bank customer, I want to see balance on my accounts, so that I can make better informed decisions about my spending
22
+ </user-story-example>
23
+
24
+ This list of user stories should be extremely extensive and cover all aspects of the feature.
25
+
26
+ ## Implementation Decisions
27
+
28
+ A list of implementation decisions that were made. This can include:
29
+
30
+ - The modules that will be built/modified
31
+ - The interfaces of those modules that will be modified
32
+ - Technical clarifications from the developer
33
+ - Architectural decisions
34
+ - Schema changes
35
+ - API contracts
36
+ - Specific interactions
37
+
38
+ Do NOT include specific file paths or code snippets. They may end up being outdated very quickly.
39
+
40
+ ## Testing Decisions
41
+
42
+ A list of testing decisions that were made. Include:
43
+
44
+ - A description of what makes a good test (only test external behavior, not implementation details)
45
+ - Which modules will be tested
46
+ - Prior art for the tests (i.e. similar types of tests in the codebase)
47
+
48
+ ## Out of Scope
49
+
50
+ A description of the things that are out of scope for this PRD.
51
+
52
+ ## Further Notes
53
+
54
+ Any further notes about the feature.
@@ -3,72 +3,73 @@ name: write-a-prd
3
3
  description: Create a PRD through user interview, codebase exploration, and module design, then file as a bead. Use when user wants to write a PRD, create a product requirements document, or plan a new feature.
4
4
  ---
5
5
 
6
- This skill will be invoked when the user wants to create a PRD. You may skip steps if you don't consider them necessary.
6
+ # Write a PRD
7
7
 
8
- 1. Ask the user for a long, detailed description of the problem they want to solve and any potential ideas for solutions.
8
+ ## When to use
9
9
 
10
- 2. Explore the repo to verify their assertions and understand the current state of the codebase.
10
+ - The user asks to "write a PRD", wants a "product requirements document", or says "plan a new feature".
11
+ - A feature idea needs a written specification before implementation starts.
12
+ - You need a durable record of the problem, solution, user stories, and key decisions.
11
13
 
12
- 3. Interview the user relentlessly about every aspect of this plan until you reach a shared understanding. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one.
14
+ ## When NOT to use
13
15
 
14
- 4. Sketch out the major modules you will need to build or modify to complete the implementation. Actively look for opportunities to extract deep modules that can be tested in isolation.
16
+ - The idea is not ready to build yet — use `record-idea` to capture it to the backlog.
17
+ - The output targets a human team's external tracker — use `write-a-ticket`.
18
+ - A PRD already exists and needs breaking into tasks — use `prd-to-tasks`.
19
+ - The scope is a refactor needing a safe incremental plan — use `request-refactor-plan`.
15
20
 
16
- A deep module (as opposed to a shallow module) is one which encapsulates a lot of functionality in a simple, testable interface which rarely changes.
21
+ ## Workflow
17
22
 
18
- Check with the user that these modules match their expectations. Check with the user which modules they want tests written for.
23
+ 1. **Gather the problem statement.** Ask the user for a long, detailed description of the problem and any potential solution ideas. Ask one question at a time.
24
+ 2. **Explore the codebase.** Verify the user's assertions against the repo's current state. Explore instead of asking when the answer lives in code.
25
+ 3. **Interview relentlessly.** Walk down each branch of the design tree, resolving dependencies between decisions one by one, until the user's understanding and yours are identical. Every open question at this point becomes ambiguity in the PRD.
26
+ 4. **Sketch the modules.** List the major modules to build or modify, actively looking for deep modules — ones that encapsulate rich behaviour behind a simple, stable interface testable in isolation. Confirm the list with the user, plus which modules they want tests written for.
27
+ 5. **Write the PRD.** Render the template in `FORMAT.md` (Problem Statement, Solution, User Stories, Implementation Decisions, Testing Decisions, Out of Scope, Further Notes). Make the user-story list extremely extensive so it covers all aspects of the feature.
28
+ 6. **File the bead.** Create the epic with `bd create "<title>" --type epic --priority P1 --body-file -`, piping the rendered PRD to stdin, then run `classify-bead` (as a subagent, per its invocation instructions) to label it AFK or HITL.
19
29
 
20
- 5. Once you have a complete understanding of the problem and solution, use the template below to write the PRD. Create a bead for it using `bd create` with type `epic` and priority P1, passing the rendered PRD template as the description.
30
+ Run the steps in order. Skip a step only when the user confirms it is unnecessary (e.g. the codebase is already explored).
21
31
 
22
- <prd-template>
32
+ ## Red Flags
23
33
 
24
- ## Problem Statement
34
+ - Red flag: writing the PRD while an interview branch is still unresolved — each unanswered branch becomes a guess in the spec.
35
+ - Red flag: accepting user assertions about the codebase without verifying them in the repo.
36
+ - Red flag: a thin user-story list — a handful of stories usually means aspects of the feature were never discussed.
25
37
 
26
- The problem that the user is facing, from the user's perspective.
38
+ ## Common Rationalizations
27
39
 
28
- ## Solution
40
+ | Rationalization | Rebuttal |
41
+ |---|---|
42
+ | "I have enough context — the user is impatient" | Impatience is a signal to keep questions short, not to skip them. Unresolved branches surface later as rework. |
43
+ | "The feature is simple, a few stories are enough" | An extensive story list is how hidden aspects of the feature surface; thin stories mean thin scope coverage. |
44
+ | "I know this codebase, no need to explore" | Verification in the repo is cheap; a wrong assumption becomes a wrong PRD. |
29
45
 
30
- The solution to the problem, from the user's perspective.
46
+ ## Philosophy / rationale
31
47
 
32
- ## User Stories
48
+ - The PRD is the contract between intent and implementation; its quality caps everything downstream, so exhaust the interview before writing.
49
+ - Deep modules beat shallow ones — in code and in the PRD's implementation decisions. Interfaces worth stating are stable ones.
33
50
 
34
- A LONG, numbered list of user stories. Each user story should be in the format of:
51
+ ## Phase-gate checklist
35
52
 
36
- 1. As an <actor>, I want a <feature>, so that <benefit>
53
+ - [ ] Gate 1 — shared understanding: every design-tree branch resolved and the user confirms the summary.
54
+ - [ ] Gate 2 — modules agreed: the module list and test expectations match the user's model of the solution.
55
+ - [ ] Gate 3 — PRD filed: the epic bead contains the rendered template and carries an implementation-type label.
37
56
 
38
- <user-story-example>
39
- 1. As a mobile bank customer, I want to see balance on my accounts, so that I can make better informed decisions about my spending
40
- </user-story-example>
57
+ ## Cross-skill references
41
58
 
42
- This list of user stories should be extremely extensive and cover all aspects of the feature.
59
+ - Use `record-idea` when the idea is not yet ready to build.
60
+ - Use `write-a-ticket` when the spec targets an external tracker rather than a bead.
61
+ - Run `prd-to-tasks` on the filed epic to break the PRD into an executable backlog.
62
+ - Run `classify-bead` on the new epic — the repo labels every new bead AFK or HITL.
43
63
 
44
- ## Implementation Decisions
64
+ ## Examples
45
65
 
46
- A list of implementation decisions that were made. This can include:
66
+ Input: "Write a PRD for adding scheduled exports to the reporting feature"
67
+ Output: an epic bead whose description is the rendered PRD — problem, solution, extensive user stories, implementation and testing decisions, out-of-scope items, and further notes.
47
68
 
48
- - The modules that will be built/modified
49
- - The interfaces of those modules that will be modified
50
- - Technical clarifications from the developer
51
- - Architectural decisions
52
- - Schema changes
53
- - API contracts
54
- - Specific interactions
69
+ ## Verification checklist
55
70
 
56
- Do NOT include specific file paths or code snippets. They may end up being outdated very quickly.
57
-
58
- ## Testing Decisions
59
-
60
- A list of testing decisions that were made. Include:
61
-
62
- - A description of what makes a good test (only test external behavior, not implementation details)
63
- - Which modules will be tested
64
- - Prior art for the tests (i.e. similar types of tests in the codebase)
65
-
66
- ## Out of Scope
67
-
68
- A description of the things that are out of scope for this PRD.
69
-
70
- ## Further Notes
71
-
72
- Any further notes about the feature.
73
-
74
- </prd-template>
71
+ - [ ] Template in `FORMAT.md` rendered fully, with no placeholder sections.
72
+ - [ ] Every user story follows "As an <actor>, I want <feature>, so that <benefit>".
73
+ - [ ] Codebase assertions verified against the repo before writing.
74
+ - [ ] Implementation Decisions contains no file paths or code snippets.
75
+ - [ ] Epic bead filed with type `epic`, priority P1, the rendered PRD as description, and an implementation-type label applied.
@@ -1,97 +1,112 @@
1
1
  ---
2
2
  name: write-a-ticket
3
- description: Write a well-structured ticket for an external issue tracker (e.g. Jira). Use when writing tickets intended for a human engineering audience — not for creating implementation tasks in a ralph/bd loop.
3
+ description: Write a well-structured ticket for an external issue tracker (e.g. Jira) that an engineer can act on without follow-up questions. Use when asked to "write a ticket", "file this in Jira", or "create a work item" — not for creating implementation tasks in a ralph/bd loop.
4
+ argument-hint: "The work to ticket: goal, epic/initiative, constraints, or paste a draft"
4
5
  ---
5
6
 
6
7
  # Write a Ticket
7
8
 
8
- Tickets are for skilled engineers. They should be able to pick one up, understand the context immediately, know where to start, and deliver the right outcome — without having to ask questions or wade through noise.
9
+ ## When to use
9
10
 
10
- **Write for clarity, not coverage.** A ticket is not a specification. Prefer one well-chosen sentence over three that say the same thing.
11
+ - Asked to "write a ticket", "file this in Jira", or "create a work item".
12
+ - Drafting an actionable work item for a human engineering audience in an external issue tracker (Jira, Linear, GitHub Issues).
13
+ - Checking an existing ticket for clarity before it goes to the team.
11
14
 
12
- ---
13
-
14
- ## Process
15
-
16
- ### 1. Gather context
17
-
18
- Before drafting, confirm you have:
19
- - The goal of the work
20
- - Which epic, RFC, or initiative this belongs to (if any)
21
- - Any known constraints or decisions already made
22
- - Relevant code locations, schemas, or prior art
15
+ ## When NOT to use
23
16
 
24
- If anything is unclear, ask before writing.
17
+ - Creating implementation tasks for the ralph/bd loop — those are beads executed by agents, not tickets read by engineers.
18
+ - Writing a requirements document for a feature that is not yet actionable — run `write-a-prd` first and link the PRD from the ticket.
25
19
 
26
- ### 2. Draft the ticket
20
+ ## Workflow
27
21
 
28
- Use the template below. Every section has a purpose — do not pad it, and do not omit a required section without good reason.
29
-
30
- ### 3. Review against the checklist
31
-
32
- Before finalising, check:
33
- - [ ] Could a skilled engineer start this immediately with no follow-up questions?
34
- - [ ] Is every sentence earning its place? Remove anything that doesn't add information.
35
- - [ ] Are acceptance criteria verifiable, not vague?
36
- - [ ] Do technical notes point at the right things without over-prescribing the solution?
37
-
38
- ---
22
+ 1. **Gather context.** Confirm the goal of the work, the epic/RFC/initiative it belongs to (if any), known constraints or decisions, and relevant code locations, schemas, or prior art. Outcome: you can state the ticket's purpose in one sentence. If you cannot, ask before writing.
39
23
 
40
- ## Template
24
+ 2. **Draft the ticket.** Work through the template below. Every section has a purpose — write it only if it earns its place, and never omit a required section without recording why.
41
25
 
42
26
  ```markdown
43
27
  ## Context
44
28
 
45
- <1–3 sentences. Set the scene: why does this work exist, what larger initiative is it part of?
46
- Link to the relevant epic, RFC, ADR, or prior ticket — don't duplicate their content here.>
29
+ <1–3 sentences: why this work exists, and which epic/RFC/ADR it belongs to. Link to it — never copy-paste its content.>
47
30
 
48
31
  ## Description
49
32
 
50
- <What needs to be built or changed. Describe the outcome, not the implementation steps.
51
- Be specific about scope — what is in and what is explicitly out.>
33
+ <What to build or change. Describe the outcome, not the implementation steps, and state scope explicitly — what is in and what is out.>
52
34
 
53
35
  ## Acceptance criteria
54
36
 
55
- - [ ] <Specific, verifiable criterion>
56
- - [ ] <Specific, verifiable criterion>
57
- - [ ] <Specific, verifiable criterion>
37
+ - [ ] <Specific, independently verifiable criterion — e.g. "given X, the API returns Y">
38
+ - [ ] <...>
58
39
 
59
40
  ## Technical notes
60
41
 
61
- <Links to relevant code, suggested request/response/document schemas, architectural decisions,
62
- or guidance the implementer should know. This is a pointer, not a design document —
63
- if a decision needs more space, it belongs in an ADR or RFC.>
42
+ <Links to relevant code, agreed schemas, architectural decisions, or upstream constraints. A pointer, not a design document — decisions that need more space belong in an ADR or RFC.>
64
43
 
65
44
  ## Testing strategy
66
45
 
67
- <Optional. Agreed testing levels for this change: e.g. unit, integration, contract, E2E.
68
- Only include if there is something non-obvious to say.>
46
+ <Optional. Only when testing needs are non-obvious or a level was agreed — unit, integration, contract, E2E. Omit when team defaults apply.>
69
47
 
70
48
  ## Monitoring strategy
71
49
 
72
- <Optional. How will this change be observed in production? e.g. new metrics, alerts, log events,
73
- dashboards, or feature flag rollout stages. Only include if the change has non-obvious observability
74
- requirements or a specific rollout approach was agreed.>
50
+ <Optional. Only when the change adds metrics, alerts, log events, dashboards, or a phased rollout. Omit when there is no meaningful observability footprint.>
75
51
 
76
52
  ## Notes
77
53
 
78
- <Optional. Anything else that is genuinely useful and doesn't fit above.>
54
+ <Optional. Genuinely useful details with no other home. If you reach for this often, restructure the ticket.>
79
55
  ```
80
56
 
81
- ---
57
+ 3. **Review against the checklist.** Work through the verification checklist below before finalising.
58
+
59
+ ## Red Flags
60
+
61
+ - Writing implementation steps into the description — describe the outcome, not the how.
62
+ - Acceptance criteria that cannot be verified: "works correctly", "is tested".
63
+ - Copy-pasting context instead of linking to the epic, RFC, or ADR.
64
+ - Padding sections with filler to look complete — a short, accurate ticket beats a padded one.
65
+ - Omitting a required section without recording why.
66
+
67
+ ## Common Rationalizations
68
+
69
+ | Rationalization | Rebuttal |
70
+ |---|---|
71
+ | "The engineer will figure it out" | Skilled engineers can — but questions are a blocked ticket. The ticket must stand alone. |
72
+ | "More detail is safer" | Detail only helps if it informs the implementer. Every extra sentence is noise to skim. |
73
+ | "We will verify acceptance criteria in review" | Unverifiable criteria cannot be checked. Write given/outcome pairs instead. |
74
+ | "We will discuss the details in standup" | The ticket is the record. If it cannot stand alone, the discussion is lost. |
75
+
76
+ ## Philosophy / rationale
77
+
78
+ - **Write for clarity, not coverage.** A ticket is not a specification. One well-chosen sentence beats three that say the same thing.
79
+ - **Describe the outcome, not the implementation.** The ticket owns the what and why; the implementer owns the how.
80
+ - **A ticket must stand alone.** Link, don't copy — readers who need the full rationale should open the linked document, not a paraphrase.
81
+
82
+ ## Cross-skill references
82
83
 
83
- ## Guidance per section
84
+ | When you need… | Use this skill |
85
+ |---|---|
86
+ | Tone, structure, and concision for human-facing writing | `style-comms` |
87
+ | A requirements document that precedes the ticket | `write-a-prd` |
84
88
 
85
- **Context** — one job: explain *why*. A reader should understand the motivation without opening another tab. Link freely; copy-paste never.
89
+ ## Examples
86
90
 
87
- **Description** — describes *what*, not *how*. Avoid implementation steps. If scope boundaries matter, state them explicitly ("this ticket does not include X").
91
+ ### Vague vs verifiable acceptance criteria
88
92
 
89
- **Acceptance criteria** — must be independently verifiable. Avoid "works correctly" or "is tested". Prefer "given X, the API returns Y" or "the migration runs without errors on staging".
93
+ | Instead of… | Write… |
94
+ |---|---|
95
+ | "The export feature works" | "Given exports enabled, selecting 'Export CSV' downloads `<account>-export-<date>.csv`" |
96
+ | "Adds tests for the new endpoint" | "POST /v1/orders returns 201 with the created order for valid input and 422 with field errors for schema violations" |
90
97
 
91
- **Technical notes** — share what the implementer needs to know, not everything you know. Good candidates: a tricky code location, a schema that has already been agreed, a constraint from an upstream system. Bad candidates: a tutorial on the technology, decisions that haven't been made yet.
98
+ ### Context that links vs context that copies
92
99
 
93
- **Testing strategy** — omit if the team's default testing conventions apply. Include only when this ticket has unusual testing requirements or a specific agreement was reached.
100
+ | Instead of… | Write… |
101
+ |---|---|
102
+ | Four paragraphs paraphrasing the ADR | "Follows ADR-014 (token refresh). This ticket adds only the retry path — see ADR link." |
94
103
 
95
- **Monitoring strategy** — omit if the change has no meaningful observability footprint. Include when the ticket introduces new metrics, requires new alerts, involves a phased rollout, or has an agreed approach to validating success in production.
104
+ ## Verification checklist
96
105
 
97
- **Notes** — a catch-all for genuinely relevant information that has no other home. If you're reaching for it often, the ticket probably needs restructuring.
106
+ - [ ] Context explains why the work exists; the reader needs no other tab open
107
+ - [ ] Description states the outcome, not implementation steps, and defines scope
108
+ - [ ] Acceptance criteria are independently verifiable — no "works correctly" or "is tested"
109
+ - [ ] Technical notes link to code or schemas without prescribing the solution
110
+ - [ ] Testing/Monitoring/Notes present only when they add non-obvious information
111
+ - [ ] Every sentence passes the "does this add information?" test
112
+ - [ ] A skilled engineer can start immediately with zero follow-up questions
@@ -13,3 +13,15 @@ Do not duplicate content already captured in other artifacts (PRDs, plans, ADRs,
13
13
  Redact any sensitive information, such as API keys, passwords, or personally identifiable information.
14
14
 
15
15
  If the user passed arguments, treat them as a description of what the next session will focus on and tailor the doc accordingly.
16
+
17
+ ## Output a starter prompt
18
+
19
+ As the last section of the document, include a `## Starter prompt` section containing a ready-to-paste prompt the user can give the next session. The prompt must:
20
+
21
+ 1. Point the new session at the handoff document itself by absolute path.
22
+ 2. State the focus of the next session in one or two sentences.
23
+ 3. Tell the new session to read the handoff first, then the referenced artifacts it needs, before acting.
24
+ 4. Ask the new session to clean up any provisional/test artifacts the handoff documents (e.g. prototype beads created during the session) unless the handoff says otherwise.
25
+ 5. Stay under ~150 words so it can be pasted verbatim as the first message.
26
+
27
+ The point of the starter prompt is to give the next session a minimal-context start: everything it needs lives in the handoff document and the artifacts it references, so the first message can be short.