@brunosps00/dev-workflow 1.7.0 → 2.0.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 (67) hide show
  1. package/.claude-plugin/plugin.json +2 -2
  2. package/CHANGELOG.md +201 -0
  3. package/README.md +2 -2
  4. package/lib/agents.js +6 -1
  5. package/lib/init.js +14 -0
  6. package/lib/install-deps.js +15 -0
  7. package/lib/install-open-design.js +39 -0
  8. package/lib/install-state.js +8 -4
  9. package/lib/utils.js +46 -6
  10. package/package.json +3 -2
  11. package/scaffold/agents/core/dw-build-fixer.md +0 -1
  12. package/scaffold/agents/core/dw-code-explorer.md +0 -1
  13. package/scaffold/agents/core/dw-code-reviewer.md +0 -1
  14. package/scaffold/agents/core/dw-planner.md +0 -1
  15. package/scaffold/agents/core/dw-test-author.md +0 -1
  16. package/scaffold/agents/csharp/dw-csharp-reviewer.md +0 -1
  17. package/scaffold/agents/csharp/dw-dotnet-build-fixer.md +0 -1
  18. package/scaffold/agents/frontend/dw-qa-runner.md +0 -1
  19. package/scaffold/agents/python/dw-python-build-fixer.md +0 -1
  20. package/scaffold/agents/python/dw-python-reviewer.md +0 -1
  21. package/scaffold/agents/rust/dw-rust-build-fixer.md +0 -1
  22. package/scaffold/agents/rust/dw-rust-reviewer.md +0 -1
  23. package/scaffold/agents/security/dw-security-reviewer.md +0 -1
  24. package/scaffold/agents/security/dw-silent-failure-hunter.md +0 -1
  25. package/scaffold/agents/typescript/dw-typescript-build-fixer.md +0 -1
  26. package/scaffold/agents/typescript/dw-typescript-reviewer.md +0 -1
  27. package/scaffold/config/routing.json +60 -0
  28. package/scaffold/en/commands/dw-claude-run.md +5 -1
  29. package/scaffold/en/commands/dw-codex-run.md +5 -1
  30. package/scaffold/en/commands/dw-dockerize.md +14 -7
  31. package/scaffold/en/commands/dw-generate-pr.md +13 -0
  32. package/scaffold/en/commands/dw-new-project.md +34 -30
  33. package/scaffold/en/commands/dw-run.md +1 -1
  34. package/scaffold/en/templates/project-onepager.md +16 -14
  35. package/scaffold/en/templates/task-template.md +1 -1
  36. package/scaffold/en/templates/tasks-template.md +7 -5
  37. package/scaffold/pt-br/commands/dw-claude-run.md +5 -1
  38. package/scaffold/pt-br/commands/dw-codex-run.md +5 -1
  39. package/scaffold/pt-br/commands/dw-dockerize.md +14 -7
  40. package/scaffold/pt-br/commands/dw-generate-pr.md +13 -0
  41. package/scaffold/pt-br/commands/dw-new-project.md +34 -30
  42. package/scaffold/pt-br/commands/dw-plan.md +1 -1
  43. package/scaffold/pt-br/commands/dw-run.md +1 -1
  44. package/scaffold/pt-br/templates/project-onepager.md +16 -14
  45. package/scaffold/pt-br/templates/task-template.md +1 -1
  46. package/scaffold/pt-br/templates/tasks-template.md +7 -5
  47. package/scaffold/skills/docker-compose-recipes/SKILL.md +4 -5
  48. package/scaffold/skills/docker-compose-recipes/references/compose-composition.md +6 -6
  49. package/scaffold/skills/docker-compose-recipes/references/env-conventions.md +18 -9
  50. package/scaffold/skills/docker-compose-recipes/references/healthcheck-patterns.md +4 -5
  51. package/scaffold/skills/docker-compose-recipes/references/prod-vs-dev.md +7 -2
  52. package/scaffold/skills/docker-compose-recipes/services/elasticsearch.yml +3 -3
  53. package/scaffold/skills/docker-compose-recipes/services/mailpit.yml +4 -4
  54. package/scaffold/skills/docker-compose-recipes/services/meilisearch.yml +2 -2
  55. package/scaffold/skills/docker-compose-recipes/services/minio.yml +8 -4
  56. package/scaffold/skills/docker-compose-recipes/services/mysql.yml +4 -4
  57. package/scaffold/skills/docker-compose-recipes/services/postgres.yml +2 -2
  58. package/scaffold/skills/docker-compose-recipes/services/rabbitmq.yml +3 -3
  59. package/scaffold/skills/docker-compose-recipes/services/typesense.yml +3 -3
  60. package/scaffold/skills/dw-cli-run/SKILL.md +42 -38
  61. package/scaffold/skills/dw-cli-run/references/dispatch-tuning.md +85 -0
  62. package/scaffold/skills/dw-execute-phase/SKILL.md +4 -2
  63. package/scaffold/skills/dw-execute-phase/agents/executor.md +4 -2
  64. package/scaffold/skills/dw-execute-phase/agents/plan-checker.md +9 -7
  65. package/scaffold/skills/dw-execute-phase/references/atomic-commits.md +12 -8
  66. package/scaffold/skills/dw-execute-phase/references/plan-verification.md +6 -4
  67. package/scaffold/skills/docker-compose-recipes/services/mailhog.yml +0 -23
@@ -0,0 +1,60 @@
1
+ {
2
+ "_note": "Dispatch routing for the CLI runners (/dw-claude-run, /dw-codex-run) via the dw-cli-run skill. Maps a task's Conventional-Commit type to a tier, and a tier to a concrete model + effort per brand. Seeded once on init and NEVER overwritten on update — model availability differs per account, so this file is yours to edit. Verify the model ids against `claude --help` / `codex --help` before trusting them; the shipped values are conservative defaults, not a guarantee that your account has access.",
3
+ "schema_version": "1.0",
4
+
5
+ "brands": {
6
+ "claude": { "detect": "claude --version" },
7
+ "codex": { "detect": "codex --version" }
8
+ },
9
+
10
+ "tiers": {
11
+ "light": {
12
+ "_use": "mechanical, low-ambiguity work; the answer is obvious and the diff is small",
13
+ "claude": { "model": "haiku", "effort": "low" },
14
+ "codex": { "model": "gpt-5.4-mini", "effort": "low" }
15
+ },
16
+ "standard": {
17
+ "_use": "normal feature and fix work",
18
+ "claude": { "model": "sonnet", "effort": "medium" },
19
+ "codex": { "model": "gpt-5.3-codex", "effort": "medium" }
20
+ },
21
+ "heavy": {
22
+ "_use": "architectural, security-sensitive, or wide-blast-radius work",
23
+ "claude": { "model": "opus", "effort": "high" },
24
+ "codex": { "model": "gpt-5.5", "effort": "high" }
25
+ }
26
+ },
27
+
28
+ "by_commit_type": {
29
+ "_note": "The task's type is already declared in tasks.md and in the atomic commit subject — no new inference needed.",
30
+ "chore": "light",
31
+ "docs": "light",
32
+ "style": "light",
33
+ "ci": "light",
34
+ "test": "standard",
35
+ "fix": "standard",
36
+ "feat": "standard",
37
+ "build": "standard",
38
+ "refactor": "standard",
39
+ "perf": "heavy"
40
+ },
41
+
42
+ "escalate_on_surface": {
43
+ "_note": "If the task's fence touches any of these, override the type-derived tier upward. Match against file paths and the task title.",
44
+ "tier": "heavy",
45
+ "patterns": ["auth", "session", "token", "credential", "migration", "payment", "billing", "invoice", "tenant", "crypto", "permission"]
46
+ },
47
+
48
+ "validation": {
49
+ "_note": "The worker never signs off on its own exam. Cross-brand is the default because a second vendor fails differently.",
50
+ "cross_brand": "preferred",
51
+ "degrade": "When only one brand is installed, validate in a SEPARATE dispatch at a different tier — never reuse the executing session.",
52
+ "acceptance_score": 9
53
+ },
54
+
55
+ "defaults": {
56
+ "_note": "Applied to every dispatch unless the prompt names a capability that needs otherwise.",
57
+ "no_mcp": true,
58
+ "read_only_skips_worktree": true
59
+ }
60
+ }
@@ -13,7 +13,11 @@ session**, score the delivery 0–10, escalate on failure, and **STOP for the ga
13
13
  |---|---|
14
14
  | `DISPATCH` | `UUID=$(cat /proc/sys/kernel/random/uuid); cd <WORKTREE> && claude -p --session-id "$UUID" --model <MODEL> --effort <EFFORT> --output-format stream-json --include-partial-messages --verbose --dangerously-skip-permissions "$(cat <PROMPT>)" </dev/null > <AUDIT>/<slug>.log 2>&1` |
15
15
  | `STREAM` | `--output-format stream-json --include-partial-messages --verbose` (`--verbose` is **required** with `stream-json` in `-p` mode) |
16
- | `AUTO` | `--dangerously-skip-permissions` (headless auto-approve; justified because the worktree is isolated). Read-only/analysis: drop it and pass `--permission-mode plan` (or restrict `--allowedTools`). |
16
+ | `MODEL` | `--model <MODEL>` — `opus` · `sonnet` · `haiku` · `fable`, or a full id (`claude-opus-5`) |
17
+ | `EFFORT` | `--effort <EFFORT>` — `low` · `medium` · `high` · `xhigh` · `max` |
18
+ | `AUTO` | `--dangerously-skip-permissions` (headless auto-approve for a **WRITE** dispatch; justified because the worktree is isolated) |
19
+ | `AUTO_READONLY` | `--permission-mode plan` (optionally `--allowedTools <list>`). Never combine with `AUTO`. |
20
+ | `NO_MCP` | `--strict-mcp-config` with no `--mcp-config` → boots zero MCP servers |
17
21
  | `RESUME <id>` | `cd <WORKTREE> && claude --resume "$UUID" -p --effort <EFFORT> --output-format stream-json --include-partial-messages --verbose --dangerously-skip-permissions "$(cat <FOLLOWUP_PROMPT>)" </dev/null >> <AUDIT>/<slug>.log 2>&1` |
18
22
  | `RESUME_LAST` | `claude -c -p …` (continue the most recent conversation in this cwd) |
19
23
  | `SESSION_ID` | **FIXED by you** — you pass `--session-id "$UUID"` on the first run, so the id is known up front. Generate it (`cat /proc/sys/kernel/random/uuid` or `uuidgen`) and write it to `<AUDIT>/<slug>.session` BEFORE/at dispatch. No stream-scraping needed — Claude is the easy case. |
@@ -13,7 +13,11 @@ the delivery 0–10, escalate on failure, and **STOP for the gate**.
13
13
  |---|---|
14
14
  | `DISPATCH` | `cd <WORKTREE> && codex exec --skip-git-repo-check -m <MODEL> --config model_reasoning_effort="<EFFORT>" --dangerously-bypass-approvals-and-sandbox --json -o <AUDIT>/<slug>.last.md "$(cat <PROMPT>)" </dev/null > <AUDIT>/<slug>.log 2>&1` |
15
15
  | `STREAM` | `--json` (JSONL events) |
16
- | `AUTO` | `--dangerously-bypass-approvals-and-sandbox` (no sandbox + no approvals = full access **with network** so the CLI can run the gate; justified because the worktree is isolated). Edits without a network gate: `--sandbox workspace-write --full-auto`. Read-only/analysis: `--sandbox read-only` (drop `--full-auto`). |
16
+ | `MODEL` | `-m <MODEL>` — `gpt-5.5` · `gpt-5.3-codex` · `gpt-5.4` · `gpt-5.3-codex-spark` · `gpt-5.4-mini` |
17
+ | `EFFORT` | `--config model_reasoning_effort="<EFFORT>"` — `low` · `medium` · `high` · `xhigh` |
18
+ | `AUTO` | `--dangerously-bypass-approvals-and-sandbox` (no sandbox + no approvals = full access **with network** so the CLI can run the gate; **WRITE** dispatch only, justified because the worktree is isolated). Edits without a network gate: `--sandbox workspace-write --full-auto`. |
19
+ | `AUTO_READONLY` | `--sandbox read-only` (drop `--full-auto`). Never combine with `AUTO`. |
20
+ | `NO_MCP` | `-c mcp_servers='{}'` → boots zero MCP servers, keeps auth and the rest of `config.toml`. Blunter alternative: `--ignore-user-config` (also drops model defaults — then `MODEL` + `EFFORT` are mandatory). |
17
21
  | `RESUME <id>` | `cd <WORKTREE> && codex exec resume <THREAD_ID> --skip-git-repo-check --dangerously-bypass-approvals-and-sandbox --json "$(cat <FOLLOWUP_PROMPT>)" </dev/null >> <AUDIT>/<slug>.log 2>&1` |
18
22
  | `RESUME_LAST` | `codex exec resume --last …` (filters by cwd = the worktree) |
19
23
  | `SESSION_ID` | Codex has **no flag to fix** the id → **capture** the thread id from the first run's stream: `grep -oE '"thread_id":"[^"]*"' <AUDIT>/<slug>.log \| head -1` (from the `thread.started` event) → write to `<AUDIT>/<slug>.session`. |
@@ -129,10 +129,12 @@ Each option lists final-image-size estimate, attack-surface notes, debug-ability
129
129
 
130
130
  Present the services detected in Phase 0.3 as a checklist. The user can:
131
131
  - **Accept** — include all detected services in `docker-compose.dev.yml`
132
- - **Add** — include additional services they want for dev (e.g., MailHog if SMTP is used in app code, Jaeger if OTel is used)
132
+ - **Add** — include additional services they want for dev (e.g., Mailpit if SMTP is used in app code, Jaeger if OTel is used)
133
133
  - **Remove** — drop a detected service (e.g., they have managed Postgres in dev too)
134
134
 
135
- Always offer MailHog if any email-sending library is detected and no email service is already in dev.
135
+ Always offer Mailpit if any email-sending library is detected and no email service is already in dev.
136
+
137
+ If pgvector is detected in the project, there is no bundled recipe to reach for — it was removed because the image carried CVEs with no upstream fix. Keep whatever image the project already uses, and tell the user plainly that it needs its own review: a rebuilt image, or a managed Postgres with the `vector` extension enabled. Do not substitute an image on the user's behalf.
136
138
 
137
139
  #### 1.4 File tree preview
138
140
 
@@ -163,8 +165,11 @@ Without approval: write report (Phase 3 with `status: PLANNED`) and stop.
163
165
  **`docker-compose.dev.yml`**:
164
166
  - Compose service blocks from `.agents/skills/docker-compose-recipes/services/*.yml` per `references/compose-composition.md`.
165
167
  - Add app service(s) at the end: `build: { context: ., dockerfile: Dockerfile.dev }`, `volumes` for hot reload (bind mount source, anonymous volume for `node_modules`/`__pycache__`), `env_file: .env`, `depends_on` with `condition: service_healthy` per `references/healthcheck-patterns.md`.
168
+ - Preserve each recipe's image tag (do NOT convert any of them to a digest — a digest freezes the base and never picks up a security rebuild), the required credential vars, and the `127.0.0.1` binds. The loopback ports intentionally keep the `apps on host` topology working.
166
169
  - Header comment: `# Generated by /dw-dockerize on YYYY-MM-DD`.
167
170
 
171
+ **`.env.example`**: emit every credential var with no working value (the recipes use `${VAR:?}`, so Compose refuses to start without one). After copying to `.env`, require the user to set unique generated local values before running Compose. Application URLs use `localhost` when apps run on the host and service DNS when they run in Compose.
172
+
168
173
  **`Dockerfile.dev`** (multi-stage NOT required for dev — single stage is fine):
169
174
 
170
175
  | Stack | Shape |
@@ -176,7 +181,7 @@ Without approval: write report (Phase 3 with `status: PLANNED`) and stop.
176
181
 
177
182
  **`.dockerignore`** for dev: exclude `.git`, `node_modules`, `target`, `dist`, `.dw`, `.agents`, `*.md` (except README.md).
178
183
 
179
- **README.md "Local Dev" section** (appended): port table for selected services, default credentials from `.env.example`, the four `dev:*` script commands.
184
+ **README.md "Local Dev" section** (appended): port table for selected services, credential requirements from `.env.example` without working passwords, the four `dev:*` script commands.
180
185
 
181
186
  #### 2.2 `--prod` artifacts
182
187
 
@@ -217,7 +222,8 @@ Key requirements (apply to every language):
217
222
  - `restart: always`.
218
223
  - Internal network. NO public ports except via reverse proxy.
219
224
  - Secrets via `secrets:` block or external manager.
220
- - Drop dev-only services (no MailHog, Mailpit, smtp4dev, LocalStack, MinIO unless explicitly needed in prod).
225
+ - Drop dev-only services (no Mailpit, smtp4dev, LocalStack, MinIO unless explicitly needed in prod).
226
+ - For vector search, use a separately reviewed image or a managed Postgres service with the `vector` extension; this project ships no vetted pgvector image.
221
227
 
222
228
  **`.dockerignore`** for prod: stricter than dev. Exclude tests, `tests/`, `.github/`, `.dw/`, `.agents/`, all markdown except license.
223
229
 
@@ -234,6 +240,7 @@ Read existing `Dockerfile` and compose files. Apply `security-review/infrastruct
234
240
  - Compose: missing healthchecks on services? (flag)
235
241
  - Compose: services missing `restart` policy? (flag)
236
242
  - Compose: bind mounts in prod compose? (flag CRITICAL if `prod` in filename)
243
+ - Compose: any image pinned by digest, or a credential with a working default? (flag CRITICAL — both block base-image rebuilds or ship a usable credential)
237
244
 
238
245
  Apply `dw-review-rigor`: dedup repeated patterns, signal-over-volume on style nits.
239
246
 
@@ -257,7 +264,7 @@ mode: <dev|prod|both|audit|dry-run>
257
264
  languages: [...]
258
265
  frameworks: { web: '...', api: '...' }
259
266
  services_detected: [postgres, redis, ...]
260
- services_added: [mailhog, ...]
267
+ services_added: [mailpit, ...]
261
268
  base_image_strategy: <conservative|balanced|bold>
262
269
  ---
263
270
  ```
@@ -272,7 +279,7 @@ Sections:
272
279
  6. **Files Created** — table with path + bytes + role.
273
280
  7. **Audit Findings** (only `--audit` mode) — table of issues with severity, file:line, recommendation.
274
281
  8. **Next Steps:**
275
- - For `--dev`: `cp .env.example .env` (if missing), `docker compose -f docker-compose.dev.yml up -d`, then smoke test the app.
282
+ - For `--dev`: `cp .env.example .env` (if missing), set every required secret such as `POSTGRES_PASSWORD` to a unique local value, run `docker compose -f docker-compose.dev.yml up -d`, then smoke test the app.
276
283
  - For `--prod`: build the image locally first (`docker build -t <name>:dev .`), run `/dw-secure-audit` on the Dockerfile and compose, then push to registry.
277
284
  - For `--audit`: apply suggested fixes manually or run with `--mode=force-overwrite`.
278
285
  - Always: run `/dw-secure-audit --plan` against the project before promoting the image to production.
@@ -293,7 +300,7 @@ Sections:
293
300
  - <critical>Never silently overwrite. If `Dockerfile`/`docker-compose.*.yml`/`.dockerignore` exists, default to `--audit`.</critical>
294
301
  - <critical>Prod images NEVER include secrets, dev SDK tooling, source code that wasn't compiled, or test fixtures.</critical>
295
302
  - <critical>Prod images ALWAYS run as a non-root user.</critical>
296
- - <critical>Prod compose files NEVER include MailHog, Mailpit, smtp4dev, LocalStack, or development-only services.</critical>
303
+ - <critical>Prod compose files NEVER include Mailpit, smtp4dev, LocalStack, or development-only services.</critical>
297
304
  - <critical>If `--audit` finds CRITICAL severity issues (secrets in ENV, root user, public ports on data tier), the report's Next Steps must list the fix as REQUIRED before deploy.</critical>
298
305
  - Do NOT use `:latest` tags anywhere.
299
306
  - Do NOT exec compose commands from this command — produce files, the user runs `docker compose up`.
@@ -109,6 +109,19 @@ Build the body following the template below, filling in with collected informati
109
109
 
110
110
  3. **Instruct the user** to paste the body (Ctrl+V) in the description field
111
111
 
112
+ ### 6. Record the PR back into the spec
113
+
114
+ The PR URL only exists after the user clicks "Create". Once it does, write it back — otherwise nothing on the `.dw/` side ever records which PR delivered the work, and the trail ends at the branch.
115
+
116
+ ```bash
117
+ # Fast path: resolves once the PR exists. Needs the GitHub CLI; skip silently if absent.
118
+ gh pr view --json url -q .url 2>/dev/null
119
+ ```
120
+
121
+ - If a URL resolves, append it to the PRD's `## Related` section as `- PR: <url>`.
122
+ - If `gh` is unavailable or the PR isn't created yet, print the exact line for the user to paste and move on. **Never block the command on this** — it is a record, not a gate.
123
+ - For bugfix branches, append the same line to `.dw/bugfixes/<NNN-slug>/SUMMARY.md` under `## Related` instead.
124
+
112
125
  ## PR Template (copy to clipboard)
113
126
 
114
127
  ```markdown
@@ -1,17 +1,17 @@
1
1
  <system_instructions>
2
- You are a workspace bootstrap lead for the dev-workflow ecosystem. Your job is to take an empty (or near-empty) directory, run a Socratic stack interview, and produce a working monorepo or single-app project with: (1) the right framework scaffolds via official `create-*` tools, (2) a `docker-compose.dev.yml` covering every selected dev dependency (db, cache, queue, email, storage, search, observability, proxy), (3) `.env.example`, scripts, `.gitignore`, `.dockerignore`, GitHub Action, README, and (4) a seeded `.dw/rules/index.md`.
2
+ You are a workspace bootstrap lead for the dev-workflow ecosystem. Your job is to take an empty, near-empty, or docs-first directory (documentation without application code), run a Socratic stack interview, and produce a working monorepo or single-app project with: (1) the right framework scaffolds via official `create-*` tools, (2) a `docker-compose.dev.yml` covering every selected dev dependency (db, cache, queue, email, storage, search, observability, proxy), (3) `.env.example`, scripts, `.gitignore`, `.dockerignore`, GitHub Action, README, and (4) a seeded `.dw/rules/index.md`.
3
3
 
4
4
  <critical>This command MUST run AFTER `npx dev-workflow init` has populated `.dw/`. If `.dw/commands/` does not exist in the target directory, abort with: "Run `npx @brunosps00/dev-workflow init` first, then re-invoke /dw-new-project."</critical>
5
5
  <critical>NEVER touch files outside the new project's directory. The interview captures `{{TARGET_DIR}}`; all writes are scoped under it.</critical>
6
6
  <critical>Phase 3 (execution) runs ONLY after the user explicitly approves the plan presented in Phase 2. No flag bypass.</critical>
7
- <critical>MailHog is the DEFAULT for email-in-dev. The user must explicitly opt out before any other SMTP target is wired into dev.</critical>
7
+ <critical>Mailpit is the DEFAULT for email-in-dev. The user must explicitly opt out before any other SMTP target is wired into dev.</critical>
8
8
 
9
9
  ## When to Use
10
10
 
11
- - Starting a new project from an empty directory and you want the dev-workflow conventions, containerized infra, and CI scaffolding from day one
11
+ - Starting a new project from an empty or docs-first directory and you want the dev-workflow conventions, containerized infra, and CI scaffolding from day one
12
12
  - Replacing manual `pnpm create next-app && create vite ...` ceremony with a guided interview that captures the full dev environment
13
13
  - Spinning up a learning sandbox where you want a realistic stack (db + cache + email + observability) without 30 minutes of YAML
14
- - NOT for adding services to an existing project — use `/dw-dockerize --audit` for that
14
+ - NOT for adding services to a project that already has manifests or application code — use `/dw-dockerize --audit`
15
15
  - NOT for adding a new app inside an existing monorepo — that needs a different command (planned for a future release)
16
16
  - NOT a replacement for `/dw-plan prd` — this generates the workspace, not the product spec
17
17
 
@@ -52,7 +52,7 @@ Execute phases in order. Phase 3 runs ONLY after user approval at the end of Pha
52
52
  1. Verify `.dw/commands/` exists in `{{TARGET_DIR}}`. If not, abort with the message above.
53
53
  2. Verify Docker is available: run `docker --version` and `docker compose version` (or `docker-compose --version`). If either fails, warn the user and point to `npx @brunosps00/dev-workflow install-deps`. Do NOT abort — the user may want a `--dry-run` plan even without Docker.
54
54
  3. Capture `{{PROJECT_NAME}}` (default: kebab-case of CWD basename) and confirm `{{TARGET_DIR}}`.
55
- 4. Confirm the target directory is empty or contains only `.dw/`, `.git/`, `.agents/`, `.claude/`, `.opencode/`. If other files exist, list them and ask whether to proceed (anything else risks clobbering user code).
55
+ 4. Classify the target directory as `empty`, `workflow-only`, `docs-first`, or `existing-app`. A docs-first directory may contain documentation, prototypes, assets, and README files, but no application manifests or source directories. List every path that will be preserved and ask for confirmation. If it is an existing app, abort and point to `/dw-dockerize --audit`; never overwrite existing code.
56
56
 
57
57
  Emit a VERIFICATION REPORT for Phase 0 (Docker version captured, target dir state).
58
58
 
@@ -68,21 +68,21 @@ Use `AskUserQuestion` when available; otherwise plain numbered prompts. Ask in *
68
68
  2. **Language(s)**: TypeScript/JavaScript, Python, C#, Rust (per app)
69
69
  3. **Framework per layer** (curated list — refuse anything outside):
70
70
  - **Frontend**: Next.js (app router), Vite + React (TS template)
71
- - **Backend**: FastAPI (Python), ASP.NET Core minimal API (C#), Axum (Rust), Fastify (Node TS)
72
- - **Fullstack** (single bundle): T3 stack (Next.js + tRPC + Prisma + NextAuth), or Next.js front + FastAPI back (separate apps in monorepo)
71
+ - **Backend**: NestJS or Fastify (Node TS), FastAPI (Python), ASP.NET Core minimal API (C#), Axum (Rust)
72
+ - **Fullstack**: T3 stack (single bundle), Next.js + NestJS, or Next.js + FastAPI (separate apps in a monorepo)
73
73
  4. **Package manager** (NO default — ask explicitly):
74
74
  - For Node: npm / pnpm / yarn
75
75
  - For Python: poetry / uv / pip + venv
76
76
  - For .NET: dotnet (built-in)
77
77
  - For Rust: cargo (built-in)
78
- 5. **If fullstack** — monorepo orchestrator (NO default — ask explicitly): pnpm workspaces, npm workspaces, Turborepo, Nx
78
+ 5. **If fullstack** — workspace + task runner (NO default — ask explicitly): package-manager workspaces with native scripts, Turborepo, or Nx. Record combinations such as `pnpm workspaces + Turborepo`.
79
79
 
80
80
  #### Layer B — Infra (only ask what fits the shape)
81
81
 
82
- 6. **Database**: Postgres / MySQL / SQLite (file, no service) / MongoDB (out of scope for compose recipes — note and skip if chosen) / none
82
+ 6. **Database**: Postgres / MySQL / SQLite (file, no service) / MongoDB (out of scope for compose recipes — note and skip if chosen) / none. There is no bundled pgvector recipe: the image carried unfixed upstream CVEs and no bundled artifact could clear them. If the project needs vector search, note it and let the user pick a separately reviewed image or a managed Postgres with the extension enabled.
83
83
  7. **Cache**: Redis / Memcached / none
84
- 8. **Queue / message broker**: BullMQ (Node only), Celery (Python only), RabbitMQ (any), LocalStack SQS (any), none. If chosen, also ask whether the project will have async workers.
85
- 9. **Email — dev capture** (default: **MailHog**, ask only if user wants to override): MailHog / Mailpit / smtp4dev / skip
84
+ 8. **Queue / message broker**: pg-boss (Node + Postgres, no extra service), BullMQ (Node + Redis), Celery (Python only), RabbitMQ (any), LocalStack SQS (any), none. If chosen, also ask whether the project will have async workers.
85
+ 9. **Email — dev capture** (default: **Mailpit**, ask only if user wants to override): Mailpit / smtp4dev / skip
86
86
  10. **Email — prod target** (only ask if user wants email at all): SMTP relay / SendGrid / Resend / Postmark / SES / skip
87
87
  11. **Object storage**: S3 (real, no service in compose) / MinIO (dev) / GCS (no service) / none
88
88
  12. **Search**: Meilisearch / Typesense / Elasticsearch / none
@@ -93,7 +93,8 @@ Use `AskUserQuestion` when available; otherwise plain numbered prompts. Ask in *
93
93
  #### Layer C — Tooling
94
94
 
95
95
  16. **Auth** (only ask if applicable to chosen stack):
96
- - Next.js: NextAuth / Lucia / Clerk / custom JWT / none
96
+ - Next.js: Auth.js / generic OIDC / Clerk / custom JWT / none
97
+ - NestJS: generic OIDC / Passport JWT / custom auth / none
97
98
  - FastAPI: fastapi-users / authlib / custom JWT / none
98
99
  - ASP.NET: built-in Identity / IdentityServer / custom JWT / none
99
100
  - Axum: tower-cookies + jsonwebtoken / custom / none
@@ -102,7 +103,8 @@ Use `AskUserQuestion` when available; otherwise plain numbered prompts. Ask in *
102
103
  - Python: Ruff + Black / Ruff only
103
104
  - C#: dotnet format
104
105
  - Rust: rustfmt + clippy (default)
105
- 18. **CI**: GitHub Actions (always seed; user can opt out)
106
+ 18. **Dev topology**: apps on host + infrastructure in Compose / everything in Compose. For Node monorepos, recommend apps on host when fast hot reload is the priority.
107
+ 19. **CI**: GitHub Actions (always seed; user can opt out)
106
108
 
107
109
  Save all answers in memory for Phase 2.
108
110
 
@@ -110,7 +112,7 @@ Save all answers in memory for Phase 2.
110
112
 
111
113
  ### Phase 2 — One-Pager + Plan + Approval Gate
112
114
 
113
- 1. Render `.dw/spec/projects/{{PROJECT_NAME}}.md` from `.dw/templates/project-onepager.md`. Fill every section: shape, languages, frameworks, services table (name + port + default credentials), architecture diagram (ASCII), generated-files list, open questions.
115
+ 1. Render `.dw/spec/projects/{{PROJECT_NAME}}.md` from `.dw/templates/project-onepager.md`. Fill every section: shape, languages, frameworks, services table (name + port + credential requirements, never a working password), architecture diagram (ASCII), generated-files list, open questions.
114
116
  2. Build a plan:
115
117
  - Commands to run (in order, with arguments)
116
118
  - Files to create (with paths under `{{TARGET_DIR}}`)
@@ -133,6 +135,7 @@ Run in this order. Each step emits its own mini-VERIFICATION block.
133
135
  | Next.js | `pnpm create next-app@latest <dir> --ts --tailwind --eslint --app --import-alias '@/*' --use-pnpm --no-git` |
134
136
  | Vite + React | `pnpm create vite@latest <dir> --template react-ts` |
135
137
  | T3 | `pnpm dlx create-t3-app@latest <dir> --noGit --CI --tailwind --trpc --prisma --nextAuth --appRouter` |
138
+ | NestJS | `pnpm dlx @nestjs/cli@latest new <dir> --package-manager pnpm --skip-git --strict` |
136
139
  | Fastify | `pnpm create fastify@latest <dir>` then trim interactive prompts; if no non-interactive flag works, generate the structure inline (`src/server.ts` + `src/routes/` + `package.json`) |
137
140
  | FastAPI | NO official `create-*`. Generate inline: `pyproject.toml` (with chosen package manager), `app/{routers,models,schemas,deps}/`, `app/main.py`, `tests/` skeleton |
138
141
  | ASP.NET Core | `dotnet new webapi -n <name> --use-minimal-apis --auth None` (use `--auth Individual` if Identity was chosen) |
@@ -142,12 +145,12 @@ Adjust the package manager flag per the user's choice (e.g., `--use-npm`, `--use
142
145
 
143
146
  For **fullstack-T3**: that's it for app code (T3 ships everything in one tree).
144
147
 
145
- For **fullstack-NextJS+FastAPI**: run two scaffolds, then move them into `apps/web/` and `apps/api/`.
148
+ For **fullstack-NextJS+NestJS** or **fullstack-NextJS+FastAPI**: scaffold directly into `apps/web/` and `apps/api/` without moving or deleting pre-existing documentation.
146
149
 
147
150
  #### 3.2 Compose monorepo (fullstack only)
148
151
 
149
152
  If fullstack:
150
- 1. Move scaffolded apps under `apps/<name>/`.
153
+ 1. If an app was scaffolded outside its final workspace path, move it under `apps/<name>/`. Apps scaffolded directly into `apps/web/` or `apps/api/` are already in place and must not be moved again.
151
154
  2. Create `pnpm-workspace.yaml` (or equivalent), root `package.json` with workspace scripts, root `tsconfig.base.json` if shared TS config.
152
155
  3. If user picked Turborepo: add `turbo.json` with `dev`, `build`, `lint`, `test` pipelines.
153
156
  4. If user picked Nx: run `pnpm dlx nx@latest init` after the apps are in place; integrate them as Nx projects.
@@ -159,12 +162,13 @@ If fullstack:
159
162
  - Concatenate selected service blocks under `services:`.
160
163
  - Aggregate named volumes under `volumes:`.
161
164
  - Resolve port collisions if any.
162
- - Add the app service(s) at the end (build context = `apps/<name>` or root, Dockerfile.dev, env_file, volumes, depends_on with `condition: service_healthy` per `references/healthcheck-patterns.md`).
165
+ - For `everything in Compose`, add the app service(s) at the end (build context = `apps/<name>` or root, Dockerfile.dev, env_file, volumes, depends_on with `condition: service_healthy`). For `apps on host`, compose infrastructure only and use `localhost` endpoints in app-facing environment variables.
166
+ - Preserve each recipe's image tag (do NOT convert any of them to a digest — a digest freezes the base image and never picks up a security rebuild), the required credential vars, and the `127.0.0.1` port binds. Those loopback mappings intentionally support `apps on host`; do not remove them from local dev.
163
167
  3. Add a header comment: `# Generated by /dw-new-project on YYYY-MM-DD`.
164
168
 
165
169
  #### 3.4 Generate `.env.example`
166
170
 
167
- Consolidate every env var referenced by selected services (per `references/env-conventions.md`). Group by service. Always include the application-side derived URLs (`DATABASE_URL`, `REDIS_URL`, `AMQP_URL`, `SMTP_HOST`/`SMTP_PORT`, `AWS_ENDPOINT_URL`, etc.).
171
+ Consolidate every env var referenced by selected services (per `references/env-conventions.md`). Group by service. Always include the application-side derived URLs (`DATABASE_URL`, `REDIS_URL`, `AMQP_URL`, `SMTP_HOST`/`SMTP_PORT`, `AWS_ENDPOINT_URL`, etc.). Every credential var is emitted empty in `.env.example` (the recipes use `${VAR:?}`, so Compose refuses to start without a real value). Require the user to set unique generated values in the gitignored `.env` before running Compose. Never emit a reusable password.
168
172
 
169
173
  #### 3.5 Generate scripts
170
174
 
@@ -214,7 +218,7 @@ Minimal scaffold:
214
218
  | Database | <db or n/a> |
215
219
  | Cache | <cache or n/a> |
216
220
  | Queue | <queue or n/a> |
217
- | Email (dev) | <mailhog|mailpit|smtp4dev|none> |
221
+ | Email (dev) | <mailpit|smtp4dev|none> |
218
222
  | Search | <search or n/a> |
219
223
  | Observability | <observability or n/a> |
220
224
  | Reverse proxy | <traefik|none> |
@@ -225,12 +229,12 @@ Minimal scaffold:
225
229
 
226
230
  ## Services in docker-compose.dev.yml
227
231
 
228
- (table of selected services with ports and default credentials)
232
+ (table of selected services with ports and credential requirements; never include a working password)
229
233
 
230
234
  ## Conventions
231
235
 
232
236
  - See `.dw/rules/<module>.md` after `/dw-analyze-project` runs.
233
- - Email-in-dev uses MailHog by default; the app NEVER sends real mail in dev.
237
+ - Email-in-dev uses Mailpit by default; the app NEVER sends real mail in dev.
234
238
  - All env vars live in `.env` (gitignored); `.env.example` is the template.
235
239
  ```
236
240
 
@@ -238,8 +242,8 @@ Minimal scaffold:
238
242
 
239
243
  Generate a starter README with:
240
244
  - Project name + 1-line purpose
241
- - Quick Start (`cp .env.example .env && pnpm install && pnpm dev:up`)
242
- - Local Dev (port table for selected services + UI URLs + default credentials)
245
+ - Quick Start (`cp .env.example .env`, set every required secret to a unique local value, then `pnpm install && pnpm dev:up`)
246
+ - Local Dev (port table for selected services + UI URLs + credential requirements; never publish a working password)
243
247
  - Architecture diagram (ASCII from the one-pager)
244
248
  - Project layout (tree of top-level dirs)
245
249
  - Dev-workflow integration (mentions `/dw-plan prd`, `/dw-run`, `/dw-qa`, `/dw-secure-audit --plan`, `/dw-secure-audit`)
@@ -273,7 +277,7 @@ date: YYYY-MM-DD
273
277
  shape: <frontend|backend|fullstack>
274
278
  languages: [typescript, python, ...]
275
279
  frameworks: { web: '...', api: '...' }
276
- services: [postgres, redis, mailhog, ...]
280
+ services: [postgres, mailpit, minio, ...]
277
281
  package_manager: <pnpm|npm|yarn|poetry|uv|cargo|dotnet>
278
282
  monorepo: <pnpm-workspaces|turborepo|nx|none>
279
283
  ---
@@ -296,13 +300,13 @@ monorepo: <pnpm-workspaces|turborepo|nx|none>
296
300
  | ... | ... | ... |
297
301
 
298
302
  ## Services Composed
299
- <table of services with port + UI URL + default credentials, sourced from .agents/skills/docker-compose-recipes/>
303
+ <table of services with port + UI URL + credential requirements, sourced from .agents/skills/docker-compose-recipes/>
300
304
 
301
305
  ## Next Steps
302
- 1. `cp .env.example .env` and review credentials.
306
+ 1. `cp .env.example .env`, generate unique local secrets, and set every required value such as `POSTGRES_PASSWORD`.
303
307
  2. `pnpm install` (or your chosen package manager).
304
308
  3. `pnpm dev:up` to bring up all services. Wait for healthchecks.
305
- 4. Open MailHog UI at http://localhost:8025 to confirm email capture is wired.
309
+ 4. Open Mailpit UI at http://localhost:8025 to confirm email capture is wired.
306
310
  5. `/dw-plan prd` to draft the first feature.
307
311
  6. After your first substantial commit, run `/dw-analyze-project` to enrich `.dw/rules/`.
308
312
  ```
@@ -320,10 +324,10 @@ monorepo: <pnpm-workspaces|turborepo|nx|none>
320
324
 
321
325
  - <critical>NEVER bypass the Phase 2 approval gate. If invoked in a non-interactive context, abort with: "/dw-new-project requires an interactive approval; rerun with --dry-run to plan-only."</critical>
322
326
  - <critical>NEVER run `create-*` tools outside `{{TARGET_DIR}}`. Each command's CWD is the target dir.</critical>
323
- - <critical>If MailHog/Mailpit/smtp4dev was selected, NEVER also wire a real SMTP into dev. The dev compose ALWAYS captures.</critical>
327
+ - <critical>If Mailpit/smtp4dev was selected, NEVER also wire a real SMTP into dev. The dev compose ALWAYS captures.</critical>
324
328
  - <critical>If a `create-*` tool fails, STOP execution. Do not skip ahead to compose generation — partial scaffolds confuse later commands.</critical>
325
329
  - Do NOT pin Node/Python/.NET/Rust SDK versions inside the project unless the user asks; rely on `package.json` engines / `pyproject.toml` / `global.json` / `rust-toolchain.toml` to express intent without forcing.
326
- - Do NOT bake secrets into any generated file. `.env.example` has dev defaults only; real values live in untracked `.env`.
330
+ - Do NOT bake secrets into any generated file. `.env.example` has non-secret dev defaults and empty required secret keys; real values live in untracked `.env`.
327
331
 
328
332
  ## Error Handling
329
333
 
@@ -332,7 +336,7 @@ monorepo: <pnpm-workspaces|turborepo|nx|none>
332
336
  - User picks MongoDB → note "MongoDB recipe not bundled in v0.8.0; we'll add app dependencies but you'll need to wire the service manually". Continue.
333
337
  - User picks Caddy → same: note as not in bundled recipes; continue without compose service.
334
338
  - Port already bound on host → suggest the override env var and continue; do not pick a different port silently.
335
- - Working tree contains files other than the allowed set → list them and ask explicitly before proceeding.
339
+ - Docs-first working tree → preserve every listed path and write only to approved new paths. Existing app → abort and point to `/dw-dockerize --audit`.
336
340
 
337
341
  ## Integration With Other dw-* Commands
338
342
 
@@ -75,7 +75,7 @@ When available under `./.agents/skills/`, these skills are invoked per task:
75
75
  - Atomic commit message: `feat(<scope>): <task title> (#<task-id>)`.
76
76
  - Reference the FRs covered.
77
77
  - One task = one commit (unless the task explicitly has subtask milestones that earn separate commits).
78
- 6. **Update tasks.md:** mark this task as `Done` with the commit SHA.
78
+ 6. **Update tasks.md:** set this task's `Status` to `Done` and write the short SHA (`git rev-parse --short HEAD`) into its `Commit` column. This is the only record linking a task to its diff — do not skip it.
79
79
  7. **Report:** what was done, what tests were added, what was validated.
80
80
 
81
81
  ### STOP CONDITIONS
@@ -23,33 +23,35 @@ services: []
23
23
  |-------|--------|-----------|
24
24
  | Shape | frontend / backend / fullstack | [why this shape — single product surface, API for partners, etc.] |
25
25
  | Frontend | Next.js / Vite+React / n/a | [why this framework — SSR needs, SPA simplicity, etc.] |
26
- | Backend | FastAPI / ASP.NET Core minimal / Axum / Fastify / n/a | [why this framework — team expertise, ecosystem, latency targets] |
27
- | Database | Postgres / MySQL / SQLite / MongoDB / none | [why this DB — relational needs, JSON-heavy, transactional, etc.] |
26
+ | Backend | NestJS / Fastify / FastAPI / ASP.NET Core minimal / Axum / n/a | [why this framework — team expertise, ecosystem, latency targets] |
27
+ | Database | Postgres / MySQL / SQLite / MongoDB / none | [why this DB — relational, transactional needs, etc. Vector search has no bundled recipe; name the reviewed image or managed service if the project needs it] |
28
28
  | Cache | Redis / Memcached / none | [why or why not] |
29
- | Queue | BullMQ / Celery / RabbitMQ / LocalStack SQS / none | [why or why not + sync vs async workers] |
30
- | Email — dev | MailHog (default) / Mailpit / smtp4dev / none | [usually MailHog — capture only, never sends real mail] |
29
+ | Queue | pg-boss / BullMQ / Celery / RabbitMQ / LocalStack SQS / none | [why or why not + sync vs async workers] |
30
+ | Email — dev | Mailpit (default) / smtp4dev / none | [usually Mailpit — capture only, never sends real mail] |
31
31
  | Email — prod | SMTP / SendGrid / Resend / Postmark / SES / none | [why this provider — volume, deliverability, cost] |
32
32
  | Object storage | S3 / MinIO (dev) / GCS / none | [why or why not] |
33
33
  | Search | Meilisearch / Typesense / Elasticsearch / none | [why this engine — features, scale, simplicity] |
34
34
  | Observability | Sentry / OTel + Jaeger / none | [why this approach — error tracking only, full tracing, etc.] |
35
35
  | Reverse proxy | Traefik / Caddy / none | [usually only needed for multi-host dev or prod] |
36
- | Auth | NextAuth / Lucia / Clerk / fastapi-users / dotnet Identity / custom JWT / none | [why this approach — social login needs, B2B, etc.] |
36
+ | Auth | Auth.js / generic OIDC / Clerk / fastapi-users / dotnet Identity / custom JWT / none | [why this approach — social login needs, B2B, etc.] |
37
37
  | Linter / formatter | Biome / ESLint+Prettier / Ruff+Black / dotnet format / cargo fmt+clippy | [team preference] |
38
38
  | Package manager | pnpm / npm / yarn / poetry / uv / cargo / dotnet | [team preference] |
39
- | Monorepo orchestrator | pnpm workspaces / npm workspaces / Turborepo / Nx / n/a | [only for fullstack — caching/build needs] |
39
+ | Workspace + task runner | pnpm workspaces + Turborepo / npm workspaces / Nx / n/a | [only for fullstack — caching/build needs] |
40
+ | Dev topology | apps on host / everything in Compose | [hot reload versus environment parity] |
40
41
  | CI | GitHub Actions / none | [usually GitHub Actions; opt out only for non-public repos] |
41
42
 
42
43
  ## Services & Infra
43
44
 
44
45
  [Generated services from the docker-compose-recipes skill. Filled by /dw-new-project.]
45
46
 
46
- | Service | Port (host) | UI | Default credentials |
47
- |---------|-------------|----|--------------------|
48
- | postgres | 5432 | — | POSTGRES_USER=app, POSTGRES_PASSWORD=app, POSTGRES_DB=app |
47
+ | Service | Port (host) | UI | Credentials |
48
+ |---------|-------------|----|-------------|
49
+ | postgres | 127.0.0.1:5432 | — | POSTGRES_USER=app, POSTGRES_PASSWORD required in `.env` (no default), POSTGRES_DB=app |
49
50
  | redis | 6379 | — | (no auth in dev) |
50
- | mailhog | 1025 (smtp), 8025 (UI) | http://localhost:8025 | (no auth) |
51
+ | mailpit | 1025 (smtp), 8025 (UI) | http://localhost:8025 | (no auth) |
51
52
  | ... | ... | ... | ... |
52
53
 
54
+
53
55
  ## Architecture Diagram
54
56
 
55
57
  ```
@@ -59,12 +61,12 @@ services: []
59
61
  [ Browser ] -> [ Next.js (apps/web) ]
60
62
 
61
63
  # Fullstack
62
- [ Browser ] -> [ Next.js (apps/web) ] -> [ FastAPI (apps/api) ] -> [ Postgres ]
64
+ [ Browser ] -> [ Next.js (apps/web) ] -> [ NestJS (apps/api) ] -> [ Postgres ]
63
65
  |-> [ Redis ]
64
- |-> [ MailHog ]
66
+ |-> [ Mailpit ]
65
67
 
66
68
  # With observability
67
- ... -> [ FastAPI ] -> { OTLP } -> [ Jaeger ]
69
+ ... -> [ NestJS ] -> { OTLP } -> [ Jaeger ]
68
70
  ```
69
71
 
70
72
  ## Generated Files
@@ -75,7 +77,7 @@ services: []
75
77
  {{TARGET_DIR}}/
76
78
  ├── apps/
77
79
  │ ├── web/ (created by `pnpm create next-app`)
78
- │ └── api/ (inline scaffold — FastAPI)
80
+ │ └── api/ (created by `pnpm dlx @nestjs/cli` or selected scaffold)
79
81
  ├── packages/
80
82
  │ └── shared/ (created by /dw-new-project)
81
83
  ├── docker-compose.dev.yml (composed from .agents/skills/docker-compose-recipes/)
@@ -12,7 +12,7 @@ status: pending
12
12
 
13
13
  [Brief task description]
14
14
 
15
- **Functional Requirements covered**: FR[X.Y], FR[X.Z] (maximum 2 per task)
15
+ **Functional Requirements covered**: FR-X.Y, FR-X.Z (maximum 2 per task)
16
16
 
17
17
  <requirements>
18
18
  [List of mandatory requirements]
@@ -19,11 +19,13 @@ feat/prd-[feature-name]
19
19
 
20
20
  ## Tasks
21
21
 
22
- | Task | Description | FRs | Status |
23
- |------|-------------|-----|--------|
24
- | 1.0 | [Title] | FR1.1, FR1.2 | Pending |
25
- | 2.0 | [Title] | FR2.1 | Pending |
26
- | 3.0 | [Title] | FR3.1, FR3.2 | Pending |
22
+ | Task | Description | FRs | Status | Commit |
23
+ |------|-------------|-----|--------|--------|
24
+ | 1.0 | [Title] | FR-1.1, FR-1.2 | Pending | — |
25
+ | 2.0 | [Title] | FR-2.1 | Pending | — |
26
+ | 3.0 | [Title] | FR-3.1, FR-3.2 | Pending | — |
27
+
28
+ `Commit` holds the short SHA written back by `/dw-run` when the task closes (step 6). It is what makes a task's diff findable later — leave `—` until the task commits.
27
29
 
28
30
  ## Progress
29
31
 
@@ -13,7 +13,11 @@ para implementar um prompt/spec ja preparado, captura a execucao inteira num log
13
13
  |---|---|
14
14
  | `DISPATCH` | `UUID=$(cat /proc/sys/kernel/random/uuid); cd <WORKTREE> && claude -p --session-id "$UUID" --model <MODEL> --effort <EFFORT> --output-format stream-json --include-partial-messages --verbose --dangerously-skip-permissions "$(cat <PROMPT>)" </dev/null > <AUDIT>/<slug>.log 2>&1` |
15
15
  | `STREAM` | `--output-format stream-json --include-partial-messages --verbose` (`--verbose` e **obrigatorio** com `stream-json` no modo `-p`) |
16
- | `AUTO` | `--dangerously-skip-permissions` (auto-aprovacao headless; justificavel porque a worktree e isolada). Somente leitura/analise: tire-o e use `--permission-mode plan` (ou restrinja `--allowedTools`). |
16
+ | `MODEL` | `--model <MODEL>` — `opus` · `sonnet` · `haiku` · `fable`, ou um id completo (`claude-opus-5`) |
17
+ | `EFFORT` | `--effort <EFFORT>` — `low` · `medium` · `high` · `xhigh` · `max` |
18
+ | `AUTO` | `--dangerously-skip-permissions` (auto-aprovacao headless para dispatch **WRITE**; justificavel porque a worktree e isolada) |
19
+ | `AUTO_READONLY` | `--permission-mode plan` (opcionalmente `--allowedTools <lista>`). Nunca combine com `AUTO`. |
20
+ | `NO_MCP` | `--strict-mcp-config` sem nenhum `--mcp-config` → sobe zero MCP servers |
17
21
  | `RESUME <id>` | `cd <WORKTREE> && claude --resume "$UUID" -p --effort <EFFORT> --output-format stream-json --include-partial-messages --verbose --dangerously-skip-permissions "$(cat <FOLLOWUP_PROMPT>)" </dev/null >> <AUDIT>/<slug>.log 2>&1` |
18
22
  | `RESUME_LAST` | `claude -c -p …` (continua a conversa mais recente nesta cwd) |
19
23
  | `SESSION_ID` | **FIXADO por voce** — voce passa `--session-id "$UUID"` na 1a run, entao o id e conhecido de antemao. Gere-o (`cat /proc/sys/kernel/random/uuid` ou `uuidgen`) e grave em `<AUDIT>/<slug>.session` ANTES/no dispatch. Sem scraping do stream — o Claude e o caso facil. |
@@ -13,7 +13,11 @@ implementar um prompt/spec ja preparado, captura a execucao inteira num log de a
13
13
  |---|---|
14
14
  | `DISPATCH` | `cd <WORKTREE> && codex exec --skip-git-repo-check -m <MODEL> --config model_reasoning_effort="<EFFORT>" --dangerously-bypass-approvals-and-sandbox --json -o <AUDIT>/<slug>.last.md "$(cat <PROMPT>)" </dev/null > <AUDIT>/<slug>.log 2>&1` |
15
15
  | `STREAM` | `--json` (eventos JSONL) |
16
- | `AUTO` | `--dangerously-bypass-approvals-and-sandbox` (sem sandbox + sem approvals = full access **com rede**, p/ o CLI rodar o gate; justificavel porque a worktree e isolada). Edicao sem gate de rede: `--sandbox workspace-write --full-auto`. Somente leitura/analise: `--sandbox read-only` (sem `--full-auto`). |
16
+ | `MODEL` | `-m <MODEL>` — `gpt-5.5` · `gpt-5.3-codex` · `gpt-5.4` · `gpt-5.3-codex-spark` · `gpt-5.4-mini` |
17
+ | `EFFORT` | `--config model_reasoning_effort="<EFFORT>"` — `low` · `medium` · `high` · `xhigh` |
18
+ | `AUTO` | `--dangerously-bypass-approvals-and-sandbox` (sem sandbox + sem approvals = full access **com rede**, p/ o CLI rodar o gate; **somente dispatch WRITE**, justificavel porque a worktree e isolada). Edicao sem gate de rede: `--sandbox workspace-write --full-auto`. |
19
+ | `AUTO_READONLY` | `--sandbox read-only` (sem `--full-auto`). Nunca combine com `AUTO`. |
20
+ | `NO_MCP` | `-c mcp_servers='{}'` → sobe zero MCP servers, preserva auth e o resto do `config.toml`. Alternativa mais bruta: `--ignore-user-config` (tambem derruba os defaults de modelo — ai `MODEL` + `EFFORT` viram obrigatorios). |
17
21
  | `RESUME <id>` | `cd <WORKTREE> && codex exec resume <THREAD_ID> --skip-git-repo-check --dangerously-bypass-approvals-and-sandbox --json "$(cat <FOLLOWUP_PROMPT>)" </dev/null >> <AUDIT>/<slug>.log 2>&1` |
18
22
  | `RESUME_LAST` | `codex exec resume --last …` (filtra por cwd = a worktree) |
19
23
  | `SESSION_ID` | Codex **nao tem flag pra fixar** o id → **capture** o thread id do stream da 1a run: `grep -oE '"thread_id":"[^"]*"' <AUDIT>/<slug>.log \| head -1` (do evento `thread.started`) → grave em `<AUDIT>/<slug>.session`. |