@brunosps00/dev-workflow 2.0.0 → 2.1.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 (66) hide show
  1. package/.claude-plugin/marketplace.json +1 -0
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +104 -0
  4. package/README.md +6 -4
  5. package/lib/build-plugin.js +4 -1
  6. package/lib/constants.js +4 -2
  7. package/lib/validate.js +21 -0
  8. package/package.json +1 -1
  9. package/scaffold/en/commands/dw-brainstorm.md +12 -8
  10. package/scaffold/en/commands/dw-bugfix.md +4 -2
  11. package/scaffold/en/commands/dw-plan.md +2 -2
  12. package/scaffold/en/commands/dw-refactor.md +1 -0
  13. package/scaffold/en/commands/dw-review.md +33 -2
  14. package/scaffold/en/commands/dw-run.md +1 -0
  15. package/scaffold/en/commands/dw-triage.md +220 -0
  16. package/scaffold/en/templates/idea-onepager.md +28 -0
  17. package/scaffold/en/templates/task-template.md +1 -0
  18. package/scaffold/en/templates/tasks-template.md +9 -8
  19. package/scaffold/en/templates/triage-needs-info-template.md +23 -0
  20. package/scaffold/en/templates/triage-out-of-scope-template.md +36 -0
  21. package/scaffold/en/templates/triage-record-template.md +88 -0
  22. package/scaffold/pt-br/commands/dw-autopilot.md +81 -81
  23. package/scaffold/pt-br/commands/dw-brainstorm.md +12 -9
  24. package/scaffold/pt-br/commands/dw-bugfix.md +4 -2
  25. package/scaffold/pt-br/commands/dw-claude-run.md +19 -19
  26. package/scaffold/pt-br/commands/dw-codex-run.md +19 -19
  27. package/scaffold/pt-br/commands/dw-context-budget.md +10 -10
  28. package/scaffold/pt-br/commands/dw-copilot-run.md +20 -20
  29. package/scaffold/pt-br/commands/dw-dockerize.md +102 -102
  30. package/scaffold/pt-br/commands/dw-find-skills.md +52 -52
  31. package/scaffold/pt-br/commands/dw-goal.md +41 -41
  32. package/scaffold/pt-br/commands/dw-harness-audit.md +11 -11
  33. package/scaffold/pt-br/commands/dw-intel.md +70 -70
  34. package/scaffold/pt-br/commands/dw-learn.md +24 -24
  35. package/scaffold/pt-br/commands/dw-new-project.md +88 -88
  36. package/scaffold/pt-br/commands/dw-open-design.md +53 -53
  37. package/scaffold/pt-br/commands/dw-opportunities.md +45 -45
  38. package/scaffold/pt-br/commands/dw-pause.md +39 -39
  39. package/scaffold/pt-br/commands/dw-plan.md +2 -2
  40. package/scaffold/pt-br/commands/dw-refactor.md +31 -30
  41. package/scaffold/pt-br/commands/dw-resume.md +22 -22
  42. package/scaffold/pt-br/commands/dw-review.md +33 -2
  43. package/scaffold/pt-br/commands/dw-run.md +1 -0
  44. package/scaffold/pt-br/commands/dw-skill-health.md +10 -10
  45. package/scaffold/pt-br/commands/dw-subtask-complete.md +4 -4
  46. package/scaffold/pt-br/commands/dw-subtask-start.md +4 -4
  47. package/scaffold/pt-br/commands/dw-triage.md +220 -0
  48. package/scaffold/pt-br/templates/bugfix-summary-template.md +20 -20
  49. package/scaffold/pt-br/templates/concerns-template.md +20 -20
  50. package/scaffold/pt-br/templates/idea-onepager.md +28 -0
  51. package/scaffold/pt-br/templates/project-onepager.md +32 -32
  52. package/scaffold/pt-br/templates/state-template.md +13 -13
  53. package/scaffold/pt-br/templates/task-template.md +1 -0
  54. package/scaffold/pt-br/templates/tasks-template.md +9 -8
  55. package/scaffold/pt-br/templates/triage-needs-info-template.md +23 -0
  56. package/scaffold/pt-br/templates/triage-out-of-scope-template.md +36 -0
  57. package/scaffold/pt-br/templates/triage-record-template.md +88 -0
  58. package/scaffold/scripts/hooks/git-guardrails.mjs +41 -24
  59. package/scaffold/skills/dw-debug-protocol/SKILL.md +2 -0
  60. package/scaffold/skills/dw-debug-protocol/references/six-step-triage.md +60 -1
  61. package/scaffold/skills/dw-execute-phase/references/wave-coordination.md +14 -14
  62. package/scaffold/skills/dw-grilling/SKILL.md +17 -7
  63. package/scaffold/skills/dw-grilling/references/decision-tree.md +30 -7
  64. package/scaffold/skills/dw-simplification/references/deep-modules.md +50 -0
  65. package/scaffold/skills/dw-testing-discipline/SKILL.md +3 -1
  66. package/scaffold/skills/dw-testing-discipline/references/tdd-loop.md +83 -0
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "name": "brunosps00-dev-workflow",
3
+ "description": "À-la-carte dev-workflow skills for focused agent work: minimalism, search-first research, verification, security review, and code quality.",
3
4
  "owner": {
4
5
  "name": "Bruno Santos"
5
6
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dev-workflow",
3
3
  "description": "Standalone, à-la-carte skills from the dev-workflow pipeline: minimalism, search-first, simplification, verification, security review, and more.",
4
- "version": "2.0.0",
4
+ "version": "2.1.0",
5
5
  "author": {
6
6
  "name": "Bruno Santos"
7
7
  },
package/CHANGELOG.md CHANGED
@@ -10,6 +10,110 @@ project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
10
10
  > those versions were released, so they are summaries of what shipped, not
11
11
  > contemporaneous release notes. `git log` remains the authoritative record.
12
12
 
13
+ ## [2.1.0] — 2026-08-04
14
+
15
+ Release driven by a skill-by-skill analysis of [mattpocock/skills](https://github.com/mattpocock/skills),
16
+ whose philosophy is the opposite of this project's: small composable skills anchored
17
+ to an issue tracker, against an opinionated pipeline with durable state in `.dw/`.
18
+ What follows is the transferable technique, adapted — plus five defects of our own
19
+ that the comparison exposed. What was deliberately **not** taken, and why, is
20
+ recorded in [docs/skills-ecosystem-comparison.md](docs/skills-ecosystem-comparison.md).
21
+
22
+ ### Added
23
+
24
+ - **`/dw-triage` — the intake boundary the pipeline never had.** External bug
25
+ reports, feature requests, and PRs previously had to be hand-converted into a
26
+ bugfix or a PRD before anything could touch them. One category (`bug` |
27
+ `enhancement`) and one state (`needs-triage` → `needs-info` | `ready-for-work` |
28
+ `needs-human` | `wontfix`), persisted in `.dw/triage/NNN-<slug>.md`, routing to
29
+ `/dw-bugfix`, `/dw-plan prd`, or `/dw-brainstorm --mode=grill`. Two mechanisms
30
+ carry the weight: **claims are verified before a brief is written** (bugs
31
+ reproduced from the reporter's steps, PR diffs checked against what they claim),
32
+ and `.dw/out-of-scope/<concept>.md` remembers rejections **by domain concept**
33
+ rather than by the request's wording, so a request refused in January is not
34
+ re-litigated in March. A `wontfix` for "already implemented" deliberately does
35
+ not write there — that store is memory of refusal, not of delivery.
36
+ It is local-first in the strict sense: `.dw/` is the source of truth and the
37
+ command works with no network and no `gh`. GitHub read via `gh` is optional
38
+ enrichment, and writing back is opt-in per write, never a side effect of triage.
39
+ - **`### Decision Map` in the idea one-pager.** `dw-grilling` already instructed
40
+ the agent to record its decision tree so a session could resume — with nowhere
41
+ to record it, so the graph was rebuilt from scratch every time and what the last
42
+ session knew was still *undecided* was lost. Each node now carries a `State`
43
+ (`resolved` | `open-ready` | `open-blocked`), a `Depends on:` field reusing the
44
+ form `tasks.md` already uses, and an explicit `**Frontier:**` line so the next
45
+ session reads what is decidable now without recomputing the graph. `#### Decision
46
+ Fog` records what is known to be undecided but not yet sharp enough to phrase as
47
+ a decision. Grill resumes from the map instead of re-deriving it, never re-asks a
48
+ `resolved` node, and the alignment gate now also requires `Frontier: none`.
49
+ Schema stays at `1.1`: the section is optional, so existing one-pagers stay valid.
50
+ - **`/dw-review --since <ref>`** — ad-hoc review against a verified comparison
51
+ point. Resolves the ref with `git rev-parse --verify`, aborts with an actionable
52
+ message if it does not resolve, aborts if the diff is empty rather than reviewing
53
+ nothing, and records the exact diff and commit commands in every report so the
54
+ review is reproducible. Three-dot, matching PR review semantics. The default
55
+ PRD/bugfix flow is unchanged.
56
+ - **Test-first loop in `dw-testing-discipline`** (`references/tdd-loop.md`):
57
+ confirm the public seam with the user, one red test per vertical slice, run it
58
+ and **observe** the expected red, minimum green, next slice. Refactor is outside
59
+ the cycle. `/dw-run` uses it only on an explicit request — never by default.
60
+ - **Red-capable feedback contract in `dw-debug-protocol`.** Reproduction was
61
+ specified as an outcome, not a procedure. A loop must now be single,
62
+ deterministic, fast, agent-runnable, and **proven red now** — "it should fail"
63
+ does not count — before any theorizing, with a repertoire of loop types and a
64
+ HITL template for when the loop needs credentials, hardware, or a human action.
65
+ `/dw-bugfix` records the loop command before and after the fix. Trivial bugs stay
66
+ exempt; the exemption ends when a first fix fails or the bug spans layers.
67
+ - **Seam dependency categories and Design It Twice** in
68
+ `dw-simplification/references/deep-modules.md`. Classifying what a seam isolates
69
+ (in-process, local-substitutable, remote owned, true external) derives the test
70
+ strategy instead of reflexively mocking or running everything; interface findings
71
+ require three-plus proposals under distinct constraints before one is recommended.
72
+ Loaded from `/dw-refactor` only for interface/seam findings, so simple refactors
73
+ stay cheap.
74
+ - **`AGENTS.md` and `CLAUDE.md`** at the repo root. A project whose product is
75
+ agent instructions had none for maintaining itself; the invariants existed only
76
+ as tests that fail after the mistake.
77
+
78
+ ### Fixed
79
+
80
+ - **`git restore .` bypassed the git guardrails entirely.** `git checkout .` was
81
+ blocked while `git restore .`, `git restore -- .`, `git restore --staged
82
+ --worktree .` and `git restore --source=<ref> .` — which discard exactly the same
83
+ uncommitted work — passed through. The hook had **no test at all**, which is why
84
+ the hole survived. It now has one that invokes the script for real over stdin,
85
+ including a case that runs it from a directory whose name contains a space.
86
+ - **`Depends on:` was parsed by the wave executor but existed in no template.**
87
+ `/dw-plan` told each task to declare its dependencies and
88
+ `dw-execute-phase/references/wave-coordination.md` built the parallel graph by
89
+ topological sort from that field — while `tasks-template.md` had no column for it
90
+ and `task-template.md` no field. The graph rested on data nothing produced. The
91
+ field now has a home in both, and `wave-coordination.md` uses the `1.0` task IDs
92
+ the pipeline actually writes instead of the `01` form its example carried.
93
+ - **`/dw-brainstorm --research` wrote outside the repo.** Reports went to
94
+ `~/Documents/<Topic>_Research_<date>/`, so `/dw-plan` and `/dw-intel` could not
95
+ consume research the pipeline itself produced. They now land under the active
96
+ spec, or under `.dw/spec/research/` when standalone.
97
+ - **The marketplace manifest had no description**, which `claude plugin validate`
98
+ warns about and `npm run validate` did not catch. The field was added to the
99
+ generator in `build-plugin.js`, not only to the checked-in JSON, so it survives
100
+ the next `npm run build:plugin`.
101
+ - **The PT `/dw-refactor` searched for a section that did not exist.** It told the
102
+ agent to locate `Modo: refactor-audit (catalogo de code smells + deep-modules)`
103
+ while the heading in `dw-brainstorm` reads `catálogo`, accented. The lookup never
104
+ matched; the EN pair matches exactly and always worked. Surfaced by the
105
+ accentuation pass below.
106
+
107
+ ### Changed
108
+
109
+ - **24 PT-BR scaffold files were written with no diacritics at all** ("Voce e a
110
+ entrada", "secao", "nao") while the other half of the scaffold was correctly
111
+ accented, making it impossible to tell a new mistake from old debt. All 24 are
112
+ now accented. Diacritics only, verified mechanically: both sides normalized
113
+ (Unicode NFKD, combining marks dropped) and compared byte for byte, so any
114
+ content change would have failed the check. Literal strings the commands search
115
+ for, code blocks, flags, paths, and English technical terms were left untouched.
116
+
13
117
  ## [2.0.0] — 2026-08-02
14
118
 
15
119
  First release after a full security audit of the compose recipes. Two options were
package/README.md CHANGED
@@ -42,14 +42,15 @@ Exportable skills (no `.dw/` pipeline required): `dw-minimalism`, `dw-search-fir
42
42
 
43
43
  ## Commands
44
44
 
45
- dev-workflow v2.0.0 ships **38 commands** organized into four tiers. Most users only invoke Tier 1 + Tier 2.
45
+ dev-workflow v2.1.0 ships **39 commands** organized into four tiers. Most users only invoke Tier 1 + Tier 2.
46
46
 
47
- ### Tier 1 — Gateway (3)
47
+ ### Tier 1 — Gateway (4)
48
48
 
49
49
  | Command | When |
50
50
  |---------|------|
51
51
  | **`/dw-autopilot "wish"`** | Default entry point in two invocations. First run completes PRD → TechSpec → Tasks and stops. Second run resumes from state, executes `/dw-goal --from-autopilot <slug>` for Run → Review → QA/Fix → Review, then Security Gate → Commit → PR. |
52
52
  | **`/dw-bugfix "description"`** | A bug report or pasted error. Triages bug-vs-feature-vs-scope, surgical fix or routes to a PRD. |
53
+ | **`/dw-triage [item]`** | An external bug report, feature request, or PR. Checks whether it already exists and whether it was rejected before, verifies the claim, then routes to `/dw-bugfix`, `/dw-plan prd`, or `/dw-brainstorm --mode=grill`. Local-first in `.dw/triage/`; works with no network and no `gh`. |
53
54
  | **`/dw-help [keyword]`** | Discover commands. Pass a keyword for shortcuts; `--advanced` reveals internal commands. |
54
55
 
55
56
  ### Tier 2 — Pipeline granular (10)
@@ -62,19 +63,20 @@ Use these when you want step-by-step control instead of `/dw-autopilot`.
62
63
  | **`/dw-brainstorm "idea"`** | Refine a concrete idea before PRD. Flags: `--onepager` (durable artifact), `--council` (multi-advisor debate), `--research` (multi-source cited research). |
63
64
  | **`/dw-plan "feature"`** | PRD → TechSpec → Tasks sequentially with checkpoints. Stages: `prd`, `techspec`, `tasks`. Mandatory clarification questions, source-grounding, constitution gate, final consistency check. |
64
65
  | **`/dw-run [task-id]`** | Execute tasks. Default: all pending in dependency order with wave-based parallel dispatch. Single-task: pass an ID. `--resume` continues an interrupted plan. |
65
- | **`/dw-review`** | Level 2 (PRD coverage mapping) + Level 3 (code quality). Hard gates on dw-verify PASS, secure-audit, constitution violations. Flags: `--coverage-only`, `--code-only`, `--bugfix <slug>` (review a bugfix at `.dw/bugfixes/<slug>/`). |
66
+ | **`/dw-review`** | Level 2 (PRD coverage mapping) + Level 3 (code quality). Hard gates on dw-verify PASS, secure-audit, constitution violations. Flags: `--coverage-only`, `--code-only`, `--bugfix <slug>` (review a bugfix at `.dw/bugfixes/<slug>/`), `--since <ref>` (ad-hoc review from a verified comparison point). |
66
67
  | **`/dw-qa`** | Mode-aware QA. Auto-detects UI vs API. Flags: `--fix` (iterative QA + fix-retest loop), `--api`, `--ai` (AI eval against reference dataset), `--uat` (human-in-the-loop walkthrough), `--bugfix <slug>` (QA a bugfix). |
67
68
  | **`/dw-pause`** | Consolidate the current session's mental state into `.dw/STATE.md` (Decisions, Blockers, Todos, Deferred, Lessons, Open Loops). Used before long breaks or context-window compactions. |
68
69
  | **`/dw-resume`** | Read `.dw/STATE.md`, present a TLDR of where work left off, and suggest the next `dw-*` command. Never auto-executes. |
69
70
  | **`/dw-commit`** | Atomic Conventional Commits for pending changes. Applies `dw-git-discipline` (one intent per commit, lint+tests+build green before). |
70
71
  | **`/dw-generate-pr [target]`** | Push the branch, draft a PR body with summary + test plan, open the browser. Hard gates: dw-verify PASS + secure-audit. |
71
72
 
72
- ### Tier 3 — Specialty (12)
73
+ ### Tier 3 — Specialty (13)
73
74
 
74
75
  | Command | What |
75
76
  |---------|------|
76
77
  | **`/dw-analyze-project`** | Scans the repo, writes `.dw/rules/` (per-module conventions, anti-patterns, naming). Step 8 offers `.dw/constitution.md`; Step 9 writes `.dw/rules/concerns.md`; Step 10 can synthesize a frontend `DESIGN.md` from existing tokens. Run once per project; refresh after major refactors. |
77
78
  | **`/dw-redesign-ui "target"`** | Audits a frontend page, runs the `dw-ui-discipline` 4-question grounding, proposes 2-3 design directions, ships the redesign. WCAG 2.2 AA accessibility floor is non-negotiable; UI diffs can also run the deterministic impeccable slop detector. |
79
+ | **`/dw-open-design "brief"`** | Generates, iterates, or refactors headless Open Design HTML prototypes through the `od` CLI. Refines the brief before dispatch, runs with an explicit `--agent codex\|claude`, captures JSONL audit logs, and stops for a dual ≥9 visual gate. `--refactor` works from a live URL or from screenshots. |
78
80
  | **`/dw-refactor "target"`** | Audits a target for refactor opportunities using Fowler smells, `dw-simplification`, deep-modules analysis, and behavior-preserving test gates. This is the explicit route for code-health and tech-debt work. |
79
81
  | **`/dw-functional-doc`** | Maps screens + user flows into a functional doc, validated end-to-end with Playwright. Uses the WSL-resilient browser resolver and can capture guided functional video evidence. |
80
82
  | **`/dw-context-budget`** | Audits context overhead from commands, skills, agents, instruction files, and MCPs. |
@@ -22,6 +22,8 @@ const { readSkillRegistry } = require('./skill-registry');
22
22
 
23
23
  const REPO_ROOT = path.join(__dirname, '..');
24
24
  const PLUGIN_DIR = path.join(REPO_ROOT, '.claude-plugin');
25
+ const MARKETPLACE_DESCRIPTION =
26
+ 'À-la-carte dev-workflow skills for focused agent work: minimalism, search-first research, verification, security review, and code quality.';
25
27
 
26
28
  function buildManifests() {
27
29
  const registry = readSkillRegistry();
@@ -46,6 +48,7 @@ function buildManifests() {
46
48
 
47
49
  const marketplace = {
48
50
  name: 'brunosps00-dev-workflow',
51
+ description: MARKETPLACE_DESCRIPTION,
49
52
  owner: author,
50
53
  plugins: [
51
54
  {
@@ -72,7 +75,7 @@ function run() {
72
75
  for (const name of exportable) console.log(` - ${name}`);
73
76
  }
74
77
 
75
- module.exports = { buildManifests, run };
78
+ module.exports = { buildManifests, run, MARKETPLACE_DESCRIPTION };
76
79
 
77
80
  if (require.main === module) {
78
81
  run();
package/lib/constants.js CHANGED
@@ -30,13 +30,14 @@ const COMMANDS = {
30
30
  { name: 'dw-redesign-ui', description: 'Audits a frontend page, proposes design directions you choose from, then ships the redesign.' },
31
31
  { name: 'dw-refactor', description: 'Audits a target for refactor opportunities using the refactor-audit protocol, Fowler smells, deep-modules analysis, and behavior-preserving test gates.' },
32
32
  { name: 'dw-resume', description: 'Trigger when user says "resume work", "where did we stop?", or starts a session in a project with an existing .dw/STATE.md. Reads STATE.md, presents a TLDR, and suggests the next dw-* command.' },
33
- { name: 'dw-review', description: 'Trigger when user asks to review code, check quality, or verify PR readiness. Default runs L2 (PRD coverage) + L3 (code quality). Flags --coverage-only / --code-only / --bugfix <slug>.' },
33
+ { name: 'dw-review', description: 'Trigger when user asks to review code, check quality, or verify PR readiness. Default runs L2 (PRD coverage) + L3 (code quality). Flags --coverage-only / --code-only / --bugfix <slug> / --since <ref>.' },
34
34
  { name: 'dw-run', description: 'Trigger when user wants to execute tasks. Default runs all pending in dependency order; \'run <task-id>\' runs one; \'run --resume\' continues an interrupted plan.' },
35
35
  { name: 'dw-secure-audit', description: 'Security Gate: OWASP + Semgrep SAST (diff) + gitleaks secrets + Trivy SCA/IaC + lockfile + supply-chain + outdated. Rigoroso: secrets/CRITICAL/HIGH block. Auto-invoked by /dw-review and /dw-generate-pr, explicit phase in /dw-autopilot, and runnable standalone.' },
36
36
  { name: 'dw-skill-health', description: 'Audits installed skills and agents for bloat, duplication, missing references, and stale or unused modules.' },
37
37
  { name: 'dw-subtask-start', userInvoked: true, description: 'Creates a minimal input packet for a subagent without injecting the parent transcript.' },
38
38
  { name: 'dw-subtask-complete', userInvoked: true, description: 'Records a structured subagent handoff with result, files, decisions, risks, verification, and blockers.' },
39
39
  { name: 'dw-subtask-resume', userInvoked: true, description: 'Consumes pending subagent handoffs, summarizes them for the parent, and archives the local packets.' },
40
+ { name: 'dw-triage', description: 'Local-first intake for external bug reports, feature requests, and PRs. Persists .dw/triage/ state, checks redundancy and prior rejections, verifies claims, then routes to /dw-bugfix, /dw-plan prd, /dw-brainstorm --mode=grill, or no work.' },
40
41
  { name: 'dw-update', description: 'Updates dev-workflow to the latest npm release in-place, with a snapshot you can roll back to.' },
41
42
  ],
42
43
  'pt-br': [
@@ -70,13 +71,14 @@ const COMMANDS = {
70
71
  { name: 'dw-redesign-ui', description: 'Audita uma pagina frontend, propoe direcoes de design que voce escolhe, e entrega o redesign.' },
71
72
  { name: 'dw-refactor', description: 'Audita um target por oportunidades de refactor usando o protocolo refactor-audit, smells Fowler, deep-modules e gates de teste preservando comportamento.' },
72
73
  { name: 'dw-resume', description: 'Trigger quando usuario diz "retoma", "onde paramos?" ou comeca sessao num projeto com .dw/STATE.md existente. Le STATE.md, apresenta TLDR e sugere proximo comando dw-*.' },
73
- { name: 'dw-review', description: 'Trigger quando usuario pede pra revisar codigo, checar qualidade ou validar prontidao pra PR. Default roda L2 (cobertura PRD) + L3 (qualidade). Flags --coverage-only / --code-only / --bugfix <slug>.' },
74
+ { name: 'dw-review', description: 'Trigger quando usuário pede pra revisar código, checar qualidade ou validar prontidão pra PR. Default roda L2 (cobertura PRD) + L3 (qualidade). Flags --coverage-only / --code-only / --bugfix <slug> / --since <ref>.' },
74
75
  { name: 'dw-run', description: 'Trigger quando usuario quer executar tasks. Default roda todas pendentes em ordem de dependencia; \'run <task-id>\' roda uma; \'run --resume\' continua plan interrompido.' },
75
76
  { name: 'dw-secure-audit', description: 'Security Gate: OWASP + Semgrep SAST (diff) + gitleaks secrets + Trivy SCA/IaC + lockfile + supply-chain + outdated. Rigoroso: secrets/CRITICAL/HIGH bloqueiam. Auto-invocado por /dw-review e /dw-generate-pr, fase explicita no /dw-autopilot, e executavel standalone.' },
76
77
  { name: 'dw-skill-health', description: 'Audita skills e agentes instalados por bloat, duplicacao, referencias quebradas e modulos sem uso.' },
77
78
  { name: 'dw-subtask-start', userInvoked: true, description: 'Cria um input packet minimo para subagente sem injetar transcript bruto do parent.' },
78
79
  { name: 'dw-subtask-complete', userInvoked: true, description: 'Registra handoff estruturado do subagente com resultado, arquivos, decisoes, riscos, verificacao e bloqueios.' },
79
80
  { name: 'dw-subtask-resume', userInvoked: true, description: 'Consome handoffs pendentes de subagentes, resume para o parent e arquiva os pacotes locais.' },
81
+ { name: 'dw-triage', description: 'Intake local-first para bug reports, feature requests e PRs externos. Persiste estado em .dw/triage/, checa redundância e rejeições anteriores, verifica alegações, e então roteia para /dw-bugfix, /dw-plan prd, /dw-brainstorm --mode=grill, ou nenhum trabalho.' },
80
82
  { name: 'dw-update', description: 'Atualiza o dev-workflow para o release mais recente no npm, com snapshot para rollback.' },
81
83
  ],
82
84
  };
package/lib/validate.js CHANGED
@@ -23,8 +23,10 @@ function run() {
23
23
 
24
24
  // Plugin manifest drift check.
25
25
  const { plugin, marketplace } = buildManifests();
26
+ checkMarketplaceDescription(marketplace, issues);
26
27
  checkManifestDrift('.claude-plugin/plugin.json', plugin, issues);
27
28
  checkManifestDrift('.claude-plugin/marketplace.json', marketplace, issues);
29
+ checkMarketplaceFileDescription('.claude-plugin/marketplace.json', issues);
28
30
 
29
31
  console.log('dev-workflow validate\n');
30
32
  if (warnings.length) {
@@ -55,6 +57,25 @@ function checkManifestDrift(relPath, expected, issues) {
55
57
  }
56
58
  }
57
59
 
60
+ function checkMarketplaceDescription(marketplace, issues) {
61
+ if (!marketplace || typeof marketplace.description !== 'string' || !marketplace.description.trim()) {
62
+ issues.push('Generated marketplace manifest must include a root-level description.');
63
+ }
64
+ }
65
+
66
+ function checkMarketplaceFileDescription(relPath, issues) {
67
+ const file = path.join(__dirname, '..', relPath);
68
+ if (!fs.existsSync(file)) return;
69
+ try {
70
+ const manifest = JSON.parse(fs.readFileSync(file, 'utf-8'));
71
+ if (typeof manifest.description !== 'string' || !manifest.description.trim()) {
72
+ issues.push(`${relPath} must include a root-level description.`);
73
+ }
74
+ } catch {
75
+ issues.push(`${relPath} is not valid JSON.`);
76
+ }
77
+ }
78
+
58
79
  module.exports = { run };
59
80
 
60
81
  if (require.main === module) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brunosps00/dev-workflow",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "AI-driven development workflow commands for any project. Scaffolds a complete PRD-to-PR pipeline with multi-platform AI assistant support.",
5
5
  "bin": {
6
6
  "dev-workflow": "./bin/dev-workflow.js"
@@ -181,7 +181,7 @@ At the end, always leave the user in one of these situations:
181
181
  - With better questions to decide
182
182
  - With a next workspace command to follow
183
183
  - With the one-pager at `.dw/spec/ideas/<slug>.md` (if **onepager** mode fired)
184
- - With the research report at `~/Documents/<Topic>_Research_<date>/` (if **research** mode fired)
184
+ - With the research report at `.dw/spec/<prd-slug>/research/<topic-slug>-<YYYYMMDD>/research.md` when a PRD is active, `.dw/spec/ideas/<idea-slug>-research-<YYYYMMDD>/research.md` when an idea one-pager is active, or `.dw/spec/research/<topic-slug>-<YYYYMMDD>/research.md` for standalone research (if **research** mode fired)
185
185
  - With the refactor plan at `<target>/refactor-plan.md` (if **refactor-audit** mode fired)
186
186
  - With canonical glossary entries in `.dw/domain/**` and an aligned idea one-pager (if **grill** ran with authorization)
187
187
  - With a runnable throwaway prototype + verdict template (if **prototype** mode fired)
@@ -237,7 +237,7 @@ Complementary skill **`dw-source-grounding`**: **ALWAYS** — apply Detect → F
237
237
 
238
238
  ### Output
239
239
 
240
- Saved to `~/Documents/<Topic>_Research_<YYYYMMDD>/`. Mandatory sections:
240
+ Save `research.md` inside the repo: `.dw/spec/<prd-slug>/research/<topic-slug>-<YYYYMMDD>/research.md` when a PRD is active, `.dw/spec/ideas/<idea-slug>-research-<YYYYMMDD>/research.md` when an idea one-pager is active, or `.dw/spec/research/<topic-slug>-<YYYYMMDD>/research.md` for standalone research. Mandatory sections:
241
241
  1. Executive Summary (200-400 words)
242
242
  2. Introduction (scope, methodology, assumptions)
243
243
  3. Main Analysis (4-8 findings, 600-2000 words each, all cited)
@@ -364,9 +364,12 @@ When these signals appear during auto-dispatch, **recommend** Grill in one line
364
364
 
365
365
  ### The session (after authorization)
366
366
 
367
- 1. **Build the decision tree first.** Before the first question, inspect project facts — current PRDs/TechSpecs,
368
- `.dw/rules/`, `.dw/intel/` (via `/dw-intel`), `.dw/constitution.md`, `.dw/domain/**`, and recent git activity —
369
- and build a decision tree **ordered by dependencies** (never ask a downstream decision before its blocker).
367
+ 1. **Resume or build the decision tree first.** Before the first question, read the active one-pager for an
368
+ existing **Decision Map**. If present, resume from its `Depends on:` graph, `State` values, explicit
369
+ **Frontier**, and `Decision Fog`; do not re-ask nodes already `resolved`. If no map exists, inspect project
370
+ facts — current PRDs/TechSpecs, `.dw/rules/`, `.dw/intel/` (via `/dw-intel`), `.dw/constitution.md`,
371
+ `.dw/domain/**`, and recent git activity — and build a decision tree **ordered by dependencies** (never ask a
372
+ downstream decision before its blocker).
370
373
  2. **Ask exactly one unresolved decision per interaction and wait.** Each question includes: evidence when
371
374
  available (with source), the recommended answer, a short rationale, and a meaningful alternative/trade-off.
372
375
  Follow `dw-grilling` (`references/interview-loop.md`, `references/decision-tree.md`).
@@ -403,9 +406,10 @@ reads and links `.dw/domain/**` and must preserve it, never regenerate it.
403
406
 
404
407
  ### Aligned handoff — the idea one-pager (schema `1.1`)
405
408
 
406
- Grill extends `.dw/spec/ideas/<slug>.md` to schema `1.1`, adding: **Resolved Decisions** (each with the recommended
407
- answer, the user's choice, and the alternative rejected), **Evidence** (facts discovered with sources),
408
- **Canonical Vocabulary** (links into `.dw/domain/**`), **Remaining Decisions**, and **Alignment State**.
409
+ Grill extends `.dw/spec/ideas/<slug>.md` to schema `1.1`, adding: **Decision Map** (nodes, `Depends on:`, `State`,
410
+ explicit **Frontier**, and `Decision Fog` for unclear future nodes), **Resolved Decisions** (each with the
411
+ recommended answer, the user's choice, and the alternative rejected), **Evidence** (facts discovered with
412
+ sources), **Canonical Vocabulary** (links into `.dw/domain/**`), **Remaining Decisions**, and **Alignment State**.
409
413
 
410
414
  Set `status: aligned` **only when all** of these hold: every dependency branch is resolved, glossary/code
411
415
  contradictions are closed, no blocking open decision remains, AND the user **explicitly confirms** shared
@@ -38,7 +38,7 @@
38
38
 
39
39
  When available in the project at `./.agents/skills/`, use these skills as contextual support without replacing this command:
40
40
 
41
- - `dw-debug-protocol`: **ALWAYS** — runs the bug through the six-step triage (Reproduce → Localize → Reduce → Fix Root Cause → Guard → Verify End-to-End). Stop-the-line discipline; root-cause over symptom; regression test committed in the same atomic commit. Non-reproducible bugs follow the instrument-first sub-protocol — no guess fixes without explicit acknowledgement.
41
+ - `dw-debug-protocol`: **ALWAYS** — runs the bug through the six-step triage (Reproduce → Localize → Reduce → Fix Root Cause → Guard → Verify End-to-End). Stop-the-line discipline; root-cause over symptom; regression test committed in the same atomic commit. For non-trivial bugs, or after a first fix fails, Step 1 must establish a red-capable feedback loop before theorizing. Non-reproducible bugs follow the instrument-first sub-protocol — no guess fixes without explicit acknowledgement.
42
42
  - `dw-verify`: **ALWAYS** — in Direct mode, invoked before committing the fix. The VERIFICATION REPORT must show the original bug symptom no longer reproduces (not just that tests pass).
43
43
  - `vercel-react-best-practices`: use when the bug affects React/Next.js and there is suspicion of render, hydration, fetching, waterfall, bundle, or re-render issues
44
44
  - `dw-testing-discipline`: use when the fix requires a reproducible E2E/retest flow in a web app — `references/playwright-recipes.md` for recipes, core rules + 6 agent guardrails for any test the fix adds, flaky-discipline if the bug surfaces intermittently.
@@ -214,6 +214,7 @@
214
214
  - Stack traces
215
215
  - Recently modified files
216
216
  - If the bug is UI-related or depends on browser flow, supplement collection with `dw-testing-discipline` (playwright-recipes + three-workflow-patterns to pick the right verification mode)
217
+ - For non-trivial bugs, or when the first fix attempt failed, build the `dw-debug-protocol` red-capable feedback loop before proposing a cause: one loop command/artifact, deterministic enough, fast, agent-runnable, and observed red. If no agent-runnable loop is possible, record attempts and ask the user for the missing artifact/access with the HITL template from `references/six-step-triage.md`.
217
218
 
218
219
  ### 3. Clarification Questions (MANDATORY - EXACTLY 3)
219
220
 
@@ -384,7 +385,7 @@
384
385
  1. Discover the next `NNN` (see File Locations section).
385
386
  2. Create `.dw/bugfixes/NNN-<slug>/` if not yet created in step 5.0.
386
387
  3. Write `TASK.md` with the triage, clarifications, root cause, and the approved plan as executed (use `.dw/templates/bugfix-template.md` as the base structure).
387
- 4. Write `fix-report.md` with the verbatim `dw-verify` VERIFICATION REPORT plus the before/after reproduction trace.
388
+ 4. Write `fix-report.md` with the verbatim `dw-verify` VERIFICATION REPORT plus the before/after reproduction trace. The report MUST include `Loop command before fix` and `Loop command after fix` (or the exact HITL blocker, attempts made, and artifact/access requested when no loop was possible).
388
389
  5. Write `SUMMARY.md` using `.dw/templates/bugfix-summary-template.md`. Fill in slug, date, status `Fixed`, severity, related_concerns (from step 1.5), Symptom (verbatim), Root Cause (one sentence), Resolution (2-4 bullets), Files Touched, Verification, Related, Followups.
389
390
  6. If the fix touched a concern listed in `.dw/rules/concerns.md`, append a line to that concern's row's `Last incident` column (or add a new row under Known Bug History) — preserve hand-written entries between `<!-- preserved:start -->` markers.
390
391
  7. Report paths of all three files in chat before the commit step.
@@ -494,6 +495,7 @@
494
495
  - [ ] **Maximum 5 affected files**
495
496
  - [ ] **No migrations**
496
497
  - [ ] **Test task included (correct project framework)**
498
+ - [ ] **Non-trivial bug loop recorded: command before fix + command after fix, or HITL blocker with attempts + requested artifact/access**
497
499
  - [ ] Awaiting approval before executing
498
500
  - [ ] **`.dw/bugfixes/NNN-<slug>/{TASK,fix-report,SUMMARY}.md` written after verify PASS**
499
501
 
@@ -69,7 +69,7 @@ Before Stage 1, check for an idea one-pager at `.dw/spec/ideas/<slug>.md` and th
69
69
  - `schema_version: "1.1"`;
70
70
  - `status: aligned`;
71
71
  - `alignment.confirmed_by_user: true`;
72
- - every dependency branch is resolved (no open decision node);
72
+ - the **Decision Map** has every dependency branch resolved (no open decision node and `Frontier: none`);
73
73
  - glossary/code contradictions are closed;
74
74
  - no **blocking** entry remains under Remaining Decisions.
75
75
  If ANY check fails — or the file is malformed, internally inconsistent, `draft`, or `paused` — the one-pager is **input, not a trusted handoff**: read it for context, but treat all its decisions as **uncovered** and ask them normally. Never suppress a product question on the strength of `status: aligned` alone; `alignment.confirmed_by_user: true` and a resolved, non-blocking, contradiction-free tree are required too.</critical>
@@ -167,7 +167,7 @@ Runs when default mode (after TechSpec approval) OR `plan tasks`.
167
167
  4. **Test placement (`dw-testing-discipline`):** every test-adding subtask names its invariant per the placement doctrine. Owning layer specified.
168
168
  5. **Constitution alignment:** every task lists `Constitution: respects P-NNN` or `Constitution: deviates P-NNN — ADR planned: <slug>` or `Constitution: n/a — reason: <one-liner>`.
169
169
  6. **LLM-eval subtask (when applicable):** if the PRD has an AI feature, one task must include an Eval Plan subtask (reference dataset path, oracle rungs, judge calibration, target metrics).
170
- 7. **Dependency declaration:** each task explicitly lists which previous tasks it depends on. Validation rejects cycles.
170
+ 7. **Dependency declaration:** each task explicitly lists which previous tasks it depends on. Write the field as `Depends on: none` or `Depends on: 1.0, 2.0` in `tasks.md` and each `<N>_task.md`. Validation rejects cycles.
171
171
  8. **Output locations:**
172
172
  - Summary: `.dw/spec/prd-<feature-slug>/tasks.md`
173
173
  - Per-task files: `.dw/spec/prd-<feature-slug>/<N>_task.md`
@@ -29,6 +29,7 @@ You are the dev-workflow refactor audit entrypoint. This command restores an exp
29
29
  - Using Fowler smell taxonomy.
30
30
  - Loading `dw-review-rigor` and `dw-simplification` when available.
31
31
  - Applying Chesterton's Fence and deep-modules analysis before proposing a refactor.
32
+ - Loading the advanced deep-modules sections (`Dependency categories decide seam tests` and `Design It Twice for interface findings`) only when the surviving finding is a shallow interface, interface leak, or seam in the wrong place.
32
33
  - De-duplicating findings and severity-ordering P0-P3.
33
34
  - Saving the output to `<target>/refactor-plan.md`.
34
35
  5. If the target does not exist or is too broad, use the clarification questions to narrow it before scanning.
@@ -19,6 +19,7 @@ You are the review orchestrator. Runs both Level 2 (PRD compliance / coverage) a
19
19
  | `/dw-review --coverage-only` | Only Level 2 — maps every PRD requirement (or bugfix scope) to the code that delivers it. Skips code quality. |
20
20
  | `/dw-review --code-only` | Only Level 3 — code quality / convention / security checks. Skips PRD/scope mapping. |
21
21
  | `/dw-review --bugfix <NNN-slug>` | Targets a bugfix at `.dw/bugfixes/NNN-slug/` instead of a PRD. Level 2 maps the bugfix scope (TASK.md + fix-report.md + SUMMARY.md) to the code that delivers the fix; Level 3 checks the diff. Output: `.dw/bugfixes/NNN-slug/review/`. |
22
+ | `/dw-review --since <ref>` | Ad-hoc review against a verified comparison point. Runs the normal selected levels, but the diff is computed from `<ref>` after the `--since` preflight below. |
22
23
 
23
24
  ## Inputs
24
25
 
@@ -26,7 +27,8 @@ You are the review orchestrator. Runs both Level 2 (PRD compliance / coverage) a
26
27
  |----------|-------------|---------|
27
28
  | `{{PRD_PATH}}` | Path to PRD directory (auto-detect from active branch if omitted; ignored when `--bugfix` is used) | `.dw/spec/prd-invoice-export` |
28
29
  | `{{BUGFIX_SLUG}}` | Bugfix slug when `--bugfix` flag is used | `001-login-not-working` |
29
- | `{{MODE}}` | `--coverage-only` / `--code-only` / `--bugfix <slug>` (optional; default = both, target = PRD) | — |
30
+ | `{{SINCE_REF}}` | Git ref used when `--since <ref>` is passed | `v2.0.0`, `HEAD~3`, `main` |
31
+ | `{{MODE}}` | `--coverage-only` / `--code-only` / `--bugfix <slug>` / `--since <ref>` (optional; default = both, target = PRD) | — |
30
32
 
31
33
  ## Target Resolution
32
34
 
@@ -38,6 +40,24 @@ The review runs against one of two target kinds. Compute `<target>` ONCE at the
38
40
 
39
41
  When the bugfix target is used, the Coverage mapping (Level 2) operates on the numbered tasks from `TASK.md` (not FR-N.M); a task is DELIVERED when (a) the files it claimed to touch are in the diff and (b) the regression test referenced in `fix-report.md` exists and runs. Orphan code in bugfix mode is anything in the diff that does not correspond to a numbered task — a strong signal the safety valve should have escalated to `/dw-plan`.
40
42
 
43
+ ## `--since <ref>` Preflight
44
+
45
+ `--since` is opt-in. The default PRD/bugfix review keeps using the PRD branch creation point / base branch flow unchanged.
46
+
47
+ When `--since <ref>` is passed, run this preflight before any Level 2 or Level 3 analysis:
48
+
49
+ 1. Resolve the fixed point:
50
+ - Run `git rev-parse --verify --quiet <ref>^{commit}`.
51
+ - If it fails, abort with: `REJECTED: --since ref '<ref>' does not resolve to a commit. Pass a valid commit, tag, or branch, then rerun /dw-review --since <ref>.`
52
+ 2. Build the review range:
53
+ - Diff command: `git diff <ref>...HEAD`.
54
+ - Commit command: `git log <ref>..HEAD --oneline`.
55
+ - Choice: three-dot diff is used so the reviewed patch is what `HEAD` changed since the merge-base with the verified ref, matching PR review semantics and avoiding changes that exist only on `<ref>`.
56
+ 3. Confirm the diff is not empty:
57
+ - Run `git diff --name-only <ref>...HEAD`.
58
+ - If it returns no paths, abort with: `APPROVED: no changes to review for git diff <ref>...HEAD. Pick an earlier --since ref or use the default PRD/base-branch review.`
59
+ 4. Record the resolved ref, the diff command, and the commit command in every generated review report so the review is reproducible.
60
+
41
61
  ## Complementary Skills
42
62
 
43
63
  When available under `./.agents/skills/`, these are invoked as analytical support:
@@ -107,6 +127,9 @@ Saved to `<target>/QA/review-coverage.md` (PRD target) or `<target>/review/revie
107
127
  ```markdown
108
128
  # Coverage Review
109
129
 
130
+ **Diff command:** git diff <effective-base-or-ref>...HEAD
131
+ **Commit range:** git log <effective-base-or-ref>..HEAD --oneline
132
+
110
133
  ## Status by Functional Requirement
111
134
 
112
135
  | FR | Description | Status | Evidence | Commit |
@@ -133,7 +156,7 @@ If MISSING > 0, the verdict suggests revisiting `/dw-plan tasks` to scope or `/d
133
156
 
134
157
  ### Behavior
135
158
 
136
- 1. **Diff analysis:** identify what changed since the PRD branch was created (`git diff <base-branch>...HEAD`).
159
+ 1. **Diff analysis:** identify what changed since the PRD branch was created (`git diff <base-branch>...HEAD`). If `--since <ref>` is used, use the preflight diff command instead.
137
160
 
138
161
  2. **Rules conformance** (against `.dw/rules/`):
139
162
  - General patterns: no `any` types in TS, no `console.log` in prod, error handling, multi-tenancy.
@@ -176,6 +199,13 @@ Saved to `<target>/QA/dw-code-review.md` (PRD target) or `<target>/review/dw-cod
176
199
  - **APPROVED WITH CAVEATS** — green but findings worth fixing in follow-up (filed with severities).
177
200
  - **REJECTED** — at least one hard gate failed. Specify which.
178
201
 
202
+ The report MUST include:
203
+
204
+ ```markdown
205
+ **Diff command:** git diff <effective-base-or-ref>...HEAD
206
+ **Commit range:** git log <effective-base-or-ref>..HEAD --oneline
207
+ ```
208
+
179
209
  ## Consolidated output (default mode)
180
210
 
181
211
  When both levels run, a consolidated report at `<target>/QA/review-consolidated.md` (PRD target) or `<target>/review/review-consolidated.md` (bugfix target):
@@ -188,6 +218,7 @@ When both levels run, a consolidated report at `<target>/QA/review-consolidated.
188
218
  **Verification Report:** PASS
189
219
  **Security Audit:** PASS (or REJECTED with reasons)
190
220
  **Constitution Compliance:** PASS (or violations listed)
221
+ **Diff command:** git diff <effective-base-or-ref>...HEAD
191
222
 
192
223
  ## Overall Verdict
193
224
  <line>
@@ -34,6 +34,7 @@ When available under `./.agents/skills/`, these skills are invoked per task:
34
34
  - Instincts (lazy): at task start, also load any high-confidence instinct (`.dw/memory/instincts/`, confidence ≥0.7) whose `trigger` matches the task — learned project conventions promoted by `/dw-learn`. Match by trigger only; never bulk-load the set.
35
35
  - `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.
36
36
  - `dw-testing-discipline`: applies the placement doctrine, 6 agent guardrails, and 25 anti-patterns when adding tests during the task.
37
+ - `dw-testing-discipline` test-first mode: ONLY when the task text or user explicitly says `TDD`, `test first`, or `red-green-refactor`, execute that task through `references/tdd-loop.md` (confirm public seams with the user → write ONE red test → run and observe red → implement minimum green → run and observe green → next slice; refactor only after the loop via `dw-simplification`). This is not the default `/dw-run` mode.
37
38
  - `dw-ui-discipline`: when the task touches UI, the 4 grounding questions must be answered before any visual decision lands.
38
39
  - `dw-llm-eval`: when the task touches AI feature code paths, the reference dataset + oracle ladder rules apply.
39
40
  - `dw-minimalism`: **before writing new code** — climb the YAGNI decision ladder (need it? reuse? stdlib? native? installed dep? one line?) at the active intensity, then write the minimum. Hands new dependencies to `dw-search-first`.