orchid-sdd 0.3.0 → 0.3.1

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "orchid-sdd",
3
3
  "displayName": "orchid-sdd",
4
- "version": "0.3.0",
4
+ "version": "0.3.1",
5
5
  "description": "Memory-backed, specification-driven development for Claude Code. Explicit-only /orchid-sdd:run workflow with a local Node CLI.",
6
6
  "author": {
7
7
  "name": "orchid-sdd contributors"
@@ -16,17 +16,23 @@ The project must declare one repository workflow and use it consistently:
16
16
  - **XP mainline:** direct integration to main is allowed only for small, tested, reversible
17
17
  changes with the configured review or pairing evidence.
18
18
 
19
- If no repository preset is active, orchid-sdd's default build flow uses an integration branch and
20
- does not merge to the default branch during build. If `repository-trunk-based`,
21
- `repository-gitflow`, or `repository-xp-mainline` is active, that preset is authoritative for
22
- the concrete branch flow; this core rule checks that the declared workflow and the actual
23
- commands agree. A project selecting XP mainline must also update its execution and release
24
- configuration and record the decision in an ADR.
19
+ If no repository preset is active, orchid-sdd's build flow uses the iteration's
20
+ feature/integration branch only when the user opted in; otherwise prompt branches merge into
21
+ the current branch. The default branch is not touched during build. If
22
+ `repository-trunk-based`, `repository-gitflow`, or `repository-xp-mainline` is active, that
23
+ preset is authoritative for the concrete branch flow; this core rule checks that the declared
24
+ workflow and the actual commands agree. A project selecting XP mainline must also update its
25
+ execution and release configuration and record the decision in an ADR.
25
26
 
26
27
  # Checks
27
28
 
28
29
  - The default branch is named and protected by policy.
29
30
  - The branch owner and merge target are clear before work starts.
31
+ - A feature branch is created only when the user asks for one; otherwise work stays on the
32
+ current branch.
33
+ - Each prompt uses one disposable worktree and temporary branch, deleted immediately after CR
34
+ and merge.
35
+ - No orphan `orchid/<iteration>/<prompt-id>` branch or worktree remains at G5 or closure.
30
36
  - Changes are small enough to review and reverse.
31
37
  - Commit messages identify the requirement or prompt when the project uses traceability.
32
38
  - Direct pushes to the default branch are either explicitly allowed by the selected preset or
@@ -37,12 +43,14 @@ configuration and record the decision in an ADR.
37
43
 
38
44
  # Evidence
39
45
 
40
- - Discovery: record the workflow and any repository constraints in `discovery/steering.md`.
46
+ - Discovery: record the workflow, feature-branch decision, and base branch in
47
+ `discovery/steering.md`.
41
48
  - Assessment: note branch/release impact and rollback strategy.
42
- - Build: branch names, commits, and merge target are visible in the prompt report.
49
+ - Build: branch names, worktree path, commits, merge target, and branch deletion are visible
50
+ in the prompt report.
43
51
  - Code review: review the integration diff, not the implementer’s local branch.
44
- - Logic review: confirm the delivered change is on the expected branch and no stray merge or
45
- release action occurred.
52
+ - Logic review: confirm the delivered change is on the expected branch; no prompt branch,
53
+ worktree, or stray merge remains.
46
54
 
47
55
  # Exceptions
48
56
 
@@ -27,5 +27,11 @@ What could break; how it is guarded.
27
27
  ## Versioning and release
28
28
  Compatibility, flags, rollout, rollback.
29
29
 
30
+ ## Branch strategy
31
+ - Feature branch: yes/no
32
+ - Base branch: main/develop
33
+ - Integration target: <feature branch, or the current branch when no feature branch is used>
34
+ - Prompt branches: one disposable worktree/branch per prompt, deleted after CR and merge
35
+
30
36
  ## Criticalities
31
37
  Top risks and open technical questions.
package/README.md CHANGED
@@ -393,6 +393,11 @@ Use `--global` for a user-wide install, `--dest DIR` for a custom directory, `--
393
393
  preview, and `--force` only after reviewing an existing installation. There is no
394
394
  `postinstall` side effect.
395
395
 
396
+ `setup` and `skill install` are independent: `setup` initializes the project artifacts
397
+ (`.orchid/`, `.knowledge/`, `orchid-sdd.yml`), while `skill install` writes the agent skill
398
+ (`.opencode/skills/orchid-sdd`). Either order works; run `setup` first if you want the skill
399
+ usable immediately. Installing the npm package does not create `.opencode/skills`.
400
+
396
401
  For the Vercel Agent Skills catalog:
397
402
 
398
403
  ```bash
@@ -911,7 +916,7 @@ Every referenced persona must exist and be enabled.
911
916
  | `execution.max_parallel` | `4` | Maximum simultaneous prompts/reviews | Agent |
912
917
  | `execution.isolation` | `worktree` | `worktree`, `clone`, or `branch`; `branch` requires `max_parallel: 1` | Agent/CLI (doctor) |
913
918
  | `execution.require_clean_tree` | `true` | `start` refuses a dirty root/repo | CLI |
914
- | `execution.integration_branch` | `orchid/{iteration}/integration` | Build merge target | Agent |
919
+ | `execution.integration_branch` | `orchid/{iteration}/integration` | Feature/integration branch used only when the user opts in; otherwise prompts merge into the current branch | Agent |
915
920
  | `execution.release_strategy` | `squash` | `squash`, `pr`, or `none` at closure | Agent/Policy |
916
921
  | `execution.merge` | `orchestrator` | Who performs merges | Agent/Policy |
917
922
  | `execution.max_fix_loops` | `3` | CR fix attempts before escalation | Agent |
@@ -919,6 +924,12 @@ Every referenced persona must exist and be enabled.
919
924
  | `execution.test_commands.integration` | profile default | Integration test command | Agent/Setup |
920
925
  | `execution.test_commands.e2e` | profile default | End-to-end test command | Agent/Setup |
921
926
 
927
+ At Intent, the skill asks whether to create a feature branch and which base branch to use
928
+ (`main`/`develop`; default `project.default_branch`, or `develop` for Git-flow). If the answer
929
+ is no, it stays on each affected repository's current branch. Every prompt uses one disposable
930
+ worktree and temporary branch (`orchid/<iteration>/<prompt-id>`), deleted immediately after CR
931
+ and merge; closure verifies that no prompt branch or worktree remains.
932
+
922
933
  ### Reviews
923
934
 
924
935
  | Key | Default | Meaning / values | Acted on by |
@@ -1184,7 +1195,7 @@ example fit (closest approved shape), and conflict check (requirements that cont
1184
1195
  blocking rule). Record them in `discovery/steering.md`; G2 can cite that file.
1185
1196
 
1186
1197
  **Suggested Logic Review rules.** Use `logic-review-steering`: rule coverage (every active
1187
- blocking rule has a verdict), evidence freshness (integration branch, not a local branch),
1198
+ blocking rule has a verdict), evidence freshness (chosen integration target, not a throwaway prompt branch),
1188
1199
  scope integrity (no deleted tests or hidden suppressions), exception integrity (waivers name
1189
1200
  owner and expiry), and behavioral fit (the delivered behavior still matches the requirement).
1190
1201
  Record them in `reviews/steering-review.md`; G6 can cite that file.
package/SKILL.md CHANGED
@@ -25,7 +25,8 @@ Implementers, reviewers, and assessment lenses run as subagents with fresh conte
25
25
  - The CLI is the only writer of state, events, manifest, indexes, and the matrix.
26
26
  - Never edit `.knowledge/**`, `manifest.jsonld`, or the index files by hand.
27
27
  - Deterministic operations go through the CLI: setup, record, index, lint, gates, close.
28
- - Code reaches the default branch only at closure. Build merges go to the integration branch.
28
+ - Code reaches the default branch only at closure. Build merges go to the iteration's
29
+ feature/integration branch, or to the current branch when no feature branch was chosen.
29
30
 
30
31
  # User-facing output
31
32
 
@@ -116,7 +117,7 @@ A gate passes only with evidence. Never pass a gate on a promise.
116
117
  | G4 Plan | valid DAG, disjoint waves, coverage, cost estimate within budget | yes |
117
118
  | G5 Prompt | acceptance met, tests green, CR passed, anchors/docblocks valid, merged to integration | per prompt, no |
118
119
  | G6 Logic review | scenarios verified; steering review complete; no open business or blocking steering findings; scope matches intent | yes |
119
- | G7 Closure | prompts done/waived; audit archived; integration merged; release notes | yes |
120
+ | G7 Closure | prompts done/waived; audit archived; feature/integration merged to base or current branch already base; prompt branches deleted; release notes | yes |
120
121
  | G8 Handover | HANDOVER.md + tour.md verified | yes |
121
122
 
122
123
  Use `--evidence <iteration-relative path>` or `--note "why"`; both are logged.
@@ -156,6 +157,11 @@ before G1.
156
157
 
157
158
  Artifacts: `intent/title.md`, `intent/prd.md`, `intent/trd.md`.
158
159
 
160
+ - Branch strategy: before implementation, ask whether to create a feature branch. If yes,
161
+ ask the base branch (`main`/`develop`; default `project.default_branch`, or `develop` for
162
+ Git-flow) and record the answer in `intent/trd.md`. Use one feature/integration branch for
163
+ the iteration; do not create both a feature branch and a separate integration branch. If
164
+ the answer is no, use the current branch of each affected repo.
159
165
  - Validate the title: ≤500 chars, names subject + change + outcome. If vague, ask at most
160
166
  five clarifying questions with examples.
161
167
  - PRD: problem, users, current behaviour, desired outcome, flows, business rules, metrics,
@@ -223,11 +229,13 @@ Artifacts: `plan/plan.json`, `plan/matrix.md`, `plan/matrix.json`, `plan/cost-es
223
229
 
224
230
  ## Phase 5 — Build and adversarial CR
225
231
 
226
- - Select ready prompts; create a worktree and branch `orchid/<iteration>/<prompt-id>`.
232
+ - Select ready prompts. Create one worktree and one temporary branch
233
+ `orchid/<iteration>/<prompt-id>` per prompt; never reuse a prompt branch.
227
234
  - Run `orchid-sdd route --phase build --prompt <prompt-id>` before execution and alert the user
228
235
  on `unknown` or `mismatch`.
229
236
  - Record the prompt with `orchid-sdd prompt start <prompt-id> --step implement`; advance safe
230
- steps with `prompt step` and finish with `prompt complete|fail|waive`.
237
+ steps with `prompt step`. Finish with `prompt complete|fail|waive` only after tests, CR,
238
+ merge, and branch cleanup.
231
239
  - Give each implementer a context pack, not the repository.
232
240
  - Keep inline comments why-only; update the anchor and docblock for significant units, with
233
241
  history in the docblock.
@@ -237,10 +245,16 @@ Artifacts: `plan/plan.json`, `plan/matrix.md`, `plan/matrix.json`, `plan/cost-es
237
245
  S-size work; independence and the rubric are unchanged. Check active steering rules and cite
238
246
  violations in `reviews/steering.md`.
239
247
  - Fix loop up to `max_fix_loops`; then `escalated`: accept with ADR, split, or revert.
240
- - Merge to `orchid/<iteration>/integration` in wave order. Do not merge to the default branch
241
- during build unless an active repository steering rule explicitly permits direct mainline
242
- integration and records the evidence.
243
- - A prompt is done only when acceptance, tests, CR, anchors/docblocks, and the matrix agree.
248
+ - Merge to the iteration's feature/integration branch in wave order, or to the current branch
249
+ when the user chose no feature branch. Do not merge to the default branch during build
250
+ unless an active repository steering rule explicitly permits direct mainline integration
251
+ and records the evidence.
252
+ - Immediately after CR passes and the merge lands, remove the prompt worktree
253
+ (`git worktree remove <path>`) and delete its temporary branch
254
+ (`git branch -D orchid/<iteration>/<prompt-id>`). This is mandatory: a prompt is not done
255
+ while its worktree or branch still exists. Clean up failed and waived prompts the same way.
256
+ - A prompt is done only when acceptance, tests, CR, anchors/docblocks, branch cleanup, and the
257
+ matrix agree.
244
258
 
245
259
  ## Phase 6 — Logic review (PM)
246
260
 
@@ -263,9 +277,13 @@ Artifacts: `reviews/logic-review.md`, `reviews/steering-review.md`.
263
277
  ## Phase 7 — Closure
264
278
 
265
279
  - Confirm every prompt is `done` or `waived`; tests green; lint/index current.
280
+ - Verify branch hygiene: no prompt worktrees and no `orchid/<iteration>/<prompt-id>`
281
+ branches remain.
266
282
  - Move prompts, bus, and runs to `audit/`; keep the matrix as the index.
267
- - Write `release-notes.md`; merge integration to the default branch per
268
- `execution.release_strategy`; tag/freeze the iteration.
283
+ - Write `release-notes.md`; merge the feature/integration branch to the chosen base per
284
+ `execution.release_strategy`, then delete it unless repository policy explicitly requires
285
+ retention and records it. If no feature branch was used, the current branch is already the
286
+ base.
269
287
  - Mark closed and rebuild the manifest. A closed iteration is immutable.
270
288
  - If it will not ship, use `orchid-sdd abandon "<reason>"` instead.
271
289
  - After closure, ask: **Do you want to start the technical handover?** Wait for the
@@ -295,8 +313,8 @@ explicit project decisions that must be checked and cited.
295
313
  language example and adapt it to the project’s real conventions.
296
314
  - Discovery converts applicable rules into requirements, scenarios, questions, assumptions, or
297
315
  ADR-backed exceptions. It does not review implementation style.
298
- - Logic review verifies every active rule against the integration branch, records a verdict and
299
- evidence in `reviews/steering-review.md`, and stops on an unresolved blocking rule.
316
+ - Logic review verifies every active rule against the chosen integration target, records a
317
+ verdict and evidence in `reviews/steering-review.md`, and stops on an unresolved blocking rule.
300
318
  - Do not enable competing architecture, style-tool, or repository presets. An exception is an
301
319
  ADR, not a silent waiver.
302
320
  - The CLI validates references, but the agent owns semantic compliance. `steering context`
package/cli/phases.mjs CHANGED
@@ -91,7 +91,7 @@ function validateTitle(raw, maxChars) {
91
91
 
92
92
  function nextAction(phase) {
93
93
  const actions = {
94
- intent: "Write intent/prd.md and intent/trd.md, then `orchid-sdd gate pass G1 --evidence intent/prd.md`.",
94
+ intent: "Ask whether to create a feature branch and which base (main/develop); write intent/prd.md and intent/trd.md, then `orchid-sdd gate pass G1 --evidence intent/prd.md`.",
95
95
  discovery: "Apply steering, capture discovery/Gherkin/questionnaires, write discovery/steering.md; then `orchid-sdd gate pass G2 --evidence discovery/gherkin`.",
96
96
  assessment: "Run the impact lenses and negotiation; then `orchid-sdd gate pass G3 --evidence assessment/negotiation.md`.",
97
97
  planning: "Generate the prompt DAG and cost estimate; then `orchid-sdd gate pass G4 --evidence plan/plan.json`.",
package/cli/setup.mjs CHANGED
@@ -34,6 +34,8 @@ export function agentsBlock(knowledgeFolder, constitutionFolder = ".orchid/const
34
34
  - Read \`orchid-sdd steering context --phase <phase>\` before Discovery and Logic Review; apply every active rule and cite its ID.
35
35
  - Run \`orchid-sdd route --phase <phase>\` before work; if the current model/agent is unknown or mismatched, tell the user. Never switch automatically.
36
36
  - Track development prompts with \`orchid-sdd prompt start|step|complete\`; save a checkpoint with \`orchid-sdd handoff prepare\` before changing harness.
37
+ - Ask before starting whether to create a feature branch and from which base; record the answer in the TRD. If not, stay on the current branch.
38
+ - Each prompt gets one disposable worktree and temporary branch; remove both immediately after CR and merge. Never leave an \`orchid/<iteration>/<prompt-id>\` branch behind.
37
39
  ${AGENTS_END}
38
40
  `;
39
41
  }
@@ -21,7 +21,7 @@
21
21
  2. Keep **intent, discovery, and assessment separate**; do not ask technical personas to define business meaning, or business personas to estimate code impact.
22
22
  3. Make the manifest a **generated projection of append-only events**, not a hand-edited JSON file.
23
23
  4. Document code in **three tiers**: a one-line `ORCHID-MEM` anchor, a Markdown docblock, and the manifest graph.
24
- 5. Turn work into **prompt contracts** with dependencies, disjoint write scopes, tests, and acceptance commands; parallelism is proven by the plan, code lands on an integration branch, and the default branch is touched only at closure unless an explicit XP-mainline steering rule permits otherwise.
24
+ 5. Turn work into **prompt contracts** with dependencies, disjoint write scopes, tests, and acceptance commands; parallelism is proven by the plan, code lands on the iteration's feature/integration branch when the user opts in (otherwise on the current branch), and the default branch is touched only at closure unless an explicit XP-mainline steering rule permits otherwise.
25
25
  6. Review with **independent, persona-routed adversarial CR**, then a separate **PM logic review** against Gherkin.
26
26
  7. Treat personas as **role contracts** (phase, authority, triggers), not chatbots; treat the constitution as a **layered, lockable source of truth** for *how* code is written.
27
27
  8. Make the skill **explicit-only, portable, and self-contained**: an explicit command (`/orchid-sdd` in OpenCode, `orchid-sdd` at the CLI) is the only entry point, and the skill package is versioned separately from project knowledge.
@@ -356,8 +356,8 @@ execution:
356
356
  max_parallel: 4
357
357
  isolation: worktree # worktree | clone | branch (§11.2)
358
358
  require_clean_tree: true
359
- integration_branch: "orchid/{iteration}/integration"
360
- release_strategy: squash # squash | pr | none — how integration reaches the default branch at G7
359
+ integration_branch: "orchid/{iteration}/integration" # feature branch when the user opts in; otherwise the current branch
360
+ release_strategy: squash # squash | pr | none — how the iteration branch reaches its base at G7
361
361
  merge: orchestrator
362
362
  max_fix_loops: 3
363
363
  test_commands:
@@ -503,9 +503,9 @@ The orchestrator is the primary agent session in the host harness — in OpenCod
503
503
  | **G2** | Discovery signed off | Business impact, boundaries, Gherkin, traceability, zero blocking questions or recorded `Assumption` nodes; PM sign-off | Yes, if answers changed scope |
504
504
  | **G3** | Assessment decided | Impact map, contracts, regressions, options, ADRs; go/no-go decision | Yes |
505
505
  | **G4** | Plan approved | Valid DAG, disjoint waves, complete coverage, matrix generated, cost estimate within budget or explicitly overridden | Yes |
506
- | **G5** | Prompt done | Acceptance met, tests pass in a clean environment, CR passed, anchors/docblocks valid, merged to the integration branch | No, per prompt |
506
+ | **G5** | Prompt done | Acceptance met, tests pass in a clean environment, CR passed, anchors/docblocks valid, merged to the chosen integration target, prompt worktree/branch deleted | No, per prompt |
507
507
  | **G6** | Logic review passed | Scenarios verified; no open business findings; scope matches intent | Yes |
508
- | **G7** | Closure complete | All prompts done or waived; manifest/index rebuilt; transients archived; integration merged to the default branch; release notes written | Yes |
508
+ | **G7** | Closure complete | All prompts done or waived; manifest/index rebuilt; transients archived; feature/integration merged to its base (or current branch already base); prompt branches deleted; release notes written | Yes |
509
509
  | **G8** | Handover accepted | Handover and tour complete; links resolve; human acknowledges | Yes |
510
510
 
511
511
  Gates are enforced by the orchestrator, not by prompt instructions alone. A command that would cross a gate without evidence fails with the missing evidence listed.
@@ -561,7 +561,7 @@ The skill exposes one explicit entry point with subcommands. Running `/orchid-sd
561
561
  | `/orchid-sdd discover` | 2 | PM-led requirements capture, Gherkin, consistency scan, questionnaires | G2 |
562
562
  | `/orchid-sdd assess` | 3 | Parallel technical impact analysis, negotiation, ADRs, go/no-go | G3 |
563
563
  | `/orchid-sdd plan` | 4 | Decompose into prompts, validate the DAG, generate the matrix | G4 |
564
- | `/orchid-sdd build [--all\|--wave N\|--prompt P-003]` | 5 | Execute ready prompts, verify tests, run adversarial CR, merge to the integration branch | G5 per prompt |
564
+ | `/orchid-sdd build [--all\|--wave N\|--prompt P-003]` | 5 | Execute ready prompts, verify tests, run adversarial CR, merge to the feature/integration or current branch, delete prompt branches | G5 per prompt |
565
565
  | `/orchid-sdd review` | 6 | PM logic review against PRD/TRD/Gherkin; generate follow-up prompts if needed | G6 |
566
566
  | `/orchid-sdd close` | 7 | Freeze, archive transients, rebuild manifest/index, write release notes | G7 |
567
567
  | `/orchid-sdd handover` | 8 | Generate and verify the human tutorial | G8 |
@@ -711,6 +711,8 @@ intent/
711
711
  | "Fix performance" | "Reduce checkout API p95 latency from 1.8s to under 600ms for carts with more than 50 items" |
712
712
  | "Add Redis" | "Introduce a shared cache for product catalog reads to remove the repeated database fan-out during peak traffic" |
713
713
 
714
+ **Branch strategy.** Before implementation, ask whether to create a feature branch. If yes, ask the base branch (`main`/`develop`; default `project.default_branch`, or `develop` for Git-flow) and record the answer in the TRD. The feature branch is the iteration's single integration target; do not create a separate feature branch and integration branch. If no, use each affected repository's current branch. Prompt branches are always disposable and are deleted after CR and merge.
715
+
714
716
  **PRD contents:** problem, affected users and personas, current behaviour, desired outcome, primary and alternate flows, business rules, success metrics, non-goals, assumptions, risks, open questions. No technology choices.
715
717
 
716
718
  **TRD contents:** technical constraints, proposed architecture direction, patterns to follow (with constitution references), expected deliverables (unit, integration, e2e), infrastructure/API/data hypotheses, regression strategy, versioning and release strategy, criticalities. The TRD is explicitly a **hypothesis**: Phase 3 validates or rejects it.
@@ -913,16 +915,16 @@ plan/ # the prompt folder for this spec
913
915
 
914
916
  1. **Select ready prompts** whose dependencies are done and whose write scopes are disjoint.
915
917
  2. **Resolve routing** with `orchid-sdd route --phase build --prompt <prompt-id>`; if the current agent/model is unknown or mismatched, notify the user and do not switch automatically.
916
- 3. **Isolate** each prompt in a worktree and branch (`orchid/<iteration>/<prompt-id>`), following the isolation and knowledge protocol (§11.2).
918
+ 3. **Isolate** each prompt in one disposable worktree and temporary branch (`orchid/<iteration>/<prompt-id>`), following the isolation and knowledge protocol (§11.2). Never reuse a prompt branch.
917
919
  4. **Build a context pack**, not a repository dump: the prompt, relevant spec slice, constitution sections, 1-hop memory, affected code, test commands, and known constraints.
918
920
  5. **Implement** the prompt, run the tests, keep inline comments why-only, update or create the anchor and docblock (including `History`), and write run artifacts and any message to the outbox; the orchestrator copies both back when the prompt completes.
919
921
  6. **Verify independently:** the orchestrator runs the acceptance commands in a clean environment. The implementer's claim is not evidence.
920
922
  7. **Review adversarially** with a fresh-context reviewer, routed by changed paths and topics.
921
923
  8. **Fix loop** up to `max_fix_loops`. A prompt that exhausts the loop enters `escalated` (§11.5): arbitration, split, or revert. A prompt never merges on a promise to fix later.
922
- 9. **Merge into the integration branch** (`orchid/<iteration>/integration`) in wave order, through the orchestrator; the default branch is untouched during build unless an XP-mainline steering rule explicitly permits otherwise. Update the matrix and emit events. Commit and PR metadata carry the iteration and prompt IDs, the matrix slice, test evidence, and the CR verdict.
924
+ 9. **Merge into the iteration's feature/integration branch**, or into the current branch when the user chose no feature branch, in wave order through the orchestrator; the default branch is untouched during build unless an XP-mainline steering rule explicitly permits otherwise. Immediately after the merge lands, remove the prompt worktree and delete its temporary branch. Cleanup is mandatory; a prompt is not done while either exists. Update the matrix and emit events. Commit and PR metadata carry the iteration and prompt IDs, the matrix slice, test evidence, and the CR verdict.
923
925
  10. **Refresh indexes at wave boundaries**, not on every file write.
924
926
 
925
- **Exit:** G5 for each prompt — acceptance met, tests green, CR passed, anchors/docblocks valid, merged to the integration branch, matrix updated. The iteration can proceed to logic review only when all prompts are done or explicitly waived.
927
+ **Exit:** G5 for each prompt — acceptance met, tests green, CR passed, anchors/docblocks valid, merged to the chosen integration target, prompt worktree/branch deleted, matrix updated. The iteration can proceed to logic review only when all prompts are done or explicitly waived.
926
928
 
927
929
  ### Phase 6 — Logic review
928
930
 
@@ -930,7 +932,7 @@ plan/ # the prompt folder for this spec
930
932
 
931
933
  **Lead:** PM, with any persona configured for `phases.logic_review`.
932
934
 
933
- **Inputs:** PRD, TRD, Gherkin, test evidence, the integration branch diff, manifest history, the active steering rules and examples, and the prompt outcomes. The PM does not replace the technical reviewer; steering verification may cite specialist evidence, but the PM owns the final coverage statement.
935
+ **Inputs:** PRD, TRD, Gherkin, test evidence, the chosen integration target diff, manifest history, the active steering rules and examples, and the prompt outcomes. The PM does not replace the technical reviewer; steering verification may cite specialist evidence, but the PM owns the final coverage statement.
934
936
 
935
937
  **Checks:**
936
938
 
@@ -940,7 +942,7 @@ plan/ # the prompt folder for this spec
940
942
  - error states, copy, accessibility, and edge cases match the intent;
941
943
  - prior regressions are still guarded;
942
944
  - every active steering rule has a verdict and current evidence: `satisfied`, `not applicable`, `finding`, or `waived`;
943
- - style gates ran on the integration branch and no new suppression hides a violation;
945
+ - style gates ran on the chosen integration target and no new suppression hides a violation;
944
946
  - repository flow and architecture boundaries match the declared rules;
945
947
  - the implementation is explainable to a non-engineer.
946
948
 
@@ -966,6 +968,7 @@ The “explainable to a non-engineer” check verifies that the PM can state the
966
968
  - the full test suite is green in a clean environment;
967
969
  - anchors and docblocks resolve; `lint --check` and `index --check` pass;
968
970
  - the manifest matches the artifacts;
971
+ - no prompt worktree or `orchid/<iteration>/<prompt-id>` branch remains;
969
972
  - release notes and rollback notes exist.
970
973
 
971
974
  **Actions:**
@@ -975,7 +978,8 @@ The “explainable to a non-engineer” check verifies that the PM can state the
975
978
  - freeze the archived prompts and all artifacts by hash;
976
979
  - rebuild the root `manifest.jsonld` and all indexes;
977
980
  - write `release-notes.md`: changes, breaking changes, migrations, rollback, version bump;
978
- - merge the integration branch into the default branch per `execution.release_strategy` (squash merge, release PR, or manual);
981
+ - merge the feature/integration branch into the chosen base branch per `execution.release_strategy` (squash merge, release PR, or manual); when no feature branch was used, the current branch is already the base;
982
+ - delete the feature/integration branch after a successful merge unless repository policy explicitly requires retention and records it;
979
983
  - tag or prepare the release according to project convention;
980
984
  - mark the iteration `closed`; it becomes read-only;
981
985
  - ask whether the human wants to start the technical handover, and wait for the answer before Phase 8.
@@ -1873,6 +1877,8 @@ This is the difference between "we hope they don't collide" and "the plan proves
1873
1877
 
1874
1878
  The knowledge protocol applies in every mode: agents never write `.knowledge`, and the context pack stays authoritative regardless of where the checkout lives.
1875
1879
 
1880
+ **Branch lifecycle.** Prompt worktrees and temporary branches are disposable. Create one per prompt (`orchid/<iteration>/<prompt-id>`), merge it, then remove the worktree and delete the branch immediately after CR passes. A leftover prompt branch is a build failure, not cleanup debt. The iteration has at most one long-lived feature/integration branch, and only when the user asked for one; otherwise prompt branches merge into the current branch of each affected repository. At closure, verify no prompt branch or worktree remains, merge the feature/integration branch to its chosen base, and delete it unless repository policy explicitly requires retention.
1881
+
1876
1882
  ```mermaid
1877
1883
  flowchart TB
1878
1884
  W["wave N ready"] --> CP["orchestrator: context pack + knowledge snapshot into worktree"]
@@ -1881,7 +1887,7 @@ flowchart TB
1881
1887
  TV -->|fail| IM
1882
1888
  TV -->|pass| RV["reviewer agent: adversarial CR, fresh context"]
1883
1889
  RV -->|findings| IM
1884
- RV -->|pass| MG["CLI: merge to integration branch"]
1890
+ RV -->|pass| MG["CLI: merge to feature/integration or current branch"]
1885
1891
  MG --> UP["orchestrator: drain bus, update matrix, emit events"]
1886
1892
  UP --> W
1887
1893
  ```
@@ -2820,7 +2826,7 @@ One-line pointers to every machine-checkable rule, for implementers who should n
2820
2826
  | Implementer never reviews its own work | §11.5 |
2821
2827
  | CR blocking severities gate; escalation after `max_fix_loops` | §11.5 |
2822
2828
  | Logic review capped at `max_loops`; follow-up or waived risk | §11.6 |
2823
- | Merge to the integration branch only; default branch at G7, unless an XP-mainline steering rule permits direct mainline | §6 Phases 5, 7, §9.4 |
2829
+ | Merge to the chosen integration target only; default branch at G7, unless an XP-mainline steering rule permits direct mainline | §6 Phases 5, 7, §9.4 |
2824
2830
  | External sources are untrusted snapshots with provenance | §10 |
2825
2831
  | `doctor --ci` is offline; `--online` for network probes | §10.2 |
2826
2832
  | Audit is permanent; deletion is a human-approved event | §7.9 |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orchid-sdd",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "A memory-backed, specification-driven development (SDD) skill for coding agents.",
5
5
  "type": "module",
6
6
  "bin": {