@deftai/directive-content 0.86.0 → 0.88.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/deft-directive-swarm/SKILL.md +1 -996
- package/QUICK-START.md +6 -0
- package/Taskfile.yml +3 -1
- package/UPGRADING.md +24 -2
- package/coding/coding.md +5 -1
- package/commands.md +1 -1
- package/contracts/runtime-authority.md +34 -8
- package/conventions/references.md +1 -1
- package/docs/getting-started.md +6 -0
- package/docs/no-deft-directive.md +87 -0
- package/docs/openclaw-agent-host.md +170 -0
- package/docs/product-signal.md +2 -0
- package/docs/writing-ste100.md +53 -0
- package/glossary.md +37 -39
- package/package.json +2 -1
- package/packs/rules/rules-pack-0.1.json +25 -1
- package/packs/skills/skills-pack-0.1.json +5 -5
- package/packs/strategies/strategies-pack-0.1.json +4 -4
- package/skills/deft-directive-review-cycle/SKILL.md +116 -14
- package/skills/deft-directive-setup/SKILL.md +35 -8
- package/skills/deft-directive-swarm/SKILL.md +81 -956
- package/skills/deft-directive-swarm/references/core-ops.md +144 -0
- package/skills/deft-directive-swarm/references/core-phase-0.md +200 -0
- package/skills/deft-directive-swarm/references/core-phase-1-2.md +73 -0
- package/skills/deft-directive-swarm/references/core-phase-3.md +145 -0
- package/skills/deft-directive-swarm/references/core-phase-4.md +71 -0
- package/skills/deft-directive-swarm/references/core-phase-5-6.md +317 -0
- package/skills/deft-directive-swarm/references/host-cursor.md +25 -0
- package/skills/deft-directive-swarm/references/host-generic.md +27 -0
- package/skills/deft-directive-swarm/references/host-grok-build.md +37 -0
- package/skills/deft-directive-swarm/references/host-openclaw.md +70 -0
- package/skills/deft-directive-swarm/references/host-warp.md +37 -0
- package/skills/deft-directive-triage/SKILL.md +40 -55
- package/skills/deft-directive-write-skill/SKILL.md +17 -0
- package/strategies/artifact-guards.md +24 -14
- package/strategies/discuss.md +40 -1
- package/strategies/interview.md +103 -30
- package/strategies/probe.md +27 -1
- package/tasks/engine-invoke.cjs +69 -13
- package/tasks/engine-invoke.test.cjs +188 -0
- package/tasks/triage-queue.yml +1 -1
- package/tasks/verify.yml +19 -0
- package/templates/agent-prompt-preamble.md +16 -5
- package/templates/swarm-greptile-poller-prompt.md +21 -12
- package/vbrief/vbrief.md +4 -2
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"artifact-guards"
|
|
22
22
|
],
|
|
23
23
|
"path": "strategies/artifact-guards.md",
|
|
24
|
-
"body": "# Artifact Idempotency Guards\n\nShared guard rules for strategies that write to vBRIEF artifacts. Referenced by individual strategy files to prevent silent overwrites of approved or completed work.\n\nLegend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.\n\n**⚠️ See also**: [vbrief/vbrief.md](../vbrief/vbrief.md) | [strategies/v0-20-contract.md](./v0-20-contract.md) | [strategies/interview.md](./interview.md)\n\n---\n\n## When to Use\n\nThis file is not a standalone strategy — it is a shared guard referenced by other strategies. It activates automatically when a strategy writes to vBRIEF artifacts.\n\n- ! Referenced by spec-generating strategies: [speckit](./speckit.md), [enterprise](./enterprise.md), [rapid](./rapid.md)\n- ! Referenced by preparatory strategies: [bdd](./bdd.md), [discuss](./discuss.md), [research](./research.md), [map](./map.md), [probe](./probe.md)\n\n## Workflow\n\n1. Strategy reaches its output step\n2. Strategy follows the appropriate guard (Spec-Generating or Preparatory) from this file\n3. Guard checks file existence and status, prompts user if needed\n4. Strategy proceeds with the write or aborts based on user response\n\n---\n\n## Spec-Generating Guard (Full)\n\nApplies to strategies that write
|
|
24
|
+
"body": "# Artifact Idempotency Guards\n\nShared guard rules for strategies that write to vBRIEF artifacts. Referenced by individual strategy files to prevent silent overwrites of approved or completed work.\n\nLegend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.\n\n**⚠️ See also**: [vbrief/vbrief.md](../vbrief/vbrief.md) | [strategies/v0-20-contract.md](./v0-20-contract.md) | [strategies/interview.md](./interview.md)\n\n---\n\n## When to Use\n\nThis file is not a standalone strategy — it is a shared guard referenced by other strategies. It activates automatically when a strategy writes to vBRIEF artifacts.\n\n- ! Referenced by spec-generating strategies: [speckit](./speckit.md), [enterprise](./enterprise.md), [rapid](./rapid.md), [interview](./interview.md), [yolo](./yolo.md)\n- ! Referenced by preparatory strategies: [bdd](./bdd.md), [discuss](./discuss.md), [research](./research.md), [map](./map.md), [probe](./probe.md)\n\n## Workflow\n\n1. Strategy reaches its output step\n2. Strategy follows the appropriate guard (Spec-Generating or Preparatory) from this file\n3. Guard checks file existence and status, prompts user if needed\n4. Strategy proceeds with the write or aborts based on user response\n\n---\n\n## Spec-Generating Guard (Full)\n\nApplies to strategies that write project identity as `PROJECT-DEFINITION` (⊗ never `specification.vbrief.json` / `specification.xbrief.json` per [v0-20-contract.md](./v0-20-contract.md)): **speckit**, **enterprise**, **rapid**, **interview**, **yolo**.\n\n! **Target resolution (xbrief-first)**: guard the file that is the live project identity:\n1. `./xbrief/PROJECT-DEFINITION.xbrief.json` when it exists (canonical current layout)\n2. else `./vbrief/PROJECT-DEFINITION.vbrief.json` when it exists (legacy layout)\n3. else the intended write path for a greenfield create (usually `./xbrief/PROJECT-DEFINITION.xbrief.json`)\n\n! Before writing or updating that target, the strategy MUST perform the following checks (⊗ Never target the legacy `specification.*.json`):\n\n1. ! **Check existence**: Does the resolved target file already exist?\n - If NO: proceed with the write — no guard needed.\n - If YES: continue to step 2.\n\n2. ! **Read `plan.status`**: Parse the existing file and read `plan.status`.\n\n3. ! **Status: `approved` or `completed`**: Refuse to overwrite without explicit user confirmation.\n - ! Display: \"This artifact has status `{status}`. Overwriting will reset it to `draft` and discard approved/completed state. Continue? (yes/no)\"\n - ! Accept only explicit affirmative (`yes`, `confirmed`) — not vague responses (`proceed`, `ok`, `go ahead`)\n - ⊗ Silently overwrite an approved or completed artifact\n\n4. ! **Status: `draft` or `running`**: Warn and ask before overwriting.\n - ! Display: \"A `{status}` version of this artifact already exists. Replace it? (yes/no)\"\n - ~ If the user declines, offer to enrich (merge narratives) instead of replacing\n\n5. ! **Narrative preservation**: When overwriting `PROJECT-DEFINITION`, read existing `narratives` keys first. If the strategy only writes a subset of narratives (e.g. speckit Phase 1 writes only `Principles`), merge the new narrative into the existing set — do NOT replace all narratives with only the new key.\n - ⊗ Overwrite all `PROJECT-DEFINITION` narratives when the strategy only produces a single narrative key\n - ⊗ Guard only the legacy `vbrief/` path while an `xbrief/PROJECT-DEFINITION.xbrief.json` is the live identity\n\n---\n\n## Preparatory Guard (Light)\n\nApplies to strategies that write scoped records to `proposed/`: **bdd**, **discuss**, **research**, **map**, **probe**, and brownfield **Add scope** paths from interview/setup.\n\n! **Target folder resolution (xbrief-first)**: scan `./xbrief/proposed/` when it exists; else legacy `./vbrief/proposed/`. Prefer writing new scopes under the same root the project already uses.\n\n! Before writing a scope record to `proposed/`, the strategy MUST check for existing files with the same scope or feature name:\n\n1. ! **Check for existing file**: Scan the resolved `proposed/` folder for files matching the target scope/feature slug (e.g. `*-{feature}-bdd.xbrief.json`, `*-{scope}-context.vbrief.json`).\n - If NO match: proceed with the write — no guard needed.\n - If a match exists: continue to step 2.\n\n2. ! **Warn and ask**: Display: \"A scope record for this feature already exists at `{path}`. Replace it, or create a new version? (replace/new)\"\n - ! If replace: overwrite the existing file\n - ! If new: append a numeric suffix or use today's date to create a distinct file\n\n3. ~ **Read existing decisions**: If the existing file contains a `LockedDecisions` or similar narrative, surface those decisions to the agent context so they are not lost even if the user chooses to replace.\n\n⊗ Silently overwrite an existing scope record with the same feature/scope name without warning the user.\n⊗ Scan only legacy `vbrief/proposed/` when `xbrief/proposed/` is the live lifecycle root.\n\n---\n\n## Anti-Patterns\n\n- ⊗ Writing to `PROJECT-DEFINITION` without checking the file's current status (⊗ never write `specification.vbrief.json` / `specification.xbrief.json` at all per v0-20-contract.md)\n- ⊗ Guarding only `vbrief/PROJECT-DEFINITION.vbrief.json` while `xbrief/PROJECT-DEFINITION.xbrief.json` is the live identity\n- ⊗ Silently overwriting an `approved` or `completed` artifact — this discards locked decisions and approval state\n- ⊗ Replacing all `PROJECT-DEFINITION` narratives when the strategy only contributes one narrative key (e.g. `Principles`)\n- ⊗ Overwriting a scope record in `proposed/` without checking if one already exists for the same scope\n- ⊗ Accepting vague confirmation (`proceed`, `ok`) when the guard requires explicit confirmation for approved/completed artifacts\n"
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
"id": "bdd",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"discuss"
|
|
52
52
|
],
|
|
53
53
|
"path": "strategies/discuss.md",
|
|
54
|
-
"body": "# Discuss Strategy\n\nStructured alignment before planning — front-load decisions, prevent drift.\n\nLegend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.\n\n**⚠️ See also**: [strategies/interview.md](./interview.md) (Phase 1: Interview) | [strategies/speckit.md](./speckit.md) (Phase 2: Specify) | [core/glossary.md](../glossary.md)\n\n> Extends Deft's Interview phase with decision locking and Feynman technique. Adapted from [GSD](https://github.com/gsd-build/get-shit-done) discuss phase.\n\n---\n\n## Core Principle\n\nThe most expensive mistake is building the wrong thing. A 10-minute alignment conversation saves hours of re-implementation. Decisions made here flow through the entire pipeline — planning, execution, verification — and are **never re-debated** downstream.\n\n---\n\n## When to Use\n\n- ! Before planning any feature/phase with gray areas\n- ~ Before any feature where multiple reasonable approaches exist\n- ? Skip only when the path forward is unambiguous and the user confirms\n\n## The Feynman Approach\n\nUse the Feynman technique: if the user (or you) can't explain the feature in simple, concrete terms, the understanding isn't there yet.\n\n- ! **Make the abstract concrete** — \"Walk me through using this.\" \"What does that look like on screen?\" \"What happens when this fails?\"\n- ! **Explain it back** — Restate the user's intent in your own words. If the restatement surprises them, the spec is wrong.\n- ! **Find the gaps** — Where the explanation gets hand-wavy is where the bugs will be.\n- ~ Use the \"teach it to a child\" filter: if the expected behavior can't be described without jargon, it's underspecified.\n\n## Questioning Behaviors\n\n### Follow Energy\n\n- ~ Whatever the user emphasizes, dig deeper into that\n- ⊗ Robotically marching through a predetermined question list\n- ~ If the user spends time on error handling, ask deeper questions about error handling\n\n### Challenge Vagueness\n\n- ! Push back on fuzzy answers: \"Make it simple\" → \"Simple how? For the user? To implement? To extend later?\"\n- ! Push back on assumed agreement: \"Standard auth\" → \"JWT with refresh? Server-side sessions? OAuth? Which standard?\"\n- ⊗ Accept fuzzy input — it produces divergent output\n\n### Scope Guardrails\n\n- ! If the user suggests a capability belonging to a different feature, capture it as **deferred**\n- ~ Redirect: \"That sounds like a new capability — I'll note it. For now, let's focus on [current scope].\"\n- ~ Record deferred ideas in `./vbrief/plan.vbrief.json` with `deferred` status and a narrative explaining why\n\n## Domain-Sensitive Questions\n\nAdapt question focus to what's being built:\n\n- **Visual features** → Layout, density, interactions, empty states\n- **APIs/CLIs** → Response format, flags, error handling, verbosity\n- **Data systems** → Schema, validation, migration, edge cases\n- **Organization tasks** → Grouping criteria, naming, duplicates, exceptions\n\n## Output\n\n! Before writing output artifacts, follow the [Preparatory Guard](./artifact-guards.md#preparatory-guard-light).\n\n- ! Produce a `vbrief/proposed/{scope}-context.vbrief.json` scope vBRIEF with a `LockedDecisions` narrative\n- ! Each decision includes: **what** was decided, **why**, and **alternatives considered**\n- ! This vBRIEF is injected into all downstream work: planning, execution, verification\n- ! Persist decisions as vBRIEF narratives on the relevant plan items\n- ⊗ Write decisions to a hand-authored markdown context file -- use vBRIEF narratives for token-efficient agent consumption\n\n! After emitting the scope vBRIEF to `vbrief/proposed/`, surface the GitHub-issue tracking hint from [emit-hints.md](./emit-hints.md) — name all three patterns (none / `--umbrella` / `--per-vbrief`).\n\n## Decision Locking\n\n- ! Decisions in the vBRIEF `LockedDecisions` narrative are **locked** -- downstream tasks inherit them, don't re-debate\n- ! If a locked decision needs revisiting, explicitly flag it as unlocked with justification\n- ⊗ Silently making a different choice because the agent forgot what was decided\n- ⊗ Re-debating a settled decision without explicit user approval\n\n---\n\n## Then: Chaining Gate\n\nAfter alignment is complete and decisions are locked in `vbrief/proposed/{scope}-context.vbrief.json`,\nreturn to the [chaining gate](./interview.md#chaining-gate) so the user can\nrun additional preparatory strategies or proceed to spec generation.\n\n- ! On completion, register artifacts in `./vbrief/plan.vbrief.json`:\n - Update `completedStrategies`: increment `runCount` for `\"discuss\"`,\n append artifact path (`vbrief/proposed/{scope}-context.vbrief.json`)\n - Append the path to the flat `artifacts` array\n- ! Return to [interview.md Chaining Gate](./interview.md#chaining-gate)\n (the discuss phase replaces the interview's question-gathering -- decisions are\n already made, so the interview will be short or skipped entirely)\n- ! The locked decisions from `vbrief/proposed/{scope}-context.vbrief.json` MUST flow into subsequent\n strategies and spec generation\n- ⊗ End the session after discuss without returning to the chaining gate\n or the invoking strategy's next-step menu\n\n! **Standalone context:** If invoked from a standalone strategy (e.g. map's\n standalone next-step menu) rather than from the interview chaining gate,\n return to the invoking strategy's menu instead.\n\n---\n\n## Workflow\n\n1. **Open** -- Start with the user's goal statement; restate it in your own words\n2. **Explore** -- Follow energy, challenge vagueness, ask domain-sensitive questions\n3. **Lock** -- Record each decision in `vbrief/proposed/{scope}-context.vbrief.json` `LockedDecisions` narrative with what/why/alternatives\n4. **Verify** -- Explain the full picture back to the user (Feynman check)\n5. **Chain** -- Return to [interview.md Chaining Gate](./interview.md#chaining-gate), or -- if invoked from a standalone strategy (e.g. map's standalone next-step menu) -- return to the invoking strategy's menu per the [standalone-context rule](#then-chaining-gate) above\n\n## Anti-Patterns\n\n- ⊗ Skipping discuss and immediately writing code\n- ⊗ Asking generic checklist questions instead of following energy\n- ⊗ Accepting \"make it nice\" / \"standard approach\" / \"whatever works\" without pushback\n- ⊗ Scope creep — capturing out-of-scope ideas inline instead of deferring\n- ⊗ Decisions that exist only in conversation history (they must be in the vBRIEF `LockedDecisions` narrative)\n- ⊗ Ending after discuss without chaining into specification generation (chained mode; in standalone context, returning to the invoking strategy's menu satisfies the completion requirement per the [standalone-context rule](#then-chaining-gate))\n"
|
|
54
|
+
"body": "# Discuss Strategy\n\nStructured alignment before planning — front-load decisions, prevent drift.\n\nLegend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.\n\n**⚠️ See also**: [strategies/interview.md](./interview.md) (Phase 1: Interview) | [strategies/speckit.md](./speckit.md) (Phase 2: Specify) | [core/glossary.md](../glossary.md)\n\n> Extends Deft's Interview phase with decision locking and Feynman technique. Adapted from [GSD](https://github.com/gsd-build/get-shit-done) discuss phase.\n\n---\n\n## Core Principle\n\nThe most expensive mistake is building the wrong thing. A 10-minute alignment conversation saves hours of re-implementation. Decisions made here flow through the entire pipeline — planning, execution, verification — and are **never re-debated** downstream.\n\n---\n\n## When to Use\n\n- ! Before planning any feature/phase with gray areas\n- ~ Before any feature where multiple reasonable approaches exist\n- ? Skip only when the path forward is unambiguous and the user confirms\n\n## The Feynman Approach\n\nUse the Feynman technique: if the user (or you) can't explain the feature in simple, concrete terms, the understanding isn't there yet.\n\n- ! **Make the abstract concrete** — \"Walk me through using this.\" \"What does that look like on screen?\" \"What happens when this fails?\"\n- ! **Explain it back** — Restate the user's intent in your own words. If the restatement surprises them, the spec is wrong.\n- ! **Find the gaps** — Where the explanation gets hand-wavy is where the bugs will be.\n- ~ Use the \"teach it to a child\" filter: if the expected behavior can't be described without jargon, it's underspecified.\n\n## Questioning Behaviors\n\n### Follow Energy\n\n- ~ Whatever the user emphasizes, dig deeper into that\n- ⊗ Robotically marching through a predetermined question list\n- ~ If the user spends time on error handling, ask deeper questions about error handling\n\n### Challenge Vagueness\n\n- ! Push back on fuzzy answers: \"Make it simple\" → \"Simple how? For the user? To implement? To extend later?\"\n- ! Push back on assumed agreement: \"Standard auth\" → \"JWT with refresh? Server-side sessions? OAuth? Which standard?\"\n- ⊗ Accept fuzzy input — it produces divergent output\n\n### Scope Guardrails\n\n- ! If the user suggests a capability belonging to a different feature, capture it as **deferred**\n- ~ Redirect: \"That sounds like a new capability — I'll note it. For now, let's focus on [current scope].\"\n- ~ Record deferred ideas in `./vbrief/plan.vbrief.json` with `deferred` status and a narrative explaining why\n\n## Domain-Sensitive Questions\n\nAdapt question focus to what's being built:\n\n- **Visual features** → Layout, density, interactions, empty states\n- **APIs/CLIs** → Response format, flags, error handling, verbosity\n- **Data systems** → Schema, validation, migration, edge cases\n- **Organization tasks** → Grouping criteria, naming, duplicates, exceptions\n\n## Output\n\n! Before writing output artifacts, follow the [Preparatory Guard](./artifact-guards.md#preparatory-guard-light).\n\n- ! Produce a `vbrief/proposed/{scope}-context.vbrief.json` scope vBRIEF with a `LockedDecisions` narrative\n- ! Each decision includes: **what** was decided, **why**, and **alternatives considered**\n- ! When the lock is an intentional under-build (weaker Now + decided end-product Later), the decision MUST also include dual-path graduation fields: `now`, `later`, `graduationRef`, `trigger`, and `status` (`open` | `shipped` | `cancelled`) — see [Graduation (Now+Later)](#graduation-nowlater-dual-path-locks-2899)\n- ! This vBRIEF is injected into all downstream work: planning, execution, verification\n- ! Persist decisions as vBRIEF narratives on the relevant plan items\n- ⊗ Write decisions to a hand-authored markdown context file -- use vBRIEF narratives for token-efficient agent consumption\n\n! After emitting the scope vBRIEF to `vbrief/proposed/`, surface the GitHub-issue tracking hint from [emit-hints.md](./emit-hints.md) — name all three patterns (none / `--umbrella` / `--per-vbrief`).\n\n## Decision Locking\n\n- ! Decisions in the vBRIEF `LockedDecisions` narrative are **locked** -- downstream tasks inherit them, don't re-debate\n- ! If a locked decision needs revisiting, explicitly flag it as unlocked with justification\n- ⊗ Silently making a different choice because the agent forgot what was decided\n- ⊗ Re-debating a settled decision without explicit user approval\n\n## Graduation (Now+Later) dual-path locks (#2899)\n\n**Graduation** (alias: Now+Later) is a first-class decision shape for intentional under-builds:\n\n> We *decided* to ship a weaker path **now**, and we also decided what the end-product path is **later**.\n\nIt is **not** the same as other \"later\" concepts:\n\n| Concept | Meaning |\n|---|---|\n| `DeferredDecisions` (probe) | Not decided yet; open question with justification |\n| deferred plan item / `triage:defer` | Out of scope, or not accepted into the workspace backlog |\n| rapid **graduate** | Spike / prototype → fresh full interview/spec cycle |\n| **Graduation** | Decided weaker **Now** + decided end-product **Later** |\n\nGlossary naming for this term is owned by sibling work (#2907). Strategy prose here is the Wave A contract agents must follow until the glossary entry lands.\n\n### When a lock is an under-build\n\n- ! When a `LockedDecisions` entry chooses a temporary, weaker, MVP, or shortcut approach **and** a stronger end-product approach is also decided, the entry MUST record a dual-path graduation shape with all of:\n - `now` — what this scope ships\n - `later` — the end-product approach\n - `graduationRef` — GitHub issue URL and/or scope xBRIEF path that tracks Later work\n - `trigger` — free-text condition that makes Later required (examples are illustrative only, e.g. \"before multi-tenant customers\", \"when latency SLO is adopted\")\n - `status` — `open` | `shipped` | `cancelled` (cancellation MUST include justification)\n- ! A permanent approach lock (no weaker temporary path) does **not** require graduation fields\n- ! Chat-only \"we'll harden this later\" is insufficient — same anti-pattern as decisions that exist only in conversation history\n- ~ Emitting `graduationRef` SHOULD use existing [emit-hints](./emit-hints.md) patterns (none / `--umbrella` / `--per-vbrief`) rather than a parallel SCM ontology\n- ⊗ Routing a *decided* under-build into `DeferredDecisions`, a deferred plan item, or `triage:defer` — those surfaces mean undecided or out-of-scope, not dual-path delivery\n- ⊗ Treating rapid prototype **graduate** as Graduation dual-path tracking inside a normal production build\n\n### Lifecycle: Now complete ≠ Later closed\n\n- ! `task scope:complete` on the Now story MUST NOT imply closure of linked graduation work (`graduationRef` issue and/or Later scope xBRIEF stay open until Later ships or is explicitly cancelled)\n- ⊗ Closing a graduation ticket solely because the MVP / Now story completed\n- ~ Wave A (soft): when completing a story whose `LockedDecisions` contain an open graduation, warn and audit if `graduationRef` is missing or invalid — hard fail / policy flag is Wave B follow-on\n- ! Durable surfaces for graduation are: (1) strategy output narratives (this contract), (2) optional always-loadable ProjectRules for stricter consumer policy — ⊗ Cursor-rule-only as the sole persistence path\n\n---\n\n## Then: Chaining Gate\n\nAfter alignment is complete and decisions are locked in `vbrief/proposed/{scope}-context.vbrief.json`,\nreturn to the [chaining gate](./interview.md#chaining-gate) so the user can\nrun additional preparatory strategies or proceed to spec generation.\n\n- ! On completion, register artifacts in `./vbrief/plan.vbrief.json`:\n - Update `completedStrategies`: increment `runCount` for `\"discuss\"`,\n append artifact path (`vbrief/proposed/{scope}-context.vbrief.json`)\n - Append the path to the flat `artifacts` array\n- ! Return to [interview.md Chaining Gate](./interview.md#chaining-gate)\n (the discuss phase replaces the interview's question-gathering -- decisions are\n already made, so the interview will be short or skipped entirely)\n- ! The locked decisions from `vbrief/proposed/{scope}-context.vbrief.json` MUST flow into subsequent\n strategies and spec generation\n- ⊗ End the session after discuss without returning to the chaining gate\n or the invoking strategy's next-step menu\n\n! **Standalone context:** If invoked from a standalone strategy (e.g. map's\n standalone next-step menu) rather than from the interview chaining gate,\n return to the invoking strategy's menu instead.\n\n---\n\n## Workflow\n\n1. **Open** -- Start with the user's goal statement; restate it in your own words\n2. **Explore** -- Follow energy, challenge vagueness, ask domain-sensitive questions\n3. **Lock** -- Record each decision in `vbrief/proposed/{scope}-context.vbrief.json` `LockedDecisions` narrative with what/why/alternatives (and dual-path graduation fields when the lock is an under-build; #2899)\n4. **Verify** -- Explain the full picture back to the user (Feynman check)\n5. **Chain** -- Return to [interview.md Chaining Gate](./interview.md#chaining-gate), or -- if invoked from a standalone strategy (e.g. map's standalone next-step menu) -- return to the invoking strategy's menu per the [standalone-context rule](#then-chaining-gate) above\n\n## Anti-Patterns\n\n- ⊗ Skipping discuss and immediately writing code\n- ⊗ Asking generic checklist questions instead of following energy\n- ⊗ Accepting \"make it nice\" / \"standard approach\" / \"whatever works\" without pushback\n- ⊗ Scope creep — capturing out-of-scope ideas inline instead of deferring\n- ⊗ Decisions that exist only in conversation history (they must be in the vBRIEF `LockedDecisions` narrative)\n- ⊗ Ending after discuss without chaining into specification generation (chained mode; in standalone context, returning to the invoking strategy's menu satisfies the completion requirement per the [standalone-context rule](#then-chaining-gate))\n"
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
"id": "emit-hints",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"interview"
|
|
82
82
|
],
|
|
83
83
|
"path": "strategies/interview.md",
|
|
84
|
-
"body": "# Interview Strategy\n\nThe standard Deft workflow: structured interview → SPECIFICATION. This is the\ncanonical source of truth for the interview process. All entry points (CLI via\n`run spec`, agent via `deft-directive-setup` Phase 3, and `templates/make-spec.md`) MUST\nfollow this strategy.\n\nLegend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.\n\n**⚠️ See also**: [strategies/discuss.md](./discuss.md) | [strategies/yolo.md](./yolo.md) | [core/glossary.md](../glossary.md)\n\n## When to Use\n\n- ! Default strategy for all new projects\n- ~ Projects with unclear or evolving requirements\n- ~ When stakeholder alignment is needed before implementation\n- ? Skip to SPECIFICATION phase if requirements are already fully documented\n\n---\n\n## Chaining Gate\n\nBefore spec generation, offer the user a chance to run preparatory strategies\nor switch to a different spec-generating strategy. This gate is the single\norchestration point for strategy composition.\n\n! The chaining gate MUST always be shown — even when the interview strategy is\ninvoked directly with no prior strategy.\n! The chaining gate is a **blocking question**. The AI MUST present the options\nand wait for the user to choose before proceeding.\n⊗ Skip the chaining gate or proceed to the sizing gate without presenting it.\n\n### When It Appears\n\n- ! Before the [Sizing Gate](#sizing-gate) on every entry to the interview strategy\n- ! After each completed preparatory strategy (recursive — the gate reappears)\n- ! After the [Acceptance Gate](#acceptance-gate) when the user chooses \"Revise\" or \"Switch\"\n\n### Options\n\nPresent two groups sourced from the `Type` column in\n[strategies/README.md](./README.md#strategy-types):\n\n**Default:**\n1. **Proceed to specification** (default) — continue to the [Sizing Gate](#sizing-gate)\n\n**Preparatory strategies** (type: `preparatory` — loops back to this gate on completion):\n- Research — investigate the domain, find libraries, identify pitfalls\n- Discuss — lock key decisions using Feynman technique\n- Probe — adversarially stress-test the plan; surface assumptions, edge cases, and risks\n- Map — analyze existing codebase conventions\n\n~ Some preparatory strategies (currently map) also support standalone invocation\nvia `/deft:run:<name>` without entering the interview flow. When invoked standalone,\nthey present their own completion options instead of returning to this gate.\nSee `strategies/map.md` for standalone behavior.\n\n**Switch spec-generating strategy** (type: `spec-generating` — replaces current pipeline):\n- Yolo — auto-pilot, Johnbot picks all answers\n- SpecKit — formal spec process with story readiness before implementation\n\n### Run Count Annotations\n\n- ! Previously-run strategies MUST display with a run count (e.g., `Research (ran 1×)`)\n- ! No strategy is ever removed from the gate — users can re-run any strategy\n- ! Run counts are read from `completedStrategies` in\n [`./vbrief/plan.vbrief.json`](../vbrief/vbrief.md#strategy-chaining-fields)\n\n### State Tracking\n\n- ! On completion of a preparatory strategy, update `completedStrategies` in\n `./vbrief/plan.vbrief.json`: increment `runCount`, append artifact paths\n- ! Append all new artifact paths to the flat `artifacts` array\n- ! The next strategy and eventual spec generation MUST load all artifacts\n listed in `plan.vbrief.json`\n\n### Example Prompt\n\n```\nReady to generate the specification. Before we proceed, would you like to:\n\n1. Proceed to specification (default)\n\n--- Preparatory (loops back) ---\n2. Run a research phase — investigate the domain, find libraries, identify pitfalls\n3. Run a discuss phase — lock key decisions using Feynman technique\n4. Run a probe phase — adversarially stress-test the plan; surface assumptions, edge cases, and risks\n5. Run a map phase — analyze existing codebase conventions\n\n--- Switch strategy ---\n6. Switch to yolo — auto-pilot picks all answers\n7. Switch to speckit — formal spec process with story readiness before implementation\n\n8. Other (specify)\n```\n\n---\n\n## Sizing Gate\n\nBefore the interview begins, determine project complexity to select the\nappropriate path. The gate runs once, immediately after hearing what the user\nwants to build.\n\n! The sizing gate is a **blocking question**. The AI MUST propose a size and\nwait for the user to confirm or override before asking any interview questions.\n⊗ Combine the sizing proposal with the first interview question in the same message.\n⊗ Proceed to interview questions before the user has explicitly confirmed the path.\n\n### Sizing Signals\n\nThe AI SHOULD propose a size based on these signals; the user confirms or overrides:\n\n- Number of features (≤5 → Light, >5 → Full)\n- Number of components/services (1–2 → Light, 3+ → Full)\n- Expected duration (days → Light, weeks/months → Full)\n- Team/agent count (solo → Light, multi-agent/swarm → Full)\n- Integration complexity (standalone → Light, external APIs/auth/DB → Full)\n\n### PROJECT-DEFINITION.vbrief.json Override\n\n`PROJECT-DEFINITION.vbrief.json` narratives ? declare `\"Process\": \"Light\"` or `\"Process\": \"Full\"` to skip the\ngate entirely. `PROJECT.md` (deprecated) may also carry this field. If the field is absent or empty, the AI MUST ask.\n\n## Workflow Overview\n\n```mermaid\nflowchart LR\n subgraph interview [\"Interview Strategy\"]\n G{\"⚖️ Sizing Gate\"}\n I_L[\"💬 Interview<br/><i>Light path</i>\"]\n I_F[\"💬 Interview<br/><i>Full path</i>\"]\n P[\"📄 PRD<br/><i>What to build</i>\"]\n S[\"📋 SPECIFICATION<br/><i>How to build it</i>\"]\n end\n\n G -->|\"Light\"| I_L\n G -->|\"Full\"| I_F\n I_L -->|\"Ambiguity resolved\"| S\n I_F -->|\"Ambiguity resolved\"| P\n P -->|\"Approved\"| S\n S -->|\"Ready\"| IMPL[\"🔨 Implementation\"]\n\n style G fill:#f0abfc,stroke:#a21caf,color:#000\n style I_L fill:#c4b5fd,stroke:#7c3aed,color:#000\n style I_F fill:#c4b5fd,stroke:#7c3aed,color:#000\n style P fill:#fef08a,stroke:#ca8a04,color:#000\n style S fill:#6ee7b7,stroke:#059669,color:#000\n style IMPL fill:#7dd3fc,stroke:#0284c7,color:#000\n```\n\n---\n\n## Interview Rules (shared by both paths)\n\n- ~ Use Claude AskInterviewQuestion when available (emulate if not)\n- ! Ask **ONE** focused, non-trivial question per step\n- ⊗ Ask multiple questions at once or sneak in \"also\" questions\n- ~ Provide numbered answer options when appropriate\n- ! Include \"other\" option for custom/unknown responses\n- ! Indicate which option is RECOMMENDED\n- ! When making an opinionated recommendation, state the principle (1 sentence)\n- ! When done, append all questions asked and answers given to the working document\n\n### Question Areas\n\n- ! Missing decisions (language, framework, deployment)\n- ! Edge cases (errors, boundaries, failure modes)\n- ! Implementation details (architecture, patterns, libraries)\n- ! Requirements (performance, security, scalability)\n- ! UX/constraints (users, timeline, compatibility)\n- ! Tradeoffs (simplicity vs features, speed vs safety)\n\n### Transition Criteria (interview complete)\n\n- ! All major decisions have answers\n- ! Edge cases are addressed\n- ! User has approved key tradeoffs (Interview strategy) or Johnbot has chosen recommended options (Yolo strategy)\n- ~ Little ambiguity remains\n\n---\n\n## Light Path (small/medium projects)\n\nInterview → scope vBRIEFs (date-prefixed in proposed/) + PROJECT-DEFINITION.vbrief.json + rendered SPECIFICATION (v0.20 contract).\n\n### Flow\n\n1. Sizing gate selects Light\n2. Interview (rules above)\n3. Write scope vBRIEF(s) to `./vbrief/proposed/YYYY-MM-DD-<slug>.vbrief.json` (date-prefixed per vbrief filename convention) with `status: proposed`\n4. Run `task project:render` to create/update `./vbrief/PROJECT-DEFINITION.vbrief.json` (full project identity + items registry) and ensure all five lifecycle folders exist\n5. Summarize decisions, ask user to review\n6. On approval, use `task scope:promote` (or equivalent) to move scope vBRIEF(s) to `./vbrief/pending/` with `status: pending` / `approved`\n7. Run `task spec:render` (SPECIFICATION.md is a rendered derivative with deprecation sentinel; `specification.vbrief.json` is legacy and is NOT written by this strategy on the v0.20 path)\n\n! At the emission step (step 3 above), after writing the scope vBRIEF(s) to `./vbrief/proposed/`, surface the GitHub-issue tracking hint from [emit-hints.md](./emit-hints.md) — name all three patterns (none / `--umbrella` / `--per-vbrief`).\n\n### SPECIFICATION Structure (Light)\n\n```markdown\n# [Project Name] SPECIFICATION\n\n## Overview\nBrief summary of the project.\n\n## Requirements\n\n### Functional Requirements\n- FR-1: [requirement]\n- FR-2: [requirement]\n\n### Non-Functional Requirements\n- NFR-1: Performance — [requirement]\n- NFR-2: Security — [requirement]\n\n## Architecture\nHigh-level system design, components, data flow.\n\n## Implementation Plan\n\n### Phase 1: Foundation\n#### Subphase 1.1: Setup\n- Task 1.1.1: [description] (traces: FR-1)\n - Dependencies: none\n - Acceptance: [criteria]\n\n#### Subphase 1.2: Core (depends on: 1.1)\n- Task 1.2.1: [description] (traces: FR-2, NFR-1)\n\n### Phase 2: Features (depends on: Phase 1)\n...\n\n## Testing Strategy\nHow to verify the implementation meets requirements.\n\n## Deployment\nHow to ship it.\n```\n\n- ! Requirements section MUST appear in SPECIFICATION.md (embedded, no separate PRD)\n- ! Each task SHOULD reference which FR/NFR it implements via `(traces: FR-N)`\n- ⊗ Create a separate PRD.md on the Light path\n\n---\n\n## Full Path (large/complex projects)\n\nInterview → PRD → scope vBRIEFs (date-prefixed in proposed/) + PROJECT-DEFINITION.vbrief.json + rendered SPECIFICATION (v0.20 contract).\n\n### Flow\n\n1. Sizing gate selects Full\n2. Interview (rules above)\n3. Generate `PRD.md` — user approval gate\n4. Write scope vBRIEF(s) to `./vbrief/proposed/YYYY-MM-DD-<slug>.vbrief.json` (date-prefixed per vbrief filename convention) with `status: proposed`\n5. Run `task project:render` to create/update `./vbrief/PROJECT-DEFINITION.vbrief.json` (full project identity + items registry) and ensure all five lifecycle folders exist\n6. Summarize decisions, ask user to review\n7. On approval, use `task scope:promote` (or equivalent) to move scope vBRIEF(s) to `./vbrief/pending/` with `status: pending` / `approved`\n8. Run `task spec:render` (SPECIFICATION.md is a rendered derivative with deprecation sentinel; `specification.vbrief.json` is legacy and is NOT written by this strategy on the v0.20 path)\n\n! At the emission step (step 4 above), after writing the scope vBRIEF(s) to `./vbrief/proposed/`, surface the GitHub-issue tracking hint from [emit-hints.md](./emit-hints.md) — name all three patterns (none / `--umbrella` / `--per-vbrief`).\n\n### PRD Structure (Full path only)\n\n```markdown\n# [Project Name] PRD\n\n## Problem Statement\nWhat problem does this solve? Who has this problem?\n\n## Goals\n- Primary goal\n- Secondary goals\n- Non-goals (explicitly out of scope)\n\n## User Stories\nAs a [user type], I want [capability] so that [benefit].\n\n## Requirements\n\n### Functional Requirements\n- FR-1: [requirement]\n- FR-2: [requirement]\n\n### Non-Functional Requirements\n- NFR-1: Performance — [requirement]\n- NFR-2: Security — [requirement]\n\n## Success Metrics\nHow do we know this succeeded?\n\n## Open Questions\nAny remaining decisions deferred to implementation.\n```\n\n### PRD Guidelines\n\n- ! Focus on WHAT, not HOW\n- ! Use RFC 2119 language (MUST, SHOULD, MAY)\n- ! Number all requirements for traceability\n- ~ Include acceptance criteria for each requirement\n- ⊗ Include implementation details or architecture\n\n### PRD Transition Criteria\n\n- ! All functional requirements documented\n- ! Non-functional requirements specified\n- ! User has reviewed and approved PRD\n- ~ No blocking open questions remain\n\n### PRD Approval Menu (#740, refs #767)\n\n! After every PRD (Product Requirements Document) review, the agent MUST\npresent the canonical numbered approval menu defined in\n[`../references/plain-english-ux.md`](../references/plain-english-ux.md)\n`## Rule 4`. The menu replaces ambiguous `Accept / Refine / Edit`\nbuttons with action-shaped labels and follows the #767 framework rule\nfor deterministic numbered menus -- the **final two numbered options\nMUST be `Discuss` and `Back`**, in that order.\n\n```\nWhat would you like to do with the PRD (Product Requirements Document)?\n\n 1. Approve and continue (lock the PRD, generate the SPECIFICATION)\n 2. Suggest changes (you describe what to change; the agent rewrites)\n 3. Edit yourself (you edit the PRD directly; the agent waits)\n 4. Discuss\n 5. Back\n\nEnter confirm / b back / 0 discuss\n```\n\n! When `contracts/deterministic-questions.md` lands (Agent 1, #767), this\nstrategy MUST defer to that contract for canonical menu wording.\n\n! When the PRD review surfaces a red/green diff, the agent MUST emit a\nnon-alarming preface above it (per `references/plain-english-ux.md` Rule 5):\n\n```\nHere's what changed since the previous draft. Red lines were removed,\ngreen lines were added. Nothing here is broken -- this is a normal\nreview.\n```\n\n? Alternatively, the agent MAY hide the diff entirely on the first review\npass and present a plain-English summary of changes; show the diff only\non the second pass or when the user explicitly asks for it.\n\n- ⊗ Use plain `Accept / Refine / Edit` buttons without explanatory\n parentheticals.\n- ⊗ Add a numbered approval menu where Discuss and Back are not the\n final two options.\n- ⊗ Show a red/green diff at first review without a non-alarming preface.\n\n### SPECIFICATION Structure (Full)\n\n```markdown\n# [Project Name] SPECIFICATION\n\n## Overview\nBrief summary and link to PRD.\n\n## Architecture\nHigh-level system design, components, data flow.\n\n## Implementation Plan\n\n### Phase 1: Foundation\n#### Subphase 1.1: Setup\n- Task 1.1.1: [description] (traces: FR-1)\n - Dependencies: none\n - Acceptance: [criteria]\n\n#### Subphase 1.2: Core (depends on: 1.1)\n- Task 1.2.1: [description] (traces: FR-2, NFR-1)\n\n### Phase 2: Features (depends on: Phase 1)\n...\n\n## Testing Strategy\nHow to verify the implementation meets requirements.\n\n## Deployment\nHow to ship it.\n```\n\n---\n\n## SPECIFICATION Guidelines (both paths)\n\n- ! Reference requirement IDs (FR-1, NFR-2, etc.) in each task\n- ! Break into phases, subphases, tasks\n- ! Mark ALL dependencies explicitly\n- ! Design for parallel work (multiple agents)\n- ! End each phase/subphase with tests that pass\n- ~ Size tasks for 1-4 hours of work\n- ~ Minimize inter-task dependencies\n- ⊗ Write code (specification only)\n\n### Task Format\n\nEach task SHOULD include:\n- ! Clear description\n- ! Dependencies (or \"none\")\n- ! Acceptance criteria\n- ~ Estimated effort\n- ? Assigned agent (for swarm mode)\n\n### Transition Criteria\n\n- ! All requirements mapped to tasks\n- ! Dependencies form a valid DAG (no cycles)\n- ! Scope vBRIEF(s) exist in `./vbrief/proposed/` (with date-prefixed filenames and `status: \"proposed\"`) or promoted to pending/active (with `status: \"approved\" / \"pending\"`)\n- ! `./vbrief/PROJECT-DEFINITION.vbrief.json` is present (populated via `task project:render`)\n- ! `SPECIFICATION.md` has been rendered via `task spec:render`\n- ! Proceed to [Acceptance Gate](#acceptance-gate)\n\n---\n\n## Acceptance Gate\n\nAfter spec generation, present the user with a final decision before\nimplementation begins.\n\n! The acceptance gate MUST appear after every spec generation (both Light and\nFull paths).\n! The acceptance gate is a **blocking question**. The AI MUST present the\noptions and wait for the user to choose.\n\n### Options\n\n1. **Accept** — spec is approved, proceed to implementation\n - ! Before handing off to implementation, verify the project toolchain is installed and functional — see [../coding/toolchain.md](../coding/toolchain.md); stop and report if any required tool is missing\n2. **Revise** — return to the [Chaining Gate](#chaining-gate) with all prior\n context preserved (completed strategies, artifacts). Run additional\n preparatory strategies or regenerate the spec.\n3. **Switch strategy** — return to the [Chaining Gate](#chaining-gate) to select\n a different spec-generating strategy (e.g., switch from interview to speckit)\n\n### SPECIFICATION Approval Menu (#740, refs #767)\n\n! In addition to the structured Accept / Revise / Switch options above,\nthe agent MUST present the canonical numbered approval menu defined in\n[`../references/plain-english-ux.md`](../references/plain-english-ux.md)\n`## Rule 4`. The menu states what each choice will actually do, in\nplain-English action-shaped labels, and follows the #767 framework rule\nfor deterministic numbered menus -- the **final two numbered options\nMUST be `Discuss` and `Back`**, in that order.\n\n```\nWhat would you like to do with the SPECIFICATION?\n\n 1. Approve and continue (lock the SPEC, proceed to implementation)\n 2. Suggest changes (you describe what to change; the agent rewrites)\n 3. Edit yourself (you edit the SPEC directly; the agent waits)\n 4. Discuss\n 5. Back\n\nEnter confirm / b back / 0 discuss\n```\n\n! Option 1 (`Approve and continue`) maps to the `Accept` option above\n(which then runs the toolchain verification). Option 2 (`Suggest\nchanges`) and Option 3 (`Edit yourself`) both map to `Revise` (return to\nthe Chaining Gate with prior context preserved). The numbered menu is\nthe user-facing surface; the structured Accept / Revise / Switch above\nis the agent's internal contract.\n\n! When `contracts/deterministic-questions.md` lands (Agent 1, #767), this\nstrategy MUST defer to that contract for canonical menu wording.\n\n! When the SPECIFICATION review surfaces a red/green diff, the agent\nMUST emit a non-alarming preface above it (per\n`references/plain-english-ux.md` Rule 5):\n\n```\nHere's what changed since the previous draft. Red lines were removed,\ngreen lines were added. Nothing here is broken -- this is a normal\nreview.\n```\n\n? Alternatively, the agent MAY hide the diff entirely on the first\nreview pass and present a plain-English summary of changes; show the\ndiff only on the second pass or when the user explicitly asks for it.\n\n- ⊗ Add a numbered approval menu where Discuss and Back are not the\n final two options.\n- ⊗ Show a red/green diff at first review without a non-alarming preface.\n\n### Rejected Spec Archival\n\n- ! When the user chooses \"Revise\" or \"Switch\", the current `SPECIFICATION.md`\n MUST be archived to `history/specs/` before regeneration\n- ! Archived name format: `SPECIFICATION-rejected-{ISO-timestamp}.md`\n (e.g., `SPECIFICATION-rejected-2026-03-15T19-23-00Z.md`)\n- ! If a `PRD.md` exists (Full path), it is NOT archived — only the spec\n- ~ Include a one-line header in the archived file noting why it was rejected\n\n### State Preservation\n\n- ! All `completedStrategies` and `artifacts` in `plan.vbrief.json` MUST be\n preserved across revisions\n- ! The chaining gate will show updated run counts reflecting the full session history\n\n---\n\n## Artifacts Summary\n\n**Light path:**\n\n| Artifact | Purpose | Created By |\n|----------|---------|------------|\n| `./vbrief/proposed/YYYY-MM-DD-*.vbrief.json` | Scope story vBRIEFs (date-prefixed, v0.20 contract) | Interview |\n| `./vbrief/PROJECT-DEFINITION.vbrief.json` | Project identity gestalt + items registry | `task project:render` (triggered by strategy) |\n| `SPECIFICATION.md` | Generated plan with embedded Requirements (rendered derivative; deprecation sentinel) | `task spec:render` |\n| (no `specification.vbrief.json`) | Legacy artifact — omitted on v0.20 path | — |\n\n**Full path:**\n\n| Artifact | Purpose | Created By |\n|----------|---------|------------|\n| `PRD.md` | What to build (approval gate) | Interview |\n| `./vbrief/proposed/YYYY-MM-DD-*.vbrief.json` | Scope story vBRIEFs (date-prefixed, v0.20 contract) | Post-PRD interview |\n| `./vbrief/PROJECT-DEFINITION.vbrief.json` | Project identity gestalt + items registry | `task project:render` (triggered by strategy) |\n| `SPECIFICATION.md` | Generated implementation plan (rendered derivative; deprecation sentinel) | `task spec:render` |\n| (no `specification.vbrief.json`) | Legacy artifact — omitted on v0.20 path | — |\n\n## Invoking This Strategy\n\n```\n/deft:run:interview [project name]\n```\n\nOr explicitly:\n\n```\nUse the interview strategy to plan [project].\n```\n\nAfter completion:\n\n```\nimplement the scope vBRIEFs in ./vbrief/active/\n```\n"
|
|
84
|
+
"body": "# Interview Strategy\n\nThe standard Deft workflow: structured interview → SPECIFICATION. This is the\ncanonical source of truth for the interview process. All entry points (CLI via\n`run spec`, agent via `deft-directive-setup` Phase 3, and `templates/make-spec.md`) MUST\nfollow this strategy.\n\nLegend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.\n\n**⚠️ See also**: [strategies/discuss.md](./discuss.md) | [strategies/yolo.md](./yolo.md) | [strategies/artifact-guards.md](./artifact-guards.md) | [core/glossary.md](../glossary.md)\n\n## When to Use\n\n- ! Default strategy for all new projects\n- ~ Projects with unclear or evolving requirements\n- ~ When stakeholder alignment is needed before implementation\n- ? Skip to SPECIFICATION phase if requirements are already fully documented\n\n---\n\n## Chaining Gate\n\nBefore spec generation, offer the user a chance to run preparatory strategies\nor switch to a different spec-generating strategy. This gate is the single\norchestration point for strategy composition.\n\n! The chaining gate MUST always be shown — even when the interview strategy is\ninvoked directly with no prior strategy.\n! The chaining gate is a **blocking question**. The AI MUST present the options\nand wait for the user to choose before proceeding.\n⊗ Skip the chaining gate or proceed to the sizing gate without presenting it.\n\n### When It Appears\n\n- ! Before the [Sizing Gate](#sizing-gate) on every entry to the interview strategy\n- ! After each completed preparatory strategy (recursive — the gate reappears)\n- ! After the [Acceptance Gate](#acceptance-gate) when the user chooses \"Revise\" or \"Switch\"\n\n### Brownfield Detector\n\nBefore rendering menu options, classify the repo (align with setup Phase 3):\n\n- **Brownfield** when **either**:\n - `PROJECT-DEFINITION` exists under `./xbrief/` or legacy `./vbrief/` (`PROJECT-DEFINITION.xbrief.json` or `PROJECT-DEFINITION.vbrief.json`), **or**\n - any lifecycle folder (`proposed/`, `pending/`, `active/`, `completed/`, `cancelled/` under `xbrief/` or legacy `vbrief/`) has scope records\n- **Greenfield** otherwise\n\n! The detector MUST run on every Chaining Gate presentation.\n⊗ Offer only the greenfield-framed **Proceed to specification** default on a brownfield repo.\n⊗ Treat brownfield as a full create path without an explicit Replace/scrap confirm.\n\n### Options\n\n! Numbered Chaining Gate menus (greenfield and brownfield examples below) MUST end with `Discuss` and `Back` as the final two options per [deterministic-questions.md](../contracts/deterministic-questions.md).\n\nPresent groups sourced from the `Type` column in\n[strategies/README.md](./README.md#strategy-types). The **default path** depends\non the brownfield detector:\n\n**Default path (greenfield):**\n1. **Proceed to specification** (default) — continue to the [Sizing Gate](#sizing-gate) for a full create path\n\n**Default path (brownfield) — create-vs-update menu:**\n1. **Add scope to this project** (default) — load existing project identity + preparatory artifacts; **skip** the greenfield \"what are we building?\" interview; gather only the new scope; emit **one** proposed scope record; apply the [Preparatory Guard](./artifact-guards.md#preparatory-guard-light) on write\n2. **Update project definition** — run a **delta** interview against existing identity; apply the [Spec-Generating Guard](./artifact-guards.md#spec-generating-guard-full); **merge** narratives (prefer enrich/merge when the user declines replace)\n3. **Replace specification (scrap)** — full recreate equivalent to greenfield Proceed; **only** after explicit affirmative (`yes` / `confirmed`); vague replies (`proceed`, `ok`, `go ahead`) are **not** acceptance\n - ! On confirmed scrap, continue to the [Sizing Gate](#sizing-gate) as a full create path\n - ⊗ Auto-delete PROJECT-DEFINITION without scrap confirm\n - ⊗ Rename Proceed to \"Update\" without changing behavior\n\n**Preparatory strategies** (type: `preparatory` — loops back to this gate on completion):\n- Research — investigate the domain, find libraries, identify pitfalls\n- Discuss — lock key decisions using Feynman technique\n- Probe — adversarially stress-test the plan; surface assumptions, edge cases, and risks\n- Map — analyze existing codebase conventions\n\n~ Some preparatory strategies (currently map) also support standalone invocation\nvia `/deft:run:<name>` without entering the interview flow. When invoked standalone,\nthey present their own completion options instead of returning to this gate.\nSee `strategies/map.md` for standalone behavior.\n\n**Switch spec-generating strategy** (type: `spec-generating` — replaces current pipeline):\n- Yolo — auto-pilot, Johnbot picks all answers\n- SpecKit — formal spec process with story readiness before implementation\n\n### Run Count Annotations\n\n- ! Previously-run strategies MUST display with a run count (e.g., `Research (ran 1×)`)\n- ! No strategy is ever removed from the gate — users can re-run any strategy\n- ! Run counts are read from `completedStrategies` in\n [`./vbrief/plan.vbrief.json`](../vbrief/vbrief.md#strategy-chaining-fields)\n\n### State Tracking\n\n- ! On completion of a preparatory strategy, update `completedStrategies` in\n `./vbrief/plan.vbrief.json`: increment `runCount`, append artifact paths\n- ! Append all new artifact paths to the flat `artifacts` array\n- ! The next strategy and eventual spec generation MUST load all artifacts\n listed in `plan.vbrief.json`\n- ! On brownfield **Add scope** or **Update project definition**, load existing\n PROJECT-DEFINITION identity and preparatory artifacts before asking questions\n\n### Write Guards (interview)\n\n! Interview is a **spec-generating** strategy and MUST follow\n[artifact-guards.md](./artifact-guards.md) before emission (Light or Full path).\n\n- ! **Before writing** scope records to `proposed/`: [Preparatory Guard](./artifact-guards.md#preparatory-guard-light) (xbrief-first: `./xbrief/proposed/`, else legacy `./vbrief/proposed/`)\n- ! **Before writing** or updating `PROJECT-DEFINITION`: [Spec-Generating Guard](./artifact-guards.md#spec-generating-guard-full) against the **single live** identity file only — `./xbrief/PROJECT-DEFINITION.xbrief.json` when present (or after `deft migrate:xbrief`); else, until migrated, the existing legacy `./vbrief/PROJECT-DEFINITION.vbrief.json`. ⊗ Dual-write both roots\n- ! Prefer enrich/merge when the user declines replace\n- ⊗ Silently overwrite PROJECT-DEFINITION or same-slug proposed scopes\n- ⊗ Guard only the legacy `vbrief/` path while an `xbrief/` PROJECT-DEFINITION is the live identity\n- ⊗ Rely on write-time guards alone without the brownfield Chaining Gate menu above\n\nSurface this obligation **inside `interview.md`** so agents that load only this\nfile still hit the guards (#2925; incomplete closeout of #82/#387).\n\n### Example Prompt\n\n**Greenfield:**\n\n```\nReady to generate the specification. Before we proceed, would you like to:\n\n1. Proceed to specification (default)\n\n--- Preparatory (loops back) ---\n2. Run a research phase — investigate the domain, find libraries, identify pitfalls\n3. Run a discuss phase — lock key decisions using Feynman technique\n4. Run a probe phase — adversarially stress-test the plan; surface assumptions, edge cases, and risks\n5. Run a map phase — analyze existing codebase conventions\n\n--- Switch strategy ---\n6. Switch to yolo — auto-pilot picks all answers\n7. Switch to speckit — formal spec process with story readiness before implementation\n8. Other (specify)\n9. Discuss\n10. Back\n```\n\n**Brownfield:**\n\n```\nThis repo already has a project definition and/or scopes. Before we proceed:\n\n1. Add scope to this project (default) — keep identity; add one new proposed scope\n2. Update project definition — delta interview; merge narratives (Spec-Generating Guard)\n3. Replace specification (scrap) — requires explicit yes/confirmed; full recreate\n\n--- Preparatory (loops back) ---\n4. Run a research phase — investigate the domain, find libraries, identify pitfalls\n5. Run a discuss phase — lock key decisions using Feynman technique\n6. Run a probe phase — adversarially stress-test the plan; surface assumptions, edge cases, and risks\n7. Run a map phase — analyze existing codebase conventions\n\n--- Switch strategy ---\n8. Switch to yolo — auto-pilot picks all answers\n9. Switch to speckit — formal spec process with story readiness before implementation\n10. Other (specify)\n11. Discuss\n12. Back\n```\n\n---\n\n## Sizing Gate\n\nBefore the interview begins, determine project complexity to select the\nappropriate path. The gate runs once, immediately after hearing what the user\nwants to build.\n\n! The sizing gate is a **blocking question**. The AI MUST propose a size and\nwait for the user to confirm or override before asking any interview questions.\n⊗ Combine the sizing proposal with the first interview question in the same message.\n⊗ Proceed to interview questions before the user has explicitly confirmed the path.\n\n### Sizing Signals\n\nThe AI SHOULD propose a size based on these signals; the user confirms or overrides:\n\n- Number of features (≤5 → Light, >5 → Full)\n- Number of components/services (1–2 → Light, 3+ → Full)\n- Expected duration (days → Light, weeks/months → Full)\n- Team/agent count (solo → Light, multi-agent/swarm → Full)\n- Integration complexity (standalone → Light, external APIs/auth/DB → Full)\n\n### PROJECT-DEFINITION.vbrief.json Override\n\n`PROJECT-DEFINITION.vbrief.json` narratives ? declare `\"Process\": \"Light\"` or `\"Process\": \"Full\"` to skip the\ngate entirely. `PROJECT.md` (deprecated) may also carry this field. If the field is absent or empty, the AI MUST ask.\n\n## Workflow Overview\n\n```mermaid\nflowchart LR\n subgraph interview [\"Interview Strategy\"]\n G{\"⚖️ Sizing Gate\"}\n I_L[\"💬 Interview<br/><i>Light path</i>\"]\n I_F[\"💬 Interview<br/><i>Full path</i>\"]\n P[\"📄 PRD<br/><i>What to build</i>\"]\n S[\"📋 SPECIFICATION<br/><i>How to build it</i>\"]\n end\n\n G -->|\"Light\"| I_L\n G -->|\"Full\"| I_F\n I_L -->|\"Ambiguity resolved\"| S\n I_F -->|\"Ambiguity resolved\"| P\n P -->|\"Approved\"| S\n S -->|\"Ready\"| IMPL[\"🔨 Implementation\"]\n\n style G fill:#f0abfc,stroke:#a21caf,color:#000\n style I_L fill:#c4b5fd,stroke:#7c3aed,color:#000\n style I_F fill:#c4b5fd,stroke:#7c3aed,color:#000\n style P fill:#fef08a,stroke:#ca8a04,color:#000\n style S fill:#6ee7b7,stroke:#059669,color:#000\n style IMPL fill:#7dd3fc,stroke:#0284c7,color:#000\n```\n\n---\n\n## Interview Rules (shared by both paths)\n\n- ~ Use Claude AskInterviewQuestion when available (emulate if not)\n- ! Ask **ONE** focused, non-trivial question per step\n- ⊗ Ask multiple questions at once or sneak in \"also\" questions\n- ~ Provide numbered answer options when appropriate\n- ! Include \"other\" option for custom/unknown responses\n- ! Indicate which option is RECOMMENDED\n- ! When making an opinionated recommendation, state the principle (1 sentence)\n- ! When done, append all questions asked and answers given to the working document\n\n### Question Areas\n\n- ! Missing decisions (language, framework, deployment)\n- ! Edge cases (errors, boundaries, failure modes)\n- ! Implementation details (architecture, patterns, libraries)\n- ! Requirements (performance, security, scalability)\n- ! UX/constraints (users, timeline, compatibility)\n- ! Tradeoffs (simplicity vs features, speed vs safety)\n\n### Transition Criteria (interview complete)\n\n- ! All major decisions have answers\n- ! Edge cases are addressed\n- ! User has approved key tradeoffs (Interview strategy) or Johnbot has chosen recommended options (Yolo strategy)\n- ~ Little ambiguity remains\n\n---\n\n## Light Path (small/medium projects)\n\nInterview → scope records (date-prefixed in proposed/) + live PROJECT-DEFINITION + rendered SPECIFICATION (v0.20 contract). Paths are **xbrief-first**: use `./xbrief/` when that root is the live project layout; else legacy `./vbrief/`.\n\n### Flow\n\n1. Sizing gate selects Light\n2. Interview (rules above)\n3. Write scope record(s) to the live lifecycle root — `./xbrief/proposed/YYYY-MM-DD-<slug>.xbrief.json` when `./xbrief/` is live; else legacy `./vbrief/proposed/YYYY-MM-DD-<slug>.vbrief.json` — date-prefixed with `status: proposed`\n4. Run `task project:render` to create/update the **live** PROJECT-DEFINITION under the resolved layout root (`./xbrief/PROJECT-DEFINITION.xbrief.json`). Engine layout resolution requires `xbrief/` (#2112); if the repo is legacy-only `./vbrief/`, run `deft migrate:xbrief` first, then render. Ensure all five lifecycle folders exist under the live root. ⊗ Write a second PROJECT-DEFINITION under legacy `vbrief/` when `xbrief/` is live\n5. Summarize decisions, ask user to review\n6. On approval, use `task scope:promote` (or equivalent) to move scope record(s) to `pending/` under the **same** live root with `status: pending` / `approved`\n7. Run `task project:export-spec` / `task spec:render` as appropriate (SPECIFICATION.md is a rendered derivative with deprecation sentinel; `specification.vbrief.json` / `specification.xbrief.json` are legacy and are NOT written by this strategy on the v0.20 path)\n\n! **Before writing** scope records or updating `PROJECT-DEFINITION` on the Light path, follow [artifact-guards.md](./artifact-guards.md): Preparatory Guard for `proposed/` scopes; Spec-Generating Guard against the **live** identity file (xbrief-first). Prefer enrich/merge when the user declines replace.\n! ⊗ Write a second PROJECT-DEFINITION under legacy `vbrief/` when `./xbrief/PROJECT-DEFINITION.xbrief.json` is already the live identity.\n\n! At the emission step (step 3 above), after writing the scope record(s) to the live `proposed/`, surface the GitHub-issue tracking hint from [emit-hints.md](./emit-hints.md) — name all three patterns (none / `--umbrella` / `--per-vbrief`).\n\n### SPECIFICATION Structure (Light)\n\n```markdown\n# [Project Name] SPECIFICATION\n\n## Overview\nBrief summary of the project.\n\n## Requirements\n\n### Functional Requirements\n- FR-1: [requirement]\n- FR-2: [requirement]\n\n### Non-Functional Requirements\n- NFR-1: Performance — [requirement]\n- NFR-2: Security — [requirement]\n\n## Architecture\nHigh-level system design, components, data flow.\n\n## Implementation Plan\n\n### Phase 1: Foundation\n#### Subphase 1.1: Setup\n- Task 1.1.1: [description] (traces: FR-1)\n - Dependencies: none\n - Acceptance: [criteria]\n\n#### Subphase 1.2: Core (depends on: 1.1)\n- Task 1.2.1: [description] (traces: FR-2, NFR-1)\n\n### Phase 2: Features (depends on: Phase 1)\n...\n\n## Testing Strategy\nHow to verify the implementation meets requirements.\n\n## Deployment\nHow to ship it.\n```\n\n- ! Requirements section MUST appear in SPECIFICATION.md (embedded, no separate PRD)\n- ! Each task SHOULD reference which FR/NFR it implements via `(traces: FR-N)`\n- ⊗ Create a separate PRD.md on the Light path\n\n---\n\n## Full Path (large/complex projects)\n\nInterview → PRD → scope records (date-prefixed in proposed/) + live PROJECT-DEFINITION + rendered SPECIFICATION (v0.20 contract). Paths are **xbrief-first**: use `./xbrief/` when that root is the live project layout; else legacy `./vbrief/`.\n\n### Flow\n\n1. Sizing gate selects Full\n2. Interview (rules above)\n3. Generate `PRD.md` — user approval gate\n4. Write scope record(s) to the live lifecycle root — `./xbrief/proposed/YYYY-MM-DD-<slug>.xbrief.json` when `./xbrief/` is live; else legacy `./vbrief/proposed/YYYY-MM-DD-<slug>.vbrief.json` — date-prefixed with `status: proposed`\n5. Run `task project:render` to create/update the **live** PROJECT-DEFINITION under the resolved layout root (`./xbrief/PROJECT-DEFINITION.xbrief.json`). Engine layout resolution requires `xbrief/` (#2112); if the repo is legacy-only `./vbrief/`, run `deft migrate:xbrief` first, then render. Ensure all five lifecycle folders exist under the live root. ⊗ Write a second PROJECT-DEFINITION under legacy `vbrief/` when `xbrief/` is live\n6. Summarize decisions, ask user to review\n7. On approval, use `task scope:promote` (or equivalent) to move scope record(s) to `pending/` under the **same** live root with `status: pending` / `approved`\n8. Run `task project:export-spec` / `task spec:render` as appropriate (SPECIFICATION.md is a rendered derivative with deprecation sentinel; `specification.vbrief.json` / `specification.xbrief.json` are legacy and are NOT written by this strategy on the v0.20 path)\n\n! **Before writing** PRD, scope records, or updating `PROJECT-DEFINITION` on the Full path, follow [artifact-guards.md](./artifact-guards.md): Preparatory Guard for `proposed/` scopes; Spec-Generating Guard against the **live** identity file (xbrief-first). Prefer enrich/merge when the user declines replace.\n! ⊗ Write a second PROJECT-DEFINITION under legacy `vbrief/` when `./xbrief/PROJECT-DEFINITION.xbrief.json` is already the live identity.\n\n! At the emission step (step 4 above), after writing the scope record(s) to the live `proposed/`, surface the GitHub-issue tracking hint from [emit-hints.md](./emit-hints.md) — name all three patterns (none / `--umbrella` / `--per-vbrief`).\n\n### PRD Structure (Full path only)\n\n```markdown\n# [Project Name] PRD\n\n## Problem Statement\nWhat problem does this solve? Who has this problem?\n\n## Goals\n- Primary goal\n- Secondary goals\n- Non-goals (explicitly out of scope)\n\n## User Stories\nAs a [user type], I want [capability] so that [benefit].\n\n## Requirements\n\n### Functional Requirements\n- FR-1: [requirement]\n- FR-2: [requirement]\n\n### Non-Functional Requirements\n- NFR-1: Performance — [requirement]\n- NFR-2: Security — [requirement]\n\n## Success Metrics\nHow do we know this succeeded?\n\n## Open Questions\nAny remaining decisions deferred to implementation.\n```\n\n### PRD Guidelines\n\n- ! Focus on WHAT, not HOW\n- ! Use RFC 2119 language (MUST, SHOULD, MAY)\n- ! Number all requirements for traceability\n- ~ Include acceptance criteria for each requirement\n- ⊗ Include implementation details or architecture\n\n### PRD Transition Criteria\n\n- ! All functional requirements documented\n- ! Non-functional requirements specified\n- ! User has reviewed and approved PRD\n- ~ No blocking open questions remain\n\n### PRD Approval Menu (#740, refs #767)\n\n! After every PRD (Product Requirements Document) review, the agent MUST\npresent the canonical numbered approval menu defined in\n[`../references/plain-english-ux.md`](../references/plain-english-ux.md)\n`## Rule 4`. The menu replaces ambiguous `Accept / Refine / Edit`\nbuttons with action-shaped labels and follows the #767 framework rule\nfor deterministic numbered menus -- the **final two numbered options\nMUST be `Discuss` and `Back`**, in that order.\n\n```\nWhat would you like to do with the PRD (Product Requirements Document)?\n\n 1. Approve and continue (lock the PRD, generate the SPECIFICATION)\n 2. Suggest changes (you describe what to change; the agent rewrites)\n 3. Edit yourself (you edit the PRD directly; the agent waits)\n 4. Discuss\n 5. Back\n\nEnter confirm / b back / 0 discuss\n```\n\n! When `contracts/deterministic-questions.md` lands (Agent 1, #767), this\nstrategy MUST defer to that contract for canonical menu wording.\n\n! When the PRD review surfaces a red/green diff, the agent MUST emit a\nnon-alarming preface above it (per `references/plain-english-ux.md` Rule 5):\n\n```\nHere's what changed since the previous draft. Red lines were removed,\ngreen lines were added. Nothing here is broken -- this is a normal\nreview.\n```\n\n? Alternatively, the agent MAY hide the diff entirely on the first review\npass and present a plain-English summary of changes; show the diff only\non the second pass or when the user explicitly asks for it.\n\n- ⊗ Use plain `Accept / Refine / Edit` buttons without explanatory\n parentheticals.\n- ⊗ Add a numbered approval menu where Discuss and Back are not the\n final two options.\n- ⊗ Show a red/green diff at first review without a non-alarming preface.\n\n### SPECIFICATION Structure (Full)\n\n```markdown\n# [Project Name] SPECIFICATION\n\n## Overview\nBrief summary and link to PRD.\n\n## Architecture\nHigh-level system design, components, data flow.\n\n## Implementation Plan\n\n### Phase 1: Foundation\n#### Subphase 1.1: Setup\n- Task 1.1.1: [description] (traces: FR-1)\n - Dependencies: none\n - Acceptance: [criteria]\n\n#### Subphase 1.2: Core (depends on: 1.1)\n- Task 1.2.1: [description] (traces: FR-2, NFR-1)\n\n### Phase 2: Features (depends on: Phase 1)\n...\n\n## Testing Strategy\nHow to verify the implementation meets requirements.\n\n## Deployment\nHow to ship it.\n```\n\n---\n\n## SPECIFICATION Guidelines (both paths)\n\n- ! Reference requirement IDs (FR-1, NFR-2, etc.) in each task\n- ! Break into phases, subphases, tasks\n- ! Mark ALL dependencies explicitly\n- ! Design for parallel work (multiple agents)\n- ! End each phase/subphase with tests that pass\n- ~ Size tasks for 1-4 hours of work\n- ~ Minimize inter-task dependencies\n- ⊗ Write code (specification only)\n\n### Task Format\n\nEach task SHOULD include:\n- ! Clear description\n- ! Dependencies (or \"none\")\n- ! Acceptance criteria\n- ~ Estimated effort\n- ? Assigned agent (for swarm mode)\n\n### Transition Criteria\n\n- ! All requirements mapped to tasks\n- ! Dependencies form a valid DAG (no cycles)\n- ! Scope records exist in the live `proposed/` root (`./xbrief/proposed/` when live; else legacy `./vbrief/proposed/`) with date-prefixed filenames and `status: \"proposed\"`, or promoted to pending/active (with `status: \"approved\" / \"pending\"`)\n- ! Live PROJECT-DEFINITION is present (`./xbrief/PROJECT-DEFINITION.xbrief.json` when that is the identity; else legacy `./vbrief/PROJECT-DEFINITION.vbrief.json`) populated via `task project:render`\n- ! `SPECIFICATION.md` has been rendered via export/`task spec:render`\n- ! Proceed to [Acceptance Gate](#acceptance-gate)\n\n---\n\n## Acceptance Gate\n\nAfter spec generation, present the user with a final decision before\nimplementation begins.\n\n! The acceptance gate MUST appear after every spec generation (both Light and\nFull paths).\n! The acceptance gate is a **blocking question**. The AI MUST present the\noptions and wait for the user to choose.\n\n### Options\n\n1. **Accept** — spec is approved, proceed to implementation\n - ! Before handing off to implementation, verify the project toolchain is installed and functional — see [../coding/toolchain.md](../coding/toolchain.md); stop and report if any required tool is missing\n2. **Revise** — return to the [Chaining Gate](#chaining-gate) with all prior\n context preserved (completed strategies, artifacts). Run additional\n preparatory strategies or regenerate the spec.\n3. **Switch strategy** — return to the [Chaining Gate](#chaining-gate) to select\n a different spec-generating strategy (e.g., switch from interview to speckit)\n\n### SPECIFICATION Approval Menu (#740, refs #767)\n\n! In addition to the structured Accept / Revise / Switch options above,\nthe agent MUST present the canonical numbered approval menu defined in\n[`../references/plain-english-ux.md`](../references/plain-english-ux.md)\n`## Rule 4`. The menu states what each choice will actually do, in\nplain-English action-shaped labels, and follows the #767 framework rule\nfor deterministic numbered menus -- the **final two numbered options\nMUST be `Discuss` and `Back`**, in that order.\n\n```\nWhat would you like to do with the SPECIFICATION?\n\n 1. Approve and continue (lock the SPEC, proceed to implementation)\n 2. Suggest changes (you describe what to change; the agent rewrites)\n 3. Edit yourself (you edit the SPEC directly; the agent waits)\n 4. Discuss\n 5. Back\n\nEnter confirm / b back / 0 discuss\n```\n\n! Option 1 (`Approve and continue`) maps to the `Accept` option above\n(which then runs the toolchain verification). Option 2 (`Suggest\nchanges`) and Option 3 (`Edit yourself`) both map to `Revise` (return to\nthe Chaining Gate with prior context preserved). The numbered menu is\nthe user-facing surface; the structured Accept / Revise / Switch above\nis the agent's internal contract.\n\n! When `contracts/deterministic-questions.md` lands (Agent 1, #767), this\nstrategy MUST defer to that contract for canonical menu wording.\n\n! When the SPECIFICATION review surfaces a red/green diff, the agent\nMUST emit a non-alarming preface above it (per\n`references/plain-english-ux.md` Rule 5):\n\n```\nHere's what changed since the previous draft. Red lines were removed,\ngreen lines were added. Nothing here is broken -- this is a normal\nreview.\n```\n\n? Alternatively, the agent MAY hide the diff entirely on the first\nreview pass and present a plain-English summary of changes; show the\ndiff only on the second pass or when the user explicitly asks for it.\n\n- ⊗ Add a numbered approval menu where Discuss and Back are not the\n final two options.\n- ⊗ Show a red/green diff at first review without a non-alarming preface.\n\n### Rejected Spec Archival\n\n- ! When the user chooses \"Revise\" or \"Switch\", the current `SPECIFICATION.md`\n MUST be archived to `history/specs/` before regeneration\n- ! Archived name format: `SPECIFICATION-rejected-{ISO-timestamp}.md`\n (e.g., `SPECIFICATION-rejected-2026-03-15T19-23-00Z.md`)\n- ! If a `PRD.md` exists (Full path), it is NOT archived — only the spec\n- ~ Include a one-line header in the archived file noting why it was rejected\n\n### State Preservation\n\n- ! All `completedStrategies` and `artifacts` in `plan.vbrief.json` MUST be\n preserved across revisions\n- ! The chaining gate will show updated run counts reflecting the full session history\n\n---\n\n## Artifacts Summary\n\n**Light path:**\n\n| Artifact | Purpose | Created By |\n|----------|---------|------------|\n| `./xbrief/proposed/YYYY-MM-DD-*.xbrief.json` (else legacy `./vbrief/proposed/YYYY-MM-DD-*.vbrief.json`) | Scope story records (date-prefixed, v0.20 contract) | Interview |\n| `./xbrief/PROJECT-DEFINITION.xbrief.json` (else legacy `./vbrief/PROJECT-DEFINITION.vbrief.json`) | Project identity gestalt + items registry | `task project:render` (triggered by strategy) |\n| `SPECIFICATION.md` | Generated plan with embedded Requirements (rendered derivative; deprecation sentinel) | export / `task spec:render` |\n| (no `specification.*.json`) | Legacy artifact — omitted on v0.20 path | — |\n\n**Full path:**\n\n| Artifact | Purpose | Created By |\n|----------|---------|------------|\n| `PRD.md` | What to build (approval gate) | Interview |\n| `./xbrief/proposed/YYYY-MM-DD-*.xbrief.json` (else legacy `./vbrief/proposed/YYYY-MM-DD-*.vbrief.json`) | Scope story records (date-prefixed, v0.20 contract) | Post-PRD interview |\n| `./xbrief/PROJECT-DEFINITION.xbrief.json` (else legacy `./vbrief/PROJECT-DEFINITION.vbrief.json`) | Project identity gestalt + items registry | `task project:render` (triggered by strategy) |\n| `SPECIFICATION.md` | Generated implementation plan (rendered derivative; deprecation sentinel) | export / `task spec:render` |\n| (no `specification.*.json`) | Legacy artifact — omitted on v0.20 path | — |\n\n## Invoking This Strategy\n\n```\n/deft:run:interview [project name]\n```\n\nOr explicitly:\n\n```\nUse the interview strategy to plan [project].\n```\n\nAfter completion:\n\n```\nimplement the scope records in ./xbrief/active/ (or legacy ./vbrief/active/)\n```\n"
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
"id": "map",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"probe"
|
|
102
102
|
],
|
|
103
103
|
"path": "strategies/probe.md",
|
|
104
|
-
"body": "# Probe Strategy\n\nStress-test a plan before committing to it — relentless interrogation until every branch of the decision tree is resolved.\n\nLegend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.\n\n**⚠️ See also**: [strategies/discuss.md](./discuss.md) | [strategies/interview.md](./interview.md) | [core/glossary.md](../glossary.md)\n\n> Inspired by [grill-me](https://github.com/mattpocock/skills/tree/main/grill-me) from [mattpocock/skills](https://github.com/mattpocock/skills). Adapted to directive's preparatory strategy pattern.\n\n---\n\n## When to Use\n\n- ~ Before committing to any significant design decision or architecture choice\n- ~ When a plan has been drafted but not yet stress-tested\n- ! When the user explicitly asks to be probed or challenged on their plan\n- ? Skip when the path forward is unambiguous and small in scope\n\n## Core Principle\n\nThe goal is not alignment — that's `discuss`. Probe is adversarial discovery. It assumes the plan has holes and sets out to find them. Every assumption is challenged, every edge case explored, every dependency branch walked until nothing is unresolved. Where `discuss` builds consensus, `probe` finds what's missing.\n\n---\n\n## Workflow\n\n### Step 1: Establish the plan\n\n- ! Read whatever plan, design, or spec exists in the conversation context\n- ~ If no plan is in context, ask ONE question: \"What's the plan you want me to probe?\"\n- ~ If codebase context is relevant, explore it to answer what you can before asking\n- ⊗ Ask follow-up questions before reading available context\n\n### Step 2: Interrogate relentlessly\n\nWalk the decision tree depth-first. For each unresolved branch:\n\n- ! Ask **ONE** focused question per message\n- ! For each question, provide your recommended answer with brief reasoning\n- ! If the codebase can answer a question, explore it instead of asking the user\n- ~ Follow the thread — if an answer opens new branches, pursue them before moving on\n- ⊗ Ask multiple questions at once\n- ⊗ Accept vague answers — push back: \"What does that mean concretely?\"\n- ⊗ Move to the next branch before the current one is fully resolved\n\n### Question focus areas\n\n- ! **Assumptions** — \"This assumes X is guaranteed — is it?\"\n- ! **Edge cases** — \"What happens when Y is empty / null / at the limit?\"\n- ! **Dependencies** — \"This requires Z to exist — what if it doesn't?\"\n- ! **Failure modes** — \"How does this fail? How is that surfaced to the user?\"\n- ! **Scaling** — \"Does this hold at 10× the expected volume?\"\n- ~ **Security surface** — \"Who can reach this? What's the blast radius if it's wrong?\"\n- ~ **Reversibility** — \"Can this decision be changed later? What's the migration cost?\"\n\n### Transition criteria (probe complete)\n\n- ! All major decision branches have been resolved\n- ! No open assumptions remain\n- ~ User has acknowledged the risks of any deliberately deferred decisions\n- ~ No new branches are surfaced by the last 2–3 questions\n\n---\n\n## Output\n\n! Before writing output artifacts, follow the [Preparatory Guard](./artifact-guards.md#preparatory-guard-light).\n\n### Mechanical guard (`scripts/probe_session.py`)\n\nProbe completion is enforced mechanically — not by prose alone. A per-clone\nsession file at `.deft/probe-session.json` records whether the session is still\n`interrogate` or `complete`, plus the probe `target`, `currentBranch`, and\n`resolvedDecisions`.\n\n- ! At probe start, record the session:\n `uv run python scripts/probe_session.py start --target <scope>`\n- ! While interrogating, record locked/deferred/risk-accepted decisions and\n branch focus with `record` / `set-branch` subcommands as branches resolve\n- ! Before writing probe output or registering `completedStrategies.probe`,\n mark the session complete:\n `uv run python scripts/probe_session.py complete`\n- ! Immediately before artifact or plan registration, run the guard:\n - `uv run python scripts/probe_session.py guard-artifact --path vbrief/proposed/{scope}-probe.vbrief.json`\n - `uv run python scripts/probe_session.py guard-plan-registration`\n- ⊗ Write probe artifacts or update `completedStrategies.probe` while the\n session state is still `interrogate` — the guard exits non-zero with an\n actionable recovery message\n\n**Recovery when the guard blocks handoff:** continue interrogation until the\n[transition criteria](#transition-criteria-probe-complete) are met, record\ndecisions with `probe_session.py record`, run `probe_session.py complete`,\nthen retry the guard before writing artifacts or updating `plan.vbrief.json`.\n\n`{scope}` is the project name from `PROJECT-DEFINITION.vbrief.json`, or the\nfeature/component name if probing a sub-scope. Use the same value consistently\nthroughout the session. Examples: `my-app-probe`, `auth-probe`.\n\n- ! Produce a `vbrief/proposed/{scope}-probe.vbrief.json` scope vBRIEF with three mandatory narratives:\n - `LockedDecisions` — what was resolved and why\n - `SurfacedRisks` — concerns raised, even if not fully resolved\n - `DeferredDecisions` — explicitly acknowledged items with justification\n- ! Each entry in a narrative includes: **question asked**, **answer given**, **status** (locked / deferred / risk-accepted)\n- ! This vBRIEF is injected into all downstream work: planning, execution, verification\n- ! Persist significant decisions as vBRIEF narratives on the relevant plan items\n- ⊗ Write probe output to a hand-authored markdown file — use vBRIEF narratives for token-efficient, machine-consumable agent consumption (mirrors the [discuss](./discuss.md) and [research](./research.md) output contracts so the chaining-gate flow-through guarantee is mechanical, not aspirational)\n\n! After emitting the probe scope vBRIEF to `vbrief/proposed/`, surface the GitHub-issue tracking hint from [emit-hints.md](./emit-hints.md) — name all three patterns (none / `--umbrella` / `--per-vbrief`).\n\n---\n\n## Then: Chaining Gate\n\nAfter the probe is complete and `vbrief/proposed/{scope}-probe.vbrief.json` is\nwritten, return to the [chaining gate](./interview.md#chaining-gate).\n\n- ! On completion, register artifacts in `./vbrief/plan.vbrief.json`:\n - Update `completedStrategies`: increment `runCount` for `\"probe\"`,\n append artifact path (`vbrief/proposed/{scope}-probe.vbrief.json`)\n - Append the path to the flat `artifacts` array\n- ! Return to [interview.md Chaining Gate](./interview.md#chaining-gate)\n- ! The `LockedDecisions`, `SurfacedRisks`, and `DeferredDecisions` narratives from `vbrief/proposed/{scope}-probe.vbrief.json` MUST flow\n into subsequent strategies and spec generation:\n - Locked decisions become constraints in the specification\n - Surfaced risks become NFRs or explicit acceptance criteria\n - Deferred decisions appear as open questions in the spec\n- ⊗ End the session after probe without returning to the chaining gate\n or the invoking strategy's next-step menu\n\n! **Standalone context:** If invoked from a standalone strategy (e.g. map's\n standalone next-step menu) rather than from the interview chaining gate,\n return to the invoking strategy's menu instead.\n\n---\n\n## Anti-Patterns\n\n- ⊗ Accepting \"we'll figure it out later\" without marking it as explicitly deferred\n- ⊗ Asking generic checklist questions instead of following the decision tree\n- ⊗ Letting vague answers pass without pushing for concrete specifics\n- ⊗ Using codebase exploration as a substitute for asking the user about deliberate design choices\n- ⊗ Stopping when the conversation feels comfortable — stop when no new branches emerge\n- ⊗ Ending after probe without chaining back to the gate (chained mode; in standalone context, returning to the invoking strategy's menu satisfies the completion requirement per the [standalone-context rule](#then-chaining-gate))\n- ⊗ Writing probe output to a plain markdown file (`{scope}-probe.md`) instead of the canonical `vbrief/proposed/{scope}-probe.vbrief.json` scope vBRIEF — plain markdown bypasses the [Preparatory Guard](./artifact-guards.md#preparatory-guard-light) and breaks the downstream-consumer flow-through guarantee\n"
|
|
104
|
+
"body": "# Probe Strategy\n\nStress-test a plan before committing to it — relentless interrogation until every branch of the decision tree is resolved.\n\nLegend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.\n\n**⚠️ See also**: [strategies/discuss.md](./discuss.md) | [strategies/interview.md](./interview.md) | [core/glossary.md](../glossary.md)\n\n> Inspired by [grill-me](https://github.com/mattpocock/skills/tree/main/grill-me) from [mattpocock/skills](https://github.com/mattpocock/skills). Adapted to directive's preparatory strategy pattern.\n\n---\n\n## When to Use\n\n- ~ Before committing to any significant design decision or architecture choice\n- ~ When a plan has been drafted but not yet stress-tested\n- ! When the user explicitly asks to be probed or challenged on their plan\n- ? Skip when the path forward is unambiguous and small in scope\n\n## Core Principle\n\nThe goal is not alignment — that's `discuss`. Probe is adversarial discovery. It assumes the plan has holes and sets out to find them. Every assumption is challenged, every edge case explored, every dependency branch walked until nothing is unresolved. Where `discuss` builds consensus, `probe` finds what's missing.\n\n---\n\n## Workflow\n\n### Step 1: Establish the plan\n\n- ! Read whatever plan, design, or spec exists in the conversation context\n- ~ If no plan is in context, ask ONE question: \"What's the plan you want me to probe?\"\n- ~ If codebase context is relevant, explore it to answer what you can before asking\n- ⊗ Ask follow-up questions before reading available context\n\n### Step 2: Interrogate relentlessly\n\nWalk the decision tree depth-first. For each unresolved branch:\n\n- ! Ask **ONE** focused question per message\n- ! For each question, provide your recommended answer with brief reasoning\n- ! If the codebase can answer a question, explore it instead of asking the user\n- ~ Follow the thread — if an answer opens new branches, pursue them before moving on\n- ⊗ Ask multiple questions at once\n- ⊗ Accept vague answers — push back: \"What does that mean concretely?\"\n- ⊗ Move to the next branch before the current one is fully resolved\n\n### Question focus areas\n\n- ! **Assumptions** — \"This assumes X is guaranteed — is it?\"\n- ! **Edge cases** — \"What happens when Y is empty / null / at the limit?\"\n- ! **Dependencies** — \"This requires Z to exist — what if it doesn't?\"\n- ! **Failure modes** — \"How does this fail? How is that surfaced to the user?\"\n- ! **Scaling** — \"Does this hold at 10× the expected volume?\"\n- ~ **Security surface** — \"Who can reach this? What's the blast radius if it's wrong?\"\n- ~ **Reversibility** — \"Can this decision be changed later? What's the migration cost?\"\n\n### Transition criteria (probe complete)\n\n- ! All major decision branches have been resolved\n- ! No open assumptions remain\n- ~ User has acknowledged the risks of any deliberately deferred decisions\n- ~ No new branches are surfaced by the last 2–3 questions\n\n---\n\n## Output\n\n! Before writing output artifacts, follow the [Preparatory Guard](./artifact-guards.md#preparatory-guard-light).\n\n### Mechanical guard (`scripts/probe_session.py`)\n\nProbe completion is enforced mechanically — not by prose alone. A per-clone\nsession file at `.deft/probe-session.json` records whether the session is still\n`interrogate` or `complete`, plus the probe `target`, `currentBranch`, and\n`resolvedDecisions`.\n\n- ! At probe start, record the session:\n `uv run python scripts/probe_session.py start --target <scope>`\n- ! While interrogating, record locked/deferred/risk-accepted decisions and\n branch focus with `record` / `set-branch` subcommands as branches resolve\n- ! Before writing probe output or registering `completedStrategies.probe`,\n mark the session complete:\n `uv run python scripts/probe_session.py complete`\n- ! Immediately before artifact or plan registration, run the guard:\n - `uv run python scripts/probe_session.py guard-artifact --path vbrief/proposed/{scope}-probe.vbrief.json`\n - `uv run python scripts/probe_session.py guard-plan-registration`\n- ⊗ Write probe artifacts or update `completedStrategies.probe` while the\n session state is still `interrogate` — the guard exits non-zero with an\n actionable recovery message\n\n**Recovery when the guard blocks handoff:** continue interrogation until the\n[transition criteria](#transition-criteria-probe-complete) are met, record\ndecisions with `probe_session.py record`, run `probe_session.py complete`,\nthen retry the guard before writing artifacts or updating `plan.vbrief.json`.\n\n`{scope}` is the project name from `PROJECT-DEFINITION.vbrief.json`, or the\nfeature/component name if probing a sub-scope. Use the same value consistently\nthroughout the session. Examples: `my-app-probe`, `auth-probe`.\n\n- ! Produce a `vbrief/proposed/{scope}-probe.vbrief.json` scope vBRIEF with three mandatory narratives:\n - `LockedDecisions` — what was resolved and why (when the lock is an intentional under-build, include dual-path graduation fields: `now`, `later`, `graduationRef`, `trigger`, `status` — see [Graduation (Now+Later)](#graduation-nowlater-when-locking-an-under-build-2899))\n - `SurfacedRisks` — concerns raised, even if not fully resolved\n - `DeferredDecisions` — explicitly acknowledged items with justification\n- ! Each entry in a narrative includes: **question asked**, **answer given**, **status** (locked / deferred / risk-accepted)\n- ! This vBRIEF is injected into all downstream work: planning, execution, verification\n- ! Persist significant decisions as vBRIEF narratives on the relevant plan items\n- ⊗ Write probe output to a hand-authored markdown file — use vBRIEF narratives for token-efficient, machine-consumable agent consumption (mirrors the [discuss](./discuss.md) and [research](./research.md) output contracts so the chaining-gate flow-through guarantee is mechanical, not aspirational)\n\n! After emitting the probe scope vBRIEF to `vbrief/proposed/`, surface the GitHub-issue tracking hint from [emit-hints.md](./emit-hints.md) — name all three patterns (none / `--umbrella` / `--per-vbrief`).\n\n## Graduation (Now+Later) when locking an under-build (#2899)\n\nProbe already separates **locked**, **deferred**, and **risk-accepted** branches. **Graduation** is a fourth case that must not collapse into `DeferredDecisions`:\n\n| Concept | Probe role |\n|---|---|\n| `LockedDecisions` (permanent) | Approach is decided and is the end-product path |\n| `DeferredDecisions` | *Undecided* open question with justification |\n| **Graduation** on a lock | *Decided* weaker **Now** + *decided* end-product **Later** |\n| rapid **graduate** | Strategy-level spike → fresh spec; not dual-path tracking here |\n\nGlossary naming for Graduation is owned by sibling work (#2907); this section is the Wave A probe contract.\n\n- ! When probe **locks** a temporary / weaker approach and the end-product approach is also decided, record the dual-path shape on that `LockedDecisions` entry (not as a `DeferredDecisions` open question):\n - `now` — what ships in the near path\n - `later` — end-product approach\n - `graduationRef` — GitHub issue and/or scope xBRIEF path for Later work\n - `trigger` — condition that makes Later required (free text)\n - `status` — `open` | `shipped` | `cancelled` (cancel with justification)\n- ! Permanent locks and true open questions do **not** gain graduation fields — do not ticket-spam every `DeferredDecisions` item into a graduation\n- ! `task scope:complete` on a Now story MUST NOT close linked graduation work; Later stays open until shipped or explicitly cancelled\n- ⊗ Accepting \"we'll harden it later\" as a locked under-build without dual-path fields, or filing it only as `DeferredDecisions`\n- ⊗ Closing graduation work solely because the MVP / Now story completed\n\n---\n\n## Then: Chaining Gate\n\nAfter the probe is complete and `vbrief/proposed/{scope}-probe.vbrief.json` is\nwritten, return to the [chaining gate](./interview.md#chaining-gate).\n\n- ! On completion, register artifacts in `./vbrief/plan.vbrief.json`:\n - Update `completedStrategies`: increment `runCount` for `\"probe\"`,\n append artifact path (`vbrief/proposed/{scope}-probe.vbrief.json`)\n - Append the path to the flat `artifacts` array\n- ! Return to [interview.md Chaining Gate](./interview.md#chaining-gate)\n- ! The `LockedDecisions`, `SurfacedRisks`, and `DeferredDecisions` narratives from `vbrief/proposed/{scope}-probe.vbrief.json` MUST flow\n into subsequent strategies and spec generation:\n - Locked decisions become constraints in the specification\n - Surfaced risks become NFRs or explicit acceptance criteria\n - Deferred decisions appear as open questions in the spec\n- ⊗ End the session after probe without returning to the chaining gate\n or the invoking strategy's next-step menu\n\n! **Standalone context:** If invoked from a standalone strategy (e.g. map's\n standalone next-step menu) rather than from the interview chaining gate,\n return to the invoking strategy's menu instead.\n\n---\n\n## Anti-Patterns\n\n- ⊗ Accepting \"we'll figure it out later\" without marking it as explicitly deferred\n- ⊗ Recording a *decided* weaker-Now + stronger-Later path only as `DeferredDecisions` (or chat) instead of dual-path graduation fields on the lock (#2899)\n- ⊗ Treating Now-story `scope:complete` as closure of linked graduation work (#2899)\n- ⊗ Asking generic checklist questions instead of following the decision tree\n- ⊗ Letting vague answers pass without pushing for concrete specifics\n- ⊗ Using codebase exploration as a substitute for asking the user about deliberate design choices\n- ⊗ Stopping when the conversation feels comfortable — stop when no new branches emerge\n- ⊗ Ending after probe without chaining back to the gate (chained mode; in standalone context, returning to the invoking strategy's menu satisfies the completion requirement per the [standalone-context rule](#then-chaining-gate))\n- ⊗ Writing probe output to a plain markdown file (`{scope}-probe.md`) instead of the canonical `vbrief/proposed/{scope}-probe.vbrief.json` scope vBRIEF — plain markdown bypasses the [Preparatory Guard](./artifact-guards.md#preparatory-guard-light) and breaks the downstream-consumer flow-through guarantee\n"
|
|
105
105
|
},
|
|
106
106
|
{
|
|
107
107
|
"id": "rapid",
|
|
@@ -50,6 +50,17 @@ On repos with `.deft/core/` installed, **PR shepherding intent** routes here --
|
|
|
50
50
|
- ! Cloud babysit workers use `worker_role: review-monitor` (or `drive-to: merge-ready` implementation workers that own the review cycle) -- not a generic babysit loop without Phase 1 audit or Step 6 exit predicate (#1259).
|
|
51
51
|
- ⊗ Route **babysit-pull-request-in-cloud** to Cursor global babysit when `.deft/core/` is present -- that bypasses xBRIEF preflight, `task check`, Greptile fail-closed exit, and CHANGELOG discipline (#2261 recurrence).
|
|
52
52
|
|
|
53
|
+
### OpenClaw babysit supersession (#2876 / #2261)
|
|
54
|
+
|
|
55
|
+
On OpenClaw hosts with Directive installed (`.deft/core/` or equivalent content deposit), **babysit / shepherd / watch** intent likewise routes here -- not host-local freestyle poll loops and not OpenClaw `cron` alone.
|
|
56
|
+
|
|
57
|
+
- ! When the OpenClaw tool surface exposes `sessions_spawn`, Approach 1 is the **default** babysit path: spawn a background review-monitor via `sessions_spawn` (register with `--platform-primitive sessions_spawn` or the alias `openclaw-sessions-spawn`).
|
|
58
|
+
- ! Prefer a **visible** Control UI subagent when OpenClaw Control UI is the operator control plane so humans can inspect the monitor.
|
|
59
|
+
- ! Long review-monitor ownership (>~3 min) MUST NOT block the parent OpenClaw session — background `sessions_spawn` + parent yield; same Gap D rule as Cursor/Grok Build (#1880).
|
|
60
|
+
- ! Prefer deep-think gates inside the monitor via the dual-invoke probe order (#2893): `deft pr:watch` / `deft pr:merge-ready` first, then `task deft:pr:watch` when the Taskfile include is present, then the #2878 gh-only fallback — bare `task pr:watch` is not the consumer form.
|
|
61
|
+
- ⊗ Treat OpenClaw `cron` (or any host scheduler alone) as Approach 1. Cron/timer re-invocation is Approach 2 only when `sessions_spawn` is unavailable.
|
|
62
|
+
- ⊗ Freestyle main-session `gh pr view` / `sleep` poll + ad-hoc cron when `sessions_spawn` is available — that is the statusreport#153 / #2876 process-routing failure mode.
|
|
63
|
+
|
|
53
64
|
## Branch-Protection Policy Guard
|
|
54
65
|
|
|
55
66
|
! Before entering the review/fix loop, run the skill-level branch-policy guard (#746 / #747). Halt before any state mutation if the project's `plan.policy.allowDirectCommitsToMaster` is unresolvable AND the operator has not set `DEFT_ALLOW_DEFAULT_BRANCH_COMMIT=1`. Concretely:
|
|
@@ -142,9 +153,39 @@ Both commands extract the "Comments Outside Diff" section with surrounding conte
|
|
|
142
153
|
- Identify cross-file dependencies (a term, value, or field mentioned in multiple files)
|
|
143
154
|
- Categorize by severity (P0, P1, P2 — where P0 is critical/blocking, P1 is a real defect, P2 is a style or non-blocking suggestion)
|
|
144
155
|
- Plan a single coherent batch of fixes
|
|
156
|
+
- ! **Scope-check each finding against the active story xBRIEF** (`plan.items[].narrative.Acceptance`) before coding — see Out-of-AC gate (#2881) below
|
|
145
157
|
|
|
146
158
|
⊗ Start fixing individual findings as you encounter them.
|
|
147
159
|
|
|
160
|
+
### Out-of-AC findings / active-story scope gate (#2881)
|
|
161
|
+
|
|
162
|
+
Babysit and review-cycle are **not** a second unbounded implementation mandate. When Greptile (or another reviewer) raises design-adjacent work outside the active story's acceptance criteria, default to follow-up — not silent redesign mid-babysit (PR #2871 / #2869 → #2880 recurrence).
|
|
163
|
+
|
|
164
|
+
! Given an active story xBRIEF with fixed `plan.items`, when a finding is **outside** those Acceptance criteria:
|
|
165
|
+
|
|
166
|
+
1. ! File or propose a **follow-up** GitHub issue / scope xBRIEF for the out-of-AC work, **or**
|
|
167
|
+
2. ! Amend the active brief's `plan.items` (and narratives) **with explicit operator consent** before implementing a new subsystem,
|
|
168
|
+
3. ! Then continue babysit only for in-AC and carve-out findings.
|
|
169
|
+
|
|
170
|
+
! **P0 carve-out vs new-subsystem-needs-story:**
|
|
171
|
+
|
|
172
|
+
- ! P0 security / correctness defects on files **already touched** by the PR MAY land in the same PR without a new story.
|
|
173
|
+
- ! New ledgers, idempotency protocols, cross-cutting reliability contracts, or multi-commit redesigns that expand story meaning **require** a separate story or an amended brief before code.
|
|
174
|
+
|
|
175
|
+
! **Confidence-only holds (0 P0/P1):** when confidence is below threshold (e.g. `Confidence Score: 3/5`) with zero P0 and zero P1 findings, the skill does **not** mandate unbounded redesign to raise confidence. Offer one of:
|
|
176
|
+
|
|
177
|
+
1. Follow-up issue / residual-risk note in the PR,
|
|
178
|
+
2. Operator override path (document in PR comment),
|
|
179
|
+
3. Minimal in-AC polish only — then re-evaluate Step 6.
|
|
180
|
+
|
|
181
|
+
! **`issue:emit` related-ref footgun:** `task issue:emit` treats any `plan.references[]` entry whose type matches `github-issue` / `x-xbrief/github-issue` / `x-vbrief/github-issue` as **already tracked** and SKIPs creating a new issue. When linking **related** (non-primary) work:
|
|
182
|
+
|
|
183
|
+
- ! Use a non-emit-tracking type for related issues (e.g. keep related links in narratives / PR body / `Refs #N` prose), **or** designate a single primary origin github-issue ref that emit should honor.
|
|
184
|
+
- ⊗ Add related-issue `x-*/github-issue` refs to a brief that still needs `issue:emit` for its primary origin — emit will SKIP as already tracked.
|
|
185
|
+
|
|
186
|
+
⊗ Expand active story scope past xBRIEF AC mid-babysit without follow-up or consented amend (#2881).
|
|
187
|
+
⊗ Treat confidence-only holds as authorization to invent new subsystems in-tree.
|
|
188
|
+
|
|
148
189
|
### Step 3: Fix all findings in ONE batch commit
|
|
149
190
|
|
|
150
191
|
! Apply ALL fixes across all files before committing:
|
|
@@ -186,7 +227,52 @@ Both commands extract the "Comments Outside Diff" section with surrounding conte
|
|
|
186
227
|
|
|
187
228
|
### Greptile CLEAN vs CI holdout (`pr:watch` / #2688)
|
|
188
229
|
|
|
189
|
-
! When waiting on a Greptile verdict for a `drive-to: merge-ready` worker (or any review-cycle owner), prefer
|
|
230
|
+
! When waiting on a Greptile verdict for a `drive-to: merge-ready` worker (or any review-cycle owner), prefer the dual-invoke probe order below over ad-hoc sleep loops (#1056 / #2893). Parse `clean_gate_holdout` on every probe.
|
|
231
|
+
|
|
232
|
+
### Gates-surface dual invoke order (#2893 / #2878)
|
|
233
|
+
|
|
234
|
+
Deep-think gates (`pr:watch`, `pr:merge-ready`, `review-monitor:*`) have **three ordered invoke paths**. Agents MUST probe in this order; bare `task pr:watch` is **not** the sole (or first) consumer form.
|
|
235
|
+
|
|
236
|
+
! **Probe order (MUST):**
|
|
237
|
+
|
|
238
|
+
1. **`deft` / `directive` CLI first** — attempt `deft pr:watch --help` (or `directive pr:watch --help`). Primary for npm/package-manager installs; works without a root Taskfile. CLI forms take flags **without** go-task's bare `--` separator (e.g. `deft pr:watch <N> --json`, `deft verify:review-monitor --pr <N>`).
|
|
239
|
+
2. **`task deft:<verb>` second** — when a root Taskfile includes `.deft/core/Taskfile.yml` under key `deft:`, go-task exposes **namespaced** tasks (`task deft:pr:watch`, `task deft:verify:review-monitor`, `task deft:review-monitor:register`). Probe `task --list` / `task deft:pr:watch -- --help`. Task forms **require** the bare `--` separator before verb flags (e.g. `task deft:pr:watch -- <N>`, `task deft:verify:review-monitor -- --pr <N>`).
|
|
240
|
+
3. **#2878 gh-only fallback last** — only when both CLI and namespaced task probes fail, classify **missing-task: pr:watch** (or **missing-task: review-monitor**) and use the official gh-only subset below.
|
|
241
|
+
|
|
242
|
+
⊗ Treat bare `task pr:watch` / `task review-monitor:register` as the only prescribed consumer form — under include key `deft:` those un-namespaced names are absent; that probe failure is not proof the gate is unavailable if `deft` or `task deft:` works (#2893).
|
|
243
|
+
⊗ Pass go-task's bare `--` separator into `deft`/`directive` CLI forms (e.g. `deft pr:watch -- --help`) — CLI parsers reject the standalone `--` and the probe fails falsely (#2893).
|
|
244
|
+
|
|
245
|
+
### Missing gate surface / consumer gh-only fallback (#2878)
|
|
246
|
+
|
|
247
|
+
Some consumer repos (e.g. sister product deposits) ship Directive skills but have **no working invoke path** for `pr:watch` / `review-monitor:*` (no `deft` CLI on PATH, no Taskfile include → no `task deft:…`). Agents MUST NOT invent a non-skill poll loop when every probe fails.
|
|
248
|
+
|
|
249
|
+
! **After dual-invoke probe fails (#2893):** classify the session as **missing-task: pr:watch** (or the specific verb) and fail-loud:
|
|
250
|
+
|
|
251
|
+
```
|
|
252
|
+
BLOCKED: missing-task pr:watch on this consumer
|
|
253
|
+
Remediation:
|
|
254
|
+
1. Prefer `deft pr:watch` / install `@deftai/directive` so the CLI surface works, OR
|
|
255
|
+
2. Add the root Taskfile include (doctor gates-surface snippet) so `task deft:pr:watch` works, OR
|
|
256
|
+
3. Use the official gh-only fallback subset below (still this skill — not freestyle).
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
! **Official gh-only fallback** (when both `deft`/`directive` and `task deft:<verb>` probes fail for pr:watch / review-monitor):
|
|
260
|
+
|
|
261
|
+
1. Still select Approach 1 when a sub-agent primitive exists (OpenClaw `sessions_spawn`, Cursor `Task`, `spawn_subagent`, `start_agent`) — spawn a review-monitor that runs the gh-only loop; do not block the parent.
|
|
262
|
+
2. **Do not call** gate verbs via any surface the probe showed absent — those invocations cannot succeed and must not gate the spawn.
|
|
263
|
+
3. Ownership claim without the tasks: post/update the sticky `<!-- deft:review-owner -->` PR comment via `gh api` (same field shape as the task-written lease) **or** keep ownership in the parent and document `missing-task: review-monitor` in the PR/parent handback. Never invent `.deft/review-monitor.json`.
|
|
264
|
+
4. Poll with adaptive cadence (20-30s / 60s / 90s) using:
|
|
265
|
+
- `gh pr view <N> --comments` (dual-source + Step 1 rules still apply)
|
|
266
|
+
- `gh pr checks <N>`
|
|
267
|
+
- `gh api repos/<owner>/<repo>/pulls/<N> -q .head.sha` for HEAD pin
|
|
268
|
+
- `gh api repos/<owner>/<repo>/commits/<sha>/check-runs` for Greptile terminal check-run
|
|
269
|
+
5. Evaluate the same Step 6 fail-closed all-of (terminal check-run + HEAD SHA + Last reviewed commit + confidence > 3 + no P0/P1).
|
|
270
|
+
6. Surface missing-task once to the operator/parent on first detection; do not silently rebrand freestyle sleep as `pr:watch`.
|
|
271
|
+
|
|
272
|
+
⊗ Fake a successful `pr:watch` or `review-monitor:*` gate when every dual-invoke probe failed.
|
|
273
|
+
⊗ Block Approach 1 / parent yield on missing `review-monitor:*` after the dual-invoke probe — use the gh lease claim or parent-owned gh-only poll instead (#2878).
|
|
274
|
+
⊗ Invent ad-hoc `sleep` / main-session poll / OpenClaw cron loops outside Approach 1–3 when the skill already names this fallback (#2878 / statusreport#153 recurrence).
|
|
275
|
+
⊗ Skip Step 6 fail-closed fields because deterministic tasks are missing — the gh surfaces above remain mandatory.
|
|
190
276
|
|
|
191
277
|
! When `clean_gate_holdout=ci_failures` and Greptile otherwise satisfies the probe-side Step 6 fields (SHA match on HEAD, confidence > 3, no P0/P1, not errored): **MUST NOT** idle-poll hoping CI heals. Treat Greptile CLEAN + CI red with the **same ownership** as a Greptile P0 for a merge-ready worker — one fix batch, re-push, re-probe.
|
|
192
278
|
|
|
@@ -243,41 +329,51 @@ Both commands extract the "Comments Outside Diff" section with surrounding conte
|
|
|
243
329
|
|
|
244
330
|
|
|
245
331
|
|
|
246
|
-
! Select the monitoring approach based on runtime capability detection (the matrix in `skills/deft-directive-swarm/SKILL.md` Phase 3 Step 1, extended per #1342 slices 1-2 for `spawn_subagent` / "grok-build"
|
|
332
|
+
! Select the monitoring approach based on runtime capability detection (the matrix in `skills/deft-directive-swarm/SKILL.md` Phase 3 Step 1, extended per #1342 slices 1-2 for `spawn_subagent` / "grok-build", per #1877 for Cursor as first-class Tier-1 tiers, and per #2876 for OpenClaw `sessions_spawn`). Probe the environment (tool set + env vars) to obtain the stable platform descriptor (`grok-build`, `warp-orchestrated`, `warp-manual`, `cursor-composer`, `cursor-cloud-agent`, `openclaw`, etc.) from the launch adapter / `get_platform_capabilities` and map the descriptor to the appropriate tier + dispatch primitive (`start_agent`, `spawn_subagent`, the Cursor `Task` tool, or OpenClaw `sessions_spawn`). The descriptor (not hard-coded tool presence) is the single source of truth for both launch and review monitoring.
|
|
247
333
|
|
|
248
|
-
- **Tier 1 (orchestrated sub-agent)** → Approach 1 (spawn review-monitor sub-agent via the primitive matching the descriptor: `start_agent`, `spawn_subagent`,
|
|
249
|
-
- **Tier 2 (no sub-agent primitive, but scheduler/timer/auto-reinvocation)** → Approach 2 (yield-between-polls)
|
|
334
|
+
- **Tier 1 (orchestrated sub-agent)** → Approach 1 (spawn review-monitor sub-agent via the primitive matching the descriptor: `start_agent`, `spawn_subagent`, the Cursor `Task` tool with `run_in_background: true`, or OpenClaw `sessions_spawn`)
|
|
335
|
+
- **Tier 2 (no sub-agent primitive, but scheduler/timer/auto-reinvocation)** → Approach 2 (yield-between-polls) — includes OpenClaw `cron` / host scheduler **only when** `sessions_spawn` is unavailable (#2876)
|
|
250
336
|
- **Tier 3 (interactive session, nothing else)** → Approach 3 (blocking sleep loop as last resort)
|
|
251
337
|
|
|
252
|
-
! Detection: use the full runtime capability matrix (swarm Phase 3 + launch adapter from #1342 slice 2). The old single-probe for `start_agent` is superseded; the returned platform descriptor determines both the orchestration path and the MCP surface (see MCP probe below). If the descriptor is `grok-build` (spawn_subagent present, start_agent + WARP_* absent), treat as Tier 1 with the spawn_subagent poller path. If the descriptor is `cursor-composer` / `cursor-cloud-agent` (Cursor `Task` tool present, start_agent + WARP_* + spawn_subagent absent), treat as **Tier 1 with the backgrounded Cursor `Task` poller path** (#1877) — NOT Tier 3. Cursor's `Task` tool is a first-class sub-agent primitive; degrading a Cursor session to the Approach-3 blocking poll is the misclassification #1877 closes.
|
|
338
|
+
! Detection: use the full runtime capability matrix (swarm Phase 3 + launch adapter from #1342 slice 2). The old single-probe for `start_agent` is superseded; the returned platform descriptor determines both the orchestration path and the MCP surface (see MCP probe below). If the descriptor is `grok-build` (spawn_subagent present, start_agent + WARP_* absent), treat as Tier 1 with the spawn_subagent poller path. If the descriptor is `cursor-composer` / `cursor-cloud-agent` (Cursor `Task` tool present, start_agent + WARP_* + spawn_subagent absent), treat as **Tier 1 with the backgrounded Cursor `Task` poller path** (#1877) — NOT Tier 3. Cursor's `Task` tool is a first-class sub-agent primitive; degrading a Cursor session to the Approach-3 blocking poll is the misclassification #1877 closes. If the descriptor is `openclaw` (`sessions_spawn` present), treat as **Tier 1 with the backgrounded `sessions_spawn` poller path** (#2876) — NOT Approach 2 cron and NOT main-session gh poll.
|
|
253
339
|
|
|
254
|
-
! Swarm agents (whether launched via `start_agent` or `
|
|
340
|
+
! Swarm agents (whether launched via `start_agent`, `spawn_subagent`, or OpenClaw `sessions_spawn` per the platform descriptor) SHOULD prefer Approach 1 for their own review-monitor sub-agent. Approach 2's yield-between-polls is not self-sustaining for swarm agents (see warning below). Always include the canonical `templates/agent-prompt-preamble.md` (AGENTS.md read mandate, #810 xBRIEF gate, #798 PowerShell UTF-8, pre-PR + review-cycle mandates) when spawning a poller sub-agent.
|
|
255
341
|
|
|
256
|
-
! **Deterministic review-monitor gate (#2655 / #2814):** When Tier 1 is available
|
|
342
|
+
! **Deterministic review-monitor gate (#2655 / #2814 / #2876 / #2893):** When Tier 1 is available **and** a dual-invoke probe succeeds for review-monitor verbs (`deft verify:review-monitor` / `deft review-monitor:register`, or `task deft:verify:review-monitor` / `task deft:review-monitor:register`), run that verify form before yielding, entering Approach 3, or claiming review monitoring started — CLI: `deft verify:review-monitor --pr <N> [--call-site solo]`; task: `task deft:verify:review-monitor -- --pr <N> [--call-site solo]`. After spawning Approach 1, claim the PR-anchored lease with the matching register form (CLI: `deft review-monitor:register --pr <N> --monitor-agent-id <id> --platform-primitive ...`; task: `task deft:review-monitor:register -- --pr <N> --monitor-agent-id <id> --platform-primitive start_agent|spawn_subagent|cursor-task|sessions_spawn|openclaw-sessions-spawn`). Release with the matching release form (CLI: `deft review-monitor:release --pr <N>`; task: `task deft:review-monitor:release -- --pr <N>`) when done. Exit `0` ready / `1` not ready or held-by-other / `2` config. The sole source of truth is the sticky GitHub PR comment (`<!-- deft:review-owner -->`); legacy `.deft/review-monitor.json` is obsolete and ignored. On register conflict, attach to the existing owner or stop — do not parallel-fix.
|
|
257
343
|
|
|
258
|
-
! **
|
|
344
|
+
! **Missing review-monitor surface carve-out (#2878 / #2893):** When dual-invoke probes fail for `pr:watch` **and** `review-monitor:*` (no `deft` CLI, no `task deft:` include), do **not** invoke those gates and do **not** block Approach 1 on them. Fail-loud once with `missing-task: review-monitor` / `missing-task: pr:watch`, then:
|
|
345
|
+
1. Still spawn Approach 1 with the official gh-only fallback when a sub-agent primitive exists.
|
|
346
|
+
2. Post (or update) the sticky lease comment via raw `gh api` using the same `<!-- deft:review-owner -->` field shape the tasks would write — parent may yield after that claim succeeds — **or**, if the agent cannot write issue comments, keep ownership in the parent with the gh-only poll and document that lease tasks were unavailable.
|
|
347
|
+
3. Never invent a local `.deft/review-monitor.json` as a substitute gate.
|
|
348
|
+
⊗ Require successful review-monitor register/verify on a consumer where dual-invoke probes failed — that is the conf=3 / #2878 inconsistency Greptile flagged.
|
|
349
|
+
|
|
350
|
+
! **Regression trigger (#2797 / #2878):** A leaf that claims a monitor is active without a preceding successful **GitHub sticky lease claim** MUST fail the review-monitor checklist/eval; a backgrounded `pr:watch` shell is insufficient. When a dual-invoke probe finds `review-monitor:register`, that form is the required claim path. When the missing-task carve-out applies (#2878), a raw `gh api` post/update of the same `<!-- deft:review-owner -->` sticky comment satisfies the claim (or the parent keeps ownership and does not claim a separate monitor). The regression fails only on a claim with **no** sticky lease evidence — not on consumers that legitimately lack the gate surface.
|
|
259
351
|
|
|
260
352
|
|
|
261
353
|
|
|
262
354
|
! **CI-holdout carve-out (#2688):** When `task pr:watch --one-shot --json` reports `clean_gate_holdout=ci_failures` with Greptile fields otherwise satisfied on current HEAD, do **not** freeze on `verify:review-monitor` / spawn-monitor as if Greptile latency were the blocker. Fix CI first (same ownership as Greptile P0). Keep or register a review-monitor only while still waiting on Greptile latency; a `BLOCKED: ci_failures` DONE handback to the implementation owner is correct.
|
|
263
355
|
|
|
264
356
|
|
|
265
|
-
! **Cursor leaf boundary (#2797):** A Cursor `Task` leaf cannot reliably spawn another Cursor `Task`; nested Task (leaf spawning leaf) is unsupported for an Approach 1 review-monitor. A Cursor `drive-to: merge-ready` leaf MUST either keep ownership in the same agent by blocking on `task pr:watch -- <N
|
|
357
|
+
! **Cursor leaf boundary (#2797 / #2893):** A Cursor `Task` leaf cannot reliably spawn another Cursor `Task`; nested Task (leaf spawning leaf) is unsupported for an Approach 1 review-monitor. A Cursor `drive-to: merge-ready` leaf MUST either keep ownership in the same agent by blocking on `deft pr:watch <N>` (or `task deft:pr:watch -- <N>` when include-present), or its envelope MUST instead be `stop-at: pr-open` so the orchestrator can spawn and register a sibling review-monitor. A background shell `pr:watch` is not a monitor and MUST NOT be claimed as one.
|
|
266
358
|
|
|
267
359
|
**Approach 1 (preferred -- sub-agent orchestration available per platform descriptor):**
|
|
268
360
|
|
|
269
|
-
! **Background dispatch (#1880):** Spawn the review-monitor sub-agent via the matching primitive IN THE BACKGROUND (Cursor: Task `run_in_background: true`; Grok Build: `spawn_subagent` with parent yielding). The parent MUST remain interactive while the poller runs.
|
|
361
|
+
! **Background dispatch (#1880 / #2876):** Spawn the review-monitor sub-agent via the matching primitive IN THE BACKGROUND (Cursor: Task `run_in_background: true`; Grok Build: `spawn_subagent` with parent yielding; OpenClaw: `sessions_spawn` with parent yielding). The parent MUST remain interactive while the poller runs — never block the parent OpenClaw/Cursor/Grok session for >~3 min of monitor ownership.
|
|
362
|
+
|
|
363
|
+
! **Heartbeat contract for Cursor pollers (#1877 / #1166 / #2876):** OpenClaw sessions_spawn pollers share this contract. A Cursor `Task` or OpenClaw `sessions_spawn` review-monitor poller whose loop runs > ~3 min MUST honour the sub-agent heartbeat contract (`docs/subagent-heartbeat.md`), same as the `spawn_subagent` path — emit periodic progress so the parent can distinguish a live poller from a hung one.
|
|
270
364
|
|
|
271
|
-
|
|
365
|
+
~ **Visible Control UI (OpenClaw):** When OpenClaw Control UI is the operator control plane, SHOULD spawn the review-monitor as a **visible** subagent so humans can inspect progress without attaching to the parent session.
|
|
272
366
|
|
|
273
367
|
! When the platform descriptor indicates Tier 1 (sub-agent support), spawn a review-monitor sub-agent using the primitive matching the descriptor:
|
|
274
368
|
|
|
275
|
-
1. ! Launch via the matching primitive: `start_agent` (Warp), `spawn_subagent` (grok-build / TUI / non-Warp),
|
|
276
|
-
2. ! The sub-agent polls using the mechanism for its primitive: for `spawn_subagent` use `get_command_or_subagent_output` (adaptive cadence: ~20-30s first check after push, ~60s second, ~90s thereafter; Greptile typically lands in 3-7 min); for `start_agent` the native messaging path; for the Cursor `Task` tool the backgrounded-task completion-notification path. Front-load the first check to catch fast reviews.
|
|
277
|
-
3. ! When the exit condition is met (Greptile review current on the HEAD commit SHA, confidence > 3, no P0/P1 remaining), the sub-agent reports completion back to the parent (via `send_message_to_agent
|
|
369
|
+
1. ! Launch via the matching primitive: `start_agent` (Warp), `spawn_subagent` (grok-build / TUI / non-Warp), the Cursor `Task` tool with `run_in_background: true` (`cursor-composer` / `cursor-cloud-agent`, #1877), **or OpenClaw `sessions_spawn` (`openclaw`, #2876)** with a prompt that instructs it to poll for Greptile completion. For `spawn_subagent`, Cursor `Task`, and OpenClaw `sessions_spawn` the prompt MUST reference the canonical poller template `templates/swarm-greptile-poller-prompt.md` (with placeholders filled) plus the agent preamble; the working directory / context must be the PR branch (worktree or equivalent for hybrid).
|
|
370
|
+
2. ! The sub-agent polls using the mechanism for its primitive: for `spawn_subagent` use `get_command_or_subagent_output` (adaptive cadence: ~20-30s first check after push, ~60s second, ~90s thereafter; Greptile typically lands in 3-7 min); for `start_agent` the native messaging path; for the Cursor `Task` tool the backgrounded-task completion-notification path; for OpenClaw `sessions_spawn` the host session completion / messaging channel (prefer `task pr:watch` inside the child when available). Front-load the first check to catch fast reviews.
|
|
371
|
+
3. ! When the exit condition is met (Greptile review current on the HEAD commit SHA, confidence > 3, no P0/P1 remaining), the sub-agent reports completion back to the parent (via `send_message_to_agent`, the spawn_subagent result channel, or the OpenClaw sessions completion channel).
|
|
278
372
|
4. ! The main conversation pane stays fully interactive during monitoring -- the user (or parent monitor) can continue other work.
|
|
279
373
|
5. ! On receiving the completion message / result, the parent re-fetches findings (both gh pr view --comments and the secondary source) and proceeds to Step 5.
|
|
280
374
|
|
|
375
|
+
⊗ Use OpenClaw `cron` alone as Approach 1 when `sessions_spawn` is available — cron is Approach 2 scheduler fallback only (#2876).
|
|
376
|
+
|
|
281
377
|
**Approach 2 (fallback -- no sub-agent primitive for the descriptor):**
|
|
282
378
|
|
|
283
379
|
! When the platform descriptor indicates no sub-agent orchestration (or the primitive is unavailable), use discrete tool calls with a yield between checks. For `grok-build` / spawn_subagent descriptor this path is normally avoided in favor of Approach 1; it exists for pure interactive or limited runtimes.
|
|
@@ -439,6 +535,12 @@ task lifecycle:event -- emit plan:approved \
|
|
|
439
535
|
## Anti-Patterns
|
|
440
536
|
|
|
441
537
|
- ⊗ Route PR shepherding to Cursor global `babysit` on Deft-managed repos when `.deft/core/` is installed -- use this review-cycle skill instead (#2261)
|
|
538
|
+
- ⊗ Route OpenClaw babysit/shepherd/watch to main-session gh poll + cron when `sessions_spawn` is available -- use Approach 1 with `sessions_spawn` (#2876 / #2261)
|
|
539
|
+
- ⊗ Treat OpenClaw `cron` alone as Approach 1 — cron/timer is Approach 2 only if spawn is unavailable (#2876)
|
|
540
|
+
- ⊗ Expand active story scope past xBRIEF AC mid-babysit without follow-up issue or consented brief amend (#2881)
|
|
541
|
+
- ⊗ Treat confidence-only holds (0 P0/P1) as a mandate for unbounded redesign (#2881)
|
|
542
|
+
- ⊗ Invent freestyle sleep/poll loops when dual-invoke probes fail for `pr:watch` — use the official gh-only fallback and fail-loud missing-task (#2878 / #2893)
|
|
543
|
+
- ⊗ Treat bare `task pr:watch` as the only consumer gate form — probe `deft` then `task deft:` first (#2893)
|
|
442
544
|
- ⊗ Treat a passing SLizard/Greptile check run, a non-blocking review comment, or an ad hoc fix commit as the review-cycle exit predicate -- Step 6 fail-closed all-of (#1259) and multi-reviewer registry triage (#769) still apply
|
|
443
545
|
- ⊗ Push individual fix commits per finding
|
|
444
546
|
- ⊗ Start fixing before analyzing ALL findings
|
|
@@ -24,6 +24,21 @@ Legend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.
|
|
|
24
24
|
- User asks to create USER.md, PROJECT-DEFINITION.xbrief.json, or a specification
|
|
25
25
|
- User clones a deft-enabled repo for the first time with no config
|
|
26
26
|
|
|
27
|
+
## Opt-out flag (`.no-deft-directive`) (#2926)
|
|
28
|
+
|
|
29
|
+
! Before Pre-Cutover Detection Guard, Phase 1, or any install/setup step, check the **project root** for `.no-deft-directive` (exact lowercase name; presence = flag; empty or short `#` comment OK).
|
|
30
|
+
|
|
31
|
+
| Condition | Action |
|
|
32
|
+
|-----------|--------|
|
|
33
|
+
| Flag **present** | Stop. Tell the human: "Directive disabled via `.no-deft-directive`". ⊗ Offer install, session ritual, or setup interview. |
|
|
34
|
+
| Flag **absent**, no Directive deposit (`.deft/core`) | ? Ask whether to use Directive. On **no** → create root `.no-deft-directive` (optional one-line rationale) and stop. On **yes** → continue setup and ⊗ create the flag. |
|
|
35
|
+
| Operator says **stop using DD** | Create `.no-deft-directive`. ⊗ Auto-delete `.deft/` (explicit cleanup only). |
|
|
36
|
+
| Operator says **start using DD** | Remove `.no-deft-directive` and ensure install (`directive init` / deposit). |
|
|
37
|
+
|
|
38
|
+
! Flag is **root-only** (workspace root opened). Nested monorepo package roots are out of scope for v1.
|
|
39
|
+
! Flag **wins locally** over trusted-org / product-signal force-on (v1).
|
|
40
|
+
! Flag + deposit = inconsistent: warn loudly; doctor diagnoses; do not silently refresh. See `content/docs/no-deft-directive.md`.
|
|
41
|
+
|
|
27
42
|
## Consumer-first default (#1813)
|
|
28
43
|
|
|
29
44
|
! Assume the operator is **using Deft in their project** (consumer path). Proceed directly to the Pre-Cutover Detection Guard and Phase 1 — do NOT open with a contributor-vs-consumer fork.
|
|
@@ -504,15 +519,27 @@ omit = [
|
|
|
504
519
|
|
|
505
520
|
### Onboarding Question
|
|
506
521
|
|
|
507
|
-
! Before proceeding with the strategy gate, ask the onboarding question
|
|
522
|
+
! Before proceeding with the strategy gate, ask the onboarding question. Use the same add-scope / update / replace vocabulary as the Chaining Gate in [strategies/interview.md](../../strategies/interview.md#chaining-gate).
|
|
523
|
+
|
|
524
|
+
**Brownfield detector** (same as Chaining Gate): `PROJECT-DEFINITION` exists (`./xbrief/` or legacy `./vbrief/`) **OR** any lifecycle folder (`proposed/`, `pending/`, `active/`, `completed/`, `cancelled/`) has scope records.
|
|
508
525
|
|
|
509
|
-
> "
|
|
510
|
-
> 1.
|
|
511
|
-
> 2.
|
|
526
|
+
> "How should we treat this project's specification?"
|
|
527
|
+
> 1. **Add scope to this project** [default when brownfield] — load existing identity; skip greenfield "what are we building?"; emit one proposed scope; Preparatory Guard on write
|
|
528
|
+
> 2. **Update project definition** — delta interview → Spec-Generating Guard → merge narratives into existing PROJECT-DEFINITION
|
|
529
|
+
> 3. **Replace specification (scrap)** — only after explicit affirmative (`yes` / `confirmed`); then full new-spec path
|
|
530
|
+
> 4. **Starting a new project specification** [default when greenfield] — proceed to the Strategy Gate below
|
|
531
|
+
> 5. **Discuss** — explore these options before choosing
|
|
532
|
+
> 6. **Back** — return to the previous setup question
|
|
512
533
|
|
|
513
|
-
- ! Default based on repo state
|
|
514
|
-
- !
|
|
515
|
-
- ! If
|
|
534
|
+
- ! Default based on repo state via the brownfield detector above (brownfield → Add scope; greenfield → Starting new)
|
|
535
|
+
- ! Final two numbered options MUST be `Discuss` and `Back` per [`../../contracts/deterministic-questions.md`](../../contracts/deterministic-questions.md)
|
|
536
|
+
- ! If **Add scope**: skip the full interview, create a new scope xBRIEF in `./xbrief/proposed/` with the user's description, apply Preparatory Guard on write, then surface the Lifecycle Bridge + End-of-Phase-3 Export Prompt + handoff sections below (do not dead-end after the write)
|
|
537
|
+
- ! If **Update project definition**: run a delta interview; apply Spec-Generating Guard against `./xbrief/PROJECT-DEFINITION.xbrief.json` (or legacy `./vbrief/PROJECT-DEFINITION.vbrief.json` if that is the existing identity); merge narratives (do not wholesale replace unless the user confirmed scrap)
|
|
538
|
+
- ! If **Replace specification (scrap)**: require explicit `yes`/`confirmed`, then proceed to the Strategy Gate as a greenfield-style full path
|
|
539
|
+
- ! If **Starting new**: proceed to the Strategy Gate below
|
|
540
|
+
- ⊗ Treat brownfield repos as "Starting new" by default
|
|
541
|
+
- ⊗ Accept vague confirmation (`proceed`, `ok`) for Replace/scrap
|
|
542
|
+
- ⊗ Exit immediately after Add-scope write without the lifecycle bridge / export / handoff guidance
|
|
516
543
|
|
|
517
544
|
### ⚠️ MANDATORY: Strategy Gate — Do This First
|
|
518
545
|
|
|
@@ -639,7 +666,7 @@ Per [strategies/interview.md](../../strategies/interview.md#interview-rules-shar
|
|
|
639
666
|
|
|
640
667
|
### Lifecycle Bridge to Downstream Skills (#1025)
|
|
641
668
|
|
|
642
|
-
! Scope xBRIEFs created by Phase 3 (both Light and Full paths) AND by the Onboarding Question "
|
|
669
|
+
! Scope xBRIEFs created by Phase 3 (both Light and Full paths) AND by the Onboarding Question "Add scope to this project" branch land in `xbrief/proposed/` with `plan.status: proposed`. This is the canonical deposit point per the deft lifecycle (`proposed -> pending -> active -> completed`). The #810 implementation-intent gate (`task xbrief:preflight`) and the deft-directive-swarm Phase 0 Step 1 preflight BOTH require candidate xBRIEFs to live in `xbrief/active/` with `plan.status == "running"` before any agent can dispatch against them; setup deliberately stops at `proposed/` because the lifecycle commitment (promote + activate) belongs to the downstream skill, not the setup interview.
|
|
643
670
|
|
|
644
671
|
! Surface this bridge to the user in the Phase 3 → next-skill handoff so they are not surprised by a wholesale preflight rejection downstream:
|
|
645
672
|
|