@brunosps00/dev-workflow 2.1.0 → 2.3.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 (129) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +118 -0
  3. package/README.md +17 -6
  4. package/lib/constants.js +24 -20
  5. package/lib/init.js +34 -0
  6. package/lib/instruction-health.js +38 -0
  7. package/lib/post-update.js +2 -1
  8. package/lib/validate.js +3 -1
  9. package/package.json +1 -1
  10. package/scaffold/config/routing.json +61 -23
  11. package/scaffold/en/agent-instructions.md +31 -135
  12. package/scaffold/en/commands/dw-analyze-project.md +2 -0
  13. package/scaffold/en/commands/dw-autopilot.md +22 -243
  14. package/scaffold/en/commands/dw-bugfix.md +9 -35
  15. package/scaffold/en/commands/dw-claude-run.md +29 -45
  16. package/scaffold/en/commands/dw-codex-run.md +30 -45
  17. package/scaffold/en/commands/dw-context-budget.md +6 -14
  18. package/scaffold/en/commands/dw-copilot-run.md +29 -41
  19. package/scaffold/en/commands/dw-generate-pr.md +2 -2
  20. package/scaffold/en/commands/dw-goal.md +11 -5
  21. package/scaffold/en/commands/dw-harness-audit.md +2 -0
  22. package/scaffold/en/commands/dw-help.md +8 -4
  23. package/scaffold/en/commands/dw-pause.md +1 -0
  24. package/scaffold/en/commands/dw-plan.md +14 -7
  25. package/scaffold/en/commands/dw-qa.md +2 -0
  26. package/scaffold/en/commands/dw-report.md +169 -0
  27. package/scaffold/en/commands/dw-resume.md +5 -11
  28. package/scaffold/en/commands/dw-review.md +4 -3
  29. package/scaffold/en/commands/dw-run.md +19 -165
  30. package/scaffold/en/commands/dw-skill-health.md +7 -0
  31. package/scaffold/en/commands/dw-update.md +18 -4
  32. package/scaffold/en/commands/dw-worktree.md +100 -0
  33. package/scaffold/en/references/command-routing.md +53 -0
  34. package/scaffold/en/references/execution-contract.md +55 -0
  35. package/scaffold/en/templates/frontend-quality-template.md +43 -0
  36. package/scaffold/en/templates/task-template.md +20 -40
  37. package/scaffold/en/templates/tasks-template.md +9 -6
  38. package/scaffold/en/templates/techspec-template.md +4 -0
  39. package/scaffold/pt-br/agent-instructions.md +31 -135
  40. package/scaffold/pt-br/commands/dw-analyze-project.md +2 -0
  41. package/scaffold/pt-br/commands/dw-autopilot.md +22 -243
  42. package/scaffold/pt-br/commands/dw-bugfix.md +9 -35
  43. package/scaffold/pt-br/commands/dw-claude-run.md +29 -46
  44. package/scaffold/pt-br/commands/dw-codex-run.md +30 -45
  45. package/scaffold/pt-br/commands/dw-context-budget.md +6 -14
  46. package/scaffold/pt-br/commands/dw-copilot-run.md +29 -43
  47. package/scaffold/pt-br/commands/dw-generate-pr.md +2 -2
  48. package/scaffold/pt-br/commands/dw-goal.md +11 -5
  49. package/scaffold/pt-br/commands/dw-harness-audit.md +2 -0
  50. package/scaffold/pt-br/commands/dw-help.md +8 -4
  51. package/scaffold/pt-br/commands/dw-pause.md +1 -0
  52. package/scaffold/pt-br/commands/dw-plan.md +14 -7
  53. package/scaffold/pt-br/commands/dw-qa.md +2 -0
  54. package/scaffold/pt-br/commands/dw-report.md +169 -0
  55. package/scaffold/pt-br/commands/dw-resume.md +7 -11
  56. package/scaffold/pt-br/commands/dw-review.md +4 -3
  57. package/scaffold/pt-br/commands/dw-run.md +19 -165
  58. package/scaffold/pt-br/commands/dw-skill-health.md +7 -0
  59. package/scaffold/pt-br/commands/dw-update.md +18 -4
  60. package/scaffold/pt-br/commands/dw-worktree.md +100 -0
  61. package/scaffold/pt-br/references/command-routing.md +53 -0
  62. package/scaffold/pt-br/references/execution-contract.md +55 -0
  63. package/scaffold/pt-br/templates/frontend-quality-template.md +43 -0
  64. package/scaffold/pt-br/templates/task-template.md +20 -40
  65. package/scaffold/pt-br/templates/tasks-template.md +9 -6
  66. package/scaffold/pt-br/templates/techspec-template.md +4 -0
  67. package/scaffold/scripts/hooks/git-guardrails.mjs +1 -0
  68. package/scaffold/scripts/lib/workflow-contract.mjs +101 -0
  69. package/scaffold/scripts/lib/worktree-gc.mjs +460 -0
  70. package/scaffold/skill-registry.json +23 -23
  71. package/scaffold/skills/dw-cli-run/SKILL.md +33 -208
  72. package/scaffold/skills/dw-cli-run/references/dispatch-tuning.md +14 -72
  73. package/scaffold/skills/dw-codebase-intel/SKILL.md +5 -39
  74. package/scaffold/skills/dw-codebase-intel/agents/intel-updater.md +1 -1
  75. package/scaffold/skills/dw-codebase-intel/references/agents-detail.md +7 -0
  76. package/scaffold/skills/dw-codebase-intel/references/files-in-dw-intel-detail.md +16 -0
  77. package/scaffold/skills/dw-codebase-intel/references/how-dw-intel-reads-this-detail.md +12 -0
  78. package/scaffold/skills/dw-codebase-intel/references/how-to-compose-the-typical-flow-detail.md +11 -0
  79. package/scaffold/skills/dw-council/SKILL.md +2 -17
  80. package/scaffold/skills/dw-council/references/integration-with-other-dw-commands-detail.md +7 -0
  81. package/scaffold/skills/dw-council/references/phase-2-tensions-and-rebuttals-detail.md +15 -0
  82. package/scaffold/skills/dw-domain-modeling/SKILL.md +1 -1
  83. package/scaffold/skills/dw-execute-phase/SKILL.md +12 -32
  84. package/scaffold/skills/dw-execute-phase/agents/executor.md +15 -252
  85. package/scaffold/skills/dw-execute-phase/agents/plan-checker.md +4 -207
  86. package/scaffold/skills/dw-execute-phase/references/atomic-commits.md +8 -18
  87. package/scaffold/skills/dw-execute-phase/references/de-sloppify-pass-optional-cleanup-task-detail.md +12 -0
  88. package/scaffold/skills/dw-execute-phase/references/deviation-rules-during-execution-detail.md +8 -0
  89. package/scaffold/skills/dw-execute-phase/references/how-the-two-agents-compose-detail.md +7 -0
  90. package/scaffold/skills/dw-execute-phase/references/plan-verification.md +9 -155
  91. package/scaffold/skills/dw-execute-phase/references/wave-coordination.md +6 -97
  92. package/scaffold/skills/dw-git-discipline/SKILL.md +2 -2
  93. package/scaffold/skills/dw-grilling/SKILL.md +1 -1
  94. package/scaffold/skills/dw-incident-response/SKILL.md +1 -64
  95. package/scaffold/skills/dw-incident-response/references/the-five-phases-detail.md +66 -0
  96. package/scaffold/skills/dw-llm-eval/SKILL.md +5 -53
  97. package/scaffold/skills/dw-llm-eval/references/agent-tool-use-evaluation-detail.md +23 -0
  98. package/scaffold/skills/dw-llm-eval/references/anti-patterns-will-block-in-dw-review-code-only-detail.md +9 -0
  99. package/scaffold/skills/dw-llm-eval/references/consistency-run-to-run-stability-detail.md +10 -0
  100. package/scaffold/skills/dw-llm-eval/references/integration-with-dev-workflow-commands-detail.md +6 -0
  101. package/scaffold/skills/dw-llm-eval/references/the-oracle-ladder-detail.md +15 -0
  102. package/scaffold/skills/dw-memory/SKILL.md +4 -50
  103. package/scaffold/skills/dw-memory/references/context-budget.md +8 -56
  104. package/scaffold/skills/dw-memory/references/promotion-decision-test-detail.md +30 -0
  105. package/scaffold/skills/dw-minimalism/SKILL.md +4 -5
  106. package/scaffold/skills/dw-review-rigor/SKILL.md +1 -54
  107. package/scaffold/skills/dw-review-rigor/references/the-five-rules-detail.md +56 -0
  108. package/scaffold/skills/dw-simplification/SKILL.md +2 -55
  109. package/scaffold/skills/dw-simplification/references/pattern-recognition-detail.md +11 -0
  110. package/scaffold/skills/dw-simplification/references/the-five-rules-detail.md +48 -0
  111. package/scaffold/skills/dw-source-grounding/SKILL.md +1 -56
  112. package/scaffold/skills/dw-source-grounding/references/the-protocol-detect-fetch-implement-cite-detail.md +58 -0
  113. package/scaffold/skills/dw-testing-discipline/SKILL.md +25 -177
  114. package/scaffold/skills/dw-testing-discipline/references/agent-guardrails.md +9 -167
  115. package/scaffold/skills/dw-testing-discipline/references/core-rules.md +3 -3
  116. package/scaffold/skills/dw-testing-discipline/references/mutation-testing.md +19 -0
  117. package/scaffold/skills/dw-testing-discipline/references/patterns.md +3 -12
  118. package/scaffold/skills/dw-ui-discipline/SKILL.md +2 -59
  119. package/scaffold/skills/dw-ui-discipline/references/frontend-engineering.md +46 -0
  120. package/scaffold/skills/dw-ui-discipline/references/the-four-grounding-questions-detail.md +61 -0
  121. package/scaffold/skills/dw-verify/SKILL.md +26 -148
  122. package/scaffold/skills/dw-verify/references/verification-discovery-and-attribution.md +2 -2
  123. package/scaffold/skills/humanizer/SKILL.md +2 -1
  124. package/scaffold/skills/security-review/SKILL.md +3 -183
  125. package/scaffold/skills/security-review/references/do-not-flag-detail.md +49 -0
  126. package/scaffold/skills/security-review/references/quick-patterns-reference-detail.md +56 -0
  127. package/scaffold/skills/security-review/references/review-process-detail.md +84 -0
  128. package/scaffold/skills/vercel-react-best-practices/SKILL.md +1 -90
  129. 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.1.0",
4
+ "version": "2.3.0",
5
5
  "author": {
6
6
  "name": "Bruno Santos"
7
7
  },
package/CHANGELOG.md CHANGED
@@ -10,6 +10,124 @@ 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.3.0] — 2026-09-09
14
+
15
+ ### Added
16
+
17
+ - Task execution contracts with per-task tool, model, effort, agent and fallback
18
+ choices, dependency validation and persistent execution state. Schema 1.0 plans
19
+ remain supported with local execution defaults.
20
+ - Instruction size and routed-reference validation in `npm run validate`, with
21
+ regression tests for missing resources and byte/discovery budget violations.
22
+ - Frontend engineering guidance and EN/PT-BR quality baseline templates integrated
23
+ into project analysis, planning, review and QA. Controls cover API contracts,
24
+ types, import boundaries, code reachability, duplication and gradual CI adoption.
25
+ - Scoped mutation-testing guidance that investigates behavioral gaps and cache
26
+ validity without introducing a universal score threshold.
27
+ - Managed `routing-defaults.json` for comparing current model candidates while
28
+ preserving owner routing. Upgrade checks cover legacy plans and template overrides.
29
+
30
+ ### Changed
31
+
32
+ - Approved implementation plans continue through execution, correction and
33
+ validation without a mandatory second invocation. Publication remains subject
34
+ to the user's authorization.
35
+ - Claude, Codex and Copilot runner instructions use approved task assignments,
36
+ explicit session identity and parent review. New-install model routing defaults
37
+ are updated; existing owner configuration is preserved.
38
+ - Installed root instructions are approximately 62% smaller. Detailed command
39
+ routing and conditional skill procedures move into references loaded as needed.
40
+ - Verification reuses inspectable passing evidence only while command, inputs,
41
+ environment and scope remain equivalent. Required project checks still apply.
42
+ - Planning and testing guidance favors behavior and risk over fixed task/file
43
+ quotas, blanket parallelism, universal coverage targets and score-only approval.
44
+
45
+ ### Fixed
46
+
47
+ - Resume guidance preserves partial work and avoids blind latest-session recovery
48
+ or destructive retries. Dependent tasks retain a coherent worktree history.
49
+ - Removed contradictory mutation-testing guidance and aligned EN/PT-BR review,
50
+ goal and resume behavior with the continuous execution contract.
51
+ - Humanizer's upstream version is preserved under supported skill metadata.
52
+ - `/dw-update` reads installed versions from `.dw/install-state.json` instead of
53
+ resolving an npm package that may only exist in the `npx` execution environment.
54
+
55
+ Validation: 129 tests pass; registry, instruction and plugin checks pass.
56
+ Install/update and package checks include the new resources. External provider
57
+ dispatches and frontend analysis tools were not exercised against live projects.
58
+
59
+ ## [2.2.0] — 2026-08-24
60
+
61
+ Release driven by two operational failures observed on a real project, both of the
62
+ same family: the pipeline was good at *starting* long work and silent about what
63
+ happened next. Delegated runs gave no visibility until someone asked "any news?",
64
+ and the worktrees those runs lived in were created by a hard rule and removed by
65
+ nobody — 35 of them (33 already merged) were sitting on disk at 40 GB with the
66
+ root filesystem at 95%. Both fixes are deterministic where prose had failed.
67
+
68
+ ### Added
69
+
70
+ - **`/dw-report` — timestamped progress loop for long work.** Every 10 minutes
71
+ (`--every <N>m`) it emits a report with a real `date` timestamp saying what is
72
+ **done** (cumulative, new items marked `➕`, each with evidence: file, commit,
73
+ test count), what is **being done** (with a measurable figure — step counter,
74
+ files touched, running command and elapsed time — never a bare "in progress"),
75
+ and what is **left** (ordered, next milestone first, remaining gates included).
76
+ Reports go to the chat and are appended to `.dw/reports/YYYY-MM-DD.md`. The
77
+ cadence is the user's: it never stretches to "wait for the build"; a report
78
+ saying "nothing changed, ~4 min left" is the product while work runs. Silence is
79
+ reserved for the blocked/idle state (the transition to blocked reports once);
80
+ completion produces a final report immediately and disarms the loop. Vehicle is
81
+ the harness's native scheduled wake-up when available, a background `sleep`
82
+ timer otherwise, and never a system cron (which keeps firing for days after the
83
+ work ended). Auto-armed by `/dw-run`, `/dw-autopilot` (execution invocation), and
84
+ the `dw-cli-run` adapters; `DW_REPORT_AUTO=off` opts out and `DW_REPORT_BELL`
85
+ hooks a local sound or notification. `now`, `status`, `stop` modes.
86
+ - **`/dw-worktree` — the lifecycle the runner adapters never had.** Backed by
87
+ `.dw/scripts/lib/worktree-gc.mjs` (Node, no dependencies), which resolves the
88
+ main checkout from anywhere in the repo. `list` gives every secondary worktree a
89
+ verdict — `REMOVABLE` (head is an ancestor of an integration branch, clean, no
90
+ process has its cwd inside, not locked), `KEEP:unmerged`, `KEEP:dirty`,
91
+ `KEEP:in-use`, `KEEP:locked`, `KEEP:recent`, `PRUNABLE` — with apparent size,
92
+ age, and dirty count; `--strict` exits 3 on leftovers. `clean` is a **dry-run by
93
+ default**; `--apply` removes only `REMOVABLE` entries, deletes their branches
94
+ (verified merged), and prunes. `create <slug>` enforces the `../<project>-<slug>`
95
+ convention and runs the install/build prep (lockfile-detected or
96
+ `.dw/config.json` `worktree.prep`) so a delegated agent never runs blind.
97
+ `merge <slug>` performs the safe order from the main checkout — ff-only merge →
98
+ remove → branch delete → prune — and aborts **before** the merge if the main
99
+ checkout is off the base branch or dirty, the worktree is dirty or in use, or
100
+ the merge is not a fast-forward. It never uses `--force` and never changes the
101
+ owner's active branch. Base resolution: `--base` → `DW_WORKTREE_BASE` →
102
+ `worktree.base` → `origin/HEAD` → `develop` → `main` → `master`.
103
+
104
+ ### Changed
105
+
106
+ - **End of life is the same turn as the merge.** `dw-cli-run` pre-flight creates
107
+ missing worktrees through `/dw-worktree create`, and its Discipline section now
108
+ carries the hard rule: merged → `/dw-worktree merge` (or `clean --apply`) in
109
+ that same turn. The three adapters point their `<WORKTREE>` input at the same
110
+ commands. `/dw-pause` sweeps worktrees and treats every `REMOVABLE` entry as an
111
+ open loop to close now rather than record; `/dw-harness-audit` gained a
112
+ *Worktree hygiene* category scored from `list --strict`.
113
+ - **git guardrails** (`scaffold/scripts/hooks/git-guardrails.mjs`) also block
114
+ `git worktree remove --force` / `-f`; plain `remove` and `prune` stay allowed.
115
+ - `/dw-run` (all-tasks and `--resume`) and `/dw-autopilot` Step 8 arm the progress
116
+ loop before dispatching; `dw-help`, the agent-instructions trigger map, and the
117
+ README register both commands (41 commands, Tier 2 = 11, Tier 3 = 14).
118
+ - `dw-cli-run` `context_limit` raised 19000 → 20500 to hold the two new sections.
119
+
120
+ ### Fixed
121
+
122
+ - `init`/`update` now create `.dw/cli-run/.gitignore` (`*`, `!.gitignore`). The
123
+ adapters' durable audit logs, session sidecars, and last-message captures were
124
+ being committed and then checked out into every worktree (219 tracked files on
125
+ the project that motivated this release). Existing projects untrack them with
126
+ `git rm -r --cached .dw/cli-run`.
127
+ - `init`/`update` create `.dw/reports/.gitignore` so the daily report logs and the
128
+ loop's `.active.json` stay machine-local while other reports (e.g.
129
+ `context-budget.md`) remain tracked.
130
+
13
131
  ## [2.1.0] — 2026-08-04
14
132
 
15
133
  Release driven by a skill-by-skill analysis of [mattpocock/skills](https://github.com/mattpocock/skills),
package/README.md CHANGED
@@ -42,18 +42,18 @@ Exportable skills (no `.dw/` pipeline required): `dw-minimalism`, `dw-search-fir
42
42
 
43
43
  ## Commands
44
44
 
45
- dev-workflow v2.1.0 ships **39 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. |
55
55
 
56
- ### Tier 2 — Pipeline granular (10)
56
+ ### Tier 2 — Pipeline granular (11)
57
57
 
58
58
  Use these when you want step-by-step control instead of `/dw-autopilot`.
59
59
 
@@ -67,10 +67,11 @@ Use these when you want step-by-step control instead of `/dw-autopilot`.
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. |
70
+ | **`/dw-report [--every <N>m]`** | Timestamped progress loop while long work runs: what is done (with evidence), what is being done (with measurable progress), what is left — every 10 minutes by default, appended to `.dw/reports/YYYY-MM-DD.md`. Silent while blocked, final report + auto-disarm when the work ends. `now`, `status`, `stop`. Auto-armed by `/dw-run`, `/dw-autopilot`, and the CLI runners; `DW_REPORT_AUTO=off` opts out, `DW_REPORT_BELL` hooks a local sound. |
70
71
  | **`/dw-commit`** | Atomic Conventional Commits for pending changes. Applies `dw-git-discipline` (one intent per commit, lint+tests+build green before). |
71
72
  | **`/dw-generate-pr [target]`** | Push the branch, draft a PR body with summary + test plan, open the browser. Hard gates: dw-verify PASS + secure-audit. |
72
73
 
73
- ### Tier 3 — Specialty (13)
74
+ ### Tier 3 — Specialty (14)
74
75
 
75
76
  | Command | What |
76
77
  |---------|------|
@@ -82,6 +83,7 @@ Use these when you want step-by-step control instead of `/dw-autopilot`.
82
83
  | **`/dw-context-budget`** | Audits context overhead from commands, skills, agents, instruction files, and MCPs. |
83
84
  | **`/dw-harness-audit`** | Deterministic health scorecard for the dev-workflow install, agents, wrappers, MCPs, and gates. |
84
85
  | **`/dw-skill-health`** | Audits installed skills and agents for bloat, duplication, and missing references. |
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`. |
85
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**. |
86
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/`. |
87
89
  | **`/dw-dockerize`** | Reads existing project, detects stack + runtime deps, proposes Dockerfile + docker-compose for dev/prod with explicit trade-offs (Conservative/Balanced/Bold). |
@@ -110,8 +112,8 @@ These are auto-invoked by Tier 1-3 commands. Available standalone via `/dw-help
110
112
  ## Workflow
111
113
 
112
114
  ```
113
- /dw-autopilot "wish" ------> First invocation: PRD → TechSpec → Tasks → STOP
114
- /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
115
117
  --- OR step-by-step ---
116
118
 
117
119
  /dw-opportunities --> /dw-brainstorm --> /dw-plan --> .dw/spec/prd-{name}/{prd,techspec,tasks}.md
@@ -226,6 +228,7 @@ your-project/
226
228
  │ ├── spec/ # PRD directories — each contains tasks-validation.md
227
229
  │ ├── bugfixes/ # Persistent bugfix records: NNN-<slug>/{TASK.md, SUMMARY.md, fix-report.md} + review/, QA/
228
230
  │ ├── goals/ # Durable goal state used by /dw-goal and /dw-autopilot
231
+ │ ├── reports/ # Progress-report loop (/dw-report): daily YYYY-MM-DD.md logs + .active.json, machine-local (gitignored)
229
232
  │ ├── secure-audit/ # Security Gate summaries and per-layer reports
230
233
  │ ├── subtasks/ # Local ephemeral subagent input packets and handoffs (pending/archive ignored by Git)
231
234
  │ └── STATE.md # Session state: Decisions, Blockers, Todos, Open Loops, Deferred Ideas, Lessons, Preferences (managed by /dw-pause + /dw-resume)
@@ -312,6 +315,8 @@ These are not slash commands — they are primitives other commands call to enfo
312
315
 
313
316
  ## Dependencies
314
317
 
318
+ 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.
319
+
315
320
  Installed via `npx @brunosps00/dev-workflow install-deps`:
316
321
 
317
322
  | Dependency | Purpose | Link |
@@ -439,3 +444,9 @@ Skill description format ("pushy" trigger phrases ≤200 chars, "Use when X. Tri
439
444
  ## License
440
445
 
441
446
  MIT
447
+
448
+ ### Task execution across tools
449
+
450
+ 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.
451
+
452
+ 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', userInvoked: true, 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', userInvoked: true, 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', userInvoked: true, 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,39 +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', userInvoked: true, 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: 'Report progress periodically during authorized long-running work; persist updates and stop reporting when the work ends.' },
32
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.' },
33
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
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.' },
35
- { 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.' },
36
+ { name: 'dw-secure-audit', description: 'Audit relevant code and dependencies for security findings using available scanners; validate exploitability and enforce blocking findings.' },
36
37
  { name: 'dw-skill-health', description: 'Audits installed skills and agents for bloat, duplication, missing references, and stale or unused modules.' },
37
38
  { name: 'dw-subtask-start', userInvoked: true, description: 'Creates a minimal input packet for a subagent without injecting the parent transcript.' },
38
39
  { name: 'dw-subtask-complete', userInvoked: true, description: 'Records a structured subagent handoff with result, files, decisions, risks, verification, and blockers.' },
39
40
  { name: 'dw-subtask-resume', userInvoked: true, description: 'Consumes pending subagent handoffs, summarizes them for the parent, and archives the local packets.' },
40
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: 'Create prepared worktrees, inspect their state, clean safely merged worktrees, or integrate an explicitly authorized branch.' },
41
43
  { name: 'dw-update', description: 'Updates dev-workflow to the latest npm release in-place, with a snapshot you can roll back to.' },
42
44
  ],
43
45
  'pt-br': [
44
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.' },
45
47
  { name: 'dw-analyze-project', description: 'Escaneia o repo para aprender stack e convencoes, e escreve as regras que os outros commands usam.' },
46
- { 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.' },
47
- { 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.' },
48
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.' },
49
- { 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.' },
50
- { 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', userInvoked: true, 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', userInvoked: true, description: 'Executa task aprovada pela CLI Codex em worktree dedicado; retorna sessão durável e evidências ao parent.' },
51
53
  { name: 'dw-commit', description: 'Trigger quando implementacao esta completa e ha mudancas pendentes pra commit. Commits atomicos com mensagens Conventional Commits.' },
52
- { 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', userInvoked: true, description: 'Executa task aprovada pela CLI Copilot em worktree dedicado; retorna sessão durável e evidências ao parent.' },
53
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.' },
54
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.' },
55
57
  { name: 'dw-functional-doc', description: 'Mapeia telas e fluxos em um dossie funcional, validado E2E com Playwright.' },
@@ -58,27 +60,29 @@ const COMMANDS = {
58
60
  { name: 'dw-help', description: 'Lista comandos primarios e fluxos que os conectam. Passe --advanced para ver comandos internos/escondidos.' },
59
61
  { name: 'dw-context-budget', description: 'Audita overhead de contexto em comandos, skills, agentes, instrucoes e MCPs; recomenda economia de tokens.' },
60
62
  { name: 'dw-harness-audit', description: 'Roda um scorecard deterministico da instalacao dev-workflow, agentes, MCPs, gates e disciplina de contexto.' },
61
- { 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.' },
62
- { 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.' },
63
65
  { name: 'dw-intel', description: 'Inteligencia do codebase: modo query (default) responde citando .dw/intel/ + .dw/rules/; modo --build (re)constroi indice.' },
64
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.' },
65
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.' },
66
- { 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', userInvoked: true, description: 'Gera ou itera protótipos HTML Open Design pela CLI od, incluindo redesign por screenshots e verificação visual.' },
67
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.' },
68
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.' },
69
- { 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.' },
70
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/.' },
71
73
  { name: 'dw-redesign-ui', description: 'Audita uma pagina frontend, propoe direcoes de design que voce escolhe, e entrega o redesign.' },
72
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: 'Reporta progresso periódico durante trabalho longo autorizado; persiste atualizações e encerra quando o trabalho termina.' },
73
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-*.' },
74
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>.' },
75
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.' },
76
- { 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.' },
79
+ { name: 'dw-secure-audit', description: 'Audita código e dependências relevantes com scanners disponíveis; valida explorabilidade e aplica achados bloqueantes.' },
77
80
  { name: 'dw-skill-health', description: 'Audita skills e agentes instalados por bloat, duplicacao, referencias quebradas e modulos sem uso.' },
78
81
  { name: 'dw-subtask-start', userInvoked: true, description: 'Cria um input packet minimo para subagente sem injetar transcript bruto do parent.' },
79
82
  { name: 'dw-subtask-complete', userInvoked: true, description: 'Registra handoff estruturado do subagente com resultado, arquivos, decisoes, riscos, verificacao e bloqueios.' },
80
83
  { name: 'dw-subtask-resume', userInvoked: true, description: 'Consome handoffs pendentes de subagentes, resume para o parent e arquiva os pacotes locais.' },
81
- { 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.' },
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.' },
82
86
  { name: 'dw-update', description: 'Atualiza o dev-workflow para o release mais recente no npm, com snapshot para rollback.' },
83
87
  ],
84
88
  };
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++;
@@ -283,6 +290,32 @@ async function run({ force = false, lang = null, mode = 'init', profile = null,
283
290
  touchedFiles.push(metricsGitignore);
284
291
  }
285
292
 
293
+ // 5.25b. Ensure .dw/reports/ + .gitignore (progress-report loop; the daily logs and
294
+ // the .active.json loop state are machine-local so they are gitignored, while other
295
+ // reports such as context-budget.md stay tracked). Created if missing on init and update.
296
+ {
297
+ const reportsDir = path.join(projectRoot, '.dw', 'reports');
298
+ ensureDir(reportsDir);
299
+ const reportsGitignore = path.join(reportsDir, '.gitignore');
300
+ const rStatus = writeFile(reportsGitignore, '????-??-??.md\n.active.json\n', false);
301
+ if (rStatus === 'created') totalCreated++;
302
+ else totalSkipped++;
303
+ touchedFiles.push(reportsGitignore);
304
+ }
305
+
306
+ // 5.25c. Ensure .dw/cli-run/ + .gitignore (durable audit logs, session sidecars and
307
+ // last-message captures of the dw-*-run adapters are machine-local; committing them
308
+ // bloats every worktree checkout). Created if missing on init and update.
309
+ {
310
+ const cliRunDir = path.join(projectRoot, '.dw', 'cli-run');
311
+ ensureDir(cliRunDir);
312
+ const cliRunGitignore = path.join(cliRunDir, '.gitignore');
313
+ const cStatus = writeFile(cliRunGitignore, '*\n!.gitignore\n', false);
314
+ if (cStatus === 'created') totalCreated++;
315
+ else totalSkipped++;
316
+ touchedFiles.push(cliRunGitignore);
317
+ }
318
+
286
319
  // 5.26. Ensure .dw/memory/instincts/ (durable learnings promoted by /dw-learn;
287
320
  // format in the dw-memory skill's references/instincts.md). Init only; preserved on update.
288
321
  if (!isUpdate) {
@@ -393,6 +426,7 @@ async function run({ force = false, lang = null, mode = 'init', profile = null,
393
426
  managedFiles: listManagedFiles(projectRoot, touchedFiles),
394
427
  });
395
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`);
396
430
 
397
431
  // 10. Summary
398
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.1.0",
3
+ "version": "2.3.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"