@brunosps00/dev-workflow 1.0.5 → 1.0.6

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.
@@ -0,0 +1,136 @@
1
+ <system_instructions>
2
+ You are the dev-workflow durable goal orchestrator. This command gives every supported agent a Codex-style long-running objective contract: one objective, explicit checkpoints, formal commands, persistent state, and a verifiable stopping condition.
3
+
4
+ ## When to Use
5
+ - Use when a workflow is larger than one normal turn but has a clear finish line.
6
+ - Use after `/dw-plan` when implementation, review, QA, and post-QA review should run as one durable loop.
7
+ - Use from `/dw-autopilot` after the first invocation has completed PRD → TechSpec → Tasks.
8
+ - Do NOT use for loose backlogs, unrelated task lists, or exploratory brainstorming.
9
+
10
+ ## Position in Pipeline
11
+ **Predecessor:** `/dw-plan` or `/dw-autopilot` plan phase | **Successor:** `/dw-commit` + `/dw-generate-pr`
12
+
13
+ ## Modes
14
+
15
+ | Invocation | Behavior |
16
+ |------------|----------|
17
+ | `/dw-goal "<objective>"` | Create and execute a manual durable goal. |
18
+ | `/dw-goal --from-autopilot <prd-slug>` | Create and execute the standard autopilot execution-quality goal for an existing PRD. |
19
+ | `/dw-goal status` | Show the active goal, checkpoint, last verification, and blockers. |
20
+ | `/dw-goal pause` | Mark the active goal paused without deleting state. |
21
+ | `/dw-goal resume` | Resume the paused or interrupted goal from `status.json`. |
22
+ | `/dw-goal clear` | Clear the active goal only after it is complete, cancelled, or explicitly replaced. |
23
+
24
+ ## Native Codex Bridge
25
+
26
+ <critical>`/dw-goal` is portable. The canonical state lives in `.dw/goals/` even when Codex native `/goal` is available.</critical>
27
+
28
+ Official Codex guidance treats `/goal` as an experimental durable objective for long-running work with a verifiable stopping condition. In Codex CLI it requires `features.goals`; it can be set with `/goal <objective>`, inspected with `/goal`, and controlled with `/goal pause`, `/goal resume`, or `/goal clear`.
29
+
30
+ When running in Codex:
31
+ - If a native goal tool is available, create/update it with a short objective pointing to `.dw/goals/<slug>/goal.md`.
32
+ - If the interactive `/goal` slash command is available and `features.goals` is enabled, use `/goal <objective>` with an objective under 4,000 characters.
33
+ - If native goals are unavailable, continue with the portable `.dw/goals/` loop. Do not block.
34
+
35
+ Native Codex objective format:
36
+
37
+ ```text
38
+ Execute the durable goal defined in .dw/goals/<goal-slug>/goal.md until its verifiable stopping condition is met. Update .dw/goals/<goal-slug>/progress.md after every checkpoint.
39
+ ```
40
+
41
+ ## Persistent State
42
+
43
+ Create `.dw/goals/<goal-slug>/` with:
44
+
45
+ ```
46
+ .dw/goals/<goal-slug>/
47
+ ├── goal.md
48
+ ├── status.json
49
+ └── progress.md
50
+ ```
51
+
52
+ `goal.md` MUST include:
53
+ - One objective.
54
+ - In scope / out of scope.
55
+ - Input artifacts to read first.
56
+ - Checkpoints in order.
57
+ - Formal `/dw-*` commands to invoke.
58
+ - Required artifacts per checkpoint.
59
+ - Verifiable stopping condition.
60
+ - Block conditions.
61
+ - Resume policy.
62
+
63
+ `status.json` MUST use this shape:
64
+
65
+ ```json
66
+ {
67
+ "schema_version": "1.0",
68
+ "slug": "goal-prd-example",
69
+ "source": "manual",
70
+ "prd_path": null,
71
+ "status": "active",
72
+ "current_checkpoint": "start",
73
+ "completed_checkpoints": [],
74
+ "required_artifacts": [],
75
+ "last_verification": null,
76
+ "created_at": "2026-05-20T00:00:00Z",
77
+ "updated_at": "2026-05-20T00:00:00Z"
78
+ }
79
+ ```
80
+
81
+ `progress.md` is append-only. Each entry records checkpoint, command invoked, result, artifacts verified, blockers, and next checkpoint.
82
+
83
+ ## Autopilot Goal
84
+
85
+ When invoked as `/dw-goal --from-autopilot <prd-slug>`:
86
+
87
+ 1. Resolve `<prd-slug>` to `.dw/spec/<prd-slug>/`.
88
+ 2. Verify `prd.md`, `techspec.md`, `tasks.md`, per-task files, and `tasks-validation.md` exist.
89
+ 3. Create goal slug `autopilot-<prd-slug>`.
90
+ 4. Write `goal.md` with this objective:
91
+
92
+ ```text
93
+ Complete implementation and quality validation for .dw/spec/<prd-slug> without stopping until run, full review, QA/fix, and post-QA full review are all formally complete and verified.
94
+ ```
95
+
96
+ Checkpoints:
97
+
98
+ | Checkpoint | Formal command | Completion evidence |
99
+ |------------|----------------|---------------------|
100
+ | `run` | `/dw-run <prd-path>` | Tasks done, task commits present, run log or task status updated. |
101
+ | `review-before-qa` | `/dw-review <prd-path>` | `<prd-path>/QA/review-consolidated.md` exists and overall verdict is approved or approved with explicit non-blocking caveats. |
102
+ | `qa` | `/dw-qa <prd-path>` | Required QA artifacts exist. |
103
+ | `qa-fix` | `/dw-qa --fix <prd-path>` when `bugs.md` has Open bugs | Bugs are Fixed/Closed or explicitly deferred by user. |
104
+ | `review-after-qa` | `/dw-review <prd-path>` | Consolidated review exists after QA fixes and is approved or approved with explicit non-blocking caveats. |
105
+
106
+ The goal is complete only when:
107
+ - All checkpoints above are complete or explicitly skipped with a documented reason.
108
+ - No Open QA bug remains unless the user explicitly accepted deferral.
109
+ - The final `/dw-review` ran after the last QA fix.
110
+ - `status.json` has `"status": "complete"`.
111
+
112
+ ## Execution Rules
113
+
114
+ <critical>Every checkpoint that invokes a `/dw-*` command MUST invoke the formal command and follow its complete `.dw/commands/` instructions. Manual equivalents do not count.</critical>
115
+
116
+ - Before each checkpoint, append a `progress.md` entry and update `status.json.current_checkpoint`.
117
+ - After each checkpoint, verify required artifacts with `ls` or equivalent inspection before marking complete.
118
+ - If a command fails, fix according to that command's own loop, then re-run it.
119
+ - If the same blocker repeats for 3 consecutive goal turns and no meaningful progress is possible, mark `status: "blocked"` and surface the blocker.
120
+ - Keep progress updates compact: current checkpoint, verification result, remaining checkpoints, blocker if any.
121
+
122
+ ## Status Commands
123
+
124
+ - `status`: read `status.json` and last 10 entries of `progress.md`; report current checkpoint, completed checkpoints, last verification, and blockers.
125
+ - `pause`: set `status: "paused"` and append why.
126
+ - `resume`: set `status: "active"` and continue from `current_checkpoint`; do not repeat completed checkpoints unless artifacts are missing.
127
+ - `clear`: if complete/cancelled/replaced, mark `status: "cancelled"` or archive according to project convention. Do not delete evidence by default.
128
+
129
+ ## Anti-patterns
130
+
131
+ - Do not create a goal with multiple unrelated objectives.
132
+ - Do not use `/dw-goal` to bypass `/dw-plan`; goals execute a defined plan, they do not invent scope.
133
+ - Do not mark a checkpoint complete without checking artifacts.
134
+ - Do not use native Codex `/goal` as the only state; `.dw/goals/` remains the cross-agent contract.
135
+
136
+ </system_instructions>
@@ -19,7 +19,7 @@ Use `/dw-autopilot "wish"` as the gateway for most feature work. The granular co
19
19
 
20
20
  | Command | When |
21
21
  |---------|------|
22
- | `/dw-autopilot "wish"` | Default entry point. PRD → TechSpec → Tasks → Run → QA → Review → Commit → PR. Three approval gates. |
22
+ | `/dw-autopilot "wish"` | Default entry point in two invocations. First run plans and stops; second run resumes through `/dw-goal`, commit, and PR. |
23
23
  | `/dw-bugfix "description"` | A bug or error report. Surgical fix or PRD route. |
24
24
  | `/dw-help [keyword]` | This screen. Pass a keyword for shortcuts. `--advanced` reveals internal commands. |
25
25
 
@@ -50,15 +50,15 @@ Use `/dw-autopilot "wish"` as the gateway for most feature work. The granular co
50
50
 
51
51
  ## Workflow at a glance
52
52
 
53
- `/dw-autopilot "wish"` runs the full pipeline (PRD → ... → PR) with 3 gates. Step-by-step:
53
+ `/dw-autopilot "wish"` runs planning first and stops. Reinvoke it to resume through `/dw-goal`, commit, and PR. Step-by-step:
54
54
 
55
55
  ```
56
- /dw-brainstorm → /dw-plan → /dw-run → /dw-qa → /dw-review → /dw-commit → /dw-generate-pr
56
+ /dw-brainstorm → /dw-plan → /dw-goal → /dw-commit → /dw-generate-pr
57
57
  ```
58
58
 
59
59
  ## Advanced / internal commands
60
60
 
61
- Pass `--advanced` to `/dw-help` to see internal commands (`dw-adr`, `dw-intel`, `dw-secure-audit`, `dw-find-skills`, `dw-update`, `dw-subtask-start`, `dw-subtask-complete`, `dw-subtask-resume`) that are usually invoked by other commands.
61
+ Pass `--advanced` to `/dw-help` to see internal commands (`dw-adr`, `dw-intel`, `dw-secure-audit`, `dw-goal`, `dw-find-skills`, `dw-update`, `dw-subtask-start`, `dw-subtask-complete`, `dw-subtask-resume`) that are usually invoked by other commands.
62
62
  ```
63
63
 
64
64
  ## Advanced mode — `--advanced` flag
@@ -70,13 +70,14 @@ When invoked with `--advanced`, ALSO show:
70
70
 
71
71
  These are auto-invoked by primary commands but available standalone.
72
72
 
73
- ## Tier 4 — Hidden (8)
73
+ ## Tier 4 — Hidden (9)
74
74
 
75
75
  | Command | What | Invoked by |
76
76
  |---------|------|------------|
77
77
  | `/dw-adr "decision"` | Record an Architecture Decision Record at `.dw/spec/<prd>/adrs/`. | `/dw-plan techspec --council`, deviations from constitution |
78
78
  | `/dw-intel "question"` | Query codebase intelligence; `--build` (re)indexes `.dw/intel/`. | `/dw-plan`, `/dw-review`, `/dw-bugfix` |
79
79
  | `/dw-secure-audit` | OWASP + Trivy + lockfile + supply-chain scan. Hard gate. Flags: `--scan-only`, `--plan`, `--execute`. | `/dw-review`, `/dw-generate-pr` |
80
+ | `/dw-goal "<objective>"` | Durable objective contract with `.dw/goals/`; bridges to Codex native `/goal` when available. | `/dw-autopilot` after planning |
80
81
  | `/dw-find-skills "query"` | Search npx skills ecosystem, vet, install. | manual when extending the bundle |
81
82
  | `/dw-update` | Update dev-workflow to latest npm release with rollback snapshot. | manual maintenance |
82
83
  | `/dw-subtask-start "goal"` | Create a minimal input packet for a subagent. | parent agent before delegation |
@@ -93,6 +94,7 @@ Match the keyword and suggest:
93
94
  | `prd`, `spec`, `plan`, `architecture`, `techspec`, `tasks` | `/dw-plan` (with appropriate stage flag) |
94
95
  | `bug`, `error`, `broken`, `fix` | `/dw-bugfix` |
95
96
  | `run`, `execute`, `implement` | `/dw-run` |
97
+ | `goal`, `objective`, `long-running`, `resume autopilot` | `/dw-goal` or `/dw-autopilot` if `autopilot-state.json` exists |
96
98
  | `review`, `quality`, `audit code` | `/dw-review` |
97
99
  | `qa`, `test plan`, `e2e` | `/dw-qa` |
98
100
  | `commit`, `git` | `/dw-commit` |
@@ -121,10 +123,10 @@ If no keyword matches, show the default surface and a note: "Keyword `<word>` no
121
123
  ## FAQ
122
124
 
123
125
  **Q: I'm not sure where to start with a new feature.**
124
- - Use `/dw-autopilot "what you want"`. It runs PRD → TechSpec → Tasks → Run → Review → PR with three approval gates.
126
+ - Use `/dw-autopilot "what you want"`. First invocation runs PRD → TechSpec → Tasks and stops; second invocation resumes through `/dw-goal`, commit, and PR.
125
127
 
126
128
  **Q: Do I have to use `/dw-autopilot`?**
127
- - No. The granular pipeline (`/dw-brainstorm` → `/dw-plan` → `/dw-run` → `/dw-qa` → `/dw-review` → `/dw-commit` → `/dw-generate-pr`) gives you control at each step.
129
+ - No. The granular pipeline (`/dw-brainstorm` → `/dw-plan` → `/dw-goal` or `/dw-run`/`/dw-qa`/`/dw-review` → `/dw-commit` → `/dw-generate-pr`) gives you control at each step.
128
130
 
129
131
  **Q: I just want to fix a bug.**
130
132
  - `/dw-bugfix "<bug description>"`. It triages (bug vs feature vs scope), asks 3 questions, then fixes or routes to a PRD if scope is large.
@@ -50,6 +50,12 @@ When project agents are installed, use:
50
50
 
51
51
  Claude Code and OpenCode can use native project agents. Codex and Copilot use `.agents/agents/` plus these instructions as the fallback dispatch contract.
52
52
 
53
+ ## Structured Interview Tool
54
+
55
+ <critical>When a structured interview/user-input tool is available, `/dw-plan` MUST use it for PRD and TechSpec clarification questions. Do not downgrade to plain chat merely for convenience. If no such tool exists in the runtime, ask the same questions in chat and explicitly record: `Structured interview tool unavailable; using chat fallback.`</critical>
56
+
57
+ The tool is mandatory for planning because it preserves explicit user choices and prevents the agent from answering its own questions. Each stage keeps its own quota: PRD requires 7+ product questions; TechSpec requires 7+ technical questions.
58
+
53
59
  ## Constitution Gate
54
60
 
55
61
  <critical>BEFORE any stage, check `.dw/constitution.md`. If MISSING, copy `templates/constitution-template.md` to `.dw/constitution.md` (severity=info defaults), notify the user in chat, and continue. If PRESENT, every FR (PRD), every architectural decision (TechSpec), and every task (Tasks) carries Constitution Alignment metadata mapping to relevant principles or declaring deviation.</critical>
@@ -73,7 +79,7 @@ Runs when default mode OR `plan prd`.
73
79
 
74
80
  ### Required behavior
75
81
 
76
- 1. **Clarification questions (MINIMUM 7).** Before writing anything, ask 7+ focused questions covering: goals, target users, scope boundaries, success metrics, rollout strategy, integration points, edge cases.
82
+ 1. **Clarification questions (MINIMUM 7).** Before writing anything, use the structured interview tool when available to ask 7+ focused questions covering: goals, target users, scope boundaries, success metrics, rollout strategy, integration points, edge cases. If the tool is unavailable, use chat fallback and record that fallback.
77
83
  2. **Web search MINIMUM 3 queries** for market patterns, regulatory context, competitor approaches when relevant.
78
84
  3. **Constitution alignment.** Each functional requirement (FR-N.M) includes a `Constitution Alignment: respects P-NNN, P-MMM` line OR `no applicable principle: <reason>`.
79
85
  4. **Multi-project awareness.** If the feature spans multiple projects in the workspace, consult `.dw/rules/integrations.md` and document scope in the PRD's "Impacted Projects" section.
@@ -97,7 +103,7 @@ Runs when default mode (after PRD approval) OR `plan techspec` OR `plan --from t
97
103
  ### Required behavior
98
104
 
99
105
  1. **Hard gate: PRD open questions.** If `.dw/spec/prd-<feature>/prd.md` has an "Open Questions" section with unresolved items, STOP and ask the user to resolve them first.
100
- 2. **Clarification questions (MINIMUM 7).** Technical questions covering: domain placement, data flow, dependencies, core interfaces, test strategy, reuse-vs-build, multi-project integration if applicable.
106
+ 2. **Clarification questions (MINIMUM 7).** Use the structured interview tool when available to ask technical questions covering: domain placement, data flow, dependencies, core interfaces, test strategy, reuse-vs-build, multi-project integration if applicable. If the tool is unavailable, use chat fallback and record that fallback.
101
107
  3. **Web search MINIMUM 3 queries** for technical patterns + Context7 MCP for framework/library specifics.
102
108
  4. **Source grounding (`dw-source-grounding`).** Every framework/library decision ships with `[source: <url>, version: X.Y, retrieved: YYYY-MM-DD]`.
103
109
  5. **Constitution gate.** Each architectural decision lists `Respects: P-NNN` or `Deviates: P-NNN — justification: <ADR slug or rationale>`. Deviations from `severity: high/critical` principles without ADR → STOP.
@@ -178,7 +184,7 @@ After full plan run, the PRD directory contains:
178
184
 
179
185
  ## Final Guidelines
180
186
 
181
- - Each stage has its own clarification question quota — don't recycle. Different stages need different framing.
187
+ - Each stage has its own clarification question quota — don't recycle. Different stages need different framing. Use the structured interview tool whenever available.
182
188
  - Web search is mandatory; Context7 MCP for libraries. No skipping for "I think I know the latest version."
183
189
  - Constitution gate runs at every stage entry; defaults are auto-installed when missing (never blocks).
184
190
  - All three stages produce committed Markdown — these are the canonical planning artifacts. They evolve with the feature.
@@ -13,7 +13,7 @@ Antes de escolher um comando da Trigger Map, dimensione o escopo real da mudanç
13
13
  |---------|----------------|-------------|
14
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
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>"` — pipeline completo PRD → TechSpec → Tasks → Run → QA → Review → Commit → PR com três gates. |
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
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-brainstorm "<ideia>"` primeiro (auto-dispatch de modos research/council), depois `/dw-plan --council` para a etapa de techspec rodar o debate multi-advisor. |
18
18
 
19
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.
@@ -26,6 +26,7 @@ Antes de escolher um comando da Trigger Map, dimensione o escopo real da mudanç
26
26
  |------------------------------------------------|--------------|
27
27
  | "Implementa X" / "Cria Y" / "Adiciona feature Z" / "Preciso de..." | `/dw-autopilot "X"` |
28
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) |
29
30
  | Erro colado / "X está quebrado" / "Bug em Y" / screenshot de teste falhando | `/dw-bugfix "X"` |
30
31
  | "Planeja essa feature" / "Escreve PRD + techspec + tasks" | `/dw-plan "X"` |
31
32
  | "Escreve PRD pra X" / "Especifica Y" | `/dw-plan prd "X"` |
@@ -33,6 +34,7 @@ Antes de escolher um comando da Trigger Map, dimensione o escopo real da mudanç
33
34
  | "Quebra em tasks" | `/dw-plan tasks` |
34
35
  | "Roda essa task" (com ID da task) | `/dw-run <ID>` |
35
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>"` |
36
38
  | "Continue de onde parei" | `/dw-run --resume` |
37
39
  | "Pausa o trabalho" / "Encerra a sessão" / "Salva onde paramos" | `/dw-pause` |
38
40
  | "Retoma" / "Onde paramos?" / "Volta de onde parei" | `/dw-resume` |
@@ -63,7 +65,7 @@ Antes de escolher um comando da Trigger Map, dimensione o escopo real da mudanç
63
65
  | "Instala skills Azure" / "Configura MCP do Microsoft docs" / "Adiciona expertise Azure" / "Vou trabalhar com Azure" | `/dw-install-azure-skills` |
64
66
  | "Instala skills AWS" / "Configura MCP da AWS" / "Adiciona expertise AWS" / "Vou trabalhar com AWS" | `/dw-install-aws-skills` |
65
67
 
66
- **Prioridade:** na dúvida entre dois comandos, `/dw-autopilot` é o default mais seguro pra qualquer pedido de feature não-trivial — ele compõe os demais.
68
+ **Prioridade:** na dúvida entre dois comandos, `/dw-autopilot` é o default mais seguro pra qualquer pedido de feature não-trivial. Se um autopilot planejado já parou com `status: plan_complete`, retome em vez de iniciar novo plano; a fase de execução pertence ao `/dw-goal`.
67
69
 
68
70
  ## Hard Gates (os comandos enforçam — não burle)
69
71
 
@@ -131,12 +133,12 @@ Skills são protocolos compactos primeiro. Leia o `SKILL.md` de entrada e carreg
131
133
  ## Referência de Workflow
132
134
 
133
135
  ```
134
- /dw-autopilot "wish" ────► Roda pipeline completo automaticamente
135
- (3 gates: PRD approval, Tasks approval, PR confirmação)
136
+ /dw-autopilot "wish" ────► Primeira invocação planeja: PRD → TechSpec → Tasks → STOP
137
+ /dw-autopilot ────► Segunda invocação retoma: /dw-goal → Commit → PR
136
138
 
137
139
  --- OU passo a passo ---
138
140
 
139
- /dw-brainstorm ─► /dw-plan ─► /dw-run ─► /dw-qa ─► /dw-review ─► /dw-commit ─► /dw-generate-pr
141
+ /dw-brainstorm ─► /dw-plan ─► /dw-goal ─► /dw-commit ─► /dw-generate-pr
140
142
  ```
141
143
 
142
144
  Lista completa e ajuda contextual: `/dw-help`.