@jaybeeuu/agent-cortex 2.1.0 → 2.3.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 (181) hide show
  1. package/CHANGELOG.md +411 -0
  2. package/README.md +33 -13
  3. package/agents/README.md +22 -10
  4. package/agents/plan/agent.md +2 -2
  5. package/agents/ralph/agent.md +126 -88
  6. package/agents/ralph/claude/frontmatter.json +3 -3
  7. package/agents/ralph/claude/wake.md +46 -0
  8. package/agents/ralph/pi/{polling.md → wake.md} +35 -20
  9. package/agents/ralph-plan/agent.md +23 -11
  10. package/bin/agent-cortex.mjs +66 -4
  11. package/bin/installers/claude.mjs +182 -68
  12. package/bin/installers/pi.mjs +200 -24
  13. package/extensions/agent-guardrails/README.md +1 -1
  14. package/extensions/agent-guardrails/guardrails.ts +1 -1
  15. package/extensions/agent-guardrails/index.ts +1 -1
  16. package/extensions/agent-modes/discover.test.ts +2 -2
  17. package/extensions/output-style/README.md +1 -1
  18. package/extensions/output-style/index.ts +2 -2
  19. package/extensions/output-style/output-style.ts +2 -2
  20. package/hooks/claude/scripts/notify.mjs +8 -1
  21. package/lib/cli.mjs +91 -2
  22. package/package.json +27 -3
  23. package/scripts/check-changeset.mjs +4 -0
  24. package/scripts/check-no-sync.mjs +5 -1
  25. package/scripts/lib/compose-agent.mjs +69 -9
  26. package/scripts/lib/fs.mjs +10 -2
  27. package/scripts/lib/migrate.mjs +736 -0
  28. package/scripts/lib/release-gates.mjs +21 -1
  29. package/scripts/lib/skill-frontmatter.mjs +23 -6
  30. package/scripts/lib/skill-links.mjs +52 -0
  31. package/scripts/lib/verify-worker-tree.mjs +25 -0
  32. package/scripts/resolve-publish-command.mjs +4 -0
  33. package/skills/engineering/design-an-interface/SKILL.md +3 -3
  34. package/skills/engineering/grill-with-docs/SKILL.md +3 -5
  35. package/skills/engineering/improve-codebase-architecture/SKILL.md +5 -4
  36. package/skills/engineering/tdd/SKILL.md +5 -7
  37. package/skills/engineering/technical-direction/SKILL.md +5 -5
  38. package/skills/planning/classify-bead/REFERENCE.md +3 -3
  39. package/skills/planning/classify-bead/SKILL.md +14 -9
  40. package/skills/planning/classify-bead/scripts/classify-bead.mjs +5 -4
  41. package/skills/planning/create-task/REFERENCE.md +52 -3
  42. package/skills/planning/create-task/SKILL.md +70 -26
  43. package/skills/planning/create-task/scripts/{create-chores.ts → create-chores.mjs} +48 -23
  44. package/skills/planning/flesh-out-idea/REFERENCE.md +116 -0
  45. package/skills/planning/flesh-out-idea/SKILL.md +146 -0
  46. package/skills/planning/prd-to-tasks/REFERENCE.md +54 -5
  47. package/skills/planning/prd-to-tasks/SKILL.md +22 -16
  48. package/skills/planning/record-idea/FORMAT.md +66 -17
  49. package/skills/planning/record-idea/SKILL.md +48 -24
  50. package/skills/planning/request-refactor-plan/SKILL.md +4 -4
  51. package/skills/planning/spec-to-tickets/SKILL.md +5 -5
  52. package/skills/planning/write-a-prd/SKILL.md +8 -9
  53. package/skills/planning/write-a-ticket/SKILL.md +4 -6
  54. package/skills/productivity/bd-tool/SKILL.md +15 -10
  55. package/skills/productivity/grill-me/SKILL.md +5 -0
  56. package/skills/productivity/init-beads/SKILL.md +3 -3
  57. package/skills/productivity/migration/REFERENCE.md +227 -0
  58. package/skills/productivity/migration/SKILL.md +188 -0
  59. package/skills/productivity/validate-agent-dir/scripts/{validate-agent-dir.ts → validate-agent-dir.mjs} +49 -28
  60. package/skills/productivity/write-a-skill/SKILL.md +5 -5
  61. package/skills/review/maintain-agent-docs/SKILL.md +5 -7
  62. package/skills/review/refactor-skill/SKILL.md +4 -3
  63. package/skills/review/review-security/SKILL.md +3 -5
  64. package/skills/style/style-code/SKILL.md +5 -10
  65. package/skills/style/style-comms/SKILL.md +5 -7
  66. package/skills/style/style-documentation/SKILL.md +5 -6
  67. package/skills/style/style-tests/SKILL.md +5 -7
  68. package/skills/workflow/git-workflow/SKILL.md +52 -26
  69. package/skills/workflow/hitl-collab/SKILL.md +4 -6
  70. package/skills/workflow/plan/SKILL.md +41 -30
  71. package/skills/workflow/ralph/REFERENCE.md +182 -51
  72. package/skills/workflow/ralph/SKILL.md +89 -50
  73. package/skills/workflow/run-pipeline-stage/SKILL.md +72 -71
  74. package/skills/workflow/run-pipeline-stage/playbooks/code.md +11 -0
  75. package/skills/workflow/run-pipeline-stage/playbooks/document.md +12 -0
  76. package/skills/workflow/run-pipeline-stage/playbooks/fix.md +12 -0
  77. package/skills/workflow/run-pipeline-stage/playbooks/review.md +11 -0
  78. package/skills/workflow/run-pipeline-stage/playbooks/verify.md +13 -0
  79. package/skills/workflow/run-pipeline-stage/prompts/stage-runner.md +73 -1
  80. package/token-map.README.md +9 -4
  81. package/token-map.json +13 -6
  82. package/.agents/skills/style-versioning/SKILL.md +0 -172
  83. package/.changeset/README.md +0 -8
  84. package/.changeset/config.json +0 -11
  85. package/.github/workflows/ci.yml +0 -302
  86. package/.junie/guidelines.md +0 -87
  87. package/.junie/mcp/mcp.json +0 -10
  88. package/AGENTS.md +0 -153
  89. package/agents/ralph/claude/polling.md +0 -31
  90. package/agents-native/ralph.md +0 -203
  91. package/docs/claude-hooks.md +0 -144
  92. package/docs/commit-signing.md +0 -231
  93. package/docs/ideas/auto-model-selection.md +0 -75
  94. package/docs/ideas/ban-content-assertion-tests.md +0 -75
  95. package/docs/ideas/bead-progress-notes-for-session-resumption.md +0 -75
  96. package/docs/ideas/classify-beads-via-deterministic-script-with-agent-fallback.md +0 -70
  97. package/docs/ideas/ctx-alias-version-and-update-commands.md +0 -65
  98. package/docs/ideas/ctx-feedback-command-for-capturing-ideas-from-any-machine.md +0 -67
  99. package/docs/ideas/dedicated-review-tests-skill.md +0 -71
  100. package/docs/ideas/deployment-beads-for-post-merge-pipelines.md +0 -36
  101. package/docs/ideas/design-and-delivery-as-separate-bead-trees/design-and-delivery-as-separate-bead-trees.md +0 -99
  102. package/docs/ideas/enable-signed-commit-enforcement-changesets-bot-commits-must-be-signed.md +0 -42
  103. package/docs/ideas/extension-manifests.md +0 -121
  104. package/docs/ideas/improve-pi-system-prompt.md +0 -43
  105. package/docs/ideas/map-every-cortex-tool-to-a-real-pi-equivalent.md +0 -95
  106. package/docs/ideas/model-selector.md +0 -40
  107. package/docs/ideas/pi-task-memory.md +0 -34
  108. package/docs/ideas/qa-extension.md +0 -43
  109. package/docs/ideas/record-idea-implementation-questions.md +0 -68
  110. package/docs/ideas/record-ideas-as-beads.md +0 -115
  111. package/docs/ideas/self-flushing-session.md +0 -72
  112. package/docs/ideas/state-in-beads-not-md.md +0 -69
  113. package/docs/ideas/subagent-visibility.md +0 -72
  114. package/docs/ideas/task-session-context.local.md +0 -95
  115. package/docs/ideas/task-session-context.md +0 -89
  116. package/docs/ideas/test-data-creation-helpers.md +0 -92
  117. package/docs/ideas/test-planning-stage-bead-in-feature-planning.md +0 -68
  118. package/docs/ideas/unified-ci-pipeline.md +0 -28
  119. package/docs/ideas/unify-the-ticket-and-task-decomposition-workflows.md +0 -71
  120. package/docs/ideas/worktree-housekeeping-for-closed-beads.md +0 -39
  121. package/docs/inspirations.md +0 -33
  122. package/docs/research/disable-model-invocation.md +0 -82
  123. package/docs/research/gas-city-research.md +0 -256
  124. package/docs/research/skill-design-research.md +0 -286
  125. package/docs/research/skill-improvements-analysis.md +0 -117
  126. package/docs/research/skill-patterns-research.md +0 -24
  127. package/docs/skills/skill-anatomy.md +0 -200
  128. package/docs/technical-direction/harness-config.md +0 -177
  129. package/docs/technical-direction/migration-execution-labels.md +0 -177
  130. package/docs/user-preferences.md +0 -17
  131. package/extensions/agent-guardrails/tsconfig.json +0 -12
  132. package/extensions/agent-modes/tsconfig.json +0 -12
  133. package/extensions/output-style/tsconfig.json +0 -12
  134. package/extensions/session-start/tsconfig.json +0 -12
  135. package/extensions/skill-stats/pnpm-lock.yaml +0 -329
  136. package/extensions/skill-stats/tsconfig.json +0 -12
  137. package/extensions/subagent/agents/planner.md +0 -37
  138. package/extensions/subagent/agents/reviewer.md +0 -35
  139. package/extensions/subagent/agents/scout.md +0 -50
  140. package/extensions/subagent/agents/worker.md +0 -24
  141. package/extensions/subagent/prompts/implement-and-review.md +0 -10
  142. package/extensions/subagent/prompts/implement.md +0 -10
  143. package/extensions/subagent/prompts/scout-and-plan.md +0 -9
  144. package/extensions/subagent/tsconfig.json +0 -12
  145. package/pi/keybindings.json +0 -3
  146. package/pi/settings.json +0 -34
  147. package/pnpm-workspace.yaml +0 -14
  148. package/skills/planning/create-task/scripts/package.json +0 -14
  149. package/skills/planning/create-task/scripts/pnpm-lock.yaml +0 -342
  150. package/skills/planning/create-task/scripts/tsconfig.json +0 -12
  151. package/skills/planning/record-idea/scripts/new-idea.sh +0 -89
  152. package/skills/productivity/validate-agent-dir/scripts/package.json +0 -15
  153. package/skills/productivity/validate-agent-dir/scripts/pnpm-lock.yaml +0 -329
  154. package/skills/productivity/validate-agent-dir/scripts/pnpm-workspace.yaml +0 -2
  155. package/skills/productivity/validate-agent-dir/scripts/tsconfig.json +0 -19
  156. package/skills/productivity/validate-agent-dir/scripts/validate-agent-dir.test.ts +0 -317
  157. package/skills/workflow/run-pipeline-stage/REFERENCE.md +0 -22
  158. package/skills/workflow/run-pipeline-stage/scripts/generate-progress.test.ts +0 -682
  159. package/skills/workflow/run-pipeline-stage/scripts/generate-progress.ts +0 -588
  160. package/skills/workflow/run-pipeline-stage/scripts/package.json +0 -15
  161. package/skills/workflow/run-pipeline-stage/scripts/pnpm-lock.yaml +0 -342
  162. package/skills/workflow/run-pipeline-stage/scripts/pnpm-workspace.yaml +0 -2
  163. package/skills/workflow/run-pipeline-stage/scripts/tsconfig.json +0 -12
  164. package/test/classify-bead.test.mjs +0 -277
  165. package/test/claude-installer.test.mjs +0 -308
  166. package/test/cli.test.mjs +0 -314
  167. package/test/create-chores.test.mjs +0 -85
  168. package/test/fake-bd.test.mjs +0 -72
  169. package/test/fs.test.mjs +0 -76
  170. package/test/helpers/fake-bd.mjs +0 -87
  171. package/test/helpers/fake-claude.mjs +0 -152
  172. package/test/helpers/fake-pi.mjs +0 -132
  173. package/test/installer.test.mjs +0 -806
  174. package/test/notify-hook.test.mjs +0 -63
  175. package/test/pending-gates.test.mjs +0 -147
  176. package/test/pi-installer.test.mjs +0 -785
  177. package/test/pi-register.test.mjs +0 -342
  178. package/test/pi-sweep.test.mjs +0 -619
  179. package/test/release-gates.test.mjs +0 -190
  180. package/test/skill-frontmatter.test.mjs +0 -137
  181. package/test/verify-worker-tree.test.mjs +0 -120
@@ -72,14 +72,12 @@ description: Sets tone, structure, and concision rules for written communication
72
72
  |---|---|
73
73
  | "This might potentially cause some issues that we could look at." | "This approach causes two problems: increased latency and a single point of failure." |
74
74
 
75
- ## Cross-skill references
75
+ ## See Also
76
76
 
77
- | When you need… | Use this skill |
78
- |---|---|
79
- | A document template with section structure | `write-a-ticket`, `write-a-prd`, `write-a-skill` |
80
- | Guidance on what and whether to document | `style-documentation` |
81
- | Coding style and conventions | `style-code` |
82
- | Test writing style | `style-tests` |
77
+ - [style-documentation](../style-documentation/SKILL.md) — what and whether to document, decided before the prose choices here.
78
+ - [write-a-prd](../../planning/write-a-prd/SKILL.md) — the section structure for a requirements document.
79
+ - [write-a-ticket](../../planning/write-a-ticket/SKILL.md) — the section structure for an external ticket.
80
+ - [write-a-skill](../../productivity/write-a-skill/SKILL.md) — the section structure for a SKILL.md.
83
81
 
84
82
  ## Verification checklist
85
83
 
@@ -70,13 +70,12 @@ description: Defines what to document, what to skip, and how to structure docume
70
70
  | "This is obvious from the code" | Then do not write it. The code is the documentation — let it do the work. |
71
71
  | "This doc is harmless even if it drifts" | Drift is not harmless — it erodes trust. Every stale sentence makes the reader wonder what else is wrong. Prune or update instead. |
72
72
 
73
- ## Cross-skill references
73
+ ## See Also
74
74
 
75
- | When you need… | Use this skill |
76
- |---|---|
77
- | Tone, structure, and concision for writing | `style-comms` |
78
- | Code-level conventions and inline comments | `style-code` |
79
- | Secrets and credential scanning before committing | `review-security` |
75
+ - [maintain-agent-docs](../../review/maintain-agent-docs/SKILL.md) — load when auditing existing docs for drift rather than writing new pages.
76
+ - [style-comms](../style-comms/SKILL.md) — tone, structure, and concision for the prose itself.
77
+ - [style-code](../style-code/SKILL.md) — code-level conventions, including doc comments and examples.
78
+ - [review-security](../../review/review-security/SKILL.md) — run before committing, so examples stay secret-free.
80
79
 
81
80
  ## Examples
82
81
 
@@ -106,14 +106,12 @@ Worked examples for each rule are in `EXAMPLES.md` under _Test data_.
106
106
  | "A shared fixture saves setup time" | It couples tests and hides which value drives the case. Build data fresh per test. |
107
107
  | "Asserting every field is more thorough" | It makes the test break for reasons the case does not care about. Assert the fields that prove the behaviour. |
108
108
 
109
- ## Cross-skill references
109
+ ## See Also
110
110
 
111
- | When you need… | Use this skill |
112
- |---|---|
113
- | Red-green-refactor development loop | `tdd` |
114
- | Code-level style and conventions | `style-code` |
115
- | Plan test rows that gate implementation | `plan` |
116
- | Secrets and credential scanning | `review-security` |
111
+ - [tdd](../../engineering/tdd/SKILL.md) — the red-green loop these conventions serve; load it for slicing and cycle discipline.
112
+ - [style-code](../style-code/SKILL.md) — naming and module-boundary rules for the code under test.
113
+ - [plan](../../workflow/plan/SKILL.md) — load when test rows should gate implementation planning rather than code.
114
+ - [review-security](../../review/review-security/SKILL.md) — run before committing, when fixtures risk carrying real credentials.
117
115
 
118
116
  ## Examples
119
117
 
@@ -46,7 +46,31 @@ working on the same thing, use a shared branch and workspace instead.
46
46
  not spin up a separate worktree — work in the same checkout so you both see
47
47
  the same state.
48
48
 
49
- ### 3. Pull requests for review
49
+ ### 3. Never stack branches — put the dependency in the tracker
50
+
51
+ Every branch is based on the **integration branch**: `main`, or `epic/<id>` for
52
+ multi-feature work. Never base one feature branch on another.
53
+
54
+ ```
55
+ ❌ git worktree add ../b -b feature/b feature/a # b silently carries a
56
+ ✅ git worktree add ../b -b feature/b origin/main
57
+ ```
58
+
59
+ If `b` needs `a`, that is a **dependency**, not a branch. Record it in the
60
+ tracker — `bd dep add <b> <a>` ("b depends on a") — and let the tracker keep `b`
61
+ out of the ready queue until `a` merges and closes. Then branch `b` from the
62
+ integration branch, which by then contains `a`.
63
+
64
+ Why: this repo squash-merges, so `feature/a`'s commits never become ancestors of
65
+ the integration branch. The moment `a` merges, `b` carries all of `a`'s content
66
+ as if it were new work, GitHub reports `CONFLICTING` on byte-identical files, and
67
+ the repair costs a `git rebase --onto <integration> <old-base>` plus a full
68
+ re-verification. Waiting for the merge is always cheaper.
69
+
70
+ Wanting to "get ahead" while a dependency is in review is the signal the
71
+ dependency is real — stop and check the tracker instead.
72
+
73
+ ### 4. Pull requests for review
50
74
 
51
75
  Every feature branch ends in a GitHub PR. Open the PR early (draft if unfinished) so the diff is visible.
52
76
 
@@ -55,7 +79,7 @@ gh pr create --title "..." --body "..."
55
79
  gh pr create --draft # early
56
80
  ```
57
81
 
58
- ### 4. Sync before branching
82
+ ### 5. Sync before branching
59
83
 
60
84
  Before creating a feature branch, sync with upstream:
61
85
 
@@ -66,41 +90,43 @@ git pull
66
90
 
67
91
  This avoids avoidable merge conflicts.
68
92
 
69
- ### 5. Bring a behind branch up to date — merge, don't rebase
93
+ ### 6. Bring a behind branch up to date — rebase, don't merge
70
94
 
71
- When the base branch moves and the PR reports `BEHIND` or `CONFLICTING`, update
72
- the branch before anything else:
95
+ When the base branch moves and the PR reports `BEHIND` or `CONFLICTING`, rebase
96
+ your branch onto its base branch before anything else — never merge the base in:
73
97
 
74
98
  ```bash
75
99
  git fetch origin
76
- git merge origin/main
100
+ git rebase origin/main # or epic/<id> for a feature branch inside an epic
101
+ git push --force-with-lease
77
102
  ```
78
103
 
79
- **Never rebase a branch that contains a merge commit.** `git rebase` drops merge
80
- commits and the patches they carry, so rebasing a branch that already merged the
81
- base silently reverts what that merge resolved — the conflict resolutions, and
82
- any fix from the base the merge brought in. The result usually looks like a
83
- regression in your own change. `--rebase-merges` preserves the structure, but
84
- it re-opens the same conflicts; only worth it when the branch's history is
85
- itself the deliverable.
104
+ A merge from the base drags every intervening commit into the review diff and,
105
+ under a squash-merge landing method, contributes nothing that reaches the base
106
+ branch. Landing is still a squash merge; rebasing only reshapes *your* branch
107
+ before it lands, so these are separate decisions, not rivals. Keeping the branch
108
+ linear is what makes the rebase safe: `git rebase` drops merge commits and the
109
+ patches they resolved, so never rebase a branch that already merged the base.
86
110
 
87
- Rebase only a **linear branch that has not been reviewed yet**. Rewriting
88
- commits under review discards the review context and invalidates approvals, and
89
- it requires `git push --force-with-lease` — never `--force`, which overwrites
90
- work you have not seen.
111
+ One exception: an **integration branch** that other branches are based on
112
+ (`main`, or an `epic/<id>` branch) is not yours to rewrite. Sync it by merging
113
+ the base in — under squash-merge that merge never reaches the landing diff, and
114
+ the branches based on it stay linear by rebasing onto it.
91
115
 
92
- Which one you owe the repository depends on its landing method, not on taste:
116
+ Rewritten commits are re-signed automatically when `commit.gpgsign` is set. Pass
117
+ no `--gpg-sign`, and do not set `rebase.gpgSign` — both are redundant.
93
118
 
94
- - **Squash merge**: the branch is collapsed on landing, so its shape never
95
- reaches the base branch. Merge the base in and move on — rebasing here is
96
- cosmetic, and the risky kind of cosmetic.
97
- - **Rebase-and-merge**: a linear branch is mandatory, so rebase *before* the
98
- first review. Once a merge has landed on the branch, that option is gone.
119
+ Scope: rebase only your **own unmerged feature branch**. Never rebase `main` or an
120
+ `epic/<id>` branch others are based on, and never rebase a branch another person
121
+ or agent is working on — it discards their context and invalidates review.
122
+ Force-push with `--force-with-lease`, never `--force`, which overwrites work you
123
+ have not seen. Rewriting a reviewed branch discards the review context and
124
+ invalidates approvals, so re-request review after a sync.
99
125
 
100
- After any update, re-run the checks. A merge that resolved conflicts by hand is
101
- not verified by the base branch's green CI.
126
+ After any update, re-run the checks: a conflict resolved by hand is not verified
127
+ by the base branch's green CI.
102
128
 
103
- ### 6. Worktree lifecycle
129
+ ### 7. Worktree lifecycle
104
130
 
105
131
  After the PR is merged or closed, clean up the worktree:
106
132
 
@@ -55,13 +55,11 @@ Use these sections in this order, adapting headings to the task:
55
55
 
56
56
  - **Docs are the durable artifact; bead updates are pointers.** The document outlives the session and the worktree, so the human gate always has a stable review surface. The bead carries only what routing needs — links and the doc path.
57
57
 
58
- ## Cross-skill references
58
+ ## See Also
59
59
 
60
- | When you need… | Use this skill |
61
- |---|---|
62
- | Tone, structure, and concision for the doc | `style-comms` |
63
- | Conversation compaction for another agent | `handoff` |
64
- | Bead discovery, queries, and state updates | `bd-tool` |
60
+ - [style-comms](../../style/style-comms/SKILL.md) — tone, structure, and concision for the handoff doc.
61
+ - [handoff](../../productivity/handoff/SKILL.md) — load when the reader is another agent rather than a human.
62
+ - [bd-tool](../../productivity/bd-tool/SKILL.md) — bead discovery, queries, and the state updates the doc links from.
65
63
 
66
64
  ## Examples
67
65
 
@@ -63,7 +63,7 @@ section content; surface assumptions and confirm them with the user.
63
63
 
64
64
  7. Create an epic bead from the approved PRD:
65
65
  ```bash
66
- bd create "<Feature Title> — PRD" --type epic \
66
+ bd create "<Feature Title> — PRD" --type epic -l execution:hitl \
67
67
  --description "<rendered PRD as markdown>" --priority p2 --validate
68
68
  bd tag <epic-id> workflow:plan
69
69
  bd lint <epic-id>
@@ -91,7 +91,7 @@ Take the approved PRD and produce a set of epics and tasks using tracer-bullet v
91
91
 
92
92
  10. If the work is small enough for a single epic (one phase, a few tasks), skip epics and proceed directly to Phase 3. A single epic with a few tasks dispatches through ralph more efficiently than creating unnecessary epic hierarchy. If the work has multiple distinct phases, create epics:
93
93
  ```bash
94
- bd create "<Phase Title>" --type epic \
94
+ bd create "<Phase Title>" --type epic -l execution:hitl \
95
95
  --description "<epic body with scope, success criteria, dependencies>" --priority <same as parent> --validate
96
96
  bd tag <epic-id> workflow:plan
97
97
  bd lint <epic-id>
@@ -119,19 +119,30 @@ For each task (within each epic), create a bead, classify it, and expand AFK tas
119
119
  ```bash
120
120
  # create-task handles: bead creation → classify → AFK: expand into pipeline stages → HITL: stop
121
121
  ```
122
- Pass the parent epic ID (if epics are used) so tasks are nested under their epic.
122
+ Pass the parent epic ID (if epics are used) so tasks are nested under their epic — `--parent`
123
+ records ownership. Work that needs sequencing instead of nesting gets `bd dep add`.
123
124
 
124
- 14. After all tasks in an epic are created, tag the parent epic with the aggregate classification:
125
- - If **any** task is HITL: `bd tag <epic-id> implementation-type:hitl`
126
- - If **all** tasks are AFK: `bd tag <epic-id> implementation-type:afk`
125
+ 14. When a task in the breakdown is really several deliverables, create it with the feature shape
126
+ rather than fattening it: a feature bead (`execution:hitl`) owning one planning bead
127
+ (`execution:hitl`, "Plan: <title>") that blocks one `execution:afk` impl child per deliverable.
128
+ `create-task` steps 5–6 run this sequence; the planning bead's description carries the
129
+ cold-start contract (what and why, decisions made, open questions, references).
127
130
 
128
- 15. Present the full bead tree to the user:
131
+ 15. Do not aggregate a child's execution class onto its parent. An epic or feature is a container
132
+ that a human owns, so it is `execution:hitl` in its own right; each task states its own
133
+ `execution:afk` or `execution:hitl`. Copying `execution:afk` upward because every child is AFK
134
+ labels a human-owned container as agent work.
135
+
136
+ 16. Present the full bead tree to the user:
129
137
  ```
130
- Epic: "Phase 1 Title" (#epic-abc)
138
+ Epic: "Phase 1 Title" (#epic-abc) — HITL
131
139
  ├── Task 1: "..." (#task-123) — AFK
132
140
  ├── Task 2: "..." (#task-456) — HITL (visual review)
133
- └── Task 3: "..." (#task-789) — AFK
134
- Epic: "Phase 2 Title" (#epic-def)
141
+ ├── Task 3: "..." (#task-789) — AFK
142
+ └── Feature 4: "..." (#feat-012) — HITL
143
+ ├── Plan: Feature 4 (#task-013) — HITL, blocks #task-014
144
+ └── Task 5 (#task-014) — AFK
145
+ Epic: "Phase 2 Title" (#epic-def) — HITL
135
146
  ├── ...
136
147
  ```
137
148
 
@@ -140,14 +151,15 @@ For each task (within each epic), create a bead, classify it, and expand AFK tas
140
151
  - [ ] All tasks created via `create-task`
141
152
  - [ ] All tasks classified (AFK or HITL)
142
153
  - [ ] AFK tasks expanded into pipeline-stage chore beads plus PR gate
143
- - [ ] Parent epics tagged with aggregate `implementation-type`
154
+ - [ ] Epics and features carry `execution:hitl`; no execution label aggregated from children
144
155
  - [ ] Full bead tree presented to the user
145
156
 
146
157
  ### Phase 4 — Prepare handoff to ralph
147
158
 
148
159
  Deliver a handoff bead and instructions for running ralph.
149
160
 
150
- 16. Determine the entry point:
161
+ 17. Determine the entry point:
162
+
151
163
  - **Single epic**: the epic ID is the handoff bead.
152
164
  - **Multiple independent epics**: create a parent meta-epic that groups them:
153
165
  ```bash
@@ -157,7 +169,7 @@ Deliver a handoff bead and instructions for running ralph.
157
169
  ## Success Criteria
158
170
 
159
171
  - [ ] All child epics complete and the feature verified end-to-end." \
160
- --priority <same> --validate
172
+ --priority <same> -l execution:hitl --validate
161
173
  bd lint <meta-epic>
162
174
  bd dep add <epic-1> <meta-epic> --type parent-child
163
175
  bd dep add <epic-2> <meta-epic> --type parent-child
@@ -165,17 +177,18 @@ Deliver a handoff bead and instructions for running ralph.
165
177
  The meta-epic ID is the handoff bead.
166
178
  - **Sequentially dependent epics**: the first unblocked epic is the handoff bead — ralph will discover the rest via `bd ready` as dependencies clear.
167
179
 
168
- 17. Tag the handoff bead for ralph's discovery:
180
+ 18. Tag the handoff bead for ralph's discovery:
169
181
  ```bash
170
182
  bd tag <handoff-id> workflow:ralph
171
183
  ```
172
184
 
173
- 18. Push the bead state:
185
+ 19. Push the bead state:
174
186
  ```bash
175
187
  bd dolt push
176
188
  ```
189
+ **Gate on the exit status.** Non-zero: retry once, then stop and report the command, exit code and stderr as a sync blocker — the handoff has not left this machine, so do not present the handoff summary.
177
190
 
178
- 19. Present the handoff summary:
191
+ 20. Present the handoff summary:
179
192
  ```
180
193
  ✅ Plan complete. Ready for ralph.
181
194
 
@@ -189,7 +202,7 @@ Deliver a handoff bead and instructions for running ralph.
189
202
 
190
203
  | Bead ID | Title | Type | Classification |
191
204
  |---------|-------|------|---------------|
192
- | #epic | Phase 1 | epic | AFK |
205
+ | #epic | Phase 1 | epic | HITL |
193
206
  | #task | Task 1 | task | AFK (4 chore beads + PR gate) |
194
207
  | #task | Task 2 | task | HITL |
195
208
  | ... | ... | ... | ... |
@@ -199,7 +212,7 @@ Deliver a handoff bead and instructions for running ralph.
199
212
 
200
213
  - [ ] Handoff bead identified and tagged `workflow:ralph`
201
214
  - [ ] Every handoff-path bead lints clean (`bd lint`)
202
- - [ ] Bead state pushed with `bd dolt push`
215
+ - [ ] Bead state pushed with `bd dolt push`, and the push exited 0 — a non-zero exit was retried once, then surfaced as a blocker (command, exit code, stderr) with no handoff summary presented
203
216
  - [ ] Handoff summary presented with the exact instruction to give an agent
204
217
 
205
218
  ## Phase-gate checklist
@@ -232,16 +245,13 @@ Deliver a handoff bead and instructions for running ralph.
232
245
  - **Planning and execution are separate concerns.** The plan skill works with the user to get the right scope and structure. Ralph then executes autonomously within that structure. Separating them means the user reviews once, not piecemeal.
233
246
  - **AFK by default.** Classify tasks as AFK unless a human is genuinely required. Agent capability grows over time — tasks that feel HITL today may be AFK tomorrow.
234
247
 
235
- ## Cross-skill references
248
+ ## See Also
236
249
 
237
- - `write-a-prd` — PRD template and interview workflow for Phase 1 (this skill incorporates the approach inline rather than delegating, to maintain a single coherent conversation).
238
- - `prd-to-tasks` — For the task breakdown step in Phase 2. If the PRD is already written and only decomposition is needed, use that skill directly.
239
- - `create-task` — Invoked in Phase 3 for each task. Handles bead creation, classification via `classify-bead`, and pipeline expansion for AFK tasks.
240
- - `classify-bead` — Invoked internally by `create-task`; not invoked directly by this skill.
241
- - `ralph` — The downstream skill that consumes the handoff bead. Run a separate agent with "Use the ralph skill. Start from bead #<handoff-id>."
242
- - `record-idea` — Use this instead if the idea is not ready for implementation planning.
243
- - `style-comms` — Invoke during Phase 1 if the user stories or implementation decisions need clearer writing.
244
- - `style-documentation` — Invoke during Phase 1 to align PRD documentation conventions with project standards.
250
+ - [write-a-prd](../../planning/write-a-prd/SKILL.md) — owns the PRD template and interview workflow that Phase 1 folds in.
251
+ - [prd-to-tasks](../../planning/prd-to-tasks/SKILL.md) — load when the PRD is already written and only decomposition is needed.
252
+ - [spec-to-tickets](../../planning/spec-to-tickets/SKILL.md) — load instead when the PRD must become external tickets rather than beads.
253
+ - [create-task](../../planning/create-task/SKILL.md) — Phase 3's per-task bead creation and pipeline expansion; it invokes `classify-bead` internally, so this skill never classifies directly.
254
+ - [ralph](../ralph/SKILL.md) — the downstream consumer of the handoff bead — hand off by running a separate agent with "Use the ralph skill. Start from bead #<handoff-id>".
245
255
 
246
256
  ## Examples
247
257
 
@@ -261,7 +271,7 @@ Full bead tree:
261
271
 
262
272
  | Bead ID | Title | Type | Classification |
263
273
  |---------|-------|------|---------------|
264
- | #epic-abc123 | Webhook Notification System — PRD | epic | AFK |
274
+ | #epic-abc123 | Webhook Notification System — PRD | epic | HITL |
265
275
  | #task-456 | Create webhook subscription schema + API | task | AFK (4 chore beads + PR gate) |
266
276
  | #task-789 | Implement event dispatch and retry logic | task | AFK (4 chore beads + PR gate) |
267
277
  | #task-012 | Build subscriber management UI | task | HITL (visual review) |
@@ -277,8 +287,9 @@ Full bead tree:
277
287
  - [ ] Task breakdown uses vertical slices (each task covers all layers — schema, API, logic, UI if applicable, tests)
278
288
  - [ ] Task breakdown approved by the user before moving to Phase 3
279
289
  - [ ] All tasks created via `create-task` (which handles classification, pipeline expansion, and PR gate creation)
280
- - [ ] Parent epics tagged with aggregate `implementation-type` (AFK if all children AFK, HITL if any child is HITL)
290
+ - [ ] Epics and features carry `execution:hitl`; every task states its own `execution:afk`/`execution:hitl`
291
+ - [ ] No execution label aggregated from children onto a parent
281
292
  - [ ] Full bead tree presented to the user before handoff
282
293
  - [ ] Handoff bead tagged `workflow:ralph`
283
- - [ ] Bead state pushed with `bd dolt push`
294
+ - [ ] Bead state pushed with `bd dolt push`, and the push exited 0 — a non-zero exit was retried once, then surfaced as a blocker (command, exit code, stderr) with no handoff summary presented
284
295
  - [ ] Handoff summary includes the exact instruction to give an agent