@brunosps00/dev-workflow 0.8.1 → 0.10.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 (96) hide show
  1. package/README.md +30 -27
  2. package/bin/dev-workflow.js +1 -1
  3. package/lib/constants.js +6 -8
  4. package/lib/init.js +6 -0
  5. package/lib/install-deps.js +0 -5
  6. package/lib/migrate-gsd.js +164 -0
  7. package/lib/uninstall.js +2 -2
  8. package/package.json +1 -1
  9. package/scaffold/en/commands/dw-analyze-project.md +6 -11
  10. package/scaffold/en/commands/dw-autopilot.md +10 -17
  11. package/scaffold/en/commands/dw-brainstorm.md +2 -2
  12. package/scaffold/en/commands/dw-bugfix.md +1 -0
  13. package/scaffold/en/commands/dw-code-review.md +7 -5
  14. package/scaffold/en/commands/dw-commit.md +6 -0
  15. package/scaffold/en/commands/dw-create-prd.md +5 -4
  16. package/scaffold/en/commands/dw-create-techspec.md +7 -4
  17. package/scaffold/en/commands/dw-deep-research.md +6 -0
  18. package/scaffold/en/commands/dw-deps-audit.md +1 -0
  19. package/scaffold/en/commands/dw-find-skills.md +4 -4
  20. package/scaffold/en/commands/dw-fix-qa.md +1 -0
  21. package/scaffold/en/commands/dw-generate-pr.md +1 -0
  22. package/scaffold/en/commands/dw-help.md +10 -27
  23. package/scaffold/en/commands/dw-intel.md +99 -30
  24. package/scaffold/en/commands/dw-map-codebase.md +125 -0
  25. package/scaffold/en/commands/dw-new-project.md +1 -1
  26. package/scaffold/en/commands/dw-redesign-ui.md +5 -9
  27. package/scaffold/en/commands/dw-refactoring-analysis.md +8 -6
  28. package/scaffold/en/commands/dw-review-implementation.md +28 -2
  29. package/scaffold/en/commands/dw-run-plan.md +14 -20
  30. package/scaffold/en/commands/dw-run-task.md +5 -4
  31. package/scaffold/en/commands/dw-update.md +3 -1
  32. package/scaffold/en/templates/idea-onepager.md +2 -2
  33. package/scaffold/pt-br/commands/dw-analyze-project.md +6 -11
  34. package/scaffold/pt-br/commands/dw-autopilot.md +10 -17
  35. package/scaffold/pt-br/commands/dw-brainstorm.md +2 -2
  36. package/scaffold/pt-br/commands/dw-bugfix.md +1 -0
  37. package/scaffold/pt-br/commands/dw-code-review.md +7 -5
  38. package/scaffold/pt-br/commands/dw-commit.md +6 -0
  39. package/scaffold/pt-br/commands/dw-create-prd.md +5 -4
  40. package/scaffold/pt-br/commands/dw-create-techspec.md +7 -4
  41. package/scaffold/pt-br/commands/dw-deep-research.md +6 -0
  42. package/scaffold/pt-br/commands/dw-deps-audit.md +1 -0
  43. package/scaffold/pt-br/commands/dw-find-skills.md +4 -4
  44. package/scaffold/pt-br/commands/dw-fix-qa.md +1 -0
  45. package/scaffold/pt-br/commands/dw-generate-pr.md +1 -0
  46. package/scaffold/pt-br/commands/dw-help.md +10 -27
  47. package/scaffold/pt-br/commands/dw-intel.md +99 -30
  48. package/scaffold/pt-br/commands/dw-map-codebase.md +125 -0
  49. package/scaffold/pt-br/commands/dw-new-project.md +1 -1
  50. package/scaffold/pt-br/commands/dw-redesign-ui.md +5 -9
  51. package/scaffold/pt-br/commands/dw-refactoring-analysis.md +8 -6
  52. package/scaffold/pt-br/commands/dw-review-implementation.md +21 -2
  53. package/scaffold/pt-br/commands/dw-run-plan.md +16 -22
  54. package/scaffold/pt-br/commands/dw-run-task.md +5 -4
  55. package/scaffold/pt-br/commands/dw-update.md +3 -1
  56. package/scaffold/pt-br/templates/idea-onepager.md +2 -2
  57. package/scaffold/skills/dw-codebase-intel/SKILL.md +102 -0
  58. package/scaffold/skills/dw-codebase-intel/agents/intel-updater.md +318 -0
  59. package/scaffold/skills/dw-codebase-intel/references/api-design-discipline.md +138 -0
  60. package/scaffold/skills/dw-codebase-intel/references/incremental-update.md +79 -0
  61. package/scaffold/skills/dw-codebase-intel/references/intel-format.md +208 -0
  62. package/scaffold/skills/dw-codebase-intel/references/query-patterns.md +148 -0
  63. package/scaffold/skills/dw-debug-protocol/SKILL.md +106 -0
  64. package/scaffold/skills/dw-debug-protocol/references/error-categorization.md +127 -0
  65. package/scaffold/skills/dw-debug-protocol/references/non-reproducible-strategy.md +108 -0
  66. package/scaffold/skills/dw-debug-protocol/references/six-step-triage.md +139 -0
  67. package/scaffold/skills/dw-debug-protocol/references/stop-the-line.md +52 -0
  68. package/scaffold/skills/dw-execute-phase/SKILL.md +133 -0
  69. package/scaffold/skills/dw-execute-phase/agents/executor.md +264 -0
  70. package/scaffold/skills/dw-execute-phase/agents/plan-checker.md +215 -0
  71. package/scaffold/skills/dw-execute-phase/references/atomic-commits.md +143 -0
  72. package/scaffold/skills/dw-execute-phase/references/plan-verification.md +156 -0
  73. package/scaffold/skills/dw-execute-phase/references/wave-coordination.md +102 -0
  74. package/scaffold/skills/dw-git-discipline/SKILL.md +120 -0
  75. package/scaffold/skills/dw-git-discipline/references/atomic-commits-discipline.md +158 -0
  76. package/scaffold/skills/dw-git-discipline/references/branch-hygiene.md +150 -0
  77. package/scaffold/skills/dw-git-discipline/references/trunk-based-pattern.md +82 -0
  78. package/scaffold/skills/dw-memory/SKILL.md +1 -2
  79. package/scaffold/skills/dw-simplification/SKILL.md +142 -0
  80. package/scaffold/skills/dw-simplification/references/behavior-preserving.md +148 -0
  81. package/scaffold/skills/dw-simplification/references/chestertons-fence.md +152 -0
  82. package/scaffold/skills/dw-simplification/references/complexity-metrics.md +147 -0
  83. package/scaffold/skills/dw-source-grounding/SKILL.md +128 -0
  84. package/scaffold/skills/dw-source-grounding/references/citation-protocol.md +108 -0
  85. package/scaffold/skills/dw-source-grounding/references/freshness-check.md +108 -0
  86. package/scaffold/skills/dw-source-grounding/references/source-priority.md +146 -0
  87. package/scaffold/skills/dw-verify/SKILL.md +0 -1
  88. package/scaffold/skills/vercel-react-best-practices/SKILL.md +4 -0
  89. package/scaffold/skills/vercel-react-best-practices/references/perf-discipline.md +122 -0
  90. package/scaffold/skills/webapp-testing/SKILL.md +5 -0
  91. package/scaffold/skills/webapp-testing/references/security-boundary.md +115 -0
  92. package/scaffold/skills/webapp-testing/references/three-workflow-patterns.md +144 -0
  93. package/scaffold/en/commands/dw-quick.md +0 -85
  94. package/scaffold/en/commands/dw-resume.md +0 -82
  95. package/scaffold/pt-br/commands/dw-quick.md +0 -85
  96. package/scaffold/pt-br/commands/dw-resume.md +0 -82
@@ -0,0 +1,115 @@
1
+ # Security boundary — every browser is hostile
2
+
3
+ > Adapted from [`addyosmani/agent-skills/browser-devtools`](https://github.com/addyosmani/agent-skills/tree/main/browser-devtools) (MIT). Adopts the security-boundary principle to inform how webapp-testing scenarios should validate trust boundaries.
4
+
5
+ The browser is not a secure environment. Anything that runs there — JS, CSS, HTML, devtools — is under the user's control. When you write a webapp test, you're not just verifying functionality; you're often verifying that this assumption holds.
6
+
7
+ ## The core principle
8
+
9
+ > Every byte sent from a browser is potentially attacker-controlled, regardless of what the UI presents.
10
+
11
+ The UI is a convenience for the user. The server cannot trust:
12
+
13
+ - Hidden form fields (the user can edit them in DevTools).
14
+ - Disabled buttons (the user can re-enable them).
15
+ - Client-side validation (the user can bypass it).
16
+ - Cookie values (the user can modify them).
17
+ - HTTP request bodies (the user can craft any payload).
18
+ - Headers (mostly user-controlled; a few are browser-set).
19
+
20
+ Only server-side checks count for security. Client-side checks are UX, not security.
21
+
22
+ ## Implications for webapp testing
23
+
24
+ When designing test scenarios for a webapp, validate:
25
+
26
+ ### 1. Server-side authorization on every action
27
+
28
+ Test that a user CANNOT perform an action they shouldn't, even if they manipulate the UI to send the request:
29
+
30
+ ```
31
+ - Log in as user A.
32
+ - Attempt to access another user's resource by directly hitting the endpoint
33
+ (skip the UI navigation; craft the request).
34
+ - Expected: 403 Forbidden, no data leakage in error response.
35
+ ```
36
+
37
+ If the test passes only when going through the UI, the test is incomplete. Real attackers don't go through the UI.
38
+
39
+ ### 2. Server-side validation independent of client
40
+
41
+ Test that the server rejects malformed input even when the client would normally prevent it:
42
+
43
+ ```
44
+ - Open the form.
45
+ - Use DevTools to remove the `maxlength` attribute from an input.
46
+ - Submit an oversized value.
47
+ - Expected: server rejects with 400/422, not 500 (server crashed because client validation was assumed).
48
+ ```
49
+
50
+ ### 3. Auth state cannot be forged
51
+
52
+ Test that:
53
+
54
+ - Modifying client-stored tokens (localStorage, sessionStorage) does not grant access.
55
+ - Removing or modifying cookies does not grant access (or it gracefully de-authenticates).
56
+ - Replaying captured requests after logout fails.
57
+
58
+ ### 4. CSRF / cross-origin protection
59
+
60
+ Test that:
61
+
62
+ - A request originating from a different origin (set `Origin: https://attacker.com` in test) is rejected for state-changing operations.
63
+ - CSRF tokens (or SameSite cookie equivalents) are validated, not just included.
64
+
65
+ ### 5. No client-side secrets
66
+
67
+ Audit the bundle for accidentally-shipped secrets:
68
+
69
+ ```
70
+ - Build the production bundle.
71
+ - grep for: API keys (hex strings, JWT structure), private endpoints, internal URLs,
72
+ source maps containing internal paths, debug flags left enabled.
73
+ - Expected: nothing sensitive present.
74
+ ```
75
+
76
+ ## Common UI-as-security misconceptions
77
+
78
+ | Misconception | Why it fails |
79
+ |---------------|--------------|
80
+ | "Hidden field hides the value" | Visible in HTML source / DevTools |
81
+ | "Disabled button prevents action" | User can re-enable in DevTools |
82
+ | "Client-side regex prevents bad input" | Bypassable with crafted request |
83
+ | "Auth check on the page renders the wrong page" | Page didn't render but the API is still callable |
84
+ | "We minified the code" | Reverse-engineering minified code is trivial |
85
+ | "We obfuscated the API" | Network tab reveals the calls |
86
+ | "Only our app calls this endpoint" | Anyone can call any URL |
87
+
88
+ ## Testing browser-side trust boundaries
89
+
90
+ When using Playwright/Puppeteer/MCP for testing:
91
+
92
+ - **Capture and replay attacks:** record a request, replay with modified payload, assert the server rejects.
93
+ - **Session manipulation:** modify cookies/localStorage between actions, assert the server detects.
94
+ - **Direct API calls:** skip the UI; call endpoints directly; assert correct authorization.
95
+ - **Cross-origin simulation:** override `Origin` header; assert correct rejection.
96
+
97
+ These tests catch bugs unit tests miss, because unit tests assume well-formed input. The browser-as-attacker tests assume malicious input.
98
+
99
+ ## Anti-patterns
100
+
101
+ - Testing only the happy path through the UI.
102
+ - Asserting "the button is disabled" without asserting "the API rejects the call."
103
+ - Treating client-side validation messages as if they were security checks.
104
+ - Relying on minification/obfuscation as defense.
105
+ - Testing once, never re-testing after dependency updates that change the trust surface.
106
+
107
+ ## When this matters most
108
+
109
+ - Auth flows, account changes, password resets.
110
+ - Payment / billing operations.
111
+ - Data export, account deletion, irreversible actions.
112
+ - Multi-tenant boundaries (one user's data must not leak to another).
113
+ - Admin endpoints (must reject non-admin users at the server, not just hide UI).
114
+
115
+ These are the tests that catch real production incidents.
@@ -0,0 +1,144 @@
1
+ # Three workflow patterns for browser-based testing
2
+
3
+ > Adapted from [`addyosmani/agent-skills/browser-devtools`](https://github.com/addyosmani/agent-skills/tree/main/browser-devtools) (MIT). The three workflows below organize webapp testing tasks by what's actually being verified.
4
+
5
+ Most webapp testing tasks fall into one of three workflows. Each has different goals, different signals, and different failure modes. Don't conflate them.
6
+
7
+ ## Workflow 1 — UI bugs
8
+
9
+ **Goal:** verify what the user sees matches what's expected.
10
+
11
+ **Signals:**
12
+ - Screenshot diff vs reference.
13
+ - Element exists / does not exist in DOM.
14
+ - Element has expected text / attributes.
15
+ - Element is visible / styled correctly.
16
+ - Click triggers expected navigation or state change.
17
+
18
+ **Tools:**
19
+ - Playwright / Puppeteer for navigation and interaction.
20
+ - Visual regression (Percy, Chromatic, Playwright's `toHaveScreenshot`).
21
+ - Accessibility checks (`axe-core`, Playwright's accessibility snapshot).
22
+
23
+ **Common bugs caught:**
24
+ - Layout shift after image loads.
25
+ - Text wrapping that overflows containers.
26
+ - Missing focus styles on interactive elements.
27
+ - Hover/active states broken on touch devices.
28
+ - Hydration mismatch (server-rendered ≠ client-rendered DOM).
29
+
30
+ **Common bugs missed:**
31
+ - Behavior bugs (click works but state is wrong).
32
+ - Race conditions (UI state stable; network race underneath).
33
+ - Security bugs (UI hides the action; server still accepts it).
34
+
35
+ **When to use this workflow:**
36
+ - After a CSS / component refactor.
37
+ - Before / after design system migrations.
38
+ - Smoke testing critical pages on every release.
39
+
40
+ ## Workflow 2 — Network issues
41
+
42
+ **Goal:** verify the client-server contract is honored under various network conditions.
43
+
44
+ **Signals:**
45
+ - Request was sent with expected payload, headers, method, URL.
46
+ - Response was received with expected status, body, headers.
47
+ - Retries occurred when expected (and didn't when not).
48
+ - Errors are surfaced to UI vs swallowed silently.
49
+ - Requests don't fire when they shouldn't (e.g., debounced search).
50
+
51
+ **Tools:**
52
+ - Playwright `page.route()` to intercept and inspect / modify requests.
53
+ - DevTools Network panel via MCP / inspection.
54
+ - Mock server / MSW for controlled scenarios.
55
+ - Network throttling (slow 3G, offline) for resilience tests.
56
+
57
+ **Common bugs caught:**
58
+ - N+1 requests on page load.
59
+ - Missing error handling (200 success path tested; 500 path crashes UI).
60
+ - Auth headers missing on retried requests.
61
+ - Stale data shown after offline reconnect.
62
+ - Race conditions when multiple requests resolve out of order.
63
+
64
+ **Common bugs missed:**
65
+ - Visual bugs that don't affect network (CSS issues).
66
+ - Server-side bugs (test only checks request/response shape, not server logic).
67
+ - Performance bugs at scale (single request looks fine; thousands per second don't).
68
+
69
+ **When to use this workflow:**
70
+ - After auth / API client refactor.
71
+ - Verifying offline / connectivity-loss behavior.
72
+ - Validating against contract tests / API mocks.
73
+ - Reproducing user-reported "loading forever" bugs.
74
+
75
+ ## Workflow 3 — Performance investigation
76
+
77
+ **Goal:** find why a page is slow and verify a fix.
78
+
79
+ **Signals:**
80
+ - Lighthouse scores (LCP, FID/INP, CLS, TTFB).
81
+ - DevTools Performance flame graph timing.
82
+ - Bundle analyzer output.
83
+ - `web-vitals` library captures from real browser sessions.
84
+ - Frame rate during interactions (`requestAnimationFrame` timing).
85
+
86
+ **Tools:**
87
+ - Playwright `tracing.start({ snapshots: true, screenshots: true })`.
88
+ - Lighthouse CI for automated runs.
89
+ - DevTools Performance tab via MCP.
90
+ - WebPageTest for repeatable third-party measurement.
91
+ - Bundle analyzer (`next-bundle-analyzer`, `webpack-bundle-analyzer`).
92
+
93
+ **Common bugs caught:**
94
+ - Render-blocking third-party scripts.
95
+ - Unintended re-renders amplifying click handlers.
96
+ - Large bundle from accidental lib import (e.g., `import _ from 'lodash'` instead of specific function).
97
+ - Images larger than displayed size.
98
+ - N+1 client-side renders (list of 1000 items each fetching).
99
+
100
+ **Common bugs missed:**
101
+ - Network correctness (perf can pass even when results are wrong).
102
+ - Visual issues unrelated to render time.
103
+ - Backend perf (this workflow looks at client-side; backend traces are needed too).
104
+
105
+ **When to use this workflow:**
106
+ - Performance regression alerts firing.
107
+ - User-reported slowness.
108
+ - Before / after a perf-targeted refactor.
109
+ - Pre-launch validation against budget targets.
110
+
111
+ ## Choosing a workflow
112
+
113
+ The first question for any test: what am I trying to verify?
114
+
115
+ | Concern | Workflow |
116
+ |---------|----------|
117
+ | "Does the page look right?" | UI bugs |
118
+ | "Does clicking this button do the right thing visually?" | UI bugs |
119
+ | "Does the API get called correctly?" | Network issues |
120
+ | "Does the UI handle errors gracefully?" | Network issues |
121
+ | "Why is this page slow?" | Performance |
122
+ | "Does this hit our perf budget?" | Performance |
123
+ | "Does an attacker get blocked here?" | Network issues + security boundary (`security-boundary.md`) |
124
+
125
+ Mixing workflows in a single test produces flaky, slow, or incomplete coverage. A test that asserts BOTH "the button is styled correctly" AND "Lighthouse score is >90" runs slowly and fails for unrelated reasons.
126
+
127
+ ## Anti-patterns
128
+
129
+ - One mega-test that "checks everything" — fails fragilely, hard to debug.
130
+ - UI tests that assert pixel-perfect layout in CI (CI rendering differs from local).
131
+ - Network tests that mock the entire API (you stop testing the contract; you test the mock).
132
+ - Performance tests run once during dev, never in CI (regressions land silently).
133
+ - Skipping security workflow because "we have unit tests for auth" — unit tests don't catch UI/server-disagreement bugs.
134
+
135
+ ## How these compose
136
+
137
+ A real webapp test suite has all three workflows running:
138
+
139
+ - **Per commit (CI):** UI smoke tests + critical-path network tests.
140
+ - **Per PR:** above + visual regression on changed components.
141
+ - **Per release:** above + Lighthouse CI + extended network resilience tests.
142
+ - **Periodically (nightly / weekly):** full perf baseline + security boundary checks.
143
+
144
+ Different cadences match different cost profiles. UI smoke is cheap; full perf + security is expensive. Balance accordingly.
@@ -1,85 +0,0 @@
1
- <system_instructions>
2
- You are a quick task executor. This command exists to implement one-off changes with workflow guarantees (validation, atomic commit) without requiring a full PRD.
3
-
4
- <critical>This command is for small, well-defined changes. If the change needs multiple tasks, redirect to `/dw-create-prd`.</critical>
5
- <critical>ALWAYS run tests and validation before committing. Workflow guarantees are mandatory even for quick tasks.</critical>
6
-
7
- ## When to Use
8
- - Use for small changes that don't justify the full pipeline (PRD -> TechSpec -> Tasks)
9
- - Use for hotfixes, config adjustments, dependency updates, one-off refactors
10
- - Use when invoked after `/dw-brainstorm --onepager` and the one-pager carries `[IMPROVES]` classification with an MVP Scope fitting in ≤3 files (skip-PRD path)
11
- - Do NOT use for new features with multiple requirements (use `/dw-create-prd`)
12
- - Do NOT use for complex bugs (use `/dw-bugfix`)
13
-
14
- ## Pipeline Position
15
- **Predecessor:** (user's ad-hoc need) | **Successor:** `/dw-commit` (automatic)
16
-
17
- ## Complementary Skills
18
-
19
- | Skill | Trigger |
20
- |-------|---------|
21
- | `dw-verify` | **ALWAYS** — invoked before the commit. Even small changes require a VERIFICATION REPORT PASS (minimal test + lint) before the atomic commit. |
22
-
23
- ## Input Variables
24
-
25
- | Variable | Description | Example |
26
- |----------|-------------|---------|
27
- | `{{DESCRIPTION}}` | Description of the change to implement | "add loading spinner to dashboard" |
28
-
29
- ## Required Behavior
30
-
31
- 1. Read `.dw/rules/` to understand project patterns and conventions
32
- 2. **If a one-pager exists** at `.dw/spec/ideas/<slug>.md` and was passed as input, read it first. If classification is `[IMPROVES]` and MVP Scope fits in ≤3 files, proceed. If `[NEW]` or `[CONSOLIDATES]` with larger scope, warn and redirect to `/dw-create-prd`.
33
- 3. Summarize the change in 1-2 sentences and confirm scope with the user
34
- 4. If the change seems too large (>3 files, >100 lines), warn and suggest `/dw-create-prd`
35
- 5. Implement the change following project conventions
36
- 6. Run relevant existing tests (unit, integration)
37
- 7. Run lint if configured in the project
38
- 8. Invoke `dw-verify` and include the VERIFICATION REPORT in the output before committing. Without PASS, DO NOT commit.
39
- 9. Create atomic semantic commit with the change
40
-
41
- ## GSD Integration
42
-
43
- <critical>When GSD is installed, delegation to /gsd-quick is MANDATORY for tracking.</critical>
44
-
45
- If GSD (get-shit-done-cc) is installed in the project:
46
- - Delegate to `/gsd-quick` for tracking in `.planning/quick/`
47
- - The task is registered in history for future lookup via `/dw-intel`
48
-
49
- If GSD is NOT installed:
50
- - Execute directly with Level 1 validation
51
- - No history tracking (only git log)
52
-
53
- ## Codebase Intelligence
54
-
55
- If `.planning/intel/` exists, query before implementing:
56
- - Internally run: `/gsd-intel "implementation patterns in [target area]"`
57
- - Follow the patterns found
58
-
59
- If `.planning/intel/` does NOT exist:
60
- - Use only `.dw/rules/` as context
61
-
62
- ## Response Format
63
-
64
- ### 1. Scope
65
- - Change: [description]
66
- - Affected files: [list]
67
- - Estimate: [small/medium]
68
-
69
- ### 2. Implementation
70
- - File-by-file changes
71
-
72
- ### 3. Validation
73
- - Tests run: [result]
74
- - Lint: [result]
75
-
76
- ### 4. Commit
77
- - Message: [semantic commit]
78
-
79
- ## Closing
80
-
81
- At the end, inform:
82
- - Change implemented and committed
83
- - Whether to push or continue with more changes
84
-
85
- </system_instructions>
@@ -1,82 +0,0 @@
1
- <system_instructions>
2
- You are a session continuity assistant. This command exists to restore context from the last session and suggest the next workflow step.
3
-
4
- <critical>This command is read-only. Do NOT modify code, do NOT execute tasks, do NOT create files. Only analyze state and recommend the next step.</critical>
5
-
6
- ## When to Use
7
- - Use when starting a new session to pick up where you left off
8
- - Use when unsure which command to run next
9
- - Do NOT use in the middle of a task or plan execution
10
-
11
- ## Pipeline Position
12
- **Predecessor:** (session start) | **Successor:** any dw-* command
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
-
20
- ## Required Behavior
21
-
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>
23
-
24
- ### Interrupted Autopilot Detection
25
-
26
- 1. Search for `.dw/spec/*/autopilot-state.json`
27
- 2. If you find a file with `"mode": "autopilot"` and no `"status": "completed"`:
28
- - Present: original wish, step where it stopped, steps already completed
29
- - Ask: **"Found an interrupted autopilot at step [N] ([step name]). Do you want to continue where you left off?"**
30
- - If **YES**: run `/dw-autopilot` instructing it to resume from `current_step` using the state file. The autopilot must read the state and skip already completed steps.
31
- - If **NO**: continue with the normal resume flow below
32
-
33
- ### Normal Flow (no pending autopilot)
34
-
35
- 1. Read `.dw/spec/` and identify PRDs with pending tasks (`- [ ]` checkboxes in tasks.md)
36
- 2. Read `git log --oneline -10` to identify the last work performed
37
- 3. Identify the active branch and whether there are uncommitted changes
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
42
-
43
- ## GSD Integration
44
-
45
- <critical>When GSD is installed, delegation to /gsd-resume-work is MANDATORY, not optional.</critical>
46
-
47
- If GSD (get-shit-done-cc) is installed in the project:
48
- - Delegate to `/gsd-resume-work` for cross-session state restoration from `.planning/STATE.md`
49
- - Incorporate additional context: persistent threads, backlog, notes
50
-
51
- If GSD is NOT installed:
52
- - Use only `.dw/spec/` and git log as context sources
53
- - Full functionality, just without advanced cross-session persistence
54
-
55
- ## Response Format
56
-
57
- ### Session Summary
58
- - **Last work**: [time ago], branch [name]
59
- - **Active PRD**: [PRD name]
60
- - **Tasks**: [N completed] of [total]
61
- - **Last completed task**: [name]
62
- - **Next pending task**: [name]
63
- - **Blockers**: [unresolved dependencies, if any]
64
- - **Uncommitted changes**: [yes/no]
65
-
66
- ### Suggested Next Step
67
- - Command: `/dw-[command] [arguments]`
68
- - Reason: [why this is the logical next step]
69
-
70
- ## Heuristics
71
-
72
- - If there are uncommitted changes, suggest `/dw-commit` first
73
- - If all tasks are complete, suggest `/dw-code-review` or `/dw-run-qa`
74
- - If no active PRD, suggest `/dw-brainstorm` or `/dw-create-prd`
75
- - If there are pending tasks, suggest `/dw-run-task` or `/dw-run-plan`
76
- - If the last task failed, suggest investigating the error before continuing
77
-
78
- ## Closing
79
-
80
- At the end, leave the user ready to execute the next command with a single copy-paste.
81
-
82
- </system_instructions>
@@ -1,85 +0,0 @@
1
- <system_instructions>
2
- Voce e um executor de tasks rapidas. Este comando existe para implementar mudancas pontuais com garantias do workflow (validacao, commit atomico) sem precisar de PRD completo.
3
-
4
- <critical>Este comando e para mudancas pequenas e bem definidas. Se a mudanca precisar de multiplas tasks, redirecione para `/dw-create-prd`.</critical>
5
- <critical>SEMPRE execute testes e validacao antes de commitar. Garantias do workflow sao obrigatorias mesmo para tasks rapidas.</critical>
6
-
7
- ## Quando Usar
8
- - Use para mudancas pequenas que nao justificam o pipeline completo (PRD -> TechSpec -> Tasks)
9
- - Use para hotfixes, ajustes de config, atualizacoes de dependencias, refatoracoes pontuais
10
- - Use quando invocado apos `/dw-brainstorm --onepager` e o one-pager tem classificacao `[IMPROVES]` com MVP Scope cabendo em ≤3 arquivos (skip-PRD path)
11
- - NAO use para features novas com multiplos requisitos (use `/dw-create-prd`)
12
- - NAO use para bugs complexos (use `/dw-bugfix`)
13
-
14
- ## Posicao no Pipeline
15
- **Antecessor:** (necessidade pontual do usuario) | **Sucessor:** `/dw-commit` (automatico)
16
-
17
- ## Skills Complementares
18
-
19
- | Skill | Gatilho |
20
- |-------|---------|
21
- | `dw-verify` | **SEMPRE** — invocada antes do commit. Mesmo mudancas pequenas exigem VERIFICATION REPORT PASS (test + lint minimos) antes de commit atomico. |
22
-
23
- ## Variaveis de Entrada
24
-
25
- | Variavel | Descricao | Exemplo |
26
- |----------|-----------|---------|
27
- | `{{DESCRIPTION}}` | Descricao da mudanca a implementar | "adicionar spinner de loading no dashboard" |
28
-
29
- ## Comportamento Obrigatorio
30
-
31
- 1. Leia `.dw/rules/` para entender padroes e convencoes do projeto
32
- 2. **Se um one-pager existe** em `.dw/spec/ideas/<slug>.md` e foi passado como input, leia-o primeiro. Se classification for `[IMPROVES]` e MVP Scope cabe em ≤3 arquivos, prosseguir. Se for `[NEW]` ou `[CONSOLIDATES]` de escopo maior, alertar e redirecionar para `/dw-create-prd`.
33
- 3. Resuma a mudanca em 1-2 frases e confirme escopo com o usuario
34
- 4. Se a mudanca parecer grande demais (>3 arquivos, >100 linhas), alerte e sugira `/dw-create-prd`
35
- 5. Implemente a mudanca seguindo convencoes do projeto
36
- 6. Execute testes existentes relevantes (unit, integration)
37
- 7. Execute lint se configurado no projeto
38
- 8. Invoque `dw-verify` e inclua o VERIFICATION REPORT no output antes de commitar. Sem PASS, NAO commit.
39
- 9. Crie commit atomico semantico com a mudanca
40
-
41
- ## Integracao GSD
42
-
43
- <critical>Quando o GSD estiver instalado, a delegação para /gsd-quick é OBRIGATÓRIA para tracking.</critical>
44
-
45
- Se o GSD (get-shit-done-cc) estiver instalado no projeto:
46
- - Delegue para `/gsd-quick` para tracking em `.planning/quick/`
47
- - A task fica registrada no historico para consulta futura via `/dw-intel`
48
-
49
- Se o GSD NAO estiver instalado:
50
- - Execute diretamente com validacao Level 1
51
- - Sem tracking historico (apenas git log)
52
-
53
- ## Inteligencia do Codebase
54
-
55
- Se `.planning/intel/` existir, consulte antes de implementar:
56
- - Execute internamente: `/gsd-intel "implementation patterns in [target area]"`
57
- - Siga os padroes encontrados
58
-
59
- Se `.planning/intel/` NAO existir:
60
- - Use apenas `.dw/rules/` como contexto
61
-
62
- ## Formato de Resposta
63
-
64
- ### 1. Escopo
65
- - Mudanca: [descricao]
66
- - Arquivos afetados: [lista]
67
- - Estimativa: [pequena/media]
68
-
69
- ### 2. Implementacao
70
- - Mudancas arquivo por arquivo
71
-
72
- ### 3. Validacao
73
- - Testes executados: [resultado]
74
- - Lint: [resultado]
75
-
76
- ### 4. Commit
77
- - Mensagem: [commit semantico]
78
-
79
- ## Encerramento
80
-
81
- Ao final, informe:
82
- - Mudanca implementada e commitada
83
- - Se deseja fazer push ou continuar com mais mudancas
84
-
85
- </system_instructions>
@@ -1,82 +0,0 @@
1
- <system_instructions>
2
- Voce e um assistente de continuidade de sessao. Este comando existe para restaurar contexto da ultima sessao e sugerir o proximo passo do workflow.
3
-
4
- <critical>Este comando e somente leitura. NAO modifique codigo, NAO execute tasks, NAO crie arquivos. Apenas analise o estado e recomende o proximo passo.</critical>
5
-
6
- ## Quando Usar
7
- - Use ao iniciar uma nova sessao para retomar de onde parou
8
- - Use quando nao souber qual comando executar em seguida
9
- - NAO use no meio de uma execucao de task ou plano
10
-
11
- ## Posicao no Pipeline
12
- **Antecessor:** (inicio de sessao) | **Sucessor:** qualquer comando dw-*
13
-
14
- ## Skills Complementares
15
-
16
- | Skill | Gatilho |
17
- |-------|---------|
18
- | `dw-memory` | **SEMPRE** — para cada PRD ativo identificado, ler `.dw/spec/<prd>/MEMORY.md` (shared) para reconstituir constraints, decisoes e handoff notes da sessao anterior. Incluir no resumo apresentado ao usuario. |
19
-
20
- ## Comportamento Obrigatorio
21
-
22
- <critical>ANTES de qualquer analise, verifique se existe um autopilot interrompido. Procure por `autopilot-state.json` em TODOS os diretorios dentro de `.dw/spec/`. Se encontrar um com status diferente de "completed", a retomada do autopilot tem PRIORIDADE sobre qualquer outra sugestao.</critical>
23
-
24
- ### Deteccao de Autopilot Interrompido
25
-
26
- 1. Procure por `.dw/spec/*/autopilot-state.json`
27
- 2. Se encontrar um arquivo com `"mode": "autopilot"` e sem `"status": "completed"`:
28
- - Apresente: desejo original, etapa em que parou, etapas ja completadas
29
- - Pergunte: **"Encontrei um autopilot interrompido na etapa [N] ([nome da etapa]). Deseja continuar de onde parou?"**
30
- - Se **SIM**: execute `/dw-autopilot` informando que deve retomar a partir da etapa `current_step` usando o state file. O autopilot deve ler o state e pular as etapas ja completadas.
31
- - Se **NAO**: continue com o fluxo normal de resume abaixo
32
-
33
- ### Fluxo Normal (sem autopilot pendente)
34
-
35
- 1. Leia `.dw/spec/` e identifique PRDs com tasks pendentes (checkboxes `- [ ]` em tasks.md)
36
- 2. Leia `git log --oneline -10` para identificar o ultimo trabalho realizado
37
- 3. Identifique a branch ativa e se ha mudancas nao commitadas
38
- 4. **Invoque `dw-memory`**: para o PRD ativo, leia `.dw/spec/<prd>/MEMORY.md` e a memory da proxima task pendente (`tasks/<N>_memory.md` se existir). Extraia decisoes durables, constraints cross-task e handoff notes.
39
- 5. Cruze: ultimo PRD ativo, ultima task completada, proxima task pendente, contexto de memory
40
- 6. Apresente o resumo no formato abaixo (incluindo bullets de "Do ponto onde paramos" com base na memory)
41
- 7. Sugira o proximo comando a executar
42
-
43
- ## Integracao GSD
44
-
45
- <critical>Quando o GSD estiver instalado, a delegação para /gsd-resume-work é OBRIGATÓRIA, não opcional.</critical>
46
-
47
- Se o GSD (get-shit-done-cc) estiver instalado no projeto:
48
- - Delegue para `/gsd-resume-work` para restaurar estado cross-sessao de `.planning/STATE.md`
49
- - Incorpore contexto adicional: threads persistentes, backlog, notas
50
-
51
- Se o GSD NAO estiver instalado:
52
- - Use apenas `.dw/spec/` e git log como fontes de contexto
53
- - Funcionalidade completa, apenas sem persistencia cross-sessao avancada
54
-
55
- ## Formato de Resposta
56
-
57
- ### Resumo da Sessao
58
- - **Ultimo trabalho**: [tempo atras], branch [nome]
59
- - **PRD ativo**: [nome do PRD]
60
- - **Tasks**: [N completadas] de [total]
61
- - **Ultima task completada**: [nome]
62
- - **Proxima task pendente**: [nome]
63
- - **Bloqueios**: [dependencias nao resolvidas, se houver]
64
- - **Mudancas nao commitadas**: [sim/nao]
65
-
66
- ### Proximo Passo Sugerido
67
- - Comando: `/dw-[comando] [argumentos]`
68
- - Motivo: [por que este e o proximo passo logico]
69
-
70
- ## Heuristicas
71
-
72
- - Se ha mudancas nao commitadas, sugira `/dw-commit` primeiro
73
- - Se todas as tasks estao completas, sugira `/dw-code-review` ou `/dw-run-qa`
74
- - Se nao ha PRD ativo, sugira `/dw-brainstorm` ou `/dw-create-prd`
75
- - Se ha tasks pendentes, sugira `/dw-run-task` ou `/dw-run-plan`
76
- - Se a ultima task falhou, sugira investigar o erro antes de continuar
77
-
78
- ## Encerramento
79
-
80
- Ao final, deixe o usuario pronto para executar o proximo comando com um unico copy-paste.
81
-
82
- </system_instructions>