@brunosps00/dev-workflow 1.4.0 → 1.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.
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +6 -5
- package/lib/constants.js +6 -4
- package/lib/hooks.js +53 -11
- package/lib/init.js +49 -1
- package/package.json +4 -2
- package/scaffold/config/stack-mappings.json +40 -0
- package/scaffold/en/commands/dw-adr.md +49 -11
- package/scaffold/en/commands/dw-analyze-project.md +10 -1
- package/scaffold/en/commands/dw-brainstorm.md +103 -32
- package/scaffold/en/commands/dw-claude-run.md +8 -5
- package/scaffold/en/commands/dw-context-budget.md +9 -0
- package/scaffold/en/commands/dw-harness-audit.md +3 -0
- package/scaffold/en/commands/dw-learn.md +41 -0
- package/scaffold/en/commands/dw-plan.md +36 -5
- package/scaffold/en/commands/dw-review.md +1 -0
- package/scaffold/en/commands/dw-run.md +1 -0
- package/scaffold/en/templates/adr-template.md +8 -4
- package/scaffold/en/templates/idea-onepager.md +44 -2
- package/scaffold/pt-br/commands/dw-adr.md +49 -11
- package/scaffold/pt-br/commands/dw-analyze-project.md +10 -1
- package/scaffold/pt-br/commands/dw-brainstorm.md +105 -32
- package/scaffold/pt-br/commands/dw-claude-run.md +8 -5
- package/scaffold/pt-br/commands/dw-context-budget.md +9 -0
- package/scaffold/pt-br/commands/dw-harness-audit.md +3 -0
- package/scaffold/pt-br/commands/dw-learn.md +41 -0
- package/scaffold/pt-br/commands/dw-plan.md +36 -5
- package/scaffold/pt-br/commands/dw-review.md +1 -0
- package/scaffold/pt-br/commands/dw-run.md +1 -0
- package/scaffold/pt-br/templates/adr-template.md +8 -4
- package/scaffold/pt-br/templates/idea-onepager.md +44 -2
- package/scaffold/rules/README.md +22 -0
- package/scaffold/rules/common.md +29 -0
- package/scaffold/rules/csharp.md +18 -0
- package/scaffold/rules/python.md +18 -0
- package/scaffold/rules/react.md +18 -0
- package/scaffold/rules/rust.md +18 -0
- package/scaffold/rules/typescript.md +23 -0
- package/scaffold/rules-readme.md +8 -0
- package/scaffold/scripts/hooks/session-cost.mjs +126 -0
- package/scaffold/scripts/hooks/statusline.mjs +31 -0
- package/scaffold/scripts/lib/model-prices.json +12 -0
- package/scaffold/skill-registry.json +25 -1
- package/scaffold/skills/dw-cli-run/SKILL.md +13 -9
- package/scaffold/skills/dw-codebase-intel/SKILL.md +3 -1
- package/scaffold/skills/dw-debug-protocol/SKILL.md +4 -0
- package/scaffold/skills/dw-debug-protocol/references/agent-degradation.md +30 -0
- package/scaffold/skills/dw-domain-modeling/SKILL.md +84 -0
- package/scaffold/skills/dw-domain-modeling/references/adr-policy.md +48 -0
- package/scaffold/skills/dw-domain-modeling/references/glossary-format.md +66 -0
- package/scaffold/skills/dw-execute-phase/SKILL.md +13 -0
- package/scaffold/skills/dw-git-discipline/SKILL.md +1 -0
- package/scaffold/skills/dw-grilling/SKILL.md +98 -0
- package/scaffold/skills/dw-grilling/references/decision-tree.md +56 -0
- package/scaffold/skills/dw-grilling/references/interview-loop.md +52 -0
- package/scaffold/skills/dw-llm-eval/SKILL.md +12 -0
- package/scaffold/skills/dw-memory/SKILL.md +12 -1
- package/scaffold/skills/dw-memory/references/instincts.md +45 -0
- package/scaffold/skills/dw-review-rigor/SKILL.md +12 -0
- package/scaffold/skills/dw-review-rigor/references/false-positives.md +21 -0
- package/scaffold/skills/dw-review-rigor/references/self-eval-rubric.md +38 -0
- package/scaffold/skills/dw-silent-failure/SKILL.md +4 -2
- package/scaffold/skills/dw-simplification/SKILL.md +13 -0
- package/scaffold/skills/dw-simplification/references/dead-code-tools.md +23 -0
- package/scaffold/skills/dw-testing-discipline/SKILL.md +17 -0
- package/scaffold/skills/dw-ui-discipline/SKILL.md +1 -1
- package/scaffold/skills/dw-verify/SKILL.md +1 -1
- package/scaffold/skills/dw-verify/references/pre-check-and-status.md +28 -0
|
@@ -19,7 +19,8 @@ Use during `/dw-review`, `/dw-bugfix`, and `/dw-qa --fix` when failures may be h
|
|
|
19
19
|
- Log-only handling where callers need the failure.
|
|
20
20
|
- Generic rethrows that lose stack or input context.
|
|
21
21
|
- Async work launched without awaiting, tracking, or explicit detachment.
|
|
22
|
-
- Network/database/filesystem calls without timeout
|
|
22
|
+
- Network/database/filesystem calls without a **timeout** — the call can hang indefinitely and block everything waiting on it.
|
|
23
|
+
- Transactional work (multi-step writes, DB mutations, chained external calls) without **rollback** on partial failure — leaves silently corrupted or half-written state.
|
|
23
24
|
|
|
24
25
|
## Reporting Standard
|
|
25
26
|
|
|
@@ -27,7 +28,8 @@ Only flag a finding when you can name:
|
|
|
27
28
|
|
|
28
29
|
- the exact location,
|
|
29
30
|
- the trigger,
|
|
30
|
-
- the
|
|
31
|
+
- the severity (critical / high / medium),
|
|
32
|
+
- the hidden bad outcome and its impact (what the user or system experiences when it fires),
|
|
31
33
|
- the minimal fix.
|
|
32
34
|
|
|
33
35
|
Inspired by ECC's `silent-failure-hunter`; adapted as both a skill and a dispatchable `dw-silent-failure-hunter` agent.
|
|
@@ -99,6 +99,18 @@ If a simplification touches >500 lines, **don't do it manually**. Use:
|
|
|
99
99
|
|
|
100
100
|
Manual edits across hundreds of lines are how subtle bugs creep in.
|
|
101
101
|
|
|
102
|
+
## Refactor risk levels
|
|
103
|
+
|
|
104
|
+
Before removing or restructuring, categorize by blast radius and act in that order — never all at once:
|
|
105
|
+
|
|
106
|
+
| Risk | Examples | Discipline |
|
|
107
|
+
|------|----------|-----------|
|
|
108
|
+
| **SAFE** | Unused exports, unused deps, unreachable branches | Batch-remove, run the gate after each batch, commit |
|
|
109
|
+
| **CAREFUL** | Consolidate duplicates, extract/inline, rename symbol | One or two per commit; re-read callers first |
|
|
110
|
+
| **RISKY** | Change a public API, alter a data structure, extract a layer | One per commit; regression tests first; pair review / ADR |
|
|
111
|
+
|
|
112
|
+
Start with SAFE and graduate only after the gate is green. For finding SAFE candidates on JS/TS (and other ecosystems), see `references/dead-code-tools.md`. This composes with Chesterton's Fence (Rule 1) — a tool calling code "unused" still needs the WHY check before deletion (reflection, dynamic imports, and framework entry points are invisible to static analysis).
|
|
113
|
+
|
|
102
114
|
## Verification protocol
|
|
103
115
|
|
|
104
116
|
Before committing the simplification:
|
|
@@ -139,6 +151,7 @@ In the formal Level 3 review (post-Level 2 chain from `dw-review-implementation`
|
|
|
139
151
|
- `references/complexity-metrics.md` — when each metric (cyclomatic, cognitive, depth, fanout) actually matters; how to measure cheaply.
|
|
140
152
|
- `references/behavior-preserving.md` — characterization tests, refactor with test gate, rollback patterns, codemod tooling per language.
|
|
141
153
|
- `references/deep-modules.md` — high-leverage modules behind small interfaces; deletion test, locality, leverage, seam, adapter diagnostic; anti-patterns (shallow wrapper, god-module). Invoked by `/dw-refactor` and `/dw-brainstorm` refactor-audit mode.
|
|
154
|
+
- `references/dead-code-tools.md` — per-ecosystem tools that surface SAFE-tier dead-code candidates (knip/depcheck/ts-prune for JS/TS; vulture/ruff for Python; deadcode/staticcheck for Go; cargo-udeps for Rust). Candidates still pass Chesterton's Fence before deletion.
|
|
142
155
|
|
|
143
156
|
## Inspired by
|
|
144
157
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Dead-code detection tools (find candidates; then apply Chesterton's Fence)
|
|
2
|
+
|
|
3
|
+
Detection tools surface **candidates** — they do not know about reflection, dynamic imports, framework
|
|
4
|
+
entry points, or external consumers of a public API. Every hit is a SAFE-tier candidate to verify, not an
|
|
5
|
+
automatic deletion. Run the gate (lint + tests + build) after each batch.
|
|
6
|
+
|
|
7
|
+
## JavaScript / TypeScript
|
|
8
|
+
- `npx knip` — unused files, exports, and dependencies in one pass (the broadest single tool).
|
|
9
|
+
- `npx depcheck` — unused and missing npm dependencies.
|
|
10
|
+
- `npx ts-prune` — unused TypeScript exports.
|
|
11
|
+
- `npx eslint . --report-unused-disable-directives` — stale `eslint-disable` comments.
|
|
12
|
+
|
|
13
|
+
## Other ecosystems
|
|
14
|
+
- **Python:** `vulture`, `ruff` (`F401` unused imports), `deptry` (unused dependencies).
|
|
15
|
+
- **Go:** `deadcode` (golang.org/x/tools/cmd/deadcode), `staticcheck` (`U1000`).
|
|
16
|
+
- **Rust:** `cargo +nightly udeps` (unused deps), the compiler's own `dead_code` warnings.
|
|
17
|
+
- **C# / .NET:** Roslyn analyzers (`IDE0051` unused private member, `IDE0059` unnecessary assignment).
|
|
18
|
+
|
|
19
|
+
## Discipline
|
|
20
|
+
1. Run the tool; treat every result as a **SAFE-tier candidate**, not a confirmed removal.
|
|
21
|
+
2. For each candidate, apply Chesterton's Fence (Rule 1) — dynamic/reflective/plugin use won't appear in static analysis.
|
|
22
|
+
3. Remove in batches by category (deps → exports → files); run the gate after each batch; commit per batch.
|
|
23
|
+
4. Anything the tool flags that turns out to be load-bearing → add a comment explaining why, so the next pass doesn't re-flag it.
|
|
@@ -38,6 +38,23 @@ Each rule has nuance read `references/core-rules.md` for the long version with e
|
|
|
38
38
|
- Verifying browser-side trust boundaries (auth, CSRF, headers) → `references/security-boundary.md`.
|
|
39
39
|
- Picking which test workflow applies (UI / network / perf) → `references/three-workflow-patterns.md`.
|
|
40
40
|
|
|
41
|
+
## Step 0 — detect the runner before writing any test
|
|
42
|
+
|
|
43
|
+
Do not assume `npm test`. The package manager and the test runner are different things — confirm both:
|
|
44
|
+
|
|
45
|
+
1. Read `package.json` `scripts.test` (plus `test:watch` / `test:coverage`), or the language equivalent (`pyproject.toml`/`tox.ini`, `Cargo.toml`, `*.csproj`, `go.mod`).
|
|
46
|
+
2. Identify the actual runner: jest / vitest / mocha / `node:test` / `bun:test` / pytest / `go test` / `cargo test` / `dotnet test`.
|
|
47
|
+
3. Invoke it through the project's package manager, not a hardcoded `npm`:
|
|
48
|
+
|
|
49
|
+
| Manager | test | watch | coverage |
|
|
50
|
+
|---|---|---|---|
|
|
51
|
+
| npm | `npm test` | `npm test -- --watch` | `npm run test:coverage` |
|
|
52
|
+
| pnpm | `pnpm test` | `pnpm test --watch` | `pnpm test:coverage` |
|
|
53
|
+
| yarn | `yarn test` | `yarn test --watch` | `yarn coverage` |
|
|
54
|
+
| bun (native) | `bun test` | `bun test --watch` | `bun test --coverage` |
|
|
55
|
+
|
|
56
|
+
**Bun gotcha:** `bun test` runs Bun's native runner (`bun:test`); `bun run test` runs whatever `scripts.test` is (often jest/vitest). They are not interchangeable — use the one the project actually configures. When unsure, confirm with `<runner> --help`.
|
|
57
|
+
|
|
41
58
|
## Reference router
|
|
42
59
|
|
|
43
60
|
| Doing what | Read |
|
|
@@ -34,7 +34,7 @@ Find the project's design source-of-truth in this order:
|
|
|
34
34
|
4. Component library config — `components.json` for shadcn, theme exports.
|
|
35
35
|
5. Storybook stories (implicit canonical components).
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
**Stop at the first match** in this list — that source is the authority; defer to it and do not override it with a lower rung or a training-data default. If a needed token is missing (e.g., a danger-secondary color), propose adding it to the authority FIRST, not inline.
|
|
38
38
|
|
|
39
39
|
If **none exists**: read `references/curated-defaults.md` and pick one of the 10 neutral palettes + one of the 10 font pairings shipped there. Mark the choice in the techspec/PR description: "Design source: no project authority found; using curated default `<name>`; recommend establishing `DESIGN.md`."
|
|
40
40
|
|
|
@@ -160,7 +160,7 @@ Verification failure is information, not a dead end. Protocol:
|
|
|
160
160
|
|
|
161
161
|
Discover the project gate before claiming success. Prefer documented gates in `.dw/rules/`, then package scripts such as `verify`, `check`, `ci`, or `test`, then Makefile/just/pyproject equivalents. If no verification command exists, state that explicitly in the Verification Report and avoid completion language.
|
|
162
162
|
|
|
163
|
-
Load `references/verification-discovery-and-attribution.md`
|
|
163
|
+
Load `references/verification-discovery-and-attribution.md` for the discovery checklist and attribution notes, or `references/pre-check-and-status.md` for the cheap diff-hygiene grep and the compact polling status line.
|
|
164
164
|
|
|
165
165
|
## Structured Return
|
|
166
166
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Cheap pre-check + compact status
|
|
2
|
+
|
|
3
|
+
Two lightweight companions to the full verification gate. Neither replaces the Verification Report — they
|
|
4
|
+
run *around* it.
|
|
5
|
+
|
|
6
|
+
## Diff hygiene (cheap pre-commit grep)
|
|
7
|
+
|
|
8
|
+
Before running the full pipeline, one fast grep over the staged diff catches the most common "left it in"
|
|
9
|
+
mistakes:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
git diff --cached | grep -nE 'console\.(log|debug)|debugger|TODO: *remove|sk-[A-Za-z0-9]|api[_-]?key|password *='
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Hits are a smell to clear, not a gate by themselves. This is **not** the security gate — `/dw-secure-audit`
|
|
16
|
+
(gitleaks + Trivy + Semgrep) remains the authoritative secret/vuln check before commit/PR. Use this grep as a
|
|
17
|
+
2-second sanity pass, then run the real pipeline.
|
|
18
|
+
|
|
19
|
+
## Compact status (for real-time polling)
|
|
20
|
+
|
|
21
|
+
When a runner (e.g. `dw-cli-run`) polls progress *between* full reports, a one-line form is enough:
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
Build: PASS | Lint: PASS | Tests: 42/42 | Verdict: READY
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The compact line never replaces the full report — the final completion claim still requires the Verification
|
|
28
|
+
Report Template with cited command output. Use the compact line for progress, the full template for the claim.
|