@jaybeeuu/agent-cortex 1.38.1 → 1.40.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.
- package/.agents/skills/style-versioning/SKILL.md +1 -1
- package/.github/workflows/ci.yml +47 -14
- package/AGENTS.md +19 -3
- package/CHANGELOG.md +42 -0
- package/README.md +118 -63
- package/agents/README.md +13 -10
- package/agents/ralph-plan/agent.md +1 -1
- package/agents/ralph-plan.agent.md +1 -1
- package/bin/agent-cortex.mjs +29 -8
- package/bin/installers/claude.mjs +569 -105
- package/bin/installers/copilot.mjs +22 -12
- package/bin/installers/pi.mjs +37 -34
- package/docs/claude-hooks.md +3 -3
- package/docs/ideas/extension-manifests.md +75 -0
- package/docs/ideas/record-ideas-as-beads.md +115 -0
- package/docs/ideas/subagent-visibility.md +72 -0
- package/docs/ideas/task-session-context.md +89 -0
- package/docs/research/skill-design-research.md +4 -4
- package/docs/research/skill-improvements-analysis.md +1 -1
- package/docs/skills/skill-anatomy.md +38 -2
- package/docs/technical-direction/migration-execution-labels.md +132 -0
- package/extensions/agent-modes/README.md +3 -2
- package/extensions/agent-modes/discover.test.ts +30 -7
- package/extensions/agent-modes/discover.ts +1 -1
- package/extensions/skill-stats/index.test.ts +3 -2
- package/lib/cli.mjs +24 -6
- package/package.json +4 -4
- package/plugin.json +1 -1
- package/pnpm-workspace.yaml +1 -1
- package/scripts/build-copilot-agents.mjs +1 -1
- package/scripts/check-no-sync.mjs +49 -0
- package/scripts/lib/compose-agent.mjs +32 -14
- package/skills/engineering/design-an-interface/SKILL.md +78 -58
- package/skills/engineering/grill-with-docs/REFERENCE.md +78 -0
- package/skills/engineering/grill-with-docs/SKILL.md +66 -63
- package/skills/engineering/improve-codebase-architecture/SKILL.md +66 -48
- package/skills/engineering/technical-direction/FORMAT.md +38 -0
- package/skills/engineering/technical-direction/SKILL.md +70 -77
- package/skills/planning/classify-bead/SKILL.md +59 -35
- package/skills/planning/create-task/REFERENCE.md +40 -0
- package/skills/planning/create-task/SKILL.md +70 -66
- package/skills/planning/create-task/scripts/create-chores.ts +6 -1
- package/skills/planning/create-task/scripts/node_modules/.bin/tsc +21 -0
- package/skills/planning/create-task/scripts/node_modules/.bin/tsserver +21 -0
- package/skills/planning/create-task/scripts/node_modules/.bin/tsx +21 -0
- package/skills/planning/prd-to-tasks/REFERENCE.md +66 -0
- package/skills/planning/prd-to-tasks/SKILL.md +86 -170
- package/skills/planning/record-idea/FORMAT.md +44 -0
- package/skills/planning/record-idea/SKILL.md +70 -53
- package/skills/planning/request-refactor-plan/FORMAT.md +45 -0
- package/skills/planning/request-refactor-plan/SKILL.md +57 -46
- package/skills/planning/write-a-prd/FORMAT.md +54 -0
- package/skills/planning/write-a-prd/SKILL.md +49 -48
- package/skills/planning/write-a-ticket/SKILL.md +68 -53
- package/skills/productivity/handoff/SKILL.md +12 -0
- package/skills/productivity/init-beads/SKILL.md +48 -40
- package/skills/productivity/validate-agent-dir/scripts/node_modules/.bin/tsc +21 -0
- package/skills/productivity/validate-agent-dir/scripts/node_modules/.bin/tsserver +21 -0
- package/skills/productivity/validate-agent-dir/scripts/node_modules/.bin/tsx +21 -0
- package/skills/productivity/write-a-skill/SKILL.md +2 -1
- package/skills/review/maintain-agent-docs/SKILL.md +71 -51
- package/skills/workflow/hitl-collab/SKILL.md +86 -17
- package/skills/workflow/ralph/REFERENCE.md +22 -17
- package/skills/workflow/ralph/SKILL.md +88 -74
- package/skills/workflow/run-pipeline-stage/REFERENCE.md +22 -0
- package/skills/workflow/run-pipeline-stage/SKILL.md +91 -93
- package/skills/workflow/run-pipeline-stage/scripts/generate-progress.test.ts +6 -107
- package/skills/workflow/run-pipeline-stage/scripts/node_modules/.bin/tsc +21 -0
- package/skills/workflow/run-pipeline-stage/scripts/node_modules/.bin/tsserver +21 -0
- package/skills/workflow/run-pipeline-stage/scripts/node_modules/.bin/tsx +21 -0
- package/test/claude-installer.test.mjs +308 -0
- package/test/cli.test.mjs +40 -30
- package/test/copilot-installer.test.mjs +92 -82
- package/test/helpers/fake-claude.mjs +152 -0
- package/test/installer.test.mjs +309 -57
- package/test/pi-installer.test.mjs +115 -99
- package/token-map.README.md +21 -10
- package/token-map.json +7 -6
- package/.claude-plugin/marketplace.json +0 -16
- package/claude/.claude-plugin/plugin.json +0 -11
- package/claude/agents/plan.md +0 -58
- package/claude/agents/ralph-plan.md +0 -121
- package/claude/agents/ralph.md +0 -193
- package/claude/agents/strategy.md +0 -111
- package/claude/hooks/scripts/notify.mjs +0 -54
- package/claude/hooks.json +0 -38
- /package/{claude → claude-extras}/.mcp.json +0 -0
- /package/{claude → claude-extras}/scripts/statusline-command.sh +0 -0
|
@@ -1,73 +1,84 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: request-refactor-plan
|
|
3
|
-
description: Create a detailed refactor plan
|
|
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
|
-
|
|
6
|
+
# Request Refactor Plan
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
## When to use
|
|
9
9
|
|
|
10
|
-
|
|
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
|
-
|
|
14
|
+
## When NOT to use
|
|
13
15
|
|
|
14
|
-
|
|
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
|
-
|
|
21
|
+
## Workflow
|
|
17
22
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
|
32
|
+
- **description**: the refactor plan formatted with the template in `FORMAT.md`
|
|
25
33
|
- **priority**: P2
|
|
26
34
|
|
|
27
|
-
|
|
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
|
-
##
|
|
37
|
+
## Red Flags
|
|
40
38
|
|
|
41
|
-
|
|
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
|
-
##
|
|
43
|
+
## Common Rationalizations
|
|
44
44
|
|
|
45
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
58
|
+
## Phase-gate checklist
|
|
58
59
|
|
|
59
|
-
|
|
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
|
-
-
|
|
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
|
-
|
|
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
|
-
|
|
71
|
+
## Examples
|
|
68
72
|
|
|
69
|
-
|
|
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
|
-
|
|
76
|
+
## Verification checklist
|
|
72
77
|
|
|
73
|
-
|
|
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
|
-
|
|
6
|
+
# Write a PRD
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
## When to use
|
|
9
9
|
|
|
10
|
-
|
|
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
|
-
|
|
14
|
+
## When NOT to use
|
|
13
15
|
|
|
14
|
-
|
|
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
|
-
|
|
21
|
+
## Workflow
|
|
17
22
|
|
|
18
|
-
|
|
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
|
-
|
|
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
|
-
|
|
32
|
+
## Red Flags
|
|
23
33
|
|
|
24
|
-
|
|
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
|
-
|
|
38
|
+
## Common Rationalizations
|
|
27
39
|
|
|
28
|
-
|
|
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
|
-
|
|
46
|
+
## Philosophy / rationale
|
|
31
47
|
|
|
32
|
-
|
|
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
|
-
|
|
51
|
+
## Phase-gate checklist
|
|
35
52
|
|
|
36
|
-
1
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
64
|
+
## Examples
|
|
45
65
|
|
|
46
|
-
|
|
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
|
-
|
|
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
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
|
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
|
-
|
|
9
|
+
## When to use
|
|
9
10
|
|
|
10
|
-
|
|
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
|
-
|
|
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
|
-
|
|
20
|
+
## Workflow
|
|
27
21
|
|
|
28
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
-
- [ ]
|
|
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,
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
89
|
+
## Examples
|
|
86
90
|
|
|
87
|
-
|
|
91
|
+
### Vague vs verifiable acceptance criteria
|
|
88
92
|
|
|
89
|
-
|
|
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
|
-
|
|
98
|
+
### Context that links vs context that copies
|
|
92
99
|
|
|
93
|
-
|
|
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
|
-
|
|
104
|
+
## Verification checklist
|
|
96
105
|
|
|
97
|
-
|
|
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.
|