@brunosps00/dev-workflow 2.2.0 → 2.4.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 (154) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +121 -0
  3. package/README.md +25 -15
  4. package/lib/constants.js +39 -36
  5. package/lib/doctor.js +1 -1
  6. package/lib/init.js +8 -0
  7. package/lib/instruction-health.js +38 -0
  8. package/lib/post-update.js +2 -1
  9. package/lib/validate.js +3 -1
  10. package/package.json +1 -1
  11. package/scaffold/agent-registry.json +17 -1
  12. package/scaffold/agents/core/dw-finding-refuter.md +55 -0
  13. package/scaffold/config/routing.json +61 -23
  14. package/scaffold/en/agent-instructions.md +32 -137
  15. package/scaffold/en/commands/dw-analyze-project.md +2 -0
  16. package/scaffold/en/commands/dw-autopilot.md +36 -241
  17. package/scaffold/en/commands/dw-brainstorm.md +1 -1
  18. package/scaffold/en/commands/dw-bugfix.md +10 -35
  19. package/scaffold/en/commands/dw-claude-run.md +47 -45
  20. package/scaffold/en/commands/dw-codex-run.md +48 -45
  21. package/scaffold/en/commands/dw-context-budget.md +6 -14
  22. package/scaffold/en/commands/dw-copilot-run.md +47 -41
  23. package/scaffold/en/commands/dw-find-skills.md +3 -1
  24. package/scaffold/en/commands/dw-generate-pr.md +2 -2
  25. package/scaffold/en/commands/dw-goal.md +25 -5
  26. package/scaffold/en/commands/dw-help.md +3 -3
  27. package/scaffold/en/commands/dw-install-aws-skills.md +2 -0
  28. package/scaffold/en/commands/dw-install-azure-skills.md +2 -0
  29. package/scaffold/en/commands/dw-plan.md +15 -8
  30. package/scaffold/en/commands/dw-qa.md +3 -0
  31. package/scaffold/en/commands/dw-resume.md +5 -11
  32. package/scaffold/en/commands/dw-review.md +154 -10
  33. package/scaffold/en/commands/dw-run.md +47 -177
  34. package/scaffold/en/commands/dw-secure-audit.md +4 -0
  35. package/scaffold/en/commands/dw-skill-health.md +39 -0
  36. package/scaffold/en/commands/dw-triage.md +8 -0
  37. package/scaffold/en/commands/dw-update.md +18 -4
  38. package/scaffold/en/references/automode.md +71 -0
  39. package/scaffold/en/references/command-routing.md +54 -0
  40. package/scaffold/en/references/execution-contract.md +55 -0
  41. package/scaffold/en/references/invariants.md +88 -0
  42. package/scaffold/en/references/untrusted-input.md +69 -0
  43. package/scaffold/en/templates/constitution-template.md +1 -0
  44. package/scaffold/en/templates/frontend-quality-template.md +43 -0
  45. package/scaffold/en/templates/task-template.md +20 -40
  46. package/scaffold/en/templates/tasks-template.md +9 -6
  47. package/scaffold/en/templates/techspec-template.md +4 -0
  48. package/scaffold/en/templates/triage-record-template.md +5 -0
  49. package/scaffold/pt-br/agent-instructions.md +32 -137
  50. package/scaffold/pt-br/commands/dw-analyze-project.md +3 -1
  51. package/scaffold/pt-br/commands/dw-autopilot.md +36 -241
  52. package/scaffold/pt-br/commands/dw-brainstorm.md +1 -1
  53. package/scaffold/pt-br/commands/dw-bugfix.md +10 -35
  54. package/scaffold/pt-br/commands/dw-claude-run.md +47 -46
  55. package/scaffold/pt-br/commands/dw-codex-run.md +48 -45
  56. package/scaffold/pt-br/commands/dw-context-budget.md +6 -14
  57. package/scaffold/pt-br/commands/dw-copilot-run.md +47 -43
  58. package/scaffold/pt-br/commands/dw-find-skills.md +3 -1
  59. package/scaffold/pt-br/commands/dw-generate-pr.md +2 -2
  60. package/scaffold/pt-br/commands/dw-goal.md +25 -5
  61. package/scaffold/pt-br/commands/dw-help.md +3 -3
  62. package/scaffold/pt-br/commands/dw-install-aws-skills.md +2 -0
  63. package/scaffold/pt-br/commands/dw-install-azure-skills.md +2 -0
  64. package/scaffold/pt-br/commands/dw-plan.md +15 -8
  65. package/scaffold/pt-br/commands/dw-qa.md +3 -0
  66. package/scaffold/pt-br/commands/dw-resume.md +7 -11
  67. package/scaffold/pt-br/commands/dw-review.md +154 -10
  68. package/scaffold/pt-br/commands/dw-run.md +47 -177
  69. package/scaffold/pt-br/commands/dw-secure-audit.md +5 -1
  70. package/scaffold/pt-br/commands/dw-skill-health.md +39 -0
  71. package/scaffold/pt-br/commands/dw-triage.md +8 -0
  72. package/scaffold/pt-br/commands/dw-update.md +18 -4
  73. package/scaffold/pt-br/references/automode.md +72 -0
  74. package/scaffold/pt-br/references/command-routing.md +54 -0
  75. package/scaffold/pt-br/references/execution-contract.md +55 -0
  76. package/scaffold/pt-br/references/invariants.md +88 -0
  77. package/scaffold/pt-br/references/untrusted-input.md +70 -0
  78. package/scaffold/pt-br/templates/constitution-template.md +1 -0
  79. package/scaffold/pt-br/templates/frontend-quality-template.md +43 -0
  80. package/scaffold/pt-br/templates/task-template.md +20 -40
  81. package/scaffold/pt-br/templates/tasks-template.md +9 -6
  82. package/scaffold/pt-br/templates/techspec-template.md +4 -0
  83. package/scaffold/pt-br/templates/triage-record-template.md +5 -0
  84. package/scaffold/scripts/hooks/git-guardrails.mjs +12 -0
  85. package/scaffold/scripts/hooks/session-cost.mjs +122 -7
  86. package/scaffold/scripts/lib/workflow-contract.mjs +101 -0
  87. package/scaffold/skill-registry.json +35 -23
  88. package/scaffold/skills/dw-chaos-engineering/SKILL.md +126 -0
  89. package/scaffold/skills/dw-chaos-engineering/references/vector-catalog.md +43 -0
  90. package/scaffold/skills/dw-cli-run/SKILL.md +39 -215
  91. package/scaffold/skills/dw-cli-run/references/dispatch-tuning.md +14 -72
  92. package/scaffold/skills/dw-codebase-intel/SKILL.md +5 -39
  93. package/scaffold/skills/dw-codebase-intel/agents/intel-updater.md +1 -1
  94. package/scaffold/skills/dw-codebase-intel/references/agents-detail.md +7 -0
  95. package/scaffold/skills/dw-codebase-intel/references/files-in-dw-intel-detail.md +16 -0
  96. package/scaffold/skills/dw-codebase-intel/references/how-dw-intel-reads-this-detail.md +12 -0
  97. package/scaffold/skills/dw-codebase-intel/references/how-to-compose-the-typical-flow-detail.md +11 -0
  98. package/scaffold/skills/dw-council/SKILL.md +2 -17
  99. package/scaffold/skills/dw-council/references/integration-with-other-dw-commands-detail.md +7 -0
  100. package/scaffold/skills/dw-council/references/phase-2-tensions-and-rebuttals-detail.md +15 -0
  101. package/scaffold/skills/dw-debug-protocol/references/six-step-triage.md +1 -0
  102. package/scaffold/skills/dw-domain-modeling/SKILL.md +1 -1
  103. package/scaffold/skills/dw-execute-phase/SKILL.md +12 -32
  104. package/scaffold/skills/dw-execute-phase/agents/executor.md +15 -252
  105. package/scaffold/skills/dw-execute-phase/agents/plan-checker.md +4 -207
  106. package/scaffold/skills/dw-execute-phase/references/atomic-commits.md +8 -18
  107. package/scaffold/skills/dw-execute-phase/references/de-sloppify-pass-optional-cleanup-task-detail.md +12 -0
  108. package/scaffold/skills/dw-execute-phase/references/deviation-rules-during-execution-detail.md +8 -0
  109. package/scaffold/skills/dw-execute-phase/references/how-the-two-agents-compose-detail.md +7 -0
  110. package/scaffold/skills/dw-execute-phase/references/plan-verification.md +9 -155
  111. package/scaffold/skills/dw-execute-phase/references/wave-coordination.md +6 -97
  112. package/scaffold/skills/dw-git-discipline/SKILL.md +2 -2
  113. package/scaffold/skills/dw-grilling/SKILL.md +1 -1
  114. package/scaffold/skills/dw-incident-response/SKILL.md +1 -64
  115. package/scaffold/skills/dw-incident-response/references/the-five-phases-detail.md +66 -0
  116. package/scaffold/skills/dw-llm-eval/SKILL.md +6 -53
  117. package/scaffold/skills/dw-llm-eval/references/agent-tool-use-evaluation-detail.md +23 -0
  118. package/scaffold/skills/dw-llm-eval/references/anti-patterns-will-block-in-dw-review-code-only-detail.md +9 -0
  119. package/scaffold/skills/dw-llm-eval/references/bounded-decisions.md +76 -0
  120. package/scaffold/skills/dw-llm-eval/references/consistency-run-to-run-stability-detail.md +10 -0
  121. package/scaffold/skills/dw-llm-eval/references/integration-with-dev-workflow-commands-detail.md +6 -0
  122. package/scaffold/skills/dw-llm-eval/references/judge-calibration.md +5 -0
  123. package/scaffold/skills/dw-llm-eval/references/the-oracle-ladder-detail.md +15 -0
  124. package/scaffold/skills/dw-memory/SKILL.md +4 -50
  125. package/scaffold/skills/dw-memory/references/context-budget.md +8 -56
  126. package/scaffold/skills/dw-memory/references/promotion-decision-test-detail.md +30 -0
  127. package/scaffold/skills/dw-minimalism/SKILL.md +4 -5
  128. package/scaffold/skills/dw-review-rigor/SKILL.md +31 -88
  129. package/scaffold/skills/dw-review-rigor/references/composition-audit.md +160 -0
  130. package/scaffold/skills/dw-review-rigor/references/refutation-pass.md +124 -0
  131. package/scaffold/skills/dw-review-rigor/references/the-five-rules-detail.md +56 -0
  132. package/scaffold/skills/dw-simplification/SKILL.md +2 -55
  133. package/scaffold/skills/dw-simplification/references/pattern-recognition-detail.md +11 -0
  134. package/scaffold/skills/dw-simplification/references/the-five-rules-detail.md +48 -0
  135. package/scaffold/skills/dw-source-grounding/SKILL.md +21 -56
  136. package/scaffold/skills/dw-source-grounding/references/the-protocol-detect-fetch-implement-cite-detail.md +58 -0
  137. package/scaffold/skills/dw-testing-discipline/SKILL.md +25 -177
  138. package/scaffold/skills/dw-testing-discipline/references/agent-guardrails.md +9 -167
  139. package/scaffold/skills/dw-testing-discipline/references/core-rules.md +3 -3
  140. package/scaffold/skills/dw-testing-discipline/references/mutation-testing.md +19 -0
  141. package/scaffold/skills/dw-testing-discipline/references/patterns.md +3 -12
  142. package/scaffold/skills/dw-ui-discipline/SKILL.md +2 -59
  143. package/scaffold/skills/dw-ui-discipline/references/frontend-engineering.md +46 -0
  144. package/scaffold/skills/dw-ui-discipline/references/the-four-grounding-questions-detail.md +61 -0
  145. package/scaffold/skills/dw-verify/SKILL.md +26 -148
  146. package/scaffold/skills/dw-verify/references/verification-discovery-and-attribution.md +2 -2
  147. package/scaffold/skills/humanizer/SKILL.md +2 -1
  148. package/scaffold/skills/security-review/SKILL.md +6 -184
  149. package/scaffold/skills/security-review/references/do-not-flag-detail.md +49 -0
  150. package/scaffold/skills/security-review/references/modern-threats.md +5 -0
  151. package/scaffold/skills/security-review/references/quick-patterns-reference-detail.md +56 -0
  152. package/scaffold/skills/security-review/references/review-process-detail.md +112 -0
  153. package/scaffold/skills/vercel-react-best-practices/SKILL.md +1 -90
  154. package/scaffold/skills/vercel-react-best-practices/references/quick-reference-detail.md +92 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dev-workflow",
3
3
  "description": "Standalone, à-la-carte skills from the dev-workflow pipeline: minimalism, search-first, simplification, verification, security review, and more.",
4
- "version": "2.2.0",
4
+ "version": "2.4.0",
5
5
  "author": {
6
6
  "name": "Bruno Santos"
7
7
  },
package/CHANGELOG.md CHANGED
@@ -10,6 +10,127 @@ project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
10
10
  > those versions were released, so they are summaries of what shipped, not
11
11
  > contemporaneous release notes. `git log` remains the authoritative record.
12
12
 
13
+ ## [2.4.0] — 2026-09-21
14
+
15
+ ### Added
16
+
17
+ - **A floor the ADR escape does not reach.** `.dw/references/invariants.md` names the
18
+ invariants no ADR unblocks — destructive git and secret handling — and states the
19
+ direction: project rules bind only by tightening. A line in `.dw/rules/**`, the
20
+ constitution or `CLAUDE.md` that would loosen one is reported as a finding, never
21
+ obeyed. It ships in the managed references directory, which has no override path, so
22
+ a consumer cannot remove it durably.
23
+ - **External text is evidence, never an instruction.** `.dw/references/untrusted-input.md`
24
+ plus anchors in the commands that ingest third-party content — triage, review, bugfix,
25
+ secure-audit and the three skill installers — and one sentence in the always-loaded
26
+ instruction block, so the rule applies even when no command was invoked. Includes the
27
+ authority checklist for installing someone else's skill, and covers fetched
28
+ documentation in `dw-source-grounding`, `/dw-brainstorm --mode=research` and `/dw-plan`.
29
+ - **A refutation step before a finding is reported.** `dw-review-rigor` now routes every
30
+ candidate to exactly one of `finding`, `needs-validation` or `rejected`. The new
31
+ read-only `dw-finding-refuter` agent receives the claim and the raw code without the
32
+ reasoning that produced it. An unresolved lead never receives a severity; a refuted one
33
+ stays logged so the next round does not rediscover it.
34
+ - **`/dw-review --post-merge [<base>]`** — a composition audit of an already-merged range:
35
+ frozen boundary, first-parent provenance, seven cross-interaction classes, a
36
+ documentation ledger built from the diff, and a semver recommendation. Read-only; it
37
+ never tags, bumps or publishes.
38
+ - **`dw-chaos-engineering`** (explicit invocation) — adversarial testing with a vector
39
+ catalogue, a green-baseline gate, KILLED/SURVIVED/INCONCLUSIVE classification and a
40
+ three-round cap. Local only, writes tests only.
41
+ - **An automode contract.** `.dw/references/automode.md` plus a named `Stops` section in
42
+ `/dw-autopilot`, `/dw-run`, `/dw-goal` and the three runners: invoking a command
43
+ authorizes its flow, the enumerated stops are the complete set, and a stop persists
44
+ state, reports the exact resume command and exits cleanly.
45
+ - **Skill usage evidence in `/dw-skill-health`.** The SessionEnd cost hook now records
46
+ which skills a session's tool calls referenced, in the file it already wrote. Missing
47
+ telemetry is reported as missing, never as disuse.
48
+ - **Bounded-decision guidance in `dw-llm-eval`**, including the distinction our judge
49
+ calibration never made explicit: Spearman ≥0.80 is rank agreement, not probability
50
+ calibration.
51
+ - **`evals/`** — a behavioural battery for this repository's own skills, run against fresh
52
+ sub-agents at a declared model tier. Versioned in git, excluded from the package.
53
+
54
+ ### Changed
55
+
56
+ - **No bundled command carries the invocation lock any more.** `dw-open-design`,
57
+ `dw-claude-run`, `dw-copilot-run` and the three `dw-subtask-*` join `dw-codex-run`.
58
+ After an update the model may fire these directly where it previously could not. The
59
+ lock is not an authorization gate: where approval already exists upstream it only made
60
+ the user retype a command they had authorized. The runners' real gates are unchanged —
61
+ dedicated worktree, never the main checkout, never a merge, dual evaluation and the STOP
62
+ at the gate.
63
+ - `security-review`'s fp-check gains a third verdict: reachability that cannot be
64
+ established either way is `needs-validation`, with no severity, rather than drifting into
65
+ blocking or advisory.
66
+ - A candidate whose deciding environment is unavailable stays unresolved instead of being
67
+ promoted or dropped.
68
+
69
+ ### Fixed
70
+
71
+ - `dw-review-rigor` pointed prior-round awareness at `.dw/spec/prd-*/reviews/`, a directory
72
+ no command has ever written. Reviews live in `<target>/QA/` and `<target>/review/`.
73
+ - `<AUDIT>` was referenced nine times across the runners without ever being resolved. It is
74
+ `.dw/cli-run`, which `init` has been creating all along.
75
+ - `autopilot-state.json` had no directory anywhere in the repository. It is
76
+ `.dw/autopilot-state.json`.
77
+ - The constitution installer printed "All 10 principles start at `severity: info`". The
78
+ template has eleven, and two ship at `high`.
79
+ - `security-review` appeared twice in `/dw-review`'s complementary skills.
80
+ - The git guardrails hook now also denies `filter-branch`, `reflog expire`, `gc --prune`,
81
+ `stash drop`, `stash clear`, `branch -M` and `update-ref -d`. `rebase` and
82
+ `commit --amend` are deliberately left out — routine on unpushed work, and a command line
83
+ cannot tell pushed from unpushed.
84
+ - The ecosystem comparison's title and attribution chain: the adversarial-verification
85
+ model originates in `cloudflare/security-audit-skill` (MIT) and reached this project
86
+ through `akitaonrails/my-skills`.
87
+
88
+ ## [2.3.0] — 2026-09-09
89
+
90
+ ### Added
91
+
92
+ - Task execution contracts with per-task tool, model, effort, agent and fallback
93
+ choices, dependency validation and persistent execution state. Schema 1.0 plans
94
+ remain supported with local execution defaults.
95
+ - Instruction size and routed-reference validation in `npm run validate`, with
96
+ regression tests for missing resources and byte/discovery budget violations.
97
+ - Frontend engineering guidance and EN/PT-BR quality baseline templates integrated
98
+ into project analysis, planning, review and QA. Controls cover API contracts,
99
+ types, import boundaries, code reachability, duplication and gradual CI adoption.
100
+ - Scoped mutation-testing guidance that investigates behavioral gaps and cache
101
+ validity without introducing a universal score threshold.
102
+ - Managed `routing-defaults.json` for comparing current model candidates while
103
+ preserving owner routing. Upgrade checks cover legacy plans and template overrides.
104
+
105
+ ### Changed
106
+
107
+ - Approved implementation plans continue through execution, correction and
108
+ validation without a mandatory second invocation. Publication remains subject
109
+ to the user's authorization.
110
+ - Claude, Codex and Copilot runner instructions use approved task assignments,
111
+ explicit session identity and parent review. New-install model routing defaults
112
+ are updated; existing owner configuration is preserved.
113
+ - Installed root instructions are approximately 62% smaller. Detailed command
114
+ routing and conditional skill procedures move into references loaded as needed.
115
+ - Verification reuses inspectable passing evidence only while command, inputs,
116
+ environment and scope remain equivalent. Required project checks still apply.
117
+ - Planning and testing guidance favors behavior and risk over fixed task/file
118
+ quotas, blanket parallelism, universal coverage targets and score-only approval.
119
+
120
+ ### Fixed
121
+
122
+ - Resume guidance preserves partial work and avoids blind latest-session recovery
123
+ or destructive retries. Dependent tasks retain a coherent worktree history.
124
+ - Removed contradictory mutation-testing guidance and aligned EN/PT-BR review,
125
+ goal and resume behavior with the continuous execution contract.
126
+ - Humanizer's upstream version is preserved under supported skill metadata.
127
+ - `/dw-update` reads installed versions from `.dw/install-state.json` instead of
128
+ resolving an npm package that may only exist in the `npx` execution environment.
129
+
130
+ Validation: 129 tests pass; registry, instruction and plugin checks pass.
131
+ Install/update and package checks include the new resources. External provider
132
+ dispatches and frontend analysis tools were not exercised against live projects.
133
+
13
134
  ## [2.2.0] — 2026-08-24
14
135
 
15
136
  Release driven by two operational failures observed on a real project, both of the
package/README.md CHANGED
@@ -42,13 +42,13 @@ Exportable skills (no `.dw/` pipeline required): `dw-minimalism`, `dw-search-fir
42
42
 
43
43
  ## Commands
44
44
 
45
- dev-workflow v2.2.0 ships **41 commands** organized into four tiers. Most users only invoke Tier 1 + Tier 2.
45
+ dev-workflow v2.3.0 ships **41 commands** organized into four tiers. Most users only invoke Tier 1 + Tier 2.
46
46
 
47
47
  ### Tier 1 — Gateway (4)
48
48
 
49
49
  | Command | When |
50
50
  |---------|------|
51
- | **`/dw-autopilot "wish"`** | Default entry point in two invocations. First run completes PRD → TechSpec → Tasks and stops. Second run resumes from state, executes `/dw-goal --from-autopilot <slug>` for Run → Review → QA/Fix → Review, then Security Gate → Commit → PR. |
51
+ | **`/dw-autopilot "wish"`** | Plan and approve task execution assignments, then continue through implementation, review and validation. Cross-tool workers return to the parent; merge/push/publication follow existing authorization. |
52
52
  | **`/dw-bugfix "description"`** | A bug report or pasted error. Triages bug-vs-feature-vs-scope, surgical fix or routes to a PRD. |
53
53
  | **`/dw-triage [item]`** | An external bug report, feature request, or PR. Checks whether it already exists and whether it was rejected before, verifies the claim, then routes to `/dw-bugfix`, `/dw-plan prd`, or `/dw-brainstorm --mode=grill`. Local-first in `.dw/triage/`; works with no network and no `gh`. |
54
54
  | **`/dw-help [keyword]`** | Discover commands. Pass a keyword for shortcuts; `--advanced` reveals internal commands. |
@@ -63,7 +63,7 @@ Use these when you want step-by-step control instead of `/dw-autopilot`.
63
63
  | **`/dw-brainstorm "idea"`** | Refine a concrete idea before PRD. Flags: `--onepager` (durable artifact), `--council` (multi-advisor debate), `--research` (multi-source cited research). |
64
64
  | **`/dw-plan "feature"`** | PRD → TechSpec → Tasks sequentially with checkpoints. Stages: `prd`, `techspec`, `tasks`. Mandatory clarification questions, source-grounding, constitution gate, final consistency check. |
65
65
  | **`/dw-run [task-id]`** | Execute tasks. Default: all pending in dependency order with wave-based parallel dispatch. Single-task: pass an ID. `--resume` continues an interrupted plan. |
66
- | **`/dw-review`** | Level 2 (PRD coverage mapping) + Level 3 (code quality). Hard gates on dw-verify PASS, secure-audit, constitution violations. Flags: `--coverage-only`, `--code-only`, `--bugfix <slug>` (review a bugfix at `.dw/bugfixes/<slug>/`), `--since <ref>` (ad-hoc review from a verified comparison point). |
66
+ | **`/dw-review`** | Level 2 (PRD coverage mapping) + Level 3 (code quality). Hard gates on dw-verify PASS, secure-audit, constitution violations. Every candidate finding passes a refutation step before it is reported; an unresolved lead becomes `needs-validation` with no severity, and a refuted one stays logged. Flags: `--coverage-only`, `--code-only`, `--bugfix <slug>` (review a bugfix at `.dw/bugfixes/<slug>/`), `--since <ref>` (ad-hoc review from a verified comparison point), `--post-merge [<base>]` (composition audit of an already-merged range — cross-PR interaction, documentation ledger, semver recommendation; never tags or publishes). |
67
67
  | **`/dw-qa`** | Mode-aware QA. Auto-detects UI vs API. Flags: `--fix` (iterative QA + fix-retest loop), `--api`, `--ai` (AI eval against reference dataset), `--uat` (human-in-the-loop walkthrough), `--bugfix <slug>` (QA a bugfix). |
68
68
  | **`/dw-pause`** | Consolidate the current session's mental state into `.dw/STATE.md` (Decisions, Blockers, Todos, Deferred, Lessons, Open Loops). Used before long breaks or context-window compactions. |
69
69
  | **`/dw-resume`** | Read `.dw/STATE.md`, present a TLDR of where work left off, and suggest the next `dw-*` command. Never auto-executes. |
@@ -82,7 +82,7 @@ Use these when you want step-by-step control instead of `/dw-autopilot`.
82
82
  | **`/dw-functional-doc`** | Maps screens + user flows into a functional doc, validated end-to-end with Playwright. Uses the WSL-resilient browser resolver and can capture guided functional video evidence. |
83
83
  | **`/dw-context-budget`** | Audits context overhead from commands, skills, agents, instruction files, and MCPs. |
84
84
  | **`/dw-harness-audit`** | Deterministic health scorecard for the dev-workflow install, agents, wrappers, MCPs, and gates. |
85
- | **`/dw-skill-health`** | Audits installed skills and agents for bloat, duplication, and missing references. |
85
+ | **`/dw-skill-health`** | Audits installed skills and agents for bloat, duplication, and missing references, plus usage evidence: which installed skills have not fired inside a declared, observed window. Missing telemetry is reported as missing, never as disuse. |
86
86
  | **`/dw-worktree <list\|create\|clean\|merge>`** | Lifecycle of delegation worktrees (`../<project>-<slug>`): `create` runs install/build prep so a delegate never works blind; `list` gives every worktree a verdict (`REMOVABLE`, `KEEP:unmerged`, `KEEP:dirty`, `KEEP:in-use`); `clean` removes only proven-merged-and-clean ones (dry-run by default, `--apply` to execute); `merge` does the safe order from the main checkout (ff-only → remove → branch delete → prune). Never `--force`. Backed by `.dw/scripts/lib/worktree-gc.mjs`; auto-used by the CLI runners, `/dw-pause`, and `/dw-harness-audit`. |
87
87
  | **`/dw-learn`** | Synthesizes durable decisions (confidence-tagged), bugfixes, deviations, and git history into atomic confidence-weighted **instincts** you approve at `.dw/memory/instincts/`; can propose constitution principles. On-demand and human-in-the-loop — **no always-on observer**. |
88
88
  | **`/dw-new-project`** | Bootstrap a new project from an empty or docs-first directory while preserving existing documentation and prototypes. Stack interview includes Next.js + NestJS, Postgres, pg-boss, Mailpit, dev topology, and wraps official `create-*` tools before composing dev infrastructure, `.env`, scripts, CI, and `.dw/rules/`. |
@@ -100,9 +100,9 @@ These are auto-invoked by Tier 1-3 commands. Available standalone via `/dw-help
100
100
  | **`/dw-intel "question"`** | Query codebase intelligence (`.dw/intel/`). `--build` (re)creates the index. | `/dw-plan`, `/dw-review`, `/dw-bugfix` |
101
101
  | **`/dw-secure-audit`** | **Security Gate** (phase after review/QA, before commit/PR): OWASP + Semgrep SAST (diff/generated code) + gitleaks secrets + Trivy SCA/IaC + lockfile + supply-chain + outdated. Rigoroso: secrets/CRITICAL/HIGH block (secrets have no ADR escape). Flags: `--scan-only`, `--plan`, `--execute`. See [docs/security-gate.md](docs/security-gate.md). | `/dw-review`, `/dw-autopilot` (explicit step), enforced by `/dw-generate-pr` |
102
102
  | **`/dw-goal "<objective>"`** | Durable objective contract. Uses Codex native `/goal` when available and `.dw/goals/` everywhere for Codex, Copilot, Claude Code, and OpenCode. | `/dw-autopilot` after planning |
103
- | **`/dw-claude-run`** | Fire `claude -p` (headless) in a dedicated git worktree to implement a prepared prompt/spec. Claude adapter over the `dw-cli-run` protocol: durable audit log, resumable session via `--session-id`, 0–10 dual evaluation, STOP for the gate. Never the main checkout; never merges. | manual delegation step |
104
- | **`/dw-codex-run`** | Fire `codex exec` in a dedicated git worktree to implement a prepared prompt/spec. Codex adapter over the `dw-cli-run` protocol: durable audit log, resumable per-task session, 0–10 dual evaluation, STOP for the gate. Never the main checkout; never merges. | manual delegation step |
105
- | **`/dw-copilot-run`** | Fire `copilot -p` (GitHub Copilot CLI) in a dedicated git worktree to implement a prepared prompt/spec. Copilot adapter over the `dw-cli-run` protocol: durable audit log, resumable session, 0–10 dual evaluation, STOP for the gate. Never the main checkout; never merges. | manual delegation step |
103
+ | **`/dw-claude-run`** | Fire `claude -p` (headless) in a dedicated git worktree to implement a prepared prompt/spec. Claude adapter over the `dw-cli-run` protocol: durable audit log, resumable session via `--session-id`, 0–10 dual evaluation, STOP for the gate. Never the main checkout; never merges. | `/dw-plan tasks` cross-tool assignment, once approved; or manually |
104
+ | **`/dw-codex-run`** | Fire `codex exec` in a dedicated git worktree to implement a prepared prompt/spec. Codex adapter over the `dw-cli-run` protocol: durable audit log, resumable per-task session, 0–10 dual evaluation, STOP for the gate. Never the main checkout; never merges. | `/dw-plan tasks` cross-tool assignment, once approved; or manually |
105
+ | **`/dw-copilot-run`** | Fire `copilot -p` (GitHub Copilot CLI) in a dedicated git worktree to implement a prepared prompt/spec. Copilot adapter over the `dw-cli-run` protocol: durable audit log, resumable session, 0–10 dual evaluation, STOP for the gate. Never the main checkout; never merges. | `/dw-plan tasks` cross-tool assignment, once approved; or manually |
106
106
  | **`/dw-find-skills "query"`** | Searches `npx skills` ecosystem, vets, installs. | manual when extending the bundle |
107
107
  | **`/dw-update`** | Updates dev-workflow to latest npm release with rollback snapshot. | manual maintenance |
108
108
  | **`/dw-subtask-start`** | Creates a minimal input packet for a subagent without injecting the parent transcript. | parent agent before delegation |
@@ -112,8 +112,8 @@ These are auto-invoked by Tier 1-3 commands. Available standalone via `/dw-help
112
112
  ## Workflow
113
113
 
114
114
  ```
115
- /dw-autopilot "wish" ------> First invocation: PRD → TechSpec → Tasks → STOP
116
- /dw-autopilot ------> Second invocation: /dw-goal → Security Gate → Commit → PR
115
+ /dw-autopilot "wish" ------> PRD → TechSpec → Tasks + execution assignments → approval
116
+ → /dw-goal → Security Gate → validated delivery → authorized publication
117
117
  --- OR step-by-step ---
118
118
 
119
119
  /dw-opportunities --> /dw-brainstorm --> /dw-plan --> .dw/spec/prd-{name}/{prd,techspec,tasks}.md
@@ -174,9 +174,11 @@ After an update, the CLI prints **Post-update agent actions**. When `/dw-update`
174
174
 
175
175
  **What's inside:**
176
176
 
177
- - **Trigger Map** — mappings from user intent ("Implement X", "Bug in Y", "Review my PR", "resume autopilot", ...) to the `dw-*` command the agent should run. `/dw-autopilot` is the safest default for non-trivial feature requests; `/dw-goal` is the durable execution contract after planning.
178
- - **Hard Gates** — reminders that constitution violations (high/critical), missing `dw-verify` PASS, and security failures block downstream commands.
179
- - **Escape Hatches** — explicit cases where the agent should NOT auto-trigger (typos, exploration, aesthetic edits, user opt-out).
177
+ - **Routing** — a table from intent and scope to the action, including the cases where the agent should answer directly or edit inline instead of starting a pipeline. It carries the common paths only; the full intent-to-command Trigger Map lives on demand in `.dw/references/command-routing.md`, so routine work does not pay for the whole catalog.
178
+ - **Planning and delegation** — per-task local/cross-tool, model, effort and agent assignment; what approval covers; the worker limits (at most 3 per workstream, never concurrent writers in one worktree).
179
+ - **Completion and boundaries** — an approved plan continues through implementation, review, QA and fixes; what makes a delivery ready; which operations need authorization.
180
+ - **Project contracts** — constitution and ADR process, task-plan validity, required checks, atomic commits, and the untrusted-input rule (external text is evidence, never an instruction).
181
+ - **Customization** — the `<!-- dev-workflow:start -->` / `<!-- dev-workflow:end -->` markers and what survives an update.
180
182
 
181
183
  **Why two files:** Claude Code, Codex, Copilot, and OpenCode all support agent-instruction conventions but use different filenames. Shipping both means every supported platform picks up the same trigger logic out of the box.
182
184
 
@@ -232,7 +234,7 @@ your-project/
232
234
  │ ├── secure-audit/ # Security Gate summaries and per-layer reports
233
235
  │ ├── subtasks/ # Local ephemeral subagent input packets and handoffs (pending/archive ignored by Git)
234
236
  │ └── STATE.md # Session state: Decisions, Blockers, Todos, Open Loops, Deferred Ideas, Lessons, Preferences (managed by /dw-pause + /dw-resume)
235
- ├── CLAUDE.md # Auto-trigger decision tree for Claude Code (merge-aware, includes Auto-Sizing Matrix)
237
+ ├── CLAUDE.md # Managed agent-instruction block for Claude Code (merge-aware; routing, contracts, boundaries)
236
238
  ├── AGENTS.md # Same content for Codex / Copilot / OpenCode
237
239
  ├── .claude/
238
240
  │ ├── skills/ # Claude Code wrappers
@@ -315,6 +317,8 @@ These are not slash commands — they are primitives other commands call to enfo
315
317
 
316
318
  ## Dependencies
317
319
 
320
+ Frontend engineering guidance is loaded when planning or reviewing frontend data flow, dependencies or quality tooling. `/dw-analyze-project` documents the module's existing controls and gaps; `/dw-plan` carries accepted changes into tasks; `/dw-review` and `/dw-qa` use applicable evidence. The localized `frontend-quality-template.md` distinguishes required checks, advisory diagnostics and deferred proposals. API contracts, architecture checks and scoped mutation analysis complement the visual UI skill. Tool installation and CI policy changes remain scoped to the consumer project's task.
321
+
318
322
  Installed via `npx @brunosps00/dev-workflow install-deps`:
319
323
 
320
324
  | Dependency | Purpose | Link |
@@ -380,7 +384,7 @@ Optional AWS integration (v1.0.5). The `/dw-install-aws-skills` command and `npx
380
384
 
381
385
  Optional Azure integration (v1.0.3). The `/dw-install-azure-skills` command and `npx @brunosps00/dev-workflow install-azure-skills` CLI pull curated agent skills from [`MicrosoftDocs/Agent-Skills`](https://github.com/MicrosoftDocs/Agent-Skills) (CC-BY-4.0, by Microsoft) into `.agents/skills/azure/` and register the [Microsoft Learn MCP Server](https://learn.microsoft.com/en-us/training/support/mcp-get-started) (HTTP endpoint, no authentication required) into `.claude/settings.json`. The MCP server exposes three tools — `microsoft_docs_search`, `microsoft_docs_fetch`, `microsoft_code_sample_search` — that give the agent live access to Microsoft Learn documentation. **Not installed by default**: `init` and `update` do not touch `.agents/skills/azure/` or register the MCP. Users explicitly invoke the command when they begin Azure-focused work. The 10 categories (Compute, Data & Storage, AI & ML, Networking, Identity & Security, DevOps, Observability, Integration, Architecture, All) are dev-workflow's curated grouping over the 200+ skills in the upstream repo; the `--products=<csv>` flag lets advanced users pick individual services. Re-running the command refreshes from upstream; `dev-workflow update` deliberately does not touch these external skills so the Microsoft upstream release cadence is decoupled from the dev-workflow npm release cadence. Skills are copied verbatim from the upstream repo (CC-BY-4.0 permits this with attribution); the agent-facing `.dw/references/azure-mcp-instructions.md` is a clean-room adaptation of Microsoft's "Set instructions" guidance.
382
386
 
383
- Session continuity and adaptive routing patterns adapted from [`tech-leads-club/agent-skills/tlc-spec-driven`](https://github.com/tech-leads-club/agent-skills/tree/main/packages/skills-catalog/skills/(development)/tlc-spec-driven) by Felipe Rodrigues (CC-BY-4.0, v1.0.2). Eight patterns were absorbed selectively after a comparative analysis confirmed that the majority of the skill duplicates existing dev-workflow capabilities (PRD/TechSpec/Tasks pipeline, constitution discipline, source-grounding, two-tier memory, verify-before-complete, brownfield mapping, sub-agent delegation, atomic commits). Patterns adopted: (1) `STATE.md` cross-session working memory at `.dw/STATE.md` + new `/dw-pause` and `/dw-resume` commands; (2) Auto-Sizing Matrix (Small/Medium/Large/Complex) formalized in `CLAUDE.md`/`AGENTS.md` above the Trigger Map; (3) Concerns Map (`.dw/rules/concerns.md`) generated by a new Step 9 in `/dw-analyze-project` and consumed on-demand by `/dw-plan`, `/dw-run`, and `/dw-bugfix`; (4) Context Budget discipline as a new section in `dw-memory` with reference `dw-memory/references/context-budget.md`; (5) Interactive UAT walkthrough as `/dw-qa --uat`; (6) Quick-mode persistence — bugfixes now land in `.dw/bugfixes/NNN-<slug>/{TASK.md, SUMMARY.md, fix-report.md}` and remain queryable via `/dw-intel`; (7) Safety valve in `/dw-bugfix` Step 5.0 that forces escalation to `/dw-plan` when scope exceeds 5 tasks or has cross-dependencies; (8) Cross-skill awareness — `/dw-intel --build` now indexes `.dw/bugfixes/*/SUMMARY.md` into `bugfixes.json`, and `dw-codebase-intel` documents the new `bugfix-history` and `risk-area` query shapes. Patterns explicitly REJECTED: `.specs/` directory structure (dev-workflow uses `.dw/`), Knowledge Verification Chain (already covered by `dw-source-grounding`), Specify/Design/Tasks/Execute naming (dev-workflow keeps PRD/TechSpec/Tasks/Run), Skill Integrations pattern with mermaid-studio/codenavi delegation, and literal text copying (everything is clean-room reimplementation from the conceptual patterns; CC-BY-4.0 attribution is for derivative ideas, not borrowed prose).
387
+ Session continuity and adaptive routing patterns adapted from [`tech-leads-club/agent-skills/tlc-spec-driven`](https://github.com/tech-leads-club/agent-skills/tree/main/packages/skills-catalog/skills/(development)/tlc-spec-driven) by Felipe Rodrigues (CC-BY-4.0, v1.0.2). Eight patterns were absorbed selectively after a comparative analysis confirmed that the majority of the skill duplicates existing dev-workflow capabilities (PRD/TechSpec/Tasks pipeline, constitution discipline, source-grounding, two-tier memory, verify-before-complete, brownfield mapping, sub-agent delegation, atomic commits). Patterns adopted: (1) `STATE.md` cross-session working memory at `.dw/STATE.md` + new `/dw-pause` and `/dw-resume` commands; (2) Auto-Sizing Matrix (Small/Medium/Large/Complex), formalized in `CLAUDE.md`/`AGENTS.md` at the time and **since removed** — the managed block now routes on intent and scope instead of a size bracket, and the fixed matrix was dropped when the block was compacted; (3) Concerns Map (`.dw/rules/concerns.md`) generated by a new Step 9 in `/dw-analyze-project` and consumed on-demand by `/dw-plan`, `/dw-run`, and `/dw-bugfix`; (4) Context Budget discipline as a new section in `dw-memory` with reference `dw-memory/references/context-budget.md`; (5) Interactive UAT walkthrough as `/dw-qa --uat`; (6) Quick-mode persistence — bugfixes now land in `.dw/bugfixes/NNN-<slug>/{TASK.md, SUMMARY.md, fix-report.md}` and remain queryable via `/dw-intel`; (7) Safety valve in `/dw-bugfix` Step 5.0 that forces escalation to `/dw-plan` when scope exceeds 5 tasks or has cross-dependencies; (8) Cross-skill awareness — `/dw-intel --build` now indexes `.dw/bugfixes/*/SUMMARY.md` into `bugfixes.json`, and `dw-codebase-intel` documents the new `bugfix-history` and `risk-area` query shapes. Patterns explicitly REJECTED: `.specs/` directory structure (dev-workflow uses `.dw/`), Knowledge Verification Chain (already covered by `dw-source-grounding`), Specify/Design/Tasks/Execute naming (dev-workflow keeps PRD/TechSpec/Tasks/Run), Skill Integrations pattern with mermaid-studio/codenavi delegation, and literal text copying (everything is clean-room reimplementation from the conceptual patterns; CC-BY-4.0 attribution is for derivative ideas, not borrowed prose).
384
388
 
385
389
  Patterns from [`mattpocock/skills`](https://github.com/mattpocock/skills) by Matt Pocock (MIT) were integrated **without adding any new public command** (the public command count is unchanged): (1) **grill** — a native, stateful alignment session reimplemented (clean-room, no upstream prose copied) from [`skills/engineering/grill-with-docs`](https://github.com/mattpocock/skills/blob/main/skills/engineering/grill-with-docs/SKILL.md), [`skills/productivity/grilling`](https://github.com/mattpocock/skills/blob/main/skills/productivity/grilling/SKILL.md), and [`skills/engineering/domain-modeling`](https://github.com/mattpocock/skills/blob/main/skills/engineering/domain-modeling/SKILL.md). It is the `/dw-brainstorm` `grill` mode, backed by two **internal, non-exported** bundled skills — `dw-grilling` (dependency-ordered decision-tree interview, one decision per turn with a recommended answer, facts looked up rather than asked, shared-understanding gate) and `dw-domain-modeling` (canonical glossary, fuzzy/overloaded-term challenge, rare ADRs). Intentional `.dw/` differences: the curated glossary lives in **`.dw/domain/**`** (not upstream's root `CONTEXT.md`, and not our auto-generated `.dw/rules/`); Grill requires **one explicit authorization** before it writes and is mutually exclusive with the option matrix; alignment emits an idea one-pager at **schema `1.1`** consumed by `/dw-plan` without re-asking; and ADR creation is gated on the 3-criteria test and routed via `/dw-adr --scope=repo|prd`. (2) **prototype** → `/dw-brainstorm` `prototype` mode (LOGIC terminal app or UI variant dispatch); (3) **improve-codebase-architecture** → `dw-simplification/references/deep-modules.md` (deletion test, locality, leverage, seam, adapter diagnostic invoked by the `refactor-audit` mode); (4) **zoom-out** → one-paragraph guidance in `agent-instructions.md`. The same line of work also collapses `/dw-brainstorm`'s six legacy flags into a single full-flow entry point that auto-dispatches modes based on project signals.
386
390
 
@@ -433,7 +437,7 @@ On the next `npx @brunosps00/dev-workflow update`, the following happens automat
433
437
 
434
438
  ### CLAUDE.md / AGENTS.md updates
435
439
 
436
- The Trigger Map block (between `<!-- dev-workflow:start -->` and `<!-- dev-workflow:end -->`) refreshes automatically on update with the v1.0.0 command surface. Your edits outside the markers are preserved.
440
+ The managed instruction block (between `<!-- dev-workflow:start -->` and `<!-- dev-workflow:end -->`) refreshes automatically on update with the v1.0.0 command surface. Your edits outside the markers are preserved.
437
441
 
438
442
  ### Skill conventions
439
443
 
@@ -442,3 +446,9 @@ Skill description format ("pushy" trigger phrases ≤200 chars, "Use when X. Tri
442
446
  ## License
443
447
 
444
448
  MIT
449
+
450
+ ### Task execution across tools
451
+
452
+ During `/dw-plan tasks`, review the proposed complexity, local/cross-tool executor, model, effort and agents for each task. Claude can delegate to `/dw-codex-run`, and Codex to `/dw-claude-run`. Approval carries through implementation, review and corrections; the parent continues after each worker handoff. A planning-only request still ends with the plan.
453
+
454
+ Existing task documents remain compatible and default to local execution. Updates preserve your `.dw/config/routing.json`; new model candidates are proposals to verify against your account, not silent upgrades. See [workflow modernization](docs/model-workflow-modernization.md) for the execution contract, evidence reuse and validation limits.
package/lib/constants.js CHANGED
@@ -2,13 +2,13 @@ const COMMANDS = {
2
2
  en: [
3
3
  { name: 'dw-adr', description: 'Records an architectural decision and the trade-offs accepted, before they get lost. --scope=repo writes .dw/adrs/ (works before any PRD); --scope=prd writes under the active PRD. Gated on hard-to-reverse + surprising + genuine trade-off.' },
4
4
  { name: 'dw-analyze-project', description: 'Scans the repo to learn its stack and conventions, then writes the rules other commands rely on.' },
5
- { name: 'dw-autopilot', description: 'Trigger when user asks to implement, build, create, or add a feature non-trivially. First invocation plans and stops; second invocation resumes via dw-goal, then commit and PR.' },
6
- { name: 'dw-brainstorm', description: 'Refine a concrete idea against the product\'s existing features. Auto-dispatches internal modes via --mode= (option-matrix / grill / prototype / council / research / refactor-audit / onepager). Grill is a native stateful alignment session (a direct grill-me phrase or --mode=grill) that writes canonical vocabulary to .dw/domain/. Use dw-opportunities before you have an idea and dw-refactor for code-health audits.' },
5
+ { name: 'dw-autopilot', description: 'Plan a multi-component implementation, approve task execution assignments, then continue through implementation, review and validation.' },
6
+ { name: 'dw-brainstorm', description: 'Explore unresolved product or architecture choices for a concrete idea; use grill for stateful alignment, research for unknowns, or council for competing approaches.' },
7
7
  { name: 'dw-bugfix', description: 'Trigger when user reports a bug, pastes an error, or describes broken behavior. Triages with three questions, then fixes or routes to PRD.' },
8
- { name: 'dw-claude-run', userInvoked: true, description: 'Trigger when user asks to run/fire Claude (claude -p headless) in a dedicated worktree to implement a prepared prompt/spec. Claude adapter over the dw-cli-run protocol: durable audit log, resumable session via --session-id, 0-10 dual evaluation, STOP for the gate. Never the main checkout; never merges.' },
9
- { name: 'dw-codex-run', userInvoked: true, description: 'Trigger when user asks to run/fire Codex (codex exec) in a dedicated worktree to implement a prepared prompt/spec. Codex adapter over the dw-cli-run protocol: durable audit log, resumable per-task session, 0-10 dual evaluation, STOP for the gate. Never the main checkout; never merges.' },
8
+ { name: 'dw-claude-run', description: 'Run an approved task through Claude CLI in a dedicated worktree; return a durable session and evidence to the parent.' },
9
+ { name: 'dw-codex-run', description: 'Run an approved task through Codex CLI in a dedicated worktree; return a durable session and evidence to the parent.' },
10
10
  { name: 'dw-commit', description: 'Trigger when implementation is complete and pending changes need to be committed. Atomic commits with Conventional Commits messages.' },
11
- { name: 'dw-copilot-run', userInvoked: true, description: 'Trigger when user asks to run/fire GitHub Copilot CLI (copilot -p) in a dedicated worktree to implement a prepared prompt/spec. Copilot adapter over the dw-cli-run protocol: durable audit log, resumable session, 0-10 dual evaluation, STOP for the gate. Never the main checkout; never merges.' },
11
+ { name: 'dw-copilot-run', description: 'Run an approved task through Copilot CLI in a dedicated worktree; return a durable session and evidence to the parent.' },
12
12
  { name: 'dw-dockerize', description: 'Reads a project, detects the stack and runtime deps, then proposes Dockerfile and docker-compose for dev and prod with explicit trade-offs.' },
13
13
  { name: 'dw-find-skills', description: 'Searches the npx skills ecosystem for a skill matching what you need, vets it, and installs it where you choose.' },
14
14
  { name: 'dw-functional-doc', description: 'Maps screens and user flows into a functional doc, validated end-to-end with Playwright.' },
@@ -17,41 +17,41 @@ const COMMANDS = {
17
17
  { name: 'dw-help', description: 'Lists primary commands and the flows that connect them. Pass --advanced to see internal/hidden commands.' },
18
18
  { name: 'dw-context-budget', description: 'Audits context overhead from commands, skills, agents, instructions, and MCPs; recommends token savings.' },
19
19
  { name: 'dw-harness-audit', description: 'Runs a deterministic health scorecard for dev-workflow installation, agents, MCPs, gates, and context discipline.' },
20
- { name: 'dw-install-aws-skills', description: 'Trigger when user asks to install AWS expertise, setup AWS MCP server, or add AWS agent skills. Opt-in: clones curated skills from aws/agent-toolkit-for-aws into .agents/skills/aws/ and registers the unified AWS MCP Server (stdio via mcp-proxy-for-aws). Requires uv, aws cli, and AWS credentials.' },
20
+ { name: 'dw-install-aws-skills', description: 'Install selected AWS expertise and configure the AWS MCP integration when requested.' },
21
21
  { name: 'dw-install-azure-skills', description: 'Trigger when user asks to install Azure expertise, setup Microsoft docs MCP, or add Azure agent skills. Opt-in: clones curated skills from MicrosoftDocs/Agent-Skills into .agents/skills/azure/ and registers the Microsoft Learn MCP server.' },
22
22
  { name: 'dw-intel', description: 'Codebase intelligence: query mode (default) answers questions citing .dw/intel/ + .dw/rules/; --build mode (re)builds the index.' },
23
23
  { name: 'dw-learn', description: 'Synthesizes durable decisions, bugfixes, deviations, and git history into atomic confidence-weighted instincts you approve; can propose constitution principles. On-demand and human-in-the-loop — no always-on observer.' },
24
24
  { name: 'dw-new-project', description: 'Interviews you about stack and infra, then scaffolds a working monorepo with docker-compose for dev, .env, scripts, CI, and seeded rules.' },
25
- { name: 'dw-open-design', userInvoked: true, description: 'Trigger when user asks to generate, iterate, or refactor/redesign headless Open Design HTML prototypes via the od CLI. Imports a target folder with isolated OD_DATA_DIR, refines briefs before dispatch, supports --refactor screenshots via --url/--viewports or --screenshot, runs web-prototype briefs with explicit --agent codex|claude, verifies files, captures JSONL audit logs, and stops for a dual >=9 visual gate.' },
25
+ { name: 'dw-open-design', description: 'Generate or iterate Open Design HTML prototypes through the od CLI, including screenshot-based redesign and visual verification.' },
26
26
  { name: 'dw-opportunities', description: 'Scans the installed project for product, UX, automation, refactor, and security opportunities, then routes each idea to the right next dw-* command.' },
27
27
  { name: 'dw-pause', description: 'Trigger when user says "pause work", "end session", or "save where we are". Consolidates open loops, decisions, blockers, and todos into .dw/STATE.md so the next session can resume.' },
28
- { name: 'dw-plan', description: 'Trigger when user has a feature idea and needs spec + architecture + tasks. Runs PRD → TechSpec → Tasks sequentially. Stages: prd / techspec / tasks; --from techspec; --council.' },
28
+ { name: 'dw-plan', description: 'Produce PRD, architecture and tasks, with local/cross-tool executor, model, effort and agent proposals by task complexity.' },
29
29
  { name: 'dw-qa', description: 'Trigger when user wants to validate behavior beyond unit tests. Mode-aware (UI / API / --ai / --uat). --fix enters the iterative QA + fix-retest loop. --bugfix <slug> targets a .dw/bugfixes/ entry.' },
30
30
  { name: 'dw-redesign-ui', description: 'Audits a frontend page, proposes design directions you choose from, then ships the redesign.' },
31
31
  { name: 'dw-refactor', description: 'Audits a target for refactor opportunities using the refactor-audit protocol, Fowler smells, deep-modules analysis, and behavior-preserving test gates.' },
32
- { name: 'dw-report', description: 'Trigger when user asks for periodic progress reports ("report every 10 minutes", "keep me posted while this runs"). Timestamped done / doing / remaining report at a fixed cadence (default 10m, --every <N>m), appended to .dw/reports/YYYY-MM-DD.md; silent while blocked, final report + auto-disarm when the work ends. Auto-armed by dw-run, dw-autopilot, and the dw-cli-run adapters.' },
32
+ { name: 'dw-report', description: 'Report progress periodically during authorized long-running work; persist updates and stop reporting when the work ends.' },
33
33
  { name: 'dw-resume', description: 'Trigger when user says "resume work", "where did we stop?", or starts a session in a project with an existing .dw/STATE.md. Reads STATE.md, presents a TLDR, and suggests the next dw-* command.' },
34
- { name: 'dw-review', description: 'Trigger when user asks to review code, check quality, or verify PR readiness. Default runs L2 (PRD coverage) + L3 (code quality). Flags --coverage-only / --code-only / --bugfix <slug> / --since <ref>.' },
34
+ { name: 'dw-review', description: 'Trigger when user asks to review code, check quality, or verify PR readiness. Default runs L2 (PRD coverage) + L3 (code quality). Flags --coverage-only / --code-only / --bugfix <slug> / --since <ref> / --post-merge <base>.' },
35
35
  { name: 'dw-run', description: 'Trigger when user wants to execute tasks. Default runs all pending in dependency order; \'run <task-id>\' runs one; \'run --resume\' continues an interrupted plan.' },
36
- { name: 'dw-secure-audit', description: 'Security Gate: OWASP + Semgrep SAST (diff) + gitleaks secrets + Trivy SCA/IaC + lockfile + supply-chain + outdated. Rigoroso: secrets/CRITICAL/HIGH block. Auto-invoked by /dw-review and /dw-generate-pr, explicit phase in /dw-autopilot, and runnable standalone.' },
37
- { name: 'dw-skill-health', description: 'Audits installed skills and agents for bloat, duplication, missing references, and stale or unused modules.' },
38
- { name: 'dw-subtask-start', userInvoked: true, description: 'Creates a minimal input packet for a subagent without injecting the parent transcript.' },
39
- { name: 'dw-subtask-complete', userInvoked: true, description: 'Records a structured subagent handoff with result, files, decisions, risks, verification, and blockers.' },
40
- { name: 'dw-subtask-resume', userInvoked: true, description: 'Consumes pending subagent handoffs, summarizes them for the parent, and archives the local packets.' },
36
+ { name: 'dw-secure-audit', description: 'Audit relevant code and dependencies for security findings using available scanners; validate exploitability and enforce blocking findings.' },
37
+ { name: 'dw-skill-health', description: 'Audits installed skills and agents for bloat, duplication, missing references, and stale modules; reports usage evidence so an idle skill is named with its observed window, never guessed.' },
38
+ { name: 'dw-subtask-start', description: 'Creates a minimal input packet for a subagent without injecting the parent transcript.' },
39
+ { name: 'dw-subtask-complete', description: 'Records a structured subagent handoff with result, files, decisions, risks, verification, and blockers.' },
40
+ { name: 'dw-subtask-resume', description: 'Consumes pending subagent handoffs, summarizes them for the parent, and archives the local packets.' },
41
41
  { name: 'dw-triage', description: 'Local-first intake for external bug reports, feature requests, and PRs. Persists .dw/triage/ state, checks redundancy and prior rejections, verifies claims, then routes to /dw-bugfix, /dw-plan prd, /dw-brainstorm --mode=grill, or no work.' },
42
- { name: 'dw-worktree', description: 'Worktree lifecycle for delegated work: create prepared (../<project>-<slug> + install/build prep), list with verdicts (REMOVABLE / KEEP:unmerged / KEEP:dirty / KEEP:in-use), clean only what is proven merged and clean (dry-run by default), merge in the safe ff-only order and remove in the same turn. Never --force. Backed by .dw/scripts/lib/worktree-gc.mjs; used by the dw-*-run adapters, /dw-pause, and /dw-harness-audit.' },
42
+ { name: 'dw-worktree', description: 'Create prepared worktrees, inspect their state, clean safely merged worktrees, or integrate an explicitly authorized branch.' },
43
43
  { name: 'dw-update', description: 'Updates dev-workflow to the latest npm release in-place, with a snapshot you can roll back to.' },
44
44
  ],
45
45
  'pt-br': [
46
46
  { name: 'dw-adr', description: 'Registra uma decisao arquitetural e os trade-offs aceitos, antes que se percam. --scope=repo escreve em .dw/adrs/ (funciona antes de qualquer PRD); --scope=prd escreve sob o PRD ativo. Gated em dificil-de-reverter + surpreendente + trade-off real.' },
47
47
  { name: 'dw-analyze-project', description: 'Escaneia o repo para aprender stack e convencoes, e escreve as regras que os outros commands usam.' },
48
- { name: 'dw-autopilot', description: 'Trigger quando usuario pede pra implementar, criar ou adicionar uma feature nao-trivial. Primeira invocacao planeja e para; segunda retoma via dw-goal, depois commit e PR.' },
49
- { name: 'dw-brainstorm', description: 'Refina uma ideia concreta contra features existentes do produto. Auto-dispatch de modos internos via --mode= (option-matrix / grill / prototype / council / research / refactor-audit / onepager). Grill e uma sessao nativa de alinhamento com estado (frase direta tipo me-questione ou --mode=grill) que escreve vocabulario canonico em .dw/domain/. Use dw-opportunities antes de ter uma ideia e dw-refactor para auditoria de code health.' },
48
+ { name: 'dw-autopilot', description: 'Planeja implementação multicomponente, aprova escolhas de execução por task e continua por implementação, review e validação.' },
49
+ { name: 'dw-brainstorm', description: 'Explora escolhas pendentes de produto ou arquitetura; grill para alinhamento com estado, pesquisa para lacunas e council para alternativas concorrentes.' },
50
50
  { name: 'dw-bugfix', description: 'Trigger quando usuario reporta bug, cola erro ou descreve comportamento quebrado. Tria com tres perguntas, depois corrige ou roteia pra PRD.' },
51
- { name: 'dw-claude-run', userInvoked: true, description: 'Trigger quando usuario pede pra rodar/disparar o Claude (claude -p headless) numa worktree dedicada pra implementar um prompt/spec preparado. Adapter Claude sobre o protocolo dw-cli-run: log de auditoria duravel, sessao resumivel via --session-id, dupla avaliacao 0-10, PARA pro gate. Nunca no checkout principal; nunca mergeia.' },
52
- { name: 'dw-codex-run', userInvoked: true, description: 'Trigger quando usuario pede pra rodar/disparar o Codex (codex exec) numa worktree dedicada pra implementar um prompt/spec preparado. Adapter Codex sobre o protocolo dw-cli-run: log de auditoria duravel, sessao resumivel por tarefa, dupla avaliacao 0-10, PARA pro gate. Nunca no checkout principal; nunca mergeia.' },
51
+ { name: 'dw-claude-run', description: 'Executa task aprovada pela CLI Claude em worktree dedicado; retorna sessão durável e evidências ao parent.' },
52
+ { name: 'dw-codex-run', description: 'Executa task aprovada pela CLI Codex em worktree dedicado; retorna sessão durável e evidências ao parent.' },
53
53
  { name: 'dw-commit', description: 'Trigger quando implementacao esta completa e ha mudancas pendentes pra commit. Commits atomicos com mensagens Conventional Commits.' },
54
- { name: 'dw-copilot-run', userInvoked: true, description: 'Trigger quando usuario pede pra rodar/disparar o GitHub Copilot CLI (copilot -p) numa worktree dedicada pra implementar um prompt/spec preparado. Adapter Copilot sobre o protocolo dw-cli-run: log de auditoria duravel, sessao resumivel, dupla avaliacao 0-10, PARA pro gate. Nunca no checkout principal; nunca mergeia.' },
54
+ { name: 'dw-copilot-run', description: 'Executa task aprovada pela CLI Copilot em worktree dedicado; retorna sessão durável e evidências ao parent.' },
55
55
  { name: 'dw-dockerize', description: 'Le um projeto, detecta stack e deps de runtime, e propoe Dockerfile e docker-compose para dev e prod com trade-offs explicitos.' },
56
56
  { name: 'dw-find-skills', description: 'Busca no ecossistema npx skills uma skill que resolva o que voce precisa, valida e instala onde voce escolher.' },
57
57
  { name: 'dw-functional-doc', description: 'Mapeia telas e fluxos em um dossie funcional, validado E2E com Playwright.' },
@@ -60,29 +60,29 @@ const COMMANDS = {
60
60
  { name: 'dw-help', description: 'Lista comandos primarios e fluxos que os conectam. Passe --advanced para ver comandos internos/escondidos.' },
61
61
  { name: 'dw-context-budget', description: 'Audita overhead de contexto em comandos, skills, agentes, instrucoes e MCPs; recomenda economia de tokens.' },
62
62
  { name: 'dw-harness-audit', description: 'Roda um scorecard deterministico da instalacao dev-workflow, agentes, MCPs, gates e disciplina de contexto.' },
63
- { name: 'dw-install-aws-skills', description: 'Trigger quando usuario pede pra instalar expertise AWS, configurar MCP da AWS, ou adicionar agent skills AWS. Opt-in: clona skills curadas de aws/agent-toolkit-for-aws para .agents/skills/aws/ e registra o AWS MCP Server unificado (stdio via mcp-proxy-for-aws). Requer uv, aws cli e credenciais AWS.' },
64
- { name: 'dw-install-azure-skills', description: 'Trigger quando usuario pede pra instalar expertise Azure, configurar MCP do Microsoft docs, ou adicionar agent skills Azure. Opt-in: clona skills curadas de MicrosoftDocs/Agent-Skills para .agents/skills/azure/ e registra o Microsoft Learn MCP server.' },
63
+ { name: 'dw-install-aws-skills', description: 'Instala expertise AWS selecionada e configura integração MCP AWS quando solicitado.' },
64
+ { name: 'dw-install-azure-skills', description: 'Trigger quando usuario pede pra instalar expertise Azure, configurar MCP do Microsoft docs, ou adicionar agent skills Azure.' },
65
65
  { name: 'dw-intel', description: 'Inteligencia do codebase: modo query (default) responde citando .dw/intel/ + .dw/rules/; modo --build (re)constroi indice.' },
66
66
  { name: 'dw-learn', description: 'Sintetiza decisoes duraveis, bugfixes, deviations e historico git em instincts atomicos ponderados por confianca que voce aprova; pode propor principios de constitution. On-demand e human-in-the-loop — sem observador sempre-ligado.' },
67
67
  { name: 'dw-new-project', description: 'Entrevista voce sobre stack e infra, depois faz scaffold de um monorepo com docker-compose para dev, .env, scripts, CI e rules seed.' },
68
- { name: 'dw-open-design', userInvoked: true, description: 'Trigger quando usuario pede para gerar, iterar ou refatorar/redesenhar prototipos HTML headless do Open Design via od CLI. Importa pasta alvo com OD_DATA_DIR isolado, refina briefs antes de despachar, suporta prints --refactor via --url/--viewports ou --screenshot, roda briefs web-prototype com --agent codex|claude explicito, verifica arquivos, captura logs JSONL e para para gate visual dual >=9.' },
68
+ { name: 'dw-open-design', description: 'Gera ou itera protótipos HTML Open Design pela CLI od, incluindo redesign por screenshots e verificação visual.' },
69
69
  { name: 'dw-opportunities', description: 'Escaneia o projeto instalado por oportunidades de produto, UX, automacao, refactor e seguranca, e roteia cada ideia para o proximo comando dw-* correto.' },
70
70
  { name: 'dw-pause', description: 'Trigger quando usuario diz "pausa o trabalho", "encerra a sessao" ou "salva onde paramos". Consolida pontas soltas, decisoes, bloqueios e todos em .dw/STATE.md para a proxima sessao retomar.' },
71
- { name: 'dw-plan', description: 'Trigger quando usuario tem ideia de feature e precisa spec + arquitetura + tasks. Roda PRD → TechSpec → Tasks sequencial. Stages: prd / techspec / tasks; --from techspec; --council.' },
71
+ { name: 'dw-plan', description: 'Produz PRD, arquitetura e tasks com propostas de executor local/cruzado, modelo, esforço e agentes por complexidade.' },
72
72
  { name: 'dw-qa', description: 'Trigger quando usuario quer validar comportamento alem de unit tests. Mode-aware (UI / API / --ai / --uat). --fix entra no loop iterativo QA + fix-retest. --bugfix <slug> aponta para uma entrada em .dw/bugfixes/.' },
73
73
  { name: 'dw-redesign-ui', description: 'Audita uma pagina frontend, propoe direcoes de design que voce escolhe, e entrega o redesign.' },
74
74
  { name: 'dw-refactor', description: 'Audita um target por oportunidades de refactor usando o protocolo refactor-audit, smells Fowler, deep-modules e gates de teste preservando comportamento.' },
75
- { name: 'dw-report', description: 'Trigger quando usuário pede report periódico de progresso ("report de 10 em 10 minutos", "me mantém informado enquanto isso roda"). Report carimbado com data/hora de feito / fazendo / falta em cadência fixa (default 10m, --every <N>m), anexado em .dw/reports/YYYY-MM-DD.md; silencioso enquanto bloqueado, report final + auto-desarme quando o trabalho termina. Auto-armado por dw-run, dw-autopilot e pelos adapters dw-cli-run.' },
75
+ { name: 'dw-report', description: 'Reporta progresso periódico durante trabalho longo autorizado; persiste atualizações e encerra quando o trabalho termina.' },
76
76
  { name: 'dw-resume', description: 'Trigger quando usuario diz "retoma", "onde paramos?" ou comeca sessao num projeto com .dw/STATE.md existente. Le STATE.md, apresenta TLDR e sugere proximo comando dw-*.' },
77
- { name: 'dw-review', description: 'Trigger quando usuário pede pra revisar código, checar qualidade ou validar prontidão pra PR. Default roda L2 (cobertura PRD) + L3 (qualidade). Flags --coverage-only / --code-only / --bugfix <slug> / --since <ref>.' },
77
+ { name: 'dw-review', description: 'Trigger quando usuário pede pra revisar código, checar qualidade ou validar prontidão pra PR. Default roda L2 (cobertura PRD) + L3 (qualidade). Flags --coverage-only / --code-only / --bugfix <slug> / --since <ref> / --post-merge <base>.' },
78
78
  { name: 'dw-run', description: 'Trigger quando usuario quer executar tasks. Default roda todas pendentes em ordem de dependencia; \'run <task-id>\' roda uma; \'run --resume\' continua plan interrompido.' },
79
- { name: 'dw-secure-audit', description: 'Security Gate: OWASP + Semgrep SAST (diff) + gitleaks secrets + Trivy SCA/IaC + lockfile + supply-chain + outdated. Rigoroso: secrets/CRITICAL/HIGH bloqueiam. Auto-invocado por /dw-review e /dw-generate-pr, fase explicita no /dw-autopilot, e executavel standalone.' },
80
- { name: 'dw-skill-health', description: 'Audita skills e agentes instalados por bloat, duplicacao, referencias quebradas e modulos sem uso.' },
81
- { name: 'dw-subtask-start', userInvoked: true, description: 'Cria um input packet minimo para subagente sem injetar transcript bruto do parent.' },
82
- { name: 'dw-subtask-complete', userInvoked: true, description: 'Registra handoff estruturado do subagente com resultado, arquivos, decisoes, riscos, verificacao e bloqueios.' },
83
- { name: 'dw-subtask-resume', userInvoked: true, description: 'Consome handoffs pendentes de subagentes, resume para o parent e arquiva os pacotes locais.' },
84
- { name: 'dw-triage', description: 'Intake local-first para bug reports, feature requests e PRs externos. Persiste estado em .dw/triage/, checa redundância e rejeições anteriores, verifica alegações, e então roteia para /dw-bugfix, /dw-plan prd, /dw-brainstorm --mode=grill, ou nenhum trabalho.' },
85
- { name: 'dw-worktree', description: 'Ciclo de vida de worktrees de delegação: cria preparada (../<projeto>-<slug> + prep de install/build), lista com vereditos (REMOVABLE / KEEP:unmerged / KEEP:dirty / KEEP:in-use), limpa só o que está provadamente mergeado e limpo (dry-run por default), mergeia na ordem segura ff-only e remove no mesmo turno. Nunca --force. Apoiado em .dw/scripts/lib/worktree-gc.mjs; usado pelos adapters dw-*-run, /dw-pause e /dw-harness-audit.' },
79
+ { name: 'dw-secure-audit', description: 'Audita código e dependências relevantes com scanners disponíveis; valida explorabilidade e aplica achados bloqueantes.' },
80
+ { name: 'dw-skill-health', description: 'Audita skills e agentes instalados por bloat, duplicacao, referencias quebradas e modulos velhos; reporta evidencia de uso, nomeando skill ociosa com a janela observada em vez de chutar.' },
81
+ { name: 'dw-subtask-start', description: 'Cria um input packet minimo para subagente sem injetar transcript bruto do parent.' },
82
+ { name: 'dw-subtask-complete', description: 'Registra handoff estruturado do subagente com resultado, arquivos, decisoes, riscos, verificacao e bloqueios.' },
83
+ { name: 'dw-subtask-resume', description: 'Consome handoffs pendentes de subagentes, resume para o parent e arquiva os pacotes locais.' },
84
+ { name: 'dw-triage', description: 'Intake local-first para bug reports, feature requests e PRs externos.' },
85
+ { name: 'dw-worktree', description: 'Cria worktrees preparados, inspeciona estado, limpa worktrees integrados com segurança ou integra branch explicitamente autorizada.' },
86
86
  { name: 'dw-update', description: 'Atualiza o dev-workflow para o release mais recente no npm, com snapshot para rollback.' },
87
87
  ],
88
88
  };
@@ -91,8 +91,11 @@ const PLATFORMS = {
91
91
  claude: {
92
92
  dir: '.claude/skills',
93
93
  // opts.userInvoked → emit disable-model-invocation: true so Claude Code never
94
- // auto-fires hidden/internal commands (e.g. the worktree runners); the user
95
- // still invokes them explicitly with /<name>.
94
+ // auto-fires that command; the user invokes it explicitly with /<name>.
95
+ // No bundled command sets this today (see docs/skills-ecosystem-comparison.md §2:
96
+ // the lock is not a substitute for an authorization gate). It is kept for a
97
+ // consumer's own commands, and test/wrappers.test.js exercises it directly so the
98
+ // path cannot rot unnoticed while unused.
96
99
  wrapperTemplate: (name, description, opts = {}) => `---
97
100
  name: ${name}
98
101
  description: "${description.replace(/"/g, '\\"')}"${opts.userInvoked ? '\ndisable-model-invocation: true' : ''}
package/lib/doctor.js CHANGED
@@ -207,7 +207,7 @@ function checkMcp(projectRoot, issues) {
207
207
 
208
208
  function checkHooks(projectRoot, issues, warnings) {
209
209
  // Hook scripts (copied from scaffold/scripts/ into .dw/scripts/).
210
- for (const script of ['git-guardrails.mjs', 'statusline.mjs']) {
210
+ for (const script of ['git-guardrails.mjs', 'statusline.mjs', 'session-cost.mjs']) {
211
211
  const file = path.join(projectRoot, '.dw', 'scripts', 'hooks', script);
212
212
  if (!fs.existsSync(file)) issues.push(`Missing hook script: ${path.relative(projectRoot, file)}`);
213
213
  }
package/lib/init.js CHANGED
@@ -202,6 +202,13 @@ async function run({ force = false, lang = null, mode = 'init', profile = null,
202
202
  const cfgDir = path.join(projectRoot, '.dw', 'config');
203
203
  ensureDir(cfgDir);
204
204
  const routingDest = path.join(cfgDir, 'routing.json');
205
+ // Refresh the candidate reference without replacing active owner choices.
206
+ const defaultsDest = path.join(cfgDir, 'routing-defaults.json');
207
+ const defaultsStatus = writeFile(defaultsDest, require('fs').readFileSync(routingSrc, 'utf-8'), managedForce);
208
+ if (defaultsStatus === 'created') totalCreated++;
209
+ else if (defaultsStatus === 'overwritten') totalOverwritten++;
210
+ else totalSkipped++;
211
+ touchedFiles.push(defaultsDest);
205
212
  const rtStatus = writeFile(routingDest, require('fs').readFileSync(routingSrc, 'utf-8'), false);
206
213
  if (rtStatus === 'created') totalCreated++;
207
214
  else totalSkipped++;
@@ -419,6 +426,7 @@ async function run({ force = false, lang = null, mode = 'init', profile = null,
419
426
  managedFiles: listManagedFiles(projectRoot, touchedFiles),
420
427
  });
421
428
  console.log(` Install state: ${path.relative(projectRoot, path.join(projectRoot, '.dw', 'install-state.json'))} (${installState.managed_files.length} files tracked)\n`);
429
+ console.log(` Installed version: ${priorState?.version || 'unknown'} -> ${installState.version}\n`);
422
430
 
423
431
  // 10. Summary
424
432
  console.log(` ${'='.repeat(40)}`);
@@ -0,0 +1,38 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const { COMMANDS } = require('./constants');
4
+
5
+ const LIMITS = { instructions: 6000, skill: 8000, description: 250 };
6
+
7
+ function inspectInstructions(root = path.join(__dirname, '..')) {
8
+ const issues = [];
9
+ const metrics = { instructions: {}, descriptions: {}, skills: {} };
10
+ for (const locale of ['en', 'pt-br']) {
11
+ const file = path.join(root, 'scaffold', locale, 'agent-instructions.md');
12
+ metrics.instructions[locale] = fs.statSync(file).size;
13
+ if (metrics.instructions[locale] > LIMITS.instructions) issues.push(`${locale} installed instructions exceed ${LIMITS.instructions} bytes`);
14
+ metrics.descriptions[locale] = 0;
15
+ for (const command of COMMANDS[locale]) {
16
+ metrics.descriptions[locale] += [...command.description].length;
17
+ if ([...command.description].length > LIMITS.description) issues.push(`${locale} ${command.name} description exceeds ${LIMITS.description} characters`);
18
+ }
19
+ }
20
+ const skillsDir = path.join(root, 'scaffold', 'skills');
21
+ for (const entry of fs.readdirSync(skillsDir, { withFileTypes: true })) {
22
+ if (!entry.isDirectory()) continue;
23
+ const file = path.join(skillsDir, entry.name, 'SKILL.md');
24
+ if (!fs.existsSync(file)) continue; // Registry validator reports missing entrypoints.
25
+ const content = fs.readFileSync(file, 'utf8');
26
+ metrics.skills[entry.name] = Buffer.byteLength(content);
27
+ if (metrics.skills[entry.name] > LIMITS.skill) issues.push(`${entry.name} entrypoint exceeds ${LIMITS.skill} bytes`);
28
+ const description = content.match(/^description:\s*(.+)$/m)?.[1]?.replace(/^"|"$/g, '');
29
+ if (!description || [...description].length > LIMITS.description) issues.push(`${entry.name} requires a description of at most ${LIMITS.description} characters`);
30
+ // Concrete skill-relative router links, not wildcard examples or installed paths.
31
+ for (const match of content.matchAll(/(?:`|\]\()((?:references|agents|rules|languages|infrastructure)\/[\w./-]+\.md)(?:`|\))/g)) {
32
+ if (!fs.existsSync(path.join(path.dirname(file), match[1]))) issues.push(`${entry.name} missing routed reference ${match[1]}`);
33
+ }
34
+ }
35
+ return { issues, metrics };
36
+ }
37
+
38
+ module.exports = { LIMITS, inspectInstructions };
@@ -71,7 +71,7 @@ function listPostUpdateActions(projectRoot) {
71
71
  });
72
72
  actions.push({
73
73
  command: '/dw-skill-health',
74
- reason: 'audit refreshed bundled skills and agents for bloat, duplication, and stale references',
74
+ reason: 'audit refreshed skills and compare .dw/config/routing.json with managed routing-defaults.json; preserve owner choices and approved plans',
75
75
  });
76
76
 
77
77
  return actions;
@@ -80,6 +80,7 @@ function listPostUpdateActions(projectRoot) {
80
80
  function printPostUpdateActions(projectRoot) {
81
81
  const actions = listPostUpdateActions(projectRoot);
82
82
  console.log(' Post-update agent actions:');
83
+ console.log(' Read the refreshed .dw/commands/dw-update.md before following the post-update instructions.');
83
84
  console.log(' The CLI refreshed managed files. Project-derived docs require the agent to run commands:');
84
85
  for (const action of actions) {
85
86
  console.log(` - ${action.command} - ${action.reason}`);
package/lib/validate.js CHANGED
@@ -3,6 +3,7 @@ const path = require('path');
3
3
  const { validateSkillRegistry } = require('./skill-registry');
4
4
  const { validateAgentRegistry, readAgentRegistry } = require('./agents');
5
5
  const { buildManifests } = require('./build-plugin');
6
+ const { inspectInstructions } = require('./instruction-health');
6
7
 
7
8
  /**
8
9
  * Repo quality gate (npm run validate). Validates the skill + agent registries
@@ -20,6 +21,7 @@ function run() {
20
21
  const agent = validateAgentRegistry(readAgentRegistry());
21
22
  issues.push(...agent.issues);
22
23
  warnings.push(...agent.warnings);
24
+ issues.push(...inspectInstructions().issues);
23
25
 
24
26
  // Plugin manifest drift check.
25
27
  const { plugin, marketplace } = buildManifests();
@@ -41,7 +43,7 @@ function run() {
41
43
  console.log('FAIL');
42
44
  process.exit(1);
43
45
  }
44
- console.log('PASS: skill + agent registries valid; plugin manifests in sync.');
46
+ console.log('PASS: skill + agent registries valid; instruction budgets valid; plugin manifests in sync.');
45
47
  }
46
48
 
47
49
  function checkManifestDrift(relPath, expected, issues) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brunosps00/dev-workflow",
3
- "version": "2.2.0",
3
+ "version": "2.4.0",
4
4
  "description": "AI-driven development workflow commands for any project. Scaffolds a complete PRD-to-PR pipeline with multi-platform AI assistant support.",
5
5
  "bin": {
6
6
  "dev-workflow": "./bin/dev-workflow.js"