the-frame-ai 0.1.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 (77) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +335 -0
  3. package/README.ru.md +333 -0
  4. package/bin/the-frame +5 -0
  5. package/bin/the-frame-ai +5 -0
  6. package/package.json +29 -0
  7. package/src/cli.js +84 -0
  8. package/src/doctor.js +164 -0
  9. package/src/init.js +178 -0
  10. package/src/languages.js +141 -0
  11. package/src/manifest.js +55 -0
  12. package/src/update.js +87 -0
  13. package/src/utils.js +55 -0
  14. package/templates/agents/builder.md +240 -0
  15. package/templates/agents/devils-advocate.md +136 -0
  16. package/templates/agents/planner.md +277 -0
  17. package/templates/agents/researcher.md +195 -0
  18. package/templates/agents/reviewer.md +300 -0
  19. package/templates/commands/frame:add-task.md +57 -0
  20. package/templates/commands/frame:build.md +170 -0
  21. package/templates/commands/frame:check-deps.md +118 -0
  22. package/templates/commands/frame:checkpoint.md +158 -0
  23. package/templates/commands/frame:cleanup-memory.md +80 -0
  24. package/templates/commands/frame:context.md +64 -0
  25. package/templates/commands/frame:daily.md +77 -0
  26. package/templates/commands/frame:debug.md +146 -0
  27. package/templates/commands/frame:doctor.md +170 -0
  28. package/templates/commands/frame:estimate.md +105 -0
  29. package/templates/commands/frame:explain.md +84 -0
  30. package/templates/commands/frame:fast.md +89 -0
  31. package/templates/commands/frame:forensics.md +139 -0
  32. package/templates/commands/frame:headless.md +118 -0
  33. package/templates/commands/frame:health.md +86 -0
  34. package/templates/commands/frame:init.md +231 -0
  35. package/templates/commands/frame:migrate.md +107 -0
  36. package/templates/commands/frame:note.md +32 -0
  37. package/templates/commands/frame:pause.md +145 -0
  38. package/templates/commands/frame:performance.md +228 -0
  39. package/templates/commands/frame:plan.md +198 -0
  40. package/templates/commands/frame:refactor.md +161 -0
  41. package/templates/commands/frame:research.md +131 -0
  42. package/templates/commands/frame:resume.md +137 -0
  43. package/templates/commands/frame:retrospective.md +196 -0
  44. package/templates/commands/frame:review.md +174 -0
  45. package/templates/commands/frame:rollback.md +207 -0
  46. package/templates/commands/frame:ship.md +148 -0
  47. package/templates/commands/frame:sprint-check.md +111 -0
  48. package/templates/commands/frame:status.md +103 -0
  49. package/templates/commands/frame:unstuck.md +102 -0
  50. package/templates/commands/frame:wave.md +312 -0
  51. package/templates/commands/frame:where.md +5 -0
  52. package/templates/commands/frame:why.md +57 -0
  53. package/templates/commands/frame:worktree.md +219 -0
  54. package/templates/hooks/git-safety.sh +33 -0
  55. package/templates/hooks/quality-gate.sh +52 -0
  56. package/templates/hooks/safety-net.sh +13 -0
  57. package/templates/hooks/session-init.sh +81 -0
  58. package/templates/planning/pause-state.json +1 -0
  59. package/templates/project/CLAUDE.md +63 -0
  60. package/templates/project/CONTEXT.md +16 -0
  61. package/templates/project/MAP.md +35 -0
  62. package/templates/project/ROADMAP.md +12 -0
  63. package/templates/project/STATE.md +13 -0
  64. package/templates/project/config.json +74 -0
  65. package/templates/project/memory/anti-patterns.md +14 -0
  66. package/templates/project/memory/context.md +23 -0
  67. package/templates/project/memory/conventions.md +19 -0
  68. package/templates/project/memory/decisions.md +20 -0
  69. package/templates/project/memory/dependencies.md +23 -0
  70. package/templates/project/memory/metrics.md +22 -0
  71. package/templates/project/memory/patterns.md +30 -0
  72. package/templates/project/memory/wins.md +11 -0
  73. package/templates/project/settings.local.json +50 -0
  74. package/templates/project/specs/_template/PRD.md +24 -0
  75. package/templates/project/specs/_template/plan.md +25 -0
  76. package/templates/project/specs/_template/spec.md +27 -0
  77. package/templates/project/specs/_template/subagent-prompt.md +43 -0
@@ -0,0 +1,81 @@
1
+ #!/bin/bash
2
+ # session-init.sh - Loads context at session start
3
+
4
+ PROJECT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || echo ".")
5
+ STATE_FILE="$PROJECT_ROOT/.planning/STATE.md"
6
+
7
+ # Onboarding: STATE.md missing or not yet filled (only template headers)
8
+ if [ ! -f "$STATE_FILE" ] || ! grep -q "^- Phase:" "$STATE_FILE" 2>/dev/null; then
9
+ echo "╔══════════════════════════════════════════╗"
10
+ echo "║ FRAME — Getting Started ║"
11
+ echo "╚══════════════════════════════════════════╝"
12
+ echo ""
13
+ echo " FRAME is installed but not yet initialized."
14
+ echo ""
15
+ echo " Next step: run /frame:init"
16
+ echo " This will scan your project and fill in"
17
+ echo " MAP.md, CLAUDE.md, and STATE.md."
18
+ echo ""
19
+ exit 0
20
+ fi
21
+
22
+ LAST_ACTIVITY=0
23
+ if [[ "$OSTYPE" == "darwin"* ]]; then
24
+ LAST_ACTIVITY=$(stat -f %m "$STATE_FILE" 2>/dev/null || echo 0)
25
+ else
26
+ LAST_ACTIVITY=$(stat -c %Y "$STATE_FILE" 2>/dev/null || echo 0)
27
+ fi
28
+ NOW=$(date +%s)
29
+ ELAPSED=$(( NOW - LAST_ACTIVITY ))
30
+
31
+ PHASE=$(grep "^- Phase:" "$STATE_FILE" 2>/dev/null | head -1 | sed 's/.*Phase: //')
32
+ FEATURE=$(grep "^- Feature:" "$STATE_FILE" 2>/dev/null | head -1 | sed 's/.*Feature: //')
33
+ TASK=$(grep "^- Task:" "$STATE_FILE" 2>/dev/null | head -1 | sed 's/.*Task: //')
34
+
35
+ # < 2 hours: one-liner
36
+ if [ "$ELAPSED" -lt 7200 ]; then
37
+ echo "FRAME | Phase: ${PHASE:-?} | Feature: ${FEATURE:-?} | Task: ${TASK:-?}"
38
+ exit 0
39
+ fi
40
+
41
+ # 2-24 hours: brief digest
42
+ if [ "$ELAPSED" -lt 86400 ]; then
43
+ echo "╔══════════════════════════════════════════╗"
44
+ echo "║ FRAME — Welcome back ║"
45
+ echo "╚══════════════════════════════════════════╝"
46
+ echo ""
47
+ echo " Phase: ${PHASE:-?} | Feature: ${FEATURE:-?}"
48
+ echo " Task: ${TASK:-?}"
49
+ echo ""
50
+ echo " Recent commits:"
51
+ git log --oneline -3 2>/dev/null | sed 's/^/ /'
52
+ echo ""
53
+ exit 0
54
+ fi
55
+
56
+ # > 24 hours: full context
57
+ echo "╔══════════════════════════════════════════╗"
58
+ echo "║ FRAME SESSION INITIALIZED ║"
59
+ echo "╚══════════════════════════════════════════╝"
60
+ echo ""
61
+
62
+ if [ -f "$STATE_FILE" ]; then
63
+ echo "Current State:"
64
+ head -15 "$STATE_FILE" | sed 's/^/ /'
65
+ echo ""
66
+ fi
67
+
68
+ MAP_FILE="$PROJECT_ROOT/.planning/MAP.md"
69
+ if [ -f "$MAP_FILE" ]; then
70
+ echo "Project:"
71
+ grep "^## Quick Facts" -A 6 "$MAP_FILE" 2>/dev/null | head -7 | sed 's/^/ /'
72
+ echo ""
73
+ fi
74
+
75
+ echo " Recent commits:"
76
+ git log --oneline -5 2>/dev/null | sed 's/^/ /'
77
+ echo ""
78
+ echo "Commands: /frame:status, /frame:context, /frame:daily, /frame:fast"
79
+ echo ""
80
+
81
+ exit 0
@@ -0,0 +1 @@
1
+ {}
@@ -0,0 +1,63 @@
1
+ # CLAUDE.md — {{PROJECT_NAME}}
2
+
3
+ ## Tech Stack
4
+
5
+ (to be filled after /frame:init scan)
6
+
7
+ ## Architecture
8
+
9
+ (to be filled after /frame:init scan)
10
+
11
+ ## Key Patterns
12
+
13
+ (to be filled after /frame:init scan)
14
+
15
+ ## Code Conventions
16
+
17
+ - **File naming**: (define your convention)
18
+ - **Imports**: (define your import order)
19
+ - **TypeScript**: Strict mode
20
+ - **Git**: `{type}({scope}): {description}` — types: feat, fix, refactor, test, docs, chore
21
+ - **Tests**: co-located or `__tests__/` directory
22
+
23
+ ## Rules (MUST follow)
24
+
25
+ 1. Always run quality checks before commit
26
+ 2. Use error reporting (not console.log)
27
+ 3. No `any` type — use `unknown` + type guard
28
+ 4. New features require tests
29
+
30
+ ## FRAME Framework
31
+
32
+ This project uses FRAME (Framework for AI-Assisted Solo Development).
33
+
34
+ **Commands**:
35
+ - `/frame:init` — initialize project
36
+ - `/frame:status` — current state
37
+ - `/frame:fast <task>` — quick task
38
+ - `/frame:research <topic>` — domain research
39
+ - `/frame:plan <feature>` — plan feature
40
+ - `/frame:build` — implement with TDD
41
+ - `/frame:review` — code review
42
+ - `/frame:ship` — git + PR
43
+ - `/frame:debug <issue>` — systematic debugging
44
+ - `/frame:retrospective` — retrospective + memory update
45
+ - `/frame:cleanup-memory` — trim and archive memory files
46
+
47
+ **Key files**:
48
+ - `.planning/STATE.md` — current position
49
+ - `.planning/MAP.md` — project map
50
+ - `.planning/ROADMAP.md` — roadmap
51
+ - `.frame/config.json` — FRAME configuration
52
+ - `.planning/memory/` — project memory
53
+
54
+ **Quality Gates** (D→P→D):
55
+ - `{quality.commands.typecheck}` — Type check
56
+ - `{quality.commands.test}` — Test check
57
+ - `{quality.commands.lint}` — Lint check
58
+ - `{quality.commands.build}` — Build check (before Ship)
59
+
60
+ ## Anti-Patterns (NEVER do)
61
+
62
+ - ❌ Skip verification steps (D→P→D is mandatory)
63
+ - ❌ `any` type (use `unknown` + type guard)
@@ -0,0 +1,16 @@
1
+ # CONTEXT.md — Working Context
2
+
3
+ ## Active Feature
4
+ - Name: (none yet)
5
+ - Phase: SETUP
6
+
7
+ ## Key Files
8
+ - .planning/STATE.md — current state
9
+ - .planning/MAP.md — project map
10
+ - .frame/config.json — FRAME configuration
11
+
12
+ ## Tech Context
13
+ (to be filled by /frame:init)
14
+
15
+ ## Recent Changes
16
+ - FRAME installed via the-frame CLI
@@ -0,0 +1,35 @@
1
+ # MAP.md -- {{PROJECT_NAME}}
2
+
3
+ ## Quick Facts
4
+ - **Name**: {{PROJECT_NAME}}
5
+ - **Type**: (filled by /frame:init)
6
+ - **Stack**: (filled by /frame:init)
7
+ - **Database**: (filled by /frame:init)
8
+ - **Auth**: (filled by /frame:init)
9
+ - **Deploy**: (filled by /frame:init)
10
+ - **Tests**: (filled by /frame:init)
11
+
12
+ ## Architecture Pattern
13
+ (filled by /frame:init)
14
+
15
+ ## Entry Points
16
+ (filled by /frame:init)
17
+
18
+ ## Key Layers
19
+ (filled by /frame:init)
20
+
21
+ ## Data Flow
22
+ (filled by /frame:init)
23
+
24
+ ## Key Patterns
25
+ | Pattern | Where Used |
26
+ |---------|-----------|
27
+ | (filled by /frame:init) |
28
+
29
+ ## File Inventory
30
+ | Directory/File | Purpose |
31
+ |----------------|---------|
32
+ | (filled by /frame:init) |
33
+
34
+ ## Tech Debt / Notes
35
+ (filled by /frame:init)
@@ -0,0 +1,12 @@
1
+ # ROADMAP.md — {{PROJECT_NAME}}
2
+
3
+ ## v1.0 — Current
4
+ - [ ] Core features
5
+ - [ ] Testing
6
+ - [ ] Documentation
7
+
8
+ ## v1.1 — Planned
9
+ - (add planned features here)
10
+
11
+ ## v2.0 — Future
12
+ - (add future vision here)
@@ -0,0 +1,13 @@
1
+ # STATE.md — Current Position
2
+
3
+ ## Current Position
4
+ - Phase: SETUP
5
+ - Feature: Framework initialization
6
+ - Status: FRAME installed, awaiting /frame:init scan
7
+
8
+ ## Completed
9
+ - [x] FRAME installed via the-frame CLI
10
+
11
+ ## Notes
12
+ - Run /frame:init to scan your codebase and populate MAP.md
13
+ - Run /frame:doctor to verify all systems
@@ -0,0 +1,74 @@
1
+ {
2
+ "version": "1.0",
3
+ "project": "{{PROJECT_NAME}}",
4
+
5
+ "_solo_comment": "=== SOLO SETTINGS — review and adjust these ===",
6
+
7
+ "quality": {
8
+ "commands": {
9
+ "typecheck": "npx tsc --noEmit",
10
+ "test": "npx vitest run",
11
+ "lint": "npx eslint .",
12
+ "build": "npm run build",
13
+ "audit": "npm audit",
14
+ "outdated": "npm outdated"
15
+ },
16
+ "typescript": "strict",
17
+ "eslint": true,
18
+ "tests": "required",
19
+ "build": "required"
20
+ },
21
+
22
+ "soloMode": {
23
+ "autoContextPruning": true,
24
+ "timeBoxing": { "defaultMinutes": 30 }
25
+ },
26
+
27
+ "devilsAdvocate": {
28
+ "enabled": true,
29
+ "categories": ["input", "error", "edge", "security", "performance"]
30
+ },
31
+
32
+ "_advanced_comment": "=== ADVANCED — safe to leave as-is ===",
33
+
34
+ "workflow": {
35
+ "tdd": true,
36
+ "autoCommit": false,
37
+ "checkpoints": true,
38
+ "autoCheckpoint": true,
39
+ "checkpointBefore": ["research", "plan", "build", "review"],
40
+ "maxCheckpoints": 10,
41
+ "cleanupAfterShip": true,
42
+ "pauseResume": true,
43
+ "worktrees": true
44
+ },
45
+
46
+ "phases": {
47
+ "research": { "type": "plan", "freshContext": true },
48
+ "plan": { "freshContext": true },
49
+ "build": { "type": "tdd" },
50
+ "review": { "freshContext": true },
51
+ "ship": {}
52
+ },
53
+
54
+ "memory": {
55
+ "autoUpdate": true,
56
+ "trigger": "per-task",
57
+ "maxPatterns": 50,
58
+ "maxAntiPatterns": 20,
59
+ "maxDecisions": 30,
60
+ "confidenceArchiveDays": 60,
61
+ "retrospectiveRequired": true
62
+ },
63
+
64
+ "checkDeps": {
65
+ "runBeforeShip": true,
66
+ "auditAgeDaysWarning": 7
67
+ },
68
+
69
+ "archive": {
70
+ "enabled": true,
71
+ "thresholdDays": 90,
72
+ "archivePath": "docs/specs/archive"
73
+ }
74
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "Anti-Patterns",
3
+ "description": "Patterns to avoid in this project"
4
+ }
5
+
6
+ # Anti-Patterns
7
+
8
+ <!-- Format for new entries:
9
+ ## Anti-pattern: {name}
10
+ - **Why it is bad**: {reason}
11
+ - **Correct approach**: {how it should be done}
12
+ - **Related decision**: {DEC-XXX if avoided by a decision}
13
+ - **Occurrences**: {count}
14
+ -->
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "Context",
3
+ "description": "Current project state — what's happening now, recent decisions, health"
4
+ }
5
+
6
+ # Project Context
7
+
8
+ ## Current Focus
9
+ - Working on: {feature}
10
+ - Status: {status}
11
+ - Blocked by: {blockers or "none"}
12
+
13
+ ## Recent Decisions (last 2 weeks)
14
+ - {decision with link to decisions.md if available}
15
+
16
+ ## Health
17
+ - Last retrospective: {date}
18
+ - Open anti-patterns: {count} {needs attention if > 2}
19
+ - Stale patterns: {count}
20
+
21
+ ## Active Blockers
22
+ - {blocker 1}
23
+ - {blocker 2}
@@ -0,0 +1,19 @@
1
+ # Conventions
2
+
3
+ Code conventions and standards discovered during /frame:init scan.
4
+
5
+ ## File Naming
6
+
7
+ (auto-filled by /frame:init)
8
+
9
+ ## Import Order
10
+
11
+ (auto-filled by /frame:init)
12
+
13
+ ## Patterns
14
+
15
+ (auto-filled by /frame:init)
16
+
17
+ ## Git Commit Format
18
+
19
+ `{type}({scope}): {description}` — types: feat, fix, refactor, test, docs, chore
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "Architecture Decisions",
3
+ "description": "Architecture Decision Records (ADRs)"
4
+ }
5
+
6
+ # Architecture Decisions
7
+
8
+ <!-- Format for new entries:
9
+ ## [DEC-{XXX}] {Decision Title}
10
+ - **Date**: {date}
11
+ - **Status**: {accepted|deprecated|superseded by DEC-YYY}
12
+ - **Context**: {why this decision was needed}
13
+ - **Decision**: {what was decided}
14
+ - **Consequences**: {what follows from this decision}
15
+
16
+ Related:
17
+ - → derives: patterns.md#{pattern-name}
18
+ - → avoids: anti-patterns.md#{anti-pattern-name}
19
+ - ← derived from: (if this supersedes another decision)
20
+ -->
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "Dependencies",
3
+ "description": "External dependencies, tech stack, and things to avoid adding"
4
+ }
5
+
6
+ # Dependencies
7
+
8
+ ## Core
9
+ - {runtime language + version}
10
+ - {key framework}
11
+ - {database driver}
12
+ - {cache library}
13
+
14
+ ## Integrations
15
+ - {service} -- {purpose}
16
+
17
+ ## Dev Tools
18
+ - {testing framework}
19
+ - {linter}
20
+ - {build tool}
21
+
22
+ ## Avoid
23
+ - {technology} -- {reason / what we use instead}
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "Metrics",
3
+ "description": "Project baseline metrics and task type analysis"
4
+ }
5
+
6
+ # Metrics
7
+
8
+ <!-- Updated automatically by /frame:retrospective -->
9
+
10
+ ## Overall
11
+ - Total tasks completed: 0
12
+ - Average time per task: 0 min
13
+ - Success rate: 0%
14
+
15
+ ## Task Type Analysis
16
+
17
+ | Type | Count | Avg Time | Anti-pattern Rate |
18
+ |------|-------|----------|-------------------|
19
+ | feature | 0 | 0h | 0% |
20
+ | bug | 0 | 0h | 0% |
21
+ | refactor | 0 | 0h | 0% |
22
+ | other | 0 | 0h | 0% |
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "Patterns",
3
+ "description": "Project-specific patterns discovered during development"
4
+ }
5
+
6
+ # Patterns
7
+
8
+ <!-- Format for new entries:
9
+ ## {Pattern Name} [confidence: {high|medium|low}, confirmed: {N}x, added: {date}, last: {date}]
10
+ - **Pattern**: {description}
11
+ - **Where**: {where it is used}
12
+ - **Convention**: {convention}
13
+ - **From**: {DEC-XXX or blank if organic}
14
+ - **Discovered**: {date}
15
+ -->
16
+
17
+ ## Core
18
+
19
+ <!-- Established patterns: confidence: high (5+ confirmed)
20
+ or confidence: medium with confirmed >= 3 and last within the last 90 days.
21
+ Planner reads only this section. -->
22
+
23
+ ## Active
24
+
25
+ <!-- Working patterns: all patterns not in Core.
26
+ Marked [stale] if last > 90 days. -->
27
+
28
+ ## Archived
29
+
30
+ <!-- Patterns with confidence: low, inactive for > 60 days. -->
@@ -0,0 +1,11 @@
1
+ # Wins
2
+
3
+ Recorded successes and completed tasks.
4
+
5
+ ## Format
6
+
7
+ `- {date}: {task} — {outcome}`
8
+
9
+ ## Log
10
+
11
+ (populated by /frame:fast and /frame:build)
@@ -0,0 +1,50 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "npx tsc *",
5
+ "npx vitest *",
6
+ "npx eslint *",
7
+ "WebSearch",
8
+ "WebFetch"
9
+ ]
10
+ },
11
+ "hooks": {
12
+ "PreToolUse": [
13
+ {
14
+ "matcher": "Bash",
15
+ "hooks": [
16
+ {
17
+ "type": "command",
18
+ "command": "bash .claude/hooks/safety-net.sh"
19
+ },
20
+ {
21
+ "type": "command",
22
+ "command": "bash .claude/hooks/git-safety.sh"
23
+ }
24
+ ]
25
+ }
26
+ ],
27
+ "PostToolUse": [
28
+ {
29
+ "matcher": "Write|Edit",
30
+ "hooks": [
31
+ {
32
+ "type": "command",
33
+ "command": "bash .claude/hooks/quality-gate.sh",
34
+ "async": true
35
+ }
36
+ ]
37
+ }
38
+ ],
39
+ "SessionStart": [
40
+ {
41
+ "hooks": [
42
+ {
43
+ "type": "command",
44
+ "command": "bash .claude/hooks/session-init.sh"
45
+ }
46
+ ]
47
+ }
48
+ ]
49
+ }
50
+ }
@@ -0,0 +1,24 @@
1
+ # PRD.md — Product Requirements Document
2
+
3
+ ## Overview
4
+ - Feature: (name)
5
+ - Problem: (what problem does this solve?)
6
+ - Users: (who benefits?)
7
+
8
+ ## Requirements
9
+
10
+ ### Must Have
11
+ - (requirement 1)
12
+ - (requirement 2)
13
+
14
+ ### Nice to Have
15
+ - (requirement 3)
16
+
17
+ ## Success Criteria
18
+ - (how do we know it's done?)
19
+
20
+ ## Constraints
21
+ - (technical or business constraints)
22
+
23
+ ## Out of Scope
24
+ - (what we explicitly won't do)
@@ -0,0 +1,25 @@
1
+ # plan.md — {{feature}}
2
+
3
+ ## Overview
4
+ - Feature: {{feature}}
5
+ - Tasks: 0/0
6
+ - Status: PLANNING
7
+
8
+ ## Tasks
9
+
10
+ ### Task 1: (task name)
11
+ - Files: `path/to/file`
12
+ - Dependencies: NONE
13
+ - Wave: 1
14
+ - Complexity: low | medium | high
15
+ - Risk: low | medium | high
16
+ - Estimate: XS | S | M | L | XL
17
+ - Test: (test file or "not needed")
18
+ - Verification: {quality.commands.test} {quality.commands.typecheck}
19
+ - Status: [ ] TODO
20
+
21
+ <!-- Add more tasks as needed -->
22
+
23
+ ## Wave Map
24
+ - Wave 1: Task 1
25
+ - Wave 2: (tasks depending on Wave 1)
@@ -0,0 +1,27 @@
1
+ # spec.md — {{feature}}
2
+
3
+ ## Overview
4
+ - Feature: (name)
5
+ - Status: DRAFT
6
+
7
+ ## Problem
8
+ (what problem does this solve?)
9
+
10
+ ## Solution
11
+ (how will we solve it?)
12
+
13
+ ## API / Interface
14
+ (define endpoints, components, or interfaces)
15
+
16
+ ## Data Model
17
+ (define data structures if applicable)
18
+
19
+ ## Edge Cases
20
+ - (edge case 1)
21
+ - (edge case 2)
22
+
23
+ ## Testing Strategy
24
+ - (how will we test this?)
25
+
26
+ ## References
27
+ - (links to research, docs, examples)
@@ -0,0 +1,43 @@
1
+ # Subagent Prompt Template
2
+
3
+ ## Memory (read before writing code)
4
+ - `.planning/memory/anti-patterns.md` — what to avoid
5
+ - `.planning/memory/conventions.md` — how to write code
6
+ - `.planning/memory/dependencies.md` — stack + Avoid list
7
+ - `docs/specs/{FEATURE}/research.md` → Memory Impact section
8
+
9
+ ## Heartbeat rules
10
+ - After each D-step write: "✓ Task {name}: {step} confirmed"
11
+ - Before a long command: "⏳ Running: {command}"
12
+ - Do not execute more than 3 tools in a row without output
13
+
14
+ ## Context
15
+ - Project: {{PROJECT_NAME}}
16
+ - MAP: See .planning/MAP.md
17
+ - Spec: See docs/specs/{FEATURE}/spec.md
18
+ - Task: {task_description}
19
+
20
+ ## Your Role: Builder
21
+ 1. Write TEST first (RED)
22
+ 2. Verify: {quality.commands.test} {test_file}
23
+ 3. Write CODE (GREEN)
24
+ 4. Verify: {quality.commands.test} {test_file}
25
+ 5. Refactor if needed
26
+ 6. Verify types: {quality.commands.typecheck}
27
+ 7. Verify lint: {quality.commands.lint} {files}
28
+ 8. Git commit: `{type}({scope}): {description}`
29
+
30
+ ## Key Files
31
+ - {file1} — {purpose}
32
+ - {file2} — {purpose}
33
+
34
+ ## Patterns
35
+ - Follow project conventions in CLAUDE.md
36
+ - Use project-specific patterns from .planning/memory/
37
+
38
+ ## DO NOT
39
+ - Do not modify files outside {scope_dir}
40
+ - Do not skip tests
41
+ - Do not use `any` type
42
+ - Do not add dependencies without approval
43
+ - Do not commit without passing quality gates