@deftai/directive-content 0.115.0 → 0.117.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/UPGRADING.md +17 -6
- package/coding/review.md +8 -0
- package/commands.md +8 -6
- package/contracts/design-critique.md +27 -20
- package/docs/BROWNFIELD.md +10 -0
- package/docs/grok-build-subscription-setup.md +46 -0
- package/docs/plan-acceptance.md +52 -0
- package/package.json +1 -1
- package/packs/rules/rules-pack-0.1.json +112 -112
- package/packs/skills/skills-pack-0.1.json +11 -8
- package/packs/strategies/strategies-pack-0.1.json +1 -1
- package/skills/deft-directive-build/SKILL.md +8 -7
- package/skills/deft-directive-design-critique/SKILL.md +2 -2
- package/skills/deft-directive-pre-pr/SKILL.md +9 -9
- package/skills/deft-directive-release/SKILL.md +32 -5
- package/skills/deft-directive-review-cycle/SKILL.md +35 -0
- package/skills/deft-directive-setup/SKILL.md +45 -11
- package/skills/deft-directive-swarm/references/core-phase-0.md +2 -0
- package/skills/deft-directive-swarm/references/host-cursor.md +2 -0
- package/strategies/interview.md +68 -20
- package/tasks/verify.yml +3 -1
- package/templates/agent-prompt-preamble.md +1 -1
- package/templates/agents-entry.md +2 -0
- package/tools/package-manager-network.md +2 -2
- package/vbrief/schemas/vbrief-core.schema.json +1 -1
package/strategies/interview.md
CHANGED
|
@@ -31,10 +31,12 @@ or switch to a different spec-generating strategy. This gate is the single
|
|
|
31
31
|
orchestration point for strategy composition.
|
|
32
32
|
|
|
33
33
|
! The chaining gate MUST always be shown — even when the interview strategy is
|
|
34
|
-
invoked directly with no prior strategy
|
|
34
|
+
invoked directly with no prior strategy — except the identity-only Starting-new
|
|
35
|
+
skip below (#4390).
|
|
35
36
|
! The chaining gate is a **blocking question**. The AI MUST present the options
|
|
36
37
|
and wait for the user to choose before proceeding.
|
|
37
|
-
⊗ Skip the chaining gate or proceed to the sizing gate without presenting it
|
|
38
|
+
⊗ Skip the chaining gate or proceed to the sizing gate without presenting it,
|
|
39
|
+
except the identity-only Starting-new / Proceed invocation named below.
|
|
38
40
|
|
|
39
41
|
### When It Appears
|
|
40
42
|
|
|
@@ -44,17 +46,31 @@ and wait for the user to choose before proceeding.
|
|
|
44
46
|
|
|
45
47
|
### Brownfield Detector
|
|
46
48
|
|
|
47
|
-
Before rendering menu options, classify the repo (
|
|
49
|
+
Before rendering menu options, classify the repo (same rule as setup Phase 3; #4390 recut of the #2925 identity-OR-scopes probe):
|
|
48
50
|
|
|
49
|
-
- **
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
- **
|
|
51
|
+
- **Identity-only** when BOTH:
|
|
52
|
+
- live PROJECT-DEFINITION `plan.items` is empty (`[]` or absent), AND
|
|
53
|
+
- no convention-valid `*.xbrief.json` / `*.vbrief.json` in lifecycle folders (`proposed/`, `pending/`, `active/`, `completed/`, `cancelled/` under `./xbrief/` or legacy `./vbrief/`). Exclude `.gitkeep` and `*.premigrate.*`. PROJECT-DEFINITION itself is identity, not a scope record.
|
|
54
|
+
- **Scoped (brownfield)** when `plan.items` is non-empty OR at least one convention-valid scope file exists
|
|
55
|
+
- **Greenfield** otherwise (no PROJECT-DEFINITION and no convention-valid scope file)
|
|
53
56
|
|
|
54
57
|
! The detector MUST run on every Chaining Gate presentation.
|
|
58
|
+
! Identity-only and greenfield share the Proceed / Starting-new default. Scoped/brownfield defaults to Add-scope.
|
|
59
|
+
⊗ Treat PROJECT-DEFINITION existence alone as brownfield.
|
|
60
|
+
⊗ Use session-age ("this setup turn just wrote identity") as the probe.
|
|
61
|
+
⊗ Invent a "finished Phase 3" marker.
|
|
55
62
|
⊗ Offer only the greenfield-framed **Proceed to specification** default on a brownfield repo.
|
|
56
63
|
⊗ Treat brownfield as a full create path without an explicit Replace/scrap confirm.
|
|
57
64
|
|
|
65
|
+
### Starting-new / Proceed skip (#4390)
|
|
66
|
+
|
|
67
|
+
! Starting-new (setup Phase 3) and Proceed (this gate) MUST ask what to build before writing a scope.
|
|
68
|
+
|
|
69
|
+
? When setup Phase 3 already selected **Starting a new project specification** on identity-only, this Chaining Gate MAY be skipped for that invocation and the agent may continue to the Sizing Gate. Written reason: identity-only default is already Proceed; the prior identity-OR-scopes detector re-defaulted to Add-scope one step later and skipped the product interview.
|
|
70
|
+
|
|
71
|
+
⊗ Skip this gate on scoped/brownfield repos.
|
|
72
|
+
⊗ Skip this gate when the operator chose Add-scope, Update, or Replace.
|
|
73
|
+
|
|
58
74
|
### Options
|
|
59
75
|
|
|
60
76
|
! 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).
|
|
@@ -63,16 +79,22 @@ Present groups sourced from the `Type` column in
|
|
|
63
79
|
[strategies/README.md](./README.md#strategy-types). The **default path** depends
|
|
64
80
|
on the brownfield detector:
|
|
65
81
|
|
|
66
|
-
**Default path (greenfield):**
|
|
67
|
-
1. **Proceed to specification** (default) — continue to the [Sizing Gate](#sizing-gate) for a full create path
|
|
82
|
+
**Default path (greenfield or identity-only):**
|
|
83
|
+
1. **Proceed to specification** (default) — ask what to build; continue to the [Sizing Gate](#sizing-gate) for a full create path
|
|
84
|
+
|
|
85
|
+
**Identity-only also keeps Add-scope / Update / Replace / Process-only on the menu** (same vocabulary as setup Phase 3). They are not the default.
|
|
68
86
|
|
|
69
87
|
**Default path (brownfield) — create-vs-update menu:**
|
|
70
|
-
1. **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
|
|
88
|
+
1. **Add scope to this project** (default) — load existing project identity + preparatory artifacts; **skip** the greenfield "what are we building?" interview only after capturing an explicit product or slice description; gather only the new scope; emit **one** proposed scope record; apply the [Preparatory Guard](./artifact-guards.md#preparatory-guard-light) on write
|
|
89
|
+
- ! On identity-only Add-scope: capture a product or slice description, or do not emit a proposed xBRIEF. ⊗ Synthesize the first scope from Overview / directory name / init seed. Swarm's `xbrief/proposed/` scan is in scope for that skip.
|
|
71
90
|
2. **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)
|
|
72
91
|
3. **Replace specification (scrap)** — full recreate equivalent to greenfield Proceed; **only** after explicit affirmative (`yes` / `confirmed`); vague replies (`proceed`, `ok`, `go ahead`) are **not** acceptance
|
|
73
92
|
- ! On confirmed scrap, continue to the [Sizing Gate](#sizing-gate) as a full create path
|
|
74
93
|
- ⊗ Auto-delete PROJECT-DEFINITION without scrap confirm
|
|
75
94
|
- ⊗ Rename Proceed to "Update" without changing behavior
|
|
95
|
+
4. **Process-only (keep Phase 2 identity)** — leave strategy; no new scope; no spec write. Do not emit a proposed scope. Do not merge or scrap PROJECT-DEFINITION narratives. Then-path: session ritual / deft check / later Add scope. Skip Sizing Gate, export, Acceptance Gate, and build. GitHub issues stay cache/queue inputs. Docs stay described content.
|
|
96
|
+
- ⊗ Use Back or Other as this option
|
|
97
|
+
- ⊗ Bind docs or issues as the next-build plan
|
|
76
98
|
|
|
77
99
|
**Preparatory strategies** (type: `preparatory` — loops back to this gate on completion):
|
|
78
100
|
- Research — investigate the domain, find libraries, identify pitfalls
|
|
@@ -144,7 +166,32 @@ Ready to generate the specification. Before we proceed, would you like to:
|
|
|
144
166
|
10. Back
|
|
145
167
|
```
|
|
146
168
|
|
|
147
|
-
**
|
|
169
|
+
**Identity-only** (PROJECT-DEFINITION exists; empty `plan.items`; no convention-valid scopes) — same options as setup Phase 3; Proceed is the default:
|
|
170
|
+
|
|
171
|
+
```
|
|
172
|
+
This repo has project identity but no scopes yet. Before we proceed:
|
|
173
|
+
|
|
174
|
+
1. Proceed to specification (default) — ask what to build; full create path
|
|
175
|
+
2. Add scope to this project — keep identity; requires an explicit product or slice description
|
|
176
|
+
3. Update project definition — delta interview; merge narratives (Spec-Generating Guard)
|
|
177
|
+
4. Replace specification (scrap) — requires explicit yes/confirmed; full recreate
|
|
178
|
+
5. Process-only (keep Phase 2 identity) — leave strategy; no new scope; no spec write
|
|
179
|
+
|
|
180
|
+
--- Preparatory (loops back) ---
|
|
181
|
+
6. Run a research phase — investigate the domain, find libraries, identify pitfalls
|
|
182
|
+
7. Run a discuss phase — lock key decisions using Feynman technique
|
|
183
|
+
8. Run a probe phase — adversarially stress-test the plan; surface assumptions, edge cases, and risks
|
|
184
|
+
9. Run a map phase — analyze existing codebase conventions
|
|
185
|
+
|
|
186
|
+
--- Switch strategy ---
|
|
187
|
+
10. Switch to yolo — auto-pilot picks all answers
|
|
188
|
+
11. Switch to speckit — formal spec process with story readiness before implementation
|
|
189
|
+
12. Other (specify)
|
|
190
|
+
13. Discuss
|
|
191
|
+
14. Back
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
**Brownfield** (scoped):
|
|
148
195
|
|
|
149
196
|
```
|
|
150
197
|
This repo already has a project definition and/or scopes. Before we proceed:
|
|
@@ -152,19 +199,20 @@ This repo already has a project definition and/or scopes. Before we proceed:
|
|
|
152
199
|
1. Add scope to this project (default) — keep identity; add one new proposed scope
|
|
153
200
|
2. Update project definition — delta interview; merge narratives (Spec-Generating Guard)
|
|
154
201
|
3. Replace specification (scrap) — requires explicit yes/confirmed; full recreate
|
|
202
|
+
4. Process-only (keep Phase 2 identity) — leave strategy; no new scope; no spec write
|
|
155
203
|
|
|
156
204
|
--- Preparatory (loops back) ---
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
205
|
+
5. Run a research phase — investigate the domain, find libraries, identify pitfalls
|
|
206
|
+
6. Run a discuss phase — lock key decisions using Feynman technique
|
|
207
|
+
7. Run a probe phase — adversarially stress-test the plan; surface assumptions, edge cases, and risks
|
|
208
|
+
8. Run a map phase — analyze existing codebase conventions
|
|
161
209
|
|
|
162
210
|
--- Switch strategy ---
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
211
|
+
9. Switch to yolo — auto-pilot picks all answers
|
|
212
|
+
10. Switch to speckit — formal spec process with story readiness before implementation
|
|
213
|
+
11. Other (specify)
|
|
214
|
+
12. Discuss
|
|
215
|
+
13. Back
|
|
168
216
|
```
|
|
169
217
|
|
|
170
218
|
---
|
package/tasks/verify.yml
CHANGED
|
@@ -113,7 +113,9 @@ tasks:
|
|
|
113
113
|
- task: :engine:_ts-build
|
|
114
114
|
dir: '{{.USER_WORKING_DIR}}'
|
|
115
115
|
cmds:
|
|
116
|
-
-
|
|
116
|
+
- task: :engine:invoke
|
|
117
|
+
vars:
|
|
118
|
+
ENGINE_CMD: 'docs-impact --project-root "{{.USER_WORKING_DIR}}" {{.CLI_ARGS}}'
|
|
117
119
|
|
|
118
120
|
license-sync:
|
|
119
121
|
desc: "Drift guard for root LICENSE ↔ content/LICENSE.md and published package.json license fields (#2902). Three-state exit (0 clean / 1 drift / 2 config). Framework-source only."
|
|
@@ -96,7 +96,7 @@ Populate `selected_backend` OR `routing_policy` (or both when the operator sets
|
|
|
96
96
|
|
|
97
97
|
**Role-boundary expectations (all providers):** the same boundaries apply whether the worker runs on Composer, Grok Build, Cursor/cloud, Claude Code, OpenClaw, or a future adapter:
|
|
98
98
|
|
|
99
|
-
- ! `leaf-implementation` workers implement scoped xBRIEF work in their assigned worktree only -- gates (`task check
|
|
99
|
+
- ! `leaf-implementation` workers implement scoped xBRIEF work in their assigned worktree only -- gates (prefer `deft check`; else tree-correct `task deft:check` on include-only consumers or `task check` in framework source; file-scope audit; Greptile review cycle) are model-agnostic and MUST still pass. These are one gate, not two sequential runs. Do not add a fourth probe (#2893 / #4379).
|
|
100
100
|
- ! **Spawned mutating workers take their own worktree (#4066 / #4295).** Implement-class spawn must dest-place before occupancy claim. Grok `spawn_subagent` dest is `cwd` only (cannot rewrite PreToolUse input). Claude/Codex keep `isolation=worktree` or a linked path. Cursor Task has no local dest field — dest-placing is a dest-rooted window (nursery inherit) or `@cursor/sdk` `Agent.create({ local: { cwd } })`; do not advertise Task dest keys. Sharing the primary checkout with a live occupant is refuse, not `occupancy:grant` across hosts. Master/primary occupancy is the exception (`release-cut`, `policy-restore`, operator-directed default-branch work). `--read-only` never claims. On DONE/terminal the dispatcher compare-and-releases the recorded child tree (incarnation + parent-id); do not steal the parent's lease to recover.
|
|
101
101
|
- ! `orchestrator`, `review-monitor`, and `merge-release` roles MUST run on strong or review-capable agents; dispatchers MUST NOT route these roles to cheap leaf backends.
|
|
102
102
|
- ⊗ Route a cheap leaf backend onto the merge cascade, Phase 5->6 release gate, conflict-resolution rebase, or review-cycle merge-ready decision -- these are irreversible-damage surfaces that stay on the strong tier regardless of provider.
|
|
@@ -71,10 +71,12 @@ Deft is installed in .deft/core/. Full guidelines: .deft/core/main.md
|
|
|
71
71
|
|
|
72
72
|
! Process-critical skills with false-negative risk MUST be named in AGENTS.md (always-pin tier) — tier definitions: `.deft/core/docs/skill-pin-policy.md` (#2508).
|
|
73
73
|
! **Default always-pins:** `deft-directive-build`, `deft-directive-pre-pr`, `deft-directive-review-cycle`, `deft-directive-swarm` — read each `SKILL.md` when that work type starts.
|
|
74
|
+
! Policy-anchored review-response (#3452): HEAD policy before out-of-model. Depth: review-cycle SKILL.
|
|
74
75
|
⊗ Pin entire language packs, deployment docs, or framework bulk into AGENTS.md — pins are for false-negative-sensitive process gates only (#2508).
|
|
75
76
|
! **Dual stop (#2442):** multi-iteration work MUST have success + failure/budget stop (max iters / no-progress / budget); single-turn exempt; halt with operator-visible report; ⊗ thrash. Defaults: build, swarm, review-cycle skills. See main.md Dual Stop Rule. Ledger #3143 (`packages/core/src/delivery-attempt/`).
|
|
76
77
|
## Rule Authority [AXIOM]
|
|
77
78
|
! Prefer `task deft:*` over AGENTS.md prose. See main.md.
|
|
79
|
+
! Merge chokepoint (#4379 / #2893): prefer `deft check`; else `task deft:check` on include-only consumers. One gate, not two runs.
|
|
78
80
|
## Thin Fail-Closed Design (#3265)
|
|
79
81
|
! One fail-closed `task deft:*` check + one remediation. See main.md.
|
|
80
82
|
## Writing bar (#3368)
|
|
@@ -15,7 +15,7 @@ Directive runs against arbitrary repositories, including private monorepos with
|
|
|
15
15
|
|
|
16
16
|
- ! Read-only, session-start, and session-ritual flows (`deft session:start`, `deft verify:session-ritual`, `deft verify:tools`) MUST perform no npm/pnpm registry access. Tool-presence probes MUST use PATH lookups (`which`/`accessSync`) or `--version` checks, never a subcommand that can resolve dependencies or query a registry.
|
|
17
17
|
- ! `npm config get @deftai:registry` and `npm config get registry` are offline configuration reads, not registry access. `deft doctor` MAY use them in its default tier to identify effective routing, but MUST NOT print the raw values because registry URLs can contain internal hostnames or credentials.
|
|
18
|
-
- ! `deft doctor` MUST default to an OFFLINE tier: no check in the default run may contact an npm/pnpm registry. The one check that can (`payload-staleness`, which uses `git ls-remote` to verify the installed pin and `npm view <package> version --
|
|
18
|
+
- ! `deft doctor` MUST default to an OFFLINE tier: no check in the default run may contact an npm/pnpm registry. The one check that can (`payload-staleness`, which uses `git ls-remote` to verify the installed pin and `npm view <package> version --ignore-scripts` from a temp cwd whose project `.npmrc` sets `@deftai:registry=https://registry.npmjs.org/`) is gated behind the explicit `--network` flag and is skipped by default with a pointer to that flag. `--registry` does not beat `@scope:registry`; `--userconfig` does not beat a project `@scope:registry`. Directive-owned `npm view` MUST unset or override the scoped key (cwd change with a project `.npmrc`, or durable `@deftai:registry`) rather than pin `--registry` from the consumer cwd.
|
|
19
19
|
- ! Before a network-gated check runs, `deft doctor --network` MUST print a disclosure line naming the tool and registry class it may contact (for example, "may contact your git remote and the npm registry") BEFORE any network call is attempted.
|
|
20
20
|
- ! Any future doctor check, session step, or read-only command that needs to invoke `npm`/`pnpm` in a way that can reach a registry MUST follow the same pattern: explicit flag or subcommand, disclosed registry class before the call, and offline by default.
|
|
21
21
|
- ~ Where a package-manager operation is unavoidable in an explicitly-invoked flow (e.g. a release or install workflow that legitimately needs to fetch packages), prefer offline/frozen modes (`--offline`, `--prefer-offline`, `--frozen-lockfile`) when the operation only needs to validate local state rather than resolve fresh metadata.
|
|
@@ -28,4 +28,4 @@ This does not ban dependency installation or registry verification from explicit
|
|
|
28
28
|
|
|
29
29
|
## Reference implementation
|
|
30
30
|
|
|
31
|
-
`packages/core/src/doctor/npm-registry.ts` performs only the two offline `npm config get` reads above and redacts their values from findings. `packages/core/src/doctor/payload-staleness.ts` owns the network-capable doctor probes (`git ls-remote` and `npm view`); `packages/core/src/doctor/main.ts` gates them behind `--network` and prints the disclosure line first. The npm release lookup
|
|
31
|
+
`packages/core/src/doctor/npm-registry.ts` performs only the two offline `npm config get` reads above and redacts their values from findings. `packages/core/src/doctor/payload-staleness.ts` owns the network-capable doctor probes (`git ls-remote` and `npm view`); `packages/core/src/doctor/main.ts` gates them behind `--network` and prints the disclosure line first. The npm release lookup isolates from project/user `@deftai:registry` with a temp cwd whose project `.npmrc` sets `@deftai:registry=https://registry.npmjs.org/`, and `--ignore-scripts`. User npmrc still supplies proxy/cafile. `--registry` does not beat `@scope:registry` (npm/cli#7659). `--userconfig` does not beat a project scoped registry. Default doctor and gated session-ritual MUST NOT add a fail-closed `npm view`. `packages/core/src/session/session-start.ts` and `packages/core/src/verify-env/verify-tools.ts` perform no package-manager network access at all -- tool presence is resolved via PATH probing only. Do not parse per-package `.npmrc` keys.
|
|
@@ -612,7 +612,7 @@
|
|
|
612
612
|
"sessionRitualStalenessHours": {
|
|
613
613
|
"type": "integer",
|
|
614
614
|
"minimum": 1,
|
|
615
|
-
"description": "Maximum age, in hours, for .deft/ritual-state.json before the fail-closed session ritual verifier requires task session:start to run again. Default:
|
|
615
|
+
"description": "Maximum age, in hours, for .deft/ritual-state.json before the fail-closed session ritual verifier requires task session:start to run again. Default: 8."
|
|
616
616
|
},
|
|
617
617
|
"forgeOutageRetryMinutes": {
|
|
618
618
|
"type": ["integer", "null"],
|