@brunosps00/dev-workflow 0.4.7 → 0.6.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 (64) hide show
  1. package/README.md +33 -6
  2. package/lib/constants.js +6 -0
  3. package/lib/install-deps.js +39 -1
  4. package/package.json +1 -1
  5. package/scaffold/en/commands/dw-adr.md +117 -0
  6. package/scaffold/en/commands/dw-autopilot.md +7 -0
  7. package/scaffold/en/commands/dw-brainstorm.md +6 -0
  8. package/scaffold/en/commands/dw-bugfix.md +9 -0
  9. package/scaffold/en/commands/dw-code-review.md +28 -0
  10. package/scaffold/en/commands/dw-create-tasks.md +12 -0
  11. package/scaffold/en/commands/dw-create-techspec.md +8 -0
  12. package/scaffold/en/commands/dw-fix-qa.md +5 -0
  13. package/scaffold/en/commands/dw-generate-pr.md +11 -0
  14. package/scaffold/en/commands/dw-help.md +44 -3
  15. package/scaffold/en/commands/dw-quick.md +8 -1
  16. package/scaffold/en/commands/dw-refactoring-analysis.md +1 -0
  17. package/scaffold/en/commands/dw-resume.md +10 -3
  18. package/scaffold/en/commands/dw-revert-task.md +114 -0
  19. package/scaffold/en/commands/dw-review-implementation.md +17 -0
  20. package/scaffold/en/commands/dw-run-plan.md +19 -1
  21. package/scaffold/en/commands/dw-run-task.md +14 -1
  22. package/scaffold/en/commands/dw-security-check.md +271 -0
  23. package/scaffold/en/commands/dw-update.md +39 -0
  24. package/scaffold/en/templates/adr-template.md +56 -0
  25. package/scaffold/en/templates/prd-template.md +12 -0
  26. package/scaffold/en/templates/task-template.md +12 -0
  27. package/scaffold/en/templates/tasks-template.md +6 -0
  28. package/scaffold/en/templates/techspec-template.md +12 -0
  29. package/scaffold/pt-br/commands/dw-adr.md +117 -0
  30. package/scaffold/pt-br/commands/dw-autopilot.md +7 -0
  31. package/scaffold/pt-br/commands/dw-brainstorm.md +6 -0
  32. package/scaffold/pt-br/commands/dw-bugfix.md +9 -0
  33. package/scaffold/pt-br/commands/dw-code-review.md +28 -0
  34. package/scaffold/pt-br/commands/dw-create-tasks.md +12 -0
  35. package/scaffold/pt-br/commands/dw-create-techspec.md +8 -0
  36. package/scaffold/pt-br/commands/dw-fix-qa.md +5 -0
  37. package/scaffold/pt-br/commands/dw-generate-pr.md +11 -0
  38. package/scaffold/pt-br/commands/dw-help.md +44 -3
  39. package/scaffold/pt-br/commands/dw-quick.md +8 -1
  40. package/scaffold/pt-br/commands/dw-refactoring-analysis.md +1 -0
  41. package/scaffold/pt-br/commands/dw-resume.md +10 -3
  42. package/scaffold/pt-br/commands/dw-revert-task.md +114 -0
  43. package/scaffold/pt-br/commands/dw-review-implementation.md +17 -0
  44. package/scaffold/pt-br/commands/dw-run-plan.md +19 -1
  45. package/scaffold/pt-br/commands/dw-run-task.md +14 -1
  46. package/scaffold/pt-br/commands/dw-security-check.md +271 -0
  47. package/scaffold/pt-br/commands/dw-update.md +40 -0
  48. package/scaffold/pt-br/templates/adr-template.md +56 -0
  49. package/scaffold/pt-br/templates/prd-template.md +12 -0
  50. package/scaffold/pt-br/templates/task-template.md +12 -0
  51. package/scaffold/pt-br/templates/tasks-template.md +6 -0
  52. package/scaffold/pt-br/templates/techspec-template.md +12 -0
  53. package/scaffold/skills/dw-council/SKILL.md +189 -0
  54. package/scaffold/skills/dw-council/agents/architect-advisor.md +44 -0
  55. package/scaffold/skills/dw-council/agents/devils-advocate.md +45 -0
  56. package/scaffold/skills/dw-council/agents/pragmatic-engineer.md +47 -0
  57. package/scaffold/skills/dw-council/agents/product-mind.md +48 -0
  58. package/scaffold/skills/dw-council/agents/security-advocate.md +48 -0
  59. package/scaffold/skills/dw-memory/SKILL.md +178 -0
  60. package/scaffold/skills/dw-review-rigor/SKILL.md +145 -0
  61. package/scaffold/skills/dw-verify/SKILL.md +196 -0
  62. package/scaffold/skills/security-review/languages/csharp.md +507 -0
  63. package/scaffold/skills/security-review/languages/rust.md +584 -0
  64. package/scaffold/skills/security-review/languages/typescript.md +373 -0
@@ -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).
@@ -0,0 +1,196 @@
1
+ ---
2
+ name: dw-verify
3
+ description: |
4
+ Enforces fresh verification evidence before any completion, fix, or passing
5
+ claim — and before commits or PR creation. Use when a dev-workflow command
6
+ is about to report success, hand off work, or commit code. Invoked from
7
+ dw-run-task, dw-run-plan, dw-fix-qa, dw-bugfix, dw-code-review, dw-generate-pr,
8
+ and dw-quick. Do not use for early planning or brainstorming.
9
+ allowed-tools:
10
+ - Bash
11
+ - Read
12
+ - Grep
13
+ ---
14
+
15
+ # dw-verify — Verification Before Completion
16
+
17
+ ## Overview
18
+
19
+ Claiming work is complete without verification is dishonesty, not efficiency.
20
+
21
+ **Core principle:** Evidence before claims, always.
22
+
23
+ **Violating the letter of this rule is violating the spirit of this rule.**
24
+
25
+ ## The Iron Law
26
+
27
+ ```
28
+ NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE
29
+ ```
30
+
31
+ If the verification command has not been run in the current message, the result cannot be claimed.
32
+
33
+ ## The Gate Function
34
+
35
+ ```
36
+ BEFORE claiming any status or expressing satisfaction:
37
+
38
+ 1. IDENTIFY: What command proves this claim?
39
+ 2. RUN: Execute the FULL command (fresh, complete)
40
+ 3. READ: Full output, check exit code, count failures
41
+ 4. VERIFY: Does output confirm the claim?
42
+ - If NO: State actual status with evidence
43
+ - If YES: State claim WITH evidence
44
+ 5. ONLY THEN: Make the claim
45
+
46
+ Skip any step = lying, not verifying
47
+ ```
48
+
49
+ ## Scope of Verification
50
+
51
+ Match the verification scope to the claim scope.
52
+
53
+ - **Narrow claim** (e.g., "this test passes"): run the specific test.
54
+ - **Broad claim** (e.g., "task complete", "ready to commit"): run the full verification pipeline — formatting, linting, all tests, and build. If the project defines a single gate command (e.g., `npm test`, `make verify`, `pnpm check`), run that.
55
+
56
+ A narrow verification does not support a broad claim. Running one test alone does not justify "task complete." The verification scope must be equal to or broader than the claim scope.
57
+
58
+ **If in doubt, run the full pipeline.** Over-verification wastes minutes. Under-verification wastes hours.
59
+
60
+ **Passing pipeline ≠ meeting requirements.** A green build proves the code compiles, lints, and passes existing tests. It does not prove the implementation matches the PRD. For "task complete" or "requirements met" claims, also verify deliverables against the task's acceptance criteria and the PRD — line by line, not by assumption.
61
+
62
+ ## Common Failures
63
+
64
+ | Claim | Requires | Not Sufficient |
65
+ | --------------------- | -------------------------------- | ------------------------------- |
66
+ | Tests pass | Test command output: 0 failures | Previous run, "should pass" |
67
+ | Linter clean | Linter output: 0 errors | Partial check, extrapolation |
68
+ | Build succeeds | Build command: exit 0 | Linter passing, logs look good |
69
+ | Bug fixed | Test original symptom: passes | Code changed, assumed fixed |
70
+ | Regression test works | Red-green cycle verified | Test passes once |
71
+ | Task complete | Acceptance criteria cross-check | Tests passing |
72
+ | Requirements met | Line-by-line PRD checklist | Tests passing |
73
+
74
+ ## Red Flags
75
+
76
+ If you catch yourself using any of these, STOP and run verification:
77
+
78
+ - "should", "probably", "seems to", "I'm confident"
79
+ - Expressing satisfaction before verification
80
+ - About to commit, push, or open a PR without verification
81
+ - Trusting another agent's success report
82
+ - Relying on partial verification
83
+ - "Just this once"
84
+
85
+ ## Rationalization Prevention
86
+
87
+ | Excuse | Reality |
88
+ | --------------------------------------- | ---------------------- |
89
+ | "Should work now" | Run the verification |
90
+ | "I'm confident" | Confidence ≠ evidence |
91
+ | "Just this once" | No exceptions |
92
+ | "Linter passed" | Linter ≠ compiler |
93
+ | "Agent said success" | Verify independently |
94
+ | "I'm tired" | Exhaustion ≠ excuse |
95
+ | "Partial check is enough" | Partial proves nothing |
96
+ | "Different words so rule doesn't apply" | Spirit over letter |
97
+
98
+ ## When To Apply
99
+
100
+ Apply this skill before:
101
+
102
+ - any success or completion claim
103
+ - any expression of satisfaction with the implementation state
104
+ - any commit or PR creation
105
+ - any handoff that implies correctness
106
+ - moving to the next task based on completion
107
+
108
+ ## Pre-Commit and Pre-PR Gate
109
+
110
+ Commits and PRs are permanent artifacts. They require the highest verification standard.
111
+
112
+ **Before `git commit`:**
113
+ 1. Run the full verification pipeline. Not a subset. The full pipeline.
114
+ 2. Confirm zero errors, zero warnings, zero test failures in the output.
115
+ 3. Produce a Verification Report (template below) with verdict PASS.
116
+ 4. Only then run `git commit`.
117
+
118
+ **Before creating a PR:**
119
+ 1. All of the above, plus:
120
+ 2. Verify the diff matches the intended changes (`git diff` review).
121
+ 3. Confirm no unrelated files are staged.
122
+
123
+ If the full pipeline has not passed in this session after the last code change, the commit or PR must not proceed.
124
+
125
+ ## Verification Report Template
126
+
127
+ Verification is not complete until the agent **cites actual command output** in their response. "I ran it and it passed" is not evidence. If the verification output is not shown, the verification did not happen.
128
+
129
+ Every verification must be reported using this structure. Do not deviate.
130
+
131
+ ```
132
+ VERIFICATION REPORT
133
+ -------------------
134
+ Claim: [What is being claimed — e.g., "tests pass", "build succeeds", "task complete"]
135
+ Command: [Exact command run — e.g., `npm test`, `pnpm verify`]
136
+ Executed: [Timestamp or "just now, after all changes"]
137
+ Exit code: [0 or non-zero]
138
+ Output summary: [Key lines from output — pass count, error count, build result]
139
+ Warnings: [Any warnings, or "none"]
140
+ Errors: [Any errors, or "none"]
141
+ Verdict: PASS or FAIL
142
+ ```
143
+
144
+ If the verdict is FAIL, do not use completion language. State what failed and what remains.
145
+
146
+ If the verdict is PASS, the claim may proceed — but only the specific claim supported by the evidence.
147
+
148
+ ## When Verification Fails
149
+
150
+ Verification failure is information, not a dead end. Protocol:
151
+
152
+ 1. **Read the failure.** Identify the exact error. Quote the relevant output lines.
153
+ 2. **Diagnose the root cause.** Read the error. Trace it to the source. If multiple things failed, address them one at a time, starting with the first failure.
154
+ 3. **Fix the root cause.** Apply the minimal change that addresses the actual error. No workarounds, no suppressions, no skipped checks.
155
+ 4. **Re-verify from scratch.** Run the full verification command again. Do not assume the fix worked. Do not run only the previously-failing subset.
156
+ 5. **Report with evidence.** Use the Verification Report Template. If it passes, the claim may proceed. If it fails again, return to step 1.
157
+
158
+ **Never:**
159
+ - Claim partial success ("3 of 4 checks pass, close enough")
160
+ - Skip re-verification after a fix
161
+ - Blame the tooling without evidence of a false positive
162
+ - Move on while verification is still failing
163
+
164
+ ## Project-Specific Verification Commands
165
+
166
+ dev-workflow does not hardcode a verification command. Discover it from the project:
167
+
168
+ 1. Check `.dw/rules/` for a documented verify command.
169
+ 2. Read `package.json` scripts: prefer `verify`, `check`, `ci`, `test`, in that order.
170
+ 3. Check for `Makefile`/`make verify`, `pyproject.toml`/`just verify`, etc.
171
+ 4. If none is explicit, run the documented test + lint + build sequence.
172
+
173
+ If no verification command exists for the project, state that explicitly in the Verification Report and avoid completion language.
174
+
175
+ ## Integration With Other dev-workflow Commands
176
+
177
+ This skill is invoked transparently from:
178
+
179
+ - `/dw-run-task` — before committing the task's changes
180
+ - `/dw-run-plan` — before Level 2 review and before declaring the plan complete
181
+ - `/dw-fix-qa` — before marking a bug as resolved in `QA/bugs.md`
182
+ - `/dw-bugfix` — before claiming the bug is fixed (original symptom no longer reproduces)
183
+ - `/dw-code-review` — before emitting an APPROVED verdict
184
+ - `/dw-generate-pr` — blocks PR creation if the session has no passing VERIFICATION REPORT post-last-edit
185
+ - `/dw-quick` — before committing the one-off change
186
+
187
+ Callers should mention this skill in their "Skills Complementares" section so the user sees the dependency.
188
+
189
+ ## Inspired by
190
+
191
+ Ported from Compozy's `cy-final-verify` skill (`/tmp/compozy/.agents/skills/cy-final-verify/SKILL.md`). Adapted for the dev-workflow context:
192
+
193
+ - Project-agnostic verification discovery (Compozy assumes `make verify`; dev-workflow scans `package.json`/Makefile/`.dw/rules/`).
194
+ - Integration table maps to dev-workflow command names instead of Compozy phases.
195
+
196
+ Credit: Compozy project (https://github.com/compozy/compozy).