@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.
- package/.agents/skills/deft/SKILL.md +6 -0
- package/.agents/skills/deft-directive-article-review/SKILL.md +11 -0
- package/.agents/skills/deft-directive-build/SKILL.md +10 -0
- package/.agents/skills/deft-directive-cost/SKILL.md +12 -0
- package/.agents/skills/deft-directive-debug/SKILL.md +13 -0
- package/.agents/skills/deft-directive-gh-arch/SKILL.md +11 -0
- package/.agents/skills/deft-directive-gh-slice/SKILL.md +10 -0
- package/.agents/skills/deft-directive-glossary/SKILL.md +10 -0
- package/.agents/skills/deft-directive-interview/SKILL.md +9 -0
- package/.agents/skills/deft-directive-pre-pr/SKILL.md +9 -0
- package/.agents/skills/deft-directive-refinement/SKILL.md +10 -0
- package/.agents/skills/deft-directive-release/SKILL.md +12 -0
- package/.agents/skills/deft-directive-review-cycle/SKILL.md +10 -0
- package/.agents/skills/deft-directive-setup/SKILL.md +10 -0
- package/.agents/skills/deft-directive-swarm/SKILL.md +10 -0
- package/.agents/skills/deft-directive-sync/SKILL.md +9 -0
- package/.agents/skills/deft-directive-triage/SKILL.md +9 -0
- package/.agents/skills/deft-directive-write-skill/SKILL.md +9 -0
- package/LICENSE.md +22 -0
- package/QUICK-START.md +167 -0
- package/UPGRADING.md +517 -0
- package/coding/build-output.md +28 -0
- package/coding/coding.md +235 -0
- package/coding/debugging.md +110 -0
- package/coding/holzmann.md +96 -0
- package/coding/hygiene.md +127 -0
- package/coding/security.md +158 -0
- package/coding/testing.md +162 -0
- package/coding/toolchain.md +44 -0
- package/commands.md +300 -0
- package/context/context.md +57 -0
- package/context/deterministic-split.md +67 -0
- package/context/examples.md +26 -0
- package/context/fractal-summaries.md +69 -0
- package/context/long-horizon.md +46 -0
- package/context/spec-deltas.md +177 -0
- package/context/tool-design.md +34 -0
- package/context/working-memory.md +62 -0
- package/contracts/boundary-maps.md +65 -0
- package/contracts/deterministic-questions.md +59 -0
- package/contracts/hierarchy.md +77 -0
- package/conventions/content-manifest.json +399 -0
- package/conventions/machine-generated-banner.md +130 -0
- package/conventions/references.md +120 -0
- package/conventions/rule-ownership.json +382 -0
- package/conventions/task-caching.md +43 -0
- package/conventions/vbrief-filenames.md +70 -0
- package/deployments/README.md +37 -0
- package/deployments/agentuity/README.md +138 -0
- package/deployments/agentuity/via-cli.md +380 -0
- package/deployments/agentuity/via-cloud.md +425 -0
- package/deployments/agentuity/via-github-actions.md +664 -0
- package/deployments/agentuity/via-gravity-network.md +606 -0
- package/deployments/agentuity/via-vpc.md +607 -0
- package/deployments/aws/README.md +38 -0
- package/deployments/aws/via-app-runner.md +612 -0
- package/deployments/aws/via-ecs-fargate.md +561 -0
- package/deployments/aws/via-elastic-beanstalk.md +628 -0
- package/deployments/aws/via-lambda.md +649 -0
- package/deployments/azure/README.md +37 -0
- package/deployments/azure/via-aks.md +390 -0
- package/deployments/azure/via-app-service.md +564 -0
- package/deployments/azure/via-container-apps.md +599 -0
- package/deployments/azure/via-functions.md +552 -0
- package/deployments/cloud-gov/README.md +63 -0
- package/deployments/cloud-gov/agents/compliance-docs.md +154 -0
- package/deployments/cloud-gov/agents.md +39 -0
- package/deployments/cloud-gov/cicd.md +64 -0
- package/deployments/cloud-gov/deployment.md +150 -0
- package/deployments/cloud-gov/logging.md +43 -0
- package/deployments/cloud-gov/manifest.md +121 -0
- package/deployments/cloud-gov/overview.md +58 -0
- package/deployments/cloud-gov/security.md +46 -0
- package/deployments/cloud-gov/services.md +72 -0
- package/deployments/cloud-gov/upstream/README.md +18 -0
- package/deployments/cloudflare/README.md +33 -0
- package/deployments/cloudflare/via-dashboard.md +83 -0
- package/deployments/cloudflare/via-git.md +90 -0
- package/deployments/cloudflare/via-github-actions.md +185 -0
- package/deployments/cloudflare/via-terraform.md +157 -0
- package/deployments/cloudflare/via-wrangler.md +165 -0
- package/deployments/fly-io/README.md +37 -0
- package/deployments/fly-io/via-dockerfile.md +648 -0
- package/deployments/fly-io/via-flyctl.md +653 -0
- package/deployments/fly-io/via-github-actions.md +695 -0
- package/deployments/fly-io/via-multi-region.md +598 -0
- package/deployments/google/README.md +34 -0
- package/deployments/google/via-app-engine.md +42 -0
- package/deployments/google/via-cloud-functions.md +23 -0
- package/deployments/google/via-cloud-run.md +330 -0
- package/deployments/google/via-gke.md +23 -0
- package/deployments/netlify/README.md +99 -0
- package/deployments/netlify/via-cli.md +17 -0
- package/deployments/netlify/via-functions.md +19 -0
- package/deployments/netlify/via-git.md +25 -0
- package/deployments/vercel/README.md +90 -0
- package/deployments/vercel/via-api.md +16 -0
- package/deployments/vercel/via-cli.md +17 -0
- package/deployments/vercel/via-git.md +24 -0
- package/docs/BROWNFIELD.md +179 -0
- package/docs/getting-started.md +137 -0
- package/docs/good-agents-md.md +137 -0
- package/events/README.md +89 -0
- package/events/event-record.schema.json +26 -0
- package/events/registry.json +166 -0
- package/events/registry.schema.json +71 -0
- package/glossary.md +145 -0
- package/incidents/README.md +81 -0
- package/incidents/_template.md +38 -0
- package/interfaces/cli.md +104 -0
- package/interfaces/rest.md +212 -0
- package/interfaces/tui.md +242 -0
- package/interfaces/web.md +123 -0
- package/languages/6502-DASM.md +132 -0
- package/languages/c.md +235 -0
- package/languages/commands.md +23 -0
- package/languages/cpp.md +132 -0
- package/languages/csharp.md +259 -0
- package/languages/dart.md +183 -0
- package/languages/delphi.md +218 -0
- package/languages/elixir.md +208 -0
- package/languages/go.md +78 -0
- package/languages/java.md +278 -0
- package/languages/javascript.md +163 -0
- package/languages/julia.md +175 -0
- package/languages/kotlin.md +193 -0
- package/languages/markdown.md +168 -0
- package/languages/mermaid.md +146 -0
- package/languages/officejs.md +392 -0
- package/languages/python.md +209 -0
- package/languages/r.md +163 -0
- package/languages/rust.md +216 -0
- package/languages/sql.md +216 -0
- package/languages/swift.md +153 -0
- package/languages/typescript.md +132 -0
- package/languages/vba.md +279 -0
- package/languages/vhdl.md +180 -0
- package/languages/visual-basic.md +151 -0
- package/languages/zig.md +196 -0
- package/meta/SOUL.md +27 -0
- package/meta/code-field.md +44 -0
- package/meta/morals.md +40 -0
- package/meta/philosophy.md +39 -0
- package/meta/project.md +49 -0
- package/meta/ralph.md +223 -0
- package/meta/security.md +80 -0
- package/meta/versioning.md +326 -0
- package/package.json +22 -0
- package/packs/lessons/lessons-pack-0.1.json +553 -0
- package/packs/patterns/patterns-pack-0.1.json +57 -0
- package/packs/rules/rules-pack-0.1.json +4767 -0
- package/packs/skills/skills-pack-0.1.json +262 -0
- package/packs/strategies/strategies-pack-0.1.json +167 -0
- package/packs/swarm-spec/swarm-spec-pack-0.1.json +17 -0
- package/patterns/executor-layer-credentials.md +227 -0
- package/patterns/llm-app.md +156 -0
- package/patterns/multi-agent.md +278 -0
- package/patterns/prompt-assembly-layer-ordering.md +154 -0
- package/patterns/role-as-overlay.md +179 -0
- package/platforms/2600.md +137 -0
- package/platforms/unity.md +329 -0
- package/references/composer-skill-porting.md +152 -0
- package/references/cost-models.md +163 -0
- package/references/ip-risk.md +246 -0
- package/references/plain-english-ux.md +275 -0
- package/resilience/context-pruning.md +67 -0
- package/resilience/continue-here.md +62 -0
- package/scm/changelog.md +276 -0
- package/scm/git.md +139 -0
- package/scm/github.md +265 -0
- package/secrets/.gitkeep +0 -0
- package/skills/deft-build/SKILL.md +20 -0
- package/skills/deft-directive-article-review/SKILL.md +156 -0
- package/skills/deft-directive-build/SKILL.md +302 -0
- package/skills/deft-directive-cost/SKILL.md +201 -0
- package/skills/deft-directive-debug/SKILL.md +140 -0
- package/skills/deft-directive-decompose/SKILL.md +96 -0
- package/skills/deft-directive-gh-arch/SKILL.md +160 -0
- package/skills/deft-directive-gh-slice/SKILL.md +199 -0
- package/skills/deft-directive-glossary/SKILL.md +118 -0
- package/skills/deft-directive-interview/SKILL.md +528 -0
- package/skills/deft-directive-pre-pr/SKILL.md +131 -0
- package/skills/deft-directive-probe/SKILL.md +127 -0
- package/skills/deft-directive-refinement/SKILL.md +403 -0
- package/skills/deft-directive-release/SKILL.md +266 -0
- package/skills/deft-directive-review-cycle/SKILL.md +401 -0
- package/skills/deft-directive-setup/SKILL.md +717 -0
- package/skills/deft-directive-swarm/SKILL.md +989 -0
- package/skills/deft-directive-sync/SKILL.md +288 -0
- package/skills/deft-directive-triage/SKILL.md +137 -0
- package/skills/deft-directive-write-skill/SKILL.md +169 -0
- package/skills/deft-interview/SKILL.md +16 -0
- package/skills/deft-pre-pr/SKILL.md +16 -0
- package/skills/deft-review-cycle/SKILL.md +16 -0
- package/skills/deft-roadmap-refresh/SKILL.md +16 -0
- package/skills/deft-setup/SKILL.md +20 -0
- package/skills/deft-swarm/SKILL.md +16 -0
- package/skills/deft-sync/SKILL.md +16 -0
- package/strategies/README.md +83 -0
- package/strategies/artifact-guards.md +85 -0
- package/strategies/bdd.md +115 -0
- package/strategies/brownfield.md +7 -0
- package/strategies/discuss.md +129 -0
- package/strategies/emit-hints.md +69 -0
- package/strategies/enterprise.md +193 -0
- package/strategies/interview.md +551 -0
- package/strategies/map.md +179 -0
- package/strategies/probe.md +151 -0
- package/strategies/rapid.md +155 -0
- package/strategies/research.md +155 -0
- package/strategies/roadmap.md +9 -0
- package/strategies/speckit.md +437 -0
- package/strategies/v0-20-contract.md +134 -0
- package/strategies/yolo.md +169 -0
- package/swarm/swarm.md +300 -0
- package/templates/COST-ESTIMATE.md +114 -0
- package/templates/PULL_REQUEST_TEMPLATE.md +35 -0
- package/templates/agent-prompt-preamble.md +409 -0
- package/templates/agents-entry.md +211 -0
- package/templates/agents-entry.placeholders.md +75 -0
- package/templates/embed.go +20 -0
- package/templates/embed_test.go +36 -0
- package/templates/make-spec-example.md +9 -0
- package/templates/make-spec.md +246 -0
- package/templates/project.md.template +52 -0
- package/templates/specification.md +1 -0
- package/templates/swarm-greptile-poller-prompt.md +556 -0
- package/templates/user.md.template +31 -0
- package/tools/RWLDL.md +80 -0
- package/tools/greptile.md +141 -0
- package/tools/installer.md +23 -0
- package/tools/taskfile-migration.md +32 -0
- package/tools/taskfile.md +185 -0
- package/tools/telemetry.md +285 -0
- package/vbrief/schemas/cache-meta.schema.json +137 -0
- package/vbrief/schemas/candidates.schema.json +130 -0
- package/vbrief/schemas/codebase-map.schema.json +213 -0
- package/vbrief/schemas/lessons-pack.schema.json +134 -0
- package/vbrief/schemas/patterns-pack.schema.json +84 -0
- package/vbrief/schemas/rules-pack.schema.json +105 -0
- package/vbrief/schemas/skills-pack.schema.json +94 -0
- package/vbrief/schemas/slices.schema.json +87 -0
- package/vbrief/schemas/strategies-pack.schema.json +89 -0
- package/vbrief/schemas/swarm-spec-pack.schema.json +84 -0
- package/vbrief/schemas/vbrief-core.schema.json +1022 -0
- package/vbrief/vbrief.md +684 -0
- package/verification/integration.md +76 -0
- package/verification/plan-checking.md +85 -0
- package/verification/uat.md +60 -0
- package/verification/verification.md +117 -0
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: deft-directive-build
|
|
3
|
+
description: >-
|
|
4
|
+
Build a project from scope vBRIEFs following Deft Directive framework
|
|
5
|
+
standards. Use after deft-directive-setup has generated the project
|
|
6
|
+
definition, or when the user has story vBRIEFs in vbrief/active/ ready to
|
|
7
|
+
implement. Handles scaffolding, implementation, testing, and quality checks
|
|
8
|
+
phase by phase.
|
|
9
|
+
---
|
|
10
|
+
<!-- AUTO-GENERATED by task packs:render -- DO NOT EDIT MANUALLY -->
|
|
11
|
+
<!-- Purpose: rendered skill -->
|
|
12
|
+
<!-- Source of truth: packs/skills/skills-pack-0.1.json -->
|
|
13
|
+
<!-- Regenerate with: task packs:render -->
|
|
14
|
+
<!-- Edit the source, not this file. Slice instead of loading every SKILL.md: task packs:slice skills by-trigger --trigger <kw> (or list) -->
|
|
15
|
+
|
|
16
|
+
# Deft Directive Build
|
|
17
|
+
|
|
18
|
+
Implements a project from its scope vBRIEFs following Deft Directive standards.
|
|
19
|
+
|
|
20
|
+
Legend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.
|
|
21
|
+
|
|
22
|
+
## When to Use
|
|
23
|
+
|
|
24
|
+
- After `deft-directive-setup` completes and generates `PROJECT-DEFINITION.vbrief.json`
|
|
25
|
+
- User says "build this", "implement the spec", or "start building"
|
|
26
|
+
- Resuming a partially-built project that has story vBRIEFs in `vbrief/active/`
|
|
27
|
+
|
|
28
|
+
## Step 0 -- Implementation Preflight (#810)
|
|
29
|
+
|
|
30
|
+
- ! Before starting any new implementation story or switching from one story to another, MUST run `git status --short --branch`.
|
|
31
|
+
- ! If the working tree is dirty, MUST stop and summarize the current branch, modified/untracked files, and whether the changes appear related to the target story. Ask the operator to choose one path: commit existing work, stash existing work, include existing work in the current story, or stop.
|
|
32
|
+
- ⊗ Begin a new story while unrelated dirty work is present without explicit operator approval.
|
|
33
|
+
- ! Resolve exactly one target story vBRIEF path by default. One story is the default implementation unit for this skill; if the user asks for a phase/epic, decompose or ask which story to start.
|
|
34
|
+
- ! Batching multiple stories in one branch/PR requires explicit operator approval and a short rationale recorded in the handoff.
|
|
35
|
+
- ! **Swarm-cohort dispatch carve-out**: when this skill is invoked as part of a swarm cohort allocated by `skills/deft-directive-swarm/SKILL.md`, the approved Phase 5 allocation plan satisfies the "explicit operator approval and short rationale recorded in the handoff" requirement above -- the dispatched vBRIEF paths and allocation rationale ARE the consent token. Process each assigned story sequentially under the checkpoint-commit + `task scope:complete` discipline below. Do NOT re-prompt the parent for batching approval mid-cohort -- the all-or-nothing dispatch envelope rule (`AGENTS.md` `## Multi-agent orchestration discipline (#954)`) forbids mid-scope user-approval gates.
|
|
36
|
+
- ! **Structured consent-token recognition (#1378)**: the canonical recognition path for the carve-out above is the structured `## Allocation context` section of the dispatch envelope (the frozen schema in `templates/agent-prompt-preamble.md`, Story A of #1378). When that section reports `dispatch_kind: swarm-cohort` with a non-null `allocation_plan_id` AND a non-null `batching_rationale`, the consent token is satisfied mechanically -- read `cohort_vbriefs` as the authoritative file boundary and process each entry sequentially under the checkpoint-commit + `task scope:complete` discipline below, without re-prompting the parent for batching approval mid-cohort. When the `## Allocation context` section is ABSENT (pre-#1378 dispatches, solo-interactive sessions), fall back to the #1371 prose carve-out immediately above -- the prose carve-out remains the recognition path of record for un-elevated envelopes.
|
|
37
|
+
- ! **Within a cohort, between stories**: the working tree MUST be clean after each story's checkpoint commit + `task scope:complete`. If `git status --short` shows uncommitted state between stories (e.g. a missed `task scope:complete` move, an unstaged file from the prior story), checkpoint-commit it and proceed -- do NOT pause to ask the operator. The dirty-tree "ask the operator" branch above applies only at the FIRST story-start of a fresh branch, where uncommitted operator work might legitimately exist.
|
|
38
|
+
- ! If the target story is in `vbrief/proposed/`, run `task scope:promote -- <path>` first; if it is in `vbrief/pending/`, run `task scope:activate -- <path>`. After activation, update the path to the active-file location before preflight.
|
|
39
|
+
- ! Before any code-writing tool call -- the first scaffold edit, the first `task` invocation that mutates files, or any `start_agent` dispatch that will implement scope -- MUST run `task vbrief:preflight -- <active-story-path>` (the structural intent gate; wraps `scripts/preflight_implementation.py` so the same invocation works whether deft is the project root or installed as a `deft/` subdirectory).
|
|
40
|
+
|
|
41
|
+
The gate exits 0 only when the candidate vBRIEF lives in `vbrief/active/` AND `plan.status == "running"`. Any other state (pending/, proposed/, completed/, active/-with-non-running-status, malformed JSON, missing keys) exits 1 with an actionable redirect to `task vbrief:activate <path>`.
|
|
42
|
+
|
|
43
|
+
- ! A non-zero exit MUST halt the skill. Surface the helper's stderr message verbatim to the user; do NOT proceed to USER.md Gate, File Reading, or any later phase.
|
|
44
|
+
- ! Use canonical lifecycle tasks to satisfy this gate: `task scope:promote -- <path>` for proposed stories, `task scope:activate -- <path>` for pending stories, and the helper's idempotent companion `task vbrief:activate <path>` only when following the preflight redirect directly. Manual lifecycle moves bypass the activation contract -- use the task.
|
|
45
|
+
- ⊗ Infer implementation intent from lifecycle vocabulary ("do the full PR process", "start the work", "poller agents"), branching language, or workflow shape. Workflow-shape vocabulary is NOT authorization to spawn an implementation agent (#810 surfacing event).
|
|
46
|
+
- ⊗ Skip this preflight because the user said "yes", "go", or "proceed" -- affirmative continuation phrases are NOT implementation authorization unless the prior turn explicitly proposed implementation. When intent is ambiguous, ask one targeted question before invoking the gate.
|
|
47
|
+
|
|
48
|
+
## Platform Detection
|
|
49
|
+
|
|
50
|
+
! Before resolving any config paths, detect the host OS from your environment context:
|
|
51
|
+
|
|
52
|
+
| Platform | USER.md default path |
|
|
53
|
+
|--------------------|-------------------------------------------------------------------|
|
|
54
|
+
| Windows | `%APPDATA%\deft\USER.md` (e.g. `C:\Users\{user}\AppData\Roaming\deft\USER.md`) |
|
|
55
|
+
| Unix (macOS/Linux) | `~/.config/deft/USER.md` |
|
|
56
|
+
|
|
57
|
+
- ! If `$DEFT_USER_PATH` is set, it takes precedence on any platform
|
|
58
|
+
|
|
59
|
+
## Pre-Cutover Detection Guard
|
|
60
|
+
|
|
61
|
+
! Before proceeding with any build step, detect whether the project uses the pre-v0.20 document model **or was generated by a strategy that emitted non-conformant v0.20 output shape** (the root cause of most "build fails immediately after spec" complaints in #1166). Redirect or block with the precise remediation.
|
|
62
|
+
|
|
63
|
+
### Detection Criteria
|
|
64
|
+
|
|
65
|
+
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.
|
|
66
|
+
|
|
67
|
+
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.
|
|
68
|
+
2. `PROJECT.md` exists and contains neither the legacy `<!-- deft:deprecated-redirect -->` sentinel NOR the current `Purpose: deprecation redirect` canonical-banner marker (real content, not a deprecation redirect)
|
|
69
|
+
3. `vbrief/specification.vbrief.json` exists but the lifecycle folders (`vbrief/proposed/`, `vbrief/pending/`, `vbrief/active/`, `vbrief/completed/`, `vbrief/cancelled/`) do NOT exist
|
|
70
|
+
4. Strategy output shape violations (run `task verify-strategy-output` -- the canonical gate -- or the direct form `python .deft/core/scripts/validate_strategy_output.py --project-root <path>` after `deft` install):
|
|
71
|
+
- Any scope vBRIEF under `vbrief/proposed/` (or other lifecycle dirs) lacks the required `YYYY-MM-DD-` date prefix in its filename (e.g. bare `scaffold.vbrief.json`).
|
|
72
|
+
- `vbrief/PROJECT-DEFINITION.vbrief.json` is missing.
|
|
73
|
+
- `vbrief/specification.vbrief.json` exists as a legacy dual-write in a user-generated project. This is tolerated only for the framework source tree or a complete post-cutover full-spec consumer where all lifecycle folders exist and `SPECIFICATION.md` is rendered from `vbrief/specification.vbrief.json`.
|
|
74
|
+
|
|
75
|
+
### Action on Detection
|
|
76
|
+
|
|
77
|
+
! If pre-cutover or strategy-nonconformant state is detected, **stop immediately** and display an actionable message that cites the exact validator:
|
|
78
|
+
|
|
79
|
+
> "This project was generated with pre-v0.20 or non-conformant strategy output. Run the deterministic validator and follow its remediation: `task verify-strategy-output` (works in source and after `deft` package install) or `python .deft/core/scripts/validate_strategy_output.py --project-root .` . Then `task migrate:vbrief` / `task project:render` / strategy re-run as indicated."
|
|
80
|
+
|
|
81
|
+
! Include specific details about what was detected (the validator output is authoritative):
|
|
82
|
+
|
|
83
|
+
- Legacy specification.vbrief.json or missing lifecycle folders: "Run `task migrate:vbrief` to create the lifecycle folder structure and remove legacy dual-writes"
|
|
84
|
+
- Non-date-prefixed vBRIEFs: "Re-run the emitting strategy after the v0.20 migrations (#1166 s1+s2+...) or manually rename files to `YYYY-MM-DD-<slug>.vbrief.json` and `task scope:promote`"
|
|
85
|
+
- Missing `PROJECT-DEFINITION.vbrief.json`: "Run `task project:render` to generate the project definition"
|
|
86
|
+
- `SPECIFICATION.md` / `PROJECT.md` without sentinel: the classic pre-cutover messages
|
|
87
|
+
- Scope vBRIEF in wrong folder: "Status is '{status}' but file is in {folder}/ -- run `task scope:activate <file>` to fix"
|
|
88
|
+
|
|
89
|
+
! After the validator reports clean, re-run this guard before continuing.
|
|
90
|
+
|
|
91
|
+
⊗ Proceed with build when pre-cutover or strategy-nonconformant artifacts are detected -- always redirect to migration first (or run the validator) and surface the exact remediation.
|
|
92
|
+
⊗ Silently ignore these artifacts or guess at fixes -- the validator (wired into `task check` and this guard) is the deterministic gate.
|
|
93
|
+
|
|
94
|
+
## USER.md Gate
|
|
95
|
+
|
|
96
|
+
! Before proceeding, verify USER.md exists at the platform-appropriate path
|
|
97
|
+
(resolved via Platform Detection above, or `$DEFT_USER_PATH` if set).
|
|
98
|
+
|
|
99
|
+
- ! If USER.md is not found: inform the user and redirect to `deft-directive-setup`
|
|
100
|
+
Phase 1 before continuing -- do not proceed without user preferences
|
|
101
|
+
- ! Once USER.md exists, continue with the Cost Phase Gate below
|
|
102
|
+
|
|
103
|
+
## Cost Phase Gate (#739)
|
|
104
|
+
|
|
105
|
+
! Before proceeding to File Reading, verify the project has gone through the
|
|
106
|
+
pre-build cost & budget transparency phase from `skills/deft-directive-cost/SKILL.md`.
|
|
107
|
+
This closes the adoption-blocker surfaced by issue #739 (refs #151 umbrella) where
|
|
108
|
+
users finished the spec flow and stopped at build because deft offered no cost
|
|
109
|
+
signal.
|
|
110
|
+
|
|
111
|
+
### Detection
|
|
112
|
+
|
|
113
|
+
- ! Check for `COST-ESTIMATE.md` in the project root.
|
|
114
|
+
- ! Check that the file contains a recorded decision (the **Decision recorded**
|
|
115
|
+
block populated with one of: `build`, `rescope`, `no-build`, `skip`).
|
|
116
|
+
- ! For `skip`, `rescope`, or `no-build` decisions: the **Reason** field MUST be
|
|
117
|
+
populated (one or two sentences in plain language). A skip with no reason
|
|
118
|
+
recorded is treated the same as no decision.
|
|
119
|
+
|
|
120
|
+
### Action
|
|
121
|
+
|
|
122
|
+
- ! If `COST-ESTIMATE.md` is missing OR the **Decision recorded** block is
|
|
123
|
+
unpopulated OR a `skip`/`rescope`/`no-build` decision has no reason recorded:
|
|
124
|
+
stop immediately and redirect the user:
|
|
125
|
+
|
|
126
|
+
> "This project has not gone through the pre-build cost & budget transparency
|
|
127
|
+
> phase. Run `skills/deft-directive-cost/SKILL.md` to produce a plain-English
|
|
128
|
+
> `COST-ESTIMATE.md`, then re-run the build skill once the user has chosen
|
|
129
|
+
> build / rescope / no-build / skip(+reason)."
|
|
130
|
+
|
|
131
|
+
- ! On a `build` or `skip` decision: continue with File Reading below.
|
|
132
|
+
- ! On a `rescope` decision: stop and redirect the user back to spec edits
|
|
133
|
+
(chain to `skills/deft-directive-refinement/SKILL.md` to pull spec scope
|
|
134
|
+
back, or the interview), then re-run `skills/deft-directive-cost/SKILL.md`
|
|
135
|
+
before re-attempting build.
|
|
136
|
+
- ! On a `no-build` decision: stop and exit; do NOT proceed to File Reading.
|
|
137
|
+
The user has explicitly stopped the project at the cost phase.
|
|
138
|
+
- ⊗ Proceed to File Reading or any subsequent phase when `COST-ESTIMATE.md` is
|
|
139
|
+
missing, when the decision is unpopulated, or when a skip / rescope / no-build
|
|
140
|
+
decision has no reason recorded.
|
|
141
|
+
- ⊗ Treat a `rescope` or `no-build` decision as if it were a `build` -- the
|
|
142
|
+
build skill MUST honor the recorded decision.
|
|
143
|
+
|
|
144
|
+
## File Reading
|
|
145
|
+
|
|
146
|
+
- ! Read in order, lazy load:
|
|
147
|
+
1. `./vbrief/active/` -- scope vBRIEFs for work items to build (required)
|
|
148
|
+
2. `./vbrief/PROJECT-DEFINITION.vbrief.json` -- project identity, tech stack, architecture
|
|
149
|
+
3. `./.planning/codebase/MAP.md` -- generated codebase orientation projection, if present (advisory)
|
|
150
|
+
4. USER.md at the platform-appropriate path (see Platform Detection) -- Personal section is highest precedence; Defaults are fallback
|
|
151
|
+
5. `deft/main.md` -- framework guidelines
|
|
152
|
+
6. `deft/coding/coding.md` -- coding standards
|
|
153
|
+
7. `deft/coding/testing.md` -- testing requirements
|
|
154
|
+
8. `deft/coding/toolchain.md` -- toolchain validation rules
|
|
155
|
+
9. `deft/languages/{language}.md` -- only for languages this project uses
|
|
156
|
+
- ~ If the MAP is absent or may be stale and the current scope needs broad codebase orientation, run `task codebase:map` and `task verify:codebase-map-fresh` when those commands resolve. Treat absence/staleness as advisory unless the task edits `plan.architecture.codeStructure`, a configured provider artifact, or the generated MAP itself.
|
|
157
|
+
- ! Treat `plan.architecture.codeStructure` and selected provider artifacts as authoritative. The MAP is a generated projection.
|
|
158
|
+
- ⊗ Read all language/interface/tool files upfront
|
|
159
|
+
- ⊗ Hand-edit `.planning/codebase/MAP.md` or block unrelated implementation solely because the MAP is stale or absent
|
|
160
|
+
|
|
161
|
+
## Rule Precedence
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
USER.md Personal <- HIGHEST (name, custom rules -- always wins)
|
|
165
|
+
PROJECT-DEFINITION.vbrief.json <- Project-specific (tech stack, architecture, config)
|
|
166
|
+
USER.md Defaults <- Fallback defaults (used when PROJECT-DEFINITION doesn't specify)
|
|
167
|
+
{language}.md <- Language standards
|
|
168
|
+
coding.md <- General coding
|
|
169
|
+
main.md <- Framework defaults
|
|
170
|
+
Scope vBRIEFs <- LOWEST
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
- ! USER.md Personal section always wins over any other file
|
|
174
|
+
- ! For project-scoped settings, PROJECT-DEFINITION.vbrief.json overrides USER.md Defaults
|
|
175
|
+
|
|
176
|
+
## Change Lifecycle Gate
|
|
177
|
+
|
|
178
|
+
! Before any implementation that touches 3+ files, verify that a `/deft:change <name>` proposal exists and has been confirmed by the user:
|
|
179
|
+
|
|
180
|
+
- ! Check `history/changes/` for an active `proposal.vbrief.json` matching this work
|
|
181
|
+
- ! If no proposal exists: propose `/deft:change <name>` and present the change name for explicit confirmation (e.g. "Confirm? yes/no")
|
|
182
|
+
- ! The user must reply with an affirmative (`yes`, `confirmed`, `approve`) — a general 'proceed', 'do it', or 'go ahead' does NOT satisfy this gate
|
|
183
|
+
- ? For solo projects: this gate is RECOMMENDED but not mandatory for changes fully covered by `task check`; it remains mandatory for cross-cutting, architectural, or high-risk changes
|
|
184
|
+
- ⊗ Skip this gate because the user has already said "proceed" or "go ahead"
|
|
185
|
+
|
|
186
|
+
## Build Process
|
|
187
|
+
|
|
188
|
+
All vBRIEFs (including those read from `vbrief/active/` and any new vBRIEFs this skill emits) MUST use `"vBRIEFInfo": { "version": "0.6" }`. The validator rejects any other version (see [`../../conventions/references.md`](../../conventions/references.md)).
|
|
189
|
+
|
|
190
|
+
### Step 1: Understand the Scope
|
|
191
|
+
|
|
192
|
+
- ! Read story vBRIEFs from `vbrief/active/` and `PROJECT-DEFINITION.vbrief.json`
|
|
193
|
+
- ! Identify phases, dependencies, starting point from scope vBRIEF acceptance criteria
|
|
194
|
+
- ~ Use `.planning/codebase/MAP.md`, when present, to orient broad codebase scanning. If the MAP conflicts with current code or canonical metadata, surface the drift and trust `plan.architecture.codeStructure` / provider artifacts plus the working tree over generated prose.
|
|
195
|
+
- ! When scanning the existing codebase during scope understanding, MUST surface any contradicting patterns (two error-handling shapes, two state-management approaches, two naming conventions, etc.) before implementation begins -- apply `coding/hygiene.md` `## Surface Conflicts: Pick One, Explain, Flag the Other (#1005)` and choose ONE pattern (more recent OR more tested), explain the choice in the scope summary, and flag the other for cleanup
|
|
196
|
+
- ⊗ Begin implementation against an averaged blend of two contradicting patterns -- "average code that satisfies both rules is the worst code" (#1005)
|
|
197
|
+
- ! Present brief summary to user:
|
|
198
|
+
|
|
199
|
+
> "Here's what I see: {N} story vBRIEFs in active/. I'll start with {name}. Ready?"
|
|
200
|
+
|
|
201
|
+
### Step 2: Verify Toolchain
|
|
202
|
+
|
|
203
|
+
- ! Before any implementation, verify all tools required by this project are installed and functional — see `deft/coding/toolchain.md` for full rules
|
|
204
|
+
- ! At minimum: confirm task runner (`task --version`), language compiler/runtime, and platform SDK (if applicable) are available
|
|
205
|
+
- ! If any required tool is missing, stop and report — do not proceed to Step 3
|
|
206
|
+
- ⊗ Assume tools are available because the spec references them
|
|
207
|
+
|
|
208
|
+
### Step 3: Build Phase by Phase
|
|
209
|
+
|
|
210
|
+
For each phase:
|
|
211
|
+
|
|
212
|
+
1. ! **Scaffold** — file structure, dependencies, config
|
|
213
|
+
2. ! **Test first** — write tests before implementation (TDD)
|
|
214
|
+
3. ! **Implement** — make tests pass, following deft coding standards
|
|
215
|
+
4. ! **Verify** — run `task check`, fix any issues
|
|
216
|
+
5. ! **Checkpoint** — tell user what's done, what's next
|
|
217
|
+
|
|
218
|
+
- ⊗ Move to next phase until current phase passes all checks
|
|
219
|
+
|
|
220
|
+
### Step 4: Quality Gates
|
|
221
|
+
|
|
222
|
+
After EVERY phase:
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
task check # Format, lint, type check, test, coverage
|
|
226
|
+
task test:coverage # >=85% or PROJECT-DEFINITION.vbrief.json override
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
- ! Phase is NOT done until `task check` passes
|
|
230
|
+
- ⊗ Skip quality gates or claim they passed without running
|
|
231
|
+
|
|
232
|
+
## Coding Standards (Summary)
|
|
233
|
+
|
|
234
|
+
Read full files when you need detail:
|
|
235
|
+
|
|
236
|
+
- ! TDD: write tests first — implementation incomplete without passing tests
|
|
237
|
+
- ! Coverage: ≥85% lines, functions, branches, statements
|
|
238
|
+
- ~ Files: <300 lines ideal, <500 recommended, ! <1000 max
|
|
239
|
+
- ~ Naming: hyphens for filenames unless language idiom dictates otherwise
|
|
240
|
+
- ! Contracts first: define interfaces/types before implementation
|
|
241
|
+
- ! Secrets: in `secrets/` dir with `.example` templates; ⊗ secrets in code
|
|
242
|
+
- ! Commits: Conventional Commits format; ! run `task check` before every commit
|
|
243
|
+
|
|
244
|
+
See `deft/coding/coding.md` and `deft/coding/testing.md` for full rules.
|
|
245
|
+
|
|
246
|
+
## Pre-Commit File Review
|
|
247
|
+
|
|
248
|
+
! Before every commit, re-read ALL modified files and explicitly check for:
|
|
249
|
+
|
|
250
|
+
1. ! **Encoding errors** -- em-dashes corrupted to replacement characters, BOM artifacts, mojibake from round-trip read/write
|
|
251
|
+
2. ! **Unintended duplication** -- accidental double entries in CHANGELOG.md, scope vBRIEF files, or structured data files
|
|
252
|
+
3. ! **Structural issues** -- malformed CHANGELOG entries, broken table rows, mismatched index entries, invalid JSON/YAML
|
|
253
|
+
4. ! **Semantic accuracy** -- verify that counts, claims, and summaries in CHANGELOG entries and ROADMAP changelog lines match the actual data in the commit (e.g. "triaged 4 issues" must match the number actually triaged, issue numbers cited must match the issues actually added)
|
|
254
|
+
5. ! **Semantic contradictions** -- when adding a `!` or `⊗` rule that prohibits a specific command, pattern, or behavior, search the same file for any `~`, `≉`, or prose that recommends or permits the same command/pattern -- resolve all contradictions in the same commit before pushing
|
|
255
|
+
6. ! **Strength duplicates** -- when strengthening a rule (e.g. upgrading `~` to `!`), grep for the term in the full file and verify no weaker-strength duplicate remains
|
|
256
|
+
7. ! **Forward test coverage** -- for each new source file in this PR (`scripts/`, `src/`, `cmd/`, `*.py`, `*.go`), verify a corresponding test file exists in the same PR; running existing tests is not sufficient for new code
|
|
257
|
+
|
|
258
|
+
⊗ Commit without re-reading all modified files first.
|
|
259
|
+
|
|
260
|
+
## Commit Strategy
|
|
261
|
+
|
|
262
|
+
- ! Default to one story per branch/PR. Batching multiple stories in one branch requires explicit operator approval and a short rationale.
|
|
263
|
+
- ! Create a checkpoint commit after each completed story before beginning another story.
|
|
264
|
+
- ! Run `task check` before committing
|
|
265
|
+
- ⊗ Claim checks passed without running them
|
|
266
|
+
|
|
267
|
+
```
|
|
268
|
+
feat(phase-1): scaffold project structure
|
|
269
|
+
feat(phase-1): implement core data models with tests
|
|
270
|
+
feat(phase-2): add REST API endpoints with integration tests
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
## Error Recovery
|
|
274
|
+
|
|
275
|
+
- ! Tests fail → fix them; ⊗ skip or weaken assertions
|
|
276
|
+
- ! Coverage drops → write more tests; ⊗ exclude files
|
|
277
|
+
- ! Lint/type errors → fix them; ≉ add ignore comments without documented reason
|
|
278
|
+
- ! Scope vBRIEF ambiguous -> ask user; ⊗ guess
|
|
279
|
+
- ! Scope needs changes -> propose, get approval, update the scope vBRIEF first
|
|
280
|
+
|
|
281
|
+
## Completion
|
|
282
|
+
|
|
283
|
+
- ! When all phases pass and `task check` is green, complete each implemented story via `task scope:complete -- <active-story-path>` before final PR handoff.
|
|
284
|
+
|
|
285
|
+
> "The project is built and all quality checks pass. Describe any new features you'd like to add — I'll follow the deft standards we've set up."
|
|
286
|
+
|
|
287
|
+
## Anti-Patterns
|
|
288
|
+
|
|
289
|
+
- ⊗ Skip tests or write them after implementation
|
|
290
|
+
- ⊗ Ignore `task check` failures
|
|
291
|
+
- ⊗ Implement things not in scope vBRIEF without asking
|
|
292
|
+
- ⊗ Read every deft file upfront
|
|
293
|
+
- ⊗ Move to next phase before current passes checks
|
|
294
|
+
- ⊗ Make commits without running `task check`
|
|
295
|
+
- ⊗ Proceed without USER.md -- always run the USER.md Gate first
|
|
296
|
+
- ⊗ Spawn an implementation agent or invoke a code-writing tool against a vBRIEF that has not passed `task vbrief:preflight` (which wraps `scripts/preflight_implementation.py`) -- always run the Step 0 Implementation Preflight (#810) first; satisfy via `task vbrief:activate <path>`
|
|
297
|
+
- ⊗ Proceed without `COST-ESTIMATE.md` and a recorded build / rescope / no-build / skip(+reason) decision -- always run the Cost Phase Gate (#739) first
|
|
298
|
+
- ⊗ Proceed with implementation when the build or test toolchain is unavailable -- always run the Toolchain Gate (Step 2) first
|
|
299
|
+
- ⊗ Proceed to next task or phase without tests passing -- testing is a hard gate, not a cleanup step
|
|
300
|
+
- ⊗ Skip the Change Lifecycle Gate because the user said "proceed" -- broad approval does not satisfy the confirmation gate
|
|
301
|
+
- ⊗ Commit or push directly to the default branch -- always create a feature branch first. Exception: user explicitly instructs a direct commit, or `PROJECT-DEFINITION.vbrief.json` narratives contain `Allow direct commits to master: true`
|
|
302
|
+
- ⊗ Add a prohibition (`!` or `⊗`) without scanning the same file for conflicting softer-strength rules (`~`, `≉`) that reference the same term
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: deft-directive-cost
|
|
3
|
+
description: >-
|
|
4
|
+
Pre-build cost & budget transparency phase. Use after the project
|
|
5
|
+
SPECIFICATION is approved and before the build skill kicks off, to produce a
|
|
6
|
+
plain-English COST-ESTIMATE.md the user can read, react to, and explicitly
|
|
7
|
+
accept, rescope, no-build, or skip with a recorded reason. Audience is non-
|
|
8
|
+
technical users; voice is dollars and whole-number bands, not spreadsheets.
|
|
9
|
+
---
|
|
10
|
+
<!-- AUTO-GENERATED by task packs:render -- DO NOT EDIT MANUALLY -->
|
|
11
|
+
<!-- Purpose: rendered skill -->
|
|
12
|
+
<!-- Source of truth: packs/skills/skills-pack-0.1.json -->
|
|
13
|
+
<!-- Regenerate with: task packs:render -->
|
|
14
|
+
<!-- Edit the source, not this file. Slice instead of loading every SKILL.md: task packs:slice skills by-trigger --trigger <kw> (or list) -->
|
|
15
|
+
|
|
16
|
+
# Deft Directive Cost
|
|
17
|
+
|
|
18
|
+
Plain-English cost & budget transparency phase between SPECIFICATION
|
|
19
|
+
approval and build kickoff. Closes the adoption-blocker surfaced by
|
|
20
|
+
issue #739 (and issue #151 umbrella) where users finished the spec
|
|
21
|
+
flow and stopped at build because deft offered no cost signal.
|
|
22
|
+
|
|
23
|
+
Legend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.
|
|
24
|
+
|
|
25
|
+
## When to Use
|
|
26
|
+
|
|
27
|
+
- After `skills/deft-directive-setup/SKILL.md` Phase 3 has produced an
|
|
28
|
+
approved `vbrief/specification.vbrief.json` (status `approved`)
|
|
29
|
+
- Before `skills/deft-directive-build/SKILL.md` kicks off
|
|
30
|
+
- When the user says "cost", "budget", "pre-build cost", "how much will
|
|
31
|
+
this cost", or asks to estimate cost before building
|
|
32
|
+
|
|
33
|
+
## Audience & Voice
|
|
34
|
+
|
|
35
|
+
- ! Non-technical users. Voice is plain English, dollars, and whole
|
|
36
|
+
numbers. No spreadsheets, no scientific notation, no industry jargon.
|
|
37
|
+
- ! Loose ranges, not single point estimates. Express bands as **low /
|
|
38
|
+
typical / high**.
|
|
39
|
+
- ⊗ Use jargon like "TCO", "burn rate", "p50", "OPEX vs CAPEX",
|
|
40
|
+
"amortised", "blended rate", "unit economics", "FTE", or any other
|
|
41
|
+
term a non-technical user is unlikely to know.
|
|
42
|
+
|
|
43
|
+
Methodology lives in `references/cost-models.md`. The canonical body of
|
|
44
|
+
the artifact lives in `templates/COST-ESTIMATE.md`.
|
|
45
|
+
|
|
46
|
+
## Platform Detection
|
|
47
|
+
|
|
48
|
+
! Before resolving any config paths, detect the host OS from your
|
|
49
|
+
environment context and resolve the `USER.md` path:
|
|
50
|
+
|
|
51
|
+
| Platform | USER.md default path |
|
|
52
|
+
|--------------------|-------------------------------------------------------------------|
|
|
53
|
+
| Windows | `%APPDATA%\deft\USER.md` (e.g. `C:\Users\{user}\AppData\Roaming\deft\USER.md`) |
|
|
54
|
+
| Unix (macOS/Linux) | `~/.config/deft/USER.md` |
|
|
55
|
+
|
|
56
|
+
- ! If `$DEFT_USER_PATH` is set, it takes precedence on any platform.
|
|
57
|
+
|
|
58
|
+
Path resolution mirrors `skills/deft-directive-build/SKILL.md` so the
|
|
59
|
+
two skills agree on the user's preferences file.
|
|
60
|
+
|
|
61
|
+
## Inputs
|
|
62
|
+
|
|
63
|
+
- ! `vbrief/specification.vbrief.json` MUST exist with `plan.status =
|
|
64
|
+
"approved"`. If the spec is not yet approved, stop and redirect to
|
|
65
|
+
`skills/deft-directive-setup/SKILL.md` Phase 3 / the spec approval
|
|
66
|
+
gate.
|
|
67
|
+
- ~ `vbrief/PROJECT-DEFINITION.vbrief.json` (for tech-stack and
|
|
68
|
+
architecture narratives). Optional but improves the estimate.
|
|
69
|
+
- ~ `templates/COST-ESTIMATE.md` (canonical artifact body).
|
|
70
|
+
- ~ `references/cost-models.md` (methodology).
|
|
71
|
+
|
|
72
|
+
## Phases
|
|
73
|
+
|
|
74
|
+
### Phase 1 -- Read the spec & detect categories
|
|
75
|
+
|
|
76
|
+
- ! Read the approved spec and the project definition.
|
|
77
|
+
- ! Walk the spec and identify which cost categories apply for this
|
|
78
|
+
project: hosting / infrastructure, API / third-party fees, pre-flight
|
|
79
|
+
account sign-ups, build & maintenance time. Drop categories that do
|
|
80
|
+
not apply.
|
|
81
|
+
- ~ State each category's relevance to the user in one sentence (e.g.
|
|
82
|
+
"Because the spec says we will use an LLM, the AI / LLM row applies
|
|
83
|
+
and is usually the largest swing factor").
|
|
84
|
+
|
|
85
|
+
### Phase 2 -- Draft `COST-ESTIMATE.md`
|
|
86
|
+
|
|
87
|
+
- ! Copy `templates/COST-ESTIMATE.md` into the project root as
|
|
88
|
+
`COST-ESTIMATE.md`.
|
|
89
|
+
- ! Fill in each category with a **low - typical - high** plain-English
|
|
90
|
+
band. Use whole numbers where the precision does not matter.
|
|
91
|
+
- ! State the **scale assumption** beside the typical band (e.g. "About
|
|
92
|
+
100 active users per day, each doing 5 main actions"). The same
|
|
93
|
+
project shape can be \$10 / month or \$10,000 / month depending on
|
|
94
|
+
traffic, so the assumption is required.
|
|
95
|
+
- ! Roll up into a **monthly band** (low / typical / high). Keep the
|
|
96
|
+
roll-up loose -- adding a range to a range gives a range; do NOT
|
|
97
|
+
collapse to a single number.
|
|
98
|
+
- ! When the high band is more than ~10x the typical band, surface a
|
|
99
|
+
**scale considerations** note explaining what would push the project
|
|
100
|
+
from typical to high (e.g. "media-heavy traffic blows up egress").
|
|
101
|
+
- ! USD-only first pass. The artifact MUST say "USD" up top so
|
|
102
|
+
international users know to convert.
|
|
103
|
+
- ⊗ Quote single-point estimates ("this will cost $47.12 / month").
|
|
104
|
+
- ⊗ Cite live vendor pricing as if it were a guarantee. The artifact is
|
|
105
|
+
a snapshot; vendor pricing changes.
|
|
106
|
+
|
|
107
|
+
### Phase 3 -- Read it back to the user
|
|
108
|
+
|
|
109
|
+
- ! Show the user the **TL;DR**, the **monthly band** (low / typical /
|
|
110
|
+
high), and the **scale considerations** note (if present).
|
|
111
|
+
- ~ Offer to read any other section in full on request.
|
|
112
|
+
- ! Surface the explicit **decision point** menu in Phase 4.
|
|
113
|
+
|
|
114
|
+
### Phase 4 -- Decision point (build kickoff confirmation menu)
|
|
115
|
+
|
|
116
|
+
! Present the user with this exact, numbered menu. Per the framework
|
|
117
|
+
menu rule (#767), `Discuss` and `Back` MUST be the final two numbered
|
|
118
|
+
options. The four substantive choices come first.
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
This is your project's cost estimate. Pick one.
|
|
122
|
+
|
|
123
|
+
1. Build -- accept the cost and start the build phase
|
|
124
|
+
2. Rescope -- keep building but reduce cost first
|
|
125
|
+
3. No-build -- stop here; record the reason
|
|
126
|
+
4. Skip -- skip the cost phase; record a short reason
|
|
127
|
+
5. Discuss -- ask follow-up questions before deciding
|
|
128
|
+
6. Back -- return to the previous step (e.g. spec edits)
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
- ! `Discuss` MUST be option 5 and `Back` MUST be option 6 (the final
|
|
132
|
+
two numbered options) per the #767 framework rule.
|
|
133
|
+
- ! The decision MUST be recorded in `COST-ESTIMATE.md` under
|
|
134
|
+
**Decision recorded** (decision, date, recorded-by, reason). The
|
|
135
|
+
reason field is REQUIRED for `rescope`, `no-build`, and `skip` (so
|
|
136
|
+
that the artifact's existence is auditable). The reason field is
|
|
137
|
+
optional for `build`.
|
|
138
|
+
- ! On `Rescope`, return the user to spec edits (chain back to
|
|
139
|
+
`skills/deft-directive-refinement/SKILL.md` to pull spec scope back,
|
|
140
|
+
or the interview), then re-run this skill from Phase 1.
|
|
141
|
+
- ! On `No-build`, write the decision to `COST-ESTIMATE.md`, mark the
|
|
142
|
+
spec scope vBRIEF accordingly, exit, and do NOT chain into the build
|
|
143
|
+
skill.
|
|
144
|
+
- ! On `Skip`, write the decision and skip reason to `COST-ESTIMATE.md`
|
|
145
|
+
and proceed to the build kickoff.
|
|
146
|
+
- ! On `Build`, write the decision to `COST-ESTIMATE.md` and proceed
|
|
147
|
+
to the build kickoff.
|
|
148
|
+
- ! On `Discuss`, take questions and re-show the same menu. Do NOT
|
|
149
|
+
proceed without an explicit choice from options 1-4.
|
|
150
|
+
- ! On `Back`, return to the spec / setup phase. Do NOT proceed without
|
|
151
|
+
re-running this skill.
|
|
152
|
+
- ⊗ Proceed to the build skill silently without surfacing the decision
|
|
153
|
+
point to the user.
|
|
154
|
+
|
|
155
|
+
## Output Targets
|
|
156
|
+
|
|
157
|
+
- ! `COST-ESTIMATE.md` (in the project root). Created by Phase 2 and
|
|
158
|
+
finalised in Phase 4 with the recorded decision.
|
|
159
|
+
- ~ Reference the artifact from `vbrief/PROJECT-DEFINITION.vbrief.json`
|
|
160
|
+
via a `references` entry of type `x-vbrief/spec-section` so future
|
|
161
|
+
agents discover the cost decision when re-reading the project
|
|
162
|
+
definition.
|
|
163
|
+
|
|
164
|
+
## Anti-Patterns
|
|
165
|
+
|
|
166
|
+
- ⊗ Quote single-point cost estimates -- always use loose plain-English
|
|
167
|
+
bands.
|
|
168
|
+
- ⊗ Use industry jargon (TCO, p50, FTE, OPEX vs CAPEX, etc.) in the
|
|
169
|
+
artifact or skill prose -- the audience is non-technical.
|
|
170
|
+
- ⊗ Skip the decision point -- the build skill MUST refuse kickoff
|
|
171
|
+
until the user has explicitly chosen build / rescope / no-build /
|
|
172
|
+
skip(+reason).
|
|
173
|
+
- ⊗ Hide the `Discuss` and `Back` options or place them at the top of
|
|
174
|
+
the menu -- they MUST be the final two numbered options per #767.
|
|
175
|
+
- ⊗ Generate `COST-ESTIMATE.md` and chain into build silently without
|
|
176
|
+
surfacing the decision point.
|
|
177
|
+
- ⊗ Skip the `Skip` reason -- if the user opts to skip the cost phase,
|
|
178
|
+
the reason MUST be recorded so the artifact's existence is auditable.
|
|
179
|
+
- ⊗ Cite live vendor pricing as a guarantee -- the artifact is a
|
|
180
|
+
snapshot; pricing changes over time.
|
|
181
|
+
- ⊗ Localise to non-USD currency in the first pass -- USD-only is the
|
|
182
|
+
contract; international users convert manually.
|
|
183
|
+
- ⊗ Promise a project will "definitely" stay within a band -- always
|
|
184
|
+
say "expected", "typical", or "in our estimate".
|
|
185
|
+
|
|
186
|
+
## EXIT
|
|
187
|
+
|
|
188
|
+
When the user makes a decision in Phase 4 and the decision is recorded
|
|
189
|
+
in `COST-ESTIMATE.md`:
|
|
190
|
+
|
|
191
|
+
- ! Confirm exit explicitly: `deft-directive-cost complete -- exiting skill.`
|
|
192
|
+
- ! State the next step based on the decision:
|
|
193
|
+
- `Build` or `Skip` -> chain into `skills/deft-directive-build/SKILL.md`
|
|
194
|
+
- `Rescope` -> chain into `skills/deft-directive-refinement/SKILL.md`
|
|
195
|
+
for targeted spec edits, then re-run this skill
|
|
196
|
+
- `No-build` -> exit; do NOT chain into build
|
|
197
|
+
- `Discuss` -> remain in this skill until the user picks 1-4
|
|
198
|
+
- `Back` -> chain back to the previous skill (spec / setup)
|
|
199
|
+
|
|
200
|
+
⊗ Exit this skill silently without confirming completion or providing
|
|
201
|
+
next-step instructions.
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: deft-directive-debug
|
|
3
|
+
description: >-
|
|
4
|
+
Systematic, evidence-based root-cause investigation. Use when the user asks
|
|
5
|
+
"why did X break / slow down / regress?", wants to debug a failure, run a
|
|
6
|
+
forensic investigation, or find the root cause of a bug -- to enter a
|
|
7
|
+
sustained investigation MODE with a claim ledger, mandatory falsification
|
|
8
|
+
before any conclusion, a chat answer-embargo until evidence closes, and a
|
|
9
|
+
deterministic validator gate. Triggers: "debug", "root cause",
|
|
10
|
+
"investigate", "why did X break", "why is X slow", "systematic debugging",
|
|
11
|
+
"forensic".
|
|
12
|
+
---
|
|
13
|
+
<!-- AUTO-GENERATED by task packs:render -- DO NOT EDIT MANUALLY -->
|
|
14
|
+
<!-- Purpose: rendered skill -->
|
|
15
|
+
<!-- Source of truth: packs/skills/skills-pack-0.1.json -->
|
|
16
|
+
<!-- Regenerate with: task packs:render -->
|
|
17
|
+
<!-- Edit the source, not this file. Slice instead of loading every SKILL.md: task packs:slice skills by-trigger --trigger <kw> (or list) -->
|
|
18
|
+
|
|
19
|
+
# Deft Directive Debug
|
|
20
|
+
|
|
21
|
+
Turns "why did X break / slow down?" into a disciplined investigation rather
|
|
22
|
+
than a guess-and-check loop. The coding standard this skill operationalizes is
|
|
23
|
+
`coding/debugging.md` (the Iron Law, four phases, evidence discipline). This
|
|
24
|
+
skill adds the sustained MODE, the claim ledger, falsification waves, and the
|
|
25
|
+
deterministic close gate.
|
|
26
|
+
|
|
27
|
+
Legend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.
|
|
28
|
+
|
|
29
|
+
The concrete reference design is vendored read-only under
|
|
30
|
+
`docs/reference/forensic-research/` -- read it for extended detail (orchestrator
|
|
31
|
+
protocol, sub-agent prompts, question framing, domain packs). This skill is the
|
|
32
|
+
directive-native, freshly-authored workflow; do not repurpose the vendored copy
|
|
33
|
+
as the live skill.
|
|
34
|
+
|
|
35
|
+
## When to Use
|
|
36
|
+
|
|
37
|
+
- The user asks "why did X break / regress / slow down?" and the cause is not
|
|
38
|
+
yet known with evidence.
|
|
39
|
+
- A bug needs root-cause analysis before a fix is written.
|
|
40
|
+
- An incident or production anomaly needs a disciplined, auditable investigation.
|
|
41
|
+
- ⊗ Do NOT use for known, trivially-fixed issues where the cause is already
|
|
42
|
+
proven -- the four-phase loop in `coding/debugging.md` suffices.
|
|
43
|
+
|
|
44
|
+
## The Iron Law
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
NO CONCLUSIONS WITHOUT EVIDENCE THAT CLOSES
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
- ! MUST NOT state a root cause in chat until the evidence supporting it closes
|
|
51
|
+
and the cheapest disproof has been attempted (the chat answer-embargo).
|
|
52
|
+
- ! Every factual claim cites evidence (file:line / log / metric / reproduction).
|
|
53
|
+
An uncited claim is a `[HYPOTHESIS]`, not a finding. See `coding/debugging.md`
|
|
54
|
+
`## Evidence Discipline`.
|
|
55
|
+
|
|
56
|
+
## Forensic MODE Contract
|
|
57
|
+
|
|
58
|
+
The investigation is a sustained posture across turns, not a one-shot answer.
|
|
59
|
+
|
|
60
|
+
- ! On entry, create an investigation directory `.tmp/investigations/<id>/`
|
|
61
|
+
(gitignored, ephemeral) and write the ledger `investigation.vbrief.json` from
|
|
62
|
+
`docs/reference/forensic-research/templates/investigation.vbrief.json`. Stamp
|
|
63
|
+
`plan.status = "running"`.
|
|
64
|
+
- ! While MODE is active, every turn appends evidence to the ledger before any
|
|
65
|
+
narrative. The ledger is the source of truth; chat is a view of it.
|
|
66
|
+
- ! On exit, the ledger MUST pass `task verify:investigation -- --ledger <path>`
|
|
67
|
+
(the close gate) BEFORE any root-cause conclusion is delivered. Set
|
|
68
|
+
`plan.status` to `completed` / `failed` and record the Outcome.
|
|
69
|
+
- ⊗ MUST NOT deliver a conclusion while `plan.status == "running"` or while the
|
|
70
|
+
validator reports hard failures.
|
|
71
|
+
|
|
72
|
+
## The Claim Ledger
|
|
73
|
+
|
|
74
|
+
The ledger is a thin vBRIEF 0.6 profile (`forensic-research-v1`):
|
|
75
|
+
|
|
76
|
+
- ! Top-level `plan.items[]` are **branches** (competing theories). Each branch's
|
|
77
|
+
child `items[]` are **claims** (testable assertions).
|
|
78
|
+
- ! Each claim carries `metadata.x-claim` with `evidenceRefs[]` (ids into
|
|
79
|
+
`plan.references[]`) and, when ruled out, a `ruledOutReason`.
|
|
80
|
+
- ! `plan.edges[]` of type `invalidates` link a falsified claim to the branch it
|
|
81
|
+
rules out -- a branch is ruled out ONLY by a falsified child claim, never by
|
|
82
|
+
"no evidence found".
|
|
83
|
+
- ! `metadata.x-investigation.wavesCompleted` records which waves ran.
|
|
84
|
+
|
|
85
|
+
## Investigation Waves
|
|
86
|
+
|
|
87
|
+
Run the waves in order. Each works solo (one agent) or parallel (sub-agents per
|
|
88
|
+
`docs/reference/forensic-research/references/orchestrator-protocol.md`).
|
|
89
|
+
|
|
90
|
+
1. ! **Frame** -- parse the operator question; split dual questions ("why slow AND
|
|
91
|
+
why errored") into separate branches. Reproduce the failure. Seed branches.
|
|
92
|
+
2. ! **Investigate branches** -- gather evidence at component boundaries; trace
|
|
93
|
+
data flow backward from the symptom. Promote claims with `evidenceRefs`.
|
|
94
|
+
3. ! **Falsify** -- for the leading theory, attempt the cheapest test that would
|
|
95
|
+
disprove it. A theory that survives a real disproof attempt is stronger than
|
|
96
|
+
one merely asserted. Record `wavesCompleted["3"] = true`.
|
|
97
|
+
4. ! **Red-team** -- adversarially review the surviving theory: config-is-not-code
|
|
98
|
+
checks, tautology checks, alternative mechanisms. Record
|
|
99
|
+
`wavesCompleted["4"] = true`.
|
|
100
|
+
5. ! **Synthesize** -- only after the close gate passes, write the Outcome.
|
|
101
|
+
|
|
102
|
+
- ⊗ MUST NOT skip waves 3 + 4. Skipping falsification + red-team is the #1
|
|
103
|
+
forensic-discipline failure; the close gate fails closed when either is missing.
|
|
104
|
+
|
|
105
|
+
## Fact vs Hypothesis Labeling
|
|
106
|
+
|
|
107
|
+
- ! Every finding is labeled **Fact** (observable, evidence-cited) or
|
|
108
|
+
**Hypothesis** (an interpretation that could be wrong). This is the
|
|
109
|
+
debugging-side adoption of the shared findings vocabulary owned by #1580.
|
|
110
|
+
|
|
111
|
+
## Outcome
|
|
112
|
+
|
|
113
|
+
When the close gate passes, write the Outcome from
|
|
114
|
+
`docs/reference/forensic-research/references/outcome-template.md`. It MUST include:
|
|
115
|
+
|
|
116
|
+
- ! The root-cause **mechanism** (not a tautology -- "slow because phase X took N
|
|
117
|
+
minutes" is not a mechanism; name *why* phase X took N minutes).
|
|
118
|
+
- ! For "why slow?" investigations, a "Why it was slow" section naming the
|
|
119
|
+
mechanism.
|
|
120
|
+
- ! An **Observability gaps** section: when the cause was reached by inference,
|
|
121
|
+
state what could not be measured and what to log/measure next time.
|
|
122
|
+
|
|
123
|
+
## Skill Completion Gate
|
|
124
|
+
|
|
125
|
+
! When the Outcome is delivered and the ledger has passed the close gate, confirm
|
|
126
|
+
exit unambiguously: "deft-directive-debug complete -- exiting skill." Then state
|
|
127
|
+
the next step (e.g. open a fix vBRIEF for the proven cause, or chain into
|
|
128
|
+
`skills/deft-directive-build/SKILL.md` to implement the fix).
|
|
129
|
+
|
|
130
|
+
⊗ Exit silently without confirming completion.
|
|
131
|
+
|
|
132
|
+
## Anti-Patterns
|
|
133
|
+
|
|
134
|
+
- ⊗ Delivering a conclusion before the close gate passes (breaks the answer-embargo)
|
|
135
|
+
- ⊗ Fixing before reproducing the failure
|
|
136
|
+
- ⊗ Marking a branch "ruled out" without an `invalidates` edge from a falsified claim
|
|
137
|
+
- ⊗ Presenting a duration or exit status as a root cause (tautology)
|
|
138
|
+
- ⊗ Inferring a runtime/config value from source code instead of proving it at runtime
|
|
139
|
+
- ⊗ Skipping the Falsify or Red-team wave under time pressure
|
|
140
|
+
- ⊗ Treating "no evidence found" as "ruled out" -- it resolves to `unknown`
|