@donotdev/cli 0.2.3 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/dependencies-matrix.json +27 -26
  2. package/dist/bin/commands/build.js +64 -2
  3. package/dist/bin/commands/bump.js +98 -13
  4. package/dist/bin/commands/db-check.js +192804 -0
  5. package/dist/bin/commands/db.js +16 -1
  6. package/dist/bin/commands/make-admin.js +22 -6
  7. package/dist/bin/commands/seed.js +313 -236
  8. package/dist/bin/commands/setup.js +549 -97
  9. package/dist/bin/dndev.js +23 -7
  10. package/dist/index.js +64 -2
  11. package/package.json +1 -1
  12. package/templates/app-demo/index.html.example +1 -1
  13. package/templates/app-dndev/index.html.example +1 -1
  14. package/templates/app-dndev/src/globals.css.example +1 -1
  15. package/templates/app-next/src/app/AppDocument.tsx.example +3 -2
  16. package/templates/app-next/src/globals.css.example +1 -1
  17. package/templates/app-vite/csp.example.json +1 -1
  18. package/templates/app-vite/index.html.example +1 -1
  19. package/templates/app-vite/src/globals.css.example +1 -1
  20. package/templates/deploy-config/vercel.json.example +2 -2
  21. package/templates/functions-supabase/supabase/migrations/20250101000006_crud_bulk_status_guard.sql +258 -0
  22. package/templates/functions-supabase/supabase/migrations/20250101000007_rate_limit_check.sql +76 -0
  23. package/templates/root-consumer/.claude/hooks/guard-bash.sh.example +3 -3
  24. package/templates/root-consumer/.claude/hooks/typecheck-stop.sh.example +2 -2
  25. package/templates/root-consumer/.claude/rules/definition-of-done.md.example +2 -2
  26. package/templates/root-consumer/.claude/rules/framework.md.example +1 -1
  27. package/templates/root-consumer/.claude/skills/build/SKILL.md.example +1 -1
  28. package/templates/root-consumer/.claude/skills/polish/SKILL.md.example +1 -1
  29. package/templates/root-consumer/AGENTS.md.example +25 -2
  30. package/templates/root-consumer/README.md.example +1 -1
@@ -31,7 +31,7 @@ Rules:
31
31
  ## Step 2 - Validate
32
32
 
33
33
  ```bash
34
- dndev tc
34
+ dn tc
35
35
  ```
36
36
 
37
37
  Type-check must pass before completion.
@@ -62,7 +62,7 @@ Create `.github/workflows/ci.yml`: type-check → test → build → deploy.
62
62
  ## Step 6 — Validate
63
63
 
64
64
  ```bash
65
- dndev tc # Type-check
65
+ dn tc # Type-check
66
66
  bun test # All tests pass
67
67
  ```
68
68
 
@@ -2,6 +2,8 @@
2
2
 
3
3
  > **You are building a DoNotDev app.** This file is the single source of truth for how to work here.
4
4
 
5
+ **Also load your global agent instructions** (e.g. `~/.claude/CLAUDE.md`, `~/.claude/AGENTS.md`, or your tool's global instructions file). This file adds the framework's rules on top of them.
6
+
5
7
  ## Golden path (do this first)
6
8
 
7
9
  1. **Enable MCP** — project includes `.mcp.json` / `.cursor/mcp.json`. If tools fail, run **`get_guideline("AGENT_START_HERE")`** for IDE-specific steps.
@@ -13,7 +15,7 @@ Architecture and API contracts: **`get_guideline(...)`** and **`lookup_symbol(..
13
15
 
14
16
  ## The 5 phases
15
17
 
16
- Work inside an active phase: **`start_phase(N)`** before work, **`complete_phase({ files })`** before moving on, **`dndev tc`** before completing a phase when you changed code.
18
+ Work inside an active phase: **`start_phase(N)`** before work, **`complete_phase({ files })`** before moving on, **`dn tc`** before completing a phase when you changed code.
17
19
 
18
20
  | Phase | Name | Skill (slash) | Focus |
19
21
  |-------|------|---------------|--------|
@@ -36,6 +38,13 @@ Work inside an active phase: **`start_phase(N)`** before work, **`complete_phase
36
38
 
37
39
  Last resort: after **`lookup_symbol`** + **`search_framework`**. If you must add one, put it under `src/components/` and document the gap (e.g. JSDoc `@custom-component`). Do not block the user on tooling — deliver working UI.
38
40
 
41
+ ## Database credentials
42
+
43
+ - The project-root `.dndev.secrets` contains the privileged ("god mode") CLI token. Check it before reporting that live database access is blocked or asking the user for credentials.
44
+ - If database MCP authentication fails, use the CLI with the credentials in `.dndev.secrets`; do not assume the public keys in app `.env` files are the only available credentials.
45
+ - Never print token values or copy secrets into documentation, logs, chat, or committed files.
46
+ - Credentials do not authorize extra changes: preserve the user's scope and any required preview/approval before live writes.
47
+
39
48
  ## CLI essentials
40
49
 
41
50
  `dndev` is the project CLI (global or `bunx dndev`). Common commands:
@@ -43,12 +52,20 @@ Last resort: after **`lookup_symbol`** + **`search_framework`**. If you must add
43
52
  | Command | Purpose |
44
53
  |---------|---------|
45
54
  | `dndev dev` / `dndev dev:app` | Dev server |
46
- | `dndev tc` / `dndev tc:app` | Type-check (use after code changes) |
55
+ | `dn tc` / `dn tc --package <name>` | Type-check (use after code changes) |
47
56
  | `dndev build` | Production build |
48
57
  | `dndev coach` / `dndev setup` / `dndev doctor` | Env and health |
49
58
 
50
59
  Run **`dndev --help`** for the full list. **`dndev create-app`** is interactive (no `--preset`).
51
60
 
61
+ ## Dev & test flow
62
+
63
+ - **No local database.** The app runs locally against the live Supabase database. Never `--local`, never `supabase start` / `supabase db reset`.
64
+ - **Live data:** reads OK. Live writes and migrations only on the owner's order.
65
+ - **Framework changes** arrive via `dn pack --install` run from the framework repo (unpublished build). A `bun install` reverts them: re-run `dn pack`.
66
+ - **Test** by running the app locally on the live database. Typecheck with `dn tc`.
67
+ - **Deploy** only on the owner's order.
68
+
52
69
  ## Docs and markdown
53
70
 
54
71
  - Do not create random `.md` files. Allowed workflow outputs when the phase requires them: e.g. **`docs/HLD.md`**, **`docs/LLD.md`**.
@@ -61,3 +78,9 @@ Run **`dndev --help`** for the full list. **`dndev create-app`** is interactive
61
78
  ## MCP tools (quick reference)
62
79
 
63
80
  `start_phase` · `complete_phase` · `approve_phase` · `get_phase_status` · `lookup_symbol` · `get_guideline` · `search_framework` · `setup_coach` · `list_features` · `run_typecheck` · `record_lesson`
81
+
82
+ ## Project-specific rules
83
+
84
+ `dndev bump` regenerates everything above the marker below from the framework template; do not edit it. Rules that apply to this project only go below the marker: `dndev bump` keeps them as they are.
85
+
86
+ <!-- dndev:project-specific -->
@@ -49,7 +49,7 @@ dndev staging # Deploy to staging environment
49
49
  dndev sync-secrets # Push functions/.env secrets to Firebase Secret Manager
50
50
 
51
51
  # Quality
52
- dndev tc # Type-check (preferred)
52
+ dn tc # Type-check (preferred)
53
53
  bun test # Run tests
54
54
  dndev build # Production build (or bun run build per app)
55
55
  ```