@brunosps00/dev-workflow 2.1.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +118 -0
- package/README.md +17 -6
- package/lib/constants.js +24 -20
- package/lib/init.js +34 -0
- package/lib/instruction-health.js +38 -0
- package/lib/post-update.js +2 -1
- package/lib/validate.js +3 -1
- package/package.json +1 -1
- package/scaffold/config/routing.json +61 -23
- package/scaffold/en/agent-instructions.md +31 -135
- package/scaffold/en/commands/dw-analyze-project.md +2 -0
- package/scaffold/en/commands/dw-autopilot.md +22 -243
- package/scaffold/en/commands/dw-bugfix.md +9 -35
- package/scaffold/en/commands/dw-claude-run.md +29 -45
- package/scaffold/en/commands/dw-codex-run.md +30 -45
- package/scaffold/en/commands/dw-context-budget.md +6 -14
- package/scaffold/en/commands/dw-copilot-run.md +29 -41
- package/scaffold/en/commands/dw-generate-pr.md +2 -2
- package/scaffold/en/commands/dw-goal.md +11 -5
- package/scaffold/en/commands/dw-harness-audit.md +2 -0
- package/scaffold/en/commands/dw-help.md +8 -4
- package/scaffold/en/commands/dw-pause.md +1 -0
- package/scaffold/en/commands/dw-plan.md +14 -7
- package/scaffold/en/commands/dw-qa.md +2 -0
- package/scaffold/en/commands/dw-report.md +169 -0
- package/scaffold/en/commands/dw-resume.md +5 -11
- package/scaffold/en/commands/dw-review.md +4 -3
- package/scaffold/en/commands/dw-run.md +19 -165
- package/scaffold/en/commands/dw-skill-health.md +7 -0
- package/scaffold/en/commands/dw-update.md +18 -4
- package/scaffold/en/commands/dw-worktree.md +100 -0
- package/scaffold/en/references/command-routing.md +53 -0
- package/scaffold/en/references/execution-contract.md +55 -0
- package/scaffold/en/templates/frontend-quality-template.md +43 -0
- package/scaffold/en/templates/task-template.md +20 -40
- package/scaffold/en/templates/tasks-template.md +9 -6
- package/scaffold/en/templates/techspec-template.md +4 -0
- package/scaffold/pt-br/agent-instructions.md +31 -135
- package/scaffold/pt-br/commands/dw-analyze-project.md +2 -0
- package/scaffold/pt-br/commands/dw-autopilot.md +22 -243
- package/scaffold/pt-br/commands/dw-bugfix.md +9 -35
- package/scaffold/pt-br/commands/dw-claude-run.md +29 -46
- package/scaffold/pt-br/commands/dw-codex-run.md +30 -45
- package/scaffold/pt-br/commands/dw-context-budget.md +6 -14
- package/scaffold/pt-br/commands/dw-copilot-run.md +29 -43
- package/scaffold/pt-br/commands/dw-generate-pr.md +2 -2
- package/scaffold/pt-br/commands/dw-goal.md +11 -5
- package/scaffold/pt-br/commands/dw-harness-audit.md +2 -0
- package/scaffold/pt-br/commands/dw-help.md +8 -4
- package/scaffold/pt-br/commands/dw-pause.md +1 -0
- package/scaffold/pt-br/commands/dw-plan.md +14 -7
- package/scaffold/pt-br/commands/dw-qa.md +2 -0
- package/scaffold/pt-br/commands/dw-report.md +169 -0
- package/scaffold/pt-br/commands/dw-resume.md +7 -11
- package/scaffold/pt-br/commands/dw-review.md +4 -3
- package/scaffold/pt-br/commands/dw-run.md +19 -165
- package/scaffold/pt-br/commands/dw-skill-health.md +7 -0
- package/scaffold/pt-br/commands/dw-update.md +18 -4
- package/scaffold/pt-br/commands/dw-worktree.md +100 -0
- package/scaffold/pt-br/references/command-routing.md +53 -0
- package/scaffold/pt-br/references/execution-contract.md +55 -0
- package/scaffold/pt-br/templates/frontend-quality-template.md +43 -0
- package/scaffold/pt-br/templates/task-template.md +20 -40
- package/scaffold/pt-br/templates/tasks-template.md +9 -6
- package/scaffold/pt-br/templates/techspec-template.md +4 -0
- package/scaffold/scripts/hooks/git-guardrails.mjs +1 -0
- package/scaffold/scripts/lib/workflow-contract.mjs +101 -0
- package/scaffold/scripts/lib/worktree-gc.mjs +460 -0
- package/scaffold/skill-registry.json +23 -23
- package/scaffold/skills/dw-cli-run/SKILL.md +33 -208
- package/scaffold/skills/dw-cli-run/references/dispatch-tuning.md +14 -72
- package/scaffold/skills/dw-codebase-intel/SKILL.md +5 -39
- package/scaffold/skills/dw-codebase-intel/agents/intel-updater.md +1 -1
- package/scaffold/skills/dw-codebase-intel/references/agents-detail.md +7 -0
- package/scaffold/skills/dw-codebase-intel/references/files-in-dw-intel-detail.md +16 -0
- package/scaffold/skills/dw-codebase-intel/references/how-dw-intel-reads-this-detail.md +12 -0
- package/scaffold/skills/dw-codebase-intel/references/how-to-compose-the-typical-flow-detail.md +11 -0
- package/scaffold/skills/dw-council/SKILL.md +2 -17
- package/scaffold/skills/dw-council/references/integration-with-other-dw-commands-detail.md +7 -0
- package/scaffold/skills/dw-council/references/phase-2-tensions-and-rebuttals-detail.md +15 -0
- package/scaffold/skills/dw-domain-modeling/SKILL.md +1 -1
- package/scaffold/skills/dw-execute-phase/SKILL.md +12 -32
- package/scaffold/skills/dw-execute-phase/agents/executor.md +15 -252
- package/scaffold/skills/dw-execute-phase/agents/plan-checker.md +4 -207
- package/scaffold/skills/dw-execute-phase/references/atomic-commits.md +8 -18
- package/scaffold/skills/dw-execute-phase/references/de-sloppify-pass-optional-cleanup-task-detail.md +12 -0
- package/scaffold/skills/dw-execute-phase/references/deviation-rules-during-execution-detail.md +8 -0
- package/scaffold/skills/dw-execute-phase/references/how-the-two-agents-compose-detail.md +7 -0
- package/scaffold/skills/dw-execute-phase/references/plan-verification.md +9 -155
- package/scaffold/skills/dw-execute-phase/references/wave-coordination.md +6 -97
- package/scaffold/skills/dw-git-discipline/SKILL.md +2 -2
- package/scaffold/skills/dw-grilling/SKILL.md +1 -1
- package/scaffold/skills/dw-incident-response/SKILL.md +1 -64
- package/scaffold/skills/dw-incident-response/references/the-five-phases-detail.md +66 -0
- package/scaffold/skills/dw-llm-eval/SKILL.md +5 -53
- package/scaffold/skills/dw-llm-eval/references/agent-tool-use-evaluation-detail.md +23 -0
- package/scaffold/skills/dw-llm-eval/references/anti-patterns-will-block-in-dw-review-code-only-detail.md +9 -0
- package/scaffold/skills/dw-llm-eval/references/consistency-run-to-run-stability-detail.md +10 -0
- package/scaffold/skills/dw-llm-eval/references/integration-with-dev-workflow-commands-detail.md +6 -0
- package/scaffold/skills/dw-llm-eval/references/the-oracle-ladder-detail.md +15 -0
- package/scaffold/skills/dw-memory/SKILL.md +4 -50
- package/scaffold/skills/dw-memory/references/context-budget.md +8 -56
- package/scaffold/skills/dw-memory/references/promotion-decision-test-detail.md +30 -0
- package/scaffold/skills/dw-minimalism/SKILL.md +4 -5
- package/scaffold/skills/dw-review-rigor/SKILL.md +1 -54
- package/scaffold/skills/dw-review-rigor/references/the-five-rules-detail.md +56 -0
- package/scaffold/skills/dw-simplification/SKILL.md +2 -55
- package/scaffold/skills/dw-simplification/references/pattern-recognition-detail.md +11 -0
- package/scaffold/skills/dw-simplification/references/the-five-rules-detail.md +48 -0
- package/scaffold/skills/dw-source-grounding/SKILL.md +1 -56
- package/scaffold/skills/dw-source-grounding/references/the-protocol-detect-fetch-implement-cite-detail.md +58 -0
- package/scaffold/skills/dw-testing-discipline/SKILL.md +25 -177
- package/scaffold/skills/dw-testing-discipline/references/agent-guardrails.md +9 -167
- package/scaffold/skills/dw-testing-discipline/references/core-rules.md +3 -3
- package/scaffold/skills/dw-testing-discipline/references/mutation-testing.md +19 -0
- package/scaffold/skills/dw-testing-discipline/references/patterns.md +3 -12
- package/scaffold/skills/dw-ui-discipline/SKILL.md +2 -59
- package/scaffold/skills/dw-ui-discipline/references/frontend-engineering.md +46 -0
- package/scaffold/skills/dw-ui-discipline/references/the-four-grounding-questions-detail.md +61 -0
- package/scaffold/skills/dw-verify/SKILL.md +26 -148
- package/scaffold/skills/dw-verify/references/verification-discovery-and-attribution.md +2 -2
- package/scaffold/skills/humanizer/SKILL.md +2 -1
- package/scaffold/skills/security-review/SKILL.md +3 -183
- package/scaffold/skills/security-review/references/do-not-flag-detail.md +49 -0
- package/scaffold/skills/security-review/references/quick-patterns-reference-detail.md +56 -0
- package/scaffold/skills/security-review/references/review-process-detail.md +84 -0
- package/scaffold/skills/vercel-react-best-practices/SKILL.md +1 -90
- package/scaffold/skills/vercel-react-best-practices/references/quick-reference-detail.md +92 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<system_instructions>
|
|
2
|
+
You are the worktree lifecycle keeper. Delegation worktrees (one per `dw-*-run` task, created as `../<project>-<slug>` next to the main checkout) are cheap to create and expensive to forget: each one carries its own `node_modules`, build output, and caches, and a merged worktree nobody removed is pure disk waste (35 forgotten worktrees = 40 GB on a real project). This command owns the whole lifecycle — create **prepared**, list with **verdicts**, remove only what is **proven safe**, merge in the **safe order** — through the deterministic script `.dw/scripts/lib/worktree-gc.mjs`. It never uses `--force`.
|
|
3
|
+
|
|
4
|
+
## When to Use
|
|
5
|
+
- "Create a worktree for X", "spin up a worktree", and before any WRITE dispatch of `/dw-codex-run`, `/dw-claude-run`, or `/dw-copilot-run` (their pre-flight calls `create` when the worktree does not exist yet).
|
|
6
|
+
- "Clean the worktrees", "how many worktrees are left", "free some disk", right after a merge, inside `/dw-pause`, and from `/dw-harness-audit`.
|
|
7
|
+
- "Merge worktree X" — the owner's explicit merge decision **after** the gate.
|
|
8
|
+
- Do NOT use to merge unreviewed work: the gate (`/dw-review` + `/dw-qa` + `/dw-secure-audit`) comes first; `merge` only performs the mechanical safe order.
|
|
9
|
+
|
|
10
|
+
## Pipeline Position
|
|
11
|
+
**Predecessor:** `/dw-plan` (spec + prompt ready) or any task to delegate | **Successor:** `/dw-codex-run` / `/dw-claude-run` / `/dw-copilot-run` (after `create`); `/dw-commit` + `/dw-generate-pr` (after `merge`)
|
|
12
|
+
|
|
13
|
+
## Modes
|
|
14
|
+
|
|
15
|
+
| Invocation | Behavior |
|
|
16
|
+
|------------|----------|
|
|
17
|
+
| `/dw-worktree list [--base <branch>] [--json] [--strict]` | Table of every secondary worktree: branch, apparent size, age, dirty count, **verdict**, reason. `--strict` exits 3 when any REMOVABLE/PRUNABLE entry exists (audit hook). |
|
|
18
|
+
| `/dw-worktree create <slug> [--branch <name>] [--base <branch>] [--no-prep]` | Creates `../<project>-<slug>` on `feat/<slug>` (or `--branch`) from the base branch, then runs the **prep** commands so a delegate is never blind (lockfile-detected: `pnpm install --frozen-lockfile --prefer-offline` + `pnpm build:packages` when that script exists; `npm ci`; `yarn install --frozen-lockfile`; `bun install`; `uv sync`). Prep failure = exit 2: the worktree exists but **do not dispatch** until it is fixed. Prints `WORKTREE=<path>`. |
|
|
19
|
+
| `/dw-worktree clean [--apply] [--older-than <days>] [--keep-branches]` | **Dry-run by default.** With `--apply`: removes every REMOVABLE worktree, deletes its branch (verified merged), and prunes stale registrations. KEEP entries are never touched. |
|
|
20
|
+
| `/dw-worktree merge <slug\|path> [--base <branch>] [--keep-branches]` | The safe order, from the main checkout: main is on the base branch and clean → worktree is clean and not in use → `git merge --ff-only` → `git worktree remove` → branch delete → `git worktree prune`. Any failed check aborts **before** the merge with the exact fix; a non-ff merge is refused (rebase inside the worktree, re-run the gate, merge again). |
|
|
21
|
+
| `/dw-worktree prune` | Drops registrations whose directory is gone. |
|
|
22
|
+
|
|
23
|
+
## Verdicts — the script decides; you report, you do not override
|
|
24
|
+
|
|
25
|
+
| Verdict | Meaning | Action |
|
|
26
|
+
|---------|---------|--------|
|
|
27
|
+
| `REMOVABLE` | Head is an ancestor of an integration branch, working tree clean, no process has its cwd inside, not locked | `clean --apply` removes it |
|
|
28
|
+
| `KEEP:unmerged` | N commits not in any integration branch | Owner decides: merge (`merge`), keep, or explicitly drop |
|
|
29
|
+
| `KEEP:dirty` | Uncommitted or untracked files | Commit/stash inside the worktree, or owner explicitly drops |
|
|
30
|
+
| `KEEP:in-use` | A process (dev server, CLI run, shell) has its cwd inside | Stop it first (`TaskStop`, or the PID listed) |
|
|
31
|
+
| `KEEP:locked` | `git worktree lock` | Owner unlocks |
|
|
32
|
+
| `KEEP:recent` | Only with `--older-than N`: merged but last commit newer than N days | Age-based GC only |
|
|
33
|
+
| `PRUNABLE` | Directory already gone | `prune` |
|
|
34
|
+
|
|
35
|
+
## Hard Rules
|
|
36
|
+
|
|
37
|
+
<critical>Create through `create`, never a bare `git worktree add`. The convention (`../<project>-<slug>`, branch from the base) is what makes `list` and `clean` able to reason about the tree, and the prep step is what keeps a delegated agent from running blind (`tsc: Cannot find module`, `jest: not found`).</critical>
|
|
38
|
+
|
|
39
|
+
<critical>End of life is the SAME TURN as the merge. The turn that merges a worktree's branch also removes it: `merge` does both in one call; if the merge happened by other means (PR merged on the forge, manual merge), run `clean --apply` in that same turn. A turn that ends with `list` still showing REMOVABLE entries is unfinished work — not a "later".</critical>
|
|
40
|
+
|
|
41
|
+
<critical>Never `--force`. `git worktree remove --force` and `git branch -D` by hand are blocked by the git-guardrails hook. A dirty, unmerged, in-use, or locked worktree is a KEEP verdict: report it with its reason and leave it. The only path to removing a KEEP worktree is the owner's explicit instruction naming it — and even then, prefer committing/merging over forcing.</critical>
|
|
42
|
+
|
|
43
|
+
<critical>Never change the owner's active state. `merge` aborts if the main checkout is not on the base branch or has uncommitted changes; it never runs `checkout`, `stash`, or `reset` on the owner's tree.</critical>
|
|
44
|
+
|
|
45
|
+
## Base branch resolution
|
|
46
|
+
|
|
47
|
+
`--base` → `DW_WORKTREE_BASE` → `.dw/config.json` `worktree.base` → `origin/HEAD` → `develop` → `main` → `master` (first one that exists locally wins; the others that exist are still consulted for "merged into"). A project that integrates on `develop` while `origin/HEAD` points to `main` should set:
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{ "worktree": { "base": "develop", "prep": ["pnpm install --frozen-lockfile --prefer-offline", "pnpm build:packages"] } }
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
`worktree.prep` overrides lockfile detection entirely (empty array = no prep).
|
|
54
|
+
|
|
55
|
+
## Workflow
|
|
56
|
+
|
|
57
|
+
1. Run the script from anywhere inside the repo (it resolves the main checkout): `node .dw/scripts/lib/worktree-gc.mjs <mode> …`. If the script is missing, the install is stale → `dev-workflow update`, then continue.
|
|
58
|
+
2. Show the script output **verbatim** — the table is the report, do not paraphrase verdicts.
|
|
59
|
+
3. `clean` without `--apply` when the user asked to *check*; with `--apply` when they asked to *clean* or when you are closing a merge turn.
|
|
60
|
+
4. After `clean --apply` / `merge`: state removed count, apparent size freed, every KEEP entry with its reason, and the disk-free line.
|
|
61
|
+
5. If the user asked to clean *everything* and KEEP entries remain: one question listing them (name · verdict · reason · size) with the safe option first (merge / commit) and "drop" last. Otherwise just report them.
|
|
62
|
+
|
|
63
|
+
## Integrations (who calls this)
|
|
64
|
+
|
|
65
|
+
- **`dw-cli-run` pre-flight** — target worktree missing → `create <slug>`; **Discipline** — branch merged → `/dw-worktree merge <slug>` or `/dw-worktree clean --apply` in the same turn.
|
|
66
|
+
- **`/dw-pause`** — runs `list`; every REMOVABLE entry is an open loop to close *now* with `clean --apply`, not to record.
|
|
67
|
+
- **`/dw-harness-audit`** — `list --strict`; exit 3 caps the *Worktree hygiene* category and each leftover is cited.
|
|
68
|
+
- **git-guardrails hook** — blocks `git worktree remove --force`, `git branch -D`, `git clean -f`.
|
|
69
|
+
|
|
70
|
+
## Output format
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
🌳 Worktrees — /home/me/code/app (base: develop)
|
|
74
|
+
<script table verbatim>
|
|
75
|
+
33 REMOVABLE (~75.9G apparent) · 2 KEEP · 0 PRUNABLE
|
|
76
|
+
Next: /dw-worktree clean --apply (dry-run shown above)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
After `--apply`:
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
🌳 Cleaned — removed 33 worktree(s), ~75.9G apparent · kept 2: app-build (KEEP:dirty: 1 uncommitted file), w20 (KEEP:unmerged: 1 commit ahead of develop)
|
|
83
|
+
41.2G free on the filesystem of /home/me/code
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Anti-patterns
|
|
87
|
+
- `git worktree add` by hand → unprepared worktree, blind delegate, unregistered naming.
|
|
88
|
+
- Merging and "cleaning later" → the later never comes; 40 GB of it.
|
|
89
|
+
- `git worktree remove --force` / `branch -D` to make a KEEP verdict go away.
|
|
90
|
+
- Paraphrasing verdicts or hiding KEEP reasons.
|
|
91
|
+
- Running `merge` before the gate.
|
|
92
|
+
- Checking out the base branch in the owner's main tree to make `merge` pass.
|
|
93
|
+
|
|
94
|
+
## Structured Return
|
|
95
|
+
- **Status:** `PASS` (mode completed; after `clean --apply`/`merge` zero REMOVABLE remain) · `FINDINGS` (REMOVABLE entries shown in dry-run, or KEEP entries need the owner) · `BLOCKED` (script missing, merge refused, prep failed).
|
|
96
|
+
- **Evidence:** the script output (table, removed lines, disk-free line).
|
|
97
|
+
- **Artifacts:** `WORKTREE=<path>` for `create`; removed paths + deleted branches for `clean`/`merge`.
|
|
98
|
+
- **Next Step:** the exact next command (`/dw-codex-run` on the created worktree; `clean --apply`; the owner's decision on KEEP entries).
|
|
99
|
+
|
|
100
|
+
</system_instructions>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Command routing
|
|
2
|
+
|
|
3
|
+
Use the installed root routing rules first. Consult this catalog only to locate a specialized command. A command suggestion is not authorization to publish, merge, or start an unrelated workflow.
|
|
4
|
+
|
|
5
|
+
## Trigger Map
|
|
6
|
+
|
|
7
|
+
| User intent (literal or paraphrased) | Auto-trigger |
|
|
8
|
+
|--------------------------------------|--------------|
|
|
9
|
+
| "Implement X" / "Build Y" / "Add feature Z" / "I need ..." / "Create ..." | `/dw-plan` / `/dw-autopilot` |
|
|
10
|
+
| "Autopilot this PRD" / "Take this PRD to PR" / continue a bugfix escalation autonomously | `/dw-autopilot --from-prd <slug>` (existing PRD at `.dw/spec/<slug>/`) |
|
|
11
|
+
| "Resume autopilot" / "continue after plan" / `autopilot-state.json` has `status: plan_complete` | `/dw-autopilot` (or `/dw-goal --from-autopilot <slug>` if the user specifically asks for the goal step) |
|
|
12
|
+
| Pasted error / "X is broken" / "Bug in Y" / failing test screenshot | `/dw-bugfix "X"` |
|
|
13
|
+
| "Plan this feature" / "Write a PRD + techspec + tasks" | `/dw-plan "X"` |
|
|
14
|
+
| "Write a PRD for X" / "Spec out Y" | `/dw-plan prd "X"` |
|
|
15
|
+
| "Design the architecture" / "Make the techspec" | `/dw-plan techspec` |
|
|
16
|
+
| "Break this into tasks" | `/dw-plan tasks` |
|
|
17
|
+
| "Run this task" (with task ID) | `/dw-run <ID>` |
|
|
18
|
+
| "Run all pending tasks" / "Execute the plan" | `/dw-run` |
|
|
19
|
+
| "Run this as a goal" / "durable goal" / "long-running objective" | `/dw-goal "<objective>"` |
|
|
20
|
+
| "Continue where I left off" | `/dw-run --resume` |
|
|
21
|
+
| "Pause work" / "End the session" / "Save where we are" | `/dw-pause` |
|
|
22
|
+
| "Report every N minutes" / "Keep me posted while this runs" / "Give me status reports" | `/dw-report [--every <N>m]` |
|
|
23
|
+
| "Create a worktree for X" / "Clean up the worktrees" / "Merge worktree X" / "How many worktrees are left?" | `/dw-worktree create <slug>` / `/dw-worktree clean --apply` / `/dw-worktree merge <slug>` / `/dw-worktree list` |
|
|
24
|
+
| "Resume" / "Where did we stop?" / "Pick up where we left off" | `/dw-resume` |
|
|
25
|
+
| "QA this feature" / "Run the test plan" | `/dw-qa` |
|
|
26
|
+
| "Fix the QA bugs" | `/dw-qa --fix` |
|
|
27
|
+
| "Evaluate the AI feature" / "Test the RAG / classifier" | `/dw-qa --ai` |
|
|
28
|
+
| "Walk me through this feature" / "UAT this with me" / "Let's do a manual run-through" | `/dw-qa --uat` |
|
|
29
|
+
| "Review this bugfix" / "Code-review fix `<slug>`" | `/dw-review --bugfix <slug>` |
|
|
30
|
+
| "QA this bugfix" / "Validate fix `<slug>`" | `/dw-qa --bugfix <slug>` |
|
|
31
|
+
| "Review my PR" / "Check code quality" / "Is this ready to ship?" | `/dw-review` |
|
|
32
|
+
| "Just the PRD coverage check" | `/dw-review --coverage-only` |
|
|
33
|
+
| "Just the code quality review" | `/dw-review --code-only` |
|
|
34
|
+
| "Time to commit" / changes are validated and ready | `/dw-commit` |
|
|
35
|
+
| "Open a PR" / "Ship this" | `/dw-generate-pr` |
|
|
36
|
+
| "Suggest new ideas" / "What should we build next?" / "Find opportunities" / "Roadmap ideas" | `/dw-opportunities` |
|
|
37
|
+
| "What security improvements should we consider?" / "Find security opportunities" | `/dw-opportunities "security"` |
|
|
38
|
+
| "Brainstorm X" / "Explore this idea" / "Research X" | `/dw-brainstorm "X"` (auto-dispatches grill / prototype / council / research / onepager based on signals) |
|
|
39
|
+
| "Code-health audit" / "Find tech debt" / "Refactor opportunities" / "Smells in X" | `/dw-refactor "X"` |
|
|
40
|
+
| "Where is X?" / "What uses Y?" / "How is Z structured?" | `/dw-intel "<question>"` |
|
|
41
|
+
| "Rebuild the codebase index" / "Refresh intel" | `/dw-intel --build` |
|
|
42
|
+
| "Context is heavy" / "Audit token usage" / "Why is the agent slow?" | `/dw-context-budget` |
|
|
43
|
+
| "Check dev-workflow install" / "Are agents/wrappers healthy?" | `/dw-harness-audit` |
|
|
44
|
+
| "Audit skills" / "Skills feel duplicated or bloated" | `/dw-skill-health` |
|
|
45
|
+
| "Redesign this UI" / "Audit and ship a new design" | `/dw-redesign-ui "<target>"` |
|
|
46
|
+
| "Audit dependencies" / "Are we behind on packages?" | `/dw-secure-audit --plan` |
|
|
47
|
+
| "Scan for vulnerabilities" / "Security check" | `/dw-secure-audit` |
|
|
48
|
+
| "Analyze this project" / "Generate rules" | `/dw-analyze-project` |
|
|
49
|
+
| "Open a new project" / "Bootstrap a stack" | `/dw-new-project` |
|
|
50
|
+
| "Dockerize this" / "Add docker-compose" | `/dw-dockerize` |
|
|
51
|
+
| "Functional doc" / "Map screens and flows" | `/dw-functional-doc` |
|
|
52
|
+
| "Install Azure skills" / "Setup Microsoft docs MCP" / "Add Azure expertise" / "I'm going to work on Azure" | `/dw-install-azure-skills` |
|
|
53
|
+
| "Install AWS skills" / "Setup AWS MCP" / "Add AWS expertise" / "I'm going to work on AWS" | `/dw-install-aws-skills` |
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Task execution contract
|
|
2
|
+
|
|
3
|
+
Read during task breakdown, dispatch, or resume. The parent coordinates the approved plan through validation; runner return is a handoff, not the end of the objective.
|
|
4
|
+
|
|
5
|
+
## Planning assignments
|
|
6
|
+
|
|
7
|
+
Choose development locally or across tools at `/dw-plan tasks`, not on every dispatch. Present a task matrix with complexity, rationale, tool, model, effort, agents, dependencies, and checks. Use `light` for mechanical low-risk work, `standard` for known patterns with bounded decisions, and `heavy` for architecture, uncertainty, or sensitive surfaces. File counts and commit types alone do not determine complexity.
|
|
8
|
+
|
|
9
|
+
Use `.dw/config/routing.json` as model candidates, not proof of availability. Inspect installed CLI version/help for flags and supported configuration; use provider documentation or available model metadata for model IDs. Help/version alone does not prove authentication or account access. Preserve explicit model choices. Prefer configured models that satisfy the task; propose upgrades when useful, citing source/date. Local agents inherit the current session model unless an explicit task override is supported and approved. Do not choose an arbitrary different tier just to call a review independent.
|
|
10
|
+
|
|
11
|
+
Claude orchestration can propose `codex` (`/dw-codex-run`), Codex can propose `claude` (`/dw-claude-run`). Copilot/OpenCode retain local execution and may use explicitly selected adapters. Keep coupled/small work local unless the user chooses otherwise. Use only installed, relevant agents; no mandatory fan-out. Validate agent names against `.dw/agent-registry.json` and the installed profiles.
|
|
12
|
+
|
|
13
|
+
Alongside tasks.md and the per-task Markdown, write `execution-plan.json`:
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"schema_version": "1.1",
|
|
18
|
+
"approved": false,
|
|
19
|
+
"tasks": [{
|
|
20
|
+
"id": "1.0",
|
|
21
|
+
"depends_on": [],
|
|
22
|
+
"execution": {
|
|
23
|
+
"complexity": "standard",
|
|
24
|
+
"rationale": "Known service pattern; bounded behavior change",
|
|
25
|
+
"tool": "local",
|
|
26
|
+
"model": "inherit",
|
|
27
|
+
"effort": "inherit",
|
|
28
|
+
"agents": [],
|
|
29
|
+
"fallbacks": []
|
|
30
|
+
}
|
|
31
|
+
}]
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
For external tools resolve concrete model/effort before approval. Fallback entries contain `tool`, `model`, `effort`; only approved alternatives may be used. Validate with `node .dw/scripts/lib/workflow-contract.mjs validate <plan.json>` and cross-check the IDs/dependencies against tasks.md. Mark `approved: true` only after user approval of the same assignments; record the approval in the plan's decision log. Changed assignments require approval unless explicitly requested or covered by an approved fallback. An agent-authored boolean is a record, not independent proof of consent.
|
|
36
|
+
|
|
37
|
+
Resolution precedence: current explicit user instruction → approved task assignment → project configuration → tool default. For a saved plan, configuration/defaults are used to propose missing assignments, never silently replace approved ones. Model rejection uses an approved fallback or blocks with evidence; no unapproved provider change. Plans at schema 1.0 without execution metadata run locally; do not force a migration or retroactive delegation decision.
|
|
38
|
+
|
|
39
|
+
## Dependency and worktree ownership
|
|
40
|
+
|
|
41
|
+
For WRITE dispatch create a dedicated worktree through `/dw-worktree create`. Record its starting revision and branch. Tasks in a dependency chain use the same execution branch/worktree, with one writer at a time, even when successive tasks select different CLIs. The next task sees completed dependency commits on that branch; never create it afresh from main. Use separate worktrees for independent tasks only when the approved plan defines how their branches will be integrated before dependent work. Do not merge into the owner's branch merely to move to the next task.
|
|
42
|
+
|
|
43
|
+
Stage only scoped changes. Commit implementation and task status together; then record the resulting SHA in tasks.md/run-log (a SHA cannot include itself in its own commit). Include that bookkeeping in the next scoped commit or final metadata commit; leave no unreported dirty bookkeeping at delivery. Do not amend or stage unrelated files automatically.
|
|
44
|
+
|
|
45
|
+
## Durable state and resume
|
|
46
|
+
|
|
47
|
+
Persist `execution-state.json` beside the plan, with schema_version `1.1` and a `tasks` object keyed by task ID. Each entry records the approved assignment, worktree, branch/base revision, provider session ID, audit/prompt paths, attempt, status, checkpoint, commit SHA, and verification records. Store audit/session files outside disposable worktrees. Update before dispatch and after every handoff; preserve completed work on interruption.
|
|
48
|
+
|
|
49
|
+
Resume inspects saved task identity, actual diff, branch, dependencies, and evidence before continuing. Keep the approved executor and session. If its sidecar is absent, recover the exact session from that task's audit log and verify provider/worktree/task identity. Never blindly use `--last` or `-c`. If the ID cannot be recovered, start a new session in the same worktree from the approved task, state, diff and logs; record loss of conversational context. A session from one provider cannot be resumed by another provider. Never reset/clean partial work to retry.
|
|
50
|
+
|
|
51
|
+
## Completion and authorization
|
|
52
|
+
|
|
53
|
+
The worker implements and checks its task, then returns evidence and unresolved findings. The parent independently inspects the diff and acceptance criteria, verifies evidence validity, sends in-scope corrections to the same worker, and continues dependencies. No new confirmation is needed for an already approved run/resume or ordinary corrections. Only material scope changes, unavailable approved alternatives, permission restrictions, and unresolved product/architecture decisions block dependent work; continue independent authorized work when possible.
|
|
54
|
+
|
|
55
|
+
Review quality rests on acceptance criteria and blocking findings, not a numeric score. Reuse verified check output for equivalent inputs/environment/scope; rerun affected checks after edits. Finish required project checks at delivery. Merge, push and publication remain separate authorization boundaries. Without that authorization, report the prepared branch/worktree and validated result.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: frontend-quality
|
|
3
|
+
schema_version: "1.0"
|
|
4
|
+
status: draft
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Frontend quality baseline
|
|
8
|
+
|
|
9
|
+
Use for a requested frontend audit or quality-tooling plan. Embed in the existing `.dw/rules/<module>.md` for an audit, or in the feature's TechSpec for implementation. A feature needs only affected rows. This template records decisions; it does not configure tools or authorize new gates.
|
|
10
|
+
|
|
11
|
+
- Module and scope: [workspace, runtime entry points, relevant diff]
|
|
12
|
+
- Observed at: [revision plus working-tree changes, date]
|
|
13
|
+
- Stack: [framework/compiler/runner/package-manager versions, lockfile]
|
|
14
|
+
- Existing policy: [instructions, rules, scripts and CI paths]
|
|
15
|
+
|
|
16
|
+
## Controls
|
|
17
|
+
|
|
18
|
+
Keep observation and proposal separate. Preserve existing required checks. Policy values: `required`, `advisory`, `deferred`, `not_applicable`. An unadopted proposal is `deferred`; record execution separately as `passed`, `failed` or `not_run`. Explain exclusions and missing evidence. Do not mark missing tools as passed or silently enforce a proposed gate.
|
|
19
|
+
|
|
20
|
+
| ID | Risk/control to inspect | Observed configuration and gaps | Policy / proposed change | Exact command, cwd and scope | Evidence / execution |
|
|
21
|
+
|---|---|---|---|---|---|
|
|
22
|
+
| contract | API authority, generated client drift, runtime validation | | | | |
|
|
23
|
+
| types | Effective TypeScript strictness and unsafe escapes | | | | |
|
|
24
|
+
| lint | Relevant framework, test and accessibility diagnostics | | | | |
|
|
25
|
+
| boundaries | Allowed imports, server/client separation, production entry points | | | | |
|
|
26
|
+
| custom-rules | Repeated defect, detector fixtures and actionable errors | | | | |
|
|
27
|
+
| feedback | Discoverable local rules and optional hook feedback | | | | |
|
|
28
|
+
| mutation | Critical behavior, survivor investigation and cache validity | | | | |
|
|
29
|
+
| dead-code | Runtime/public reachability, generated files, reviewed exclusions | | | | |
|
|
30
|
+
| duplication | Shared business rules versus intentional repeated markup | | | | |
|
|
31
|
+
| ci | Required jobs, observable failures, deploy dependencies and repository rules | | | | |
|
|
32
|
+
|
|
33
|
+
## Adoption and validation
|
|
34
|
+
|
|
35
|
+
- Next change: [risk it removes, files/config to change, compatible tool already present or proposed dependency]
|
|
36
|
+
- Existing debt: [baseline location; keep it distinct from newly introduced defects]
|
|
37
|
+
- Promotion condition: [evidence needed to move advisory to required; decision owner]
|
|
38
|
+
- Exceptions: [specific rule/path, reason, owner and review trigger; no blanket exclusions]
|
|
39
|
+
- Detector checks: [deliberately invalid fixture, legitimate fixture, alias/generated-path cases and unsupported cases]
|
|
40
|
+
- Analysis limits: [not executed, unavailable service, incomplete graph or CI/repository settings not inspected]
|
|
41
|
+
- Delivery checks: [required commands and behavioral acceptance; reuse evidence only for equivalent inputs/environment/scope]
|
|
42
|
+
|
|
43
|
+
For operational guidance, read `dw-ui-discipline/references/frontend-engineering.md` from the installed skills location. Put accepted implementation work in the task execution matrix; continue under existing authorization. An audit alone ends with the documented findings and proposed changes.
|
|
@@ -1,72 +1,52 @@
|
|
|
1
1
|
---
|
|
2
2
|
type: task
|
|
3
|
-
schema_version: "1.
|
|
3
|
+
schema_version: "1.1"
|
|
4
4
|
status: pending
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Task X.0: [Main Task Title]
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Read the relevant PRD/TechSpec sections and task constraints; use the links below.
|
|
10
10
|
|
|
11
11
|
## Overview
|
|
12
12
|
|
|
13
13
|
[Brief task description]
|
|
14
14
|
|
|
15
|
-
**Functional Requirements covered**: FR-X.Y, FR-X.Z
|
|
15
|
+
**Functional Requirements covered**: FR-X.Y, FR-X.Z
|
|
16
16
|
Depends on: none
|
|
17
17
|
|
|
18
18
|
<requirements>
|
|
19
19
|
[List of mandatory requirements]
|
|
20
20
|
</requirements>
|
|
21
21
|
|
|
22
|
-
##
|
|
22
|
+
## Execution assignment
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
- [ ] X.1 [Subtask description]
|
|
26
|
-
- [ ] X.2 [Subtask description]
|
|
24
|
+
Mirror this task's approved entry in `execution-plan.json` (see `.dw/references/execution-contract.md`).
|
|
27
25
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
| Complexity + rationale | Tool | Model / effort | Agents | Approved fallbacks |
|
|
27
|
+
|---|---|---|---|---|
|
|
28
|
+
| standard — [reason] | local | inherit / inherit | none | none |
|
|
31
29
|
|
|
32
|
-
##
|
|
30
|
+
## Implementation
|
|
33
31
|
|
|
34
|
-
|
|
32
|
+
- [ ] [Behavior to deliver]
|
|
33
|
+
- [ ] [Relevant verification and acceptance checks]
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
|--------|-------|
|
|
38
|
-
| `[method1]` | Happy path, edge case, error |
|
|
39
|
-
| `[method2]` | Happy path, not found |
|
|
35
|
+
## Verification and success criteria
|
|
40
36
|
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
| Behavior / risk | Existing suite or new test | Command / observable evidence |
|
|
38
|
+
|---|---|---|
|
|
39
|
+
| [Required outcome] | [Lowest effective layer; new test only if needed] | [Project command or inspection] |
|
|
43
40
|
|
|
44
|
-
|
|
41
|
+
Use the project's test strategy. Define mocks only at justified boundaries; do not impose coverage percentages or a new test for every edit. Include important failure cases where applicable.
|
|
45
42
|
|
|
46
|
-
|
|
43
|
+
## Relevant files and decisions
|
|
47
44
|
|
|
48
|
-
|
|
45
|
+
[Source paths and relevant TechSpec/ADR sections; do not duplicate entire documents.]
|
|
49
46
|
|
|
50
|
-
|
|
51
|
-
- [Quality requirements]
|
|
52
|
-
- **Unit tests passing**
|
|
53
|
-
- **Minimum 80% coverage** on services/use-cases
|
|
47
|
+
## Commit on completion
|
|
54
48
|
|
|
55
|
-
|
|
56
|
-
- [Files relevant to this task]
|
|
57
|
-
- [File].spec.ts - Unit tests
|
|
58
|
-
|
|
59
|
-
## Commit on Completion
|
|
60
|
-
|
|
61
|
-
When completing this task, commit:
|
|
62
|
-
```bash
|
|
63
|
-
git add .
|
|
64
|
-
git commit -m "feat([module]): [description]
|
|
65
|
-
|
|
66
|
-
- [item 1]
|
|
67
|
-
- [item 2]
|
|
68
|
-
- Add unit tests"
|
|
69
|
-
```
|
|
49
|
+
Use the scoped atomic commit protocol in `/dw-run`. Stage only this task's files, retain requirement IDs, record the resulting SHA in tasks.md/run-log, and include final bookkeeping before delivery. No push or merge is implied.
|
|
70
50
|
|
|
71
51
|
## Related ADRs
|
|
72
52
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
type: tasks-index
|
|
3
|
-
schema_version: "1.
|
|
3
|
+
schema_version: "1.1"
|
|
4
4
|
status: draft
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -34,10 +34,13 @@ feat/prd-[feature-name]
|
|
|
34
34
|
- [ ] 2.0 Main Task Title Depends on: 1.0
|
|
35
35
|
- [ ] 3.0 Main Task Title Depends on: 1.0, 2.0
|
|
36
36
|
|
|
37
|
+
## Execution plan
|
|
38
|
+
|
|
39
|
+
Propose local or cross-tool development per task during breakdown. Summarize complexity/rationale, tool, model/effort, agents, dependencies and verification. Store validated assignments and approved fallbacks in `execution-plan.json`; use `.dw/references/execution-contract.md`. Record approval of the same matrix before execution.
|
|
40
|
+
|
|
37
41
|
## Workflow
|
|
38
42
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
4. Next task or `/dw-generate-pr [target-branch]` when all tasks are completed
|
|
43
|
+
1. `/dw-run` consumes the approved assignments in dependency order.
|
|
44
|
+
2. Each task implements, verifies and commits scoped changes; the parent reviews external-worker handoffs and routes corrections.
|
|
45
|
+
3. Continue approved implementation through final review and applicable QA. A planning-only request ends at the plan.
|
|
46
|
+
4. Prepare the validated delivery; integrate/push/publish only within existing authorization.
|
|
@@ -78,6 +78,10 @@ type ServiceName interface {
|
|
|
78
78
|
|
|
79
79
|
## Development Sequencing
|
|
80
80
|
|
|
81
|
+
### Frontend Quality (when applicable)
|
|
82
|
+
|
|
83
|
+
[Read the module's existing quality baseline. Use relevant rows from `.dw/templates/frontend-quality-template.md` for changed API contracts, types, import boundaries or quality tooling. Record authoritative sources, exact checks, current policy, proposed adoption and behavioral evidence. Keep advisory diagnostics distinct from required gates; do not expand a UI feature into a repository-wide tooling migration.]
|
|
84
|
+
|
|
81
85
|
### Build Order
|
|
82
86
|
|
|
83
87
|
[Define implementation sequence:
|
|
@@ -1,154 +1,50 @@
|
|
|
1
1
|
<!-- dev-workflow:start -->
|
|
2
|
-
# dev-workflow — Instruções
|
|
3
|
-
|
|
4
|
-
Este projeto usa [`@brunosps00/dev-workflow`](https://www.npmjs.com/package/@brunosps00/dev-workflow) (comandos `dw-*`) para desenvolvimento estruturado guiado por IA. Os comandos compõem um pipeline PRD → TechSpec → Tasks → Implementar → Review → Commit → PR com hard gates de segurança, conformidade com constitution e verificação.
|
|
5
|
-
|
|
6
|
-
**Objetivo deste arquivo:** quando o usuário expressar uma intenção que casa com a Trigger Map abaixo, rode o comando `dw-*` correspondente **sem pedir permissão** — exceto se a mudança for genuinamente trivial (veja Escape Hatches).
|
|
7
|
-
|
|
8
|
-
## Matriz de Auto-Sizing
|
|
9
|
-
|
|
10
|
-
Antes de escolher um comando da Trigger Map, dimensione o escopo real da mudança. A mesma intenção ("conserta isso", "adiciona isso") pode significar quantidades muito diferentes de trabalho; a matriz nomeia quatro tamanhos e roteia cada um para uma entrada diferente. **Escolha o menor que cabe — sub-rotear desperdiça cerimônia, super-rotear esconde o escopo.**
|
|
11
|
-
|
|
12
|
-
| Tamanho | Como se parece | Rotear para |
|
|
13
|
-
|---------|----------------|-------------|
|
|
14
|
-
| **Pequeno** | ≤3 arquivos, sem migration, sem novo endpoint, descritível em uma frase. Exemplos: typo, log message, config de uma linha, bump de dependência, version pin. | Faça inline. Nenhum comando `dw-*`. |
|
|
15
|
-
| **Médio** | Feature ou bug claro, <10 tasks numeradas esperadas, único componente ou serviço, sem decisões arquiteturais. Exemplos: adicionar campo de form com validação, corrigir regressão em módulo conhecido, ligar novo endpoint num handler existente. | `/dw-bugfix` (bugs) ou `/dw-plan` (features) — direto, não via `/dw-autopilot`. |
|
|
16
|
-
| **Grande** | Feature multi-componente, ≥10 tasks esperadas, toca múltiplos módulos, tem superfície UX user-visible E backend. Exemplos: adicionar nova entidade end-to-end (model + migration + API + UI), introduzir integração de terceiro, redesenhar fluxo. | `/dw-autopilot "<wish>"` — primeira invocação planeja e para; segunda invocação retoma via `/dw-goal` para Run → Review → QA/Fix → Review, depois Commit → PR. |
|
|
17
|
-
| **Complexo** | Domínio novo, requisitos ambíguos, decisão arquitetural exigida, superfície regulatória ou de compliance, ou escopo que cruza múltiplos PRDs. Exemplos: introduzir event sourcing, reconstruir auth, multi-tenancy, nova linha de produto. | `/dw-opportunities` primeiro se a ideia ainda nao existir; caso contrario `/dw-brainstorm "<ideia>"` (auto-dispatch de modos research/council), depois `/dw-plan --council` para a etapa de techspec rodar o debate multi-advisor. |
|
|
18
|
-
|
|
19
|
-
**Safety valve:** se você começou em Pequeno ou Médio mas o trabalho revela que é Grande de fato (a listagem inline passa de 5 passos, ou `/dw-bugfix` dispara seu `Step 5.0`), PARE e escale. Não existe flag para bypass. Escalar é o desfecho correto.
|
|
20
|
-
|
|
21
|
-
**Adaptado de** [`tech-leads-club/agent-skills/tlc-spec-driven`](https://github.com/tech-leads-club/agent-skills/tree/main/packages/skills-catalog/skills/(development)/tlc-spec-driven) (CC-BY-4.0). A matriz de quatro tamanhos é de lá; o mapeamento para comandos `dw-*` é específico do dev-workflow.
|
|
22
|
-
|
|
23
|
-
## Trigger Map
|
|
24
|
-
|
|
25
|
-
| Intenção do usuário (literal ou parafraseada) | Auto-trigger |
|
|
26
|
-
|------------------------------------------------|--------------|
|
|
27
|
-
| "Implementa X" / "Cria Y" / "Adiciona feature Z" / "Preciso de..." | `/dw-autopilot "X"` |
|
|
28
|
-
| "Autopilota esse PRD" / "Leva esse PRD pra PR" / continua escalação de bugfix autonomamente | `/dw-autopilot --from-prd <slug>` (PRD existente em `.dw/spec/<slug>/`) |
|
|
29
|
-
| "Retoma autopilot" / "continua depois do plan" / `autopilot-state.json` tem `status: plan_complete` | `/dw-autopilot` (ou `/dw-goal --from-autopilot <slug>` se o usuário pedir especificamente a etapa de goal) |
|
|
30
|
-
| Erro colado / "X está quebrado" / "Bug em Y" / screenshot de teste falhando | `/dw-bugfix "X"` |
|
|
31
|
-
| "Planeja essa feature" / "Escreve PRD + techspec + tasks" | `/dw-plan "X"` |
|
|
32
|
-
| "Escreve PRD pra X" / "Especifica Y" | `/dw-plan prd "X"` |
|
|
33
|
-
| "Desenha a arquitetura" / "Faz o techspec" | `/dw-plan techspec` |
|
|
34
|
-
| "Quebra em tasks" | `/dw-plan tasks` |
|
|
35
|
-
| "Roda essa task" (com ID da task) | `/dw-run <ID>` |
|
|
36
|
-
| "Roda todas as tasks pendentes" / "Executa o plano" | `/dw-run` |
|
|
37
|
-
| "Roda isso como goal" / "objetivo durável" / "long-running objective" | `/dw-goal "<objetivo>"` |
|
|
38
|
-
| "Continue de onde parei" | `/dw-run --resume` |
|
|
39
|
-
| "Pausa o trabalho" / "Encerra a sessão" / "Salva onde paramos" | `/dw-pause` |
|
|
40
|
-
| "Retoma" / "Onde paramos?" / "Volta de onde parei" | `/dw-resume` |
|
|
41
|
-
| "QA dessa feature" / "Roda o test plan" | `/dw-qa` |
|
|
42
|
-
| "Corrige os bugs do QA" | `/dw-qa --fix` |
|
|
43
|
-
| "Avalia a feature AI" / "Testa o RAG / classifier" | `/dw-qa --ai` |
|
|
44
|
-
| "Caminha comigo pela feature" / "UAT comigo" / "Vamos fazer um run-through manual" | `/dw-qa --uat` |
|
|
45
|
-
| "Revisa esse bugfix" / "Code-review do fix `<slug>`" | `/dw-review --bugfix <slug>` |
|
|
46
|
-
| "QA desse bugfix" / "Valida o fix `<slug>`" | `/dw-qa --bugfix <slug>` |
|
|
47
|
-
| "Revisa meu PR" / "Checa qualidade" / "Tá pronto pra subir?" | `/dw-review` |
|
|
48
|
-
| "Só checagem de cobertura PRD" | `/dw-review --coverage-only` |
|
|
49
|
-
| "Só code review qualidade" | `/dw-review --code-only` |
|
|
50
|
-
| "Hora de commitar" / mudanças validadas e prontas | `/dw-commit` |
|
|
51
|
-
| "Abre um PR" / "Sobe isso" | `/dw-generate-pr` |
|
|
52
|
-
| "Sugere ideias novas" / "O que devemos construir agora?" / "Encontra oportunidades" / "Ideias de roadmap" | `/dw-opportunities` |
|
|
53
|
-
| "Que melhorias de seguranca devemos considerar?" / "Encontra oportunidades de seguranca" | `/dw-opportunities "security"` |
|
|
54
|
-
| "Brainstorm X" / "Explora essa ideia" / "Research X" | `/dw-brainstorm "X"` (auto-dispatch dos modos grill / prototype / council / research / onepager conforme os sinais) |
|
|
55
|
-
| "Auditoria de saude do codigo" / "Tech debt" / "Oportunidades de refactor" / "Smells em X" | `/dw-refactor "X"` |
|
|
56
|
-
| "Onde está X?" / "O que usa Y?" / "Como Z é estruturado?" | `/dw-intel "<pergunta>"` |
|
|
57
|
-
| "Reconstrói o índice" / "Refresh do intel" | `/dw-intel --build` |
|
|
58
|
-
| "Contexto pesado" / "Audita uso de tokens" / "Por que o agente está lento?" | `/dw-context-budget` |
|
|
59
|
-
| "Checa instalação dev-workflow" / "Agentes/wrappers estão saudáveis?" | `/dw-harness-audit` |
|
|
60
|
-
| "Audita skills" / "Skills parecem duplicadas ou pesadas" | `/dw-skill-health` |
|
|
61
|
-
| "Redesign dessa UI" / "Audita e entrega novo design" | `/dw-redesign-ui "<target>"` |
|
|
62
|
-
| "Audita dependências" / "Estamos atrasados em pacotes?" | `/dw-secure-audit --plan` |
|
|
63
|
-
| "Scan de vulnerabilidades" / "Check de segurança" | `/dw-secure-audit` |
|
|
64
|
-
| "Analisa esse projeto" / "Gera rules" | `/dw-analyze-project` |
|
|
65
|
-
| "Abre um novo projeto" / "Bootstrap de stack" | `/dw-new-project` |
|
|
66
|
-
| "Dockeriza isso" / "Adiciona docker-compose" | `/dw-dockerize` |
|
|
67
|
-
| "Functional doc" / "Mapeia screens e flows" | `/dw-functional-doc` |
|
|
68
|
-
| "Instala skills Azure" / "Configura MCP do Microsoft docs" / "Adiciona expertise Azure" / "Vou trabalhar com Azure" | `/dw-install-azure-skills` |
|
|
69
|
-
| "Instala skills AWS" / "Configura MCP da AWS" / "Adiciona expertise AWS" / "Vou trabalhar com AWS" | `/dw-install-aws-skills` |
|
|
2
|
+
# dev-workflow — Instruções do agente
|
|
70
3
|
|
|
71
|
-
|
|
4
|
+
Use o menor workflow que atende à intenção e ao risco. Continue o trabalho autorizado até implementar, verificar e corrigir falhas. Instruções do usuário e autorização existente prevalecem sobre padrões do workflow; as permissões da plataforma continuam valendo.
|
|
72
5
|
|
|
73
|
-
##
|
|
6
|
+
## Roteamento
|
|
74
7
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
8
|
+
| Intenção e escopo | Ação |
|
|
9
|
+
|---|---|
|
|
10
|
+
| Explicação, localização de código ou exploração | Inspecione fontes relevantes e responda diretamente. |
|
|
11
|
+
| Mudança pequena, clara e de baixo risco | Implemente diretamente e verifique proporcionalmente. |
|
|
12
|
+
| Bug que exige investigação | `/dw-bugfix`; correção pequena e conhecida pode ficar inline. |
|
|
13
|
+
| Feature que precisa de especificação | `/dw-plan`; em pedido de implementação completa, continue após aprovar as tasks. |
|
|
14
|
+
| Implementação multicomponente até validação | `/dw-autopilot`; aprove o plano de tasks/execução e continue na mesma invocação. |
|
|
15
|
+
| Decisões pendentes de produto ou arquitetura | `/dw-brainstorm`, depois `/dw-plan` quando alinhado. Council somente quando perspectivas diferentes ajudarem a decisão. |
|
|
16
|
+
| Executar tasks aprovadas | `/dw-run`; `/dw-goal` para execução durável. |
|
|
17
|
+
| Retomar trabalho existente | `/dw-resume` ou `/dw-run --resume`; reutilize decisões e evidências salvas. |
|
|
18
|
+
| Pedido explícito de review / QA / commit / PR | `/dw-review` / `/dw-qa` / `/dw-commit` / `/dw-generate-pr`. |
|
|
79
19
|
|
|
80
|
-
|
|
20
|
+
Não inicie outro pipeline dentro de um workflow ativo. Pedido somente de plano ou investigação termina no artefato solicitado. Mais arquivos ou esforço não exigem parada: reorganize dentro do escopo aprovado e pergunte somente sobre escopo novo material, requisitos conflitantes ou decisões ausentes.
|
|
81
21
|
|
|
82
|
-
|
|
22
|
+
Para comandos especializados consulte `.dw/references/command-routing.md` ou `/dw-help`. Não carregue o catálogo completo em trabalho rotineiro.
|
|
83
23
|
|
|
84
|
-
|
|
85
|
-
- Exploração pura: "como isso funciona?", "me mostra X", "explica Y".
|
|
86
|
-
- Preferência estética: "prefiro esse estilo" — aplica, não roda pipeline.
|
|
87
|
-
- Usuário diz explicitamente "faz direto" / "pula autopilot" / "não precisa de PRD" — honre.
|
|
88
|
-
- A conversa já está dentro de um fluxo `dw-*` (você já está executando tasks; não inicie pipeline novo).
|
|
24
|
+
## Planejamento e delegação
|
|
89
25
|
|
|
90
|
-
|
|
26
|
+
Na quebra de tasks, proponha desenvolvimento local ou cruzado e modelo, esforço e agentes por task considerando ambiguidade, dependências, risco e escopo. Leia `.dw/references/execution-contract.md` nessa etapa e ao executar/retomar o plano. A aprovação abrange essas escolhas e fallbacks declarados durante a execução.
|
|
91
27
|
|
|
92
|
-
|
|
28
|
+
Claude pode delegar implementação por `/dw-codex-run`; Codex pode usar `/dw-claude-run`. O parent conduz review, correções e continuidade. Agentes locais herdam o modelo da sessão salvo override aprovado na task. Delegue trabalho independente e delimitado quando melhorar qualidade ou tempo; mantenha trabalho pequeno ou acoplado local. Máximo de 3 workers por fluxo e nunca escritores simultâneos no mesmo worktree.
|
|
93
29
|
|
|
94
|
-
|
|
30
|
+
Leia primeiro arquivos relevantes. Use `.dw/intel/` ou code-explorer quando ajudar em fluxos amplos ou desconhecidos, conferindo o índice contra o código atual. Carregue entrypoints de skills somente para tasks correspondentes e referências somente para o modo escolhido. Subagentes recebem um pacote compacto e retornam evidências e decisões, não logs completos.
|
|
95
31
|
|
|
96
|
-
##
|
|
32
|
+
## Conclusão e limites
|
|
97
33
|
|
|
98
|
-
|
|
34
|
+
Um plano de implementação aprovado continua por implementação, review, QA aplicável e correções. Não pare só porque a primeira implementação ficou pronta ou o runner externo retornou. Reutilize decisões resolvidas na conversa. Preserve trabalho parcial e checkpoints duráveis em interrupções.
|
|
99
35
|
|
|
100
|
-
|
|
36
|
+
Entrega pronta atende aos critérios de aceitação, não tem achado bloqueante pendente e possui evidência válida de verificação. Evidência continua válida enquanto insumos, ambiente e escopo permanecerem equivalentes; outra mensagem não a invalida. Aplique `dw-verify` nos gates de entrega. Não adicione testes para mudanças de baixo impacto apenas para preencher template.
|
|
101
37
|
|
|
102
|
-
|
|
103
|
-
- A tarefa for read-only, paralelizavel e tiver fronteira clara.
|
|
104
|
-
- A tarefa tiver return value compacto: findings, mapa, arquivos alterados, verificacao ou bloqueios.
|
|
105
|
-
- Voce precisar de review independente: seguranca, silent failure, corretude por linguagem ou prontidao de PR.
|
|
38
|
+
Merge, push, publicação e operações destrutivas exigem autorização aplicável; não pergunte novamente quando já autorizado. Prepare e valide o resultado concreto antes de pedir autorização final ausente. Worktree isola mudanças Git, não permissões do sistema operacional.
|
|
106
39
|
|
|
107
|
-
|
|
40
|
+
## Contratos do projeto
|
|
108
41
|
|
|
109
|
-
-
|
|
110
|
-
-
|
|
111
|
-
-
|
|
112
|
-
-
|
|
113
|
-
- A tarefa delegada precisaria spawnar outros subagentes.
|
|
114
|
-
|
|
115
|
-
Limites:
|
|
42
|
+
- Respeite `.dw/constitution.md`; desvios high/critical seguem o processo de ADR definido. Ausência não bloqueia: use defaults não bloqueantes.
|
|
43
|
+
- Planos aprovados precisam de dependências válidas e `tasks-validation.md`; corrija inconsistências internas antes de pedir aprovação.
|
|
44
|
+
- Complete os checks exigidos pelo projeto. Gates de segurança e PR continuam aplicáveis; segredos e achados bloqueantes não podem ser escondidos por nota ou build verde.
|
|
45
|
+
- Execução formal de tasks mantém commits atômicos com escopo e rastreabilidade de requisitos. Edição pequena direta não implica pedido de commit ou PR.
|
|
116
46
|
|
|
117
|
-
|
|
118
|
-
- Output default deve ficar perto do budget do registry, normalmente 900-1200 palavras.
|
|
119
|
-
- Subagentes resumem logs; retornam linhas falhas, paths, comandos, decisoes e riscos, nao transcripts completos.
|
|
120
|
-
- O parent e o unico sintetizador final.
|
|
121
|
-
- O parent passa um input packet, nao historico bruto da conversa. Use `/dw-subtask-start`, `/dw-subtask-complete` e `/dw-subtask-resume` para handoffs locais.
|
|
122
|
-
|
|
123
|
-
Claude-only: prefira named subagents para pesquisa, review, build e QA isolados. Use forks so quando a subtarefa realmente precisar do contexto do parent.
|
|
124
|
-
|
|
125
|
-
Roteamento de agentes:
|
|
126
|
-
|
|
127
|
-
- Use `dw-code-explorer` antes de planejar ou debugar areas desconhecidas.
|
|
128
|
-
- Use `dw-build-fixer` so depois de uma falha real de build/typecheck/lint.
|
|
129
|
-
- Use `dw-code-reviewer`, `dw-security-reviewer` e `dw-silent-failure-hunter` durante `/dw-review`.
|
|
130
|
-
- Use agentes especificos de linguagem quando o modulo estiver instalado e o diff bater com a linguagem.
|
|
47
|
+
## Personalização
|
|
131
48
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
Skills são protocolos compactos primeiro. Leia o `SKILL.md` de entrada e carregue arquivos em `references/`, `assets/`, `rules/` ou `scripts/` só quando o trigger, a tarefa ou o output exigir esse material mais profundo. Se uma skill parecer duplicada, ampla demais ou cara para a tarefa atual, rode `/dw-skill-health`.
|
|
135
|
-
|
|
136
|
-
## Referência de Workflow
|
|
137
|
-
|
|
138
|
-
```
|
|
139
|
-
/dw-autopilot "wish" ────► Primeira invocação planeja: PRD → TechSpec → Tasks → STOP
|
|
140
|
-
/dw-autopilot ────► Segunda invocação retoma: /dw-goal → Commit → PR
|
|
141
|
-
|
|
142
|
-
--- OU passo a passo ---
|
|
143
|
-
|
|
144
|
-
/dw-brainstorm ─► /dw-plan ─► /dw-goal ─► /dw-commit ─► /dw-generate-pr
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
Lista completa e ajuda contextual: `/dw-help`.
|
|
148
|
-
|
|
149
|
-
## Editando esta seção
|
|
150
|
-
|
|
151
|
-
Este bloco vive entre os marcadores `<!-- dev-workflow:start -->` e `<!-- dev-workflow:end -->`. Qualquer coisa que você escrever **fora** dos marcadores em `CLAUDE.md` / `AGENTS.md` é preservada a cada `dev-workflow update`. Tudo **dentro** é regenerado do pacote — seus edits dentro do bloco serão sobrescritos.
|
|
152
|
-
|
|
153
|
-
Para customizar a trigger map permanentemente, copie o conteúdo pra fora dos marcadores (ou pra arquivo separado tipo `.dw/agent-instructions-custom.md`) e edite lá.
|
|
49
|
+
Este bloco fica entre os marcadores `<!-- dev-workflow:start -->` e `<!-- dev-workflow:end -->` e é atualizado pelo pacote. Coloque instruções específicas fora dos marcadores; não duplique o bloco inteiro. Configurações e overrides explícitos do projeto prevalecem no seu escopo.
|
|
154
50
|
<!-- dev-workflow:end -->
|
|
@@ -310,6 +310,8 @@ Documentar os fluxos rastreados com caminhos de arquivo em cada etapa.
|
|
|
310
310
|
|
|
311
311
|
### Passo 5: Detectar Antipatterns (Obrigatório)
|
|
312
312
|
|
|
313
|
+
Para um módulo frontend, leia `dw-ui-discipline/references/frontend-engineering.md` no local das skills instaladas. Use `.dw/templates/frontend-quality-template.md` para incluir controles observados, lacunas e propostas de adoção no `.dw/rules/<module>.md` do módulo. Inspecione scripts/configurações reais e CI; registre checks não executados explicitamente. Preserve a política existente e separe-a das recomendações. Este comando apenas documental não instala ferramentas, altera código/configurações nem ativa novos gates no CI.
|
|
314
|
+
|
|
313
315
|
Verificar a presença de:
|
|
314
316
|
|
|
315
317
|
| Antipattern | Como Detectar |
|