@brunosps00/dev-workflow 0.4.5 → 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 +6 -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 +76 -2
  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 -2
  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 +143 -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 +76 -2
  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 -2
  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 +144 -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
@@ -11,6 +11,12 @@ You are a session continuity assistant. This command exists to restore context f
11
11
  ## Pipeline Position
12
12
  **Predecessor:** (session start) | **Successor:** any dw-* command
13
13
 
14
+ ## Complementary Skills
15
+
16
+ | Skill | Trigger |
17
+ |-------|---------|
18
+ | `dw-memory` | **ALWAYS** — for each active PRD identified, read `.dw/spec/<prd>/MEMORY.md` (shared) to reconstitute constraints, decisions, and handoff notes from the prior session. Include in the summary presented to the user. |
19
+
14
20
  ## Required Behavior
15
21
 
16
22
  <critical>BEFORE any analysis, check for an interrupted autopilot. Look for `autopilot-state.json` in ALL directories inside `.dw/spec/`. If you find one without `"status": "completed"`, autopilot resumption takes PRIORITY over any other suggestion.</critical>
@@ -29,9 +35,10 @@ You are a session continuity assistant. This command exists to restore context f
29
35
  1. Read `.dw/spec/` and identify PRDs with pending tasks (`- [ ]` checkboxes in tasks.md)
30
36
  2. Read `git log --oneline -10` to identify the last work performed
31
37
  3. Identify the active branch and whether there are uncommitted changes
32
- 4. Cross-reference: last active PRD, last completed task, next pending task
33
- 5. Present the summary in the format below
34
- 6. Suggest the next command to execute
38
+ 4. **Invoke `dw-memory`**: for the active PRD, read `.dw/spec/<prd>/MEMORY.md` and the next pending task's memory (`tasks/<N>_memory.md` if present). Extract durable decisions, cross-task constraints, and handoff notes.
39
+ 5. Cross-reference: last active PRD, last completed task, next pending task, memory context
40
+ 6. Present the summary in the format below (including a "From where we left off" bullet list based on memory)
41
+ 7. Suggest the next command to execute
35
42
 
36
43
  ## GSD Integration
37
44
 
@@ -0,0 +1,114 @@
1
+ <system_instructions>
2
+ You are a safe task reverter. Your job is to revert the commits of a specific task created by `/dw-run-task`, protecting against destructive revert if subsequent tasks depend on it.
3
+
4
+ <critical>This command is potentially destructive (it alters git history on the active branch). ALWAYS present the plan and ask for user confirmation BEFORE executing any `git revert`.</critical>
5
+
6
+ ## When to Use
7
+ - Use to undo a specific task that was implemented and committed but needs to be reverted (requirement change, implementation error not caught by validation, decision reversed)
8
+ - Do NOT use to undo multiple tasks at once (revert one at a time)
9
+ - Do NOT use if the task has already been pushed to remote and merged into main (then a revert PR is required)
10
+
11
+ ## Pipeline Position
12
+ **Predecessor:** `/dw-run-task` or `/dw-run-plan` that created the task commits | **Successor:** re-run the task or change the plan
13
+
14
+ ## Input Variables
15
+
16
+ | Variable | Description | Example |
17
+ |----------|-------------|---------|
18
+ | `{{PRD_PATH}}` | Active PRD path | `.dw/spec/prd-my-feature` |
19
+ | `{{TASK_NUMBER}}` | Task number to revert | `3` (for task 3.0) |
20
+
21
+ ## Workflow
22
+
23
+ ### 1. Identify task commits
24
+
25
+ - Read `{{PRD_PATH}}/tasks.md` and `{{PRD_PATH}}/{{TASK_NUMBER}}_task.md`
26
+ - Identify commits related to the task via:
27
+ - `git log --grep="task {{TASK_NUMBER}}"` or
28
+ - `git log --grep="Task {{TASK_NUMBER}}"` or
29
+ - Manual intersection: commits on the branch between the last commit of task {{TASK_NUMBER - 1}} and the marker commit of task {{TASK_NUMBER}} in tasks.md
30
+ - List hashes and messages to the user
31
+
32
+ ### 2. Dependency Check (Required)
33
+
34
+ <critical>Before proposing the revert, check whether subsequent tasks depend on this task's artifacts.</critical>
35
+
36
+ - Read `tasks.md` and identify tasks with `{{TASK_NUMBER}}` in their `blockedBy` field or "Depends on" section
37
+ - For each dependent task:
38
+ - Check whether it has been executed (`- [x]` checkbox)
39
+ - If YES: reverting this task would cascade — STOP and present the conflict to the user
40
+ - If NO: OK, the pending task can be re-executed after the revert
41
+
42
+ ### 3. Present Plan
43
+
44
+ Show the user:
45
+
46
+ ```
47
+ REVERT PLAN — Task {{TASK_NUMBER}}
48
+
49
+ Commits to revert (in reverse order):
50
+ - <hash_N> <message>
51
+ - <hash_N-1> <message>
52
+ ...
53
+
54
+ Affected dependent tasks:
55
+ - Task X.Y (pending, can be re-executed after revert)
56
+ - [OR: ⚠️ Task X.Y already executed — conflict, STOP]
57
+
58
+ Artifacts to update after revert:
59
+ - {{PRD_PATH}}/tasks.md (re-mark task {{TASK_NUMBER}} as pending)
60
+ - {{PRD_PATH}}/tasks/{{TASK_NUMBER}}_memory.md (add "reverted on YYYY-MM-DD" note)
61
+
62
+ Proceed? [y/N]
63
+ ```
64
+
65
+ Wait for explicit confirmation.
66
+
67
+ ### 4. Execute Revert
68
+
69
+ Only after `y`/`yes`:
70
+
71
+ ```bash
72
+ # For each commit, in reverse order:
73
+ git revert --no-edit <hash>
74
+ ```
75
+
76
+ If conflicts occur during revert: STOP, report conflicts, and wait for the user to resolve manually. DO NOT force.
77
+
78
+ ### 5. Update Artifacts
79
+
80
+ After a successful revert:
81
+ - In `tasks.md`: change `- [x]` to `- [ ]` on task {{TASK_NUMBER}}'s line
82
+ - In `tasks/{{TASK_NUMBER}}_memory.md`: append:
83
+ ```
84
+ ## Revert on YYYY-MM-DD
85
+ - Reason: [fill with the user-provided reason]
86
+ - Reverted commits: [hashes]
87
+ ```
88
+ - Invoke `dw-memory` to promote the note to `MEMORY.md` if it's cross-task relevant
89
+
90
+ ### 6. Report
91
+
92
+ - List of reverted commits (and the revert commits created)
93
+ - Status of updated artifacts
94
+ - Suggested next step (`/dw-run-task {{TASK_NUMBER}}` to re-run, or `/dw-create-tasks` if scope changed)
95
+
96
+ ## Required Behavior
97
+
98
+ <critical>NEVER use `git reset --hard` or `git rebase -i` as an alternative to revert. Revert preserves history and is safe on shared branches.</critical>
99
+
100
+ <critical>NEVER force the revert if dependent tasks have already been executed. In that case, present the conflict and ask for user decision (also revert dependents, or cancel).</critical>
101
+
102
+ <critical>NEVER proceed without explicit `y`/`yes` confirmation from the user.</critical>
103
+
104
+ ## Complementary Skills
105
+
106
+ | Skill | Trigger |
107
+ |-------|---------|
108
+ | `dw-memory` | **ALWAYS** — when updating the task memory with the revert note, apply the promotion test to decide whether it goes into shared `MEMORY.md` |
109
+
110
+ ## Inspired by
111
+
112
+ Compozy has no analogous command. This is a dev-workflow-native pattern, motivated by a gap identified during analysis: "if a task fails or needs to be reverted after commit, there is no safe mechanism to revert only that task."
113
+
114
+ </system_instructions>
@@ -23,6 +23,12 @@ This is **Review Level 2**:
23
23
 
24
24
  This command is called automatically by `/dw-run-plan` at the end of all tasks, but can also be executed manually.
25
25
 
26
+ ## Complementary Skills
27
+
28
+ | Skill | Trigger |
29
+ |-------|---------|
30
+ | `dw-review-rigor` | **ALWAYS** — when listing gaps between PRD/TechSpec and code, apply de-duplication (same gap in N modules = 1 entry), severity ordering, and verify-intent-before-flag |
31
+
26
32
  ## Input Variables
27
33
 
28
34
  | Variable | Description | Example |
@@ -9,6 +9,13 @@ You are an assistant specialized in sequential execution of development plans. Y
9
9
  ## Pipeline Position
10
10
  **Predecessor:** `/dw-create-tasks` | **Successor:** `/dw-code-review` then `/dw-generate-pr`
11
11
 
12
+ ## Complementary Skills
13
+
14
+ | Skill | Trigger |
15
+ |-------|---------|
16
+ | `dw-memory` | **ALWAYS** — reads `MEMORY.md` before starting and applies promotion test + compaction between tasks |
17
+ | `dw-verify` | **ALWAYS** — invoked before the Level 2 Final Review and before declaring "Plan Complete" |
18
+
12
19
  ## Objective
13
20
 
14
21
  Execute ALL pending tasks in a project sequentially and automatically, marking each as completed after successful implementation (each task already includes Level 1 validation), and performing a **final Level 2 review (PRD compliance) with a corrections cycle**.
@@ -62,10 +69,19 @@ For each pending task (in sequential order):
62
69
  - If there are errors, report and PAUSE for manual correction
63
70
  - If successful, continue to next task
64
71
 
72
+ 5. **Memory compaction between tasks**
73
+ - Invoke `dw-memory` with compaction flag on `MEMORY.md` every 3 completed tasks (or when the file exceeds ~150 lines)
74
+ - Ensure the next task reads a lean, up-to-date `MEMORY.md`
75
+
65
76
  ### 3. Final Comprehensive Review
66
77
 
67
78
  When all tasks are completed:
68
79
 
80
+ 0. **Final Verification (Required before Level 2)**
81
+ - Invoke `dw-verify` with the project's verify command (test + lint + build, or the documented gate command)
82
+ - Only proceed with Level 2 if the VERIFICATION REPORT is PASS
83
+ - If FAIL: fix the root cause, re-verify, and only then open the PRD-compliance review
84
+
69
85
  1. **Execute General Review**
70
86
  - Follow `.dw/commands/dw-review-implementation.md` for ALL tasks
71
87
  - Generate a complete gap report and recommendations
@@ -102,7 +118,9 @@ When all tasks are completed:
102
118
  - No more recommendations, OR
103
119
  - User decides that remaining items are acceptable
104
120
 
105
- 4. **Final Report**
121
+ 4. **Final Report (after final dw-verify PASS)**
122
+
123
+ <critical>Before declaring "PLAN COMPLETE" or "COMPLETE WITH PENDING ITEMS", invoke `dw-verify` one last time after the last correction. Without PASS, do not emit the final report.</critical>
106
124
 
107
125
  ```
108
126
  ===================================================
@@ -18,6 +18,8 @@ When available in the project at `./.agents/skills/`, use these skills as specia
18
18
 
19
19
  | Skill | Trigger |
20
20
  |-------|---------|
21
+ | `dw-verify` | **ALWAYS** — invoked before the commit to produce a Verification Report with fresh evidence |
22
+ | `dw-memory` | **ALWAYS** — reads workflow memory at task start and updates it at task end (promotion test) |
21
23
  | `vercel-react-best-practices` | Task touches React rendering, hydration, data fetching, bundle, cache, or performance |
22
24
  | `webapp-testing` | Task has interactive frontend needing E2E validation in a real browser |
23
25
 
@@ -51,6 +53,7 @@ If `.planning/intel/` does NOT exist:
51
53
  - Review the PRD context
52
54
  - Verify tech spec requirements (including testing strategy)
53
55
  - Understand dependencies from previous tasks
56
+ - **Invoke `dw-memory`**: read `.dw/spec/prd-[name]/MEMORY.md` (shared) and `.dw/spec/prd-[name]/tasks/[num]_memory.md` (task-local, create if missing) — decisions, constraints and handoff notes from earlier tasks are mandatory context
54
57
 
55
58
  ### 2. Task Analysis
56
59
  Analyze considering:
@@ -170,9 +173,19 @@ Format in tasks.md (add after marking the task as completed):
170
173
  - **If FAILURE**: Fix the issues and re-execute the validation
171
174
  - **DO NOT generate a report file** - only output in the terminal
172
175
 
176
+ ## Final Verification (Required before commit)
177
+
178
+ <critical>Invoke the `dw-verify` skill before any "task complete" claim. Produce a VERIFICATION REPORT with the project's real verify command (test + lint + build) and exit code 0. Without a PASS report, DO NOT proceed to the commit.</critical>
179
+
180
+ ## Memory Update (Required before commit)
181
+
182
+ Invoke `dw-memory` to:
183
+ - Update `tasks/[num]_memory.md` with files touched, non-obvious decisions, and handoff notes
184
+ - Apply the **promotion test** (next task needs it? durable? not obvious from repo?) and only promote what passes to `MEMORY.md`
185
+
173
186
  ## Automatic Commit (Required)
174
187
 
175
- At the end of the task (after Level 1 validation passes), **always** commit (no push):
188
+ At the end of the task (after Level 1 validation + dw-verify PASS + dw-memory update), **always** commit (no push):
176
189
 
177
190
  ```bash
178
191
  git status
@@ -0,0 +1,143 @@
1
+ <system_instructions>
2
+ You are an update utility. When invoked, update dev-workflow to the latest version published on npm without requiring the user to leave the agent.
3
+
4
+ ## When to Use
5
+ - Use when the user wants to update `/dw-*` commands, templates, references, scripts, skills, wrappers, and MCPs to the latest version
6
+ - Use when a new release is out and the user wants to apply it without exiting the session
7
+ - Do NOT use to install from scratch in a new project (use `npx dev-workflow init`)
8
+ - Do NOT use to install system dependencies/Playwright/MCPs (use `npx dev-workflow install-deps`)
9
+
10
+ ## Pipeline Position
11
+ **Predecessor:** (any) | **Successor:** (any)
12
+
13
+ ## Modes
14
+
15
+ - **Update (default)**: `/dw-update` — updates to the latest version on npm
16
+ - **Rollback**: `/dw-update --rollback` — restores the most recent snapshot in `.dw/.backup/` (created before each update)
17
+
18
+ ## Behavior
19
+
20
+ ### 0. Snapshot Before Update (Required in default mode)
21
+
22
+ Before overwriting managed files, create a snapshot:
23
+
24
+ ```bash
25
+ SNAPSHOT_DIR=".dw/.backup/$(date -u +%Y%m%dT%H%M%SZ)"
26
+ mkdir -p "$SNAPSHOT_DIR"
27
+ cp -r .dw/commands .dw/templates .dw/references .dw/scripts "$SNAPSHOT_DIR/" 2>/dev/null
28
+ [ -d .agents/skills ] && cp -r .agents/skills "$SNAPSHOT_DIR/agents-skills" 2>/dev/null
29
+ echo "Snapshot saved to $SNAPSHOT_DIR"
30
+ ```
31
+
32
+ Keep only the 3 most recent snapshots (remove older ones) to avoid buildup.
33
+
34
+ ### 1. Record Current Version (Required)
35
+
36
+ Before updating, capture the installed version so you can report the delta:
37
+
38
+ ```bash
39
+ node -e "try { console.log(require('@brunosps00/dev-workflow/package.json').version) } catch(e) { console.log('not-cached-locally') }" 2>/dev/null
40
+ ```
41
+
42
+ ### 2. Detect Language of Installed Commands (Required)
43
+
44
+ <critical>Do NOT assume the language from this command file. Detect by inspecting the actual files in `.dw/commands/` so a user with a mixed or switched install does not receive an update in the wrong language.</critical>
45
+
46
+ Run at the project root:
47
+
48
+ ```bash
49
+ if [ -d .dw/commands ]; then
50
+ PT_COUNT=$(grep -l "## Quando Usar" .dw/commands/*.md 2>/dev/null | wc -l)
51
+ EN_COUNT=$(grep -l "## When to Use" .dw/commands/*.md 2>/dev/null | wc -l)
52
+ if [ "$PT_COUNT" -gt "$EN_COUNT" ]; then
53
+ DETECTED_LANG=pt-br
54
+ elif [ "$EN_COUNT" -gt "$PT_COUNT" ]; then
55
+ DETECTED_LANG=en
56
+ else
57
+ DETECTED_LANG=""
58
+ fi
59
+ echo "pt:$PT_COUNT en:$EN_COUNT -> $DETECTED_LANG"
60
+ else
61
+ DETECTED_LANG=""
62
+ echo ".dw/commands does not exist"
63
+ fi
64
+ ```
65
+
66
+ Rules:
67
+ - If `DETECTED_LANG` is `pt-br` or `en`: use it in the next step
68
+ - If empty (tie, missing folder, new install): ask the user `I detected [describe context]. Proceed with pt-br or en?` and wait for the response before continuing
69
+
70
+ ### 3. Run the Update (Required)
71
+
72
+ <critical>Use `npx -y @brunosps00/dev-workflow@latest` to FORCE fetching the latest version from npm (bypass local cache). Pass `--lang=<DETECTED_LANG>` to skip the interactive prompt.</critical>
73
+
74
+ ```bash
75
+ npx -y @brunosps00/dev-workflow@latest update --lang=$DETECTED_LANG
76
+ ```
77
+
78
+ The `update` command overwrites managed files and PRESERVES:
79
+ - `.dw/rules/` (user rules)
80
+ - `.dw/spec/` (in-progress PRDs and tasks)
81
+ - `.planning/` (user data)
82
+
83
+ If the update fails (network error, permission, package unavailable): report the error to the user and STOP. Do NOT attempt manual workarounds like copying files by hand.
84
+
85
+ ### 4. Capture New Version
86
+
87
+ ```bash
88
+ node -e "console.log(require('@brunosps00/dev-workflow/package.json').version)" 2>/dev/null
89
+ ```
90
+
91
+ ### 5. Report Result
92
+
93
+ Present to the user:
94
+ - Detected language (`DETECTED_LANG`)
95
+ - Previous version → new version
96
+ - Summary of what the `update` output showed (files copied, wrappers generated, MCPs configured)
97
+ - Any warnings or errors
98
+
99
+ ### 6. Suggest Next Step
100
+
101
+ If commands/skills were updated, remind the user:
102
+ - Restart the agent session (or reload skills) so the new instructions take effect — skills are usually loaded at session start
103
+ - Run `/dw-help` after the reload to see the updated command set
104
+ - If the release changed system dependencies (Playwright, MCPs), run `npx dev-workflow install-deps` separately
105
+
106
+ ## Rollback Mode
107
+
108
+ If invoked with `--rollback`:
109
+
110
+ 1. List snapshots in `.dw/.backup/`
111
+ 2. If none exist: STOP and report "No snapshot available"
112
+ 3. If more than one exists: ask the user which to restore (default: most recent)
113
+ 4. Confirm with the user: "Restore snapshot `<path>`? This OVERWRITES `.dw/commands/`, `.dw/templates/`, `.dw/references/`, `.dw/scripts/`, and `.agents/skills/`. Proceed? [y/N]"
114
+ 5. Only after `y`: copy back
115
+
116
+ ```bash
117
+ cp -r "$SNAPSHOT_DIR/commands" .dw/
118
+ cp -r "$SNAPSHOT_DIR/templates" .dw/
119
+ cp -r "$SNAPSHOT_DIR/references" .dw/ 2>/dev/null
120
+ cp -r "$SNAPSHOT_DIR/scripts" .dw/ 2>/dev/null
121
+ [ -d "$SNAPSHOT_DIR/agents-skills" ] && cp -r "$SNAPSHOT_DIR/agents-skills" .agents/skills 2>/dev/null
122
+ ```
123
+
124
+ 6. Report: snapshot restored, version likely recovered (read from `.dw/commands/dw-help.md` or metadata if present)
125
+
126
+ ## Advanced Options
127
+
128
+ If the user asks for a specific version (not `@latest`):
129
+
130
+ ```bash
131
+ npx -y @brunosps00/dev-workflow@<version> update --lang=$DETECTED_LANG
132
+ ```
133
+
134
+ E.g.: `npx -y @brunosps00/dev-workflow@0.4.5 update --lang=en`
135
+
136
+ ## Notes
137
+
138
+ - `npx -y` skips the "OK to install" prompt when the package is not cached
139
+ - `@latest` bypasses the npx cache and pulls the `latest` tag from the registry
140
+ - `--lang=...` skips the interactive language prompt; the value comes from the auto-detection in step 2
141
+ - This command does NOT update the user project's Node dependencies — only the dev-workflow scaffold
142
+
143
+ </system_instructions>
@@ -0,0 +1,56 @@
1
+ ---
2
+ id: NNN
3
+ status: Proposed
4
+ title: [Short imperative title of the decision]
5
+ date: YYYY-MM-DD
6
+ prd: [PRD slug, e.g. prd-user-auth]
7
+ schema_version: "1.0"
8
+ supersedes: null
9
+ superseded_by: null
10
+ ---
11
+
12
+ # ADR-NNN: [Title]
13
+
14
+ ## Status
15
+
16
+ Proposed | Accepted | Deprecated | Superseded by ADR-XXX
17
+
18
+ ## Context
19
+
20
+ [Problem context. What motivating forces led to this decision?
21
+ 1-3 short paragraphs. Focus on "why are we deciding now" — do not retell the whole project history.]
22
+
23
+ ## Decision
24
+
25
+ [The decision made. Start with a verb ("Adopt", "Use", "Migrate to", "Reject").
26
+ 1 actionable sentence, followed by 1-3 detail sentences if needed.]
27
+
28
+ ## Alternatives Considered
29
+
30
+ 1. **[Alternative 1]** — [what it was, why not chosen. 1-2 sentences.]
31
+ 2. **[Alternative 2]** — [what it was, why not chosen. 1-2 sentences.]
32
+ 3. **[Add more if relevant.]**
33
+
34
+ ## Consequences
35
+
36
+ ### Positive
37
+ - [Positive consequence 1]
38
+ - [Positive consequence 2]
39
+
40
+ ### Negative
41
+ - [Accepted cost 1 — do not omit]
42
+ - [Accepted cost 2]
43
+
44
+ ### Neutral / Mitigations
45
+ - [Unbiased tradeoff, or mitigation plan]
46
+
47
+ ## Related
48
+
49
+ - PRD: `.dw/spec/[prd-slug]/prd.md`
50
+ - TechSpec: `.dw/spec/[prd-slug]/techspec.md` (if applicable)
51
+ - Affected tasks: [task list, if applicable]
52
+ - Related ADRs: [list, if applicable]
53
+
54
+ ## References
55
+
56
+ - [Links to external docs, RFCs, posts, issues]
@@ -1,3 +1,9 @@
1
+ ---
2
+ type: prd
3
+ schema_version: "1.0"
4
+ status: draft
5
+ ---
6
+
1
7
  # Product Requirements Document (PRD) Template
2
8
 
3
9
  ## Overview
@@ -68,3 +74,9 @@ Implementation details will be addressed in the Technical Specification.]
68
74
  - Questions about user needs or business goals
69
75
  - Dependencies on external business factors
70
76
  - Areas requiring design or user research]
77
+
78
+ ## Related ADRs
79
+
80
+ [List ADRs that constrain or inform this feature. Leave empty if none. Use `/dw-adr` to record a decision that emerges during execution.
81
+
82
+ - `adrs/adr-NNN.md` — [short title]]
@@ -1,3 +1,9 @@
1
+ ---
2
+ type: task
3
+ schema_version: "1.0"
4
+ status: pending
5
+ ---
6
+
1
7
  # Task X.0: [Main Task Title]
2
8
 
3
9
  <critical>Read the prd.md and techspec.md files in this folder. If you don't read these files your task will be invalidated.</critical>
@@ -60,3 +66,9 @@ git commit -m "feat([module]): [description]
60
66
  - [item 2]
61
67
  - Add unit tests"
62
68
  ```
69
+
70
+ ## Related ADRs
71
+
72
+ [ADRs that constrain this task's decisions. Leave empty if none.
73
+
74
+ - `adrs/adr-NNN.md` — [short title, how the decision affects this task]]
@@ -1,3 +1,9 @@
1
+ ---
2
+ type: tasks-index
3
+ schema_version: "1.0"
4
+ status: draft
5
+ ---
6
+
1
7
  # Implementation Tasks Summary for [Feature]
2
8
 
3
9
  ## Branch
@@ -1,3 +1,9 @@
1
+ ---
2
+ type: techspec
3
+ schema_version: "1.0"
4
+ status: draft
5
+ ---
6
+
1
7
  # Technical Specification Template
2
8
 
3
9
  ## Executive Summary
@@ -121,3 +127,9 @@ type ServiceName interface {
121
127
  ### Relevant Files
122
128
 
123
129
  [List relevant project files here]
130
+
131
+ ## Related ADRs
132
+
133
+ [List architectural ADRs that constrain or inform this techspec. Leave empty if none. Use `/dw-adr` during execution to record new decisions.
134
+
135
+ - `adrs/adr-NNN.md` — [short title]]
@@ -0,0 +1,117 @@
1
+ <system_instructions>
2
+ Você é um registrador de decisões arquiteturais. Sua função é criar um **Architecture Decision Record (ADR)** que documente uma decisão técnica importante feita durante a fase atual do PRD.
3
+
4
+ ## Quando Usar
5
+ - Use quando uma decisão arquitetural ou de design foi tomada e precisa ser registrada para referência futura (escolha de biblioteca, padrão de comunicação, tradeoff de performance, restrição imposta por compliance, etc.)
6
+ - Use durante `/dw-create-techspec` ou `/dw-run-task` quando a justificativa da decisão não cabe no techspec nem no task file
7
+ - NÃO use para decisões triviais ou reversíveis sem custo (escolha de nome de variável, ordem de import)
8
+ - NÃO use para registrar bugs ou incidents (use `/dw-bugfix` ou notas operacionais)
9
+
10
+ ## Posição no Pipeline
11
+ **Antecessor:** qualquer ponto do pipeline após `/dw-create-prd` | **Sucessor:** continua o fluxo anterior (techspec, task, review)
12
+
13
+ O ADR é **aditivo**: ele não substitui nenhuma etapa do pipeline. Qualquer command existente pode invocar `/dw-adr` quando uma decisão não-trivial precisar de registro permanente.
14
+
15
+ ## Variáveis de Entrada
16
+
17
+ | Variável | Descrição | Exemplo |
18
+ |----------|-----------|---------|
19
+ | `{{PRD_PATH}}` | Caminho da pasta do PRD ativo | `.dw/spec/prd-minha-feature` |
20
+ | `{{TITLE}}` | Título curto da decisão (imperativo) | "Usar PostgreSQL ao invés de MongoDB" |
21
+
22
+ Se `{{PRD_PATH}}` não for fornecido, pergunte ao usuário qual PRD está ativo (leia `.dw/spec/` e liste). Se `{{TITLE}}` não for fornecido, pergunte.
23
+
24
+ ## Localização dos Arquivos
25
+
26
+ - Diretório de ADRs: `{{PRD_PATH}}/adrs/`
27
+ - Arquivo novo: `{{PRD_PATH}}/adrs/adr-NNN.md` (NNN zero-padded para 3 dígitos)
28
+ - Template: `.dw/templates/adr-template.md`
29
+
30
+ ## Fluxo de Trabalho
31
+
32
+ ### 1. Descobrir o próximo número
33
+ - Liste os arquivos em `{{PRD_PATH}}/adrs/` (crie o diretório se não existir)
34
+ - O próximo número é `max(existentes) + 1`, ou `1` se vazio
35
+
36
+ ### 2. Coletar contexto (perguntas mínimas)
37
+
38
+ Pergunte ao usuário **4 perguntas objetivas**, uma por vez:
39
+
40
+ 1. **Contexto**: qual problema ou força motivadora levou a esta decisão? (1-3 frases)
41
+ 2. **Decisão**: qual é a decisão tomada? (1 frase acionável, começa com verbo)
42
+ 3. **Alternativas consideradas**: quais outras opções foram avaliadas e por que não foram escolhidas? (mínimo 2)
43
+ 4. **Consequências**: quais são os tradeoffs positivos e negativos desta decisão? (explicite os negativos — sem painting rosy)
44
+
45
+ ### 3. Escrever o arquivo ADR
46
+
47
+ Use `.dw/templates/adr-template.md` como base. Campos obrigatórios:
48
+
49
+ ```yaml
50
+ ---
51
+ id: NNN
52
+ status: Proposed | Accepted | Deprecated | Superseded
53
+ title: [título do ADR]
54
+ date: YYYY-MM-DD
55
+ prd: [slug do PRD]
56
+ schema_version: "1.0"
57
+ ---
58
+
59
+ # ADR-NNN: [Título]
60
+
61
+ ## Status
62
+ [Proposed | Accepted | Deprecated | Superseded by ADR-XXX]
63
+
64
+ ## Context
65
+ [Contexto e forças motivadoras]
66
+
67
+ ## Decision
68
+ [A decisão tomada]
69
+
70
+ ## Alternatives Considered
71
+ 1. **[Alternativa 1]** — [por que não foi escolhida]
72
+ 2. **[Alternativa 2]** — [por que não foi escolhida]
73
+
74
+ ## Consequences
75
+ ### Positivas
76
+ - [consequência positiva 1]
77
+
78
+ ### Negativas
79
+ - [consequência negativa / tradeoff aceito]
80
+
81
+ ## Related
82
+ - PRD: `.dw/spec/prd-[nome]/prd.md`
83
+ - TechSpec: `.dw/spec/prd-[nome]/techspec.md` (se aplicável)
84
+ - Tasks afetadas: [lista, se aplicável]
85
+ ```
86
+
87
+ ### 4. Atualizar referências cruzadas
88
+
89
+ Se o ADR for criado **durante** a execução de um PRD, adicionar uma linha na seção "Related ADRs" dos artefatos relacionados:
90
+ - `prd.md`, `techspec.md`, ou `[N]_task.md`, conforme o escopo da decisão
91
+
92
+ Se a seção "Related ADRs" não existir no arquivo, adicioná-la ao final.
93
+
94
+ ### 5. Reportar
95
+
96
+ Apresente ao usuário:
97
+ - Caminho do ADR criado
98
+ - Artefatos atualizados com referência cruzada
99
+ - Status inicial (geralmente `Accepted` para decisões já tomadas, `Proposed` para decisões ainda abertas)
100
+
101
+ ## Comportamento Obrigatório
102
+
103
+ <critical>NUNCA sobrescreva um ADR existente. Cada ADR é imutável — se a decisão muda, crie um novo ADR com status `Supersedes ADR-NNN` e marque o antigo como `Superseded by ADR-XXX`.</critical>
104
+
105
+ <critical>NUNCA pinte o tradeoff como "só positivo". A seção Consequências Negativas é obrigatória — se não houver nenhum custo, a decisão não precisa de ADR.</critical>
106
+
107
+ ## Inspired by
108
+
109
+ Este command é inspirado no padrão de ADRs de `/tmp/compozy/.agents/skills/cy-create-adr/` do projeto [Compozy](https://github.com/compozy/compozy). Adaptações para dev-workflow:
110
+
111
+ - Paths são `.dw/spec/<prd>/adrs/` ao invés de `.compozy/tasks/<name>/adrs/`
112
+ - 4 perguntas mínimas em vez do fluxo interativo mais longo (alinhado com o estilo conciso de outros commands dw-*)
113
+ - Integração explícita com `schema_version` dos templates v1.0
114
+
115
+ Credit: Compozy project.
116
+
117
+ </system_instructions>