@jaybeeuu/agent-cortex 1.41.1 → 1.42.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 (67) hide show
  1. package/.github/workflows/ci.yml +5 -5
  2. package/CHANGELOG.md +23 -0
  3. package/agents/ralph-plan/agent.md +7 -3
  4. package/agents/ralph-plan.agent.md +7 -3
  5. package/claude-extras/scripts/statusline-command.sh +0 -0
  6. package/docs/ideas/ban-content-assertion-tests.md +3 -1
  7. package/docs/ideas/dedicated-review-tests-skill.md +71 -0
  8. package/docs/ideas/unify-the-ticket-and-task-decomposition-workflows.md +71 -0
  9. package/package.json +5 -2
  10. package/plugin.json +1 -1
  11. package/scripts/install-instructions.sh +0 -0
  12. package/scripts/sync-plugin-version.sh +0 -0
  13. package/skills/engineering/grill-with-docs/SKILL.md +3 -2
  14. package/skills/engineering/improve-codebase-architecture/REFERENCE.md +5 -0
  15. package/skills/engineering/improve-codebase-architecture/SKILL.md +2 -1
  16. package/skills/planning/create-task/SKILL.md +8 -3
  17. package/skills/planning/create-task/scripts/create-chores.ts +4 -1
  18. package/skills/planning/prd-to-tasks/REFERENCE.md +2 -2
  19. package/skills/planning/prd-to-tasks/SKILL.md +9 -4
  20. package/skills/planning/request-refactor-plan/FORMAT.md +5 -0
  21. package/skills/planning/request-refactor-plan/SKILL.md +3 -2
  22. package/skills/planning/spec-to-tickets/REFERENCE.md +82 -0
  23. package/skills/planning/spec-to-tickets/SKILL.md +143 -0
  24. package/skills/planning/write-a-prd/FORMAT.md +6 -0
  25. package/skills/planning/write-a-prd/SKILL.md +9 -6
  26. package/skills/planning/write-a-ticket/EXAMPLES.md +133 -0
  27. package/skills/planning/write-a-ticket/SKILL.md +77 -59
  28. package/skills/productivity/bd-tool/SKILL.md +27 -2
  29. package/skills/productivity/grill-me/SKILL.md +11 -0
  30. package/skills/review/review-security/scripts/install-gitleaks.sh +0 -0
  31. package/skills/workflow/plan/SKILL.md +20 -8
  32. package/skills/workflow/ralph/REFERENCE.md +3 -1
  33. package/skills/workflow/run-pipeline-stage/SKILL.md +6 -1
  34. package/skills/workflow/using-agent-skills/SKILL.md +1 -0
  35. package/test/create-chores.test.mjs +12 -0
  36. package/test/fake-bd.test.mjs +72 -0
  37. package/test/helpers/fake-bd.mjs +26 -6
  38. package/extensions/agent-guardrails/node_modules/.bin/pi +0 -21
  39. package/extensions/agent-guardrails/node_modules/.bin/tsc +0 -21
  40. package/extensions/agent-guardrails/node_modules/.bin/tsserver +0 -21
  41. package/extensions/agent-guardrails/node_modules/.bin/tsx +0 -21
  42. package/extensions/agent-modes/node_modules/.bin/pi +0 -21
  43. package/extensions/agent-modes/node_modules/.bin/tsc +0 -21
  44. package/extensions/agent-modes/node_modules/.bin/tsserver +0 -21
  45. package/extensions/agent-modes/node_modules/.bin/tsx +0 -21
  46. package/extensions/skill-stats/node_modules/.bin/pi +0 -21
  47. package/extensions/skill-stats/node_modules/.bin/tsc +0 -21
  48. package/extensions/skill-stats/node_modules/.bin/tsserver +0 -21
  49. package/extensions/skill-stats/node_modules/.bin/tsx +0 -21
  50. package/extensions/skill-stats/pnpm-lock.yaml +0 -329
  51. package/extensions/subagent/node_modules/.bin/pi +0 -21
  52. package/extensions/subagent/node_modules/.bin/pi-ai +0 -21
  53. package/extensions/subagent/node_modules/.bin/tsc +0 -21
  54. package/extensions/subagent/node_modules/.bin/tsserver +0 -21
  55. package/extensions/subagent/node_modules/.bin/tsx +0 -21
  56. package/skills/planning/create-task/scripts/node_modules/.bin/tsc +0 -21
  57. package/skills/planning/create-task/scripts/node_modules/.bin/tsserver +0 -21
  58. package/skills/planning/create-task/scripts/node_modules/.bin/tsx +0 -21
  59. package/skills/planning/create-task/scripts/pnpm-lock.yaml +0 -342
  60. package/skills/productivity/validate-agent-dir/scripts/node_modules/.bin/tsc +0 -21
  61. package/skills/productivity/validate-agent-dir/scripts/node_modules/.bin/tsserver +0 -21
  62. package/skills/productivity/validate-agent-dir/scripts/node_modules/.bin/tsx +0 -21
  63. package/skills/productivity/validate-agent-dir/scripts/pnpm-lock.yaml +0 -329
  64. package/skills/workflow/run-pipeline-stage/scripts/node_modules/.bin/tsc +0 -21
  65. package/skills/workflow/run-pipeline-stage/scripts/node_modules/.bin/tsserver +0 -21
  66. package/skills/workflow/run-pipeline-stage/scripts/node_modules/.bin/tsx +0 -21
  67. package/skills/workflow/run-pipeline-stage/scripts/pnpm-lock.yaml +0 -342
@@ -0,0 +1,143 @@
1
+ ---
2
+ name: spec-to-tickets
3
+ description: Turn a PRD, RFC, or spec into an agreed map of tickets, then draft each ticket body with the human in dependency order. Use when the user says "break this spec into tickets", "turn this RFC into tickets", or "map out the work".
4
+ argument-hint: "The spec to decompose (path or link) and the target tracker"
5
+ ---
6
+
7
+ # Spec to Tickets
8
+
9
+ Turn one spec into a reviewed graph of tickets. The map is agreed before any body is
10
+ written, the drafts are reviewed as a set, and only then are tickets created.
11
+
12
+ ## When to use
13
+
14
+ - A PRD, RFC, ADR, or spec is approved and needs to become tickets in a tracker.
15
+ - The user says "break this spec into tickets", "turn this RFC into tickets", or "map out the work".
16
+ - A large change needs a dependency graph before anyone starts implementing.
17
+
18
+ ## When NOT to use
19
+
20
+ - A single ticket — use `write-a-ticket` directly.
21
+ - Decomposition into beads for the ralph/bd loop — use `prd-to-tasks`.
22
+ - No spec exists yet — use `write-a-prd` or `grill-with-docs` first.
23
+
24
+ ## Philosophy / rationale
25
+
26
+ - **Agree the graph before the bodies.** Granularity decisions invalidate bodies, so the human approves titles, edges, and scope first. Bodies are cheap to write once the graph is right.
27
+ - **Draft everything, then create once.** Drafts are reviewable artefacts; tickets in a tracker are not. The human reads the whole set before anything is uploaded.
28
+ - **One ticket at a time, then all at once.** Draft each body with the human so decisions stay in the open; review the finished set together so the boundary between tickets is visible.
29
+ - **Less is more.** Tickets stay scannable; the detail lives in the spec the ticket links to.
30
+
31
+ ## Workflow
32
+
33
+ ### Phase 1 — Ingest the spec
34
+
35
+ 1. Confirm the spec is in context (file, link, or paste). If it is missing, stop and ask for it.
36
+ 2. Identify the tracker and how tickets are created there — Jira, GitLab, GitHub, or beads, via CLI, MCP, or manual paste. Ask when unclear; the mechanism only affects Phase 6.
37
+ 3. Explore the code the spec touches, enough to name the components each ticket will change. You cannot slice work you have not looked at.
38
+ 4. Record the durable decisions that apply across every ticket — schema shape, API conventions, auth, shared models — so bodies link to them instead of repeating them.
39
+
40
+ ### Phase 2 — Draft the ticket map
41
+
42
+ 5. Slice the spec into tickets. Each ticket is a coherent unit of change one engineer can pick up and finish — not a layer, not a phase, not a week of work. Prefer more, thinner tickets.
43
+ 6. For each ticket record a verb-first title, a one-line intent, the components it touches, and its `depends-on` edges.
44
+ 7. Order the graph so dependencies come first, and mark the tickets that can run in parallel.
45
+
46
+ ### Phase 3 — Agree the map
47
+
48
+ 8. Write the map to `.agent-cortex/tickets/<spec-slug>-map.md` in the format from [REFERENCE.md](./REFERENCE.md), then present it. The map carries titles, intents, touchpoints, and edges — no bodies.
49
+ 9. Walk the graph with the human: granularity (merge or split), ordering, parallelism, and what is out of scope entirely. Iterate until they approve. Draft no body before this gate passes.
50
+
51
+ ### Phase 4 — Draft every body
52
+
53
+ 10. Walk the graph in dependency order. For each ticket, draft the body with `write-a-ticket` together with the human, and write it to `.agent-cortex/tickets/<spec-slug>/<NN>-<ticket-slug>.md` in the draft format from [REFERENCE.md](./REFERENCE.md). Create nothing yet.
54
+ 11. Settle every open question as you draft: resolve it, split a blocking spike ticket, or send the human to find the answer. A question stays open only if the human explicitly agrees — and then it is recorded under `Open questions` with an owner. Ship nothing unresolved that the human has not agreed to.
55
+
56
+ ### Phase 5 — Review the drafts
57
+
58
+ 12. Present the whole draft set for one read-through: titles, bodies, and edges together, so the boundary between tickets is visible.
59
+ 13. Iterate until the human approves the set. Nothing is created before this gate passes.
60
+
61
+ ### Phase 6 — Create and backfill
62
+
63
+ 14. Create each ticket through the agreed mechanism, using its approved draft verbatim. [REFERENCE.md](./REFERENCE.md) lists adapter examples.
64
+ 15. Backfill the real ID into the map, the draft file, and downstream tickets' dependency references.
65
+
66
+ ### Phase 7 — Report
67
+
68
+ 16. Present the created tickets with their IDs, edges, and any spikes, and note which can start immediately.
69
+
70
+ Workflow at a glance:
71
+
72
+ ```
73
+ [Spec: PRD/RFC/ADR]
74
+ |
75
+ v
76
+ [P1: Ingest + explore code]
77
+ |
78
+ v
79
+ [P2: Draft the ticket map]
80
+ |
81
+ v
82
+ [P3: Agree the map] --(revise)--> [P2: Draft the ticket map]
83
+ |
84
+ (approved)
85
+ v
86
+ [P4: Draft every body] --(open)--> [Resolve / spike / ask]
87
+ |
88
+ (drafted)
89
+ v
90
+ [P5: Review the draft set] --(revise)--> [P4: Draft every body]
91
+ |
92
+ (approved)
93
+ v
94
+ [P6: Create + backfill IDs]
95
+ |
96
+ v
97
+ [P7: Report the graph]
98
+ ```
99
+
100
+ ## Red Flags
101
+
102
+ - **Drafting bodies before the map is agreed.** A granularity change rewrites bodies; agree the graph first.
103
+ - **Creating before the draft set is reviewed.** Drafts are the review artefact; upload only what the human has read.
104
+ - **Layer tickets.** "All the database work" is not a unit of change — every ticket should be independently useful.
105
+ - **Carrying an unagreed open question into a body.** Resolve it, split a spike, or get the human's explicit agreement to leave it open.
106
+ - **A missing `depends-on` edge.** Ordering is the point of the map; an unmodelled dependency surfaces later as a blocked engineer.
107
+ - **Fat tickets.** If a ticket is a week of work, split it.
108
+
109
+ ## Common Rationalizations
110
+
111
+ | Rationalization | Rebuttal |
112
+ |---|---|
113
+ | "I'll create all the tickets, then refine" | Granularity is agreed first and drafts are reviewed before creation; tickets edited in the tracker leave the map stale. |
114
+ | "The map is obvious — skip writing it down" | The map is the review artefact. The human approves a graph, not a scroll of bodies. |
115
+ | "I'll note the open question in the ticket" | Only with the human's explicit agreement. Otherwise resolve it or spike it — an unagreed question is a blocked implementer. |
116
+ | "One big ticket is simpler to track" | Big tickets hide scope and block parallel work. |
117
+
118
+ ## Cross-skill references
119
+
120
+ - **`write-a-ticket`** — invoked for every body; owns the ticket quality bar.
121
+ - **`write-a-prd`** — use first when no spec exists.
122
+ - **`prd-to-tasks`** — use when the output is beads for the ralph/bd loop, not external tickets.
123
+ - **`style-comms`** — invoke when drafting the map's titles and intents.
124
+
125
+ ## Phase-gate checklist
126
+
127
+ - [ ] Phase 1 complete: spec in context, tracker identified, code explored, shared decisions recorded.
128
+ - [ ] Phase 2 complete: map drafted with titles, intents, touchpoints, and edges.
129
+ - [ ] Phase 3 complete: map written to `.agent-cortex/tickets/` and approved by the human.
130
+ - [ ] Phase 4 complete: every body drafted with `write-a-ticket` and written to the draft directory.
131
+ - [ ] Phase 5 complete: the draft set was reviewed and approved as a whole.
132
+ - [ ] Phase 6 complete: all tickets created and IDs backfilled into the map and the drafts.
133
+ - [ ] Phase 7 complete: graph reported with IDs, edges, and spikes.
134
+
135
+ ## Verification checklist
136
+
137
+ - [ ] No body was drafted before the map was approved.
138
+ - [ ] Every ticket is a coherent unit of change, not a layer or a phase.
139
+ - [ ] Every dependency is modelled as a `depends-on` edge in the map.
140
+ - [ ] Every draft exists under `.agent-cortex/tickets/<spec-slug>/` and was approved before creation.
141
+ - [ ] Every open question shipped was explicitly agreed by the human and has an owner.
142
+ - [ ] Real ticket IDs were backfilled into the map, the drafts, and downstream dependencies.
143
+ - [ ] The map file exists at `.agent-cortex/tickets/<spec-slug>-map.md`.
@@ -23,6 +23,12 @@ A LONG, numbered list of user stories. Each user story should be in the format o
23
23
 
24
24
  This list of user stories should be extremely extensive and cover all aspects of the feature.
25
25
 
26
+ ## Success Criteria
27
+
28
+ The high-level, verifiable outcomes that mean this feature succeeded. This is the epic's
29
+ `## Success Criteria` (required by `bd create --validate`) — distinct from the per-task
30
+ acceptance criteria that `prd-to-tasks` derives later.
31
+
26
32
  ## Implementation Decisions
27
33
 
28
34
  A list of implementation decisions that were made. This can include:
@@ -14,18 +14,18 @@ description: Create a PRD through user interview, codebase exploration, and modu
14
14
  ## When NOT to use
15
15
 
16
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`.
17
+ - The output targets a human team's external tracker — use `write-a-ticket` for one ticket, or `spec-to-tickets` to break a spec into many.
18
+ - A PRD already exists and needs breaking down — use `prd-to-tasks` for beads, or `spec-to-tickets` for external tickets.
19
19
  - The scope is a refactor needing a safe incremental plan — use `request-refactor-plan`.
20
20
 
21
21
  ## Workflow
22
22
 
23
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
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.
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. The epic's required sections — `## Success Criteria` in particular — are the interview's target: it is complete only when there is enough agreed detail to fill every required section. Never invent an answer; surface it as an assumption and confirm it with the user.
26
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 the `classify-bead` classifier (`node <this-skill-dir>/../classify-bead/scripts/classify-bead.mjs <epic-id>`, run from the target project's cwd) to label it AFK or HITL. Escalate to the `classify-bead` subagent only when the classifier reports `escalate: true`.
27
+ 5. **Write the PRD.** Render the template in `FORMAT.md` (Problem Statement, Solution, User Stories, Success Criteria, 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 - --validate`, piping the rendered PRD to stdin, then run the `classify-bead` classifier (`node <this-skill-dir>/../classify-bead/scripts/classify-bead.mjs <epic-id>`, run from the target project's cwd) to label it AFK or HITL. Escalate to the `classify-bead` subagent only when the classifier reports `escalate: true`. Finally run `bd lint <epic-id>` and fix any missing sections before reporting.
29
29
 
30
30
  Run the steps in order. Skip a step only when the user confirms it is unnecessary (e.g. the codebase is already explored).
31
31
 
@@ -52,12 +52,13 @@ Run the steps in order. Skip a step only when the user confirms it is unnecessar
52
52
 
53
53
  - [ ] Gate 1 — shared understanding: every design-tree branch resolved and the user confirms the summary.
54
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.
55
+ - [ ] Gate 3 — PRD filed: the epic bead contains the rendered template, carries an implementation-type label, and lints clean.
56
56
 
57
57
  ## Cross-skill references
58
58
 
59
59
  - Use `record-idea` when the idea is not yet ready to build.
60
60
  - Use `write-a-ticket` when the spec targets an external tracker rather than a bead.
61
+ - Use `spec-to-tickets` when an approved PRD/RFC must become a map of external tickets.
61
62
  - Run `prd-to-tasks` on the filed epic to break the PRD into an executable backlog.
62
63
  - Run the `classify-bead` classifier on the new epic — the repo labels every new bead AFK or HITL. Its `scripts/` directory sits next to this skill's directory in every harness, so `<this-skill-dir>/../classify-bead/scripts/classify-bead.mjs` resolves it. Escalate to its rubric subagent only when the classifier reports `escalate: true`.
63
64
 
@@ -69,6 +70,8 @@ Output: an epic bead whose description is the rendered PRD — problem, solution
69
70
  ## Verification checklist
70
71
 
71
72
  - [ ] Template in `FORMAT.md` rendered fully, with no placeholder sections.
73
+ - [ ] `## Success Criteria` present and the epic created with `--validate`.
74
+ - [ ] `bd lint <epic-id>` reports no missing sections.
72
75
  - [ ] Every user story follows "As an <actor>, I want <feature>, so that <benefit>".
73
76
  - [ ] Codebase assertions verified against the repo before writing.
74
77
  - [ ] Implementation Decisions contains no file paths or code snippets.
@@ -0,0 +1,133 @@
1
+ # Write a Ticket — Examples
2
+
3
+ Worked before/after rewrites for the `write-a-ticket` skill.
4
+
5
+ ## A whole ticket: padded vs tight
6
+
7
+ The padded version is the failure mode this skill exists to prevent: it explains the RFC,
8
+ prescribes an implementation, says nothing about scope, and leaves a question open. The
9
+ tight version points at the source material, states the behaviour, draws the boundary, and
10
+ gives an entry point.
11
+
12
+ ### Padded
13
+
14
+ ```markdown
15
+ ## Context
16
+
17
+ We are moving our billing stack to a new provider. The current provider has had several
18
+ outages this year, which has affected customer trust. The Q3 billing review evaluated
19
+ Stripe, Paddle, and Chargebee; Paddle was chosen because of EU data residency. The
20
+ meeting notes are attached. There was also discussion about whether to migrate in one go
21
+ or incrementally, and about how to handle existing subscriptions.
22
+
23
+ ## Description
24
+
25
+ We need to migrate to Paddle. This involves adding the Paddle SDK, creating a webhook
26
+ handler, migrating the subscription records, updating the pricing page, and changing the
27
+ retry logic. Step 1: install the SDK. Step 2: add a webhook handler that verifies the
28
+ signature. Step 3: write a migration script …
29
+
30
+ ## In scope
31
+
32
+ - The migration
33
+
34
+ ## Acceptance criteria
35
+
36
+ - [ ] The migration works correctly
37
+ - [ ] The feature is tested
38
+ - [ ] Payments still work
39
+
40
+ ## Open questions
41
+
42
+ - Do we migrate annual subscriptions too, or only monthly?
43
+ ```
44
+
45
+ ### Tight
46
+
47
+ ```markdown
48
+ ## Context
49
+
50
+ Part of the billing migration epic (BILL-412). Approach and provider decision in
51
+ RFC-018 §2; retry policy in ADR-014. Depends on the Paddle webhook receiver (BILL-420).
52
+
53
+ ## Description
54
+
55
+ When a Paddle webhook fails with a transient error, the handler retries with the shared
56
+ backoff policy. Non-transient failures are logged and acknowledged without retry. The
57
+ existing provider path is unchanged.
58
+
59
+ ## In scope
60
+
61
+ - Retry of transient Paddle webhook failures with the shared backoff policy.
62
+ - Provider selection in the payment factory.
63
+ - Structured logging of terminal webhook failures.
64
+
65
+ ## Out of scope
66
+
67
+ - Subscription record migration (BILL-421).
68
+ - Pricing-page changes (BILL-422).
69
+ - Provider cutover and production enablement.
70
+
71
+ ## Acceptance criteria
72
+
73
+ - [ ] A webhook returning 503 is retried up to 3 times with exponential backoff.
74
+ - [ ] A webhook returning 422 is not retried and is logged with the payload.
75
+ - [ ] The retry counter is per webhook event, not per process.
76
+ - [ ] The existing Stripe retry specs pass unchanged.
77
+
78
+ ## Testing approach
79
+
80
+ Integration spec in `test/webhooks/retry.spec.ts` against the Paddle sandbox, asserting
81
+ the 503-then-200 path and the terminal 422 path.
82
+
83
+ ## Technical notes
84
+
85
+ - **Entry point:** `src/payments/paddle.ts:41` (`handleWebhook`, `shouldRetry`)
86
+ - `retry()` from `@acme/retry-utils`; follow `src/payments/stripe.ts` for the handler shape.
87
+ - `handleWebhook` becomes async — update its call site in `src/payments/index.ts:12`.
88
+ ```
89
+
90
+ The tight version is shorter, answers the reviewer's questions, and still leaves the
91
+ implementation to the implementer.
92
+
93
+ ## Description: states the goal vs explains the RFC
94
+
95
+ | Instead of… | Write… |
96
+ | "We need to migrate to Paddle. The provider was chosen after a review of Stripe, Paddle and Chargebee, and there was discussion about whether to migrate incrementally. This ticket covers the retry logic, which is important because outages cost us customers. Step 1: …" | "When a Paddle webhook fails with a transient error, the handler retries with the shared backoff policy. Non-transient failures are logged and acknowledged without retry." |
97
+
98
+ The Description states what the ticket does and the behaviour it produces. It leads into the
99
+ scope bullets — the RFC link and the deliberation stay in Context or the source document.
100
+
101
+ ## Padded context vs linked context
102
+
103
+ | Instead of… | Write… |
104
+ | "We are moving to a new billing provider because the current one has outages. The provider was chosen in the Q3 billing review (attached meeting notes, see thread in #billing where we discussed Stripe vs Paddle vs Chargebee; conclusion was Paddle due to EU data residency). This ticket tracks the work agreed there." | "Part of the billing migration epic (BILL-412). Approach in RFC-018 §2. Depends on the Paddle webhook receiver (BILL-420)." |
105
+
106
+ Context is a pointer block: parent, where the approach lives, what it depends on. It does
107
+ not recap the deliberation.
108
+
109
+ ## Vague vs verifiable acceptance criteria
110
+
111
+ | Instead of… | Write… |
112
+ | "The export works correctly" | "Given a workspace with 1,000 issues, the CSV export returns all rows with no truncation" |
113
+ | "The feature is tested" | "Unit tests cover the retry path for transient HTTP 503 responses" |
114
+ | "The migration runs" | "The migration completes without errors on a staging copy of the production database" |
115
+
116
+ ## Technical notes: entry point vs full inventory
117
+
118
+ | Instead of… | Write… |
119
+ | "Step 1: install the SDK via `pnpm add @acme/paddle`. Step 2: add a webhook handler that verifies the signature and … (10 more steps)" | "- **Entry point:** `src/payments/paddle.ts:41` (`handleWebhook`, `shouldRetry`)" |
120
+ | "Files to change: `paddle.ts`, `index.ts`, `stripe.ts`, `retry.ts`, `types.ts`, `webhook.ts`, `config.ts`" | "- **Entry point:** `src/payments/paddle.ts:41` (`handleWebhook`, `shouldRetry`)<br>- Follow `src/payments/stripe.ts` for the handler shape." |
121
+
122
+ Technical notes lead with the entry point and then give only the facts that change how the
123
+ work is done — a signature, a library, a convention. They are neither an inventory of every
124
+ file touched nor a step-by-step guide; either of those means the ticket has become the code.
125
+
126
+ ## Open questions: agreed vs smuggled
127
+
128
+ An open question is legitimate when the human has agreed to it: it goes under
129
+ `Open questions` with the owner of the answer. A question the human has not agreed to is a
130
+ red flag wherever it appears — resolve it, spike it, or ask.
131
+
132
+ | Instead of… | Write… |
133
+ | A question buried in `Technical notes` or a `Notes` section, with no owner and no agreement | "## Open questions<br>- Do annual subscriptions migrate too? (owner: Priya)" |
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: write-a-ticket
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.
3
+ description: Write a clear, reviewable ticket for an external issue tracker (Jira, Linear, GitLab, GitHub Issues) 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 beads in a ralph/bd loop.
4
4
  argument-hint: "The work to ticket: goal, epic/initiative, constraints, or paste a draft"
5
5
  ---
6
6
 
@@ -9,104 +9,122 @@ argument-hint: "The work to ticket: goal, epic/initiative, constraints, or paste
9
9
  ## When to use
10
10
 
11
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.
12
+ - Drafting an actionable work item for a human engineering audience in an external tracker.
13
+ - Reviewing an existing ticket for clarity before it goes to the team.
14
14
 
15
15
  ## When NOT to use
16
16
 
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.
17
+ - Breaking a whole PRD/RFC/spec into many tickets — use `spec-to-tickets`, which calls this skill per ticket.
18
+ - Creating implementation tasks for the ralph/bd loop — those are beads executed by agents; use `prd-to-tasks` or `create-task`.
19
+ - Writing a requirements document for work that is not yet actionable — run `write-a-prd` first.
19
20
 
20
21
  ## Workflow
21
22
 
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.
23
+ 1. **Gather context.** Confirm the goal, the parent ticket or epic, the spec it follows, the decisions already made, and the entry point in the code. Outcome: you can state what this ticket does in one sentence. If you cannot, ask before writing.
23
24
 
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.
25
+ 2. **Settle open questions.** Resolve every question with the human while drafting. When a question cannot be resolved now, split a blocking spike ticket and depend on it, or ask the human to find the answer. A question may stay in the body only when the human explicitly agrees to leave it open — record it under `Open questions` with the owner of the answer. Ship no question the human has not agreed to.
26
+
27
+ 3. **Draft the body** from the template below, then check it against the format rules and the verification checklist.
28
+
29
+ 4. **Hand over the draft.** Present the body for review and get the human's agreement before it is created or filed. The draft is the review artefact — nothing reaches the tracker unseen.
25
30
 
26
31
  ```markdown
27
32
  ## Context
28
33
 
29
- <1–3 sentences: why this work exists, and which epic/RFC/ADR it belongs to. Link to it — never copy-paste its content.>
34
+ <1–5 sentences of pointers: parent ticket or epic, where the approach lives
35
+ (RFC/ADR section), the decisions already made, and what this depends on.
36
+ Reference these — do not explain them.>
30
37
 
31
38
  ## Description
32
39
 
33
- <What to build or change. Describe the outcome, not the implementation steps, and state scope explicitly — what is in and what is out.>
40
+ <2–4 sentences. What this ticket does and the behaviour it produces — the goal,
41
+ stated as the lead-in to the scope bullets. Leave detail to the sections below.>
34
42
 
35
- ## Acceptance criteria
43
+ ## In scope
36
44
 
37
- - [ ] <Specific, independently verifiable criterion — e.g. "given X, the API returns Y">
38
- - [ ] <...>
45
+ - <a distinct deliverable this ticket owns>
46
+ - <...>
39
47
 
40
- ## Technical notes
48
+ ## Out of scope
41
49
 
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.>
50
+ - <adjacent work explicitly not included — name the ticket that owns it where known>
43
51
 
44
- ## Testing strategy
52
+ ## Acceptance criteria
45
53
 
46
- <Optional. Only when testing needs are non-obvious or a level was agreed — unit, integration, contract, E2E. Omit when team defaults apply.>
54
+ - [ ] <independently verifiable check>
55
+ - [ ] <...>
47
56
 
48
- ## Monitoring strategy
57
+ ## Testing approach
49
58
 
50
- <Optional. Only when the change adds metrics, alerts, log events, dashboards, or a phased rollout. Omit when there is no meaningful observability footprint.>
59
+ <Optional. Which specs, what they assert, and any setup gotcha. Omit when team
60
+ defaults apply.>
51
61
 
52
- ## Notes
62
+ ## Technical notes
53
63
 
54
- <Optional. Genuinely useful details with no other home. If you reach for this often, restructure the ticket.>
64
+ - **Entry point:** `path/to/file.ts:42` (`symbol`, `symbol`)
65
+ - <a decisive fact: a signature that changes, a library or convention to follow,
66
+ a field injected elsewhere>
67
+
68
+ ## Open questions
69
+
70
+ <Optional, and only when the human has explicitly agreed to leave a question
71
+ open. One bullet per question, each naming who owns the answer. Omit this
72
+ section when there are none.>
55
73
  ```
56
74
 
57
- 3. **Review against the checklist.** Work through the verification checklist below before finalising.
75
+ ### Format rules
76
+
77
+ - **Link, don't copy.** Reference the spec by link or section; never paraphrase it. A reader who needs the rationale opens the source.
78
+ - **Point at the entry, not the inventory.** Technical notes lead with the entry point — 1–3 links to where the work begins — plus only the facts that change how it is done. A full list of touched files means you have written the code in prose.
79
+ - **Scope is the contract.** In scope and Out of scope say what the ticket owns; Technical notes only show where to begin.
80
+ - **Every bullet is a distinct deliverable or check.** Merge any two that restate each other, and cut any that add neither.
81
+ - **Bullets over paragraphs, and no tables in the body** — trackers render tables inconsistently and they are slow to scan.
82
+ - **Budgets are guidance, not limits.** Context ≤ 3 sentences; Description ≤ 4 sentences; In scope ≤ 8 bullets; Out of scope ≤ 6 bullets; Acceptance criteria ≤ 12 items; Technical notes ≤ 6 bullets. Extend a section when the work genuinely needs it — a larger scope, or detail that makes the goal clearer — but treat that as the exception, not the rule. Aim for the smallest body that is still complete.
58
83
 
59
84
  ## Red Flags
60
85
 
61
- - Writing implementation steps into the description — describe the outcome, not the how.
86
+ - Writing the code in prose — listing every file touched, or stepping through the edits.
87
+ - A Description that explains the RFC or the deliberation instead of stating what this ticket does.
62
88
  - 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.
89
+ - Padding a section to reach a budget, or exceeding one without the work to justify it.
90
+ - Copy-pasting spec content instead of linking to it.
91
+ - Leaving a question, `TBD`, or "we need to decide" in the body when the human has not agreed to it — an unagreed open question is a blocked implementer.
66
92
 
67
93
  ## Common Rationalizations
68
94
 
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. |
95
+ | Rationalization | Rebuttal |
96
+ | -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
97
+ | "The engineer will figure it out" | Skilled engineers can — but questions are a blocked ticket. The ticket must stand alone. |
98
+ | "More detail is safer" | Detail helps only if it informs the implementer. Every extra sentence is noise to skim. |
99
+ | "The reviewer should see every file touched" | The reviewer needs the scope and somewhere to start, not an inventory. The implementer finds the rest. |
100
+ | "I'll flag the open question in the ticket" | Only if the human agrees to leave it open. Otherwise resolve it or split a spike — an unagreed question is a blocked implementer. |
75
101
 
76
102
  ## Philosophy / rationale
77
103
 
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.
104
+ - **Write for clarity, not coverage.** Every line carries a fact; a long ticket of facts beats a short one of filler. Aim for the smallest body that is still complete, and extend a section only when the work demands it.
105
+ - **Scope is the contract.** In scope and Out of scope make the boundary reviewable at a glance.
106
+ - **Describe the behaviour, not the implementation.** The ticket owns the what and why; the implementer owns the how.
107
+ - **A ticket must stand alone.** Link, don't copy — readers who need the full rationale open the linked document, not a paraphrase.
81
108
 
82
109
  ## Cross-skill references
83
110
 
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` |
88
-
89
- ## Examples
90
-
91
- ### Vague vs verifiable acceptance criteria
92
-
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" |
97
-
98
- ### Context that links vs context that copies
111
+ | When you need… | Use this skill |
112
+ | ------------------------------------------------------- | ----------------- |
113
+ | To break a spec into a map of tickets | `spec-to-tickets` |
114
+ | Tone, structure, and concision for human-facing writing | `style-comms` |
115
+ | A requirements document that precedes the ticket | `write-a-prd` |
99
116
 
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." |
117
+ See [EXAMPLES.md](./EXAMPLES.md) for worked before/after rewrites.
103
118
 
104
119
  ## Verification checklist
105
120
 
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
121
+ - [ ] Context points at the parent, the approach, and the dependencies without explaining them
122
+ - [ ] Description states the goal and behaviour and leads into the scope bullets
123
+ - [ ] In scope and Out of scope are explicit, with every bullet a distinct deliverable
124
+ - [ ] Acceptance criteria are independently verifiable and none restate another
125
+ - [ ] Technical notes lead with the entry point and give only decisive facts
126
+ - [ ] Testing approach and Technical notes appear only when they add non-obvious information
127
+ - [ ] Every section is within its guidance budget, or the extra is justified by the work
128
+ - [ ] Any open question is one the human explicitly agreed to, listed under `Open questions` with an owner
129
+ - [ ] A skilled engineer can start immediately with zero follow-up questions
130
+ - [ ] The human reviewed the drafted body before it was created
@@ -43,13 +43,13 @@ For new tasks with pipeline expansion:
43
43
 
44
44
  ```bash
45
45
  # use the create-task skill, or manually:
46
- bd create "<title>" -d "<description>" -p <0-3>
46
+ bd create "<title>" -d "<description>" -p <0-3> --validate
47
47
  ```
48
48
 
49
49
  For parent-child relationships (create with `--parent`):
50
50
 
51
51
  ```bash
52
- bd create "<title>" --parent <parent-id>
52
+ bd create "<title>" --parent <parent-id> --validate
53
53
  ```
54
54
 
55
55
  For blocking dependencies between beads:
@@ -58,6 +58,31 @@ For blocking dependencies between beads:
58
58
  bd dep add <id> <blocked-by-id> --type blocks
59
59
  ```
60
60
 
61
+ ### Required sections
62
+
63
+ Create substantive beads with `--validate` so a section-less bead is rejected before it is
64
+ recorded. `bd create --validate` requires these sections per type (matching is case-insensitive);
65
+ `bd lint` checks the same contract on existing beads and exits non-zero when any are missing:
66
+
67
+ | Type | Required sections |
68
+ |---|---|
69
+ | `task`, `feature` | `## Acceptance Criteria` |
70
+ | `epic` | `## Success Criteria` |
71
+ | `bug` | `## Steps to Reproduce`, `## Acceptance Criteria` |
72
+ | `chore` | none |
73
+
74
+ Plan what you write: the type's required sections are the target of the planning interview
75
+ (`write-a-prd`, `request-refactor-plan`, `plan`, `grill-me`, …). Do not invent section content —
76
+ surface an assumption and confirm it with the human. Chore beads carry no required sections; their
77
+ description should reference the parent/requirements bead rather than restating criteria.
78
+
79
+ Review after creating — lint the beads you just made and fix any flagged ones:
80
+
81
+ ```bash
82
+ bd lint <new-id>... # scoped to your beads; exits non-zero on missing sections
83
+ bd lint # the whole open backlog (may flag pre-existing beads)
84
+ ```
85
+
61
86
  ## Completing work
62
87
 
63
88
  ```bash
@@ -8,3 +8,14 @@ Interview me relentlessly about every aspect of this plan until we reach a share
8
8
  Ask the questions one at a time.
9
9
 
10
10
  If a question can be answered by exploring the codebase, explore the codebase instead.
11
+
12
+ ## Completion: the bead's required sections
13
+
14
+ When this interview feeds a bead, the bead type's required sections are the target — their
15
+ contract is in the `bd-tool` skill's "Required sections" table (task/feature → `## Acceptance
16
+ Criteria`; epic → `## Success Criteria`; bug → Steps to Reproduce + Acceptance Criteria). The
17
+ interview is complete only when there is enough agreed detail to fill every required section.
18
+
19
+ Never invent section content. If you must infer an answer, state it as an assumption and get the
20
+ human to confirm it before it becomes bead content. Leave unresolved branches open — an open
21
+ question is better than a fabricated answer.