@brunosps00/dev-workflow 0.15.0 → 1.0.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 (135) hide show
  1. package/README.md +97 -119
  2. package/lib/constants.js +16 -36
  3. package/lib/migrate-skills.js +11 -4
  4. package/lib/removed-commands.js +30 -0
  5. package/package.json +1 -1
  6. package/scaffold/en/agent-instructions.md +27 -16
  7. package/scaffold/en/commands/dw-adr.md +2 -2
  8. package/scaffold/en/commands/dw-analyze-project.md +7 -7
  9. package/scaffold/en/commands/dw-autopilot.md +20 -20
  10. package/scaffold/en/commands/dw-brainstorm.md +160 -9
  11. package/scaffold/en/commands/dw-bugfix.md +5 -5
  12. package/scaffold/en/commands/dw-commit.md +1 -1
  13. package/scaffold/en/commands/dw-dockerize.md +9 -9
  14. package/scaffold/en/commands/dw-find-skills.md +4 -4
  15. package/scaffold/en/commands/dw-functional-doc.md +1 -1
  16. package/scaffold/en/commands/dw-generate-pr.md +4 -4
  17. package/scaffold/en/commands/dw-help.md +95 -351
  18. package/scaffold/en/commands/dw-intel.md +76 -12
  19. package/scaffold/en/commands/dw-new-project.md +9 -9
  20. package/scaffold/en/commands/dw-plan.md +175 -0
  21. package/scaffold/en/commands/dw-qa.md +166 -0
  22. package/scaffold/en/commands/dw-redesign-ui.md +6 -6
  23. package/scaffold/en/commands/dw-review.md +198 -0
  24. package/scaffold/en/commands/dw-run.md +176 -0
  25. package/scaffold/en/commands/dw-secure-audit.md +222 -0
  26. package/scaffold/en/commands/dw-update.md +1 -1
  27. package/scaffold/en/references/playwright-patterns.md +1 -1
  28. package/scaffold/en/references/refactoring-catalog.md +1 -1
  29. package/scaffold/en/templates/brainstorm-matrix.md +1 -1
  30. package/scaffold/en/templates/idea-onepager.md +3 -3
  31. package/scaffold/en/templates/project-onepager.md +5 -5
  32. package/scaffold/pt-br/agent-instructions.md +27 -16
  33. package/scaffold/pt-br/commands/dw-adr.md +2 -2
  34. package/scaffold/pt-br/commands/dw-analyze-project.md +7 -7
  35. package/scaffold/pt-br/commands/dw-autopilot.md +20 -20
  36. package/scaffold/pt-br/commands/dw-brainstorm.md +160 -9
  37. package/scaffold/pt-br/commands/dw-bugfix.md +8 -8
  38. package/scaffold/pt-br/commands/dw-commit.md +1 -1
  39. package/scaffold/pt-br/commands/dw-dockerize.md +9 -9
  40. package/scaffold/pt-br/commands/dw-find-skills.md +4 -4
  41. package/scaffold/pt-br/commands/dw-functional-doc.md +1 -1
  42. package/scaffold/pt-br/commands/dw-generate-pr.md +4 -4
  43. package/scaffold/pt-br/commands/dw-help.md +97 -300
  44. package/scaffold/pt-br/commands/dw-intel.md +77 -13
  45. package/scaffold/pt-br/commands/dw-new-project.md +9 -9
  46. package/scaffold/pt-br/commands/dw-plan.md +175 -0
  47. package/scaffold/pt-br/commands/dw-qa.md +166 -0
  48. package/scaffold/pt-br/commands/dw-redesign-ui.md +6 -6
  49. package/scaffold/pt-br/commands/dw-review.md +198 -0
  50. package/scaffold/pt-br/commands/dw-run.md +176 -0
  51. package/scaffold/pt-br/commands/dw-secure-audit.md +222 -0
  52. package/scaffold/pt-br/commands/dw-update.md +1 -1
  53. package/scaffold/pt-br/references/playwright-patterns.md +1 -1
  54. package/scaffold/pt-br/references/refactoring-catalog.md +1 -1
  55. package/scaffold/pt-br/templates/brainstorm-matrix.md +1 -1
  56. package/scaffold/pt-br/templates/idea-onepager.md +3 -3
  57. package/scaffold/pt-br/templates/project-onepager.md +5 -5
  58. package/scaffold/pt-br/templates/tasks-template.md +1 -1
  59. package/scaffold/skills/api-testing-recipes/SKILL.md +6 -6
  60. package/scaffold/skills/api-testing-recipes/references/auth-patterns.md +1 -1
  61. package/scaffold/skills/api-testing-recipes/references/matrix-conventions.md +1 -1
  62. package/scaffold/skills/api-testing-recipes/references/openapi-driven.md +3 -3
  63. package/scaffold/skills/docker-compose-recipes/SKILL.md +1 -1
  64. package/scaffold/skills/dw-codebase-intel/SKILL.md +9 -9
  65. package/scaffold/skills/dw-codebase-intel/agents/intel-updater.md +4 -4
  66. package/scaffold/skills/dw-codebase-intel/references/api-design-discipline.md +1 -1
  67. package/scaffold/skills/dw-codebase-intel/references/incremental-update.md +5 -5
  68. package/scaffold/skills/dw-codebase-intel/references/intel-format.md +1 -1
  69. package/scaffold/skills/dw-codebase-intel/references/query-patterns.md +3 -3
  70. package/scaffold/skills/dw-council/SKILL.md +2 -2
  71. package/scaffold/skills/dw-debug-protocol/SKILL.md +5 -3
  72. package/scaffold/skills/dw-execute-phase/SKILL.md +16 -16
  73. package/scaffold/skills/dw-execute-phase/agents/executor.md +5 -5
  74. package/scaffold/skills/dw-execute-phase/agents/plan-checker.md +4 -4
  75. package/scaffold/skills/dw-execute-phase/references/atomic-commits.md +1 -1
  76. package/scaffold/skills/dw-execute-phase/references/plan-verification.md +2 -2
  77. package/scaffold/skills/dw-execute-phase/references/wave-coordination.md +1 -1
  78. package/scaffold/skills/dw-git-discipline/SKILL.md +5 -2
  79. package/scaffold/skills/dw-incident-response/SKILL.md +5 -1
  80. package/scaffold/skills/dw-llm-eval/SKILL.md +10 -8
  81. package/scaffold/skills/dw-memory/SKILL.md +2 -2
  82. package/scaffold/skills/dw-review-rigor/SKILL.md +5 -5
  83. package/scaffold/skills/dw-simplification/SKILL.md +4 -4
  84. package/scaffold/skills/dw-source-grounding/SKILL.md +1 -1
  85. package/scaffold/skills/dw-testing-discipline/SKILL.md +8 -6
  86. package/scaffold/skills/dw-testing-discipline/references/agent-guardrails.md +3 -3
  87. package/scaffold/skills/dw-testing-discipline/references/anti-patterns.md +2 -2
  88. package/scaffold/skills/dw-testing-discipline/references/core-rules.md +1 -1
  89. package/scaffold/skills/dw-testing-discipline/references/flaky-discipline.md +3 -3
  90. package/scaffold/skills/dw-testing-discipline/references/patterns.md +1 -1
  91. package/scaffold/skills/dw-testing-discipline/references/playwright-recipes.md +1 -1
  92. package/scaffold/skills/dw-ui-discipline/SKILL.md +8 -6
  93. package/scaffold/skills/dw-ui-discipline/references/accessibility-floor.md +2 -2
  94. package/scaffold/skills/dw-ui-discipline/references/hard-gate.md +1 -1
  95. package/scaffold/skills/dw-ui-discipline/references/state-matrix.md +1 -1
  96. package/scaffold/skills/dw-ui-discipline/references/visual-slop.md +2 -2
  97. package/scaffold/skills/dw-verify/SKILL.md +4 -4
  98. package/scaffold/skills/humanizer/SKILL.md +1 -7
  99. package/scaffold/skills/remotion-best-practices/SKILL.md +3 -1
  100. package/scaffold/skills/security-review/SKILL.md +1 -1
  101. package/scaffold/skills/security-review/languages/csharp.md +1 -1
  102. package/scaffold/skills/security-review/languages/rust.md +1 -1
  103. package/scaffold/skills/security-review/languages/typescript.md +1 -1
  104. package/scaffold/skills/vercel-react-best-practices/SKILL.md +3 -1
  105. package/scaffold/templates-overrides-readme.md +3 -3
  106. package/scaffold/en/commands/dw-code-review.md +0 -386
  107. package/scaffold/en/commands/dw-create-prd.md +0 -148
  108. package/scaffold/en/commands/dw-create-tasks.md +0 -201
  109. package/scaffold/en/commands/dw-create-techspec.md +0 -210
  110. package/scaffold/en/commands/dw-deep-research.md +0 -418
  111. package/scaffold/en/commands/dw-deps-audit.md +0 -327
  112. package/scaffold/en/commands/dw-fix-qa.md +0 -152
  113. package/scaffold/en/commands/dw-map-codebase.md +0 -125
  114. package/scaffold/en/commands/dw-refactoring-analysis.md +0 -340
  115. package/scaffold/en/commands/dw-revert-task.md +0 -114
  116. package/scaffold/en/commands/dw-review-implementation.md +0 -349
  117. package/scaffold/en/commands/dw-run-plan.md +0 -300
  118. package/scaffold/en/commands/dw-run-qa.md +0 -497
  119. package/scaffold/en/commands/dw-run-task.md +0 -209
  120. package/scaffold/en/commands/dw-security-check.md +0 -271
  121. package/scaffold/pt-br/commands/dw-code-review.md +0 -366
  122. package/scaffold/pt-br/commands/dw-create-prd.md +0 -148
  123. package/scaffold/pt-br/commands/dw-create-tasks.md +0 -201
  124. package/scaffold/pt-br/commands/dw-create-techspec.md +0 -208
  125. package/scaffold/pt-br/commands/dw-deep-research.md +0 -172
  126. package/scaffold/pt-br/commands/dw-deps-audit.md +0 -327
  127. package/scaffold/pt-br/commands/dw-fix-qa.md +0 -152
  128. package/scaffold/pt-br/commands/dw-map-codebase.md +0 -125
  129. package/scaffold/pt-br/commands/dw-refactoring-analysis.md +0 -340
  130. package/scaffold/pt-br/commands/dw-revert-task.md +0 -114
  131. package/scaffold/pt-br/commands/dw-review-implementation.md +0 -337
  132. package/scaffold/pt-br/commands/dw-run-plan.md +0 -296
  133. package/scaffold/pt-br/commands/dw-run-qa.md +0 -495
  134. package/scaffold/pt-br/commands/dw-run-task.md +0 -208
  135. package/scaffold/pt-br/commands/dw-security-check.md +0 -271
@@ -0,0 +1,176 @@
1
+ <system_instructions>
2
+ You are the task execution orchestrator. Two modes: execute ONE specific task, or execute ALL pending tasks in dependency order. Both modes apply the same task-level guarantees (atomic commit per task, mandatory tests, verify before commit, deviation handling).
3
+
4
+ ## When to Use
5
+ - Use `run` after `/dw-plan` has produced `tasks.md` + per-task files and the tasks are approved.
6
+ - Use to execute a single targeted task during incremental development.
7
+ - Do NOT use for bug fixes — `/dw-bugfix` handles those.
8
+ - Do NOT use without an approved tasks breakdown — tasks files MUST exist.
9
+
10
+ ## Pipeline Position
11
+ **Predecessor:** `/dw-plan` (with tasks approved) | **Successor:** `/dw-review` then `/dw-commit` + `/dw-generate-pr`
12
+
13
+ ## Modes
14
+
15
+ | Invocation | Behavior |
16
+ |------------|----------|
17
+ | `/dw-run` | **Default.** Executes ALL pending tasks from `tasks.md` in dependency order. Wave-based parallel dispatch for independent tasks. Atomic commit per task. After all complete, runs Level 2 review (PRD compliance). |
18
+ | `/dw-run <task-id>` | Executes ONE specific task by ID (e.g., `1.0`, `2.3`). Includes Level 1 validation. Atomic commit on success. |
19
+ | `/dw-run --resume` | Resumes an interrupted multi-task plan from where it stopped. Reads `.dw/spec/<prd>/active-session.md` if present; otherwise continues from first pending task. |
20
+
21
+ ## Inputs
22
+
23
+ | Variable | Description | Example |
24
+ |----------|-------------|---------|
25
+ | `{{TASK_ID}}` | Specific task identifier (optional — defaults to all pending) | `1.0`, `2.3`, `5.1` |
26
+ | `{{PRD_PATH}}` | Path to PRD directory containing tasks (optional — auto-detect from active branch) | `.dw/spec/prd-invoice-export` |
27
+
28
+ ## Complementary Skills
29
+
30
+ When available under `./.agents/skills/`, these skills are invoked per task:
31
+
32
+ - `dw-verify`: **ALWAYS** — before each task's commit, produces a Verification Report (test + lint + build all GREEN). Without PASS, no commit. The Iron Law of verification.
33
+ - `dw-memory`: **ALWAYS** — reads workflow memory at task start; updates at task end with the promotion test (lessons that apply to next task get promoted to shared MEMORY.md).
34
+ - `dw-execute-phase`: provides `plan-checker` (6-dimension goal-backward verification before any code is touched in plan mode) and `executor` (atomic commit + deviation handling) agents.
35
+ - `dw-testing-discipline`: applies the placement doctrine, 6 agent guardrails, and 25 anti-patterns when adding tests during the task.
36
+ - `dw-ui-discipline`: when the task touches UI, the 4 grounding questions must be answered before any visual decision lands.
37
+ - `dw-llm-eval`: when the task touches AI feature code paths, the reference dataset + oracle ladder rules apply.
38
+ - `vercel-react-best-practices`: when the task touches React/Next.js performance.
39
+
40
+ ## Constitution Gate
41
+
42
+ <critical>BEFORE executing any task, check `.dw/constitution.md`. If MISSING, auto-install defaults via the v0.11 pattern. If PRESENT, the task's `Constitution Alignment` line (set during `/dw-plan` Stage 3) is consulted as the task executes — code must respect the claimed principles.</critical>
43
+
44
+ ## Codebase Intelligence
45
+
46
+ <critical>If `.dw/intel/` exists, query it via `/dw-intel` before implementation to align with existing patterns.</critical>
47
+ - Per-task: `/dw-intel "patterns for <task topic>"` to surface relevant conventions.
48
+
49
+ ## Mode 1: ONE task (`run <task-id>`)
50
+
51
+ ### Prerequisites
52
+ - `tasks.md` + per-task files exist in `.dw/spec/<prd>/`.
53
+ - The target task's dependencies are completed (check `task.md` "Depends on" section).
54
+
55
+ ### Behavior
56
+
57
+ 1. **Read the task file:** `.dw/spec/<prd>/<task-id>_task.md`. Understand inputs, FRs covered, acceptance criteria, subtasks.
58
+ 2. **Plan implementation:**
59
+ - List files to create/modify.
60
+ - Identify test additions per subtask.
61
+ - Confirm dependencies (if missing, STOP and surface).
62
+ 3. **Implement:**
63
+ - Follow project patterns from `.dw/rules/` and `.dw/intel/`.
64
+ - Apply complementary skills (UI gate, test discipline, etc.).
65
+ - Mandatory unit tests for backend/services per testspec.
66
+ - Match the testing framework specified in `.dw/rules/`.
67
+ 4. **Validate (Level 1):**
68
+ - Run the project's test command.
69
+ - Check acceptance criteria from the task file.
70
+ - Run `dw-verify` to produce the Verification Report (test + lint + build GREEN).
71
+ - For interactive frontend, also validate real behavior via `dw-testing-discipline` Playwright recipes if regression risk is meaningful.
72
+ 5. **Commit:**
73
+ - Atomic commit message: `feat(<scope>): <task title> (#<task-id>)`.
74
+ - Reference the FRs covered.
75
+ - One task = one commit (unless the task explicitly has subtask milestones that earn separate commits).
76
+ 6. **Update tasks.md:** mark this task as `Done` with the commit SHA.
77
+ 7. **Report:** what was done, what tests were added, what was validated.
78
+
79
+ ### STOP CONDITIONS
80
+ - Dependencies not satisfied → ask user how to proceed.
81
+ - Verification Report FAIL → do not commit; report what's broken.
82
+ - Task scope creep detected mid-implementation → STOP and ask user to scope.
83
+
84
+ ## Mode 2: ALL pending tasks (default `run`)
85
+
86
+ ### Prerequisites
87
+ - `tasks.md` + per-task files exist with declared dependencies.
88
+ - `tasks-validation.md` shows PASS (or explicit override).
89
+ - The branch is created: `feat/prd-<feature-slug>`.
90
+
91
+ ### Behavior
92
+
93
+ 1. **Plan check (via `dw-execute-phase/plan-checker` agent):**
94
+ - 6-dimension goal-backward verification: are these tasks actually going to deliver what the PRD promises?
95
+ - If FAIL on any dimension, STOP and report to user before any code is touched.
96
+ 2. **Build dependency graph:**
97
+ - Topological sort of tasks.
98
+ - Identify independent tasks that can run in parallel waves.
99
+ 3. **Wave-based parallel dispatch (via `dw-execute-phase/executor` agent):**
100
+ - Each wave contains tasks with no inter-dependencies.
101
+ - Execute waves serially; within a wave, tasks dispatch in parallel.
102
+ - Per-task: same Level 1 flow as Mode 1 (implement → validate → atomic commit).
103
+ 4. **Deviation handling:**
104
+ - If a task encounters scope creep, STOP that task, surface to user.
105
+ - If a task fails verification, the wave halts. No subsequent waves run until resolved.
106
+ 5. **Checkpoint between waves:**
107
+ - Print wave summary: tasks completed, commits, any deviations.
108
+ - Continue automatically unless `--checkpoint` was passed (then wait for user OK).
109
+ 6. **Final Level 2 review:**
110
+ - After all tasks complete, automatically invoke `/dw-review` (the merged review command — runs both PRD compliance check and code quality review).
111
+ - Present consolidated review report.
112
+ - Interactive corrections cycle: review surfaces gaps → user decides to fix, defer, or accept.
113
+
114
+ ### Output
115
+
116
+ ```
117
+ .dw/spec/<prd>/
118
+ ├── active-session.md # written at checkpoint; consumed by --resume
119
+ ├── run-log.md # per-wave execution log with commit SHAs
120
+ └── review-consolidated.md # final L2+L3 review (from /dw-review)
121
+ ```
122
+
123
+ ## Mode 3: Resume (`run --resume`)
124
+
125
+ ### Prerequisites
126
+ - Previous `run` (Mode 2) was interrupted.
127
+ - `active-session.md` exists in the current PRD's `.dw/spec/<prd>/` directory.
128
+
129
+ ### Behavior
130
+
131
+ 1. Read `active-session.md` to determine which task/wave the session stopped at.
132
+ 2. Surface to user: "Resuming from wave N, task X.0. Previously completed: <list>. Continue?"
133
+ 3. On confirmation, resume from the next pending task with the same Mode 2 behavior.
134
+
135
+ If `active-session.md` doesn't exist but uncompleted tasks remain, treat as Mode 2 fresh start.
136
+
137
+ ## Across all modes: deviation handling
138
+
139
+ When implementation cannot proceed as planned:
140
+
141
+ | Deviation | Action |
142
+ |-----------|--------|
143
+ | Task requires new dependency not in TechSpec | STOP. Suggest `/dw-plan techspec --update` to revise. |
144
+ | Acceptance criterion is ambiguous | STOP. Ask user for clarification. |
145
+ | Test framework decision missing | STOP. Use `dw-testing-discipline` placement doctrine to propose; ask for sign-off. |
146
+ | Pattern from `.dw/rules/` doesn't fit cleanly | STOP. Surface the friction; propose either an ADR-justified deviation or a rules update. |
147
+ | Hidden complexity emerges (task estimated 2h, looks like 8h) | STOP. Surface; either split the task via `/dw-plan tasks --update` or accept the delay with note. |
148
+
149
+ ## Reporting
150
+
151
+ After every run (Mode 1, 2, or 3 completion), print:
152
+
153
+ - Tasks completed with commit SHAs.
154
+ - Files touched count.
155
+ - Tests added (unit + E2E if applicable).
156
+ - Verification Report verdict per task.
157
+ - For Mode 2: final consolidated review status.
158
+ - For Mode 2: any deviations encountered and how they were resolved.
159
+
160
+ ## Anti-patterns
161
+
162
+ - Skipping `dw-verify` to "save time before commit" — produces commits that don't build.
163
+ - Running tasks without dependency satisfaction — produces commits that won't work in isolation.
164
+ - Letting wave-based parallel run without watching for deviations — silent scope creep compounds.
165
+ - Committing multiple tasks in one commit — breaks bisect, breaks revert granularity.
166
+ - Skipping the final Level 2 review in Mode 2 — ships features that don't fully match the PRD.
167
+
168
+ ## Final Guidelines
169
+
170
+ - Atomic commits are non-negotiable. One task = one commit (or one subtask-bundle if explicit).
171
+ - Tests are mandatory per the testing strategy section of the TechSpec.
172
+ - Verification Report PASS is the gate, not the goal — never weaken assertions to make tests pass.
173
+ - Deviation surfacing is a feature, not a bug. Stop and ask. The user prefers an interruption to a wrong implementation.
174
+ - For multi-day plans, `--resume` is your friend. Don't restart from zero.
175
+
176
+ </system_instructions>
@@ -0,0 +1,222 @@
1
+ <system_instructions>
2
+ You are the security audit orchestrator. Runs OWASP static review + supply-chain CVE/secret/IaC scanning + dependency outdated check + supply-chain compromise detection in one pass. Hard-gates downstream commands when CRITICAL or HIGH findings exist.
3
+
4
+ Auto-invoked by `/dw-review` and `/dw-generate-pr` for TS/Python/C#/Rust projects. Standalone invocation available for manual audit.
5
+
6
+ ## When to Use
7
+ - Auto-invoked: `/dw-review` and `/dw-generate-pr` for supported languages.
8
+ - Manual: when you suspect supply-chain compromise, want a security pass mid-development, or after dependency updates.
9
+ - Do NOT use mid-task implementation (use `/dw-run` which has lighter checks).
10
+ - Do NOT use as a substitute for human security review on high-stakes auth/payment code (use `security-review` skill PLUS this).
11
+
12
+ ## Pipeline Position
13
+ **Predecessor:** any time; auto-invoked by `/dw-review`, `/dw-generate-pr` | **Successor:** `/dw-bugfix` to address findings, or `/dw-commit` if APPROVED
14
+
15
+ ## Modes
16
+
17
+ | Invocation | What runs |
18
+ |------------|-----------|
19
+ | `/dw-secure-audit` | **Default.** Full audit: OWASP static review + Trivy SCA/secret/IaC + native lockfile audit + supply-chain check + outdated check. |
20
+ | `/dw-secure-audit --scan-only` | CI mode — runs scanners, exits with non-zero if CRITICAL or HIGH findings. No remediation planning. |
21
+ | `/dw-secure-audit --plan` | Default scan, plus per-package remediation plan (Conservative / Balanced / Bold options). No file writes; just the plan. |
22
+ | `/dw-secure-audit --execute` | Plan plus apply updates: scoped tests per package, one `/dw-qa --fix` retry on failure, atomic commits, `/dw-qa` as final gate. Reverts and marks BLOCKED if recovery fails. |
23
+
24
+ ## Supported Languages
25
+
26
+ | Language | Lockfile Audit | OWASP Pattern | Trivy SCA/Secrets/IaC | Compromise Check |
27
+ |----------|---------------|---------------|----------------------|------------------|
28
+ | TypeScript / JavaScript | `npm audit` / `pnpm audit` | Yes | Yes | Yes (OSV + GH Advisories) |
29
+ | Python | `pip-audit` | Yes | Yes | Yes |
30
+ | C# / .NET | `dotnet list package --vulnerable` | Yes | Yes | Yes |
31
+ | Rust | `cargo audit` | Yes | Yes | Yes |
32
+ | Other (Go, Java, etc.) | manual | Yes (best-effort) | Yes (Trivy) | Yes (OSV) |
33
+
34
+ ## Required Dependencies
35
+
36
+ - **Trivy** — must be installed (via `npx @brunosps00/dev-workflow install-deps`).
37
+ - **Context7 MCP** — for framework-version-specific security best practices.
38
+
39
+ ## Three Detection Layers
40
+
41
+ ### Layer 1: OWASP Static Review (via `security-review` skill)
42
+
43
+ Language-aware static analysis against OWASP Top 10 categories:
44
+ - A01 Broken access control
45
+ - A02 Cryptographic failures
46
+ - A03 Injection (SQL, NoSQL, OS command, etc.)
47
+ - A04 Insecure design
48
+ - A05 Security misconfiguration
49
+ - A06 Vulnerable / outdated components (overlaps with Layer 2)
50
+ - A07 Identification + authentication failures
51
+ - A08 Software / data integrity failures
52
+ - A09 Security logging + monitoring failures
53
+ - A10 Server-side request forgery (SSRF)
54
+
55
+ Output: `.dw/secure-audit/owasp-findings.md` with per-category findings ordered by severity.
56
+
57
+ ### Layer 2: Trivy + native lockfile audit
58
+
59
+ Runs in parallel:
60
+ - `trivy fs <project>` — scans for SCA (known CVEs), secret leaks, IaC issues.
61
+ - `trivy config <project>` — scans Terraform / Dockerfile / K8s configs.
62
+ - Native auditor per language (npm audit / pip-audit / dotnet list / cargo audit) — lockfile-level CVEs.
63
+
64
+ Output: `.dw/secure-audit/trivy-findings.md` + `.dw/secure-audit/lockfile-findings.md`.
65
+
66
+ ### Layer 3: Supply-chain compromise check
67
+
68
+ Cross-references the dependency tree against:
69
+ - **OSV.dev** — open-source vulnerabilities database.
70
+ - **GitHub Advisories** — npm/PyPI/etc. published advisories.
71
+ - **Hardcoded historical malicious-package list** — `event-stream`, `ua-parser-js`, `node-ipc`, etc. (known compromised packages by name+version range).
72
+
73
+ Output: `.dw/secure-audit/compromise-findings.md` per affected package: COMPROMISED / suspicious / clean.
74
+
75
+ ### Plus: outdated check
76
+
77
+ `npm outdated` / `pip list --outdated` / `dotnet list outdated` / `cargo outdated` to identify packages behind by minor or major versions.
78
+
79
+ Output: `.dw/secure-audit/outdated.md` with severity tiers (OUTDATED-MAJOR / OUTDATED-MINOR).
80
+
81
+ ## Classification
82
+
83
+ All findings are classified into one of these tiers in `.dw/secure-audit/audit-summary.md`:
84
+
85
+ | Tier | Criteria | Block | Suggested Action |
86
+ |------|----------|-------|------------------|
87
+ | **COMPROMISED** | Package known to be malicious in this version range | YES | Immediate remove / pin to safe version |
88
+ | **CRITICAL** | CVE CVSS ≥9.0 OR exploits in the wild OR auth bypass | YES | Update or replace within 24h |
89
+ | **HIGH** | CVE CVSS 7.0–8.9 OR exploitable in current context | YES | Update or replace within 1 week |
90
+ | **OUTDATED-MAJOR** | ≥1 major version behind (e.g., React 17 → 19) | NO | Plan migration in next quarter |
91
+ | **OUTDATED-MINOR** | Minor/patch behind | NO | Update routinely |
92
+ | **CLEAN** | No findings | NO | — |
93
+
94
+ ## Hard Gates
95
+
96
+ The verdict is one of:
97
+ - **APPROVED** — no CRITICAL or HIGH or COMPROMISED findings. Verdict file `.dw/secure-audit/audit-summary.md` status: APPROVED.
98
+ - **REJECTED** — ≥1 CRITICAL, HIGH, or COMPROMISED finding without explicit ADR or remediation in flight. Verdict file status: REJECTED.
99
+
100
+ **`/dw-review` and `/dw-generate-pr` enforce:** if the project's language is supported AND the most recent `.dw/secure-audit/audit-summary.md` is missing OR REJECTED, those commands themselves return REJECTED. No exception. No bypass flag.
101
+
102
+ ## Mode 1: Default (`/dw-secure-audit`)
103
+
104
+ 1. **Detect stack**: check for package.json / requirements.txt / *.csproj / Cargo.toml.
105
+ 2. **Run all three layers in parallel** (where possible):
106
+ - OWASP static (via `security-review` skill).
107
+ - Trivy + lockfile audit.
108
+ - Supply-chain compromise check.
109
+ 3. **Run outdated check.**
110
+ 4. **Aggregate findings** per classification tier.
111
+ 5. **Write summary** at `.dw/secure-audit/audit-summary.md`:
112
+
113
+ ```markdown
114
+ # Security Audit — YYYY-MM-DD
115
+
116
+ ## Verdict: APPROVED / REJECTED
117
+
118
+ ## Tier Summary
119
+ | Tier | Count | Detail |
120
+ |------|-------|--------|
121
+ | COMPROMISED | N | <list> |
122
+ | CRITICAL | N | <list> |
123
+ | HIGH | N | <list> |
124
+ | OUTDATED-MAJOR | N | <list> |
125
+ | OUTDATED-MINOR | N | <list> |
126
+
127
+ ## Layer reports
128
+ - OWASP findings: `owasp-findings.md`
129
+ - Trivy findings: `trivy-findings.md`
130
+ - Lockfile findings: `lockfile-findings.md`
131
+ - Compromise findings: `compromise-findings.md`
132
+ - Outdated: `outdated.md`
133
+
134
+ ## Next Steps
135
+ - If APPROVED: downstream commands unblocked.
136
+ - If REJECTED: run `/dw-secure-audit --plan` to draft remediation, OR `/dw-bugfix` per critical finding.
137
+ ```
138
+
139
+ ## Mode 2: Plan mode (`/dw-secure-audit --plan`)
140
+
141
+ After the default scan, draft a per-package remediation plan in `.dw/secure-audit/remediation-plan.md`:
142
+
143
+ For each finding with severity ≥HIGH (or any COMPROMISED):
144
+ 1. Identify affected files (imports of the package in source).
145
+ 2. Identify tests that cover those files (impact scope for the remediation).
146
+ 3. Propose three options:
147
+ - **Conservative** — pin to a patched version within the same major.
148
+ - **Balanced** — update to the latest minor or major.
149
+ - **Bold** — replace the package OR refactor away from it.
150
+ 4. Trade-off analysis per option (effort, risk, blast radius).
151
+
152
+ Plan does NOT execute. User reviews and chooses an option per package, then invokes `--execute`.
153
+
154
+ ## Mode 3: Execute (`/dw-secure-audit --execute`)
155
+
156
+ For each user-approved remediation:
157
+ 1. Apply the update (`npm install <pkg>@<ver>` or equivalent).
158
+ 2. Run scoped tests (tests in files that import the package).
159
+ 3. If tests fail → run `/dw-qa --fix` once to attempt automatic recovery.
160
+ 4. If recovery succeeds → atomic commit `chore(security): update <pkg> to <ver> for <CVE>`.
161
+ 5. If recovery fails → REVERT the update, mark BLOCKED in `remediation-plan.md`, surface to user.
162
+ 6. After all approved remediations: run `/dw-qa` as final gate. If clean, run `/dw-secure-audit` again to verify all findings resolved.
163
+
164
+ ## Mode 4: CI mode (`/dw-secure-audit --scan-only`)
165
+
166
+ Minimal output:
167
+ - Runs all three layers.
168
+ - Writes findings to disk.
169
+ - Exits with code 0 if APPROVED, 1 if REJECTED.
170
+ - No remediation planning.
171
+
172
+ For pre-merge CI gates.
173
+
174
+ ## Complementary Skills
175
+
176
+ - `security-review`: **ALWAYS** — OWASP static review skill ships with the scan.
177
+ - `dw-source-grounding`: **ALWAYS** in `--plan` / `--execute` mode — version recommendations cite official changelog/release notes with `[source: <url>, version: X.Y, retrieved: YYYY-MM-DD]`.
178
+ - `dw-council`: auto opt-in when ≥3 packages land in COMPROMISED tier — multi-advisor stress-test on remediation order and scope.
179
+ - `dw-testing-discipline`: when scoped tests fail in `--execute`, the testing doctrine applies (no flaky retry; investigate).
180
+ - `dw-debug-protocol`: when a critical finding turns out to be a real bug in our own code (not just an outdated dep), the six-step triage applies.
181
+
182
+ ## Constitution Gate
183
+
184
+ <critical>
185
+ - A CRITICAL or COMPROMISED finding without an ADR justifying explicit acceptance → verdict cannot be APPROVED.
186
+ - Constitution principle violations (security-related principles like P-009 server-side auth, P-010 secrets-in-repo) escalate findings — a `severity: info` principle violation surfaced here becomes a HIGH classification.
187
+ </critical>
188
+
189
+ ## Anti-patterns
190
+
191
+ - Running `--scan-only` in CI but no one reviews the report — automated REJECTs accumulate, team learns to ignore.
192
+ - Skipping `--execute` and applying updates manually without scoped tests — breaks unrelated things.
193
+ - Marking findings as "false positive" without ADR — pattern erodes over time.
194
+ - Updating a CRITICAL finding to the BLEEDING edge version instead of the patched-and-stable version — introduces new bugs.
195
+ - Running scans only at PR time — supply-chain attacks hit overnight; consider scheduled daily runs.
196
+
197
+ ## Output Directory
198
+
199
+ ```
200
+ .dw/secure-audit/
201
+ ├── audit-summary.md # verdict + tier summary
202
+ ├── owasp-findings.md # Layer 1
203
+ ├── trivy-findings.md # Layer 2 (SCA + secrets + IaC)
204
+ ├── lockfile-findings.md # Layer 2 (native auditor)
205
+ ├── compromise-findings.md # Layer 3
206
+ ├── outdated.md # outdated check
207
+ ├── remediation-plan.md # --plan output
208
+ └── execution-log.md # --execute log
209
+ ```
210
+
211
+ All files committed. Audit history is part of the repo.
212
+
213
+ ## Why this skill exists
214
+
215
+ Previously two commands: `/dw-secure-audit` (single-shot gate) and `/dw-secure-audit --plan` (planner + remediator). The split was historical — both share the same scanners and overlapping findings. Consolidating reduces:
216
+ - Confusion ("which one do I run?").
217
+ - Duplicate scans (running both did 2× the Trivy work).
218
+ - Reporting fragmentation (two separate output dirs).
219
+
220
+ The new command has both behaviors as flag modes. Default = the v0.6-era `security-check` (gate). `--plan` and `--execute` cover the v0.7-era `deps-audit` (planner + remediator).
221
+
222
+ </system_instructions>
@@ -78,7 +78,7 @@ npx -y @brunosps00/dev-workflow@latest update --lang=$DETECTED_LANG
78
78
  The `update` command overwrites managed files and PRESERVES:
79
79
  - `.dw/rules/` (user rules)
80
80
  - `.dw/spec/` (in-progress PRDs and tasks)
81
- - `.dw/intel/` (codebase index from `/dw-map-codebase`)
81
+ - `.dw/intel/` (codebase index from `/dw-intel --build`)
82
82
 
83
83
  The `update` command also runs the GSD migration step automatically — if a project has legacy `.planning/` (from prior GSD usage), the contents are migrated to `.dw/intel/`, `.dw/spec/active-session.md`, `.dw/spec/quick/`, etc., and `.planning/` is renamed to `.planning.gsd-archive-<DATE>/` for inspection. The `.claude/commands/gsd/`, `.claude/agents/gsd-*.md`, `.claude/hooks/gsd-*.js`, and `.claude/gsd-file-manifest.json` files are removed during the migration.
84
84
 
@@ -1,6 +1,6 @@
1
1
  # Playwright Test Patterns
2
2
 
3
- Reference for `/dw-run-qa` and `/dw-functional-doc`. Common E2E patterns.
3
+ Reference for `/dw-qa` and `/dw-functional-doc`. Common E2E patterns.
4
4
 
5
5
  ## 1. Authenticated Navigation
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Refactoring Catalog — Before/After Examples
2
2
 
3
- Reference for `/dw-refactoring-analysis`. Based on Fowler's refactoring catalog.
3
+ Reference for `/dw-brainstorm --refactor`. Based on Fowler's refactoring catalog.
4
4
 
5
5
  ## 1. Long Function → Extract Function
6
6
 
@@ -49,4 +49,4 @@
49
49
  ## Next Steps
50
50
 
51
51
  - [ ] Validate with stakeholders
52
- - [ ] Create PRD: `/dw-create-prd`
52
+ - [ ] Create PRD: `/dw-plan prd`
@@ -22,7 +22,7 @@ Focus on the problem, not the solution. Avoid jumping into "how to implement".]
22
22
  Sources:
23
23
  - PRDs in `.dw/spec/prd-*/prd.md` (features already delivered or in development)
24
24
  - `.dw/rules/index.md` (product overview)
25
- - `.dw/intel/` (queryable index — built by `/dw-map-codebase`, queried via `/dw-intel`)
25
+ - `.dw/intel/` (queryable index — built by `/dw-intel --build`, queried via `/dw-intel`)
26
26
 
27
27
  Format:]
28
28
 
@@ -85,6 +85,6 @@ Ideally 2-4 stories. If it's more than 5, it's probably not MVP.]
85
85
 
86
86
  Pick ONE:
87
87
 
88
- - **`/dw-create-prd`** using this one-pager as input — when the direction is clear but we need to detail user stories, acceptance criteria, and hand off to techspec
89
- - **`/dw-run-task`** — when it's an IMPROVES so small that it fits in a single task (up to 3 files, no new endpoint/screen) — write a quick PRD first
88
+ - **`/dw-plan prd`** using this one-pager as input — when the direction is clear but we need to detail user stories, acceptance criteria, and hand off to techspec
89
+ - **`/dw-run`** — when it's an IMPROVES so small that it fits in a single task (up to 3 files, no new endpoint/screen) — write a quick PRD first
90
90
  - **Stop here** — if any "Open Question" is blocking, stop and resolve with the stakeholder before advancing
@@ -94,12 +94,12 @@ services: []
94
94
 
95
95
  ## MVP Scope
96
96
 
97
- [The smallest first feature you'll ship. Thought as user stories — this should drive the first /dw-create-prd run.]
97
+ [The smallest first feature you'll ship. Thought as user stories — this should drive the first /dw-plan prd run.]
98
98
 
99
99
  - As a [persona], I can [action] so that [benefit]
100
100
  - As a [persona], I can [action] so that [benefit]
101
101
 
102
- If you don't have a first feature in mind yet, that's OK — leave a placeholder and run /dw-create-prd when ready.
102
+ If you don't have a first feature in mind yet, that's OK — leave a placeholder and run /dw-plan prd when ready.
103
103
 
104
104
  ## Not Doing (explicit)
105
105
 
@@ -115,7 +115,7 @@ If you don't have a first feature in mind yet, that's OK — leave a placeholder
115
115
 
116
116
  ## Open Questions
117
117
 
118
- [Things this one-pager cannot answer alone. Resolve before /dw-create-prd or escalate to a stakeholder.]
118
+ [Things this one-pager cannot answer alone. Resolve before /dw-plan prd or escalate to a stakeholder.]
119
119
 
120
120
  - [question 1]
121
121
  - [question 2]
@@ -124,6 +124,6 @@ If you don't have a first feature in mind yet, that's OK — leave a placeholder
124
124
 
125
125
  Pick ONE:
126
126
 
127
- - **`/dw-create-prd`** — when you have a first feature in mind and want to draft the PRD on top of this stack
127
+ - **`/dw-plan prd`** — when you have a first feature in mind and want to draft the PRD on top of this stack
128
128
  - **`/dw-analyze-project`** — after the first substantial commit, to enrich `.dw/rules/` with module-level conventions
129
- - **`/dw-deps-audit --scan-only`** — to confirm no vulnerable deps shipped from the `create-*` templates
129
+ - **`/dw-secure-audit --plan --scan-only`** — to confirm no vulnerable deps shipped from the `create-*` templates
@@ -11,28 +11,42 @@ Este projeto usa [`@brunosps00/dev-workflow`](https://www.npmjs.com/package/@bru
11
11
  |------------------------------------------------|--------------|
12
12
  | "Implementa X" / "Cria Y" / "Adiciona feature Z" / "Preciso de..." | `/dw-autopilot "X"` |
13
13
  | Erro colado / "X está quebrado" / "Bug em Y" / screenshot de teste falhando | `/dw-bugfix "X"` |
14
- | "Roda essa task" (com ID da task) | `/dw-run-task <ID>` |
15
- | "Roda todas as tasks pendentes" / "Executa o plano" | `/dw-run-plan` |
16
- | "Revisa meu PR" / "Checa qualidade do código" / "Tá pronto pra subir?" | `/dw-code-review` |
14
+ | "Planeja essa feature" / "Escreve PRD + techspec + tasks" | `/dw-plan "X"` |
15
+ | "Escreve PRD pra X" / "Especifica Y" | `/dw-plan prd "X"` |
16
+ | "Desenha a arquitetura" / "Faz o techspec" | `/dw-plan techspec` |
17
+ | "Quebra em tasks" | `/dw-plan tasks` |
18
+ | "Roda essa task" (com ID da task) | `/dw-run <ID>` |
19
+ | "Roda todas as tasks pendentes" / "Executa o plano" | `/dw-run` |
20
+ | "Continue de onde parei" | `/dw-run --resume` |
21
+ | "QA dessa feature" / "Roda o test plan" | `/dw-qa` |
22
+ | "Corrige os bugs do QA" | `/dw-qa --fix` |
23
+ | "Avalia a feature AI" / "Testa o RAG / classifier" | `/dw-qa --ai` |
24
+ | "Revisa meu PR" / "Checa qualidade" / "Tá pronto pra subir?" | `/dw-review` |
25
+ | "Só checagem de cobertura PRD" | `/dw-review --coverage-only` |
26
+ | "Só code review qualidade" | `/dw-review --code-only` |
17
27
  | "Hora de commitar" / mudanças validadas e prontas | `/dw-commit` |
18
28
  | "Abre um PR" / "Sobe isso" | `/dw-generate-pr` |
19
- | "Escreve PRD pra X" / "Especifica Y" | `/dw-create-prd` |
20
- | "Desenha a arquitetura" / "Faz o techspec" | `/dw-create-techspec` |
21
- | "Quebra em tasks" | `/dw-create-tasks` |
29
+ | "Brainstorm X" / "Explora ideias" | `/dw-brainstorm "X"` |
30
+ | "Research X" / "Compara A vs B com citações" | `/dw-brainstorm --research "X"` |
31
+ | "Auditoria de saúde do código" / "Tech debt" / "Oportunidades de refactor" | `/dw-brainstorm --refactor` |
22
32
  | "Onde está X?" / "O que usa Y?" / "Como Z é estruturado?" | `/dw-intel "<pergunta>"` |
23
- | "Audita nossas dependências" / "Estamos atrasados em pacotes?" | `/dw-deps-audit` |
24
- | "Scan de vulnerabilidades" / "Check de segurança" | `/dw-security-check` |
25
- | "QA dessa feature" / "Roda o test plan" | `/dw-run-qa` |
26
- | "Corrige os bugs do QA" | `/dw-fix-qa` |
33
+ | "Reconstrói o índice" / "Refresh do intel" | `/dw-intel --build` |
34
+ | "Redesign dessa UI" / "Audita e entrega novo design" | `/dw-redesign-ui "<target>"` |
35
+ | "Audita dependências" / "Estamos atrasados em pacotes?" | `/dw-secure-audit --plan` |
36
+ | "Scan de vulnerabilidades" / "Check de segurança" | `/dw-secure-audit` |
37
+ | "Analisa esse projeto" / "Gera rules" | `/dw-analyze-project` |
38
+ | "Abre um novo projeto" / "Bootstrap de stack" | `/dw-new-project` |
39
+ | "Dockeriza isso" / "Adiciona docker-compose" | `/dw-dockerize` |
40
+ | "Functional doc" / "Mapeia screens e flows" | `/dw-functional-doc` |
27
41
 
28
42
  **Prioridade:** na dúvida entre dois comandos, `/dw-autopilot` é o default mais seguro pra qualquer pedido de feature não-trivial — ele compõe os demais.
29
43
 
30
44
  ## Hard Gates (os comandos enforçam — não burle)
31
45
 
32
46
  - **`.dw/constitution.md`**: princípios com `severity: high` ou `critical` bloqueiam PRs / techspecs sem um ADR justificando o desvio. Constitution ausente? Os comandos auto-instalam defaults em `severity: info` (não-bloqueante) e seguem — ausência nunca bloqueia.
33
- - **`.dw/spec/<prd>/tasks-validation.md`**: auto-gerado no fim do `/dw-create-tasks`. Qualquer dimensão FAIL bloqueia approval do usuário até resolver ou override explícito.
47
+ - **`.dw/spec/<prd>/tasks-validation.md`**: auto-gerado no fim do `/dw-plan tasks`. Qualquer dimensão FAIL bloqueia approval do usuário até resolver ou override explícito.
34
48
  - **Verification**: `/dw-generate-pr` exige `dw-verify` PASS fresco (testes + lint + build) depois do último edit.
35
- - **Segurança**: projetos TS / Python / C# / Rust precisam passar `/dw-security-check` (Trivy + OWASP + lockfile audit) antes do PR abrir.
49
+ - **Segurança**: projetos TS / Python / C# / Rust precisam passar `/dw-secure-audit` (Trivy + OWASP + lockfile audit) antes do PR abrir.
36
50
 
37
51
  ## Escape Hatches — NÃO auto-trigger
38
52
 
@@ -52,10 +66,7 @@ Quando qualquer destes se aplica, responda direto e **não** invoque comando `dw
52
66
 
53
67
  --- OU passo a passo ---
54
68
 
55
- /dw-brainstorm ─► /dw-create-prd ─► /dw-create-techspec ─► /dw-create-tasks
56
-
57
-
58
- /dw-commit + /dw-generate-pr ◄──── /dw-code-review ◄──── /dw-run-plan
69
+ /dw-brainstorm ─► /dw-plan ─► /dw-run ─► /dw-qa ─► /dw-review ─► /dw-commit ─► /dw-generate-pr
59
70
  ```
60
71
 
61
72
  Lista completa e ajuda contextual: `/dw-help`.
@@ -3,12 +3,12 @@ Você é um registrador de decisões arquiteturais. Sua função é criar um **A
3
3
 
4
4
  ## Quando Usar
5
5
  - Use quando uma decisão arquitetural ou de design foi tomada e precisa ser registrada para referência futura (escolha de biblioteca, padrão de comunicação, tradeoff de performance, restrição imposta por compliance, etc.)
6
- - Use durante `/dw-create-techspec` ou `/dw-run-task` quando a justificativa da decisão não cabe no techspec nem no task file
6
+ - Use durante `/dw-plan techspec` ou `/dw-run` quando a justificativa da decisão não cabe no techspec nem no task file
7
7
  - NÃO use para decisões triviais ou reversíveis sem custo (escolha de nome de variável, ordem de import)
8
8
  - NÃO use para registrar bugs ou incidents (use `/dw-bugfix` ou notas operacionais)
9
9
 
10
10
  ## Posição no Pipeline
11
- **Antecessor:** qualquer ponto do pipeline após `/dw-create-prd` | **Sucessor:** continua o fluxo anterior (techspec, task, review)
11
+ **Antecessor:** qualquer ponto do pipeline após `/dw-plan prd` | **Sucessor:** continua o fluxo anterior (techspec, task, review)
12
12
 
13
13
  O ADR é **aditivo**: ele não substitui nenhuma etapa do pipeline. Qualquer command existente pode invocar `/dw-adr` quando uma decisão não-trivial precisar de registro permanente.
14
14
 
@@ -24,10 +24,10 @@ Você é um assistente especializado em análise de projetos de software. Sua ta
24
24
 
25
25
  ## Consumidores da Saída
26
26
  As rules geradas por este comando são consumidas por:
27
- - `/dw-run-task` -- lê rules para padrões de implementação
28
- - `/dw-code-review` -- lê rules para verificações de conformidade
29
- - `/dw-refactoring-analysis` -- lê rules para contexto do projeto
30
- - `/dw-create-techspec` -- lê rules para decisões de arquitetura
27
+ - `/dw-run` -- lê rules para padrões de implementação
28
+ - `/dw-review --code-only` -- lê rules para verificações de conformidade
29
+ - `/dw-brainstorm --refactor` -- lê rules para contexto do projeto
30
+ - `/dw-plan techspec` -- lê rules para decisões de arquitetura
31
31
 
32
32
  <critical>NUNCA modifique código fonte, apenas leia e documente</critical>
33
33
  <critical>Gere os arquivos de rules em .dw/rules/ na raiz do workspace</critical>
@@ -218,13 +218,13 @@ Para cada projeto/módulo detectado, identificar:
218
218
  Quando React for detectado, execute `npx react-doctor@latest --verbose` e inclua o health score nas rules geradas como métrica baseline.
219
219
  Para projetos Angular, execute `ng lint` e documente warnings como baseline.
220
220
 
221
- <critical>A execução do /dw-map-codebase para gerar o índice queryable em .dw/intel/ é OBRIGATÓRIA. O comando NÃO pode ser considerado completo sem ela.</critical>
221
+ <critical>A execução do /dw-intel --build para gerar o índice queryable em .dw/intel/ é OBRIGATÓRIA. O comando NÃO pode ser considerado completo sem ela.</critical>
222
222
 
223
223
  #### Inteligência do Codebase (nativo)
224
224
 
225
- Após gerar as rules em `.dw/rules/`, delegue para `/dw-map-codebase` para criar o índice queryable em `.dw/intel/`:
225
+ Após gerar as rules em `.dw/rules/`, delegue para `/dw-intel --build` para criar o índice queryable em `.dw/intel/`:
226
226
  - O índice inclui: stack (`stack.json`), grafo de arquivos (`files.json`), superfície de API (`apis.json`), dependências (`deps.json`), overview de arquitetura (`arch.md`)
227
- - O índice é incremental — `/dw-map-codebase --files <list>` atualiza só os entries tocados; full scan só quando preciso
227
+ - O índice é incremental — `/dw-intel --build --files <list>` atualiza só os entries tocados; full scan só quando preciso
228
228
  - Outros comandos dw-* consultam o índice via `/dw-intel` (veja a skill bundled `dw-codebase-intel` para schemas)
229
229
 
230
230
  ### Passo 4: Ler Arquivos Fonte Representativos (Obrigatório)