@donotdev/cli 0.0.28 → 0.0.30

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 (25) hide show
  1. package/dependencies-matrix.json +26 -16
  2. package/dist/bin/commands/bump.js +129 -8
  3. package/dist/bin/commands/db.js +5 -2
  4. package/dist/bin/commands/deploy.js +7 -4
  5. package/dist/bin/commands/make-admin.js +225 -122
  6. package/dist/bin/commands/seed.js +5 -2
  7. package/dist/bin/commands/setup.js +3 -5
  8. package/dist/bin/commands/staging.js +7 -4
  9. package/dist/bin/dndev.js +1 -1
  10. package/dist/bin/donotdev.js +1 -1
  11. package/dist/index.js +11 -8
  12. package/package.json +1 -1
  13. package/templates/app-next/src/locales/home_en.json.example +6 -6
  14. package/templates/app-vite/src/locales/home_en.json.example +6 -6
  15. package/templates/overlay-supabase/src/config/providers.expo.ts.example +3 -2
  16. package/templates/overlay-supabase/src/config/providers.ts.example +3 -2
  17. package/templates/root-consumer/.claude/skills/brainstorm/SKILL.md.example +58 -0
  18. package/templates/root-consumer/.claude/skills/build/SKILL.md.example +50 -0
  19. package/templates/root-consumer/.claude/skills/design/SKILL.md.example +46 -0
  20. package/templates/root-consumer/.claude/skills/design/output-template.md +35 -0
  21. package/templates/root-consumer/.claude/skills/grill/SKILL.md.example +70 -0
  22. package/templates/root-consumer/.claude/skills/polish/SKILL.md.example +76 -0
  23. package/templates/root-consumer/.claude/skills/techdebt/SKILL.md.example +46 -0
  24. package/templates/root-consumer/guides/dndev/advanced/COOKIE_REFERENCE.md.example +252 -252
  25. package/templates/root-consumer/guides/dndev/advanced/VERSION_CONTROL.md.example +174 -174
@@ -58878,7 +58878,7 @@ __export(supabase_management_exports, {
58878
58878
  extractProjectRef: () => extractProjectRef,
58879
58879
  tableExists: () => tableExists
58880
58880
  });
58881
- import { execSync } from "node:child_process";
58881
+ import { execSync, spawnSync } from "node:child_process";
58882
58882
  function createAdminClient(supabaseUrl, secretKey) {
58883
58883
  return createClient(supabaseUrl, secretKey, {
58884
58884
  auth: {
@@ -58988,13 +58988,16 @@ async function deployEdgeFunction(options) {
58988
58988
  try {
58989
58989
  const cmd = getSupabaseCmd();
58990
58990
  const projectDir = joinPath(supabaseDir, "..");
58991
- execSync(`${cmd} functions deploy ${functionName}`, {
58991
+ const result = spawnSync(cmd, ["functions", "deploy", functionName], {
58992
58992
  cwd: projectDir,
58993
58993
  stdio: "pipe",
58994
58994
  env: {
58995
58995
  ...process.env
58996
58996
  }
58997
58997
  });
58998
+ if (result.status !== 0) {
58999
+ throw new Error(result.stderr?.toString() || "Deploy failed");
59000
+ }
58998
59001
  } catch (error2) {
58999
59002
  const message = error2 instanceof Error ? error2.message : String(error2);
59000
59003
  throw new Error(`Failed to deploy Edge Function: ${message}`);
@@ -8615,9 +8615,8 @@ __export(firebase_exports, {
8615
8615
  });
8616
8616
  import { spawnSync } from "node:child_process";
8617
8617
  function firebaseJson(args) {
8618
- const result = spawnSync(`firebase ${[...args, "--json"].join(" ")}`, {
8618
+ const result = spawnSync("firebase", [...args, "--json"], {
8619
8619
  stdio: ["inherit", "pipe", "pipe"],
8620
- shell: true,
8621
8620
  encoding: "utf-8"
8622
8621
  });
8623
8622
  if (result.error) {
@@ -8632,9 +8631,8 @@ function firebaseJson(args) {
8632
8631
  }
8633
8632
  function isFirebaseLoggedIn() {
8634
8633
  try {
8635
- const result = spawnSync("firebase projects:list --json", {
8634
+ const result = spawnSync("firebase", ["projects:list", "--json"], {
8636
8635
  stdio: ["inherit", "pipe", "pipe"],
8637
- shell: true,
8638
8636
  encoding: "utf-8",
8639
8637
  timeout: 15e3
8640
8638
  });
@@ -9111,7 +9109,7 @@ var init_firebase = __esm({
9111
9109
  });
9112
9110
 
9113
9111
  // packages/tooling/src/utils/supabase-management.ts
9114
- import { execSync } from "node:child_process";
9112
+ import { execSync, spawnSync as spawnSync2 } from "node:child_process";
9115
9113
  function extractProjectRef(supabaseUrl) {
9116
9114
  const match = supabaseUrl.match(/https?:\/\/([a-z0-9]+)\.supabase\.co/);
9117
9115
  if (!match?.[1]) {
@@ -16543,7 +16543,7 @@ var deploy_supabase_functions_exports = {};
16543
16543
  __export(deploy_supabase_functions_exports, {
16544
16544
  deploySupabaseFunctions: () => deploySupabaseFunctions
16545
16545
  });
16546
- import { execSync as execSync3 } from "node:child_process";
16546
+ import { spawnSync as spawnSync6 } from "node:child_process";
16547
16547
  async function deploySupabaseFunctions(appDir, config) {
16548
16548
  const supabaseDir = joinPath(appDir, "supabase");
16549
16549
  const functionsDir = joinPath(supabaseDir, "functions");
@@ -16578,7 +16578,7 @@ async function deploySupabaseFunctions(appDir, config) {
16578
16578
  for (const functionName of functionDirs) {
16579
16579
  s.start(`Deploying Edge Function: ${functionName}...`);
16580
16580
  try {
16581
- execSync3(`supabase functions deploy ${functionName}`, {
16581
+ const result = spawnSync6("supabase", ["functions", "deploy", functionName], {
16582
16582
  cwd: supabaseDir,
16583
16583
  stdio: config.verbose ? "inherit" : "pipe",
16584
16584
  env: {
@@ -16586,6 +16586,9 @@ async function deploySupabaseFunctions(appDir, config) {
16586
16586
  DNDEV_APP_ROOT: appDir
16587
16587
  }
16588
16588
  });
16589
+ if (result.status !== 0) {
16590
+ throw new Error(result.stderr?.toString() || "Deploy failed");
16591
+ }
16589
16592
  s.stop(`Deployed: ${functionName}`);
16590
16593
  } catch (error2) {
16591
16594
  s.stop(`Failed to deploy: ${functionName}`);
@@ -16752,7 +16755,7 @@ function safeRemove(path, options = {}) {
16752
16755
 
16753
16756
  // packages/tooling/src/apps/deploy.ts
16754
16757
  init_utils();
16755
- import { execSync as execSync4 } from "node:child_process";
16758
+ import { execSync as execSync3 } from "node:child_process";
16756
16759
 
16757
16760
  // packages/tooling/src/apps/deploy-frontend.ts
16758
16761
  init_utils();
@@ -18055,7 +18058,7 @@ async function main2(options = {}) {
18055
18058
  isStaging ? "Building (staging mode)..." : "Building application..."
18056
18059
  );
18057
18060
  try {
18058
- execSync4(buildCmd, {
18061
+ execSync3(buildCmd, {
18059
18062
  cwd: appDir,
18060
18063
  stdio: "inherit",
18061
18064
  env: {
package/dist/bin/dndev.js CHANGED
@@ -950,7 +950,7 @@ function registerCommand(program2, def, action) {
950
950
  }
951
951
 
952
952
  // packages/cli/src/bin/dndev.mjs
953
- var CLI_VERSION = true ? "0.0.28" : "0.0.0";
953
+ var CLI_VERSION = true ? "0.0.30" : "0.0.0";
954
954
  var args = process.argv.slice(2);
955
955
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v")) {
956
956
  console.log(CLI_VERSION);
@@ -950,7 +950,7 @@ function registerCommand(program2, def, action) {
950
950
  }
951
951
 
952
952
  // packages/cli/src/bin/dndev.mjs
953
- var CLI_VERSION = true ? "0.0.28" : "0.0.0";
953
+ var CLI_VERSION = true ? "0.0.30" : "0.0.0";
954
954
  var args = process.argv.slice(2);
955
955
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v")) {
956
956
  console.log(CLI_VERSION);
package/dist/index.js CHANGED
@@ -17224,7 +17224,7 @@ var deploy_supabase_functions_exports = {};
17224
17224
  __export(deploy_supabase_functions_exports, {
17225
17225
  deploySupabaseFunctions: () => deploySupabaseFunctions
17226
17226
  });
17227
- import { execSync as execSync9 } from "node:child_process";
17227
+ import { spawnSync as spawnSync9 } from "node:child_process";
17228
17228
  async function deploySupabaseFunctions(appDir, config) {
17229
17229
  const supabaseDir = joinPath(appDir, "supabase");
17230
17230
  const functionsDir = joinPath(supabaseDir, "functions");
@@ -17259,7 +17259,7 @@ async function deploySupabaseFunctions(appDir, config) {
17259
17259
  for (const functionName of functionDirs) {
17260
17260
  s.start(`Deploying Edge Function: ${functionName}...`);
17261
17261
  try {
17262
- execSync9(`supabase functions deploy ${functionName}`, {
17262
+ const result = spawnSync9("supabase", ["functions", "deploy", functionName], {
17263
17263
  cwd: supabaseDir,
17264
17264
  stdio: config.verbose ? "inherit" : "pipe",
17265
17265
  env: {
@@ -17267,6 +17267,9 @@ async function deploySupabaseFunctions(appDir, config) {
17267
17267
  DNDEV_APP_ROOT: appDir
17268
17268
  }
17269
17269
  });
17270
+ if (result.status !== 0) {
17271
+ throw new Error(result.stderr?.toString() || "Deploy failed");
17272
+ }
17270
17273
  s.stop(`Deployed: ${functionName}`);
17271
17274
  } catch (error2) {
17272
17275
  s.stop(`Failed to deploy: ${functionName}`);
@@ -18437,7 +18440,7 @@ async function main4() {
18437
18440
 
18438
18441
  // packages/tooling/src/apps/deploy.ts
18439
18442
  init_utils();
18440
- import { execSync as execSync10 } from "node:child_process";
18443
+ import { execSync as execSync9 } from "node:child_process";
18441
18444
 
18442
18445
  // packages/tooling/src/apps/deploy-frontend.ts
18443
18446
  init_utils();
@@ -20250,7 +20253,7 @@ async function main6(options = {}) {
20250
20253
  isStaging ? "Building (staging mode)..." : "Building application..."
20251
20254
  );
20252
20255
  try {
20253
- execSync10(buildCmd, {
20256
+ execSync9(buildCmd, {
20254
20257
  cwd: appDir,
20255
20258
  stdio: "inherit",
20256
20259
  env: {
@@ -21093,8 +21096,8 @@ async function main9(options) {
21093
21096
  try {
21094
21097
  Ie("\u{1F680} DoNotDev Project Creator");
21095
21098
  try {
21096
- const { execSync: execSync11 } = await import("node:child_process");
21097
- execSync11("bun --version", { stdio: "ignore" });
21099
+ const { execSync: execSync10 } = await import("node:child_process");
21100
+ execSync10("bun --version", { stdio: "ignore" });
21098
21101
  } catch {
21099
21102
  log.error("bun is required but not installed.");
21100
21103
  Me(
@@ -21607,7 +21610,7 @@ init_utils();
21607
21610
  init_cli_output();
21608
21611
  init_errors();
21609
21612
  init_pathResolver();
21610
- import { spawnSync as spawnSync9 } from "node:child_process";
21613
+ import { spawnSync as spawnSync10 } from "node:child_process";
21611
21614
  import { EOL as EOL2 } from "node:os";
21612
21615
  async function main10(options = {}) {
21613
21616
  const dryRun = options.dryRun ?? false;
@@ -22087,7 +22090,7 @@ async function runPrettier(rootDir, dryRun, verbose) {
22087
22090
  log.info("DRY RUN: Would run Prettier");
22088
22091
  return stats;
22089
22092
  }
22090
- const result = spawnSync9(`bunx ${prettierArgs.join(" ")}`, {
22093
+ const result = spawnSync10(`bunx ${prettierArgs.join(" ")}`, {
22091
22094
  cwd: rootDir,
22092
22095
  stdio: "pipe",
22093
22096
  shell: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@donotdev/cli",
3
- "version": "0.0.28",
3
+ "version": "0.0.30",
4
4
  "description": "Command-line interface for DoNotDev Framework",
5
5
  "type": "module",
6
6
  "private": false,
@@ -1,6 +1,6 @@
1
- {
2
- "hero": {
3
- "title": "Welcome to DnDev",
4
- "subtitle": "Your app is ready. Explore the framework patterns below."
5
- }
6
- }
1
+ {
2
+ "hero": {
3
+ "title": "Welcome to DnDev",
4
+ "subtitle": "Your app is ready. Explore the framework patterns below."
5
+ }
6
+ }
@@ -1,6 +1,6 @@
1
- {
2
- "hero": {
3
- "title": "Welcome to DnDev",
4
- "subtitle": "Your app is ready. Explore the framework patterns below."
5
- }
6
- }
1
+ {
2
+ "hero": {
3
+ "title": "Welcome to DnDev",
4
+ "subtitle": "Your app is ready. Explore the framework patterns below."
5
+ }
6
+ }
@@ -2,11 +2,11 @@
2
2
  // Auto-generated by DoNotDev scaffolding. Edit freely.
3
3
  // Import from root layout (app/_layout.tsx): import '../src/config/providers';
4
4
 
5
- import { createClient } from '@supabase/supabase-js';
6
-
7
5
  import { configureProviders } from '@donotdev/core';
8
6
  import {
7
+ createClient,
9
8
  SupabaseAuth,
9
+ SupabaseCallableProvider,
10
10
  SupabaseCrudAdapter,
11
11
  SupabaseStorageAdapter,
12
12
  } from '@donotdev/supabase';
@@ -31,5 +31,6 @@ if (!url || !publicKey) {
31
31
  crud: new SupabaseCrudAdapter(supabase),
32
32
  auth: new SupabaseAuth(supabase),
33
33
  storage: new SupabaseStorageAdapter(supabase),
34
+ callable: new SupabaseCallableProvider(supabase),
34
35
  });
35
36
  }
@@ -2,11 +2,11 @@
2
2
  // Auto-generated by DoNotDev scaffolding. Edit freely.
3
3
  // Import from root component (App.tsx): import './config/providers';
4
4
 
5
- import { createClient } from '@supabase/supabase-js';
6
-
7
5
  import { configureProviders } from '@donotdev/core';
8
6
  import {
7
+ createClient,
9
8
  SupabaseAuth,
9
+ SupabaseCallableProvider,
10
10
  SupabaseCrudAdapter,
11
11
  SupabaseStorageAdapter,
12
12
  } from '@donotdev/supabase';
@@ -29,5 +29,6 @@ if (!url || !publicKey) {
29
29
  crud: new SupabaseCrudAdapter(supabase),
30
30
  auth: new SupabaseAuth(supabase),
31
31
  storage: new SupabaseStorageAdapter(supabase),
32
+ callable: new SupabaseCallableProvider(supabase),
32
33
  });
33
34
  }
@@ -0,0 +1,58 @@
1
+ ---
2
+ name: brainstorm
3
+ description: Extract requirements and generate complete HLD through interactive conversation. First step in the WAI-WAY workflow.
4
+ argument-hint: [app idea or requirement]
5
+ disable-model-invocation: true
6
+ ---
7
+
8
+ # Brainstorm — Requirements Extraction
9
+
10
+ **WORKFLOW:** `/brainstorm` → `/design` → `/build` → `/polish`
11
+
12
+ ## Step 0 — Start Phase (MANDATORY)
13
+
14
+ ```
15
+ start_phase(0)
16
+ ```
17
+ Do NOT proceed without this call.
18
+
19
+ ## Step 1 — Extract
20
+
21
+ **Input:** $ARGUMENTS
22
+
23
+ Ask probing questions **one at a time**. Use MCP to discover framework capabilities.
24
+
25
+ | Extract | Questions |
26
+ |---------|-----------|
27
+ | **Vision** | What is this app? Who uses it? |
28
+ | **Users** | Roles? Permissions? |
29
+ | **Entities** | What "things" exist? Fields? Relations? |
30
+ | **Features** | What can users DO? MVP vs V2? |
31
+ | **Pages** | Screens? Routes? Access levels? |
32
+ | **Constraints** | Platform? Languages? Auth? Integrations? |
33
+ | **Native vs Custom** | What uses framework defaults? What needs custom? |
34
+
35
+ Rules:
36
+ - One question at a time — wait for answer
37
+ - Probe vague answers: "What does 'manage' mean?"
38
+ - Challenge scope: "What's the minimum to launch?"
39
+ - Summarize progress every 3-4 exchanges
40
+ - Never guess — ask
41
+
42
+ ## Step 2 — Generate HLD
43
+
44
+ When all targets extracted, write to `docs/HLD.md` with: Vision, Users, Entities (fields + types + access), Features (MVP/V2), Pages (routes + access), Constraints, Native vs Custom, Open Questions.
45
+
46
+ **Validation before completing:**
47
+ - [ ] No empty sections or TBDs
48
+ - [ ] All entities have fields, states, permissions
49
+ - [ ] All business rules documented
50
+ - [ ] User has validated
51
+
52
+ ## Step 3 — Complete Phase
53
+
54
+ ```
55
+ complete_phase({ files: ["docs/HLD.md"], summary: "HLD complete — N entities, N pages, N features" })
56
+ ```
57
+
58
+ Wait for user `approve_phase()` → then proceed to `/design`.
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: build
3
+ description: Implement features using framework defaults. Use AFTER /design. Activates WAI-WAY Phase 3 COMPOSE.
4
+ argument-hint: [requirement or LLD reference]
5
+ disable-model-invocation: true
6
+ ---
7
+
8
+ # Build — Compose the App
9
+
10
+ **WORKFLOW:** `/brainstorm` → `/design` → `/build` → `/polish`
11
+
12
+ ## Step 0 — Start Phase (MANDATORY)
13
+
14
+ ```
15
+ start_phase(3)
16
+ ```
17
+ Do NOT write code without this call.
18
+
19
+ ## Step 1 — Prepare
20
+
21
+ **Input:** $ARGUMENTS (LLD from `/design` or direct requirement)
22
+
23
+ 1. Read LLD if it exists
24
+ 2. **STOP before every `@donotdev` import** → call `lookup_symbol({ symbol: "Name" })`. No exceptions. Do NOT guess props, hooks, or APIs.
25
+ 3. Import convention: always `@donotdev/<package>` — never sub-paths. Only exceptions: `@donotdev/core/server`, `@donotdev/core/vite`, `@donotdev/core/next`, `@donotdev/core/functions`.
26
+
27
+ ## Step 2 — Build in phases
28
+
29
+ 1. **Entities** — create entity files
30
+ 2. **Routes** — create route config
31
+ 3. **Auth** — if needed
32
+ 4. **Pages** — using framework defaults only (no styling, no customization)
33
+ 5. **Custom components** — if any
34
+ 6. **Integration** — wire everything together
35
+
36
+ Rules:
37
+ - Framework defaults ONLY — styling deferred to `/polish`
38
+ - Hardcode all strings — i18n deferred to `/polish`
39
+ - Run `dndev tc` after every file change — fix errors immediately
40
+ - Validate each phase before proceeding
41
+
42
+ ## Step 3 — Complete Phase
43
+
44
+ When all pages built and `dndev tc` passes:
45
+
46
+ ```
47
+ complete_phase({ files: ["src/pages/...all files..."], summary: "N pages composed, all type-checking" })
48
+ ```
49
+
50
+ Wait for user `approve_phase()` → then proceed to `/polish`.
@@ -0,0 +1,46 @@
1
+ ---
2
+ name: design
3
+ description: Architecture and design workflow. Creates technical plan / LLD. Use BEFORE /build, AFTER /brainstorm. Activates WAI-WAY Phase 1-2.
4
+ argument-hint: [requirement or question]
5
+ disable-model-invocation: true
6
+ ---
7
+
8
+ # Design — Architecture & Planning
9
+
10
+ **WORKFLOW:** `/brainstorm` → `/design` → `/build` → `/polish`
11
+
12
+ ## Step 0 — Start Phase (MANDATORY)
13
+
14
+ ```
15
+ start_phase(1) # SCAFFOLD (routes, page stubs)
16
+ start_phase(2) # ENTITIES (data models, fields, access)
17
+ ```
18
+ Pick the appropriate phase. Do NOT proceed without this call.
19
+
20
+ ## Step 1 — Analyze
21
+
22
+ **Input:** $ARGUMENTS
23
+
24
+ 1. Read constraints from `CLAUDE.md` and framework docs
25
+ 2. Search codebase for existing patterns
26
+ 3. **Always `lookup_symbol`** when referencing @donotdev components — verify API exists before planning
27
+ 4. Import convention: always `@donotdev/<package>` top-level, never sub-paths
28
+
29
+ ## Step 2 — Design
30
+
31
+ Produce a design document. For the output template, see [output-template.md](output-template.md).
32
+
33
+ Rules:
34
+ - **NEVER write code** — only design and plan
35
+ - **ALWAYS analyze existing patterns** — don't reinvent
36
+ - **ALWAYS consider trade-offs** — no solution is perfect
37
+ - **ALWAYS identify impacts** — what breaks if we change this?
38
+ - **ALWAYS prepare for /build** — design must be actionable
39
+
40
+ ## Step 3 — Complete Phase
41
+
42
+ ```
43
+ complete_phase({ files: ["...affected files..."], summary: "Description of what was designed" })
44
+ ```
45
+
46
+ Wait for user `approve_phase()` → then proceed to `/build`.
@@ -0,0 +1,35 @@
1
+ # Design Document Template
2
+
3
+ Use this format for `/design` output:
4
+
5
+ ```
6
+ DESIGN DOCUMENT:
7
+
8
+ REQUIREMENT:
9
+ [Clear statement of what needs to be designed]
10
+
11
+ ANALYSIS:
12
+ - Current state: [what exists]
13
+ - Problem: [what needs solving]
14
+ - Constraints: [framework rules, patterns, etc.]
15
+
16
+ DESIGN:
17
+ [Architecture/solution design]
18
+
19
+ TRADE-OFFS:
20
+ - Option A: [pros/cons]
21
+ - Option B: [pros/cons]
22
+ - Recommendation: [which and why]
23
+
24
+ IMPLEMENTATION PLAN:
25
+ - Files to create/modify: [list]
26
+ - Changes needed: [detailed breakdown]
27
+ - Dependencies: [what depends on this]
28
+ - Testing: [how to validate]
29
+
30
+ READY FOR /build:
31
+ [Summary of what will be built]
32
+
33
+ UNRESOLVED:
34
+ - [Any open questions]
35
+ ```
@@ -0,0 +1,70 @@
1
+ ---
2
+ name: grill
3
+ description: Critical staff-engineer code review — flags problems before shipping. Blocking review with high-signal findings only.
4
+ disable-model-invocation: true
5
+ argument-hint: [files, areas, or "full"]
6
+ ---
7
+
8
+ **Phase gate: only use after Phase 3 (COMPOSE) is complete.**
9
+
10
+ Skeptical staff engineer doing a blocking code review. Find things that will **break, lose data, or mislead**.
11
+
12
+ ## Step 0 — Situational Awareness
13
+
14
+ 1. Read `.dndev/grill-report.json` — last run's SHA, target, items
15
+ 2. Read `.dndev/grill-ignore.json` — accepted deviations (SSOT for exclusions)
16
+ 3. Check current `git rev-parse --short HEAD`
17
+
18
+ **No-op:** Same perimeter + same SHA as last run → skip. Nothing changed.
19
+
20
+ **If `$ARGUMENTS` provided** — use as perimeter.
21
+ **If empty** — check what changed since last grill. Propose and proceed unless ambiguous.
22
+
23
+ ## Step 1 — Archive
24
+
25
+ If `.dndev/grill-report.json` has resolved items (`fixed`, `resolved`, `rejected`):
26
+ - Archive to `.dndev/grill-history.json`
27
+ - Keep surviving items for merge
28
+
29
+ ## Step 2 — Scan
30
+
31
+ Review target files for:
32
+ - **BLOCKER** — breaks in production, loses data, security issues, breaking API changes
33
+ - **WARN** — real problems users will hit (missing edge cases, misleading dead code)
34
+ - **NOTE** — sparingly, genuine gotchas only
35
+
36
+ What NOT to flag:
37
+ - Optimization suggestions, style, formatting
38
+ - Hypothetical edge cases against TypeScript types
39
+ - Dev-only code, harmless dead code
40
+ - Over-engineering suggestions
41
+
42
+ **Self-test:** "Would I block a PR for this?" No → skip.
43
+
44
+ Also check: @donotdev component usage without `lookup_symbol` verification.
45
+
46
+ ## Step 3 — Filter + Write
47
+
48
+ 1. Filter out `grill-ignore.json` matches (fuzzy on issue text)
49
+ 2. Deduplicate against carried items
50
+ 3. Merge and write to `.dndev/grill-report.json`:
51
+
52
+ ```json
53
+ {
54
+ "generated": "<ISO>",
55
+ "gitSha": "<short HEAD>",
56
+ "target": "<what was reviewed>",
57
+ "verdict": "SHIP | DO NOT SHIP",
58
+ "items": [{ "id": 1, "severity": "...", "file": "...", "line": 0, "issue": "...", "category": "...", "status": "pending", "verified": true }]
59
+ }
60
+ ```
61
+
62
+ If any blocker → DO NOT SHIP.
63
+
64
+ ## Fixing (on demand, not during scan)
65
+
66
+ When asked to fix: apply fix, set `status: "fixed"`, set `lastReviewed`.
67
+
68
+ **Quality > quantity. 15 real issues >>> 60 padded items.**
69
+
70
+ Print: `Cleaned N → history. Carried M. Added K. Total: T.` + verdict.
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: polish
3
+ description: Generate tests, database rules, CI/CD, config, fix bugs, i18n (Phase 4). Use AFTER /build when the app works and needs production-readiness.
4
+ argument-hint: [task]
5
+ disable-model-invocation: true
6
+ ---
7
+
8
+ # Polish — Production-Ready
9
+
10
+ **WORKFLOW:** `/brainstorm` → `/design` → `/build` → `/polish`
11
+
12
+ ## Step 0 — Start Phase (MANDATORY)
13
+
14
+ ```
15
+ start_phase(4)
16
+ ```
17
+ Do NOT proceed without this call.
18
+
19
+ ## Step 1 — Read Context
20
+
21
+ - `guides/wai-way/spec_template.md` — validated spec (test plan)
22
+ - `entities/index.ts` — all entity definitions
23
+ - `src/pages/` — all page files
24
+
25
+ ## Steps 2-5 — Parallel-capable
26
+
27
+ These steps are independent. Launch them in parallel when possible:
28
+
29
+ ### Tests
30
+ Call `get_guide("TESTING")` for patterns.
31
+ - Entity tests → `tests/entities/[Entity].test.ts`
32
+ - Page tests → `tests/pages/[Page].test.tsx`
33
+ - Access control → `tests/access/access-rules.test.ts`
34
+
35
+ ### Database Rules
36
+ Auto-detect provider (Firestore or Supabase RLS). Generate rules from entity access definitions.
37
+
38
+ ### CI/CD
39
+ Create `.github/workflows/ci.yml` — type-check → test → build → deploy.
40
+
41
+ ### Config
42
+ - `src/config/app.ts` — APP_NAME, preset, footer
43
+ - `src/config/legal.ts` — company, contacts, jurisdiction
44
+ - `.env` — provider config, license key
45
+
46
+ ## Step 6 — Validate
47
+
48
+ ```bash
49
+ bun test
50
+ ```
51
+ All tests must pass. Fix failures.
52
+
53
+ ## Step 7 — Mobile Check
54
+
55
+ DevTools → 375px → navigation, forms, text, buttons (44px min).
56
+
57
+ ## Step 8 — i18n (Optional)
58
+
59
+ Extract strings to `src/locales/`, replace with `useTranslation()`.
60
+
61
+ ## Ship Readiness
62
+
63
+ - `dndev tc` passes
64
+ - `bun test` passes
65
+ - Database rules generated
66
+ - CI/CD created
67
+ - No critical bugs
68
+ - Mobile works at 375px
69
+
70
+ ## Complete Phase
71
+
72
+ ```
73
+ complete_phase({ files: ["...all test/config files..."], summary: "Tests passing, config complete, ready to ship" })
74
+ ```
75
+
76
+ Wait for user `approve_phase()`. Then → `dndev deploy`.
@@ -0,0 +1,46 @@
1
+ ---
2
+ name: techdebt
3
+ description: End-of-session tech debt sweep. Scans modified files for duplicates, dead exports, missing JSDoc, broken imports, unused deps. Reports only, does NOT fix.
4
+ disable-model-invocation: true
5
+ argument-hint: [files/areas or blank for session diff]
6
+ ---
7
+
8
+ **Phase gate: only use after Phase 3 (COMPOSE) is complete.**
9
+
10
+ Scan for tech debt — the slow rot that `/grill` doesn't catch.
11
+
12
+ ## What to scan
13
+
14
+ **If `$ARGUMENTS` provided** — scan those files/areas.
15
+ **If empty** — check git diff for files modified in this session, group by area.
16
+
17
+ ## What to check
18
+
19
+ - Duplicate logic (same pattern in 2+ places)
20
+ - Dead exports (exported symbols with no consumers)
21
+ - Missing JSDoc on public API functions/types
22
+ - Broken imports (type-only used as values, circular deps)
23
+ - Unused dependencies in package.json vs actual imports
24
+ - Hardcoded strings that should be in config or i18n
25
+
26
+ ## What NOT to check
27
+
28
+ - Security (that's `/grill`)
29
+ - Style / formatting
30
+ - node_modules, dist, .d.ts
31
+ - Items in `.dndev/implementation.md` as known TODOs
32
+
33
+ ## Output
34
+
35
+ ```
36
+ ## <area>
37
+ - [HIGH] <description> — <file>:<line>
38
+ - [MED] <description> — <file>:<line>
39
+ - [LOW] <description> — <file>:<line>
40
+ ```
41
+
42
+ Summary: `N items across M areas (H high, M med, L low)`
43
+
44
+ Rules:
45
+ - DO NOT fix anything. Report only.
46
+ - Quality > quantity. 10 real items >>> 40 noise.