@gtrabanco/pi-agentic-workflow 0.13.3 → 0.14.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 (91) hide show
  1. package/README.md +3 -9
  2. package/dist/runtime.d.ts +45 -0
  3. package/dist/runtime.js +62 -0
  4. package/package.json +3 -2
  5. package/skills/audit-docs/SKILL.md +6 -5
  6. package/skills/audit-pr/SKILL.md +1 -1
  7. package/skills/audit-pr/references/PORTABILITY.md +1 -1
  8. package/skills/execute-phase/SKILL.md +207 -116
  9. package/skills/execute-phase/references/DESCOPE.md +22 -18
  10. package/skills/execute-phase/references/EXECUTION_CONTRACT.md +69 -77
  11. package/skills/execute-phase/references/FOLDING.md +34 -47
  12. package/skills/execute-phase/references/PREFLIGHT.md +103 -114
  13. package/skills/execute-phase/references/PRE_EXECUTION_GATE.md +53 -60
  14. package/skills/init-workspace/SKILL.md +35 -5
  15. package/skills/init-workspace/references/BOOTSTRAP_DISCOVERY.md +5 -5
  16. package/skills/init-workspace/references/BOOTSTRAP_WRITE.md +15 -8
  17. package/skills/init-workspace/references/PORTABILITY.md +1 -1
  18. package/skills/init-workspace/references/UPGRADE.md +17 -7
  19. package/skills/log-session/SKILL.md +4 -3
  20. package/skills/orchestration-envelope/references/TURN_CONTRACT.md +1 -1
  21. package/skills/pre-execution-review/references/LEDGERS.md +39 -39
  22. package/skills/pre-execution-review/references/POLICY.md +1 -0
  23. package/skills/review-change/SKILL.md +1 -1
  24. package/skills/review-change/references/PORTABILITY.md +1 -1
  25. package/skills/unit-lane/SKILL.md +154 -0
  26. package/skills/unit-lane/references/DESIGN.md +35 -0
  27. package/skills/unit-lane/references/DOCS.md +36 -0
  28. package/skills/unit-lane/references/EVIDENCE.md +34 -0
  29. package/skills/unit-lane/references/IMPLEMENT.md +45 -0
  30. package/skills/unit-lane/references/PLAN.md +38 -0
  31. package/skills/unit-lane/references/RELEASE.md +45 -0
  32. package/skills/unit-lane/references/RESEARCH.md +37 -0
  33. package/skills/unit-lane/references/REVIEW.md +45 -0
  34. package/skills/unit-lane/references/STEPS.md +23 -0
  35. package/skills/unit-lane/references/TESTS.md +32 -0
  36. package/skills/workflow-status/references/ENVELOPE_FIELDS.md +5 -6
  37. package/skills/workflow-status/references/SENSOR_CORE.md +16 -20
  38. package/skills/workflow-status/references/SENSOR_SIGNALS.md +5 -7
  39. package/skills/design-feature/SKILL.md +0 -231
  40. package/skills/design-feature/references/INTERVIEW.md +0 -74
  41. package/skills/design-feature/references/PORTABILITY.md +0 -15
  42. package/skills/design-feature/references/REPAIR.md +0 -88
  43. package/skills/design-feature/references/UPSERT_EXAMPLE.md +0 -8
  44. package/skills/design-feature/references/WRITE_AND_UPSERT.md +0 -115
  45. package/skills/evidence-grounding/SKILL.md +0 -174
  46. package/skills/evidence-grounding/references/DELEGATION.md +0 -131
  47. package/skills/evidence-grounding/references/READINESS.md +0 -130
  48. package/skills/evidence-grounding/references/ROWS.md +0 -93
  49. package/skills/execute-phase/references/BATCH_AND_PORTABILITY.md +0 -57
  50. package/skills/execute-phase/references/CLOSEOUT.md +0 -77
  51. package/skills/execute-phase/references/HANDOFF.md +0 -21
  52. package/skills/execute-phase/references/OPPORTUNISTIC_FINDING.md +0 -45
  53. package/skills/execute-phase/references/UNIT_LOOP.md +0 -88
  54. package/skills/execute-phase/references/WORKFLOWS_FEATURE.md +0 -37
  55. package/skills/execute-phase/references/WORKFLOWS_FIX.md +0 -43
  56. package/skills/execute-phase/references/WORKFLOWS_LEGACY.md +0 -26
  57. package/skills/execute-phase/references/WORKFLOWS_SMALL_PHASED.md +0 -38
  58. package/skills/generate-docs/SKILL.md +0 -145
  59. package/skills/generate-docs/references/ADAPTERS.md +0 -15
  60. package/skills/generate-docs/references/ADAPTER_DISCOVERY.md +0 -33
  61. package/skills/generate-docs/references/GENERATION_PROCESS.md +0 -90
  62. package/skills/implementation-discovery/SKILL.md +0 -209
  63. package/skills/plan-feature/SKILL.md +0 -208
  64. package/skills/plan-feature/references/ROUTING.md +0 -155
  65. package/skills/plan-feature-from-issue/SKILL.md +0 -162
  66. package/skills/plan-feature-scaffold/SKILL.md +0 -112
  67. package/skills/plan-feature-scaffold/references/SCAFFOLD_PROCESS.md +0 -122
  68. package/skills/plan-fix/SKILL.md +0 -161
  69. package/skills/plan-fix/references/PLANNING_PROCESS.md +0 -148
  70. package/skills/plan-fix/references/SPEC_CONTRACT.md +0 -22
  71. package/skills/planning-preflight/SKILL.md +0 -130
  72. package/skills/replan-findings/SKILL.md +0 -131
  73. package/skills/replan-findings/references/PHASE_APPEND.md +0 -89
  74. package/skills/review-plan/SKILL.md +0 -154
  75. package/skills/review-plan/references/CHECKS.md +0 -111
  76. package/skills/review-plan/references/ENG-CHECKS.md +0 -30
  77. package/skills/review-plan/references/OUTPUT.md +0 -166
  78. package/skills/review-spec/SKILL.md +0 -145
  79. package/skills/review-spec/references/CHECKS.md +0 -108
  80. package/skills/review-spec/references/OUTPUT.md +0 -160
  81. package/skills/ship-roadmap/SKILL.md +0 -120
  82. package/skills/ship-roadmap/references/ADVANCE.md +0 -117
  83. package/skills/ship-roadmap/references/AUDIT_AND_MERGE.md +0 -64
  84. package/skills/ship-roadmap/references/CLOSEOUT_AND_LOG.md +0 -27
  85. package/skills/ship-roadmap/references/FOUNDING.md +0 -101
  86. package/skills/ship-roadmap/references/GUARDRAILS.md +0 -56
  87. package/skills/ship-roadmap/references/MODEL_ROUTING.md +0 -16
  88. package/skills/ship-roadmap/references/PORTABILITY.md +0 -34
  89. package/skills/ship-roadmap/references/RECOVERY_AND_SELECTION.md +0 -94
  90. package/skills/ship-roadmap/references/STOP_CONDITIONS.md +0 -9
  91. package/skills/ship-roadmap/references/TERMINAL_REPORT.md +0 -34
@@ -1,208 +0,0 @@
1
- ---
2
- name: plan-feature
3
- user-invocable: true
4
- version: 5.3.1
5
- argument-hint: <NN-slug | #N> | --from-issue N | --scaffold <slug> | --next
6
- author: "Gabriel Trabanco <1969593+gtrabanco@users.noreply.github.com>"
7
- license: MIT
8
- description: >
9
- Route designed features or issues into engineering planning and roadmap
10
- registration; undesigned work stops at design-feature. Supports `--next`,
11
- `--from-issue`, and `--scaffold`. Triggers: "plan-feature", "plan a feature",
12
- "plan the next roadmap feature", "create SPEC and TASKS".
13
- ---
14
-
15
- # Plan Feature (router)
16
-
17
- The engineering-planning door for a feature whose product definition already
18
- exists. Routes to a focused internal step so only the work you need runs (no
19
- fat single skill). **Docs only — no code, no branch.** Product definition
20
- (raw-idea interview, capability closure) is `design-feature`'s job, not this
21
- one — the routed redirect gate enforces that split.
22
-
23
- ## Turn contract — verify before ending the turn
24
-
25
- ```
26
- ✓ The redirect gate ran FIRST, before any SPEC edit: undesigned input → STOP,
27
- print the fixed `/design-feature <slug>` block, do nothing else this turn
28
- ✓ Then the Product-review gate ran: no current `spec-review-pass` receipt bound to
29
- the recomputed snapshot → STOP with its fixed block and the `/review-spec`
30
- hand-off; a candidate/verification receipt, a Plan receipt, or readiness never counts
31
- ✓ Designed input only: engineering half filled, artifacts written, and the
32
- roadmap entry registered (number, order, deps verified)
33
- ✓ If `plan-feature-scaffold` ran this turn: the roadmap row was re-read
34
- AFTER the write and literally reads `planned` — a dropped `defined→planned`
35
- write fails this box; do not end the turn until it's fixed
36
- ✓ Planned, not reviewed: the ledgers are frozen, `stage: plan` readiness printed
37
- `READY-FOR-REVIEW`, and the turn hands off to `/review-plan` — this skill never
38
- reviews the plan it just wrote and never hands off to `/execute-phase` for a
39
- plan with no current Plan review receipt
40
- ✓ The dependency & blocker check was RUN and its result decides which closing block is printed
41
- ✓ An unmet dependency? The closing block lists the complete dependency chain, deepest first, joined with ` + `
42
- ✓ Artifact language: explicit user instruction > the project's declared docs language > English. The CONVERSATION language never decides — a Spanish prompt still produces English PRs/issues/commits/SPECs unless one of the first two says otherwise
43
- ✓ The closing `→ Next:` block is printed as the ABSOLUTE last output
44
- ```
45
-
46
- About to end the turn with any box unchecked? The turn is NOT done — complete
47
- the missing box first (weak models drop end-of-document duties; this list is
48
- first on purpose).
49
-
50
- ## Step 0 — Discover the project (always first)
51
-
52
- Per the agent guide's **Workflow conventions** + **documentation map**, then read
53
- what THIS skill needs: the **roadmap** (`docs/features/ROADMAP.md`), so routing
54
- and roadmap registration match the project's real layout.
55
-
56
- ## Progressive loading — route before planning
57
-
58
- The allowlist:
59
-
60
- 1. Every invocation: read [redirect gate and routing](references/ROUTING.md),
61
- apply the status gate, then the Product-review gate, and stop on its exact
62
- block when instructed.
63
- 2. Any route that can write planning artifacts: after the redirect gate permits
64
- routing, consume the [planning preflight](<../planning-preflight/SKILL.md>) —
65
- it owns the normalized repository-state read and the ONE final architectural
66
- classification — before composing an internal step.
67
- 3. Before composing an internal step: load the [phase contract](<../phase-contract/SKILL.md>)
68
- so every SPEC written this turn carries the canonical 8-box phase-lint and
69
- the normalized phase fingerprint.
70
- 4. Only when `node scripts/unit-route.mjs <NN>` prints `route: replan`: load the
71
- [replan contract](<../replan-findings/SKILL.md>); it owns the exemption.
72
-
73
- Do not load planning gates after a redirect stop. Both resources are normative,
74
- one hop from this file, and fail closed when missing.
75
-
76
- ## Process
77
-
78
- 1. **Redirect gate** from `ROUTING.md` — always first.
79
- 2. **Product-review gate** from the same resource — current `spec-review-pass`
80
- receipt bound to the recomputed snapshot, or STOP. No bypass flag.
81
- 3. **Route** from the same resource. For issue input, resolve and validate the issue
82
- identity only; after the [planning preflight](<../planning-preflight/SKILL.md>)
83
- confirms that planning may write, compose the from-issue internal to produce
84
- a **filled, sized SPEC product half**; that internal stops at the Product-review
85
- gate, so `plan-feature-scaffold` runs only once `review-spec` has passed the half:
86
- it fills the engineering half, scales the artifacts to the SPEC's size (XS/S →
87
- SPEC-only; M/L → full set) and registers the roadmap. The
88
- already-designed scoped path runs `plan-feature-scaffold` directly. Every
89
- path holds **one immutable planning context** — the roadmap snapshot taken
90
- before writing (and one issue payload when `--from-issue`) — reused across
91
- the internal steps; never re-fetched mid-plan.
92
- 4. **Confirm roadmap.** Verify the feature is registered in
93
- `docs/features/ROADMAP.md` with the right number, ordering, and dependencies;
94
- if any of the three is missing or wrong, fix the entry now — never leave registration for later.
95
- `plan-feature` verifies and repairs the roadmap entry; `plan-feature-scaffold`
96
- is the sole writer of the `defined → planned` write.
97
- 5. **Dependency & blocker check (always, before recommending execution).**
98
- - Walk the feature's `Depends on:` closure (transitively): every dependency
99
- must be `done` **and merged**. Any unmet → the closing block recommends
100
- building the deepest unmet dependency first, NOT this feature.
101
- - Check the fix index + open issues (forge CLI) for fix-now items touching
102
- the same modules this SPEC names. Any hit → the closing block recommends
103
- `/plan-fix <n>` before execution ("building on a known defect bakes it in").
104
- - Planning itself never blocks on either — the SPEC/artifacts are still
105
- written; only the **recommended next step** changes.
106
- 5. **Print the next step** per the check above (see Done when).
107
-
108
- ## Guardrails
109
-
110
- - Docs only — no code, no branch (that is `execute-phase`).
111
- - **Never plan an undesigned feature** — the redirect gate has no bypass flag,
112
- ever. Do not add one, even if asked; point at `/design-feature` instead.
113
- - **Never plan an unreviewed Product half** — this gate has no bypass flag either.
114
- Planning binds the reviewer's receipt; it may never write, widen, or "refresh"
115
- one, and a receipt bound to older bytes is stale, not close enough.
116
- - Don't re-ask what a flag, the issue, or the docs already settle.
117
- - Surface conflicts (numbering clashes, dependency cycles, scope overlap) before
118
- writing, not after.
119
- - Otherwise per the project's **Workflow conventions** (docs-language).
120
-
121
- ## Internal steps (not user-invocable)
122
-
123
- - `plan-feature-from-issue` — issue → scoped SPEC product half, `Closes #N`.
124
- - `plan-feature-scaffold` — SPEC → engineering half + full artifact set +
125
- roadmap entry.
126
-
127
- These run **within this same conversation** (that's what "composing" means) —
128
- on any agent, just follow their `SKILL.md` inline as the routed step. The
129
- raw-idea interview that used to be an internal step of this router is retired
130
- — see `docs/workflow/MIGRATION.md`; that logic now lives in `design-feature`,
131
- a user-facing skill in its own right (product definition is its own pipeline
132
- stage, not an internal routing detail of this one).
133
-
134
- ## Portability (agents other than Claude Code)
135
-
136
- The workflow is the contract; Claude Code features are conveniences. On an
137
- agent that lacks one, apply the fallback — never skip the step the feature
138
- enables:
139
-
140
- - **No slash-command menu** — where this skill says `/<skill>`, open that
141
- skill's `SKILL.md` (wherever your agent installed the skills) and follow it
142
- literally, in a fresh conversation: hand-offs assume a clean context. The
143
- internal steps above are the exception — they run inline, in this one.
144
- - **No per-skill `model:`/`effort:`** — on the `#claude` branch the frontmatter pins these tiers; here, pick tiers yourself:
145
- planning is judgment work — run it on your **strongest** model. The
146
- execution it hands off to may run cheaper.
147
-
148
- ## Relationship to other skills
149
-
150
- - **Redirects to** `design-feature` when the redirect gate stops on an
151
- undesigned feature — never composed in-turn (planning-class, ≥-tier hand-off).
152
- - **Redirects to** `review-spec` when the Product-review gate stops: designed is not
153
- reviewed. Its receipt is this skill's input, and `plan-feature-scaffold` binds it
154
- as the Plan snapshot's Product parent.
155
- - `triage-issue` routes here to promote an issue to a feature (still subject to
156
- the redirect gate if the promoted issue is undesigned).
157
- - `execute-phase` executes the phases afterward (`audit-docs` audits anytime).
158
-
159
- ## Done when
160
-
161
- - The redirect gate ran, and if it stopped, nothing else in this turn touched
162
- the SPEC.
163
- - Designed input only: a planned feature with its full artifact set exists and
164
- is roadmap-registered — **and the roadmap row was re-read after the write and
165
- literally reads `planned`** (never assumed from having run the write step).
166
- - The two planning ledgers were frozen with the Engineering half
167
- ([planning ledgers](<../../pre-execution-review/SKILL.md>)), the
168
- `stage: plan` readiness preflight printed `READY-FOR-REVIEW`, and the new
169
- `artifactRevisionId` is named in the hand-off. A planned unit is **not** an
170
- executable unit: this skill never reviews its own plan.
171
- - The dependency & blocker check ran, and **the closing `→ Next:` block matches
172
- its result** — clean:
173
-
174
- ```
175
- → Next: /review-plan <NN> — the plan is written; an independent context must
176
- review it before any phase is executed
177
- · the review returned PLAN-REVIEW-FAIL → this skill replans the batch, then re-reviews
178
- · adjust scope first → re-run /design-feature <slug> · audit the planning docs → /audit-docs
179
- ```
180
-
181
- already-planned feature (redirect gate stopped, never re-scaffolded):
182
-
183
- ```
184
- → Next: /execute-phase <NN> — this feature is already planned; execute every
185
- remaining phase, don't re-plan it.
186
- · explicit atomic mode → /execute-phase <NN> P1
187
- ```
188
-
189
- undesigned feature (redirect gate stopped):
190
-
191
- ```
192
- → Next: /design-feature <slug> — this feature has no completed product design yet
193
- (capability closure not done). Design it first; then re-run /plan-feature <slug>.
194
- ```
195
-
196
- designed but unreviewed/stale (Product-review gate stopped): the fixed
197
- `PRODUCT-REVIEW GATE … BLOCKED` block from `ROUTING.md`, closing with
198
- `/review-spec <NN>-<slug>`.
199
-
200
- unmet dependency and/or blocking fix-now issue:
201
-
202
- ```
203
- Dependency chain (deepest first): <deepest> + <dependency> + <NN> (replace with every actual member; never print `…`)
204
- → Next: /plan-feature <deepest-unmet-dep> (or /execute-phase <deepest-unmet-dep>) — build the
205
- complete dependency chain first: <deepest> + <dependency> + <NN>
206
- · blocking fix-now issue #<n> in the same area → /plan-fix <n> before executing
207
- · proceed anyway → /execute-phase <NN> --force (the gate logs the override)
208
- ```
@@ -1,155 +0,0 @@
1
- ## Redirect gate (always, before routing)
2
-
3
- Before any other step, resolve the target slug/issue. An issue input
4
- (`--from-issue <N>` or issue URL/number) resolves and validates the issue
5
- identity only; it does not invoke `plan-feature-from-issue` here. The parent
6
- must consume the [planning preflight](<../../planning-preflight/SKILL.md>) and
7
- confirm that planning may write before composing that internal writer. The
8
- internal step supplies the feature slug for the later roadmap gate.
9
-
10
- **Replan exemption — the router runs first.** Before the status gate, run
11
- `node scripts/unit-route.mjs <NN>`. A `route: replan` line means the unit
12
- carries an open finding whose frozen route is the plan owner: skip the STOP and
13
- load [the replan contract](<../../replan-findings/SKILL.md>) to re-cut the plan
14
- from the router's bounded read set. Any other route keeps the gate and the
15
- hand-off its line names; a router that cannot run is `BLOCKED`.
16
-
17
- For other inputs, read **the roadmap status** (`docs/features/ROADMAP.md` → the five-state machine
18
- `idea/defined/planned/in-progress/done`) — the **primary** gate signal. The
19
- SPEC's `## Design status` marker is the SPEC-local record and the
20
- **legacy-compat fallback** only (see step 6 below), never the primary check:
21
-
22
- 1. **Roadmap row status `defined`** → proceed to Routing below (the product
23
- half is designed; the engineering half still needs scaffolding).
24
- 2. **Roadmap row status `planned`** (SPEC + artifacts already present) →
25
- **STOP**. Never invoke `plan-feature-scaffold` — re-scaffolding an
26
- already-planned feature is the re-plan-loop bug this gate exists to close.
27
- Print exactly:
28
-
29
- ```
30
- → Next: /execute-phase <NN> — this feature is already planned; execute every
31
- remaining phase, don't re-plan it.
32
- · explicit atomic mode → /execute-phase <NN> P1
33
- ```
34
- 3. **Roadmap row status `in-progress`** → **STOP**. Print exactly:
35
-
36
- ```
37
- → Next: /execute-phase <NN> <next-phase> — this feature is already being
38
- implemented; resume the current phase, don't re-plan it.
39
- ```
40
- 4. **Roadmap row status `done`** → **STOP** (replanning stays forbidden — the
41
- feature is fully built), and: `done` means built + PR open with the human merge
42
- pending (a lifecycle label, never a gate verdict), so this is **not** "nothing
43
- pending". Route to the merge gate instead. Print exactly:
44
-
45
- ```
46
- → Next: /audit-pr <PR> — done means built + PR open, merge pending (a lifecycle label, never a gate verdict)
47
- · the row's PR is merged → nothing pending, pick the next unit → /plan-feature --next
48
- · no PR is open → the row is mislabeled or execution stopped → /execute-phase <NN> (never a replan)
49
- ```
50
- 5. **Roadmap row status `idea`, or no row at all** → **STOP**. Print exactly:
51
-
52
- ```
53
- → Next: /design-feature <slug> — this feature has no completed product design yet
54
- (capability closure not done). Design it first; then re-run /plan-feature <slug>.
55
- ```
56
-
57
- No bypass flag exists for this gate — an undesigned feature is never
58
- planned by this skill, under any flag or instruction.
59
- 6. **Legacy compat.** A roadmap row still reading a plain `planned` with no
60
- five-state history (predates this repo's roadmap-status-machine feature):
61
- fall back to the SPEC marker — `## Design status: designed` and Capability
62
- closure filled → treat as `defined`+`planned`, STOP per step 2 above (a
63
- legacy `planned` row is still already-planned — hand off to
64
- `/execute-phase`, never re-scaffold). Marker missing/`not designed`/closure
65
- empty → treat as `idea`, STOP per step 5. See `docs/workflow/MIGRATION.md`.
66
- 7. **A raw idea with no slug at all** (nothing to check) → the same STOP
67
- applies: print the block above pointing at `/design-feature "<idea>"`
68
- instead of a slug.
69
-
70
- ## Product-review gate (after the redirect gate, before Routing)
71
-
72
- The redirect gate proves the Product half was **designed**; this proves it was
73
- **independently reviewed** and unchanged since. Run it before any write on every
74
- planning route. Issue input has no slug yet: evaluate it on the slug
75
- `plan-feature-from-issue` produces, just before `plan-feature-scaffold` would run.
76
-
77
- 1. Read the newest `## Pre-execution review receipt v1 — spec` block in the unit's
78
- `progress.md`; none → fail closed.
79
- 2. Recompute the SPEC-stage snapshot from the bytes on disk now — exactly one
80
- artifact row (`kind: spec`, `selector: spec-product-v1`) plus the current
81
- `artifactRevisionId` — digested with the schema package's canonical entry (no
82
- package: record `validated: manual` and compare the stored digest line by line).
83
- 3. Accept only when all hold: contract `agentic-workflow/
84
- pre-execution-review-receipt@1`, `stage: spec`, verdict `spec-review-pass`,
85
- `snapshotDigest` equals step 2, zero open or unverified material findings,
86
- `contextClean: true`, and under `authorExclusion: enforced` reviewer ≠ author.
87
- 4. Refuse, never silently: **missing** · **stale** (digest or `artifactRevisionId`
88
- differs — any Product write, context change, or mutate-and-revert) ·
89
- **wrong-stage** (a `plan` receipt) · **substitute** (candidate `ReviewReceipt v1`
90
- or staged `VerificationReceipt v1`: different contracts, never interchangeable) ·
91
- **self-approved** (reused identity under enforced exclusion, or `contextClean:
92
- false`) · **author-readiness** (`READY-FOR-REVIEW` licenses a review request, it
93
- is not one).
94
-
95
- Fail closed — print exactly, then touch nothing else this turn:
96
-
97
- ```
98
- PRODUCT-REVIEW GATE — <NN>-<slug> BLOCKED (<missing|stale|wrong-stage|substitute|self-approved|author-readiness>)
99
- Expected: current spec-review-pass receipt bound to snapshot <digest>
100
- Actual: <receipt state>
101
-
102
- → Next: /review-spec <NN>-<slug> — the Product half needs a current independent
103
- review before engineering planning can start
104
- · a product choice is genuinely open → /design-feature <NN>-<slug> "<question>"
105
- · no bypass flag exists for this gate
106
- ```
107
-
108
- A stale receipt is never "refreshed" by editing the block — only a new review of a
109
- new snapshot produces one, and `--force` is not a `plan-feature` flag.
110
-
111
- ## Routing
112
-
113
- Once the gate passes, pick the mode — first match wins:
114
-
115
- 1. **Flag forces it** (skip detection): `--scaffold <slug>`, `--next`.
116
- 2. **Issue input** — `--from-issue <N>`, an issue URL, or a bare numeric argument
117
- `<N>` (for example, `131`) selects the issue-derived route; detection itself
118
- does not compose `plan-feature-from-issue`. The parent route owns the
119
- [planning preflight](<../../planning-preflight/SKILL.md>) consumption and must
120
- confirm that planning may write before it composes `plan-feature-from-issue`,
121
- then `plan-feature-scaffold`.
122
- 3. **Scoped** — an existing, designed roadmap slug or a filled `SPEC.md` →
123
- `plan-feature-scaffold`.
124
- 4. **`--next` / no input** — read the roadmap, take the next `defined` entry
125
- (the units that still need engineering planning — a `planned` row is
126
- already scaffolded); apply the redirect gate to it, then scaffold.
127
- 5. **Ambiguous** — ask one question, then route.
128
-
129
- ### Example (routing)
130
-
131
- | You run | Detected | Routes to | Then |
132
- |---|---|---|---|
133
- | `plan-feature 14-csv-export` (not designed) | undesigned slug | — | STOP → `/design-feature 14-csv-export` |
134
- | `plan-feature 14-csv-export` (designed, no current spec review) | unreviewed Product half | — | STOP → `/review-spec 14-csv-export` |
135
- | `plan-feature 131` | issue #131 | `plan-feature-from-issue` (stops at the Product-review gate) | `/review-spec` → re-run `plan-feature 131` |
136
- | `plan-feature 14-csv-export` (designed + reviewed) | designed slug | `plan-feature-scaffold` | `execute-phase 14 P1` |
137
- | `plan-feature 14-csv-export` (already `planned`) | already-planned slug | — | STOP → `/execute-phase 14 P1` (no re-scaffold) |
138
- | `plan-feature --next` | next `defined` roadmap entry | gate, then scaffold | `execute-phase NN P1` |
139
-
140
- ## Mode grammar (versioned — read by `scripts/normative-drift.test.mjs`)
141
-
142
- The detection order above is prose for the human; this table is the machine form
143
- of the same routing: `flag` must be a flag this skill's `argument-hint:` accepts
144
- and `route` must be a skill that exists. A flag or a route no surface declares is
145
- a defect in this table, never in the hint.
146
-
147
- ```text
148
- plan-mode-routes@1
149
- # owner: plan-feature
150
- mode | flag | route
151
- issue-derived | --from-issue | plan-feature-from-issue
152
- forced-scaffold | --scaffold | plan-feature-scaffold
153
- next-defined | --next | plan-feature-scaffold
154
- designed-slug | n/a | plan-feature-scaffold
155
- ```
@@ -1,162 +0,0 @@
1
- ---
2
- name: plan-feature-from-issue
3
- user-invocable: false
4
- version: 2.0.0
5
- author: "Gabriel Trabanco <1969593+gtrabanco@users.noreply.github.com>"
6
- license: MIT
7
- description: >
8
- Internal step of plan-feature: turn a feature-request issue into a scoped,
9
- sized, roadmap-mapped SPEC **product half** (capability closure satisfied)
10
- with Closes #N traceability.
11
- ---
12
-
13
- # Plan Feature — From Issue (internal)
14
-
15
- Convert a feature-request issue into the project's planning artifacts, keeping a
16
- clean issue → SPEC → PR(Closes #n) trace. Writes the SPEC's **product half**
17
- (same two-halves convention `design-feature` uses) and must satisfy capability
18
- closure before handing off — a thin issue does not get a shortcut around it.
19
-
20
- **This skill stops at the Product half.** It designs, then the unit goes to
21
- `review-spec` for an independent Product review; engineering planning is a
22
- different authority's turn. Composing `plan-feature-scaffold` in the same breath
23
- as the design it just wrote is the bypass this separation exists to close — the
24
- author of a Product half cannot be the one who decides it is ready to build on.
25
-
26
- ## When to use
27
-
28
- - The `plan-feature` router calls this when the input is a GitHub issue (or
29
- `--from-issue N`) that describes new product capability.
30
-
31
- If the issue is a **bug or tech-debt**, stop and route it: `triage-issue` to
32
- classify, then `plan-fix` + `execute-phase --fix`. This skill is for
33
- genuine features only.
34
-
35
- ## Step 0 — Discover the project (always first)
36
-
37
- Per the agent guide's **Workflow conventions** + **documentation map**, then read
38
- what THIS skill needs: the feature SPEC template, the roadmap, and the issue/PR
39
- templates (`.github/ISSUE_TEMPLATE/`, `.github/PULL_REQUEST_TEMPLATE.md`) so the
40
- SPEC mirrors the fields reviewers expect. Then read the issue (forge CLI per the
41
- project's Workflow conventions — examples use `gh`):
42
-
43
- ```sh
44
- gh issue view <N> --json number,title,body,labels,state,comments
45
- ```
46
-
47
- ## Process
48
-
49
- 1. **Classify first.** Confirm it is a feature. Not a feature if it describes a
50
- defect, regression, duplicated code, perf debt, or carries a "when to
51
- fix / trigger" clause → hand to `triage-issue`. State the verdict explicitly.
52
- 2. **Normalize language.** If not in the project's docs language (this repo:
53
- **English**), translate before drafting any artifact.
54
- 3. **Map to the roadmap.** Assign the next number + slug. Identify dependencies
55
- and conflicts with existing features, coupling/migration risks, and whether
56
- it should instead extend an existing feature.
57
- 4. **Close product-half gaps proactively.** Compare the issue against what a
58
- complete SPEC **product half** needs (goals, scope in/out, business goals,
59
- i18n/SEO/a11y/pricing per the docs map, a UI design reference when the
60
- feature has a UI surface), probing the same fixed **vagueness rubric**
61
- `design-feature`'s interview uses: affected users/roles · error & edge
62
- states · data shape · boundaries & limits · out of scope · success
63
- criteria — each slot filled or explicit `n/a: <reason>`. For each genuine
64
- gap you can't safely default, ask the user **one question per turn, never
65
- batched**, each with a recommended default; never ask what the issue or
66
- docs already answer. **Structural hand-off threshold:** if ≥ 3 rubric
67
- slots remain unfillable from the issue plus the answers so far, stop and
68
- hand the feature to `design-feature` (the thin-issue rule below, now with
69
- a fixed trigger) instead of continuing to interview here.
70
- 5. **Satisfy capability closure.** Walk the same fixed checklist
71
- `design-feature` uses (per entity: CRUD + state transitions, each with UI +
72
- API + test, or explicit `n/a: <reason>`; per capability: entry point + ACL;
73
- per role: assigned/revoked/viewed where) into the SPEC's `## Capability
74
- closure` and `## Acceptance criteria`. **A thin issue that doesn't carry
75
- enough to fill it is not a shortcut around the gate** — hand it to
76
- `design-feature` (compose in-turn only at ≥ this skill's tier, per
77
- *Guardrails*; otherwise hand off with `run /design-feature <slug>` and stop
78
- here) rather than stamping `designed` on a hollow closure.
79
- 6. **Size it.** Estimate `XS / S / M / L` (scale defined in the SPEC template)
80
- and record it in the SPEC. XS/S → the SPEC is the only planning artifact
81
- (single-pass execution); M/L → full artifact set. If L, propose splitting.
82
- 7. **Produce the SPEC product half.** Fill it and stamp `## Design status:
83
- designed` once closure is complete; set the roadmap row (added at `idea`
84
- first if it didn't exist) to `defined` in the same edit — the same
85
- `idea → defined` transition `design-feature` owns, performed here when this
86
- skill is the one that satisfies closure. Then run the `stage: spec` readiness
87
- preflight from the internal
88
- [`evidence-grounding`](<../evidence-grounding/SKILL.md>) capability, mint the
89
- current `artifactRevisionId`, and **stop**: this skill never continues into the
90
- engineering half, never promotes the row past `defined`, and never composes
91
- `plan-feature-scaffold` in this turn. The `plan-feature` router may scaffold only
92
- after `review-spec` returns a current `spec-review-pass` receipt bound to these
93
- exact bytes.
94
- 8. **Wire traceability.** Record `#N` in the SPEC; the PR body must include
95
- `Closes #N` so the issue closes on merge.
96
- 9. **Hand off — return exactly** (fixed completion report, back to the router):
97
-
98
- ```
99
- ISSUE #<N> → SPEC <slug> — size: <XS|S|M|L>
100
- Verdict: feature (not bug/debt — else this would have routed to triage-issue)
101
- Gaps closed: <n> asked / <n> defaulted (logged) Closure: designed | handed to design-feature
102
- Readiness: READY-FOR-REVIEW | NEEDS-EVIDENCE | NEEDS-DESIGN Artifact revision: <id>
103
- Traceability: Closes #<N> wired
104
- → review-spec next (engineering planning is gated on its receipt; do not scaffold here)
105
- ```
106
-
107
- ## Guardrails
108
-
109
- - Don't silently expand scope beyond the issue — surface additions as proposals.
110
- - Don't open the feature branch or write code here.
111
- - **Don't plan engineering work here.** No Engineering half, no phases, no
112
- `defined → planned` promotion, no in-turn `plan-feature-scaffold` composition:
113
- the Product half this skill writes must be reviewed by `review-spec` first, and
114
- readiness `READY-FOR-REVIEW` is not that review.
115
- - Keep the `Closes #N` link; an issue-born feature must close it.
116
- - **Never stamp `## Design status: designed` with a blank Capability closure
117
- row** — the same rule `design-feature` follows; a thin issue hands off
118
- instead of faking closure.
119
- - **Composition tier.** Composing `design-feature` in-turn for a thin issue is
120
- allowed only when this skill is running at ≥ `design-feature`'s tier
121
- (planning-class — strongest model / highest effort); otherwise hand off
122
- (`run /design-feature <slug>`) rather than under-power it.
123
- - Otherwise honor the project's **Workflow conventions** (branch/PR, docs-language).
124
-
125
- ## Architectural invariants
126
-
127
- The [planning preflight](<../planning-preflight/SKILL.md>) owns the normalized
128
- repository state read and the ONE final architectural classification for the
129
- whole plan. Consume it here before writing the product half: for each applicable
130
- invariant rule, cite its ID and repository evidence and classify the issue
131
- proposal as `preserves`, `violates`, `introduces`, or `changes`. Only
132
- `preserves` can be stamped `designed`; every other classification stops for an
133
- explicit architectural decision through the project-declared authority — never
134
- before the full plan exists, and never inferred from the issue body, SPEC, or
135
- passing test.
136
-
137
- ## Relationship to other skills
138
-
139
- - `triage-issue` — decides bug vs feature vs defer; call it if unsure.
140
- - `plan-fix` — the fix-side sibling for bug/debt issues.
141
- - `design-feature` — receives thin issues this skill cannot safely close
142
- capability closure for; both write the SPEC's product half in the same format.
143
- - `review-spec` — the mandatory next hop for every issue-derived feature: it
144
- reviews and receipts the Product half this skill produced.
145
- - `plan-feature-scaffold` — fills the engineering half later, only once
146
- `review-spec` passed. This skill never invokes it.
147
- - `execute-phase` — executes the phases; its PR carries `Closes #N`.
148
-
149
- ## Done when
150
-
151
- - A filled SPEC product half exists, roadmap-registered at `defined`, with the
152
- `stage: spec` readiness block printed and the current `artifactRevisionId`
153
- recorded.
154
- - Capability closure is satisfied (or the issue was handed off to
155
- `design-feature` instead of faking it) and `## Design status` is accurate.
156
- - The roadmap row status is `defined` (added at `idea` first if new) whenever
157
- `## Design status: designed` was stamped — never `defined` on a hollow
158
- closure, never left at `idea` once `designed` is stamped.
159
- - Nothing was scaffolded: no Engineering half, no phases, no `planned` write, and
160
- the fixed report hands off to `/review-spec`.
161
- - `#N` is recorded and the PR plan includes `Closes #N`.
162
- - Scope gaps were resolved with the user, not assumed.
@@ -1,112 +0,0 @@
1
- ---
2
- name: plan-feature-scaffold
3
- user-invocable: false
4
- version: 2.4.0
5
- author: "Gabriel Trabanco <1969593+gtrabanco@users.noreply.github.com>"
6
- license: MIT
7
- description: >
8
- Internal step of plan-feature: from an already-designed SPEC (product half
9
- `designed`), fill the **engineering half** and generate the planning
10
- artifact set scaled to the feature's size (XS/S → SPEC-only with ≥ 2 phases
11
- in the SPEC, last = Hardening & PR; M/L → full set with a hardening phase),
12
- freeze one compact ACCEPTANCE.md for every size, and register the roadmap
13
- entry. Docs only — never code.
14
- ---
15
-
16
- # Plan Feature — Scaffold (internal)
17
-
18
- Turn a designed feature into the project's complete planning artifact set,
19
- ready for phase-by-phase execution. Fills only the SPEC's **engineering half**
20
- — the product half (goal, context, scope, capability closure) already exists
21
- and is marked `designed` before this skill ever runs (`plan-feature`'s
22
- redirect gate guarantees it). **Docs only — never code.**
23
-
24
- ## When to use
25
-
26
- - The `plan-feature` router calls this once a feature's product half is
27
- `designed` — from `design-feature`, `plan-feature-from-issue`, or an
28
- already-scoped slug/SPEC — to fill the engineering half of its
29
- `docs/features/<NN>-<slug>/SPEC.md` and the rest of the folder, then update
30
- the roadmap.
31
-
32
- Not for product definition (that is `design-feature`) or writing code (that is
33
- `execute-phase`) or deciding *whether* to build (that is the `plan-feature`
34
- router / `triage-issue`).
35
-
36
- ## Step 0 — Discover the project (always first)
37
-
38
- Per the agent guide's **Workflow conventions** + **documentation map**, then read
39
- what THIS skill needs: the feature SPEC **template**, the **roadmap**
40
- (numbering/order/deps), 1–2 recent feature folders to mirror the artifact set, and
41
- the architecture/domain docs the map points to. No template/roadmap → fall back to
42
- the agent guide and state the assumption.
43
-
44
- ## Progressive loading — scaffold only after discovery
45
-
46
- The reference allowlist is exactly one path. After Step 0, read and execute the
47
- complete [scaffold process](references/SCAFFOLD_PROCESS.md). It owns the product-
48
- half gate, artifact scaling, roadmap transition, re-read, and fixed completion
49
- report. The [phase contract](<../phase-contract/SKILL.md>) owns the 8-box
50
- phase-lint and the normalized phase fingerprint, and
51
- `bun scripts/phase-lint.mjs <plan>` (node fallback) runs it: run the linter over
52
- the emitted plan before reporting and paste its stdout block verbatim as lint
53
- output, never as instructions — exit 1 is a blocked phase to re-cut, never a
54
- verdict to re-derive by reading the rules. If the script is absent
55
- (installed-skill target — it ships with the repository, not the skill), apply the
56
- eight `phase-contract` rules by hand, label the check weaker, and disclose the
57
- linter did not run; never skip the gate.
58
-
59
- The resource is normative and one hop from this file. Missing resource → stop;
60
- never reconstruct phase or close-out wording from memory.
61
-
62
- The [verification contract](<../verification-contract/SKILL.md>) owns the
63
- `ACCEPTANCE.md` schema, validation ladder, and anti-weakening rules. Consume it
64
- after the engineering plan is complete and before registering `planned`.
65
-
66
- ## Research and reference trace (plan stage)
67
-
68
- - **Conditional web research.** Plan-stage research runs only when a bounded
69
- question (ROWS.md Q1–Q5) cannot be answered from repository evidence: run
70
- exactly one web pass before the phases are emitted and freeze what it
71
- returns as evidence rows (URL and access date). A question the repository
72
- answers is never re-fetched.
73
- - **Mandatory reference trace.** Affected code is located by symbol/reference
74
- search — LSP/serena when the environment offers it, grep otherwise — and the
75
- blast radius is derived from that search, never from model memory: added or
76
- changed code can break callers the plan must name.
77
-
78
- ## Guardrails
79
-
80
- - Docs only. No source edits, migrations, or dependencies.
81
- - Respect the architecture: honor layer rules (inner layers don't import outer)
82
- and any domain/i18n/SEO/a11y rules from the docs map.
83
- - **Architectural invariants.** The [planning preflight](<../planning-preflight/SKILL.md>)
84
- owns the normalized repository state read and the ONE final architectural
85
- classification for the whole plan; consume it here. Its absence is compatible:
86
- record `n/a: no project invariants declared` in the engineering half. For
87
- every applicable rule, record its ID, repository evidence, and
88
- `preserves | violates | introduces | changes` classification in
89
- `### Architecture impact`. Only `preserves` may produce phases; the other
90
- classifications stop for an explicit architectural decision through the
91
- project's declared authority — and only after the full plan exists, never
92
- converted into a phase task or inferred from the product half.
93
- - Surface conflicts (numbering clashes, dependency cycles, scope overlap) before
94
- writing, not after.
95
- - Otherwise honor the project's **Workflow conventions** (branch/PR, docs-language).
96
-
97
- ## Relationship to other skills
98
-
99
- Invoked by the `plan-feature` router (after `design-feature` /
100
- `plan-feature-from-issue` designed the product half, or directly for an
101
- already-designed scoped slug/SPEC). Hands off to `execute-phase` for P1;
102
- `audit-docs` audits anytime.
103
-
104
- ## Done when
105
-
106
- - `docs/features/<NN>-<slug>/` exists with the SPEC's engineering half +
107
- `ACCEPTANCE.md` + every scaled planning artifact filled — the product half untouched from what
108
- `design-feature` / `plan-feature-from-issue` wrote.
109
- - The roadmap lists the feature with correct number, order, dependencies, and
110
- **status `planned`** (the `defined → planned` write this skill owns) —
111
- **re-read and confirmed after the write**, not assumed from having run it.
112
- - No code changed; open questions captured in `decisions.md`.