@deftai/directive-content 0.55.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. package/.agents/skills/deft/SKILL.md +6 -0
  2. package/.agents/skills/deft-directive-article-review/SKILL.md +11 -0
  3. package/.agents/skills/deft-directive-build/SKILL.md +10 -0
  4. package/.agents/skills/deft-directive-cost/SKILL.md +12 -0
  5. package/.agents/skills/deft-directive-debug/SKILL.md +13 -0
  6. package/.agents/skills/deft-directive-gh-arch/SKILL.md +11 -0
  7. package/.agents/skills/deft-directive-gh-slice/SKILL.md +10 -0
  8. package/.agents/skills/deft-directive-glossary/SKILL.md +10 -0
  9. package/.agents/skills/deft-directive-interview/SKILL.md +9 -0
  10. package/.agents/skills/deft-directive-pre-pr/SKILL.md +9 -0
  11. package/.agents/skills/deft-directive-refinement/SKILL.md +10 -0
  12. package/.agents/skills/deft-directive-release/SKILL.md +12 -0
  13. package/.agents/skills/deft-directive-review-cycle/SKILL.md +10 -0
  14. package/.agents/skills/deft-directive-setup/SKILL.md +10 -0
  15. package/.agents/skills/deft-directive-swarm/SKILL.md +10 -0
  16. package/.agents/skills/deft-directive-sync/SKILL.md +9 -0
  17. package/.agents/skills/deft-directive-triage/SKILL.md +9 -0
  18. package/.agents/skills/deft-directive-write-skill/SKILL.md +9 -0
  19. package/LICENSE.md +22 -0
  20. package/QUICK-START.md +167 -0
  21. package/UPGRADING.md +517 -0
  22. package/coding/build-output.md +28 -0
  23. package/coding/coding.md +235 -0
  24. package/coding/debugging.md +110 -0
  25. package/coding/holzmann.md +96 -0
  26. package/coding/hygiene.md +127 -0
  27. package/coding/security.md +158 -0
  28. package/coding/testing.md +162 -0
  29. package/coding/toolchain.md +44 -0
  30. package/commands.md +300 -0
  31. package/context/context.md +57 -0
  32. package/context/deterministic-split.md +67 -0
  33. package/context/examples.md +26 -0
  34. package/context/fractal-summaries.md +69 -0
  35. package/context/long-horizon.md +46 -0
  36. package/context/spec-deltas.md +177 -0
  37. package/context/tool-design.md +34 -0
  38. package/context/working-memory.md +62 -0
  39. package/contracts/boundary-maps.md +65 -0
  40. package/contracts/deterministic-questions.md +59 -0
  41. package/contracts/hierarchy.md +77 -0
  42. package/conventions/content-manifest.json +399 -0
  43. package/conventions/machine-generated-banner.md +130 -0
  44. package/conventions/references.md +120 -0
  45. package/conventions/rule-ownership.json +382 -0
  46. package/conventions/task-caching.md +43 -0
  47. package/conventions/vbrief-filenames.md +70 -0
  48. package/deployments/README.md +37 -0
  49. package/deployments/agentuity/README.md +138 -0
  50. package/deployments/agentuity/via-cli.md +380 -0
  51. package/deployments/agentuity/via-cloud.md +425 -0
  52. package/deployments/agentuity/via-github-actions.md +664 -0
  53. package/deployments/agentuity/via-gravity-network.md +606 -0
  54. package/deployments/agentuity/via-vpc.md +607 -0
  55. package/deployments/aws/README.md +38 -0
  56. package/deployments/aws/via-app-runner.md +612 -0
  57. package/deployments/aws/via-ecs-fargate.md +561 -0
  58. package/deployments/aws/via-elastic-beanstalk.md +628 -0
  59. package/deployments/aws/via-lambda.md +649 -0
  60. package/deployments/azure/README.md +37 -0
  61. package/deployments/azure/via-aks.md +390 -0
  62. package/deployments/azure/via-app-service.md +564 -0
  63. package/deployments/azure/via-container-apps.md +599 -0
  64. package/deployments/azure/via-functions.md +552 -0
  65. package/deployments/cloud-gov/README.md +63 -0
  66. package/deployments/cloud-gov/agents/compliance-docs.md +154 -0
  67. package/deployments/cloud-gov/agents.md +39 -0
  68. package/deployments/cloud-gov/cicd.md +64 -0
  69. package/deployments/cloud-gov/deployment.md +150 -0
  70. package/deployments/cloud-gov/logging.md +43 -0
  71. package/deployments/cloud-gov/manifest.md +121 -0
  72. package/deployments/cloud-gov/overview.md +58 -0
  73. package/deployments/cloud-gov/security.md +46 -0
  74. package/deployments/cloud-gov/services.md +72 -0
  75. package/deployments/cloud-gov/upstream/README.md +18 -0
  76. package/deployments/cloudflare/README.md +33 -0
  77. package/deployments/cloudflare/via-dashboard.md +83 -0
  78. package/deployments/cloudflare/via-git.md +90 -0
  79. package/deployments/cloudflare/via-github-actions.md +185 -0
  80. package/deployments/cloudflare/via-terraform.md +157 -0
  81. package/deployments/cloudflare/via-wrangler.md +165 -0
  82. package/deployments/fly-io/README.md +37 -0
  83. package/deployments/fly-io/via-dockerfile.md +648 -0
  84. package/deployments/fly-io/via-flyctl.md +653 -0
  85. package/deployments/fly-io/via-github-actions.md +695 -0
  86. package/deployments/fly-io/via-multi-region.md +598 -0
  87. package/deployments/google/README.md +34 -0
  88. package/deployments/google/via-app-engine.md +42 -0
  89. package/deployments/google/via-cloud-functions.md +23 -0
  90. package/deployments/google/via-cloud-run.md +330 -0
  91. package/deployments/google/via-gke.md +23 -0
  92. package/deployments/netlify/README.md +99 -0
  93. package/deployments/netlify/via-cli.md +17 -0
  94. package/deployments/netlify/via-functions.md +19 -0
  95. package/deployments/netlify/via-git.md +25 -0
  96. package/deployments/vercel/README.md +90 -0
  97. package/deployments/vercel/via-api.md +16 -0
  98. package/deployments/vercel/via-cli.md +17 -0
  99. package/deployments/vercel/via-git.md +24 -0
  100. package/docs/BROWNFIELD.md +179 -0
  101. package/docs/getting-started.md +137 -0
  102. package/docs/good-agents-md.md +137 -0
  103. package/events/README.md +89 -0
  104. package/events/event-record.schema.json +26 -0
  105. package/events/registry.json +166 -0
  106. package/events/registry.schema.json +71 -0
  107. package/glossary.md +145 -0
  108. package/incidents/README.md +81 -0
  109. package/incidents/_template.md +38 -0
  110. package/interfaces/cli.md +104 -0
  111. package/interfaces/rest.md +212 -0
  112. package/interfaces/tui.md +242 -0
  113. package/interfaces/web.md +123 -0
  114. package/languages/6502-DASM.md +132 -0
  115. package/languages/c.md +235 -0
  116. package/languages/commands.md +23 -0
  117. package/languages/cpp.md +132 -0
  118. package/languages/csharp.md +259 -0
  119. package/languages/dart.md +183 -0
  120. package/languages/delphi.md +218 -0
  121. package/languages/elixir.md +208 -0
  122. package/languages/go.md +78 -0
  123. package/languages/java.md +278 -0
  124. package/languages/javascript.md +163 -0
  125. package/languages/julia.md +175 -0
  126. package/languages/kotlin.md +193 -0
  127. package/languages/markdown.md +168 -0
  128. package/languages/mermaid.md +146 -0
  129. package/languages/officejs.md +392 -0
  130. package/languages/python.md +209 -0
  131. package/languages/r.md +163 -0
  132. package/languages/rust.md +216 -0
  133. package/languages/sql.md +216 -0
  134. package/languages/swift.md +153 -0
  135. package/languages/typescript.md +132 -0
  136. package/languages/vba.md +279 -0
  137. package/languages/vhdl.md +180 -0
  138. package/languages/visual-basic.md +151 -0
  139. package/languages/zig.md +196 -0
  140. package/meta/SOUL.md +27 -0
  141. package/meta/code-field.md +44 -0
  142. package/meta/morals.md +40 -0
  143. package/meta/philosophy.md +39 -0
  144. package/meta/project.md +49 -0
  145. package/meta/ralph.md +223 -0
  146. package/meta/security.md +80 -0
  147. package/meta/versioning.md +326 -0
  148. package/package.json +22 -0
  149. package/packs/lessons/lessons-pack-0.1.json +553 -0
  150. package/packs/patterns/patterns-pack-0.1.json +57 -0
  151. package/packs/rules/rules-pack-0.1.json +4767 -0
  152. package/packs/skills/skills-pack-0.1.json +262 -0
  153. package/packs/strategies/strategies-pack-0.1.json +167 -0
  154. package/packs/swarm-spec/swarm-spec-pack-0.1.json +17 -0
  155. package/patterns/executor-layer-credentials.md +227 -0
  156. package/patterns/llm-app.md +156 -0
  157. package/patterns/multi-agent.md +278 -0
  158. package/patterns/prompt-assembly-layer-ordering.md +154 -0
  159. package/patterns/role-as-overlay.md +179 -0
  160. package/platforms/2600.md +137 -0
  161. package/platforms/unity.md +329 -0
  162. package/references/composer-skill-porting.md +152 -0
  163. package/references/cost-models.md +163 -0
  164. package/references/ip-risk.md +246 -0
  165. package/references/plain-english-ux.md +275 -0
  166. package/resilience/context-pruning.md +67 -0
  167. package/resilience/continue-here.md +62 -0
  168. package/scm/changelog.md +276 -0
  169. package/scm/git.md +139 -0
  170. package/scm/github.md +265 -0
  171. package/secrets/.gitkeep +0 -0
  172. package/skills/deft-build/SKILL.md +20 -0
  173. package/skills/deft-directive-article-review/SKILL.md +156 -0
  174. package/skills/deft-directive-build/SKILL.md +302 -0
  175. package/skills/deft-directive-cost/SKILL.md +201 -0
  176. package/skills/deft-directive-debug/SKILL.md +140 -0
  177. package/skills/deft-directive-decompose/SKILL.md +96 -0
  178. package/skills/deft-directive-gh-arch/SKILL.md +160 -0
  179. package/skills/deft-directive-gh-slice/SKILL.md +199 -0
  180. package/skills/deft-directive-glossary/SKILL.md +118 -0
  181. package/skills/deft-directive-interview/SKILL.md +528 -0
  182. package/skills/deft-directive-pre-pr/SKILL.md +131 -0
  183. package/skills/deft-directive-probe/SKILL.md +127 -0
  184. package/skills/deft-directive-refinement/SKILL.md +403 -0
  185. package/skills/deft-directive-release/SKILL.md +266 -0
  186. package/skills/deft-directive-review-cycle/SKILL.md +401 -0
  187. package/skills/deft-directive-setup/SKILL.md +717 -0
  188. package/skills/deft-directive-swarm/SKILL.md +989 -0
  189. package/skills/deft-directive-sync/SKILL.md +288 -0
  190. package/skills/deft-directive-triage/SKILL.md +137 -0
  191. package/skills/deft-directive-write-skill/SKILL.md +169 -0
  192. package/skills/deft-interview/SKILL.md +16 -0
  193. package/skills/deft-pre-pr/SKILL.md +16 -0
  194. package/skills/deft-review-cycle/SKILL.md +16 -0
  195. package/skills/deft-roadmap-refresh/SKILL.md +16 -0
  196. package/skills/deft-setup/SKILL.md +20 -0
  197. package/skills/deft-swarm/SKILL.md +16 -0
  198. package/skills/deft-sync/SKILL.md +16 -0
  199. package/strategies/README.md +83 -0
  200. package/strategies/artifact-guards.md +85 -0
  201. package/strategies/bdd.md +115 -0
  202. package/strategies/brownfield.md +7 -0
  203. package/strategies/discuss.md +129 -0
  204. package/strategies/emit-hints.md +69 -0
  205. package/strategies/enterprise.md +193 -0
  206. package/strategies/interview.md +551 -0
  207. package/strategies/map.md +179 -0
  208. package/strategies/probe.md +151 -0
  209. package/strategies/rapid.md +155 -0
  210. package/strategies/research.md +155 -0
  211. package/strategies/roadmap.md +9 -0
  212. package/strategies/speckit.md +437 -0
  213. package/strategies/v0-20-contract.md +134 -0
  214. package/strategies/yolo.md +169 -0
  215. package/swarm/swarm.md +300 -0
  216. package/templates/COST-ESTIMATE.md +114 -0
  217. package/templates/PULL_REQUEST_TEMPLATE.md +35 -0
  218. package/templates/agent-prompt-preamble.md +409 -0
  219. package/templates/agents-entry.md +211 -0
  220. package/templates/agents-entry.placeholders.md +75 -0
  221. package/templates/embed.go +20 -0
  222. package/templates/embed_test.go +36 -0
  223. package/templates/make-spec-example.md +9 -0
  224. package/templates/make-spec.md +246 -0
  225. package/templates/project.md.template +52 -0
  226. package/templates/specification.md +1 -0
  227. package/templates/swarm-greptile-poller-prompt.md +556 -0
  228. package/templates/user.md.template +31 -0
  229. package/tools/RWLDL.md +80 -0
  230. package/tools/greptile.md +141 -0
  231. package/tools/installer.md +23 -0
  232. package/tools/taskfile-migration.md +32 -0
  233. package/tools/taskfile.md +185 -0
  234. package/tools/telemetry.md +285 -0
  235. package/vbrief/schemas/cache-meta.schema.json +137 -0
  236. package/vbrief/schemas/candidates.schema.json +130 -0
  237. package/vbrief/schemas/codebase-map.schema.json +213 -0
  238. package/vbrief/schemas/lessons-pack.schema.json +134 -0
  239. package/vbrief/schemas/patterns-pack.schema.json +84 -0
  240. package/vbrief/schemas/rules-pack.schema.json +105 -0
  241. package/vbrief/schemas/skills-pack.schema.json +94 -0
  242. package/vbrief/schemas/slices.schema.json +87 -0
  243. package/vbrief/schemas/strategies-pack.schema.json +89 -0
  244. package/vbrief/schemas/swarm-spec-pack.schema.json +84 -0
  245. package/vbrief/schemas/vbrief-core.schema.json +1022 -0
  246. package/vbrief/vbrief.md +684 -0
  247. package/verification/integration.md +76 -0
  248. package/verification/plan-checking.md +85 -0
  249. package/verification/uat.md +60 -0
  250. package/verification/verification.md +117 -0
@@ -0,0 +1,717 @@
1
+ ---
2
+ name: deft-directive-setup
3
+ description: >-
4
+ Set up a new project with Deft Directive framework standards. Use when the
5
+ user wants to bootstrap user preferences, configure a project, or generate a
6
+ project specification. Walks through setup conversationally — no separate
7
+ CLI needed.
8
+ ---
9
+ <!-- AUTO-GENERATED by task packs:render -- DO NOT EDIT MANUALLY -->
10
+ <!-- Purpose: rendered skill -->
11
+ <!-- Source of truth: packs/skills/skills-pack-0.1.json -->
12
+ <!-- Regenerate with: task packs:render -->
13
+ <!-- Edit the source, not this file. Slice instead of loading every SKILL.md: task packs:slice skills by-trigger --trigger <kw> (or list) -->
14
+
15
+ # Deft Directive Setup
16
+
17
+ Agent-driven alternative to `.deft/core/run bootstrap && .deft/core/run project && .deft/core/run spec`.
18
+
19
+ Legend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.
20
+
21
+ ## When to Use
22
+
23
+ - User says "set up deft", "configure deft", or "bootstrap my project"
24
+ - User asks to create USER.md, PROJECT-DEFINITION.vbrief.json, or a specification
25
+ - User clones a deft-enabled repo for the first time with no config
26
+
27
+ ## Pre-Cutover Detection Guard
28
+
29
+ ! Before proceeding with any setup phase, detect whether the project uses the pre-v0.20 document model and redirect to migration if so.
30
+
31
+ ### Detection Criteria
32
+
33
+ A project is **pre-cutover** if ANY of the following are true. This prose mirrors the executable helper in `scripts/_precutover.py`; when in doubt, the helper is canonical.
34
+
35
+ 1. `SPECIFICATION.md` exists and is neither a deprecation redirect nor a current generated spec export. A current generated spec export contains `<!-- Purpose: rendered specification -->` and `<!-- Source of truth: vbrief/specification.vbrief.json -->`, and `vbrief/specification.vbrief.json` plus all five lifecycle folders exist.
36
+ 2. `PROJECT.md` exists and contains neither the legacy `<!-- deft:deprecated-redirect -->` sentinel NOR the current `Purpose: deprecation redirect` canonical-banner marker (same one-release-cycle grace window).
37
+ 3. `vbrief/specification.vbrief.json` exists but the lifecycle folders (`vbrief/proposed/`, `vbrief/pending/`, `vbrief/active/`, `vbrief/completed/`, `vbrief/cancelled/`) do NOT exist
38
+
39
+ ### Action on Detection
40
+
41
+ ! If pre-cutover state is detected, **stop immediately** and display an actionable message:
42
+
43
+ > "This project uses the pre-v0.20 document model. Run `task migrate:vbrief` to upgrade to the vBRIEF-centric model."
44
+
45
+ ! Include specific details about what was detected:
46
+
47
+ - Missing lifecycle folders: "Run `task migrate:vbrief` to create the lifecycle folder structure"
48
+ - `SPECIFICATION.md` with real content: "SPECIFICATION.md contains non-redirect content -- this file is deprecated; use scope vBRIEFs in `vbrief/` instead"
49
+ - `PROJECT.md` with real content: "PROJECT.md contains non-redirect content -- this file is deprecated; use `PROJECT-DEFINITION.vbrief.json` instead"
50
+ - Missing `PROJECT-DEFINITION.vbrief.json`: "Run `task project:render` to generate the project definition"
51
+
52
+ ### Environment Preflight (before asking to run migration)
53
+
54
+ ! Before asking the user "Would you like me to run `task migrate:vbrief` now?", run an environment preflight and report the results to the user. Do NOT ask the yes/no prompt until preflight results have been reported. Each failing check must be surfaced with a specific fix pointer so the user (or agent) can resolve the blocker before approving the run.
55
+
56
+ Run these four checks, in order:
57
+
58
+ 1. **Document-model confirmation** -- re-apply the Detection Criteria above (the executable source is `scripts/_precutover.py`). If `SPECIFICATION.md` is a current generated spec export from `vbrief/specification.vbrief.json` and all lifecycle folders exist, stop: migration is NOT needed and MUST NOT be run.
59
+ 2. **Task resolvability** -- check whether `task migrate:vbrief` is dispatchable from the project root:
60
+ - Run `task --list` (or platform-equivalent) and grep the output for a line containing `migrate:vbrief`.
61
+ - If present: the primary command works from the project root -- canonical invocation is `task migrate:vbrief`.
62
+ - If absent: the consumer `Taskfile.yml` does not include `deft/Taskfile.yml`. Fall back to the explicit-taskfile invocation `task -t ./deft/Taskfile.yml migrate:vbrief` and tell the user: "`task migrate:vbrief` is not resolvable from the project root. I will use the fallback invocation `task -t ./deft/Taskfile.yml migrate:vbrief`, which reads the task directly from the framework Taskfile. To make the primary command work in future, add an include for `deft/Taskfile.yml` to your project `Taskfile.yml` — see `deft/main.md` § Publishing deft tasks in your project root."
63
+ 3. **`uv` on PATH** -- the migrator runs `uv run python scripts/migrate_vbrief.py`. Check `uv --version` (or equivalent): if it fails, point the user at the uv install docs (`https://docs.astral.sh/uv/`) and stop; migration cannot run without `uv`.
64
+ 4. **Migration script present** -- check `deft/scripts/migrate_vbrief.py` exists on disk. If absent, the `deft/` checkout is incomplete or came from a pre-v0.20 framework version; point the user at `deft/QUICK-START.md` (framework refresh guidance) and stop.
65
+
66
+ ! Report each preflight check's result to the user (e.g. "✓ task migrate:vbrief resolvable", "✗ uv not on PATH — install from https://docs.astral.sh/uv/") BEFORE prompting for yes/no approval. If any check fails, do NOT offer to run migration until it is resolved.
67
+
68
+ ⊗ Skip preflight and immediately ask "Would you like me to run `task migrate:vbrief` now?" -- preflight catches preventable errors (unresolvable task, missing `uv`, missing script) before the user commits to running migration.
69
+ ⊗ Propose an install-step mutation that writes `migrate:vbrief` content into the consumer Taskfile. The supported publish mechanism is the `includes: deft: deft/Taskfile.yml` pattern documented in `deft/main.md` § Publishing deft tasks in your project root; inline Taskfile mutation is explicitly out of scope (per #506 D6).
70
+
71
+ ### Prompt and Run
72
+
73
+ ! After preflight results are reported (and all checks pass), ask the user: "Would you like me to run `task migrate:vbrief` now?"
74
+ - If yes: run the migration command (use the fallback invocation `task -t ./deft/Taskfile.yml migrate:vbrief` if the preflight resolvability check found the primary task unresolvable). Then re-run the pre-cutover detection guard to verify clean state before proceeding.
75
+ - If no: stop and let the user handle migration manually.
76
+
77
+ ⊗ Proceed with setup phases when pre-cutover artifacts are detected -- always redirect to migration first.
78
+ ⊗ Silently ignore pre-cutover artifacts -- the user must be informed with an actionable command to fix the state.
79
+ ⊗ Display the migration diagnostic without offering to run it -- always ask the user if they want the agent to handle it (after preflight has passed).
80
+
81
+ ### Greenfield Projects (No Migration Needed)
82
+
83
+ ! For new projects (no existing `SPECIFICATION.md`, `PROJECT.md`, or `vbrief/specification.vbrief.json`), the guard passes silently and setup proceeds normally.
84
+
85
+ ! Greenfield setup creates the full vBRIEF-centric structure from scratch:
86
+
87
+ 1. `./vbrief/` directory with all 5 lifecycle subdirectories: `proposed/`, `pending/`, `active/`, `completed/`, `cancelled/`
88
+ 2. `./vbrief/PROJECT-DEFINITION.vbrief.json` generated from Phase 2 interview results
89
+ 3. First scope vBRIEF created in `proposed/` or `pending/` depending on Phase 3 interview outcome
90
+
91
+ ~ This is already handled by Phase 2 Output Path (creates `./vbrief/` and lifecycle subfolders) and Phase 3 Output (creates scope vBRIEFs in lifecycle folders). The guard ensures migrating projects are redirected before reaching these phases.
92
+
93
+ ### Migration safety flags
94
+
95
+ `task migrate:vbrief` is destructive by default (it replaces `SPECIFICATION.md` and `PROJECT.md` with redirect stubs and rewrites `vbrief/`), but it carries four always-on / on-demand safety affordances so operators can preview, recover, and undo (#497, #506 D7). Agents offering to run migration MUST mention these and pick the right one for the operator's situation.
96
+
97
+ - ! **Automatic `.premigrate.*` backups (always-on, no flag)**: before any destructive write the migrator copies every pre-cutover input to its `.premigrate` sibling -- `SPECIFICATION.md` -> `SPECIFICATION.premigrate.md`, `PROJECT.md` -> `PROJECT.premigrate.md`, `ROADMAP.md` -> `ROADMAP.premigrate.md`, `PRD.md` -> `PRD.premigrate.md` (only if present), and `vbrief/specification.vbrief.json` -> `vbrief/specification.premigrate.vbrief.json`. Each backup emits a `BACKUP <src> -> <dst> (<N> bytes)` line in the migration output. These files are `.gitignore`d by default so they do not leak into commits; operators who want them versioned can remove the patterns.
98
+ - ! **`task migrate:vbrief -- --dry-run` (preview)**: prints the complete migration plan (every proposed backup, lifecycle folder, narrative ingestion, scope vBRIEF, and deprecation-redirect replacement) prefixed `DRYRUN` without writing any file. Exits 0 on success. Use this before running migration for the first time on an unfamiliar project.
99
+ - ! **Dirty-tree guard (always-on)**: if `git status --porcelain` is non-empty the migrator refuses to run and points the operator at `--force`. Keeps migration output separable from in-progress edits. Bypass with `task migrate:vbrief -- --force` only after confirming the operator has accepted the risk.
100
+ - ! **`task migrate:vbrief -- --rollback`**: restores every pre-cutover input from its `.premigrate.*` backup and removes the scope vBRIEFs and migration-report files a prior run created. Reads `vbrief/migration/safety-manifest.json` (written by the migrator). Refuses if any redirect stub has been edited since migration -- re-run with `--force` to overwrite those edits on purpose, or commit them before rolling back. Prompts for a yes/no confirmation unless `--force` is passed.
101
+
102
+ ! When a user declines an in-flight migration or reports an incorrect result, offer `task migrate:vbrief -- --rollback` before asking them to edit files by hand.
103
+
104
+ ⊗ Offer `task migrate:vbrief` without also telling the user about `--dry-run` when they sound hesitant -- previewing is free and catches reconciliation surprises that would otherwise land in a commit.
105
+ ⊗ Suggest `git reset --hard` or manual file deletion as a recovery path when `--rollback` would do the right thing more safely.
106
+
107
+ ## Deterministic Questions Contract
108
+
109
+ ! Every numbered-menu prompt rendered in this skill (Phase 1 depth question, Phase 2 project type / deployment / language / strategy / branching gates, Phase 3 onboarding question, end-of-phase transition prompts, post-interview confirmation gate) MUST follow [`../../contracts/deterministic-questions.md`](../../contracts/deterministic-questions.md): render the canonical numbered menu in chat unless the host UI visibly preserves numeric option labels and returns numeric selections or exact displayed option text. The final two numbered options MUST be `Discuss` and `Back`, in that order. The Discuss-pause semantic is documented verbatim there -- on `Discuss` selection the agent MUST halt the in-progress sequence immediately, prompt `What would you like to discuss?`, and resume only on an explicit user signal (re-asks original question, says `resume`/`continue`, or re-issues prior selection). Implicit resumption is forbidden. Fallback chat replies MUST map only to the displayed number or exact displayed option text; do not infer from alphabetic host affordances.
110
+
111
+ ## Platform Detection
112
+
113
+ ! Before resolving any config paths, detect the host OS from your environment context:
114
+
115
+ | Platform | USER.md default path |
116
+ |--------------------|-------------------------------------------------------------------|
117
+ | Windows | `%APPDATA%\deft\USER.md` (e.g. `C:\Users\{user}\AppData\Roaming\deft\USER.md`) |
118
+ | Unix (macOS/Linux) | `~/.config/deft/USER.md` |
119
+
120
+ - ! If `$DEFT_USER_PATH` is set, it takes precedence on any platform
121
+ - ! Create parent directories as needed when writing USER.md
122
+ - ~ `$DEFT_PROJECT_PATH` overrides the default project config path (`./vbrief/PROJECT-DEFINITION.vbrief.json`) if set
123
+
124
+ ## Agent Behavior
125
+
126
+ **Flow:**
127
+ - ! Start asking immediately — everything you need is in THIS file
128
+ - ⊗ Explore the codebase, read framework files, or gather context before asking
129
+ - ? Read `deft/main.md` or language files LATER when generating output
130
+
131
+ **Interaction:**
132
+ - ~ Use structured question tools only when their visible option labels preserve the canonical numbers (for example, `1. Yes`) and their return value is the numeric selection or exact displayed option text.
133
+ - ! Fall back to the numbered chat menu when the host UI may replace numbers with alphabetic affordances, unlabeled buttons, or any other non-canonical choice labels.
134
+ - ⊗ Infer deterministic answers from host-added letters or shortcuts unless those letters were actually displayed in the canonical menu labels.
135
+
136
+ **Defaults:**
137
+ - ! Communicate that deft ships with best-in-class standards for 20+ languages
138
+ - ! Frame setup as "tell me your overrides" — not "configure everything"
139
+ - ~ "Deft has solid opinions on how code should be written and tested — I just need a few things about you and your project."
140
+
141
+ **Adapt to Technical Level:**
142
+ - ! First question gauges whether user is technical or non-technical
143
+ - ! Technical user: ask about languages, strategy, coverage directly — they'll have opinions
144
+ - ! Non-technical user: skip jargon, use sensible defaults, ask about what they're building not how
145
+ - ⊗ Ask non-technical users about coverage thresholds, strategies, or framework choices
146
+
147
+ ## Available Languages
148
+
149
+ C, C++, C#, Dart, Delphi, Elixir, Go, Java, JavaScript, Julia, Kotlin,
150
+ Office.js (Excel JavaScript API), Python, R, Rust, SQL, Swift, TypeScript,
151
+ VBA (Excel macros), VHDL, Visual Basic (.NET), Zig, 6502-DASM
152
+
153
+ - ? Read `deft/languages/{name}.md` when generating output — not before asking
154
+
155
+ ## Available Strategies
156
+
157
+ ~ When presenting strategies to the user, always use this numbered list format (not a plain table).
158
+ ~ Always include the chaining note below the list.
159
+ ! Always show the FULL strategy list at every chaining gate — never remove a strategy because it was previously run.
160
+ ~ If a strategy has been run already, indicate it with a note e.g. `(run 1x)` but keep it selectable.
161
+
162
+ 1. **interview** ★ (recommended) — Structured interview with sizing gate: Light or Full path
163
+ 2. **yolo** — Auto-pilot interview — Johnbot picks all recommended options
164
+ 3. **map** — Analyze existing codebase conventions before adding features
165
+ 4. **discuss** — Front-load decisions and alignment before planning
166
+ 5. **probe** — Adversarially stress-test the plan; surface assumptions, edge cases, and risks before spec
167
+ 6. **research** — Investigate the domain before planning
168
+ 7. **speckit** — Five-phase spec-driven workflow for large/complex projects
169
+
170
+ > 💡 Strategies can be chained — after one completes, you'll be asked if you want to run another.
171
+
172
+ ---
173
+
174
+ ## Phase 1 — User Preferences (USER.md)
175
+
176
+ **Goal:** Personal preferences file with two sections:
177
+ - **Personal** — always wins over everything (name, custom rules)
178
+ - **Defaults** — fallback values that PROJECT-DEFINITION.vbrief.json can override (strategy, coverage)
179
+
180
+ - ~ Skip if USER.md exists at the platform-appropriate path (see Platform Detection) and user doesn't want to overwrite
181
+ - ⊗ Scan filesystem beyond checking that one path
182
+
183
+ ### USER.md Freshness Detection
184
+
185
+ ! When an existing USER.md is found (returning user), check its `deft_version` field before skipping Phase 1:
186
+
187
+ 1. ! If `deft_version` is **missing**: the USER.md predates versioning -- treat as stale
188
+ 2. ! If `deft_version` is present but **differs from the current framework version** (0.20.0): check whether any expected fields are missing from the USER.md
189
+ 3. ! If fields are missing: query the user for each missing field individually -- do NOT re-run the full Phase 1 interview
190
+ 4. ! After completing any field queries (even if none were needed), write the current `deft_version` (0.20.0) to USER.md
191
+ 5. ~ If `deft_version` matches the current version and all expected fields are present: no action needed (USER.md is fresh)
192
+
193
+ Expected USER.md fields: **Name**, **Custom Rules**, **Default Strategy**, and optionally **Coverage** and **Experimental Rules**.
194
+
195
+ ⊗ Re-run the full Phase 1 interview when only individual fields are missing from a stale USER.md -- query missing fields individually instead.
196
+
197
+ ### Interview Rules
198
+
199
+ ! This phase follows the deterministic interview loop defined in `skills/deft-directive-interview/SKILL.md`. The core rules (one question per turn, numbered options with stated default, explicit "other" escape, depth gate, default acceptance, confirmation gate, structured handoff) apply here. Key points repeated for emphasis:
200
+
201
+ ! **Each message you send MUST contain exactly ONE question.** This is the most
202
+ important rule in this file. After the user answers, send the NEXT question in
203
+ a new message. Repeat until all questions for their track are answered.
204
+
205
+ - ⊗ Include two or more questions in the same message under any circumstances
206
+ - ⊗ List upcoming questions — only show the current one
207
+ - ~ Provide numbered answer options with an "other" choice where appropriate
208
+ - ! Mark which option is RECOMMENDED when showing choices
209
+ - ~ Use structured question tools only when visible option labels preserve the canonical numbers and returns map to numeric selections or exact displayed option text.
210
+
211
+ ### Question Sequence
212
+
213
+ **Step 0 — Opening (all users):**
214
+ Ask: "How deep do you want to go?"
215
+ 1. I'm technical — ask me everything
216
+ 2. I have some opinions but keep it simple
217
+ 3. Just pick good defaults — I care about the product, not the tools
218
+
219
+ Wait for answer. Then follow the track below.
220
+
221
+ **Track 1 (technical) — 7 steps:**
222
+ - Step 1: Ask their name
223
+ - Step 2: Ask strategy preference (show Available Strategies numbered list from the Available Strategies section, with descriptions and recommended marker; fallback — projects can override)
224
+ - Step 3: Ask coverage threshold (default 85%; fallback — projects can override)
225
+ - Step 4: Ask for custom rules — if user has rules, collect them one per line (empty line to finish); if none, skip
226
+ - Step 5a: Present SOUL.md and ask whether to include it (default: yes):
227
+ > **SOUL.md** — Results-first agent persona (inspired by Winston Wolf). Enforces assess-before-acting,
228
+ > finish-what-you-start, right-tool-for-the-job, and play-the-long-game. Keeps the AI decisive and
229
+ > concise. Includes a named persona ('Vinston') — drop if you prefer to define your own agent personality.
230
+ > Include SOUL.md? (Y/n)
231
+ - Step 5b: Present morals.md and ask whether to include it (default: yes):
232
+ > **morals.md** — Epistemic honesty rules. No presenting speculation as fact, label unverified claims,
233
+ > self-correct when wrong. Foundational trust rules for any AI agent. Strongly recommended.
234
+ > Include morals.md? (Y/n)
235
+ - Step 5c: Present code-field.md and ask whether to include it (default: yes):
236
+ > **code-field.md** — Pre-code assumption protocol. Requires stating assumptions and naming failure modes
237
+ > before writing a single line. Fights the 'it compiles, ship it' instinct. Based on NeoVertex1 context-field.
238
+ > Include code-field.md? (Y/n)
239
+
240
+ **Track 2 (middle ground) — 2 steps:**
241
+ - Step 1: Ask their name
242
+ - Step 2: Ask for custom rules — if user has rules, collect them one per line (empty line to finish); if none, skip
243
+ - Set defaults without asking: strategy = "interview", coverage = 85%, all meta-guidelines included
244
+
245
+ **Track 3 (non-technical) — 2 steps:**
246
+ - Step 1: Ask their name
247
+ - Step 2: Ask what they're building (brief description — used for PROJECT-DEFINITION.vbrief.json later)
248
+ - Set defaults: strategy = "interview", coverage = 85%, all meta-guidelines included
249
+
250
+ ### Output Path
251
+
252
+ Resolve using Platform Detection above. Write to the platform-appropriate path
253
+ (or `$DEFT_USER_PATH` if set). Create parent directories as needed.
254
+
255
+ ### Template
256
+
257
+ ```markdown
258
+ # User Preferences
259
+
260
+ Legend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.
261
+
262
+ **deft_version**: 0.20.0
263
+
264
+ ## Personal (always wins)
265
+
266
+ Settings in this section have HIGHEST precedence — override all other deft rules,
267
+ including PROJECT-DEFINITION.vbrief.json.
268
+
269
+ **Name**: Address the user as: **{name}**
270
+
271
+ **Custom Rules**:
272
+ {custom rules or "No custom rules defined yet."}
273
+
274
+ ## Defaults (fallback)
275
+
276
+ Settings in this section are fallback defaults. PROJECT-DEFINITION.vbrief.json overrides these
277
+ for project-scoped settings (strategy, coverage).
278
+
279
+ **Default Strategy**: [{strategy name}](../strategies/{strategy-file}.md)
280
+
281
+ {If coverage != 85: "**Coverage**: ! ≥{N}% test coverage"}
282
+
283
+ {If any experimental rules selected:
284
+ "## Experimental Rules
285
+
286
+ {one line per selected rule, e.g.:
287
+ - ! Use meta/SOUL.md for strategic context and purpose-driven guidance
288
+ - ! Use meta/morals.md for ethical AI development principles
289
+ - ~ Use meta/code-field.md for advanced architecture patterns}"}
290
+
291
+ ---
292
+
293
+ **Note**: Edit this file anytime to update your preferences.
294
+ **See**: [../../main.md](../../../main.md) for framework defaults.
295
+ ```
296
+
297
+ ### Then
298
+
299
+ - ! Emit a structured-tool question asking whether to continue to Phase 2 (project configuration) only when the host preserves numeric labels; otherwise emit the deterministic numbered menu in chat. Options: `1. Yes (continue)`, `2. Not now (exit setup)`, `3. Discuss`, `4. Back (revisit previous phase)`. The numeric labels MUST remain visible and be returned as numeric selections or exact displayed option text.
300
+ - ⊗ Ask the phase-transition question as unnumbered conversational prose or through a structured UI that hides the canonical numeric labels -- it is a deterministic menu and MUST preserve visible numbers (#478, #1563).
301
+
302
+ ---
303
+
304
+ ## Phase 2 — Project Configuration (PROJECT-DEFINITION.vbrief.json)
305
+
306
+ **Goal:** Project-specific configuration — tech stack, type, quality standards — written as a vBRIEF file at `./vbrief/PROJECT-DEFINITION.vbrief.json`.
307
+
308
+ ! **Path Resolution Anchor**: Resolve ALL paths relative to the user's working directory (pwd) at skill entry -- never relative to the skill file location, AGENTS.md location, or any framework directory (e.g. `./deft/`). When deft is cloned as a subdirectory, the skill file lives inside the clone but all project artifacts (`./vbrief/PROJECT-DEFINITION.vbrief.json`, build files, etc.) must be resolved from the user's pwd.
309
+
310
+ - ~ Skip if `./vbrief/PROJECT-DEFINITION.vbrief.json` exists (or `$DEFT_PROJECT_PATH` if set) and user doesn't want to replace
311
+ - ⊗ Count `./deft/PROJECT-DEFINITION.vbrief.json` or `./deft/core/project.md` as the user's project config — those are framework-internal
312
+
313
+ ### Inference
314
+
315
+ - ! Before asking, infer from codebase — look for `package.json`, `go.mod`, `requirements.txt`, `Cargo.toml`, `pyproject.toml`, `*.csproj`
316
+ - ! Use inferences to pre-fill answers and confirm — don't ask blind
317
+ - ⊗ Look inside `./deft/` for build files (`go.mod`, `package.json`, `pyproject.toml`, `Cargo.toml`, `*.csproj`, etc.) — those are framework-internal. Only inspect files at the project root and its non-`deft` subdirectories.
318
+ - ⊗ Run git commands inside `./deft/` to determine project identity — that directory is the framework repo, not the user's project.
319
+ - ~ If no build files are found at the project root, default the project name to the current directory name and ask for confirmation.
320
+
321
+ ### Track Detection
322
+
323
+ ! If Phase 1 was skipped (USER.md already existed), the user's track is unknown.
324
+ Before asking any Phase 2 questions, ask the depth question:
325
+
326
+ > "How deep do you want to go?"
327
+ > 1. I'm technical — ask me everything
328
+ > 2. I have some opinions but keep it simple
329
+ > 3. Just pick good defaults — I care about the product, not the tools
330
+
331
+ Wait for answer. Then follow the corresponding track in the Question Sequence below.
332
+
333
+ ⊗ Assume Track 1 (technical) because USER.md exists or contains strategy/coverage fields.
334
+ ⊗ Infer the track from USER.md content — always ask.
335
+
336
+ ### Defaults in Agentic Mode
337
+
338
+ ! When a question has a USER.md default, phrase it as:
339
+ > "{Field}: **{value}** from USER.md — keep this, or enter a different value?"
340
+
341
+ ! Accept any affirmative response ("keep", "yes", "same", "default", ✓) as confirmation to use the default.
342
+ ⊗ Phrase defaults as "press Enter to keep" — there is no Enter in conversational mode.
343
+
344
+ ### Interview Rules (same as Phase 1)
345
+
346
+ ! **Each message MUST contain exactly ONE question.** The Phase 1 interview rules
347
+ apply here too. Do not combine questions. See `skills/deft-directive-interview/SKILL.md` for the canonical deterministic interview loop.
348
+
349
+ ### Question Sequence
350
+
351
+ **Track 1 (technical) — 8 steps:**
352
+ - Step 1: Ask project name (infer from build files or directory name, confirm)
353
+ - Step 2: Ask project type (CLI, TUI, Desktop App, REST API, Web App, Library, other)
354
+ - Step 3: Ask deployment platform:
355
+ 1. Cross-platform (Linux / macOS / Windows)
356
+ 2. Windows-native
357
+ 3. macOS-native
358
+ 4. Linux / Unix
359
+ 5. Embedded / low-resource
360
+ 6. Web / Cloud
361
+ 7. Mobile (iOS / Android)
362
+ 8. Other / not sure
363
+ - Step 4: Ask languages — show a filtered shortlist (3–4 recommendations) based on project type + platform. If codebase markers exist (`go.mod`, `pyproject.toml`, etc.), skip and confirm: "Detected {lang} — correct?"
364
+ - If user selects "Other": show remaining plausible languages for the type+platform context (Tier 2)
365
+ - If still not found: free text input (Tier 3)
366
+ - If entered language has no deft `languages/{lang}.md` standards file, warn: "deft doesn't have a standards file for {lang} yet — general defaults will be used. Continue?"
367
+ - Step 5: Ask tech stack (frameworks, libraries)
368
+ - Step 6: Ask strategy (default to USER.md Defaults; ask if this project needs different — show Available Strategies numbered list with descriptions and recommended marker)
369
+ - Step 7: Ask coverage (default to USER.md Defaults; ask if this project needs different)
370
+ - Step 8: Ask for project-specific rules (optional, same one-per-line format as Phase 1 custom rules)
371
+ - Step 9: Ask branching preference (typed `plan.policy.allowDirectCommitsToMaster` flag per #746):
372
+
373
+ ! Render this as a deterministic numbered menu. Default `1. Branch-based`. Final two options MUST be `Discuss` and `Back` per [`../../contracts/deterministic-questions.md`](../../contracts/deterministic-questions.md):
374
+
375
+ > "Do you prefer branch-based workflow (create a feature branch for every change) or
376
+ > trunk-based (commit directly to master)? Branch-based is the default and recommended
377
+ > for teams; trunk-based is common for solo projects."
378
+ > 1. Branch-based ★ (recommended -- default; enforces feature branches via the deft branch-protection policy)
379
+ > 2. Trunk-based (direct commits to master) -- see capability-cost disclosure below
380
+ > 3. Discuss
381
+ > 4. Back
382
+
383
+ ! **Capability-cost disclosure (#746):** When the user picks option 2 (trunk-based), the agent MUST present the capability-cost disclosure verbatim BEFORE writing the typed flag, then re-prompt for explicit confirmation:
384
+
385
+ > "Capability-cost disclosure -- enabling direct commits to the default branch turns OFF the deft branch-protection policy. The pre-commit + pre-push hooks will no longer block default-branch commits, `task verify:branch` will pass on the default branch, and the skill-level guards in deft-directive-{swarm,review-cycle,pre-pr,release} will not halt for default-branch work. The change is reversible (`task policy:enforce-branches`) and is recorded to meta/policy-changes.log for auditability. The CI sanity check (head_ref != base_ref) remains independent and will continue to flag master->master PRs. Are you sure?"
386
+ > 1. Yes, opt out -- write `plan.policy.allowDirectCommitsToMaster = true`
387
+ > 2. No, keep branch-protection enforced -- write `plan.policy.allowDirectCommitsToMaster = false`
388
+ > 3. Discuss
389
+ > 4. Back
390
+
391
+ ! Default to option 2 (enforce). Explicit affirmative on option 1 is required to opt out -- a broad `proceed` does NOT satisfy this gate. The same affirmative-only rule applies as in `/deft:change` (`yes`, `confirmed`, `approve`).
392
+
393
+ ! Write the answer to `plan.policy.allowDirectCommitsToMaster` (typed boolean) on the PROJECT-DEFINITION vBRIEF. Default `false` (enforce branches) when the user picks option 2 OR omits the question entirely. Writing this typed surface is what the framework reads going forward; agents MUST NOT write the legacy free-form `Allow direct commits to master:` narrative key (#746 part A migrates the legacy narrative away).
394
+
395
+ ! **Re-running the interview detects the existing flag (#746 part G2):** If `vbrief/PROJECT-DEFINITION.vbrief.json` already exists and has `plan.policy.allowDirectCommitsToMaster` set, the interview MUST surface the current value (e.g. "Current setting: `allowDirectCommitsToMaster=false` (branch-protection ON)") and ask whether to keep it or change it before re-prompting. Do not silently overwrite an existing typed value.
396
+
397
+ ! **Slash-command alternatives (#746 part G2):** Once the project is set up, the typed flag can also be flipped via slash commands wrapping `task policy:*`:
398
+ - `/deft:policy:show` -- display the current resolved policy and source
399
+ - `/deft:policy:enforce-branches` -- set `allowDirectCommitsToMaster=false`
400
+ - `/deft:policy:allow-direct-commits` -- set `allowDirectCommitsToMaster=true` (requires `--confirm` to apply)
401
+
402
+ Each transition is recorded to `meta/policy-changes.log` for auditability.
403
+
404
+ **Track 2 (middle ground) — 4 steps:**
405
+ - Step 1: Ask project name (infer from build files or directory name, confirm)
406
+ - Step 2: Ask project type (CLI, TUI, Desktop App, REST API, Web App, Library, other)
407
+ - Step 3: Ask languages (show detected, confirm or adjust; if none detected, infer from type and ask)
408
+ - Step 4: Ask strategy (default to USER.md Defaults; ask if this project needs different — show Available Strategies numbered list with descriptions and recommended marker)
409
+ - Default coverage to USER.md Defaults without asking
410
+
411
+ **Track 3 (non-technical) — 1 step:**
412
+ - Step 1: Present summary of inferences: "Based on your project: {name} ({type}), built with {stack}. Look right?"
413
+ - ⊗ Ask about strategy or coverage — use Phase 1 defaults
414
+
415
+ ### Output Path
416
+
417
+ `./vbrief/PROJECT-DEFINITION.vbrief.json` (or `$DEFT_PROJECT_PATH` if set). Create `./vbrief/` directory and lifecycle subfolders (`proposed/`, `pending/`, `active/`, `completed/`, `cancelled/`) if they don't exist.
418
+
419
+ ### GitHub PR Template Scaffolding (#531)
420
+
421
+ ! Before writing `PROJECT-DEFINITION.vbrief.json`, offer to scaffold a default GitHub PR template so downstream skills (`deft-directive-refinement` Pre-Flight, `deft-directive-pre-pr`) can satisfy their `.github/PULL_REQUEST_TEMPLATE.md` checks without blocking.
422
+
423
+ 1. ! Ask the user with a deterministic numbered menu: "Create a default GitHub PR template at `.github/PULL_REQUEST_TEMPLATE.md`?" Options: `1. Yes`, `2. No`, `3. Discuss`, `4. Back`. Use a structured question tool only if those numeric labels remain visible and are returned as numeric selections or exact displayed option text.
424
+ 2. ! If the user accepts AND `.github/PULL_REQUEST_TEMPLATE.md` does NOT already exist: copy `templates/PULL_REQUEST_TEMPLATE.md` (shipped with deft) to `./.github/PULL_REQUEST_TEMPLATE.md` in the consumer project. Create `.github/` if it does not exist.
425
+ 3. ! If the file already exists, do NOT overwrite it — report that it is present and continue.
426
+ 4. ~ If the user declines, note that `deft-directive-refinement` Pre-Flight will offer to scaffold later when needed.
427
+
428
+ ⊗ Overwrite an existing `.github/PULL_REQUEST_TEMPLATE.md` without explicit user approval.
429
+
430
+ ### Headless Coverage Warning — display-bound GUI entry points (#1027)
431
+
432
+ ! The trigger is a **display-bound GUI event loop** (pygame, tkinter, PyQt/PySide, Kivy, Electron) that cannot run without a real display — typically a **Desktop App** project type, or a TUI that embeds such a GUI. Terminal-UI frameworks (textual, urwid, blessed, ncurses) run in the terminal and DO support headless testing (e.g. textual's `App.run_async()` + `Pilot`), so a standard TUI is NOT in scope — do not omit its coverage. The concrete commands below assume a **Python** GUI stack (pygame/tkinter); the same "omit the un-runnable loop, test the logic" principle applies to non-Python desktop stacks (Electron/JS, .NET/WPF, Qt/C++) using that language's own headless-test and coverage-exclusion tooling. When the Phase 2 project type resolves to a display-bound GUI project, warn the user BEFORE writing `PROJECT-DEFINITION.vbrief.json` (adapt the wording to the project's language):
433
+
434
+ > "Heads up: pygame/tkinter event loops can't be tested headlessly, so the display-bound entry point (e.g. `src/ui.py`) reports near-zero coverage and drags the overall percentage below the 85% threshold. I recommend excluding the UI entry point from coverage measurement and keeping it thin — push testable logic (state, scoring, input handling) into separate modules."
435
+
436
+ ! When scaffolding or advising on `pyproject.toml` for a display-bound GUI project, add the display-bound entry point to `[tool.coverage.run] omit` so `task check` measures logic modules only:
437
+
438
+ ```toml
439
+ [tool.coverage.run]
440
+ omit = [
441
+ "*/tests/*",
442
+ "*/venv/*",
443
+ "*/.venv/*",
444
+ "src/ui.py", # display-bound pygame/tkinter event loop -- cannot run headlessly (#1027)
445
+ ]
446
+ ```
447
+
448
+ - ! Keep the omit narrow — exclude only the event-loop shell, never a module that also holds business logic. If logic and the loop are mixed, recommend refactoring the logic into a separate, fully-tested module first.
449
+ - ~ For a Python project, point the user at `languages/python.md` (the `Headless GUI / event-loop testing` section under Patterns) for the headless-test pattern (`SDL_VIDEODRIVER=dummy`) and the full coverage-omit rationale; for a non-Python GUI stack, apply the same principle with that language's headless-test and coverage-exclusion tooling.
450
+ - ⊗ Apply the omit to a headless-capable terminal-UI project (textual/urwid/blessed/ncurses) — those frameworks test headlessly, so omitting them hides measurable coverage, the opposite of the intended effect.
451
+ - ⊗ Silently accept the default 85% coverage gate for a display-bound GUI project without surfacing the headless blind spot — the agent reports an inflated per-session coverage that collapses when the full `src/` is measured (the 2026-05-10 tic-tac-toe desktop-UI swarm recurrence).
452
+
453
+ ### Template
454
+
455
+ ! The output MUST conform to the canonical vBRIEF v0.6 schema (`vbrief/schemas/vbrief-core.schema.json`, strict `const: "0.6"`). See [`../../conventions/references.md`](../../conventions/references.md).
456
+
457
+ ```json
458
+ {
459
+ "vBRIEFInfo": {
460
+ "version": "0.6",
461
+ "author": "agent:deft-directive-setup",
462
+ "description": "Project identity gestalt",
463
+ "created": "{ISO-8601 timestamp}"
464
+ },
465
+ "plan": {
466
+ "title": "{Project Name}",
467
+ "status": "running",
468
+ "narratives": {
469
+ "Overview": "{Brief project description}",
470
+ "TechStack": "{project type} using {languages} — {tech stack details}",
471
+ "Strategy": "Use {strategy name} for this project",
472
+ "Quality": "Run task check before every commit. Achieve >= {coverage}% coverage overall + per-module. Store secrets in secrets/ dir.",
473
+ "ProjectRules": "{Any rules the user specified, or 'No project-specific rules defined.'}",
474
+ "Branching": "{If trunk-based: 'Allow direct commits to master: true', else omit or 'Branch-based workflow (default)'}",
475
+ "DeftVersion": "0.20.0"
476
+ },
477
+ "items": []
478
+ }
479
+ }
480
+ ```
481
+
482
+ - ! All `narratives` values MUST be plain strings — never objects or arrays
483
+ - ! `items` starts empty — populated as scope vBRIEFs are created in lifecycle folders
484
+
485
+ ### Then
486
+
487
+ - ! Emit a structured-tool question asking whether to continue to Phase 3 (specification) only when the host preserves numeric labels; otherwise emit the deterministic numbered menu in chat. Options: `1. Yes (continue)`, `2. Not now (exit setup)`, `3. Discuss`, `4. Back (revisit previous phase)`. The numeric labels MUST remain visible and be returned as numeric selections or exact displayed option text.
488
+ - ⊗ Ask the phase-transition question as unnumbered conversational prose or through a structured UI that hides the canonical numeric labels -- it is a deterministic menu and MUST preserve visible numbers (#478, #1563).
489
+
490
+ ### Follow-up: triage onboarding (#1143)
491
+
492
+ - ~ After Phase 2 writes `PROJECT-DEFINITION.vbrief.json`, recommend `task triage:welcome` to the user as the single chained command for picking up the v0.27 triage surface. The N3 ritual (#1143) is the consolidating onboarding step for the #1119 governance swarm verbs (`task triage:bootstrap` / `task triage:scope` / `plan.policy.wipCap` writes / `task scope:demote --batch` relief / `task triage:summary`); without it consumers must learn each verb individually from the v0.27 release notes.
493
+ - ~ `task triage:welcome` is idempotent and detection-bound -- each phase emits an informational stderr line and skips when its precondition is already satisfied, so a re-run after a partial completion resumes cleanly. The destructive phases (subscription / `wipCap` writes, optional WIP-relief invocation) are gated by numbered-menu prompts per [`../../contracts/deterministic-questions.md`](../../contracts/deterministic-questions.md). See [`../../UPGRADING.md`](../../UPGRADING.md) `## From v0.26.x -> v0.27` for the full walkthrough.
494
+ - ? The recommendation is informational, not a hard gate -- consumers who plan to wire triage manually MAY skip the ritual and call the individual verbs in any order; the framework defaults stay fail-open per the umbrella `#1119 §12 framework-vs-consumer-config boundary`.
495
+
496
+ ---
497
+
498
+ ## Phase 3 — Specification
499
+
500
+ **Goal:** Generate an implementable spec using the strategy chosen in Phase 2, producing a `specification.vbrief.json` draft for human approval before downstream generation.
501
+
502
+ ! **Path Resolution Anchor**: Same rule as Phase 2 -- resolve ALL paths relative to the user's pwd at skill entry, never relative to the skill file, AGENTS.md, or any framework directory.
503
+
504
+ - ~ Skip if user already has scope vBRIEFs in `./vbrief/` they're happy with
505
+ - ! Check `./vbrief/specification.vbrief.json` or `./vbrief/proposed/` for existing scope vBRIEFs
506
+ - ⊗ Count ANY file inside `./deft/` as the project's spec — those are framework-internal
507
+ (e.g. `deft/PROJECT.md`, `deft/specs/`, `deft/templates/`, `deft/core/project.md`
508
+ are all part of the framework, NOT the user's project)
509
+
510
+ ### Onboarding Question
511
+
512
+ ! Before proceeding with the strategy gate, ask the onboarding question:
513
+
514
+ > "Are you adding a scope to this project or starting a new specification?"
515
+ > 1. Adding scope to existing project [default if `./vbrief/specification.vbrief.json` exists or scope vBRIEFs found in lifecycle folders]
516
+ > 2. Starting a new project specification [default if no specification or scope vBRIEFs exist]
517
+
518
+ - ! Default based on repo state: if specification.vbrief.json exists or any lifecycle folder has scope vBRIEFs, default to "Adding scope"; otherwise default to "Starting new"
519
+ - ! If adding scope: skip the full interview, create a new scope vBRIEF in `./vbrief/proposed/` with the user's description, then exit
520
+ - ! If starting new: proceed to the Strategy Gate below
521
+
522
+ ### ⚠️ MANDATORY: Strategy Gate — Do This First
523
+
524
+ ! **STOP.** You MUST determine the correct strategy before doing anything else.
525
+
526
+ 1. ! Open `./vbrief/PROJECT-DEFINITION.vbrief.json` (the file written in Phase 2)
527
+ 2. ! Find the `narratives.Strategy` value
528
+ 3. ! Extract the strategy name from the narrative
529
+
530
+ **Dispatch:**
531
+
532
+ - **interview** (or default) → Continue to the Sizing Gate below ✅
533
+ - **anything else** (discuss, yolo, speckit, research, brownfield, map, etc.) →
534
+ 1. ! Read `deft/strategies/{strategy-name}.md` **right now, in this same turn**
535
+ 2. ! Begin the strategy's workflow immediately — ask its first question
536
+ 3. ! **STOP reading this section** — do NOT use the interview process below
537
+
538
+ - ⊗ Default to interview without reading PROJECT-DEFINITION.vbrief.json
539
+ - ⊗ Continue reading below when PROJECT-DEFINITION.vbrief.json specifies a non-interview strategy
540
+ - ⊗ Assume interview because the sections below describe the interview process
541
+ - ⊗ Fabricate justification for using interview when the user chose a different strategy
542
+ - ⊗ Announce the strategy choice and then stop — you must immediately read the file and start
543
+
544
+ ---
545
+
546
+ *⬇️ Everything below applies ONLY to the interview strategy. If your strategy is anything else, STOP — follow your strategy file instead.*
547
+
548
+ ### Sizing Gate (interview and yolo strategies only)
549
+
550
+ ! After hearing what the user wants to build and their feature list, determine
551
+ project complexity per [strategies/interview.md](../../strategies/interview.md#sizing-gate).
552
+
553
+ - ! Check `PROJECT-DEFINITION.vbrief.json` narratives for `Light` or `Full` — if declared, use that path
554
+ - ! If not declared, propose a size and **ask the user to confirm in a dedicated message**
555
+ - ! **Wait for the user's response** before asking any interview questions
556
+ - ⊗ Combine the sizing proposal with the first interview question
557
+ - ⊗ Proceed to interview questions before the user has confirmed the path
558
+
559
+ **Light** (small/medium): Interview → `specification.vbrief.json` with slim narratives (Overview + Architecture) → scope vBRIEFs in `vbrief/proposed/`.
560
+ **Full** (large/complex): Interview → rich narratives in `specification.vbrief.json` (user approval) → scope vBRIEFs with traceability.
561
+
562
+ ### Interview Process (interview strategy)
563
+
564
+ Per [strategies/interview.md](../../strategies/interview.md#interview-rules-shared-by-both-paths):
565
+
566
+ - ! Ask what to build and features first
567
+ - ! Ask **ONE** focused, non-trivial question per step
568
+ - ~ Provide numbered options with an "other" choice
569
+ - ! Mark which option is RECOMMENDED
570
+ - ⊗ Ask multiple questions at once
571
+ - ⊗ Make assumptions without clarifying
572
+ - ~ Use structured question tools for interview questions only when they preserve visible numeric option labels and return numeric selections or exact displayed option text; otherwise render the numbered menu in chat.
573
+
574
+ **Question Areas:**
575
+ - ! Missing decisions (language, framework, deployment)
576
+ - ! Edge cases (errors, boundaries, failure modes)
577
+ - ! Implementation details (architecture, patterns, libraries)
578
+ - ! Requirements (performance, security, scalability)
579
+ - ! UX/constraints (users, timeline, compatibility)
580
+ - ! Tradeoffs (simplicity vs features, speed vs safety)
581
+
582
+ **Non-Technical Users:**
583
+ - ~ Adjust vocabulary: "How do you want to store data?" not "What database engine?"
584
+ - ~ "Will other apps talk to this?" not "REST or GraphQL?"
585
+
586
+ **Completion:**
587
+ - ! Continue until little ambiguity remains
588
+ - ! Spec must be comprehensive enough to implement
589
+
590
+ ### Output — Light Path
591
+
592
+ 1. ! Write `./vbrief/specification.vbrief.json` with `"vBRIEFInfo": { "version": "0.6" }`, `status: draft`, and slim narratives:
593
+ - `Overview`: Brief project summary
594
+ - `Architecture`: System design description
595
+ 2. ! Create scope vBRIEFs in `./vbrief/proposed/` for each identified work item
596
+ - Each scope vBRIEF follows the `YYYY-MM-DD-descriptive-slug.vbrief.json` filename convention (slug rules in [`../../conventions/vbrief-filenames.md`](../../conventions/vbrief-filenames.md))
597
+ - Each MUST use `"vBRIEFInfo": { "version": "0.6" }`
598
+ - Each MUST include embedded Requirements (FR-N, NFR-N) in its `narrative`
599
+ - Each task SHOULD reference which FR/NFR it implements via `narrative.Traces`
600
+ - When the scope originates from a GitHub issue, include a `references` entry in the canonical form (see [`../../conventions/references.md`](../../conventions/references.md)):
601
+ ```json
602
+ "references": [
603
+ {
604
+ "uri": "https://github.com/{owner}/{repo}/issues/{N}",
605
+ "type": "x-vbrief/github-issue",
606
+ "title": "Issue #{N}: {issue title}"
607
+ }
608
+ ]
609
+ ```
610
+ 3. ! Summarize decisions, ask user to review the vBRIEF narratives
611
+ 4. ! On approval, update `specification.vbrief.json` status to `approved`
612
+ - ⊗ Create a separate PRD.md on the Light path
613
+ - ⊗ Generate an authoritative PRD.md — if needed, users run `task prd:render`
614
+
615
+ ! The vBRIEF files MUST conform to `vbrief/schemas/vbrief-core.schema.json` (v0.6):
616
+
617
+ - ! All `narratives` and `narrative` values MUST be plain strings — never objects or arrays
618
+ - ! Nested children within a PlanItem use `items` (v0.6 preferred field); `subItems` is the deprecated legacy alias kept for backward compatibility only
619
+ - ⊗ Mix `items` and `subItems` on the same PlanItem — pick one (prefer `items`)
620
+
621
+ ### Output — Full Path
622
+
623
+ 1. ! Write rich narratives to `./vbrief/specification.vbrief.json` with `"vBRIEFInfo": { "version": "0.6" }`, `plan.status: draft`, and these narrative keys:
624
+ - `ProblemStatement`: What problem this project solves
625
+ - `Goals`: High-level project goals
626
+ - `UserStories`: User stories in standard format
627
+ - `Requirements`: Structured requirements (FR-N: ..., NFR-N: ...)
628
+ - `SuccessMetrics`: Measurable success criteria
629
+ - `Architecture`: System design and technical architecture
630
+ - `Overview`: Brief project summary
631
+ 2. ! **Human approval gate**: Present the vBRIEF draft narratives to the user for review — reviewing the `specification.vbrief.json` narratives IS the approval step (replaces the former PRD.md review). The user may request changes before approving.
632
+ 3. ! On approval, update `status` to `approved` and proceed to downstream generation
633
+ 4. ! Create scope vBRIEFs in `./vbrief/proposed/` with traceability to requirement IDs from the narratives
634
+ - ! Scope vBRIEFs MUST trace tasks back to requirement IDs (FR-1, NFR-1) from the `Requirements` narrative
635
+ - ⊗ Generate an authoritative PRD.md — if needed, users run `task prd:render`
636
+
637
+ **Spec Structure (both paths):**
638
+ - ! Overview, Architecture
639
+ - ! Implementation Plan: scope vBRIEFs in `vbrief/proposed/` with phases and dependencies
640
+ - ! Explicit dependency mapping between scopes (via vBRIEF `edges` or `references`)
641
+ - ~ Scopes designed for parallel work by multiple agents
642
+ - ! Testing Strategy and Deployment captured in narratives
643
+ - ⊗ Write code — specification only
644
+
645
+ ### Lifecycle Bridge to Downstream Skills (#1025)
646
+
647
+ ! Scope vBRIEFs created by Phase 3 (both Light and Full paths) AND by the Onboarding Question "Adding scope to existing project" branch land in `vbrief/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 vbrief:preflight`) and the deft-directive-swarm Phase 0 Step 1 preflight BOTH require candidate vBRIEFs to live in `vbrief/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.
648
+
649
+ ! Surface this bridge to the user in the Phase 3 → next-skill handoff so they are not surprised by a wholesale preflight rejection downstream:
650
+
651
+ - **If the next step is `skills/deft-directive-swarm/SKILL.md`**: the swarm skill's Phase 0 Step 0.5 (Lifecycle Bridge -- Promote and Activate Proposed Scope vBRIEFs) is the canonical bridge. The monitor will scan `vbrief/proposed/` and `vbrief/pending/`, present in-scope candidates, and run `task scope:promote -- <path>` then `task scope:activate -- <path>` on explicit user approval. No manual operator action is required ahead of the swarm invocation.
652
+ - **If the next step is `skills/deft-directive-refinement/SKILL.md`**: the refinement skill's Phase 4 (Promote/Demote) owns the same `task scope:promote` / `task scope:activate` surface and runs the bridge as part of the refinement loop. The refinement skill MAY leave vBRIEFs in `pending/` deliberately when they are queued for prioritisation rather than immediate dispatch.
653
+ - **If the user wants to invoke an implementation agent directly via `skills/deft-directive-build/SKILL.md` or `start_agent`**: the bridge MUST be run manually before dispatch -- `task scope:promote -- vbrief/proposed/<file>` then `task scope:activate -- vbrief/pending/<file>`. Both commands are idempotent and exit 0 on no-op (see `scripts/scope_lifecycle.py`). The #810 preflight gate (`task vbrief:preflight -- <active-path>`) will exit 0 only after the activate step.
654
+
655
+ ⊗ Auto-run `task scope:promote` or `task scope:activate` from the setup skill on the Phase 3 outputs. The lifecycle commitment belongs to the user ("I am ready to swarm/build on this scope"), not the setup interview; silent promotion would clear the #810 implementation-intent gate without explicit user authorisation and bypass the deterministic-questions contract that protects every other Phase 3 transition.
656
+
657
+ ⊗ Drop the user at the end of Phase 3 with scope vBRIEFs in `vbrief/proposed/` and no forward pointer to the bridge. Without this section the user discovers the gap at runtime when the swarm Phase 0 Step 1 preflight rejects every candidate (`Invalid transition: 'activate' requires file in pending/`), as in the originating 2026-05-10 first-session consumer tic-tac-toe swarm (issue #1025).
658
+
659
+ ### End-of-Phase-3 Export Prompt and Render Gate
660
+
661
+ ! After the human approval gate on `specification.vbrief.json` narratives but BEFORE handing off to `deft-directive-build` (or advancing speckit Phase 3 → Phase 4), ask the user whether to generate human-readable exports. This replaces the invisible skip-if-absent behavior of `task check` (#398) and closes the greenfield gap (#433). This is also the Phase 3 → Phase 4 transition gate required by [strategies/speckit.md Post-Phase 3 Transition Gate](../../strategies/speckit.md#post-phase-3-transition-gate-render-for-review) (#432).
662
+
663
+ 1. ! Prompt: "Your `specification.vbrief.json` is approved. Generate `SPECIFICATION.md` and/or `PRD.md` now? (recommended for stakeholder review)"
664
+ 1. Yes — render both
665
+ 2. `SPECIFICATION.md` only
666
+ 3. `PRD.md` only
667
+ 4. Skip — I’ll render later with `task spec:render` / `task prd:render`
668
+ 2. ! Run the selected render command(s):
669
+ - `task spec:render` → writes `SPECIFICATION.md`
670
+ - `task prd:render` → writes `PRD.md`
671
+ 3. ! If the user picked a speckit-strategy project: `task spec:render` is **mandatory** at this boundary — invoke it even if the user declined the prompt, because speckit Phase 3 → Phase 4 is gated on `SPECIFICATION.md` existing and matching the current vBRIEF hash.
672
+ 4. ! Confirm to the user which files were written and remind them that direct edits to `SPECIFICATION.md` / `PRD.md` are overwritten on the next render — edit `specification.vbrief.json` instead.
673
+ 5. ~ If the user skipped rendering and is NOT on a speckit strategy, no-op and continue.
674
+
675
+ ⊗ Advance a speckit project to Phase 4 without running `task spec:render` at this gate — `SPECIFICATION.md` is required for the Phase 3 transition criterion.
676
+ ⊗ Silently skip the prompt — greenfield users who never open a PR will miss the exports without it.
677
+
678
+ ### Handoff to deft-directive-build
679
+
680
+ - ! Emit a structured-tool question asking whether to continue to the build phase only when the host preserves numeric labels; otherwise emit the deterministic numbered menu in chat. Options: `1. Yes (continue)`, `2. Not now (exit setup)`, `3. Discuss`, `4. Back (revisit previous phase)`. The numeric labels MUST remain visible and be returned as numeric selections or exact displayed option text.
681
+ - ~ If platform supports skill invocation and the user picks Yes, invoke `skills/deft-directive-build/SKILL.md`
682
+ - ⊗ Leave user with a dead end -- always offer the next step via the structured-tool phase-transition question
683
+ - ⊗ Ask the handoff-to-build question as unnumbered conversational prose or through a structured UI that hides the canonical numeric labels -- it is a deterministic menu and MUST preserve visible numbers (#478, #1563).
684
+
685
+ ## Warp Auto-Approve Warning
686
+
687
+ ! **Recommended Warp setting**: Before running deft-directive-setup, ensure Warp's AI autonomy is set to **"Always ask"** in **AI -> Profile Settings**. When set to a higher autonomy level (e.g. "Auto-run"), Warp may silently self-answer interview questions without user input, producing garbage USER.md/PROJECT-DEFINITION.vbrief.json with no error or warning. The post-interview confirmation gate (below) is the last line of defense, but prevention is better than detection.
688
+
689
+ ## Post-Interview Confirmation Gate
690
+
691
+ ! After completing ALL interview questions for any phase (Phase 1, Phase 2, or Phase 3), but BEFORE writing any files:
692
+
693
+ 1. ! Display a **summary of all captured values** in a clearly formatted list -- include every field that will be written to the output file (e.g. name, strategy, coverage, languages, project type, custom rules, etc.)
694
+ 2. ! Ask the user for explicit confirmation: "These are the values I captured. Write files? (yes/no)"
695
+ 3. ! Accept only explicit affirmative responses (`yes`, `confirmed`, `approve`) -- reject vague responses (`proceed`, `do it`, `go ahead`) the same way `/deft:change` does
696
+ 4. ! If the user says `no`: re-display the values and ask which ones to correct, then re-confirm before writing
697
+ 5. ! If any value appears to be auto-generated filler (e.g. repeated default text, placeholder strings, or values that echo the question prompt), warn the user explicitly: "Some values look like they may have been auto-filled rather than provided by you. Please review carefully."
698
+
699
+ ⊗ Write USER.md, PROJECT-DEFINITION.vbrief.json, specification.vbrief.json, or any other deft-directive-setup artifact without first displaying captured values and receiving explicit user confirmation.
700
+ ⊗ Treat a broad "proceed" or "continue" as confirmation to write files -- the user must explicitly confirm the displayed values.
701
+
702
+ ? **Yolo strategy carve-out**: When the user's chosen strategy is `yolo` (auto-pilot), the confirmation gate still applies but the agent (Johnbot) may self-confirm on the user's behalf by displaying the summary and immediately proceeding -- the user has already opted into auto-pilot by selecting yolo. The summary must still be displayed so the user can interrupt if values look wrong.
703
+
704
+ ## Anti-Patterns
705
+
706
+ - ! When deft-directive-setup generates or updates USER.md or PROJECT-DEFINITION.vbrief.json, the `deft_version` field MUST be set to the current framework version
707
+ - ⊗ Generate a USER.md or PROJECT-DEFINITION.vbrief.json without including the `deft_version` field
708
+ - ⊗ Explore codebase before Phase 1 questions
709
+ - ⊗ Read framework files before first question
710
+ - ⊗ Batch multiple questions into one message — ask one at a time, interview style
711
+ - ⊗ Ask jargon-heavy questions to non-technical users
712
+ - ⊗ Ask about things inferable from codebase (Phase 2+)
713
+ - ⊗ Skip phases without asking
714
+ - ⊗ Generate files without confirming content
715
+ - ⊗ Present choices through a host UI that replaces the canonical numbers with alphabetic affordances or unlabeled buttons
716
+ - ⊗ Resolve paths relative to the skill file, AGENTS.md, or framework directory instead of the user's pwd at skill entry
717
+ - ⊗ Generate an authoritative PRD.md — PRD.md is a read-only export via `task prd:render`, never a source of truth