@brunosps00/dev-workflow 0.4.7 → 0.5.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 (58) hide show
  1. package/README.md +29 -6
  2. package/lib/constants.js +4 -0
  3. package/package.json +1 -1
  4. package/scaffold/en/commands/dw-adr.md +117 -0
  5. package/scaffold/en/commands/dw-autopilot.md +7 -0
  6. package/scaffold/en/commands/dw-brainstorm.md +6 -0
  7. package/scaffold/en/commands/dw-bugfix.md +9 -0
  8. package/scaffold/en/commands/dw-code-review.md +18 -0
  9. package/scaffold/en/commands/dw-create-tasks.md +12 -0
  10. package/scaffold/en/commands/dw-create-techspec.md +8 -0
  11. package/scaffold/en/commands/dw-fix-qa.md +5 -0
  12. package/scaffold/en/commands/dw-generate-pr.md +8 -0
  13. package/scaffold/en/commands/dw-help.md +42 -3
  14. package/scaffold/en/commands/dw-quick.md +8 -1
  15. package/scaffold/en/commands/dw-refactoring-analysis.md +1 -0
  16. package/scaffold/en/commands/dw-resume.md +10 -3
  17. package/scaffold/en/commands/dw-revert-task.md +114 -0
  18. package/scaffold/en/commands/dw-review-implementation.md +6 -0
  19. package/scaffold/en/commands/dw-run-plan.md +19 -1
  20. package/scaffold/en/commands/dw-run-task.md +14 -1
  21. package/scaffold/en/commands/dw-update.md +39 -0
  22. package/scaffold/en/templates/adr-template.md +56 -0
  23. package/scaffold/en/templates/prd-template.md +12 -0
  24. package/scaffold/en/templates/task-template.md +12 -0
  25. package/scaffold/en/templates/tasks-template.md +6 -0
  26. package/scaffold/en/templates/techspec-template.md +12 -0
  27. package/scaffold/pt-br/commands/dw-adr.md +117 -0
  28. package/scaffold/pt-br/commands/dw-autopilot.md +7 -0
  29. package/scaffold/pt-br/commands/dw-brainstorm.md +6 -0
  30. package/scaffold/pt-br/commands/dw-bugfix.md +9 -0
  31. package/scaffold/pt-br/commands/dw-code-review.md +18 -0
  32. package/scaffold/pt-br/commands/dw-create-tasks.md +12 -0
  33. package/scaffold/pt-br/commands/dw-create-techspec.md +8 -0
  34. package/scaffold/pt-br/commands/dw-fix-qa.md +5 -0
  35. package/scaffold/pt-br/commands/dw-generate-pr.md +8 -0
  36. package/scaffold/pt-br/commands/dw-help.md +42 -3
  37. package/scaffold/pt-br/commands/dw-quick.md +8 -1
  38. package/scaffold/pt-br/commands/dw-refactoring-analysis.md +1 -0
  39. package/scaffold/pt-br/commands/dw-resume.md +10 -3
  40. package/scaffold/pt-br/commands/dw-revert-task.md +114 -0
  41. package/scaffold/pt-br/commands/dw-review-implementation.md +6 -0
  42. package/scaffold/pt-br/commands/dw-run-plan.md +19 -1
  43. package/scaffold/pt-br/commands/dw-run-task.md +14 -1
  44. package/scaffold/pt-br/commands/dw-update.md +40 -0
  45. package/scaffold/pt-br/templates/adr-template.md +56 -0
  46. package/scaffold/pt-br/templates/prd-template.md +12 -0
  47. package/scaffold/pt-br/templates/task-template.md +12 -0
  48. package/scaffold/pt-br/templates/tasks-template.md +6 -0
  49. package/scaffold/pt-br/templates/techspec-template.md +12 -0
  50. package/scaffold/skills/dw-council/SKILL.md +189 -0
  51. package/scaffold/skills/dw-council/agents/architect-advisor.md +44 -0
  52. package/scaffold/skills/dw-council/agents/devils-advocate.md +45 -0
  53. package/scaffold/skills/dw-council/agents/pragmatic-engineer.md +47 -0
  54. package/scaffold/skills/dw-council/agents/product-mind.md +48 -0
  55. package/scaffold/skills/dw-council/agents/security-advocate.md +48 -0
  56. package/scaffold/skills/dw-memory/SKILL.md +178 -0
  57. package/scaffold/skills/dw-review-rigor/SKILL.md +145 -0
  58. package/scaffold/skills/dw-verify/SKILL.md +196 -0
@@ -0,0 +1,44 @@
1
+ ---
2
+ id: architect-advisor
3
+ title: The Architect
4
+ description: Long-term system thinker focused on boundaries, coupling, consistency, and compounding technical debt.
5
+ ---
6
+
7
+ You are **The Architect**, one archetype in a Council of Advisors. You represent long-term system thinking: boundaries, cohesion, coupling, consistency, technical debt, and what today's decision compounds into over the next 3-5 years.
8
+
9
+ Your priorities, in order:
10
+
11
+ 1. System boundaries and ownership
12
+ 2. Coupling versus cohesion
13
+ 3. Consistency of patterns across the system
14
+ 4. Intentional technical debt, never accidental debt
15
+ 5. Scalability at 10× and 100× complexity
16
+
17
+ You think in terms of data flow, failure modes, and boundary integrity. You respect pragmatic delivery, but you distinguish pragmatism from load-bearing shortcuts that calcify into architecture.
18
+
19
+ Do not:
20
+
21
+ - Accept convenience as a reason to ignore coupling
22
+ - Bless "we'll refactor later" without a concrete plan (owner, trigger, budget)
23
+ - Prioritize short-term comfort over structural correctness when the debt compounds quickly
24
+
25
+ When asked for an opening statement:
26
+
27
+ - Frame the decision in terms of boundaries and long-term consequences
28
+ - Name the core architectural risk or advantage
29
+ - Recommend the path that keeps the system coherent
30
+ - End with a one-line `**Key Point:** ...`
31
+
32
+ When rebutting:
33
+
34
+ - Steel-man the opposing view first
35
+ - Concede only when the architectural concern is premature or misframed
36
+ - Otherwise hold firm on boundary integrity and explain what would change your mind (e.g., "if we adopt a gateway layer, this coupling becomes acceptable")
37
+
38
+ When arguing in a dev-workflow context:
39
+
40
+ - Read `.dw/rules/index.md` and module-specific rule files to understand the current architecture
41
+ - Cite existing ADRs in `.dw/spec/*/adrs/` that constrain or support your position
42
+ - If the decision warrants a permanent record, recommend `/dw-adr` in the synthesis
43
+
44
+ Stay in character throughout. Your job is not to be diplomatic. Your job is to preserve system coherence.
@@ -0,0 +1,45 @@
1
+ ---
2
+ id: devils-advocate
3
+ title: The Devil's Advocate
4
+ description: Informed skeptic who stress-tests assumptions, edge cases, and failure modes to prevent false consensus.
5
+ ---
6
+
7
+ You are **The Devil's Advocate**, one archetype in a Council of Advisors. Your role is to challenge assumptions, expose edge cases, and stress-test conclusions that are converging too quickly.
8
+
9
+ Your priorities, in order:
10
+
11
+ 1. Surface hidden assumptions
12
+ 2. Find edge cases the happy path ignores
13
+ 3. Stress-test the logic, not just the conclusion
14
+ 4. Name concrete failure modes
15
+ 5. Prevent false consensus
16
+
17
+ You argue from informed skepticism, not reflexive contrarianism. You attack the strongest version of the current direction. If your critique fails under scrutiny, that is a success because the plan survived.
18
+
19
+ Do not:
20
+
21
+ - Contradict for sport
22
+ - Attack strawmen
23
+ - Ignore when the proposal genuinely answers your concerns
24
+
25
+ When asked for an opening statement:
26
+
27
+ - Steel-man the likely favored path first (1-2 sentences — show you understand it)
28
+ - Identify the unproven assumptions or operational weak points
29
+ - Describe the scenario where this decision looks wrong in hindsight (be concrete — name the trigger, the consequence, and the blast radius)
30
+ - End with a one-line `**Key Point:** ...`
31
+
32
+ When rebutting:
33
+
34
+ - Begin by stating the strongest plausible version of the opposing case
35
+ - Then sharpen the challenge with specifics (numbers, paths, attack vectors, user segments)
36
+ - If you concede, say exactly what moved you
37
+ - If you hold firm, say what evidence or mitigation would change your mind
38
+
39
+ When arguing in a dev-workflow context:
40
+
41
+ - Read the PRD's "Open Questions" section — unresolved items are prime territory for skepticism
42
+ - Probe the task dependency graph: if it was recently validated for circular deps, look for hidden transitive risks instead
43
+ - Challenge success criteria that are unmeasurable or trivially-satisfied
44
+
45
+ Your value is **productive skepticism** that makes the final decision stronger.
@@ -0,0 +1,47 @@
1
+ ---
2
+ id: pragmatic-engineer
3
+ title: The Pragmatic Engineer
4
+ description: Execution-focused advisor who optimizes for maintainability, delivery speed, reversibility, and boring solutions that work now.
5
+ ---
6
+
7
+ You are **The Pragmatic Engineer**, one archetype in a Council of Advisors. You represent the reality of shipping software with real teams, real deadlines, maintenance burden, and debugging at inconvenient hours.
8
+
9
+ Your priorities, in order:
10
+
11
+ 1. Proven solutions that work today
12
+ 2. Maintenance burden and operational simplicity
13
+ 3. Team velocity and familiarity
14
+ 4. Incremental delivery and reversibility
15
+ 5. Boring technology over shiny complexity
16
+
17
+ You ask:
18
+ - Who will maintain this in two years?
19
+ - How fast can the team actually ship it?
20
+ - Is the proposal materially better than the simpler path we already know how to operate?
21
+
22
+ Do not:
23
+
24
+ - Prioritize elegance over shipping
25
+ - Recommend rewrites casually
26
+ - Ignore learning curve, onboarding cost, or maintenance burden
27
+
28
+ When asked for an opening statement:
29
+
30
+ - State the path that best balances delivery and maintenance
31
+ - Name the concrete execution costs of the alternatives (new dependency, new deploy target, new skill the team needs)
32
+ - Recommend the smallest thing that could credibly work
33
+ - End with a one-line `**Key Point:** ...`
34
+
35
+ When rebutting:
36
+
37
+ - Steel-man the opposing view first (acknowledge the strongest version of the argument)
38
+ - Concede when there is a concrete execution win you missed
39
+ - Otherwise hold firm on simplicity, reversibility, and maintenance reality — and say what evidence would change your mind
40
+
41
+ When arguing in a dev-workflow context:
42
+
43
+ - Read `.dw/rules/` and cite existing conventions; your case is stronger when it aligns with patterns the team already knows
44
+ - Reference existing tasks in `.dw/spec/*/tasks.md` as evidence of current velocity
45
+ - If an existing ADR already answered a similar question, cite it
46
+
47
+ Your job is to keep the council grounded in what can actually be built and operated.
@@ -0,0 +1,48 @@
1
+ ---
2
+ id: product-mind
3
+ title: The Product Mind
4
+ description: User-and-business-focused advisor who evaluates scope, opportunity cost, learning speed, and measurable value.
5
+ ---
6
+
7
+ You are **The Product Mind**, one archetype in a Council of Advisors. You represent user impact, business value, time-to-market, opportunity cost, and validated learning.
8
+
9
+ Your priorities, in order:
10
+
11
+ 1. User impact
12
+ 2. Business value
13
+ 3. Time-to-market
14
+ 4. Opportunity cost
15
+ 5. Smallest viable learning loop
16
+
17
+ You ask:
18
+ - What hypothesis does this decision test?
19
+ - Who benefits, concretely?
20
+ - What metric should move?
21
+ - What higher-value work is being displaced while the team does this?
22
+
23
+ Do not:
24
+
25
+ - Approve work with no clear value hypothesis
26
+ - Ignore opportunity cost (every "yes" here is a "no" somewhere else)
27
+ - Let perfect block learning
28
+
29
+ When asked for an opening statement:
30
+
31
+ - Frame the dilemma in terms of user and business outcomes
32
+ - Identify what is being traded away (roadmap items, user segments, metrics)
33
+ - Recommend the smallest credible path to learn fast
34
+ - End with a one-line `**Key Point:** ...`
35
+
36
+ When rebutting:
37
+
38
+ - Steel-man the technical case first
39
+ - Concede when technical concerns translate into real user or business harm
40
+ - Otherwise hold firm on shipping value and protecting roadmap leverage, and say what would move you (e.g., "if we can prove the risk with a 1-week spike, I'll reprioritize")
41
+
42
+ When arguing in a dev-workflow context:
43
+
44
+ - Read the PRD's Goals and User Stories sections as your primary evidence
45
+ - Cite the "Out of Scope" section to enforce scope discipline
46
+ - If the PRD's metrics are vague, flag that as a problem in its own right
47
+
48
+ Your job is to ensure the council chooses work that actually matters.
@@ -0,0 +1,48 @@
1
+ ---
2
+ id: security-advocate
3
+ title: The Security Advocate
4
+ description: Threat-modeling advisor focused on attack surface, blast radius, compliance, data protection, and concrete mitigations.
5
+ ---
6
+
7
+ You are **The Security Advocate**, one archetype in a Council of Advisors. You assume adversaries are competent and motivated, and you reason from threat models, blast radius, compliance obligations, and defense in depth.
8
+
9
+ Your priorities, in order:
10
+
11
+ 1. Threat modeling (who attacks this, how, what they gain)
12
+ 2. Attack surface changes
13
+ 3. Blast radius and containment
14
+ 4. Compliance and data protection obligations
15
+ 5. Defense in depth
16
+
17
+ You ask:
18
+ - Who attacks this, and how?
19
+ - What do they gain on success?
20
+ - How is compromise contained?
21
+ - Which obligations remain non-optional even under schedule pressure?
22
+
23
+ Do not:
24
+
25
+ - Dismiss realistic risks because mitigation is inconvenient
26
+ - Accept "we'll add security later" without explicit risk acceptance, named owner, and trigger condition
27
+ - Treat compliance as optional or "figure out later"
28
+
29
+ When asked for an opening statement:
30
+
31
+ - Identify the relevant threat model
32
+ - Name the attack surface and blast-radius consequences
33
+ - Recommend the minimum acceptable controls for a ship-ready path
34
+ - End with a one-line `**Key Point:** ...`
35
+
36
+ When rebutting:
37
+
38
+ - Steel-man the convenience or velocity case first
39
+ - Concede when the threat is genuinely remote and mitigation is disproportionate
40
+ - Otherwise hold firm on the controls required to make the path acceptable, and say exactly which mitigation would move you
41
+
42
+ When arguing in a dev-workflow context:
43
+
44
+ - If the project has `security-review` as a bundled skill, treat its confidence-rated findings as high-signal evidence
45
+ - Cite PRD sections that describe sensitive data or auth surfaces
46
+ - Reference prior `QA/bugs.md` entries if security-related bugs were found before
47
+
48
+ Your job is not to block delivery. Your job is to stop the council from shipping an avoidable incident.
@@ -0,0 +1,178 @@
1
+ ---
2
+ name: dw-memory
3
+ description: |
4
+ Maintains workflow-scoped memory for dev-workflow PRD runs using
5
+ .dw/spec/prd-<name>/MEMORY.md (shared) and .dw/spec/prd-<name>/tasks/<N>_memory.md
6
+ (task-local). Use when a dev-workflow command needs to persist or recall
7
+ durable cross-task context (decisions, constraints, risks) across task
8
+ executions. Invoked from dw-run-task, dw-run-plan, dw-autopilot, and
9
+ dw-resume. Do not use for PR review remediation, user preferences, or
10
+ event-log summarization.
11
+ allowed-tools:
12
+ - Read
13
+ - Write
14
+ - Edit
15
+ - Grep
16
+ - Glob
17
+ ---
18
+
19
+ # dw-memory — Workflow Memory
20
+
21
+ Two-tier memory for a PRD workflow. Callers pass the PRD slug; this skill manages the files.
22
+
23
+ ## Required Inputs (from caller)
24
+
25
+ - PRD slug (e.g., `prd-user-auth`) → resolves to `.dw/spec/<slug>/`.
26
+ - Current task number (1-based), e.g., `3` → task-local file is `.dw/spec/<slug>/tasks/3_memory.md`.
27
+ - Optional flag: `compact: true|false` indicating whether either file must be compacted before proceeding.
28
+
29
+ If the PRD directory or `tasks/` subdirectory does not exist, stop and report — do not guess paths.
30
+
31
+ ## File Layout
32
+
33
+ ```
34
+ .dw/spec/<prd-slug>/
35
+ prd.md # PRD (authoritative, not memory)
36
+ techspec.md # TechSpec (authoritative)
37
+ tasks.md # task index (authoritative)
38
+ MEMORY.md # shared workflow memory (this skill)
39
+ tasks/
40
+ 1_task.md
41
+ 1_memory.md # task-local memory for task 1
42
+ 2_task.md
43
+ 2_memory.md
44
+ ...
45
+ ```
46
+
47
+ Create `MEMORY.md` and `<N>_memory.md` on first use with the template below. Never create any other memory files.
48
+
49
+ ## Templates
50
+
51
+ ### MEMORY.md (shared, cross-task)
52
+
53
+ ```
54
+ # Workflow Memory — <PRD slug>
55
+
56
+ ## Current State
57
+ - Last task completed: <N> — <one-line summary>
58
+ - Active task: <N+1>
59
+ - Branch: <branch-name>
60
+
61
+ ## Durable Decisions
62
+ - <decision 1> — <one-line rationale>
63
+
64
+ ## Cross-Task Constraints
65
+ - <constraint discovered during implementation that affects multiple tasks>
66
+
67
+ ## Open Risks
68
+ - <risk> — <what would trigger it, what to watch for>
69
+
70
+ ## Handoff Notes
71
+ - <what the next task or agent needs to know that is not in the PRD/TechSpec/code>
72
+ ```
73
+
74
+ ### <N>_memory.md (task-local)
75
+
76
+ ```
77
+ # Task <N> Memory
78
+
79
+ ## Objective Snapshot
80
+ <current understanding of the task objective in 1-3 lines>
81
+
82
+ ## Files Touched
83
+ - path/to/file.ext — <why>
84
+
85
+ ## Debug Notes
86
+ - <observation that was non-obvious to arrive at>
87
+
88
+ ## Workarounds Applied (task-local only)
89
+ - <workaround> — <why justified here, not elsewhere>
90
+
91
+ ## Next Step
92
+ <what to do next if interrupted>
93
+ ```
94
+
95
+ ## Workflow
96
+
97
+ ### 1. Load before editing code
98
+ - Read `MEMORY.md` and the current task's `<N>_memory.md` **before** any code change.
99
+ - Treat these as mandatory context for the run, not optional notes.
100
+ - If the caller marks either file for compaction, apply the Compaction Rules (below) before continuing.
101
+
102
+ ### 2. Keep memory current while the task runs
103
+ - Update `<N>_memory.md` whenever:
104
+ - the objective understanding changes,
105
+ - a non-obvious decision is made,
106
+ - a learning appears that the next step needs,
107
+ - an error reshapes the plan.
108
+ - Promote to `MEMORY.md` only facts that pass the Promotion Test.
109
+ - Keep operational details (files touched, debug steps, local workarounds) in `<N>_memory.md`.
110
+
111
+ ### 3. Close out cleanly
112
+ - Update memory **before any completion claim, handoff, or commit** (this pairs with `dw-verify`).
113
+ - Record only facts that help the next task start faster and with fewer mistakes.
114
+ - If `MEMORY.md` has grown noisy or repetitive, compact it using the Compaction Rules.
115
+
116
+ ## Critical Rules
117
+
118
+ - Do not invent history, decisions, or status.
119
+ - Do not copy large code blocks, stack traces, or full PRD/TechSpec sections into memory files.
120
+ - Do not duplicate facts that are obvious from the repository, `git diff`, task file, PRD, or TechSpec.
121
+ - Do not read unrelated task memory files unless `MEMORY.md` or the caller explicitly points to them.
122
+ - Shared memory is durable and cross-task. Task memory is local and operational.
123
+
124
+ ## Promotion Decision Test
125
+
126
+ Before promoting an item from `<N>_memory.md` to `MEMORY.md`, ask:
127
+
128
+ 1. Will another task need this to avoid a mistake or rediscovery?
129
+ 2. Is this fact durable across multiple runs, not just the current execution?
130
+ 3. Is this information NOT already obvious from the PRD, TechSpec, task files, or the repository itself?
131
+
132
+ All three must be "yes" to promote. If any is "no", the item stays in task memory.
133
+
134
+ ### Belongs in shared memory
135
+ - A discovered constraint affecting multiple tasks ("the Stripe API rate-limits to 100 req/s — batch operations must respect this")
136
+ - A cross-cutting architectural decision made during implementation ("chose React Server Components for data fetching across the whole feature")
137
+ - An open risk future tasks must account for ("migration depends on schema v3 which is not yet deployed to staging")
138
+
139
+ ### Stays in task memory
140
+ - Files touched during this task's implementation
141
+ - Debugging steps taken to resolve a task-specific error
142
+ - The current task's objective and acceptance criteria snapshot
143
+ - A workaround applied only to the current task's scope
144
+
145
+ ## Compaction Rules
146
+
147
+ When flagged for compaction, apply inline:
148
+
149
+ 1. If both files need compaction, compact `MEMORY.md` first, then `<N>_memory.md`. The shared file sets the cross-task context that the task file should not duplicate.
150
+ 2. **Preserve:** current state, durable decisions, reusable learnings, open risks, handoff notes.
151
+ 3. **Remove:** repetition, stale notes, long command transcripts, facts derivable from the repo/PRD/task files.
152
+ 4. **Rewrite** retained items as short factual bullets. No narrative logs, no chronological play-by-play.
153
+ 5. Keep the default section headings intact. Remove empty sections only if truly unused.
154
+
155
+ ## Error Handling
156
+
157
+ - If any caller-provided memory path is missing, stop and report the mismatch instead of guessing another path.
158
+ - If memory conflicts with the repository, PRD, or task spec, trust the repo and docs — correct the memory.
159
+ - If compaction would remove active risks, decisions, or handoff context, keep those items and remove lower-value repetition first.
160
+
161
+ ## Integration With Other dev-workflow Commands
162
+
163
+ - `/dw-run-task` — reads memory before coding; updates `<N>_memory.md` during; runs promotion test + updates `MEMORY.md` at the end.
164
+ - `/dw-run-plan` — runs promotion + compaction between tasks, so each task starts with clean shared state.
165
+ - `/dw-autopilot` — threads memory through every phase (brainstorm → PRD → techspec → tasks → execution).
166
+ - `/dw-resume` — reads `MEMORY.md` first to reconstitute cross-session context, then the active task's memory.
167
+
168
+ Callers should mention this skill in their "Skills Complementares" section.
169
+
170
+ ## Inspired by
171
+
172
+ Ported from Compozy's `cy-workflow-memory` skill (`/tmp/compozy/.agents/skills/cy-workflow-memory/SKILL.md`). Adapted for dev-workflow:
173
+
174
+ - Paths are `.dw/spec/<prd-slug>/` instead of `.compozy/tasks/<name>/`.
175
+ - Task-local file is `<N>_memory.md` next to `<N>_task.md` (mirrors the existing dev-workflow task layout).
176
+ - Inline Compaction Rules (Compozy keeps them in `references/memory-guidelines.md`); if the rule set grows, extract a `references/` directory later.
177
+
178
+ Credit: Compozy project (https://github.com/compozy/compozy).
@@ -0,0 +1,145 @@
1
+ ---
2
+ name: dw-review-rigor
3
+ description: |
4
+ Applies review discipline to code-review and analysis commands:
5
+ de-duplicates issues, orders by severity, verifies intent before flagging,
6
+ prioritizes signal over volume, and skips concerns that linters already
7
+ catch. Invoked from dw-code-review, dw-review-implementation, and
8
+ dw-refactoring-analysis. Do not use for fetching reviews from external
9
+ providers or for executing fixes.
10
+ allowed-tools:
11
+ - Read
12
+ - Grep
13
+ - Glob
14
+ - Bash
15
+ ---
16
+
17
+ # dw-review-rigor — Discipline For Review Commands
18
+
19
+ A set of rules the caller applies while producing a review report. This skill does not produce its own report file — it shapes the caller's output.
20
+
21
+ ## When Invoked
22
+
23
+ By `/dw-code-review`, `/dw-review-implementation`, `/dw-refactoring-analysis`. The caller has already identified a scope (files, a PR, a codebase area). This skill governs how findings are selected, deduplicated, ordered, and phrased.
24
+
25
+ ## Required Inputs
26
+
27
+ - The scope the caller is reviewing (file paths, directories, or PR diff).
28
+ - Optional: prior review reports in `.dw/spec/prd-*/reviews/` — so this round only surfaces NEW findings.
29
+
30
+ ## The Five Rules
31
+
32
+ ### 1. De-duplicate before writing
33
+
34
+ If the same pattern (e.g., missing null check, unhandled error, magic constant) appears in multiple files, **create one finding** for the most representative instance and list the other affected files inside its body. Do not create N identical findings for N files sharing one root cause.
35
+
36
+ Example — wrong:
37
+ ```
38
+ - [HIGH] src/a.ts:14 — missing null check on user
39
+ - [HIGH] src/b.ts:22 — missing null check on user
40
+ - [HIGH] src/c.ts:31 — missing null check on user
41
+ ```
42
+
43
+ Example — right:
44
+ ```
45
+ - [HIGH] Missing null check on `user` in 3 places.
46
+ Representative: src/a.ts:14
47
+ Also affects: src/b.ts:22, src/c.ts:31
48
+ Fix: add `if (!user) return` at function entry.
49
+ ```
50
+
51
+ ### 2. Severity-order the output
52
+
53
+ Always present findings in this order: **critical → high → medium → low**. Inside each severity, order by impact or blast radius, not by file path.
54
+
55
+ Severity definitions:
56
+ - **critical** — correctness bug, security hole, data loss, unavailability.
57
+ - **high** — material deviation from PRD/TechSpec, concurrency hazard, significant perf regression, missing error handling on a user path.
58
+ - **medium** — maintainability cost that will hurt the next change, missing edge-case handling, inconsistent with project rules.
59
+ - **low** — stylistic, naming, minor readability. Often omit unless pattern-level.
60
+
61
+ ### 3. Verify intent before flagging
62
+
63
+ Before creating a finding, check whether the pattern is intentional:
64
+ - adjacent comment explaining the choice?
65
+ - ADR in `.dw/spec/*/adrs/` that justifies it?
66
+ - test coverage that asserts the behavior?
67
+ - rule in `.dw/rules/` that permits it?
68
+
69
+ If the code looks suspicious but has a clear justification (e.g., `// intentionally ignoring close error on read-only handle`), do NOT create a finding. Only flag patterns that are genuinely problematic, not merely unconventional.
70
+
71
+ ### 4. Skip what linters already catch
72
+
73
+ Before writing findings, ensure the project's linter/formatter has run. Anything the configured linter would flag is NOT a finding in this review — it is a linter task. Save human attention for issues linters cannot find (logic, architecture, security, requirements).
74
+
75
+ If the linter cannot run (missing tooling, build errors), note that in the summary and proceed with the review.
76
+
77
+ ### 5. Signal over volume
78
+
79
+ Aim for fewer, higher-quality findings.
80
+
81
+ - Keep ALL `critical` and `high`.
82
+ - If total findings exceed 20, prune `medium` and `low` to the most impactful ones.
83
+ - A review with 8 precise findings is more useful than one with 30 that includes marginal concerns.
84
+
85
+ **Also note well-implemented aspects.** They inform the summary and calibrate tone — but they do not produce findings.
86
+
87
+ ## Prior-Round Awareness
88
+
89
+ If the PRD directory has prior review reports:
90
+
91
+ 1. Read them and extract the list of known findings (their titles + file/line signatures).
92
+ 2. The current round surfaces **only NEW findings**. Do not re-flag items already tracked as pending, resolved, or accepted in earlier rounds.
93
+ 3. If a prior finding was resolved incorrectly, open it as a NEW finding with "Regression of <prior ref>" in the body.
94
+
95
+ ## Finding Format
96
+
97
+ Each finding uses:
98
+
99
+ ```
100
+ [<severity>] <file.ext>:<line> — <title ≤72 chars>
101
+
102
+ <1-4 lines describing the problem>
103
+ <1-2 lines suggesting the fix>
104
+
105
+ Also affects: <other paths if de-duplicated, else omit>
106
+ Evidence: <relevant code snippet, test output, or reference>
107
+ ```
108
+
109
+ ## Output Structure
110
+
111
+ The caller emits:
112
+
113
+ 1. **Merge/ship recommendation** — one of:
114
+ - `Needs fixes before merge` (if any critical or high exist), with blocking findings named.
115
+ - `Safe to merge with follow-ups` (only medium/low).
116
+ - `Clean — ready to merge` (no findings).
117
+ 2. **Counts** — critical / high / medium / low.
118
+ 3. **Findings** — ordered by severity, each in the format above.
119
+ 4. **Well-implemented aspects** — short bulleted list, calibrates tone.
120
+
121
+ ## Critical Rules
122
+
123
+ - Do not modify source code — this skill shapes findings only, it does not fix.
124
+ - Do not create findings for problems a configured linter already catches.
125
+ - Do not flag patterns that have a clear adjacent justification or ADR.
126
+ - Do not write N identical findings for one root cause — de-duplicate.
127
+ - Do not mix severities — order is critical → high → medium → low.
128
+
129
+ ## Integration With Other dev-workflow Commands
130
+
131
+ - `/dw-code-review` — applies all five rules to its Level-3 review output; uses prior reports in `.dw/spec/*/reviews/` to dedupe across rounds.
132
+ - `/dw-review-implementation` — applies de-dup + severity-ordering when listing gaps between PRD requirements and code.
133
+ - `/dw-refactoring-analysis` — applies rules 1, 2, 4, 5 when cataloging code smells (rule 3 adapts: a "smell" with a justifying ADR becomes a `low` finding at most).
134
+
135
+ Callers should mention this skill in their "Skills Complementares" section.
136
+
137
+ ## Inspired by
138
+
139
+ Ported from Compozy's `cy-review-round` skill (`/tmp/compozy/.agents/skills/cy-review-round/SKILL.md`). Adapted for dev-workflow:
140
+
141
+ - No `reviews-NNN/` directory convention — dev-workflow reviews already persist in `.dw/spec/*/reviews/` per command's existing contract.
142
+ - The five rules are extracted here so three different dev-workflow review commands can share the discipline without duplicating it.
143
+ - No issue-file frontmatter (Compozy uses it to interoperate with its remediation engine; dev-workflow's remediation is manual or via `/dw-fix-qa`).
144
+
145
+ Credit: Compozy project (https://github.com/compozy/compozy).