@dewtech/dare-cli 2.15.0 → 2.17.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 (101) hide show
  1. package/README.md +659 -561
  2. package/dist/__tests__/refine.test.d.ts +2 -0
  3. package/dist/__tests__/refine.test.d.ts.map +1 -0
  4. package/dist/__tests__/refine.test.js +186 -0
  5. package/dist/__tests__/refine.test.js.map +1 -0
  6. package/dist/__tests__/review.test.d.ts +2 -0
  7. package/dist/__tests__/review.test.d.ts.map +1 -0
  8. package/dist/__tests__/review.test.js +242 -0
  9. package/dist/__tests__/review.test.js.map +1 -0
  10. package/dist/__tests__/update.test.d.ts +2 -0
  11. package/dist/__tests__/update.test.d.ts.map +1 -0
  12. package/dist/__tests__/update.test.js +150 -0
  13. package/dist/__tests__/update.test.js.map +1 -0
  14. package/dist/bin/dare.js +6 -0
  15. package/dist/bin/dare.js.map +1 -1
  16. package/dist/commands/dag.d.ts.map +1 -1
  17. package/dist/commands/dag.js +27 -9
  18. package/dist/commands/dag.js.map +1 -1
  19. package/dist/commands/execute.d.ts.map +1 -1
  20. package/dist/commands/execute.js +76 -0
  21. package/dist/commands/execute.js.map +1 -1
  22. package/dist/commands/refine.d.ts +16 -0
  23. package/dist/commands/refine.d.ts.map +1 -0
  24. package/dist/commands/refine.js +167 -0
  25. package/dist/commands/refine.js.map +1 -0
  26. package/dist/commands/review.d.ts +16 -0
  27. package/dist/commands/review.d.ts.map +1 -0
  28. package/dist/commands/review.js +106 -0
  29. package/dist/commands/review.js.map +1 -0
  30. package/dist/commands/update.d.ts +13 -0
  31. package/dist/commands/update.d.ts.map +1 -0
  32. package/dist/commands/update.js +149 -0
  33. package/dist/commands/update.js.map +1 -0
  34. package/dist/types/Refine.types.d.ts +96 -0
  35. package/dist/types/Refine.types.d.ts.map +1 -0
  36. package/dist/types/Refine.types.js +19 -0
  37. package/dist/types/Refine.types.js.map +1 -0
  38. package/dist/types/Review.types.d.ts +86 -0
  39. package/dist/types/Review.types.d.ts.map +1 -0
  40. package/dist/types/Review.types.js +15 -0
  41. package/dist/types/Review.types.js.map +1 -0
  42. package/dist/types/UpdateManifest.types.d.ts +91 -0
  43. package/dist/types/UpdateManifest.types.d.ts.map +1 -0
  44. package/dist/types/UpdateManifest.types.js +13 -0
  45. package/dist/types/UpdateManifest.types.js.map +1 -0
  46. package/dist/utils/ReviewRunner.d.ts +42 -0
  47. package/dist/utils/ReviewRunner.d.ts.map +1 -0
  48. package/dist/utils/ReviewRunner.js +175 -0
  49. package/dist/utils/ReviewRunner.js.map +1 -0
  50. package/dist/utils/UpdateApplier.d.ts +42 -0
  51. package/dist/utils/UpdateApplier.d.ts.map +1 -0
  52. package/dist/utils/UpdateApplier.js +207 -0
  53. package/dist/utils/UpdateApplier.js.map +1 -0
  54. package/dist/utils/UpdateDetector.d.ts +56 -0
  55. package/dist/utils/UpdateDetector.d.ts.map +1 -0
  56. package/dist/utils/UpdateDetector.js +164 -0
  57. package/dist/utils/UpdateDetector.js.map +1 -0
  58. package/dist/utils/complexity-analyzer.d.ts +60 -0
  59. package/dist/utils/complexity-analyzer.d.ts.map +1 -0
  60. package/dist/utils/complexity-analyzer.js +292 -0
  61. package/dist/utils/complexity-analyzer.js.map +1 -0
  62. package/dist/utils/excalidraw-renderer.d.ts +79 -0
  63. package/dist/utils/excalidraw-renderer.d.ts.map +1 -0
  64. package/dist/utils/excalidraw-renderer.js +188 -0
  65. package/dist/utils/excalidraw-renderer.js.map +1 -0
  66. package/dist/utils/excalidraw-renderer.test.d.ts +2 -0
  67. package/dist/utils/excalidraw-renderer.test.d.ts.map +1 -0
  68. package/dist/utils/excalidraw-renderer.test.js +135 -0
  69. package/dist/utils/excalidraw-renderer.test.js.map +1 -0
  70. package/dist/utils/project-generator.d.ts.map +1 -1
  71. package/dist/utils/project-generator.js +21 -2
  72. package/dist/utils/project-generator.js.map +1 -1
  73. package/dist/utils/stack-bootstrap.js +3 -1
  74. package/dist/utils/stack-bootstrap.js.map +1 -1
  75. package/dist/utils/static-analyzer.d.ts +29 -0
  76. package/dist/utils/static-analyzer.d.ts.map +1 -0
  77. package/dist/utils/static-analyzer.js +390 -0
  78. package/dist/utils/static-analyzer.js.map +1 -0
  79. package/dist/utils/version-compare.d.ts +27 -0
  80. package/dist/utils/version-compare.d.ts.map +1 -0
  81. package/dist/utils/version-compare.js +47 -0
  82. package/dist/utils/version-compare.js.map +1 -0
  83. package/package.json +1 -1
  84. package/templates/DARE-dag-example.yaml +280 -0
  85. package/templates/UPDATE-MANIFEST.json +48 -0
  86. package/templates/ide/antigravity/.agents/skills/dare-blueprint/SKILL.md +180 -36
  87. package/templates/ide/antigravity/.agents/skills/dare-refine/SKILL.md +114 -0
  88. package/templates/ide/antigravity/.agents/skills/dare-review/SKILL.md +111 -0
  89. package/templates/ide/antigravity/.agents/skills/dare-tasks/SKILL.md +41 -0
  90. package/templates/ide/antigravity/templates/TASK-SPEC-template.md +45 -4
  91. package/templates/ide/claude/.claude/commands/dare-blueprint.md +56 -0
  92. package/templates/ide/claude/.claude/commands/dare-dag-build.md +41 -0
  93. package/templates/ide/claude/.claude/commands/dare-dag-viz.md +197 -0
  94. package/templates/ide/claude/.claude/commands/dare-refine.md +145 -0
  95. package/templates/ide/claude/.claude/commands/dare-review.md +113 -0
  96. package/templates/ide/claude/templates/TASK-SPEC-template.md +45 -4
  97. package/templates/ide/cursor/.cursor/commands/generate-blueprint.md +45 -0
  98. package/templates/ide/cursor/.cursor/commands/generate-tasks.md +42 -0
  99. package/templates/ide/cursor/.cursor/commands/refine-task.md +107 -0
  100. package/templates/ide/cursor/.cursor/commands/review-task.md +91 -0
  101. package/templates/ide/cursor/templates/TASK-SPEC-template.md +45 -4
package/README.md CHANGED
@@ -1,561 +1,659 @@
1
- # @dewtech/dare-cli
2
-
3
- CLI tool for the **DARE Framework** — Design, Architect, Review, Execute.
4
-
5
- A structured methodology for AI-assisted software development with mandatory human-in-the-loop reviews and parallel task execution.
6
-
7
- [![npm](https://img.shields.io/npm/v/@dewtech/dare-cli)](https://www.npmjs.com/package/@dewtech/dare-cli)
8
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/dewtech-technologies/dare-method/blob/main/LICENSE)
9
-
10
- ---
11
-
12
- ## ⚠ Read this first — How `dare init` runs the official scaffold
13
-
14
- `dare init` invokes the **official scaffold** of the stack you pick. That
15
- means it literally runs:
16
-
17
- | Stack | What `dare init` runs |
18
- |-------|----------------------|
19
- | `php-laravel` | `composer create-project laravel/laravel:^11 .` |
20
- | `node-nestjs` | `npx @nestjs/cli new . --strict --skip-git` |
21
- | `python-fastapi` | `python -m venv .venv && python -m pip install -r requirements.txt` |
22
- | `rust-axum` | `cargo init` + write `Cargo.toml` (axum, sqlx, tokio…) |
23
- | `go-gin` | `go mod init` + `go get gin/godotenv` + starter files |
24
- | `go-stdlib` | `go mod init` + starter usando só `net/http` (zero deps externas) |
25
- | `react`, `vue` | `npx degit vitejs/vite/packages/create-vite/template-<x> .` + `npm install` |
26
- | `rust-leptos` | Cargo workspace with `crates/server` (Axum) + `crates/web` (Leptos 0.7 SSR+hydrate) + `cargo fetch` |
27
- | `rust-leptos-csr` | Cargo workspace with `crates/server` (Axum) + `crates/web` (Leptos 0.7 CSR) + Trunk.toml + `cargo fetch` |
28
- | `mcp-server-node-ts` | `npm init` + `@modelcontextprotocol/sdk` |
29
- | `mcp-server-python` | `python -m venv .venv` + `pip install mcp[cli]` |
30
-
31
- These need a working `composer` / `npm` / `cargo` / `python` / `go`
32
- **somewhere**. There are three ways to provide it — you pick at init time
33
- (prompt below), and the choice is saved in `dare.config.json` so
34
- `dare bootstrap` reuses it later.
35
-
36
- ```
37
- ? Toolchain for scaffolding (composer / npm / cargo / python / go):
38
- ❯ 🤖 Auto — use native if on PATH, else Docker (recommended)
39
- 🔧 Native only — require the CLI on PATH (faster, no Docker pulls)
40
- 🐳 Docker only — always use the official image (hermetic, no host install)
41
- ```
42
-
43
- ### 🤖 Auto (default)
44
-
45
- Tries the native CLI first. If missing, falls back to the official Docker
46
- image automatically. If neither is present, fails fast with both install
47
- links.
48
-
49
- ```
50
- which composer → ✓ found? use native
51
- → ✗ missing? which docker
52
- → ✓ found? docker run composer:latest …
53
- → ✗ missing? error: install Composer or Docker
54
- ```
55
-
56
- **When:** you don't know exactly what's installed; mixed teams (some
57
- machines have the toolchain, some only have Docker). The same project
58
- config (`dare.config.json` with `toolchain: auto`) works on every machine.
59
-
60
- ### 🔧 Native only
61
-
62
- Requires the CLI on PATH. **Fails immediately** if missing — no Docker
63
- fallback even if Docker is available.
64
-
65
- ```
66
- which composer → ✓ found? use native
67
- → ✗ missing? error: "Install Composer: https://getcomposer.org/"
68
- ```
69
-
70
- **When:** you already have the toolchain and want **maximum speed** (no
71
- `docker pull`, no bind-mount overhead, no container startup); you're in CI
72
- with the toolchain pre-installed; you want to avoid Docker Desktop edge
73
- cases (Windows volume throttling, Linux uid/gid issues, etc.).
74
-
75
- ### 🐳 Docker only
76
-
77
- **Always** runs the scaffold inside the official Docker image — even if
78
- the native CLI is on PATH. Fails if Docker isn't installed.
79
-
80
- ```
81
- which docker → ✓ found? docker run --rm -v ".:/app" composer:latest create-project …
82
- → ✗ missing? error: "Install Docker Desktop"
83
- ```
84
-
85
- **When:** you don't want to install PHP / Cargo / Python / Go on the
86
- host (keep host clean); you want **hermetic, reproducible** builds (every
87
- dev uses the exact toolchain version baked into the image); you want to
88
- mirror your CI locally.
89
-
90
- ### Quick decision table
91
-
92
- | Your situation | Pick |
93
- |----------------|------|
94
- | Already have the toolchain installed, want speed | **🔧 Native** |
95
- | Don't want to install PHP/Cargo/Python/Go on the host | **🐳 Docker** |
96
- | Mixed team, varying setups | **🤖 Auto** |
97
- | Just want it to work | **🤖 Auto** |
98
- | Want bit-for-bit toolchain reproducibility | **🐳 Docker** |
99
- | Solo dev with everything installed | **🔧 Native** |
100
-
101
- ### Override later
102
-
103
- ```bash
104
- dare bootstrap --toolchain docker # rerun scaffold inside Docker
105
- dare bootstrap --toolchain native --force # rerun native, overwriting framework files
106
- dare bootstrap --toolchain auto # back to auto-detect
107
- ```
108
-
109
- ### ⚠ Important caveat — Ralph Loop
110
-
111
- `dare execute --complete` runs the stack's quality gates
112
- (`composer dump-autoload`, `php artisan test`, `cargo build`, etc.)
113
- **directly on the host** — it does **not** automatically wrap them in
114
- Docker even if you picked `docker only` at init time.
115
-
116
- If you don't have the native toolchain installed, the agent should run
117
- the gates inside the container created by **task-001** (the Containerize
118
- task), e.g. `docker compose exec app php artisan test`. The skills
119
- shipped with `dare init` already nudge the agent toward that pattern.
120
-
121
- ---
122
-
123
- ## Prerequisites
124
-
125
- ### Required for the CLI itself
126
-
127
- | Tool | Why | Install |
128
- |------|-----|---------|
129
- | **Node.js 18+** | runs `dare`, `dare-mcp-server` and the bundled GraphRAG engine | https://nodejs.org/ |
130
-
131
- ### Required to scaffold the chosen stack
132
-
133
- `dare init` runs the **official scaffold** of the stack you pick (e.g.
134
- `composer create-project laravel/laravel`, `npm create vite@latest`,
135
- `go mod init`). It tries the native toolchain first; if it isn't on PATH,
136
- it falls back to running the equivalent **Docker image** automatically.
137
-
138
- Pick **one** of the two paths per stack:
139
-
140
- | Stack | Native toolchain | Docker fallback (used if native missing) |
141
- |-------|------------------|------------------------------------------|
142
- | `php-laravel` | PHP 8.2+ · Composer 2+ — https://getcomposer.org/ | `composer:latest` |
143
- | `node-nestjs` | Node 18+ (bundles `npx`) | `node:20-alpine` |
144
- | `python-fastapi` | Python 3.11+ — https://www.python.org/downloads/ | `python:3.12-slim` |
145
- | `rust-axum` | Rust 1.83+ (rustup) — https://www.rust-lang.org/tools/install | `rust:1.83` |
146
- | `go-gin` | Go 1.25+ — https://go.dev/dl/ | `golang:1.25` |
147
- | `go-stdlib` | Go 1.22+ — https://go.dev/dl/ | `golang:1.25` |
148
- | `react`, `vue` | Node 18+ (bundles `npm`) | `node:20-alpine` |
149
- | `rust-leptos` | Rust 1.83+ (rustup) + **cargo-leptos 0.2.22** — `cargo install cargo-leptos --version 0.2.22` | `ghcr.io/dewtech-technologies/dare-rust-leptos:1` |
150
- | `rust-leptos-csr` | Rust 1.83+ (rustup) + **trunk** — `cargo install trunk` | `ghcr.io/dewtech-technologies/dare-rust-leptos:1` |
151
- | `mcp-server-node-ts` | Node 18+ | `node:20-alpine` |
152
- | `mcp-server-python` | Python 3.11+ | `python:3.12-slim` |
153
-
154
- > **TL;DR:** if you have **Docker Desktop** installed, you don't strictly need
155
- > any other toolchain — `dare init` will pull the right image on demand.
156
- > Native toolchains are faster and don't depend on Docker pulling images.
157
-
158
- If neither the native CLI **nor** Docker is available, `dare init` fails
159
- fast with a clear error message — it never falls back to a fake template.
160
-
161
- ### Choose the toolchain at init time
162
-
163
- The 3 modes (`auto` / `native` / `docker`) are explained in detail at the
164
- top of this README — see [⚠ Read this first](#-read-this-first--how-dare-init-runs-the-official-scaffold).
165
-
166
- Quick recap:
167
-
168
- | Mode | Behavior |
169
- |------|----------|
170
- | `auto` (default) | Native if available, else Docker. Recommended. |
171
- | `native` | Requires the native CLI; fails if missing. |
172
- | `docker` | Always uses the official Docker image. |
173
-
174
- The choice is persisted in `dare.config.json` (`"toolchain": "..."`).
175
- Override at any time:
176
-
177
- ```bash
178
- dare bootstrap --toolchain docker # rerun scaffold inside Docker
179
- dare bootstrap --toolchain native --force # rerun native, overwriting
180
- ```
181
-
182
- ### Required for the Ralph Loop (per project)
183
-
184
- Once the project is scaffolded, every `dare execute --complete` runs the
185
- stack's gates: `build → test → lint`. The same toolchain (native or Docker)
186
- that scaffolded the project is needed to run those gates. Plan accordingly:
187
- if you chose `php-laravel` and only have Docker, `dare execute --complete`
188
- needs to invoke `php artisan test` somehow — typically by running it inside
189
- your `docker-compose` app service (this is the kind of thing the
190
- `task-001 = Containerize app` task sets up).
191
-
192
- ## Installation
193
-
194
- ```bash
195
- npm install -g @dewtech/dare-cli
196
- ```
197
-
198
- ## Commands
199
-
200
- ### `dare init`
201
-
202
- Interactive project initialization — creates the full project structure with DARE methodology files, IDE rules and stack templates.
203
-
204
- ```bash
205
- dare init my-project
206
- ```
207
-
208
- Prompts:
209
- - **Structure:** Monorepo · Backend only · Frontend only · **MCP Server** ← new
210
- - **MCP Server:** language (TypeScript / Python), transport (stdio / SSE / HTTP Stream), capabilities (Tools / Resources / Prompts)
211
- - **Backend stack:** Rust/Axum · Node.js/NestJS · Python/FastAPI · PHP/Laravel · Go/Gin · Go/stdlib
212
- - **Frontend stack:** React 18+ · Vue 3+ · Leptos fullstack (Rust SSR+WASM) · Leptos CSR-only (Rust WASM)
213
- - **Cargo workspace layout** *(Monorepo + Rust/Axum + Leptos only)*: Single-crate (`crates/server` + `crates/web`) · Multi-crate (`{prefix}-core` + `{prefix}-server` + `{prefix}-web` + `{prefix}-cli`) — prefix suggested from project initials (e.g. `ai-runtime-securyti-rasp` → `arsr`)
214
- - **IDE / Agent:** Claude Code · Cursor · Antigravity · Hybrid
215
- - **GraphRAG backend:** SQLite · JSON · Neo4j
216
- - **DARE MCP Server:** context query server (saves ~95% tokens)
217
-
218
- Generates:
219
- - `dare.config.json` — project config
220
- - `CLAUDE.md` + `.claude/commands/` + `.claude/settings.json` — Claude Code rules and slash commands (includes `/dare-security`)
221
- - `.cursorrules` / `.antigravityrules` — Cursor / Antigravity rules
222
- - `.cursor/rules/*.mdc` — stack-specific skills
223
- - `.cursor/commands/` — Cursor slash commands
224
- - `.agents/skills/` — Antigravity agent skills
225
- - `DARE/` — methodology directory (DESIGN, BLUEPRINT, TASKS, dag)
226
- - Full project template ready to run (MCP server, backend or frontend)
227
-
228
- ---
229
-
230
- ### `dare discover` ← new in v0.3.0
231
-
232
- Detects an existing project's stack automatically and installs DARE files without touching your source code.
233
-
234
- ```bash
235
- # Run inside an existing project
236
- cd my-existing-project
237
- dare discover
238
-
239
- # Inspect only, no changes
240
- dare discover --check
241
-
242
- # Target a specific directory
243
- dare discover --dir ./path/to/project
244
- ```
245
-
246
- Auto-detects from: `package.json`, `Cargo.toml`, `requirements.txt`, `pyproject.toml`, `composer.json`.
247
-
248
- Recognizes: NestJS · React · Vue · Nuxt · Rust/Axum · FastAPI · Laravel · **MCP Server** (`@modelcontextprotocol/sdk`, `FastMCP`).
249
-
250
- ---
251
-
252
- ### `dare design`
253
-
254
- Generate `DARE/DESIGN.md` from a project description.
255
-
256
- ```bash
257
- dare design "Build a REST API for user authentication with JWT"
258
- ```
259
-
260
- ---
261
-
262
- ### `dare blueprint`
263
-
264
- Generate `DARE/BLUEPRINT.md` from `DESIGN.md`. Stops here — requires human review and approval before tasks are created.
265
-
266
- ```bash
267
- dare blueprint
268
- ```
269
-
270
- ---
271
-
272
- ### `dare tasks`
273
-
274
- Generate `DARE/TASKS.md`, `DARE/dare-dag.yaml` and all `DARE/EXECUTION/task-*.md` specs from an approved `BLUEPRINT.md`. Run this only after reviewing and approving the blueprint.
275
-
276
- ```bash
277
- dare tasks
278
- ```
279
-
280
- ---
281
-
282
- ### `dare execute`
283
-
284
- Orchestrate DAG execution. **The IDE is the executor** (Cursor / Antigravity
285
- / Claude Code) — `dare execute` only coordinates state, composes prompts
286
- with parent context, updates the live canvas at `DARE/.canvas.md`, and
287
- ingests finished tasks into the knowledge graph.
288
-
289
- > **No API keys, no extra token costs.** You use the plan of the IDE you're
290
- > already logged into.
291
-
292
- ```bash
293
- # Print next executable tasks (with composed prompts)
294
- dare execute --next
295
-
296
- # Mark a task DONE after the agent finishes it
297
- dare execute --complete task-001 --output "Created src/auth.ts and tests/auth.test.ts; all tests green."
298
-
299
- # Mark a task FAILED — descendants are cascade-skipped automatically
300
- dare execute --fail task-002 --reason "Schema migration conflict in users table"
301
-
302
- # Reset a task back to PENDING (for retry)
303
- dare execute --reset task-002
304
-
305
- # Show snapshot of canvas + summary (default action)
306
- dare execute --status
307
- ```
308
-
309
- #### Typical flow inside the IDE agent
310
-
311
- ```bash
312
- dare execute --next # → tasks ready in current rank
313
- # (agent executes each task: code, build, test, lint)
314
- dare execute --complete task-001 --output "…"
315
- dare execute --complete task-002 --output "…"
316
- dare execute --next # → next rank
317
- # (repeat until "✅ All tasks resolved")
318
- ```
319
-
320
- The skills shipped by `dare init` (`.cursor/rules/skill-dag-runner.mdc`,
321
- `.agents/skills/dare-dag-runner/SKILL.md`, `.claude/commands/dare-dag-run.md`)
322
- guide the IDE agent through this loop.
323
-
324
- #### Stack-specific skills
325
-
326
- `dare init` also ships skills focused on architectural decisions for
327
- specific stacks. As of v2.15.0:
328
-
329
- - **`skill-rust-workspace.mdc`** (Cursor) /
330
- **`dare-rust-workspace/SKILL.md`** (Antigravity) /
331
- **`/dare-rust-workspace`** (Claude command) — guides the agent on
332
- whether a Rust project should start single-crate or as a Cargo
333
- workspace, and gives a step-by-step PR-by-PR migration plan when an
334
- existing single-crate project has outgrown its layout. Active during
335
- `/dare-design` and `/dare-blueprint` for `rust-axum` projects, plus on
336
- demand for migration analysis.
337
-
338
- - **`skill-rust-leptos.mdc`** (Cursor) /
339
- **`dare-rust-leptos/SKILL.md`** (Antigravity) /
340
- **`/dare-rust-leptos`** (Claude command) — full guide for Leptos
341
- development: CSR vs fullstack decision table, Leptos 0.7 idioms
342
- (signals, Resource, Action, Show, For, `#[server]`), shared types with
343
- `cfg_attr`, mixed workspace configuration (WASM + native crates), and
344
- antipatterns to avoid (`cargo leptos test` does not exist; no global
345
- `[build] target` in `.cargo/config.toml`). Ships 3 ready-to-use DARE
346
- task templates for Leptos projects.
347
-
348
- ### `dare bootstrap`
349
-
350
- Run the official scaffold for a project's stack on **an existing project**
351
- (created in older versions or with `--skip-bootstrap`). Reads
352
- `dare.config.json` and dispatches to:
353
-
354
- - `composer create-project laravel/laravel` for `php-laravel`
355
- - `npx @nestjs/cli new` for `node-nestjs`
356
- - `npm create vite` for `react` / `vue`
357
- - `python -m venv` + `pip install` for `python-fastapi`
358
- - `cargo init` + axum-ready `Cargo.toml` for `rust-axum`
359
- - `npm init` + `@modelcontextprotocol/sdk` for `mcp-server-node`
360
-
361
- ```bash
362
- dare bootstrap # refuses if vendor/ or node_modules/ already exist
363
- dare bootstrap --force # runs anyway (may overwrite framework files)
364
- ```
365
-
366
- Your DARE artifacts (`.cursor/`, `DARE/`, `dare.config.json`, `dare-graph.yml`)
367
- are preserved.
368
-
369
- ### `dare info`
370
-
371
- Read-only diagnostic of the current project: CLI version, platform, presence
372
- of each canonical DARE artifact, active GraphRAG backend, and task progress.
373
-
374
- ```bash
375
- dare info
376
- ```
377
-
378
- ### `dare validate`
379
-
380
- Static checks on `dare-dag.yaml` ideal for pre-commit hooks and CI.
381
- Verifies unique kebab-case ids, valid `depends_on`, absence of cycles,
382
- non-empty prompts, and parallelism (warning when only one task at rank 0).
383
-
384
- ```bash
385
- dare validate # errors fail; warnings printed
386
- dare validate --strict # warnings also fail (CI-friendly)
387
- ```
388
-
389
- A pre-commit hook template is shipped at
390
- `templates/hooks/pre-commit-dare-validate` — copy to `.git/hooks/pre-commit`
391
- (or use with husky) to validate the DAG before every commit.
392
-
393
- ### `dare execute --watch`
394
-
395
- Interactive loop: the CLI watches `.dare/state.json` and re-prints the next
396
- ready tasks every time the state changes. Pair with the IDE agent firing
397
- `--complete`/`--fail` from another terminal.
398
-
399
- ```bash
400
- dare execute --watch
401
- ```
402
-
403
- ### `dare dag`
404
-
405
- Inspect and visualize the **static task DAG** declared in `dare-dag.yaml` —
406
- distinct from `dare graph`, which inspects the populated knowledge graph
407
- (only contains tasks already executed).
408
-
409
- ```bash
410
- dare dag viz # Mermaid to stdout
411
- dare dag viz -o DARE/dag-graph.mmd # Mermaid file
412
- dare dag viz -f dot -o DARE/dag-graph.dot # DOT (Graphviz)
413
- ```
414
-
415
- The Mermaid output groups tasks into rank subgraphs and colors nodes by
416
- status (`PENDING` / `RUNNING` / `DONE` / `FAILED` / `SKIPPED`), so you can
417
- **see the execution plan before running any task**.
418
-
419
- > `dare tasks` writes `DARE/dag-graph.mmd` automatically — open it in
420
- > your editor with a Mermaid preview to see the static graph immediately.
421
-
422
- ### `dare graph`
423
-
424
- Inspect the project's knowledge graph. The graph is populated automatically
425
- by `dare execute --complete/--fail` (task nodes, file nodes, `depends_on` and
426
- `implements` edges). Backend is whatever `dare-graph.yml` declares
427
- (`sqlite` default, `json` available, `neo4j` planned).
428
-
429
- ```bash
430
- dare graph stats # totals + breakdown by type
431
- dare graph query auth # search nodes by label/description
432
- dare graph query auth --limit 20
433
-
434
- dare graph viz # Mermaid to stdout
435
- dare graph viz -f dot # DOT for Graphviz
436
- dare graph viz -o docs/graph.mmd # write to file
437
-
438
- dare graph ingest # re-sync from dare-dag.yaml + state
439
- ```
440
-
441
- ---
442
-
443
- ## Full Workflow
444
-
445
- ```bash
446
- # New project
447
- dare init my-project
448
- cd my-project
449
- dare design "Describe what you're building"
450
- dare blueprint
451
- dare execute --parallel
452
-
453
- # Existing project
454
- cd my-existing-project
455
- dare discover
456
- dare design "Describe what you're building"
457
- dare blueprint
458
- dare execute --parallel
459
- ```
460
-
461
- ## Claude Code Workflow
462
-
463
- ```bash
464
- dare init my-project
465
- # IDE: Claude Code
466
- # → Structure: Backend / Frontend / MCP Server
467
-
468
- cd my-project
469
- # Claude Code slash commands available:
470
- # /dare-design → generates DARE/DESIGN.md
471
- # /dare-blueprint generates BLUEPRINT.md + DAG
472
- # /dare-execute task-001 implements with Ralph Loop
473
- # /dare-tasks → shows task status table
474
- ```
475
-
476
- Files generated for Claude Code:
477
- ```
478
- CLAUDE.md ← main context (stack rules + DARE methodology)
479
- .claude/
480
- settings.json ← permissions + Ralph Loop hook
481
- commands/
482
- dare-design.md ← /dare-design
483
- dare-blueprint.md ← /dare-blueprint
484
- dare-execute.md ← /dare-execute
485
- dare-tasks.md ← /dare-tasks
486
- ```
487
-
488
- ---
489
-
490
- ## MCP Server Workflow
491
-
492
- ```bash
493
- dare init my-mcp-server
494
- # Structure: MCP Server
495
- # Language: TypeScript
496
- # → Transport: stdio
497
- # → Capabilities: Tools, Resources
498
-
499
- cd my-mcp-server
500
- npm install
501
- dare design "MCP server that exposes ZIP code lookup tools"
502
- dare blueprint
503
- dare execute --parallel
504
-
505
- # Test with MCP Inspector
506
- npm run inspect
507
- ```
508
-
509
- ---
510
-
511
- ## Performance
512
-
513
- | Mode | Estimated Time |
514
- |------|----------------|
515
- | Sequential | ~280 minutes |
516
- | Parallel DAG | ~70 minutes |
517
- | **Improvement** | **75% faster** |
518
-
519
- ---
520
-
521
- ## Supported Stacks
522
-
523
- | Type | Options |
524
- |------|---------|
525
- | **Backend** | Rust/Axum · Node.js/NestJS · Python/FastAPI · PHP/Laravel · Go/Gin · Go/stdlib |
526
- | **Frontend** | React 18+ · Vue 3+ · Leptos fullstack (Rust SSR+WASM) · Leptos CSR (Rust WASM) |
527
- | **MCP Server** | TypeScript/Node.js · Python — stdio / SSE / HTTP Stream |
528
- | **IDE / Agent** | Claude Code · Cursor · Antigravity · Hybrid |
529
-
530
- ---
531
-
532
- ## O que vem com o pacote (v2.0+)
533
-
534
- A partir da v2.0 o `@dewtech/dare-cli` é um **pacote único** que inclui todas as
535
- funcionalidades do framework DARE. Você não precisa instalar nada além dele:
536
-
537
- ```bash
538
- npm install -g @dewtech/dare-cli
539
- ```
540
-
541
- Isso dá:
542
-
543
- | Componente | O que é |
544
- |------------|---------|
545
- | CLI `dare` | `init`, `design`, `blueprint`, `execute`, `discover` |
546
- | CLI `dare-mcp-server` | Servidor MCP local de contexto (~95% economia de tokens) |
547
- | Engine GraphRAG | Grafo de conhecimento com SQLite + FTS5 |
548
- | DAG Task Runner | Execução paralela de tasks com Kahn's algorithm |
549
- | Tipos e templates | Tudo embutido — sem dependências externas do `@dewtech/*` |
550
-
551
- > **Histórico (v1.x):** os pacotes `@dewtech/dare-core`, `@dewtech/dare-graphrag` e
552
- > `@dewtech/dare-mcp-server` foram consolidados em `@dewtech/dare-cli` e estão
553
- > **deprecated** no npm. Não há mais subpacotes para gerenciar.
554
-
555
- ---
556
-
557
- ## Links
558
-
559
- - [GitHub](https://github.com/dewtech-technologies/dare-method)
560
- - [DARE Methodology](https://github.com/dewtech-technologies/dare-method#-o-método)
561
- - [Dewtech](https://dewtech.tech)
1
+ # @dewtech/dare-cli
2
+
3
+ CLI tool for the **DARE Framework** — Design, Architect, Review, Execute.
4
+
5
+ A structured methodology for AI-assisted software development with mandatory human-in-the-loop reviews and parallel task execution.
6
+
7
+ [![npm](https://img.shields.io/npm/v/@dewtech/dare-cli)](https://www.npmjs.com/package/@dewtech/dare-cli)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/dewtech-technologies/dare-method/blob/main/LICENSE)
9
+
10
+ ---
11
+
12
+ ## ⚠ Read this first — How `dare init` runs the official scaffold
13
+
14
+ `dare init` invokes the **official scaffold** of the stack you pick. That
15
+ means it literally runs:
16
+
17
+ | Stack | What `dare init` runs |
18
+ |-------|----------------------|
19
+ | `php-laravel` | `composer create-project laravel/laravel:^11 .` |
20
+ | `node-nestjs` | `npx @nestjs/cli new . --strict --skip-git` |
21
+ | `python-fastapi` | `python -m venv .venv && python -m pip install -r requirements.txt` |
22
+ | `rust-axum` | `cargo init` + write `Cargo.toml` (axum, sqlx, tokio…) |
23
+ | `go-gin` | `go mod init` + `go get gin/godotenv` + starter files |
24
+ | `go-stdlib` | `go mod init` + starter usando só `net/http` (zero deps externas) |
25
+ | `react`, `vue` | `npx degit vitejs/vite/packages/create-vite/template-<x> .` + `npm install` |
26
+ | `rust-leptos` | Cargo workspace with `crates/server` (Axum) + `crates/web` (Leptos 0.7 SSR+hydrate) + `cargo fetch` |
27
+ | `rust-leptos-csr` | Cargo workspace with `crates/server` (Axum) + `crates/web` (Leptos 0.7 CSR) + Trunk.toml + `cargo fetch` |
28
+ | `mcp-server-node-ts` | `npm init` + `@modelcontextprotocol/sdk` |
29
+ | `mcp-server-python` | `python -m venv .venv` + `pip install mcp[cli]` |
30
+
31
+ These need a working `composer` / `npm` / `cargo` / `python` / `go`
32
+ **somewhere**. There are three ways to provide it — you pick at init time
33
+ (prompt below), and the choice is saved in `dare.config.json` so
34
+ `dare bootstrap` reuses it later.
35
+
36
+ ```
37
+ ? Toolchain for scaffolding (composer / npm / cargo / python / go):
38
+ ❯ 🤖 Auto — use native if on PATH, else Docker (recommended)
39
+ 🔧 Native only — require the CLI on PATH (faster, no Docker pulls)
40
+ 🐳 Docker only — always use the official image (hermetic, no host install)
41
+ ```
42
+
43
+ ### 🤖 Auto (default)
44
+
45
+ Tries the native CLI first. If missing, falls back to the official Docker
46
+ image automatically. If neither is present, fails fast with both install
47
+ links.
48
+
49
+ ```
50
+ which composer → ✓ found? use native
51
+ → ✗ missing? which docker
52
+ → ✓ found? docker run composer:latest …
53
+ → ✗ missing? error: install Composer or Docker
54
+ ```
55
+
56
+ **When:** you don't know exactly what's installed; mixed teams (some
57
+ machines have the toolchain, some only have Docker). The same project
58
+ config (`dare.config.json` with `toolchain: auto`) works on every machine.
59
+
60
+ ### 🔧 Native only
61
+
62
+ Requires the CLI on PATH. **Fails immediately** if missing — no Docker
63
+ fallback even if Docker is available.
64
+
65
+ ```
66
+ which composer → ✓ found? use native
67
+ → ✗ missing? error: "Install Composer: https://getcomposer.org/"
68
+ ```
69
+
70
+ **When:** you already have the toolchain and want **maximum speed** (no
71
+ `docker pull`, no bind-mount overhead, no container startup); you're in CI
72
+ with the toolchain pre-installed; you want to avoid Docker Desktop edge
73
+ cases (Windows volume throttling, Linux uid/gid issues, etc.).
74
+
75
+ ### 🐳 Docker only
76
+
77
+ **Always** runs the scaffold inside the official Docker image — even if
78
+ the native CLI is on PATH. Fails if Docker isn't installed.
79
+
80
+ ```
81
+ which docker → ✓ found? docker run --rm -v ".:/app" composer:latest create-project …
82
+ → ✗ missing? error: "Install Docker Desktop"
83
+ ```
84
+
85
+ **When:** you don't want to install PHP / Cargo / Python / Go on the
86
+ host (keep host clean); you want **hermetic, reproducible** builds (every
87
+ dev uses the exact toolchain version baked into the image); you want to
88
+ mirror your CI locally.
89
+
90
+ ### Quick decision table
91
+
92
+ | Your situation | Pick |
93
+ |----------------|------|
94
+ | Already have the toolchain installed, want speed | **🔧 Native** |
95
+ | Don't want to install PHP/Cargo/Python/Go on the host | **🐳 Docker** |
96
+ | Mixed team, varying setups | **🤖 Auto** |
97
+ | Just want it to work | **🤖 Auto** |
98
+ | Want bit-for-bit toolchain reproducibility | **🐳 Docker** |
99
+ | Solo dev with everything installed | **🔧 Native** |
100
+
101
+ ### Override later
102
+
103
+ ```bash
104
+ dare bootstrap --toolchain docker # rerun scaffold inside Docker
105
+ dare bootstrap --toolchain native --force # rerun native, overwriting framework files
106
+ dare bootstrap --toolchain auto # back to auto-detect
107
+ ```
108
+
109
+ ### ⚠ Important caveat — Ralph Loop
110
+
111
+ `dare execute --complete` runs the stack's quality gates
112
+ (`composer dump-autoload`, `php artisan test`, `cargo build`, etc.)
113
+ **directly on the host** — it does **not** automatically wrap them in
114
+ Docker even if you picked `docker only` at init time.
115
+
116
+ If you don't have the native toolchain installed, the agent should run
117
+ the gates inside the container created by **task-001** (the Containerize
118
+ task), e.g. `docker compose exec app php artisan test`. The skills
119
+ shipped with `dare init` already nudge the agent toward that pattern.
120
+
121
+ ---
122
+
123
+ ## Prerequisites
124
+
125
+ ### Required for the CLI itself
126
+
127
+ | Tool | Why | Install |
128
+ |------|-----|---------|
129
+ | **Node.js 18+** | runs `dare`, `dare-mcp-server` and the bundled GraphRAG engine | https://nodejs.org/ |
130
+
131
+ ### Required to scaffold the chosen stack
132
+
133
+ `dare init` runs the **official scaffold** of the stack you pick (e.g.
134
+ `composer create-project laravel/laravel`, `npm create vite@latest`,
135
+ `go mod init`). It tries the native toolchain first; if it isn't on PATH,
136
+ it falls back to running the equivalent **Docker image** automatically.
137
+
138
+ Pick **one** of the two paths per stack:
139
+
140
+ | Stack | Native toolchain | Docker fallback (used if native missing) |
141
+ |-------|------------------|------------------------------------------|
142
+ | `php-laravel` | PHP 8.2+ · Composer 2+ — https://getcomposer.org/ | `composer:latest` |
143
+ | `node-nestjs` | Node 18+ (bundles `npx`) | `node:20-alpine` |
144
+ | `python-fastapi` | Python 3.11+ — https://www.python.org/downloads/ | `python:3.12-slim` |
145
+ | `rust-axum` | Rust 1.83+ (rustup) — https://www.rust-lang.org/tools/install | `rust:1.83` |
146
+ | `go-gin` | Go 1.25+ — https://go.dev/dl/ | `golang:1.25` |
147
+ | `go-stdlib` | Go 1.22+ — https://go.dev/dl/ | `golang:1.25` |
148
+ | `react`, `vue` | Node 18+ (bundles `npm`) | `node:20-alpine` |
149
+ | `rust-leptos` | Rust 1.83+ (rustup) + **cargo-leptos 0.2.22** — `cargo install cargo-leptos --version 0.2.22` | `ghcr.io/dewtech-technologies/dare-rust-leptos:1` |
150
+ | `rust-leptos-csr` | Rust 1.83+ (rustup) + **trunk** — `cargo install trunk` | `ghcr.io/dewtech-technologies/dare-rust-leptos:1` |
151
+ | `mcp-server-node-ts` | Node 18+ | `node:20-alpine` |
152
+ | `mcp-server-python` | Python 3.11+ | `python:3.12-slim` |
153
+
154
+ > **TL;DR:** if you have **Docker Desktop** installed, you don't strictly need
155
+ > any other toolchain — `dare init` will pull the right image on demand.
156
+ > Native toolchains are faster and don't depend on Docker pulling images.
157
+
158
+ If neither the native CLI **nor** Docker is available, `dare init` fails
159
+ fast with a clear error message — it never falls back to a fake template.
160
+
161
+ ### Choose the toolchain at init time
162
+
163
+ The 3 modes (`auto` / `native` / `docker`) are explained in detail at the
164
+ top of this README — see [⚠ Read this first](#-read-this-first--how-dare-init-runs-the-official-scaffold).
165
+
166
+ Quick recap:
167
+
168
+ | Mode | Behavior |
169
+ |------|----------|
170
+ | `auto` (default) | Native if available, else Docker. Recommended. |
171
+ | `native` | Requires the native CLI; fails if missing. |
172
+ | `docker` | Always uses the official Docker image. |
173
+
174
+ The choice is persisted in `dare.config.json` (`"toolchain": "..."`).
175
+ Override at any time:
176
+
177
+ ```bash
178
+ dare bootstrap --toolchain docker # rerun scaffold inside Docker
179
+ dare bootstrap --toolchain native --force # rerun native, overwriting
180
+ ```
181
+
182
+ ### Required for the Ralph Loop (per project)
183
+
184
+ Once the project is scaffolded, every `dare execute --complete` runs the
185
+ stack's gates: `build → test → lint`. The same toolchain (native or Docker)
186
+ that scaffolded the project is needed to run those gates. Plan accordingly:
187
+ if you chose `php-laravel` and only have Docker, `dare execute --complete`
188
+ needs to invoke `php artisan test` somehow — typically by running it inside
189
+ your `docker-compose` app service (this is the kind of thing the
190
+ `task-001 = Containerize app` task sets up).
191
+
192
+ ## Installation
193
+
194
+ ```bash
195
+ npm install -g @dewtech/dare-cli
196
+ ```
197
+
198
+ ## Commands
199
+
200
+ ### `dare init`
201
+
202
+ Interactive project initialization — creates the full project structure with DARE methodology files, IDE rules and stack templates.
203
+
204
+ ```bash
205
+ dare init my-project
206
+ ```
207
+
208
+ Prompts:
209
+ - **Structure:** Monorepo · Backend only · Frontend only · **MCP Server** ← new
210
+ - **MCP Server:** language (TypeScript / Python), transport (stdio / SSE / HTTP Stream), capabilities (Tools / Resources / Prompts)
211
+ - **Backend stack:** Rust/Axum · Node.js/NestJS · Python/FastAPI · PHP/Laravel · Go/Gin · Go/stdlib
212
+ - **Frontend stack:** React 18+ · Vue 3+ · Leptos fullstack (Rust SSR+WASM) · Leptos CSR-only (Rust WASM)
213
+ - **Cargo workspace layout** *(Monorepo + Rust/Axum + Leptos only)*: Single-crate (`crates/server` + `crates/web`) · Multi-crate (`{prefix}-core` + `{prefix}-server` + `{prefix}-web` + `{prefix}-cli`) — prefix suggested from project initials (e.g. `ai-runtime-securyti-rasp` → `arsr`)
214
+ - **IDE / Agent:** Claude Code · Cursor · Antigravity · Hybrid
215
+ - **GraphRAG backend:** SQLite · JSON · Neo4j
216
+ - **DARE MCP Server:** context query server (saves ~95% tokens)
217
+
218
+ Generates:
219
+ - `dare.config.json` — project config
220
+ - `CLAUDE.md` + `.claude/commands/` + `.claude/settings.json` — Claude Code rules and slash commands (includes `/dare-security`)
221
+ - `.cursorrules` / `.antigravityrules` — Cursor / Antigravity rules
222
+ - `.cursor/rules/*.mdc` — stack-specific skills
223
+ - `.cursor/commands/` — Cursor slash commands
224
+ - `.agents/skills/` — Antigravity agent skills
225
+ - `DARE/` — methodology directory (DESIGN, BLUEPRINT, TASKS, dag)
226
+ - Full project template ready to run (MCP server, backend or frontend)
227
+
228
+ ---
229
+
230
+ ### `dare discover` ← new in v0.3.0
231
+
232
+ Detects an existing project's stack automatically and installs DARE files without touching your source code.
233
+
234
+ ```bash
235
+ # Run inside an existing project
236
+ cd my-existing-project
237
+ dare discover
238
+
239
+ # Inspect only, no changes
240
+ dare discover --check
241
+
242
+ # Target a specific directory
243
+ dare discover --dir ./path/to/project
244
+ ```
245
+
246
+ Auto-detects from: `package.json`, `Cargo.toml`, `requirements.txt`, `pyproject.toml`, `composer.json`.
247
+
248
+ Recognizes: NestJS · React · Vue · Nuxt · Rust/Axum · FastAPI · Laravel · **MCP Server** (`@modelcontextprotocol/sdk`, `FastMCP`).
249
+
250
+ ---
251
+
252
+ ### `dare design`
253
+
254
+ Generate `DARE/DESIGN.md` from a project description.
255
+
256
+ ```bash
257
+ dare design "Build a REST API for user authentication with JWT"
258
+ ```
259
+
260
+ ---
261
+
262
+ ### `dare blueprint`
263
+
264
+ Generate `DARE/BLUEPRINT.md` from `DESIGN.md`. Stops here — requires human review and approval before tasks are created.
265
+
266
+ ```bash
267
+ dare blueprint
268
+ ```
269
+
270
+ ---
271
+
272
+ ### `dare tasks`
273
+
274
+ Generate `DARE/TASKS.md`, `DARE/dare-dag.yaml` and all `DARE/EXECUTION/task-*.md` specs from an approved `BLUEPRINT.md`. Run this only after reviewing and approving the blueprint.
275
+
276
+ ```bash
277
+ dare tasks
278
+ ```
279
+
280
+ ---
281
+
282
+ ### `dare execute`
283
+
284
+ Orchestrate DAG execution. **The IDE is the executor** (Cursor / Antigravity
285
+ / Claude Code) — `dare execute` only coordinates state, composes prompts
286
+ with parent context, updates the live canvas at `DARE/.canvas.md`, and
287
+ ingests finished tasks into the knowledge graph.
288
+
289
+ > **No API keys, no extra token costs.** You use the plan of the IDE you're
290
+ > already logged into.
291
+
292
+ ```bash
293
+ # Print next executable tasks (with composed prompts)
294
+ dare execute --next
295
+
296
+ # Mark a task DONE after the agent finishes it
297
+ dare execute --complete task-001 --output "Created src/auth.ts and tests/auth.test.ts; all tests green."
298
+
299
+ # Mark a task FAILED — descendants are cascade-skipped automatically
300
+ dare execute --fail task-002 --reason "Schema migration conflict in users table"
301
+
302
+ # Reset a task back to PENDING (for retry)
303
+ dare execute --reset task-002
304
+
305
+ # Show snapshot of canvas + summary (default action)
306
+ dare execute --status
307
+ ```
308
+
309
+ #### Typical flow inside the IDE agent
310
+
311
+ ```bash
312
+ dare execute --next # → tasks ready in current rank
313
+ # (agent executes each task: code, build, test, lint)
314
+ dare execute --complete task-001 --output "…"
315
+ dare execute --complete task-002 --output "…"
316
+ dare execute --next # → next rank
317
+ # (repeat until "✅ All tasks resolved")
318
+ ```
319
+
320
+ The skills shipped by `dare init` (`.cursor/rules/skill-dag-runner.mdc`,
321
+ `.agents/skills/dare-dag-runner/SKILL.md`, `.claude/commands/dare-dag-run.md`)
322
+ guide the IDE agent through this loop.
323
+
324
+ #### Stack-specific skills
325
+
326
+ `dare init` also ships skills focused on architectural decisions for
327
+ specific stacks. As of v2.15.0:
328
+
329
+ - **`skill-rust-workspace.mdc`** (Cursor) /
330
+ **`dare-rust-workspace/SKILL.md`** (Antigravity) /
331
+ **`/dare-rust-workspace`** (Claude command) — guides the agent on
332
+ whether a Rust project should start single-crate or as a Cargo
333
+ workspace, and gives a step-by-step PR-by-PR migration plan when an
334
+ existing single-crate project has outgrown its layout. Active during
335
+ `/dare-design` and `/dare-blueprint` for `rust-axum` projects, plus on
336
+ demand for migration analysis.
337
+
338
+ - **`skill-rust-leptos.mdc`** (Cursor) /
339
+ **`dare-rust-leptos/SKILL.md`** (Antigravity) /
340
+ **`/dare-rust-leptos`** (Claude command) — full guide for Leptos
341
+ development: CSR vs fullstack decision table, Leptos 0.7 idioms
342
+ (signals, Resource, Action, Show, For, `#[server]`), shared types with
343
+ `cfg_attr`, mixed workspace configuration (WASM + native crates), and
344
+ antipatterns to avoid (`cargo leptos test` does not exist; no global
345
+ `[build] target` in `.cargo/config.toml`). Ships 3 ready-to-use DARE
346
+ task templates for Leptos projects.
347
+
348
+ ### `dare bootstrap`
349
+
350
+ Run the official scaffold for a project's stack on **an existing project**
351
+ (created in older versions or with `--skip-bootstrap`). Reads
352
+ `dare.config.json` and dispatches to:
353
+
354
+ - `composer create-project laravel/laravel` for `php-laravel`
355
+ - `npx @nestjs/cli new` for `node-nestjs`
356
+ - `npm create vite` for `react` / `vue`
357
+ - `python -m venv` + `pip install` for `python-fastapi`
358
+ - `cargo init` + axum-ready `Cargo.toml` for `rust-axum`
359
+ - `npm init` + `@modelcontextprotocol/sdk` for `mcp-server-node`
360
+
361
+ ```bash
362
+ dare bootstrap # refuses if vendor/ or node_modules/ already exist
363
+ dare bootstrap --force # runs anyway (may overwrite framework files)
364
+ ```
365
+
366
+ Your DARE artifacts (`.cursor/`, `DARE/`, `dare.config.json`, `dare-graph.yml`)
367
+ are preserved.
368
+
369
+ ### `dare info`
370
+
371
+ Read-only diagnostic of the current project: CLI version, platform, presence
372
+ of each canonical DARE artifact, active GraphRAG backend, and task progress.
373
+
374
+ ```bash
375
+ dare info
376
+ ```
377
+
378
+ ### `dare review` ← new in v2.17.0
379
+
380
+ **Anti-stub gate.** Audita os arquivos que uma task tocou e detecta padrões de "fake completeness": `TODO`/`FIXME`, stubs (`throw new Error('not implemented')`, `todo!()`, `NotImplementedError`), funções vazias, retorno-fantasma (`return null` como única statement), mocks fora de testes (`jest.fn`, `vi.mock`, `sinon.stub`, `MagicMock`), comentários-placeholder (`// implement later`).
381
+
382
+ A camada estática (regex, determinística) é metade. A IDE agent pode rodar a skill `dare-review` / `review-task` para validar critério-a-critério se a implementação atende a spec, emitir um `SemanticVerdict` JSON, e o CLI funde os dois numa única decisão.
383
+
384
+ ```bash
385
+ # Audita os arquivos listados em DARE/EXECUTION/task-034.md
386
+ dare review task-034
387
+
388
+ # Em CI:
389
+ dare review task-034 --strict --format json
390
+
391
+ # Lista explícita de arquivos:
392
+ dare review task-034 --files src/auth/login.ts src/auth/register.ts
393
+
394
+ # Funde com verdito semântico do agente:
395
+ dare review task-034 --from-agent .dare/verdict-task-034.json
396
+ ```
397
+
398
+ **Gate opt-in no Ralph Loop:** com `review.onComplete: true` em `dare.config.json`, `dare execute --complete <id>` bloqueia DONE se a review falhar. Para projetos novos (`dare init` v2.17+) já vem ligado; projetos legados permanecem off até o dev flipar.
399
+
400
+ ### `dare refine` ← new in v2.17.0
401
+
402
+ **Anti-monstro.** Mede complexidade de uma task e, opcionalmente, propõe quebra em sub-tasks menores. Heurística determinística pesa # arquivos, # funções/endpoints, # testes, # dependências, keywords "pesadas" (refactor/migrate/integrate/multiple) — produz um score em LOW (0–5) / MED (6–12) / HIGH (13–20) / CRITICAL (21+).
403
+
404
+ ```bash
405
+ # Apenas mede e reporta:
406
+ dare refine task-034
407
+
408
+ # Mede + propõe quebra em sub-tasks (task-034a, task-034b, ...):
409
+ dare refine task-034 --split
410
+
411
+ # Anota TASKS.md marcando a task para split (o agente regenera as specs):
412
+ dare refine task-034 --split --apply
413
+
414
+ # Em CI: exit code 2 se HIGH/CRITICAL:
415
+ dare refine task-034 --strict
416
+ ```
417
+
418
+ A camada determinística agrupa arquivos por diretório raiz. A IDE agent (skills `dare-refine` / `refine-task`) refina o split semanticamente — por camada (Model/Controller/Service), por endpoint, por feature, refactor-then-feature, migration-then-code.
419
+
420
+ Thresholds configuráveis em `dare.config.json`:
421
+
422
+ ```jsonc
423
+ {
424
+ "refine": {
425
+ "thresholds": { "low": 5, "med": 12, "high": 20 }
426
+ }
427
+ }
428
+ ```
429
+
430
+ ### `dare update` new in v2.17.0
431
+
432
+ Sync the **project's DARE setup** (templates, slash commands, skills, schema)
433
+ with the version of the CLI currently installed. Useful when you upgrade the
434
+ CLI globally (`npm install -g @dewtech/dare-cli@latest`) and want a previous
435
+ project to pick up the new improvements — **without touching your DESIGN /
436
+ BLUEPRINT / TASKS / dare-dag.yaml artifacts**.
437
+
438
+ Different from upgrading the CLI itself: `npm update -g @dewtech/dare-cli`
439
+ changes the binary on your machine; `dare update` changes the *project files
440
+ on disk* to match what that binary now ships.
441
+
442
+ ```bash
443
+ dare update # interactive (recommended)
444
+ dare update --dry-run # preview: shows changelog + affected files, writes nothing
445
+ dare update --yes # CI: apply, preserve customizations, no prompts
446
+ dare update --force # also overwrite files the dev customized (dangerous)
447
+ dare update --target 2.17.0 # update to a specific release instead of the installed CLI
448
+ ```
449
+
450
+ **What it does:**
451
+
452
+ 1. Reads `version` from `dare.config.json` (the project's last-known DARE version).
453
+ 2. Loads `templates/UPDATE-MANIFEST.json` (ships with the CLI) and lists every
454
+ release between the project's version and the CLI's version.
455
+ 3. Prints the changelog for each pending release and the list of files
456
+ affected for your IDE (cursor / claude-code / antigravity / hybrid).
457
+ 4. For each file, classifies the situation:
458
+ - **identical** → skip
459
+ - **missing** → create
460
+ - **apply** → file matches the previous template hash, safe to overwrite
461
+ - **customized** file diverges from the previous template; prompt
462
+ (`keep` / `replace`) unless `--yes` (keep) or `--force` (replace).
463
+ 5. Backs up every affected file to `.dare/backup-<from-version>/` before
464
+ writing.
465
+ 6. Runs any schema migrations declared by the release (e.g. renaming a
466
+ config field).
467
+ 7. Stamps `version` and `updatedAt` in `dare.config.json`.
468
+
469
+ **Adding entries when you cut a release:** each new CLI version that ships
470
+ template changes needs a corresponding entry in `templates/UPDATE-MANIFEST.json`
471
+ listing `changes` (added / modified / removed / renamed) and optional
472
+ `migrations`. The applier filters changes by `appliesTo: [ide]`, so a
473
+ template that's cursor-only won't be installed in a Claude Code project and
474
+ vice versa.
475
+
476
+ ### `dare validate`
477
+
478
+ Static checks on `dare-dag.yaml` ideal for pre-commit hooks and CI.
479
+ Verifies unique kebab-case ids, valid `depends_on`, absence of cycles,
480
+ non-empty prompts, and parallelism (warning when only one task at rank 0).
481
+
482
+ ```bash
483
+ dare validate # errors fail; warnings printed
484
+ dare validate --strict # warnings also fail (CI-friendly)
485
+ ```
486
+
487
+ A pre-commit hook template is shipped at
488
+ `templates/hooks/pre-commit-dare-validate` — copy to `.git/hooks/pre-commit`
489
+ (or use with husky) to validate the DAG before every commit.
490
+
491
+ ### `dare execute --watch`
492
+
493
+ Interactive loop: the CLI watches `.dare/state.json` and re-prints the next
494
+ ready tasks every time the state changes. Pair with the IDE agent firing
495
+ `--complete`/`--fail` from another terminal.
496
+
497
+ ```bash
498
+ dare execute --watch
499
+ ```
500
+
501
+ ### `dare dag`
502
+
503
+ Inspect and visualize the **static task DAG** declared in `dare-dag.yaml`
504
+ distinct from `dare graph`, which inspects the populated knowledge graph
505
+ (only contains tasks already executed).
506
+
507
+ ```bash
508
+ dare dag viz # Mermaid to stdout
509
+ dare dag viz -o DARE/dag-graph.mmd # Mermaid file
510
+ dare dag viz -f dot -o DARE/dag-graph.dot # DOT (Graphviz)
511
+ ```
512
+
513
+ The Mermaid output groups tasks into rank subgraphs and colors nodes by
514
+ status (`PENDING` / `RUNNING` / `DONE` / `FAILED` / `SKIPPED`), so you can
515
+ **see the execution plan before running any task**.
516
+
517
+ > `dare tasks` writes `DARE/dag-graph.mmd` automatically — open it in
518
+ > your editor with a Mermaid preview to see the static graph immediately.
519
+
520
+ ### `dare graph`
521
+
522
+ Inspect the project's knowledge graph. The graph is populated automatically
523
+ by `dare execute --complete/--fail` (task nodes, file nodes, `depends_on` and
524
+ `implements` edges). Backend is whatever `dare-graph.yml` declares
525
+ (`sqlite` default, `json` available, `neo4j` planned).
526
+
527
+ ```bash
528
+ dare graph stats # totals + breakdown by type
529
+ dare graph query auth # search nodes by label/description
530
+ dare graph query auth --limit 20
531
+
532
+ dare graph viz # Mermaid to stdout
533
+ dare graph viz -f dot # DOT for Graphviz
534
+ dare graph viz -o docs/graph.mmd # write to file
535
+
536
+ dare graph ingest # re-sync from dare-dag.yaml + state
537
+ ```
538
+
539
+ ---
540
+
541
+ ## Full Workflow
542
+
543
+ ```bash
544
+ # New project
545
+ dare init my-project
546
+ cd my-project
547
+ dare design "Describe what you're building"
548
+ dare blueprint
549
+ dare execute --parallel
550
+
551
+ # Existing project
552
+ cd my-existing-project
553
+ dare discover
554
+ dare design "Describe what you're building"
555
+ dare blueprint
556
+ dare execute --parallel
557
+ ```
558
+
559
+ ## Claude Code Workflow
560
+
561
+ ```bash
562
+ dare init my-project
563
+ # → IDE: Claude Code
564
+ # → Structure: Backend / Frontend / MCP Server
565
+
566
+ cd my-project
567
+ # Claude Code slash commands available:
568
+ # /dare-design → generates DARE/DESIGN.md
569
+ # /dare-blueprint → generates BLUEPRINT.md + DAG
570
+ # /dare-execute task-001 → implements with Ralph Loop
571
+ # /dare-tasks → shows task status table
572
+ ```
573
+
574
+ Files generated for Claude Code:
575
+ ```
576
+ CLAUDE.md ← main context (stack rules + DARE methodology)
577
+ .claude/
578
+ settings.json ← permissions + Ralph Loop hook
579
+ commands/
580
+ dare-design.md ← /dare-design
581
+ dare-blueprint.md ← /dare-blueprint
582
+ dare-execute.md ← /dare-execute
583
+ dare-tasks.md ← /dare-tasks
584
+ ```
585
+
586
+ ---
587
+
588
+ ## MCP Server Workflow
589
+
590
+ ```bash
591
+ dare init my-mcp-server
592
+ # → Structure: MCP Server
593
+ # → Language: TypeScript
594
+ # → Transport: stdio
595
+ # → Capabilities: Tools, Resources
596
+
597
+ cd my-mcp-server
598
+ npm install
599
+ dare design "MCP server that exposes ZIP code lookup tools"
600
+ dare blueprint
601
+ dare execute --parallel
602
+
603
+ # Test with MCP Inspector
604
+ npm run inspect
605
+ ```
606
+
607
+ ---
608
+
609
+ ## Performance
610
+
611
+ | Mode | Estimated Time |
612
+ |------|----------------|
613
+ | Sequential | ~280 minutes |
614
+ | Parallel DAG | ~70 minutes |
615
+ | **Improvement** | **75% faster** |
616
+
617
+ ---
618
+
619
+ ## Supported Stacks
620
+
621
+ | Type | Options |
622
+ |------|---------|
623
+ | **Backend** | Rust/Axum · Node.js/NestJS · Python/FastAPI · PHP/Laravel · Go/Gin · Go/stdlib |
624
+ | **Frontend** | React 18+ · Vue 3+ · Leptos fullstack (Rust SSR+WASM) · Leptos CSR (Rust WASM) |
625
+ | **MCP Server** | TypeScript/Node.js · Python — stdio / SSE / HTTP Stream |
626
+ | **IDE / Agent** | Claude Code · Cursor · Antigravity · Hybrid |
627
+
628
+ ---
629
+
630
+ ## O que vem com o pacote (v2.0+)
631
+
632
+ A partir da v2.0 o `@dewtech/dare-cli` é um **pacote único** que inclui todas as
633
+ funcionalidades do framework DARE. Você não precisa instalar nada além dele:
634
+
635
+ ```bash
636
+ npm install -g @dewtech/dare-cli
637
+ ```
638
+
639
+ Isso já dá:
640
+
641
+ | Componente | O que é |
642
+ |------------|---------|
643
+ | CLI `dare` | `init`, `design`, `blueprint`, `execute`, `discover` |
644
+ | CLI `dare-mcp-server` | Servidor MCP local de contexto (~95% economia de tokens) |
645
+ | Engine GraphRAG | Grafo de conhecimento com SQLite + FTS5 |
646
+ | DAG Task Runner | Execução paralela de tasks com Kahn's algorithm |
647
+ | Tipos e templates | Tudo embutido — sem dependências externas do `@dewtech/*` |
648
+
649
+ > **Histórico (v1.x):** os pacotes `@dewtech/dare-core`, `@dewtech/dare-graphrag` e
650
+ > `@dewtech/dare-mcp-server` foram consolidados em `@dewtech/dare-cli` e estão
651
+ > **deprecated** no npm. Não há mais subpacotes para gerenciar.
652
+
653
+ ---
654
+
655
+ ## Links
656
+
657
+ - [GitHub](https://github.com/dewtech-technologies/dare-method)
658
+ - [DARE Methodology](https://github.com/dewtech-technologies/dare-method#-o-método)
659
+ - [Dewtech](https://dewtech.tech)