@donotdev/cli 0.1.0 → 0.1.1
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.
- package/dependencies-matrix.json +100 -50
- package/dist/bin/commands/agent-setup.js +245 -12
- package/dist/bin/commands/build.js +3339 -208
- package/dist/bin/commands/bump.js +245 -12
- package/dist/bin/commands/cacheout.js +245 -12
- package/dist/bin/commands/coach.js +361 -60
- package/dist/bin/commands/create-app.js +245 -12
- package/dist/bin/commands/create-project.js +253 -12
- package/dist/bin/commands/db.js +9114 -2327
- package/dist/bin/commands/deploy.js +4074 -694
- package/dist/bin/commands/dev.js +347 -33
- package/dist/bin/commands/doctor.js +408 -107
- package/dist/bin/commands/emu.js +386 -52
- package/dist/bin/commands/format.js +245 -12
- package/dist/bin/commands/get-demo.js +245 -12
- package/dist/bin/commands/make-admin.js +8356 -1516
- package/dist/bin/commands/preview.js +347 -33
- package/dist/bin/commands/seed.js +9114 -2327
- package/dist/bin/commands/setup-cicd.js +452 -132
- package/dist/bin/commands/setup.js +407 -107
- package/dist/bin/commands/staging.js +4074 -694
- package/dist/bin/commands/sync-secrets.js +246 -13
- package/dist/bin/commands/type-check.js +245 -12
- package/dist/bin/commands/wai.js +245 -12
- package/dist/bin/dndev.js +13 -4
- package/dist/bin/donotdev.js +13 -4
- package/dist/index.js +4169 -812
- package/{templates/root-consumer/guides/dndev/advanced/VERSION_CONTROL.md.example → guidelines/VERSION_CONTROL.md} +7 -11
- package/package.json +2 -1
- package/templates/app-demo/src/themes.css.example +21 -0
- package/templates/app-dndev/index.html.example +0 -3
- package/templates/app-dndev/src/themes.css.example +21 -0
- package/templates/app-next/src/app/layout.tsx.example +13 -4
- package/templates/app-next/src/themes.css.example +21 -0
- package/templates/app-vite/csp.example.json +44 -0
- package/templates/app-vite/index.html.example +0 -3
- package/templates/app-vite/src/themes.css.example +21 -0
- package/templates/functions-supabase/supabase/migrations/20250101000000_idempotency.sql +3 -0
- package/templates/functions-supabase/supabase/migrations/20250101000001_rate_limits.sql +3 -0
- package/templates/functions-supabase/supabase/migrations/20250101000003_operation_metrics.sql +3 -0
- package/templates/root-consumer/.claude/hooks/framework-compliance.sh.example +56 -0
- package/templates/root-consumer/.claude/hooks/guard-bash.sh.example +61 -0
- package/templates/root-consumer/.claude/hooks/guard-files.sh.example +46 -0
- package/templates/root-consumer/.claude/hooks/guard-mcp.sh.example +91 -0
- package/templates/root-consumer/.claude/hooks/guard-secrets.sh.example +67 -0
- package/templates/root-consumer/.claude/hooks/guard-write.sh.example +89 -0
- package/templates/root-consumer/.claude/hooks/session-start.sh.example +50 -0
- package/templates/root-consumer/.claude/hooks/track-mcp-lookup.sh.example +20 -0
- package/templates/root-consumer/.claude/hooks/typecheck-stop.sh.example +18 -0
- package/templates/root-consumer/.claude/rules/consumer-ux.md.example +32 -0
- package/templates/root-consumer/.claude/rules/definition-of-done.md.example +32 -0
- package/templates/root-consumer/.claude/rules/framework.md.example +39 -0
- package/templates/root-consumer/.claude/rules/git.md.example +14 -0
- package/templates/root-consumer/.claude/rules/security.md.example +13 -0
- package/templates/root-consumer/.claude/settings.json.example +123 -1
- package/templates/root-consumer/.claude/skills/build/SKILL.md.example +103 -25
- package/templates/root-consumer/.claude/skills/grill/SKILL.md.example +26 -15
- package/templates/root-consumer/.claude/skills/polish/SKILL.md.example +50 -37
- package/templates/root-consumer/AI.md.example +2 -2
- package/templates/root-consumer/CLAUDE.md.example +33 -1
- package/templates/root-consumer/guides/dndev/INDEX.md.example +23 -27
- package/templates/root-consumer/guides/dndev/SETUP_AUTH.md.example +3 -2
- package/templates/root-consumer/guides/dndev/SETUP_OAUTH.md.example +10 -5
- package/templates/root-consumer/guides/dndev/SETUP_SUPABASE.md.example +50 -3
- package/templates/root-consumer/guides/wai-way/blueprints/3_compose.md.example +13 -15
- package/templates/app-demo/public/manifest.json.example +0 -10
- package/templates/app-dndev/public/manifest.json.example +0 -10
- package/templates/root-consumer/.claude/commands/brainstorm.md.example +0 -175
- package/templates/root-consumer/.claude/commands/build.md.example +0 -131
- package/templates/root-consumer/.claude/commands/design.md.example +0 -184
- package/templates/root-consumer/.claude/commands/grill.md.example +0 -135
- package/templates/root-consumer/.claude/commands/polish.md.example +0 -146
- package/templates/root-consumer/.claude/commands/techdebt.md.example +0 -28
- package/templates/root-consumer/guides/dndev/COMPONENTS_ATOMIC.md.example +0 -180
- package/templates/root-consumer/guides/dndev/COMPONENTS_CRUD.md.example +0 -234
- package/templates/root-consumer/guides/dndev/COMPONENTS_UI.md.example +0 -136
- package/templates/root-consumer/guides/dndev/COMPONENT_API.md.example +0 -195
- package/templates/root-consumer/guides/dndev/ENV_SETUP.md.example +0 -219
- package/templates/root-consumer/guides/dndev/GOTCHAS.md.example +0 -197
- package/templates/root-consumer/guides/dndev/SETUP_APP_CONFIG.md.example +0 -132
- package/templates/root-consumer/guides/dndev/SETUP_BLOG.md.example +0 -280
- package/templates/root-consumer/guides/dndev/SETUP_CICD.md.example +0 -115
- package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +0 -334
- package/templates/root-consumer/guides/dndev/SETUP_FUNCTIONS.md.example +0 -9
- package/templates/root-consumer/guides/dndev/SETUP_I18N.md.example +0 -233
- package/templates/root-consumer/guides/dndev/SETUP_LAYOUTS.md.example +0 -158
- package/templates/root-consumer/guides/dndev/SETUP_PAGES.md.example +0 -205
- package/templates/root-consumer/guides/dndev/SETUP_PWA.md.example +0 -213
- package/templates/root-consumer/guides/dndev/SETUP_TESTING.md.example +0 -184
- package/templates/root-consumer/guides/dndev/SETUP_THEMES.md.example +0 -111
- package/templates/root-consumer/guides/dndev/SETUP_VERCEL.md.example +0 -260
- package/templates/root-consumer/guides/dndev/USE_ROUTING.md.example +0 -499
- package/templates/root-consumer/guides/dndev/essences_reference.css.example +0 -288
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# .claude/hooks/guard-write.sh
|
|
3
|
+
# UNIFIED PreToolUse:Edit|Write guard. One bun call, all checks.
|
|
4
|
+
# Replaces: guard-files + guard-mcp + guard-secrets
|
|
5
|
+
# Error strategy: security (secrets) fail CLOSED. All others fail OPEN.
|
|
6
|
+
# Cross-platform: bun-first, TMPDIR-safe.
|
|
7
|
+
|
|
8
|
+
set -eo pipefail
|
|
9
|
+
|
|
10
|
+
GATE_DIR="${TMPDIR:-/tmp}"
|
|
11
|
+
TRACK_FILE="$GATE_DIR/claude-mcp-lookups.txt"
|
|
12
|
+
|
|
13
|
+
INPUT=$(cat)
|
|
14
|
+
|
|
15
|
+
RESULT=$(echo "$INPUT" | bun -e "
|
|
16
|
+
const input = JSON.parse(await Bun.stdin.text());
|
|
17
|
+
const fp = input.tool_input?.file_path ?? '';
|
|
18
|
+
const tn = input.tool_name ?? '';
|
|
19
|
+
const bn = fp.split('/').pop() ?? '';
|
|
20
|
+
let content = '';
|
|
21
|
+
if (tn === 'Edit') content = input.tool_input?.new_string ?? '';
|
|
22
|
+
else if (tn === 'Write') content = input.tool_input?.content ?? '';
|
|
23
|
+
|
|
24
|
+
const checks = [];
|
|
25
|
+
|
|
26
|
+
// --- FILE GUARD (fail closed) ---
|
|
27
|
+
if (/^(bun\.lock|bun\.lockb|package-lock\.json|yarn\.lock|pnpm-lock\.yaml)$/.test(bn))
|
|
28
|
+
checks.push('BLOCK:Lock files are auto-generated');
|
|
29
|
+
if (/^(\.env|\.env\.local|\.env\.production|\.dndev\.secrets)$/.test(bn))
|
|
30
|
+
checks.push('BLOCK:Env files may contain secrets');
|
|
31
|
+
if (/\.(generated|g)\.(ts|js|json)$/.test(fp))
|
|
32
|
+
checks.push('BLOCK:Generated files should not be edited');
|
|
33
|
+
if (bn === 'AI.md')
|
|
34
|
+
checks.push('BLOCK:AI.md is the instruction SSOT');
|
|
35
|
+
|
|
36
|
+
// --- MCP GUARD (fail open) ---
|
|
37
|
+
try {
|
|
38
|
+
const isSrc = /(apps|src)\/.*\.(tsx?|jsx?)$/.test(fp);
|
|
39
|
+
const skip = /\/utils\/|\/hooks\/|\/stores\/|\/types\/|\/locales\/|Store\.ts|store\.ts|Hook\.ts|hook\.ts|\.json$/.test(fp);
|
|
40
|
+
if (isSrc && !skip && content.includes('@donotdev/')) {
|
|
41
|
+
const importRe = /import\s*\{([^}]+)\}\s*from\s*['\"]@donotdev\//g;
|
|
42
|
+
const symbols = new Set();
|
|
43
|
+
for (const m of content.matchAll(importRe)) {
|
|
44
|
+
for (const sym of m[1].split(',')) {
|
|
45
|
+
const name = sym.replace(/\s+as\s+\w+/, '').trim();
|
|
46
|
+
if (/^[A-Z]/.test(name)) symbols.add(name);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (symbols.size > 0) {
|
|
50
|
+
const lookups = new Set();
|
|
51
|
+
try {
|
|
52
|
+
const text = await Bun.file('${TRACK_FILE}').text();
|
|
53
|
+
for (const line of text.split('\n')) { const t = line.trim(); if (t) lookups.add(t); }
|
|
54
|
+
} catch {}
|
|
55
|
+
const missing = [...symbols].filter(s => !lookups.has(s));
|
|
56
|
+
if (missing.length) checks.push('BLOCK:lookup_symbol() missing for: ' + missing.join(', '));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
} catch {}
|
|
60
|
+
|
|
61
|
+
// --- SECRET SCAN (fail CLOSED) ---
|
|
62
|
+
try {
|
|
63
|
+
if (content && !/\.sh$|\.sh\.example$|guard-/.test(fp)) {
|
|
64
|
+
const v = [];
|
|
65
|
+
if (/(AKIA|ASIA)[A-Z0-9]{16}/.test(content)) v.push('AWS key');
|
|
66
|
+
if (/gh[pousr]_[A-Za-z0-9_]{36,}/.test(content)) v.push('GitHub token');
|
|
67
|
+
if (/-----BEGIN.*PRIVATE KEY-----/.test(content)) v.push('Private key');
|
|
68
|
+
if (/eyJ[A-Za-z0-9_-]{10,}\.eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}/.test(content)
|
|
69
|
+
&& !/test|fixture|mock|\.d\.ts/.test(fp)) v.push('JWT');
|
|
70
|
+
if (/(password|secret|api[_-]?key|token|credential)\s*[:=]\s*[\"'][A-Za-z0-9+\/=_-]{20,}/i.test(content)
|
|
71
|
+
&& !/(password|secret|api[_-]?key|token|credential)\s*[:=]\s*[\"'](your-|example-|replace-|xxx|process\.env)/i.test(content))
|
|
72
|
+
v.push('Secret assignment');
|
|
73
|
+
if (v.length) checks.push('BLOCK:Secret detected: ' + v.join(', '));
|
|
74
|
+
}
|
|
75
|
+
} catch (e) {
|
|
76
|
+
checks.push('BLOCK:Secret scan error: ' + e.message);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const block = checks.find(c => c.startsWith('BLOCK:'));
|
|
80
|
+
process.stdout.write(block ?? 'OK');
|
|
81
|
+
" 2>/dev/null || echo "OK")
|
|
82
|
+
|
|
83
|
+
case "$RESULT" in
|
|
84
|
+
OK) exit 0 ;;
|
|
85
|
+
BLOCK:*)
|
|
86
|
+
echo "BLOCKED: ${RESULT#BLOCK:}" >&2
|
|
87
|
+
exit 2 ;;
|
|
88
|
+
*) exit 0 ;;
|
|
89
|
+
esac
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# .claude/hooks/session-start.sh
|
|
3
|
+
# Injects context at session start so the agent doesn't fly blind.
|
|
4
|
+
# Cross-platform: bun-first, no grep -P.
|
|
5
|
+
|
|
6
|
+
set -euo pipefail
|
|
7
|
+
|
|
8
|
+
echo "=== SESSION CONTEXT ==="
|
|
9
|
+
|
|
10
|
+
# Git branch
|
|
11
|
+
BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown")
|
|
12
|
+
echo "Branch: $BRANCH"
|
|
13
|
+
|
|
14
|
+
# Dirty files count
|
|
15
|
+
DIRTY=$(git status --porcelain 2>/dev/null | wc -l | tr -d ' ')
|
|
16
|
+
if [ "$DIRTY" -gt 0 ]; then
|
|
17
|
+
echo "Dirty files: $DIRTY"
|
|
18
|
+
git status --porcelain 2>/dev/null | head -10
|
|
19
|
+
[ "$DIRTY" -gt 10 ] && echo " ... and $((DIRTY - 10)) more"
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
# WAI-WAY phase status (if dndev is available)
|
|
23
|
+
if command -v dndev &>/dev/null; then
|
|
24
|
+
PHASE_FILE=".dndev/implementation.md"
|
|
25
|
+
if [ -f "$PHASE_FILE" ]; then
|
|
26
|
+
CURRENT=$(bun -e "
|
|
27
|
+
const text = await Bun.file('$PHASE_FILE').text();
|
|
28
|
+
const m = text.match(/Current Phase:\\s*(.+)/);
|
|
29
|
+
process.stdout.write(m ? m[1].trim() : 'none');
|
|
30
|
+
" 2>/dev/null || echo "none")
|
|
31
|
+
echo "WAI-WAY Phase: $CURRENT"
|
|
32
|
+
else
|
|
33
|
+
echo "WAI-WAY Phase: not started - call start_phase(0)"
|
|
34
|
+
fi
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
# Recent lessons (last 3)
|
|
38
|
+
LESSONS_FILE=".dndev/LESSONS.md"
|
|
39
|
+
if [ -f "$LESSONS_FILE" ]; then
|
|
40
|
+
LESSON_COUNT=$(grep -c '^## ' "$LESSONS_FILE" 2>/dev/null || echo "0")
|
|
41
|
+
if [ "$LESSON_COUNT" -gt 0 ]; then
|
|
42
|
+
echo ""
|
|
43
|
+
echo "Recent lessons ($LESSON_COUNT total):"
|
|
44
|
+
grep '^## ' "$LESSONS_FILE" | tail -3 | sed 's/^/ /'
|
|
45
|
+
fi
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
echo ""
|
|
49
|
+
echo "REMINDER: Read AI.md. Call lookup_symbol() before any @donotdev import."
|
|
50
|
+
echo "=== END CONTEXT ==="
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# PostToolUse hook for mcp__donotdev__lookup_symbol
|
|
3
|
+
# Appends the looked-up symbol name to a session tracking file.
|
|
4
|
+
# Schema: { session_id, tool_name, tool_input: { symbol }, tool_response, ... }
|
|
5
|
+
# Cross-platform: bun-first, TMPDIR-safe.
|
|
6
|
+
|
|
7
|
+
set -euo pipefail
|
|
8
|
+
|
|
9
|
+
GATE_DIR="${TMPDIR:-/tmp}"
|
|
10
|
+
TRACK_FILE="$GATE_DIR/claude-mcp-lookups.txt"
|
|
11
|
+
|
|
12
|
+
INPUT=$(cat)
|
|
13
|
+
SYMBOL=$(echo "$INPUT" | bun -e "
|
|
14
|
+
const d = JSON.parse(await Bun.stdin.text());
|
|
15
|
+
process.stdout.write(d.tool_input?.symbol ?? '');
|
|
16
|
+
" 2>/dev/null || echo "")
|
|
17
|
+
|
|
18
|
+
[ -n "$SYMBOL" ] && echo "$SYMBOL" >> "$TRACK_FILE"
|
|
19
|
+
|
|
20
|
+
exit 0
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# .claude/hooks/typecheck-stop.sh
|
|
3
|
+
# Stop hook: run dndev tc before declaring done.
|
|
4
|
+
# Ensures type safety before any work is considered complete.
|
|
5
|
+
|
|
6
|
+
set -euo pipefail
|
|
7
|
+
|
|
8
|
+
# Only run if there are uncommitted changes (something was written)
|
|
9
|
+
DIRTY=$(git status --porcelain 2>/dev/null | wc -l | tr -d ' ')
|
|
10
|
+
[ "$DIRTY" -eq 0 ] && exit 0
|
|
11
|
+
|
|
12
|
+
echo "Running typecheck before completion..." >&2
|
|
13
|
+
if ! dndev tc 2>&1; then
|
|
14
|
+
echo '{"decision":"block","reason":"Typecheck failed. Fix type errors before completing."}'
|
|
15
|
+
exit 0
|
|
16
|
+
fi
|
|
17
|
+
|
|
18
|
+
exit 0
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Consumer-facing communication rules - never expose internals"
|
|
3
|
+
globs: "**"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Consumer UX Rules
|
|
7
|
+
|
|
8
|
+
The user paid for a product that works. They are NOT a framework developer.
|
|
9
|
+
|
|
10
|
+
## Never expose internals
|
|
11
|
+
|
|
12
|
+
- Never mention: WAI-WAY, MCP, phases, skills, hook names, guard scripts, agent-scope
|
|
13
|
+
- Never say: "I'm invoking /build" or "the MCP server returned..." or "Phase 2 complete"
|
|
14
|
+
- Never show: hook output, compliance check results, internal error messages
|
|
15
|
+
- If a hook blocks you: fix it silently. The user sees the result, not the process.
|
|
16
|
+
|
|
17
|
+
## Communication style
|
|
18
|
+
|
|
19
|
+
- Speak in terms of what's being built: "Adding the dashboard page" not "Starting Phase 3 COMPOSE"
|
|
20
|
+
- Explain errors in plain terms: "The form needs a submit handler" not "EntityFormRenderer requires onSubmit prop per lookup_symbol"
|
|
21
|
+
- Show progress as features: "Contact form is done, working on the settings page next"
|
|
22
|
+
- When asked "what are you doing?": describe the feature, not the toolchain
|
|
23
|
+
|
|
24
|
+
## Skill routing (invisible to user)
|
|
25
|
+
|
|
26
|
+
Detect user intent and invoke the right skill without mentioning it:
|
|
27
|
+
- "I want to build X" / "add a page for Y" → use the build workflow
|
|
28
|
+
- "This is broken" / "X doesn't work" → investigate and fix
|
|
29
|
+
- "Review the code" / "is this ready?" → run quality checks
|
|
30
|
+
- "What should I build?" / brainstorming language → requirements extraction
|
|
31
|
+
|
|
32
|
+
The user never types a slash command. You pick the right approach.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Definition of Done - every change must complete all items"
|
|
3
|
+
globs: "src/**,apps/**"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Definition of Done
|
|
7
|
+
|
|
8
|
+
Every change is incomplete until ALL applicable items are done.
|
|
9
|
+
|
|
10
|
+
## Mandatory (every change)
|
|
11
|
+
|
|
12
|
+
1. **Code** - simple, follows existing patterns, robust, secure
|
|
13
|
+
2. **Typecheck** - `dndev tc` passes
|
|
14
|
+
3. **i18n** - all user-facing strings via `t('key')`. Locale files updated.
|
|
15
|
+
|
|
16
|
+
## Mandatory for new features
|
|
17
|
+
|
|
18
|
+
4. **Tests** - unit test for new logic, page test for new pages
|
|
19
|
+
5. **Spec compliance** - if a spec exists, verify delivery matches it
|
|
20
|
+
|
|
21
|
+
## Output format
|
|
22
|
+
|
|
23
|
+
Every skill output MUST end with:
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
## Definition of Done
|
|
27
|
+
- [x] Code: <files changed>
|
|
28
|
+
- [x] Typecheck: dndev tc - PASS
|
|
29
|
+
- [x] i18n: <locale files updated, or N/A>
|
|
30
|
+
- [x] Tests: <test file, or N/A>
|
|
31
|
+
- [x] Spec compliance: <verified, or N/A>
|
|
32
|
+
```
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "DoNotDev framework usage - how to use the framework correctly"
|
|
3
|
+
globs: "src/**,apps/**"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Using the DoNotDev Framework
|
|
7
|
+
|
|
8
|
+
The framework's MCP server and component library cover 99% of what you need. Use them.
|
|
9
|
+
|
|
10
|
+
## Before ANY `@donotdev` import (MANDATORY)
|
|
11
|
+
|
|
12
|
+
1. Call `lookup_symbol({ symbol: "ComponentName" })` first. No exceptions.
|
|
13
|
+
2. **Only use props returned by `lookup_symbol()`.** Never invent props.
|
|
14
|
+
3. Common hallucination traps (these DO NOT exist): `size`, `tone`, `color`, `padding`, `margin`, `spacing`, `columns`, `background`, `fields`.
|
|
15
|
+
4. Import from `@donotdev/<pkg>` top-level only. Never sub-paths.
|
|
16
|
+
|
|
17
|
+
## Use framework components, not HTML
|
|
18
|
+
|
|
19
|
+
`<div>` → Stack | `<button>` → Button | `<input>` → TextInput | `<a>` → Link | `<p>`/`<h1>` → Text | `<table>` → DataTable | `<form>` → Form | `<ul>` → List | `<img>` → Image
|
|
20
|
+
|
|
21
|
+
Hook-enforced. Native HTML in source files is blocked.
|
|
22
|
+
|
|
23
|
+
## No custom CSS
|
|
24
|
+
|
|
25
|
+
No `.css`, `.scss`, `.less`, `.module.css` files. No Tailwind utility classes. Styling = component props + theme tokens. Hook-enforced.
|
|
26
|
+
|
|
27
|
+
## When the framework doesn't cover your need
|
|
28
|
+
|
|
29
|
+
1. Confirm with `lookup_symbol()` + `search_framework("keyword")`
|
|
30
|
+
2. Build custom component in `src/components/`
|
|
31
|
+
3. Add JSDoc: `@custom-component - framework gap, see issue #XX`
|
|
32
|
+
4. GitHub issue is auto-created by the guard hook
|
|
33
|
+
|
|
34
|
+
## Conventions
|
|
35
|
+
|
|
36
|
+
- **i18n-first.** All user-facing strings via `t('key')`. No hardcoded text.
|
|
37
|
+
- **Import order.** React, vendors, @donotdev, relative.
|
|
38
|
+
- **No fallbacks.** Fail loud. Never `|| default`.
|
|
39
|
+
- **Typecheck.** `dndev tc` only. Never `bunx tsc`, `npx tsc`, or raw `tsc`.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Git discipline - enforced on all operations"
|
|
3
|
+
globs: "**"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Git Rules
|
|
7
|
+
|
|
8
|
+
- **Atomic commits.** One logical change per commit. Never mix refactor + feature + fix.
|
|
9
|
+
- **Conventional format.** `type(scope): message` - e.g. `feat(auth): add email verification flow`.
|
|
10
|
+
- **Message = why**, not what. The diff shows what.
|
|
11
|
+
- **Never force-push.** No `--force`, no `-f` after push. Hook-enforced.
|
|
12
|
+
- **Never skip hooks.** No `--no-verify`. Fix the root cause.
|
|
13
|
+
- **Never amend published commits.** New commit to fix.
|
|
14
|
+
- **Push is deployment.** `git push` triggers the pipeline. Be intentional.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Security baseline - enforced on all code"
|
|
3
|
+
globs: "**"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Security Rules
|
|
7
|
+
|
|
8
|
+
- **Never commit secrets.** No API keys, tokens, passwords, or credentials in code. Use `.env`.
|
|
9
|
+
- **Never trust input.** Validate at system boundaries - user input, API responses, URL params.
|
|
10
|
+
- **Never expose internals.** No stack traces, internal paths, or system details in client output.
|
|
11
|
+
- **Sanitize before render.** User-generated content is always suspect.
|
|
12
|
+
- **Least privilege.** Request minimum permissions. Expose minimum surface.
|
|
13
|
+
- **Run `dndev doctor` and `/grill` before production.**
|
|
@@ -2,5 +2,127 @@
|
|
|
2
2
|
"statusLine": {
|
|
3
3
|
"type": "command",
|
|
4
4
|
"command": "python3 .claude/statusline.py"
|
|
5
|
-
}
|
|
5
|
+
},
|
|
6
|
+
"hooks": {
|
|
7
|
+
"SessionStart": [
|
|
8
|
+
{
|
|
9
|
+
"matcher": "",
|
|
10
|
+
"hooks": [
|
|
11
|
+
{
|
|
12
|
+
"type": "command",
|
|
13
|
+
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/session-start.sh\""
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"PreToolUse": [
|
|
19
|
+
{
|
|
20
|
+
"matcher": "Bash",
|
|
21
|
+
"hooks": [
|
|
22
|
+
{
|
|
23
|
+
"type": "command",
|
|
24
|
+
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/guard-bash.sh\""
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"matcher": "Edit|Write",
|
|
30
|
+
"hooks": [
|
|
31
|
+
{
|
|
32
|
+
"type": "command",
|
|
33
|
+
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/guard-write.sh\"",
|
|
34
|
+
"statusMessage": "Write guard"
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"PostToolUse": [
|
|
40
|
+
{
|
|
41
|
+
"matcher": "mcp__donotdev__lookup_symbol",
|
|
42
|
+
"hooks": [
|
|
43
|
+
{
|
|
44
|
+
"type": "command",
|
|
45
|
+
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/track-mcp-lookup.sh\""
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"matcher": "Edit|Write",
|
|
51
|
+
"hooks": [
|
|
52
|
+
{
|
|
53
|
+
"type": "command",
|
|
54
|
+
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/framework-compliance.sh\"",
|
|
55
|
+
"statusMessage": "Framework check"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"Stop": [
|
|
61
|
+
{
|
|
62
|
+
"matcher": "",
|
|
63
|
+
"hooks": [
|
|
64
|
+
{
|
|
65
|
+
"type": "command",
|
|
66
|
+
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/typecheck-stop.sh\""
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
"permissions": {
|
|
73
|
+
"allow": [
|
|
74
|
+
"Bash(git status*)",
|
|
75
|
+
"Bash(git diff*)",
|
|
76
|
+
"Bash(git log*)",
|
|
77
|
+
"Bash(git branch*)",
|
|
78
|
+
"Bash(git add*)",
|
|
79
|
+
"Bash(git commit*)",
|
|
80
|
+
"Bash(git push*)",
|
|
81
|
+
"Bash(git checkout*)",
|
|
82
|
+
"Bash(git stash*)",
|
|
83
|
+
"Bash(dndev *)",
|
|
84
|
+
"Bash(dndev)",
|
|
85
|
+
"Bash(bun run *)",
|
|
86
|
+
"Bash(bun add *)",
|
|
87
|
+
"Bash(bunx dndev*)",
|
|
88
|
+
"Bash(ls *)",
|
|
89
|
+
"Bash(mkdir *)",
|
|
90
|
+
"Read",
|
|
91
|
+
"Glob",
|
|
92
|
+
"Grep",
|
|
93
|
+
"Skill(brainstorm)",
|
|
94
|
+
"Skill(design)",
|
|
95
|
+
"Skill(build)",
|
|
96
|
+
"Skill(polish)",
|
|
97
|
+
"Skill(grill)",
|
|
98
|
+
"Skill(techdebt)",
|
|
99
|
+
"Skill(browse)",
|
|
100
|
+
"mcp__donotdev__lookup_symbol",
|
|
101
|
+
"mcp__donotdev__search_framework",
|
|
102
|
+
"mcp__donotdev__list_features",
|
|
103
|
+
"mcp__donotdev__get_guide",
|
|
104
|
+
"mcp__donotdev__get_guideline",
|
|
105
|
+
"mcp__donotdev__init_implementation",
|
|
106
|
+
"mcp__donotdev__update_progress",
|
|
107
|
+
"mcp__donotdev__get_progress",
|
|
108
|
+
"mcp__donotdev__get_phase_status",
|
|
109
|
+
"mcp__donotdev__start_phase",
|
|
110
|
+
"mcp__donotdev__complete_phase",
|
|
111
|
+
"mcp__donotdev__approve_phase",
|
|
112
|
+
"mcp__donotdev__run_typecheck",
|
|
113
|
+
"mcp__donotdev__record_lesson",
|
|
114
|
+
"mcp__donotdev__score_lesson",
|
|
115
|
+
"mcp__donotdev__get_project_history",
|
|
116
|
+
"mcp__donotdev__setup_coach"
|
|
117
|
+
],
|
|
118
|
+
"deny": [
|
|
119
|
+
"Bash(bunx tsc*)",
|
|
120
|
+
"Bash(npx tsc*)",
|
|
121
|
+
"Bash(bun install*)",
|
|
122
|
+
"Bash(npm install*)",
|
|
123
|
+
"Bash(yarn install*)",
|
|
124
|
+
"Bash(rm -rf *)"
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
"enableAllProjectMcpServers": true
|
|
6
128
|
}
|
|
@@ -1,50 +1,128 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: build
|
|
3
|
-
description:
|
|
3
|
+
description: "MCP-gated implementation (Phases 1-3). Spec is law — deliver COMPLETE (i18n, theme, auth, everything in spec). lookup_symbol before every component. Consumer workflow only. Use AFTER /design."
|
|
4
4
|
argument-hint: [requirement or LLD reference]
|
|
5
|
-
disable-model-invocation: true
|
|
6
5
|
---
|
|
7
6
|
|
|
8
|
-
# Build —
|
|
7
|
+
# Build — Deliver What's in the Spec
|
|
9
8
|
|
|
10
9
|
**WORKFLOW:** `/brainstorm` → `/design` → `/build` → `/polish`
|
|
11
10
|
|
|
11
|
+
## Philosophy: Waterfall, Not Agile
|
|
12
|
+
|
|
13
|
+
The spec (PRD + HLD + LLD) is the contract. Deliver exactly what's in it. No "we'll add i18n later." No "hardcode strings for now." No "iterate until it works."
|
|
14
|
+
|
|
15
|
+
If the spec says i18n → deliver i18n. If the spec says dark mode → deliver dark mode. Bad spec = bad app. That's the Extractor's job to prevent, not ours to compensate for.
|
|
16
|
+
|
|
12
17
|
## Step 0 — Start Phase (MANDATORY)
|
|
13
18
|
|
|
19
|
+
```
|
|
20
|
+
start_phase(1)
|
|
21
|
+
```
|
|
22
|
+
Do NOT write code without this call. It loads the blueprint, persona, context, and lessons.
|
|
23
|
+
|
|
24
|
+
## Step 1 — Read the Spec
|
|
25
|
+
|
|
26
|
+
Read ALL spec documents. These are your instructions, not suggestions:
|
|
27
|
+
|
|
28
|
+
- `docs/PRD.md` — what to build, user journeys, business rules, permissions
|
|
29
|
+
- `docs/HLD.md` — architecture, preset, auth, pages, features, theme
|
|
30
|
+
- `docs/LLD.md` — entity fields, state machines, access matrices
|
|
31
|
+
|
|
32
|
+
**Inventory from spec:**
|
|
33
|
+
1. List ALL pages with their purpose and user journey
|
|
34
|
+
2. List ALL entities with fields and access rules
|
|
35
|
+
3. List ALL features (i18n, auth, dark mode, etc.)
|
|
36
|
+
4. List ALL languages if i18n is specified
|
|
37
|
+
5. List the theme/essence
|
|
38
|
+
|
|
39
|
+
If something is ambiguous in the spec → STOP and ask. Do NOT interpret.
|
|
40
|
+
|
|
41
|
+
## Step 2 — Lookup All Components (MANDATORY GATE)
|
|
42
|
+
|
|
43
|
+
**STOP before every `@donotdev` import** → call `lookup_symbol({ symbol: "Name" })`.
|
|
44
|
+
|
|
45
|
+
No exceptions. Do NOT guess props, hooks, or APIs.
|
|
46
|
+
|
|
47
|
+
If MCP is down, read source directly in `packages/*/src/`.
|
|
48
|
+
|
|
49
|
+
**Hallucination traps** (commonly invented props that DO NOT exist):
|
|
50
|
+
`size`, `tone`, `color`, `padding`, `margin`, `spacing`, `columns`, `background`, `fields`
|
|
51
|
+
|
|
52
|
+
**Import convention:** Always `@donotdev/<package>` — never sub-paths. Only exceptions: `@donotdev/core/server`, `@donotdev/core/vite`, `@donotdev/core/next`, `@donotdev/core/functions`.
|
|
53
|
+
|
|
54
|
+
## Step 3 — Build (Complete, Not Iterative)
|
|
55
|
+
|
|
56
|
+
Build in order. Each step produces final output, not stubs.
|
|
57
|
+
|
|
58
|
+
### Phase 1: SCAFFOLD
|
|
59
|
+
```
|
|
60
|
+
start_phase(1)
|
|
61
|
+
```
|
|
62
|
+
- Apply theme/essence from HLD
|
|
63
|
+
- Create ALL page files with correct `PageMeta`
|
|
64
|
+
- Set up routes matching spec's page map
|
|
65
|
+
- Auth configuration if spec requires it
|
|
66
|
+
```
|
|
67
|
+
complete_phase({ files: [...], summary: "..." })
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Phase 2: ENTITIES
|
|
71
|
+
```
|
|
72
|
+
start_phase(2)
|
|
73
|
+
```
|
|
74
|
+
- Create ALL entity files from LLD
|
|
75
|
+
- Fields, states, access rules — exactly as specified
|
|
76
|
+
- Database migrations/rules
|
|
77
|
+
- Export from `entities/index.ts`
|
|
78
|
+
```
|
|
79
|
+
complete_phase({ files: [...], summary: "..." })
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Phase 3: COMPOSE
|
|
14
83
|
```
|
|
15
84
|
start_phase(3)
|
|
16
85
|
```
|
|
17
|
-
|
|
86
|
+
- Build ALL pages — FINAL versions, not prototypes
|
|
87
|
+
- CRUD pages → `EntityList` + `EntityFormRenderer`
|
|
88
|
+
- i18n from the start if spec says i18n
|
|
89
|
+
- Theme applied (essence, colors, density, radius from spec)
|
|
90
|
+
- Auth guards where spec requires auth
|
|
91
|
+
- Wire entities into pages
|
|
92
|
+
```
|
|
93
|
+
complete_phase({ files: [...], summary: "..." })
|
|
94
|
+
```
|
|
18
95
|
|
|
19
|
-
|
|
96
|
+
### BLOCKING RULES
|
|
20
97
|
|
|
21
|
-
|
|
98
|
+
| Rule | Detail |
|
|
99
|
+
|------|--------|
|
|
100
|
+
| **No native HTML** | Use framework components only (Stack, Card, Text, Button, etc.) |
|
|
101
|
+
| **No custom CSS** | No `.css` files, no Tailwind classes. Use component props + theme tokens. |
|
|
102
|
+
| **Spec is law** | Deliver what the spec says. No deferring. No "later." |
|
|
103
|
+
| **i18n-first always** | ALL user-facing strings use `t('key')`. Even single-language apps. Create locale files immediately. |
|
|
104
|
+
| **No creative freedom** | Copy/labels come from spec. Don't invent. |
|
|
105
|
+
| **Framework stores** | Use `createDoNotDevStore`, never raw `zustand`. |
|
|
106
|
+
| **Import order** | React → vendors → `@donotdev/*` → relative. ESM only. |
|
|
22
107
|
|
|
23
|
-
|
|
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`.
|
|
108
|
+
## Step 4 — Verify
|
|
26
109
|
|
|
27
|
-
|
|
110
|
+
Run `dndev tc` ONCE at the end. Fix errors with verified props only.
|
|
28
111
|
|
|
29
|
-
|
|
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
|
|
112
|
+
## Step 5 — Spec Compliance Check
|
|
35
113
|
|
|
36
|
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
114
|
+
- [ ] Every page in HLD page map exists and is functional
|
|
115
|
+
- [ ] Every entity in LLD is defined with correct fields/access
|
|
116
|
+
- [ ] Every feature in HLD is implemented (not "deferred")
|
|
117
|
+
- [ ] i18n done if spec says i18n
|
|
118
|
+
- [ ] Theme/essence applied if specified
|
|
41
119
|
|
|
42
|
-
|
|
120
|
+
**Missing anything from spec = incomplete delivery = bug.**
|
|
43
121
|
|
|
44
|
-
|
|
122
|
+
## Step 6 — Complete
|
|
45
123
|
|
|
46
124
|
```
|
|
47
|
-
complete_phase({ files: ["
|
|
125
|
+
complete_phase({ files: ["...all files..."], summary: "Spec fully delivered" })
|
|
48
126
|
```
|
|
49
127
|
|
|
50
|
-
Wait for user `approve_phase()` → then proceed to `/polish
|
|
128
|
+
Wait for user `approve_phase()` → then proceed to `/polish` (QA audit).
|