@jaybeeuu/agent-cortex 1.20.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 (154) hide show
  1. package/.beads/README.md +81 -0
  2. package/.beads/config.yaml +1 -0
  3. package/.beads/issues.jsonl +236 -0
  4. package/.beads/metadata.json +7 -0
  5. package/.claude-plugin/marketplace.json +16 -0
  6. package/.github/workflows/ci.test.ts +217 -0
  7. package/.github/workflows/ci.yml +35 -0
  8. package/.github/workflows/publish.yml +36 -0
  9. package/.junie/guidelines.md +87 -0
  10. package/.junie/mcp/mcp.json +10 -0
  11. package/AGENTS.md +102 -0
  12. package/CHANGELOG.md +705 -0
  13. package/README.md +209 -0
  14. package/agents/README.md +235 -0
  15. package/agents/plan.agent.md +56 -0
  16. package/agents/ralph-plan.agent.md +119 -0
  17. package/agents/ralph.agent.md +305 -0
  18. package/agents/strategy.agent.md +109 -0
  19. package/agents-native/ralph.md +193 -0
  20. package/bin/agent-cortex.mjs +27 -0
  21. package/claude/.claude-plugin/plugin.json +11 -0
  22. package/claude/.mcp.json +18 -0
  23. package/claude/agents/plan.md +56 -0
  24. package/claude/agents/ralph-plan.md +119 -0
  25. package/claude/agents/ralph.md +193 -0
  26. package/claude/agents/strategy.md +109 -0
  27. package/claude/hooks.json +23 -0
  28. package/claude/scripts/statusline-command.sh +124 -0
  29. package/docs/ideas/auto-model-selection.md +75 -0
  30. package/docs/ideas/improve-pi-system-prompt.md +34 -0
  31. package/docs/ideas/model-selector.md +40 -0
  32. package/docs/ideas/pi-task-memory.md +34 -0
  33. package/docs/ideas/qa-extension.md +43 -0
  34. package/docs/inspirations.md +33 -0
  35. package/docs/research/gas-city-research.md +256 -0
  36. package/docs/research/skill-design-research.md +286 -0
  37. package/docs/research/skill-improvements-analysis.md +117 -0
  38. package/docs/research/skill-patterns-research.md +24 -0
  39. package/docs/skills/skill-anatomy.md +149 -0
  40. package/docs/user-preferences.md +17 -0
  41. package/extensions/agent-modes/index.ts +507 -0
  42. package/extensions/auto-name.ts +107 -0
  43. package/extensions/context-loader.md +35 -0
  44. package/extensions/context-loader.ts +65 -0
  45. package/extensions/lib/tiny-model.ts +212 -0
  46. package/extensions/notify/index.ts +293 -0
  47. package/extensions/session-start.ts +44 -0
  48. package/extensions/skill-stats/README.md +74 -0
  49. package/extensions/skill-stats/context-loader.test.ts +107 -0
  50. package/extensions/skill-stats/discover.ts +119 -0
  51. package/extensions/skill-stats/format.ts +13 -0
  52. package/extensions/skill-stats/index.test.ts +452 -0
  53. package/extensions/skill-stats/index.ts +222 -0
  54. package/extensions/skill-stats/package.json +19 -0
  55. package/extensions/skill-stats/pnpm-lock.yaml +329 -0
  56. package/extensions/skill-stats/record.ts +48 -0
  57. package/extensions/skill-stats/store.ts +104 -0
  58. package/extensions/skill-stats/tsconfig.json +12 -0
  59. package/extensions/subagent/README.md +175 -0
  60. package/extensions/subagent/agents/planner.md +37 -0
  61. package/extensions/subagent/agents/reviewer.md +35 -0
  62. package/extensions/subagent/agents/scout.md +50 -0
  63. package/extensions/subagent/agents/worker.md +24 -0
  64. package/extensions/subagent/agents.ts +126 -0
  65. package/extensions/subagent/index.ts +1138 -0
  66. package/extensions/subagent/prompts/implement-and-review.md +10 -0
  67. package/extensions/subagent/prompts/implement.md +10 -0
  68. package/extensions/subagent/prompts/scout-and-plan.md +9 -0
  69. package/hooks.json +10 -0
  70. package/lib/cli.mjs +37 -0
  71. package/package.json +39 -0
  72. package/pi/keybindings.json +3 -0
  73. package/pi/settings.json +29 -0
  74. package/plugin.json +35 -0
  75. package/pnpm-workspace.yaml +7 -0
  76. package/scripts/build-claude-agents.mjs +179 -0
  77. package/scripts/install-instructions.sh +82 -0
  78. package/skills/engineering/design-an-interface/SKILL.md +94 -0
  79. package/skills/engineering/grill-with-docs/SKILL.md +88 -0
  80. package/skills/engineering/improve-codebase-architecture/REFERENCE.md +78 -0
  81. package/skills/engineering/improve-codebase-architecture/SKILL.md +81 -0
  82. package/skills/engineering/tdd/SKILL.md +150 -0
  83. package/skills/engineering/tdd/deep-modules.md +33 -0
  84. package/skills/engineering/tdd/interface-design.md +31 -0
  85. package/skills/engineering/tdd/mocking.md +59 -0
  86. package/skills/engineering/tdd/refactoring.md +10 -0
  87. package/skills/engineering/tdd/tests.md +61 -0
  88. package/skills/engineering/technical-direction/SKILL.md +86 -0
  89. package/skills/planning/classify-bead/SKILL.md +67 -0
  90. package/skills/planning/create-task/SKILL.md +96 -0
  91. package/skills/planning/create-task/pipeline.json +33 -0
  92. package/skills/planning/create-task/scripts/create-chores.ts +112 -0
  93. package/skills/planning/create-task/scripts/package.json +14 -0
  94. package/skills/planning/create-task/scripts/pnpm-lock.yaml +342 -0
  95. package/skills/planning/create-task/scripts/tsconfig.json +12 -0
  96. package/skills/planning/create-task/templates/code.md +40 -0
  97. package/skills/planning/create-task/templates/document.md +40 -0
  98. package/skills/planning/create-task/templates/fix.md +27 -0
  99. package/skills/planning/create-task/templates/review.md +36 -0
  100. package/skills/planning/create-task/templates/verify.md +43 -0
  101. package/skills/planning/prd-to-tasks/SKILL.md +227 -0
  102. package/skills/planning/record-idea/SKILL.md +62 -0
  103. package/skills/planning/record-idea/scripts/new-idea.sh +89 -0
  104. package/skills/planning/request-refactor-plan/SKILL.md +73 -0
  105. package/skills/planning/write-a-prd/SKILL.md +74 -0
  106. package/skills/planning/write-a-ticket/SKILL.md +97 -0
  107. package/skills/productivity/bd-tool/SKILL.md +90 -0
  108. package/skills/productivity/grill-me/SKILL.md +10 -0
  109. package/skills/productivity/handoff/SKILL.md +15 -0
  110. package/skills/productivity/init-beads/SKILL.md +93 -0
  111. package/skills/productivity/teach/GLOSSARY-FORMAT.md +35 -0
  112. package/skills/productivity/teach/LEARNING-RECORD-FORMAT.md +46 -0
  113. package/skills/productivity/teach/MISSION-FORMAT.md +31 -0
  114. package/skills/productivity/teach/RESOURCES-FORMAT.md +32 -0
  115. package/skills/productivity/teach/SKILL.md +109 -0
  116. package/skills/productivity/validate-agent-dir/scripts/package.json +15 -0
  117. package/skills/productivity/validate-agent-dir/scripts/pnpm-lock.yaml +329 -0
  118. package/skills/productivity/validate-agent-dir/scripts/pnpm-workspace.yaml +2 -0
  119. package/skills/productivity/validate-agent-dir/scripts/tsconfig.json +19 -0
  120. package/skills/productivity/validate-agent-dir/scripts/validate-agent-dir.test.ts +317 -0
  121. package/skills/productivity/validate-agent-dir/scripts/validate-agent-dir.ts +127 -0
  122. package/skills/productivity/write-a-skill/SKILL.md +74 -0
  123. package/skills/review/maintain-agent-docs/REFERENCE.md +246 -0
  124. package/skills/review/maintain-agent-docs/SKILL.md +83 -0
  125. package/skills/review/refactor-skill/EXAMPLES.md +20 -0
  126. package/skills/review/refactor-skill/SKILL.md +148 -0
  127. package/skills/review/review-security/SKILL.md +107 -0
  128. package/skills/review/review-security/scripts/install-gitleaks.sh +43 -0
  129. package/skills/style/style-code/REFERENCE.md +38 -0
  130. package/skills/style/style-code/SKILL.md +113 -0
  131. package/skills/style/style-comms/SKILL.md +93 -0
  132. package/skills/style/style-documentation/SKILL.md +112 -0
  133. package/skills/style/style-tests/SKILL.md +97 -0
  134. package/skills/workflow/git-workflow/SKILL.md +85 -0
  135. package/skills/workflow/hitl-collab/SKILL.md +29 -0
  136. package/skills/workflow/plan/SKILL.md +272 -0
  137. package/skills/workflow/ralph/REFERENCE.md +202 -0
  138. package/skills/workflow/ralph/SKILL.md +105 -0
  139. package/skills/workflow/run-pipeline-stage/SKILL.md +151 -0
  140. package/skills/workflow/run-pipeline-stage/playbooks/code.md +17 -0
  141. package/skills/workflow/run-pipeline-stage/playbooks/document.md +18 -0
  142. package/skills/workflow/run-pipeline-stage/playbooks/fix.md +17 -0
  143. package/skills/workflow/run-pipeline-stage/playbooks/review.md +19 -0
  144. package/skills/workflow/run-pipeline-stage/playbooks/verify.md +14 -0
  145. package/skills/workflow/run-pipeline-stage/prompts/stage-runner.md +20 -0
  146. package/skills/workflow/run-pipeline-stage/scripts/generate-progress.test.ts +783 -0
  147. package/skills/workflow/run-pipeline-stage/scripts/generate-progress.ts +586 -0
  148. package/skills/workflow/run-pipeline-stage/scripts/package.json +15 -0
  149. package/skills/workflow/run-pipeline-stage/scripts/pnpm-lock.yaml +342 -0
  150. package/skills/workflow/run-pipeline-stage/scripts/pnpm-workspace.yaml +2 -0
  151. package/skills/workflow/run-pipeline-stage/scripts/tsconfig.json +12 -0
  152. package/skills/workflow/using-agent-skills/SKILL.md +109 -0
  153. package/skills/workflow/using-agent-skills/scripts/validate-skill-structure.test.ts +73 -0
  154. package/test/cli.test.mjs +149 -0
@@ -0,0 +1,27 @@
1
+ ## Project context
2
+ <bd prime output — verbatim>
3
+
4
+ ## Task
5
+ <bd show <id> output — verbatim>
6
+
7
+ ## Files to update
8
+ <FILES_CHANGED from the previous coder/fixer's REPORT>
9
+
10
+ ## Progress log
11
+ Write progress to: `.agent-cortex/ralph/ralph-<bead-id>.log`
12
+ Log stage start, test results, build errors, and stage complete (see Progress Logging in run-pipeline-stage skill).
13
+
14
+ ## Instructions
15
+ Invoke the `style-code` skill before making any code changes.
16
+
17
+ Apply only the changes described in the Task section above. Do not make any other modifications.
18
+
19
+ **Use context7** when working with any third-party library — fetch live docs to ensure you use the correct, up-to-date API for the version in this project.
20
+
21
+ End your response with a ---REPORT--- block:
22
+ ---REPORT---
23
+ BEAD_ID: <id>
24
+ STAGE_COMPLETED: fixing
25
+ SUMMARY: <2–3 sentence summary of what was changed>
26
+ FILES_CHANGED: <comma-separated list, or "none">
27
+ ---
@@ -0,0 +1,36 @@
1
+ ## Project context
2
+ <bd prime output — verbatim>
3
+
4
+ ## Task
5
+ <bead description — verbatim>
6
+
7
+ ## What was implemented
8
+ <SUMMARY from the coder/fixer's REPORT block>
9
+
10
+ ## Files changed
11
+ <FILES_CHANGED from the coder/fixer's REPORT block>
12
+
13
+ ## Progress log
14
+ Write progress to: `.agent-cortex/ralph/ralph-<bead-id>.log`
15
+ Log stage start, security scan result, review outcome, and stage complete (see Progress Logging in run-pipeline-stage skill).
16
+
17
+ ## Instructions
18
+ **First**, invoke the `review-security` skill and run the scan against the changes. If the
19
+ verdict is FAIL, set `REVIEW_OUTCOME: CHANGES_REQUESTED` immediately and list each finding
20
+ as a required change — do not proceed with the quality review.
21
+
22
+ **Then**, review the implementation for correctness, quality, and alignment with the task
23
+ description and project conventions. Only flag genuine correctness issues or clear deviations
24
+ from stated requirements — not stylistic preferences.
25
+
26
+ End your response with a ---REPORT--- block:
27
+ ---REPORT---
28
+ BEAD_ID: <id>
29
+ STAGE_COMPLETED: reviewing
30
+ SUMMARY: <2–3 sentence summary of what you reviewed>
31
+ FILES_CHANGED: none
32
+ REVIEW_OUTCOME: <APPROVED|CHANGES_REQUESTED>
33
+ CHANGES_REQUESTED: ← include only if REVIEW_OUTCOME is CHANGES_REQUESTED
34
+ 1. <required change>
35
+ 2. <required change>
36
+ ---
@@ -0,0 +1,43 @@
1
+ ## Project context
2
+ <bd prime output — verbatim>
3
+
4
+ ## Task
5
+ <bead description — verbatim>
6
+
7
+ ## What was implemented
8
+ <SUMMARY from the coder/fixer's REPORT block>
9
+
10
+ ## Files changed
11
+ <FILES_CHANGED from the coder/fixer's REPORT block>
12
+
13
+ ## Progress log
14
+ Write progress to: `.agent-cortex/ralph/ralph-<bead-id>.log`
15
+ Log stage start, each command run, test/lint result, and stage complete (see Progress Logging in run-pipeline-stage skill).
16
+
17
+ ## Instructions
18
+ Discover and run the project's test and lint commands, then report the outcome.
19
+
20
+ **Step 1 — Discover commands** (check in this order, stop at the first match):
21
+ 1. `package.json` `scripts` — look for keys named `test`, `lint`, `check`, `typecheck`, or similar.
22
+ 2. `Makefile` — look for targets named `test`, `lint`, `check`.
23
+ 3. Other well-known config files (e.g. `pyproject.toml`, `Cargo.toml`) — look for test/lint targets.
24
+ 4. If no commands are found, report PASS with summary "No test or lint commands found".
25
+
26
+ **Step 2 — Run each discovered command** in the project root. Capture stdout and stderr.
27
+
28
+ **Step 3 — Evaluate**:
29
+ - If all commands exit 0: `VERIFY_OUTCOME: PASS`.
30
+ - If any command exits non-zero: `VERIFY_OUTCOME: FAIL`. List each failure concisely.
31
+
32
+ Do not fix failures — report them only.
33
+
34
+ End your response with a ---REPORT--- block:
35
+ ---REPORT---
36
+ BEAD_ID: <id>
37
+ STAGE_COMPLETED: verifying
38
+ SUMMARY: <what commands were run and overall outcome>
39
+ FILES_CHANGED: none
40
+ VERIFY_OUTCOME: <PASS|FAIL>
41
+ VERIFY_FAILURES: ← only if VERIFY_OUTCOME is FAIL
42
+ - <test/lint failure summary>
43
+ ---
@@ -0,0 +1,227 @@
1
+ ---
2
+ name: prd-to-tasks
3
+ description: Break a PRD into phased epics and task beads using tracer-bullet vertical slices. Use when a PRD is approved and you need to create the executable backlog, or when ralph-plan encounters a large workstream.
4
+ argument-hint: "Break down <PRD or epic description> into epics and tasks"
5
+ ---
6
+
7
+ # PRD to Tasks
8
+
9
+ Take a PRD (or equivalent specification) and produce a complete set of epics and task beads,
10
+ ready for ralph to execute. The epic bead is the source of truth — no intermediate plan file.
11
+
12
+ Designed to be invoked by `ralph-plan` (when the input is a PRD or a large workstream) or
13
+ directly by a user who has a clear spec.
14
+
15
+ ## When to use
16
+
17
+ - A PRD has been written and approved — time to break it into executable chunks.
18
+ - `ralph-plan` receives a PRD as input (step 1) or encounters a large workstream (step 6).
19
+ - You have a well-understood feature and want to create the full bead tree in one pass.
20
+ - The user says "break this into tasks", "phase this PRD", "create epics from this spec".
21
+
22
+ ## When NOT to use
23
+
24
+ - The work is a single self-contained task — use `create-task` instead.
25
+ - The feature is not yet specified — use `write-a-prd` or the `strategy` agent first.
26
+ - You only need to record a raw idea — use `record-idea`.
27
+ - The task is a bug fix — file directly with `create-task`.
28
+
29
+ ## Philosophy / rationale
30
+
31
+ - **Epics are the source of truth.** The epic bead body contains the phase scope,
32
+ acceptance criteria, and dependencies. No intermediate plan file means no drift between
33
+ what was planned and what is tracked.
34
+ - **Tracer-bullet vertical slices.** Each task is a thin end-to-end path through all layers
35
+ (schema, API, logic, UI, tests). A completed task is demoable alone. Prefer many thin
36
+ slices over few thick ones.
37
+ - **One pass, complete output.** This skill produces the entire bead tree. The user or
38
+ ralph-plan reviews once at the end, not piecemeal through intermediaries.
39
+
40
+ ## Workflow
41
+
42
+ ### Phase 1 — Understand the PRD
43
+
44
+ 1. Confirm the PRD is in context (conversation, bead description, or file).
45
+ 2. If you haven't explored the relevant codebase area, do so now — understand current
46
+ architecture, existing patterns, and integration layers.
47
+ 3. Identify durable architectural decisions that will apply across all phases.
48
+ Examples:
49
+ - Route structures / URL patterns
50
+ - Database schema shape
51
+ - Key data models
52
+ - Authentication / authorisation approach
53
+ - Third-party service boundaries
54
+ Add others relevant to the project — the goal is a shared skeleton every phase
55
+ can reference.
56
+ 4. Record these in a holding note — they inform every phase.
57
+
58
+ ### Phase 2 — Draft the phase breakdown
59
+
60
+ 5. Break the PRD into phases. Each phase is a **tracer-bullet vertical slice**:
61
+ - Thin but complete path through ALL integration layers.
62
+ - Demoable or verifiable on its own.
63
+ - Covers a specific set of user stories from the PRD.
64
+
65
+ 6. For each phase, define:
66
+ - **Title**: short descriptive name.
67
+ - **User stories covered**: which PRD stories this phase addresses.
68
+ - **What to build**: end-to-end behaviour description (not layer-by-layer).
69
+ - **Acceptance criteria**: verifiable outcomes.
70
+
71
+ 7. Present the proposed phases to the user. Ask:
72
+ - Does the granularity feel right?
73
+ - Should any phases be merged or split?
74
+ - Are the dependency relationships correct — can any run in parallel?
75
+
76
+ 8. Iterate until the user approves the breakdown.
77
+
78
+ ### Phase 3 — Create epics (one per phase)
79
+
80
+ 9. Create epics in dependency order (blockers first) so you can reference real bead IDs.
81
+
82
+ ```bash
83
+ bd create "<Phase Title>" --type epic \
84
+ --description "<epic body from template below>"
85
+ ```
86
+
87
+ 10. Tag each epic with a priority:
88
+ ```bash
89
+ bd tag <epic-id> priority:p3 # default for feature work; adjust if P4/P5
90
+ ```
91
+ If running in the context of ralph-plan or ralph, also tag with:
92
+ ```bash
93
+ bd tag <epic-id> workflow:ralph
94
+ ```
95
+
96
+ ### Phase 4 — Create tasks within each epic
97
+
98
+ 11. For each epic, break it into task-sized vertical slices. Each task is independently
99
+ grabbable — a single agent (or person) can pick it up and complete it.
100
+
101
+ 12. For each task, invoke `create-task`:
102
+ ```bash
103
+ # create-task handles classification (AFK/HITL) and pipeline expansion
104
+ # Pass title, description (use template below), priority (inherit from epic or adjust),
105
+ # and parent epic ID
106
+ ```
107
+
108
+ 13. After all tasks are created, tag the parent epic with the aggregate classification:
109
+ - If **any** task is HITL, the epic is HITL:
110
+ ```bash
111
+ bd tag <epic-id> implementation-type:hitl
112
+ ```
113
+ - If **all** tasks are AFK:
114
+ ```bash
115
+ bd tag <epic-id> implementation-type:afk
116
+ ```
117
+
118
+ ### Phase 5 — Report
119
+
120
+ 14. Present the full bead tree:
121
+ ```
122
+ Epic: "Phase 1 Title" (#123)
123
+ ├── Task 1 (#124) — AFK
124
+ ├── Task 2 (#125) — HITL (visual review)
125
+ └── Task 3 (#126) — AFK
126
+ Epic: "Phase 2 Title" (#127)
127
+ ├── ...
128
+ ```
129
+
130
+ 15. If invoked by `ralph-plan`, signal completion so ralph-plan can proceed to the
131
+ agree-with-user step. If invoked directly by a user, summarise the bead tree and
132
+ confirm they're happy before finishing.
133
+
134
+ ## Epic body template
135
+
136
+ ```markdown
137
+ ## Source
138
+
139
+ PRD: <brief reference>
140
+
141
+ ## Summary
142
+
143
+ A concise description of this phase. Scope and goal, not implementation details.
144
+
145
+ ## What to build
146
+
147
+ End-to-end behaviour for this phase. What a demo would show.
148
+
149
+ ## Acceptance criteria
150
+
151
+ - [ ] Criterion 1
152
+ - [ ] Criterion 2
153
+
154
+ ## Blocked by
155
+
156
+ - Blocked by #<epic-id> (if any) — or "None — can start immediately"
157
+ ```
158
+
159
+ ## Task body template (passed to `create-task`)
160
+
161
+ ```markdown
162
+ ## Epic
163
+
164
+ #<epic-id> — <Epic Title>
165
+
166
+ ## What to build
167
+
168
+ This vertical slice: end-to-end behaviour, not layer-by-layer implementation.
169
+
170
+ ## Acceptance criteria
171
+
172
+ - [ ] Criterion 1
173
+ - [ ] Criterion 2
174
+
175
+ ## Blocked by
176
+
177
+ - Blocked by #<task-id> (if any) — or "None — can start immediately"
178
+ ```
179
+
180
+ ## Red Flags
181
+
182
+ - **Skipping the user quiz.** The phase breakdown needs human approval before creating
183
+ beads. Do not skip Phase 2 step 7-8.
184
+ - **Creating horizontal slices.** "All the database work first, then all the API work" is
185
+ not tracer bullets. Every task must deliver end-to-end value.
186
+ - **Fat tasks.** If a task would take a full agent session to implement, slice thinner.
187
+ A task should be a few RED-GREEN cycles, not a week of work.
188
+ - **Letting the plan file drift.** Epics are the SOT. Do not also write a plan file —
189
+ the epic bead body is the plan.
190
+
191
+ ## Common Rationalizations
192
+
193
+ | Rationalization | Rebuttal |
194
+ |---|---|
195
+ | "I'll create the epics now and the tasks later" | The user has approved the phases. Create everything in one pass — that's the point of this skill. |
196
+ | "I'll write a plan file first, then convert" | The epic bead IS the plan. Writing a separate file creates drift. |
197
+ | "This phase is too small for acceptance criteria" | If it's too small for criteria, merge it with another phase. Every deliverable needs a definition of done. |
198
+ | "I know what the tasks should be, I don't need to check with the user" | The phase breakdown needs approval. The epic-level approval implies task-level trust, but you still present the full tree in Phase 5. |
199
+
200
+ ## Cross-skill references
201
+
202
+ - **`create-task`** — invoked in Phase 4 for each task bead. Handles classification and
203
+ pipeline expansion.
204
+ - **`write-a-prd`** — use this first if the feature isn't specified yet.
205
+ - **`classify-bead`** — not needed; `create-task` handles classification internally.
206
+ - **`style-comms`** — invoke before Phase 2 if you need help writing clear phase
207
+ descriptions.
208
+
209
+ ## Phase-gate checklist
210
+
211
+ - [ ] Phase 1 (Understand): architectural decisions captured, codebase explored.
212
+ - [ ] Phase 2 (Breakdown): phases drafted and user-approved.
213
+ - [ ] Phase 3 (Epics): all epic beads created, tagged with `workflow:ralph` and
214
+ `priority:<p3|p4|p5>`.
215
+ - [ ] Phase 4 (Tasks): all task beads created via `create-task`, epic tagged with
216
+ aggregate `implementation-type`.
217
+ - [ ] Phase 5 (Report): full bead tree presented.
218
+
219
+ ## Verification checklist
220
+
221
+ - [ ] Every phase is a vertical slice (covers all layers), not a horizontal layer.
222
+ - [ ] Every task is independently grabbable (one agent can complete without others).
223
+ - [ ] All epics are tagged with `workflow:ralph` and a priority.
224
+ - [ ] All tasks are classified (AFK/HITL) via `create-task`.
225
+ - [ ] Parent epics have aggregate `implementation-type` tags.
226
+ - [ ] No intermediate plan file was created — epics are the SOT.
227
+ - [ ] Full bead tree was presented to the user (or to ralph-plan for step 7).
@@ -0,0 +1,62 @@
1
+ ---
2
+ name: record-idea
3
+ description: Capture early-stage ideas into a structured backlog record, including a high-level validity check before implementation planning. Use when the user shares a new idea that is not ready to build yet and wants it written to the ideas backlog.
4
+ ---
5
+
6
+ # Record Idea
7
+
8
+ Capture a not-ready idea into `docs/ideas` after a short, high-level interview that pressure-tests the concept.
9
+
10
+ ## Workflow
11
+
12
+ 1. **Interview at high level (one question at a time)**
13
+ - Why might it be useful? Who benefits and what improves?
14
+ - How might we do it? Sketch the rough approach — no implementation detail.
15
+ - When should we think about it? Are there triggers, dependencies, or timing signals?
16
+ - What priority does this feel like relative to current work?
17
+ 2. **Pressure-test briefly**
18
+ - Challenge weak points (scope, feasibility, opportunity cost).
19
+ - Keep discussion strategic; do not drift into implementation detail.
20
+ 3. **Choose record shape**
21
+ - **Simple idea**: `docs/ideas/<idea-name>.md`
22
+ - **Complex idea**: `docs/ideas/<idea-name>/<idea-name>.md` with optional supporting docs in the same folder.
23
+ 4. **Create the record file**
24
+ - Run:
25
+ ```bash
26
+ bash skills/record-idea/scripts/new-idea.sh --title "<idea title>" [--complex]
27
+ ```
28
+ 5. **Write the idea record**
29
+ - Fill the scaffold with concise content from the interview.
30
+ - Keep it decision-oriented and easy to scan later.
31
+
32
+ ## Idea Record Template
33
+
34
+ ```md
35
+ # Idea: <title>
36
+
37
+ ## Status
38
+ Backlog idea (not implementation-ready)
39
+
40
+ ## Why it might be useful
41
+ <Who benefits and what improves?>
42
+
43
+ ## How we might do it
44
+ <Rough approach — no implementation detail>
45
+
46
+ ## When to think about it
47
+ <Triggers, dependencies, or timing signals that would make this timely>
48
+
49
+ ## Priority
50
+ <Relative priority and reasoning>
51
+
52
+ ## Notes
53
+ <Anything worth keeping for future prioritisation/review>
54
+ ```
55
+
56
+ ## Output
57
+
58
+ Return:
59
+
60
+ 1. The file path created.
61
+ 2. A 2–3 sentence summary of the recorded idea.
62
+ 3. The suggested priority and when it might become timely.
@@ -0,0 +1,89 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ usage() {
5
+ echo "Usage: $0 --title <idea title> [--complex]"
6
+ exit 1
7
+ }
8
+
9
+ title=""
10
+ complex="false"
11
+
12
+ while [[ $# -gt 0 ]]; do
13
+ case "$1" in
14
+ --title)
15
+ shift
16
+ [[ $# -gt 0 ]] || usage
17
+ title="$1"
18
+ ;;
19
+ --complex)
20
+ complex="true"
21
+ ;;
22
+ *)
23
+ usage
24
+ ;;
25
+ esac
26
+ shift
27
+ done
28
+
29
+ [[ -n "$title" ]] || usage
30
+
31
+ slug="$(printf '%s' "$title" \
32
+ | tr '[:upper:]' '[:lower:]' \
33
+ | sed -E 's/[^a-z0-9]+/-/g; s/^-+//; s/-+$//')"
34
+
35
+ if [[ -z "$slug" ]]; then
36
+ echo "Error: title produced an empty slug after normalization." >&2
37
+ exit 1
38
+ fi
39
+
40
+ base_dir="docs/ideas"
41
+ if [[ "$complex" == "true" ]]; then
42
+ file_path="${base_dir}/${slug}/${slug}.md"
43
+ else
44
+ file_path="${base_dir}/${slug}.md"
45
+ fi
46
+
47
+ mkdir -p "$(dirname "$file_path")"
48
+
49
+ if [[ -e "$file_path" ]]; then
50
+ echo "Error: file already exists: $file_path" >&2
51
+ exit 1
52
+ fi
53
+
54
+ created_on="$(date -u +%Y-%m-%d)"
55
+
56
+ cat > "$file_path" <<EOF
57
+ # Idea: ${title}
58
+
59
+ ## Status
60
+ Backlog idea (not implementation-ready)
61
+
62
+ ## Created
63
+ ${created_on}
64
+
65
+ ## Problem
66
+ TODO
67
+
68
+ ## Who benefits
69
+ TODO
70
+
71
+ ## Proposed outcome
72
+ TODO
73
+
74
+ ## Validity check
75
+ - Evidence we already have: TODO
76
+ - Riskiest assumption: TODO
77
+ - What would invalidate this idea: TODO
78
+
79
+ ## Constraints
80
+ TODO
81
+
82
+ ## Next validation step
83
+ TODO
84
+
85
+ ## Notes
86
+ TODO
87
+ EOF
88
+
89
+ printf '%s\n' "$file_path"
@@ -0,0 +1,73 @@
1
+ ---
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.
4
+ ---
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.
7
+
8
+ 1. Ask the user for a long, detailed description of the problem they want to solve and any potential ideas for solutions.
9
+
10
+ 2. Explore the repo to verify their assertions and understand the current state of the codebase.
11
+
12
+ 3. Ask whether they have considered other options, and present other options to them.
13
+
14
+ 4. Interview the user about the implementation. Be extremely detailed and thorough.
15
+
16
+ 5. Hammer out the exact scope of the implementation. Work out what you plan to change and what you plan not to change.
17
+
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
+ - **title**: a concise name for the refactor
24
+ - **description**: the refactor plan formatted using the template below
25
+ - **priority**: P2
26
+
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.
38
+
39
+ ## Commits
40
+
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.
42
+
43
+ ## Decision Document
44
+
45
+ A list of implementation decisions that were made. This can include:
46
+
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
54
+
55
+ Do NOT include specific file paths or code snippets. They may end up being outdated very quickly.
56
+
57
+ ## Testing Decisions
58
+
59
+ A list of testing decisions that were made. Include:
60
+
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)
64
+
65
+ ## Out of Scope
66
+
67
+ A description of the things that are out of scope for this refactor.
68
+
69
+ ## Further Notes (optional)
70
+
71
+ Any further notes about the refactor.
72
+
73
+ </refactor-plan-template>
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: write-a-prd
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
+ ---
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.
7
+
8
+ 1. Ask the user for a long, detailed description of the problem they want to solve and any potential ideas for solutions.
9
+
10
+ 2. Explore the repo to verify their assertions and understand the current state of the codebase.
11
+
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.
13
+
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.
15
+
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.
17
+
18
+ Check with the user that these modules match their expectations. Check with the user which modules they want tests written for.
19
+
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.
21
+
22
+ <prd-template>
23
+
24
+ ## Problem Statement
25
+
26
+ The problem that the user is facing, from the user's perspective.
27
+
28
+ ## Solution
29
+
30
+ The solution to the problem, from the user's perspective.
31
+
32
+ ## User Stories
33
+
34
+ A LONG, numbered list of user stories. Each user story should be in the format of:
35
+
36
+ 1. As an <actor>, I want a <feature>, so that <benefit>
37
+
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>
41
+
42
+ This list of user stories should be extremely extensive and cover all aspects of the feature.
43
+
44
+ ## Implementation Decisions
45
+
46
+ A list of implementation decisions that were made. This can include:
47
+
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
55
+
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>