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,231 @@
1
+ # /frame:init -- Project Initialization
2
+
3
+ > **This is a slash command** — run it inside Claude Code after `npx the-frame init` has already installed the framework.
4
+ > It scans your codebase and fills MAP.md, CLAUDE.md, and CONTEXT.md.
5
+ > Not to be confused with `the-frame init` (the CLI installer).
6
+
7
+ Scans the project and fills MAP.md, CLAUDE.md, and CONTEXT.md with a complete project map.
8
+
9
+ ## Instructions
10
+
11
+ ### Step 0: Auto-detect Stack
12
+
13
+ Identify the project type by checking for these files:
14
+ - `package.json` → Node.js/JS/TS (check framework: Next.js, Express, NestJS, Vue, Svelte, React)
15
+ - `go.mod` → Go
16
+ - `Cargo.toml` → Rust
17
+ - `requirements.txt` / `pyproject.toml` / `setup.py` → Python
18
+ - `pom.xml` / `build.gradle` → Java/Kotlin
19
+ - `composer.json` → PHP
20
+ - `*.csproj` / `*.sln` → .NET/C#
21
+
22
+ Run: `ls -la` and `cat README.md 2>/dev/null | head -30`
23
+
24
+ Record: **stack**, **language**, **framework**, **project type** (web/api/cli/library/mobile).
25
+
26
+ ### Step 1: Surface Scan
27
+
28
+ Read the project config files (those that exist):
29
+ - `package.json` / `go.mod` / `Cargo.toml` / `pyproject.toml` — dependencies, versions
30
+ - `tsconfig.json` / `jsconfig.json` — compiler settings
31
+ - `.env.example` / `.env` — environment variables
32
+ - `Dockerfile` / `docker-compose.yml` — deployment
33
+ - `README.md` — project description
34
+
35
+ ### Step 2: Structure Scan
36
+
37
+ Adapt commands to the detected stack:
38
+
39
+ **For JS/TS projects:**
40
+ ```
41
+ find . -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" \) \
42
+ -not -path "*/node_modules/*" -not -path "*/.next/*" | head -60
43
+ ls -la src/ 2>/dev/null || ls -la app/ 2>/dev/null || true
44
+ ```
45
+
46
+ **For Go:**
47
+ ```
48
+ find . -name "*.go" -not -path "*/vendor/*" | head -60
49
+ ```
50
+
51
+ **For Python:**
52
+ ```
53
+ find . -name "*.py" -not -path "*/__pycache__/*" -not -path "*/venv/*" | head -60
54
+ ```
55
+
56
+ **For Rust:**
57
+ ```
58
+ find . -name "*.rs" -not -path "*/target/*" | head -60
59
+ ```
60
+
61
+ **For any stack:**
62
+ ```
63
+ find . -type d -not -path "*/node_modules/*" -not -path "*/.git/*" \
64
+ -not -path "*/target/*" -not -path "*/__pycache__/*" | head -40
65
+ ```
66
+
67
+ ### Step 3: Patterns Scan
68
+
69
+ Look for patterns relevant to the detected stack:
70
+
71
+ **Auth/sessions:**
72
+ ```
73
+ grep -r "auth\|session\|token\|login\|jwt\|oauth" . \
74
+ --include="*.ts" --include="*.go" --include="*.py" --include="*.rs" \
75
+ -l 2>/dev/null | head -10
76
+ ```
77
+
78
+ **Entry points:**
79
+ ```
80
+ find . -name "main.*" -o -name "index.*" -o -name "app.*" -o -name "server.*" \
81
+ | grep -v node_modules | grep -v ".next" | head -15
82
+ ```
83
+
84
+ **HTTP/API routes:**
85
+ ```
86
+ grep -r "router\|route\|handler\|endpoint\|@Get\|@Post\|app\.get\|app\.post" . \
87
+ --include="*.ts" --include="*.go" --include="*.py" -l 2>/dev/null | head -10
88
+ ```
89
+
90
+ **Tests:**
91
+ ```
92
+ find . -name "*_test.*" -o -name "*.test.*" -o -name "*.spec.*" \
93
+ | grep -v node_modules | head -15
94
+ ```
95
+
96
+ ### Step 4: Dependencies Scan
97
+
98
+ Determine inter-module dependencies:
99
+
100
+ ```
101
+ grep -r "^import\|^from\|^require\|^use " . \
102
+ --include="*.ts" --include="*.go" --include="*.py" --include="*.rs" \
103
+ -h 2>/dev/null | sort | uniq -c | sort -rn | head -30
104
+ ```
105
+
106
+ Check for: database, cache, queues, external APIs.
107
+
108
+ ### Step 5: Dynamics Scan
109
+
110
+ Determine data flow and async patterns:
111
+
112
+ ```
113
+ grep -r "async\|await\|goroutine\|channel\|Promise\|Observable\|WebSocket\|EventSource" . \
114
+ --include="*.ts" --include="*.go" --include="*.py" --include="*.rs" \
115
+ -l 2>/dev/null | head -10
116
+ ```
117
+
118
+ ### Step 6: Fill MAP.md
119
+
120
+ Write results to `.planning/MAP.md`:
121
+
122
+ ```markdown
123
+ # Project Map -- {Project Name}
124
+
125
+ ## Quick Facts
126
+ - **Name**: {name}
127
+ - **Type**: {web-app / api / cli / library / mobile}
128
+ - **Stack**: {language + framework + key dependencies}
129
+ - **Database**: {type and ORM/driver, if any}
130
+ - **Auth**: {auth type, if any}
131
+ - **Deploy**: {Docker / Vercel / Railway / bare metal / etc.}
132
+ - **Tests**: {testing framework}
133
+
134
+ ## Architecture Pattern
135
+ {Description: MVC / Clean Architecture / Layered / Monolith / Microservices / etc.}
136
+
137
+ ## Entry Points
138
+ {Main startup files, entrypoints, main functions}
139
+
140
+ ## Key Layers
141
+ {Description of project layers — adapt to real structure, not a template}
142
+
143
+ ## Data Flow
144
+ {How data moves: request → processing → response / storage}
145
+
146
+ ## Key Patterns
147
+ | Pattern | Where Used |
148
+ |---------|-----------|
149
+ | {real patterns from code} |
150
+
151
+ ## File Inventory
152
+ | Directory/File | Purpose |
153
+ |----------------|---------|
154
+ | {real project structure} |
155
+
156
+ ## Tech Debt / Notes
157
+ {Anything notable spotted during scanning}
158
+ ```
159
+
160
+ ### Step 7: Update CLAUDE.md
161
+
162
+ Fill in the placeholders in `CLAUDE.md` — this is the main file Claude reads on every run:
163
+
164
+ - **Tech Stack** — specific stack from step 0
165
+ - **Architecture** — brief description from step 6
166
+ - **Key Patterns** — 3-5 patterns from the code
167
+
168
+ ### Step 8: Update CONTEXT.md
169
+
170
+ Fill in the `## Technical Context` section in `.planning/CONTEXT.md`:
171
+ - Project type and stack
172
+ - Main entry points
173
+ - Key dependencies
174
+
175
+ ### Step 9: Update STATE.md
176
+
177
+ Update `.planning/STATE.md`:
178
+ ```markdown
179
+ ## Current Position
180
+ - Phase: SETUP
181
+ - Status: MAP.md filled, project ready to work
182
+ ```
183
+
184
+ ### Step 10: Fill memory from scan results
185
+
186
+ Using data already gathered in steps 1-5, fill two memory files:
187
+
188
+ **`.planning/memory/conventions.md`** — add what was detected:
189
+ - File naming pattern (kebab-case, camelCase, etc.)
190
+ - Import style (named vs default, path aliases)
191
+ - Git commit format (if `.gitmessage` or recent commits reveal a pattern)
192
+
193
+ **`.planning/memory/dependencies.md`** — add:
194
+ - Core dependencies (from package.json / go.mod / etc.)
195
+ - Dev tools (test runner, linter, bundler)
196
+ - Any "avoid" patterns spotted (e.g., deprecated packages)
197
+
198
+ Only fill what was actually found — no placeholders.
199
+
200
+ ### Step 11: Output completion checklist
201
+
202
+ ```
203
+ ╔══════════════════════════════════════════╗
204
+ ║ FRAME INIT — Complete ║
205
+ ╠══════════════════════════════════════════╣
206
+ ║ Filled: ║
207
+ ║ ✓ MAP.md — project map ║
208
+ ║ ✓ CLAUDE.md — stack + architecture ║
209
+ ║ ✓ CONTEXT.md — technical context ║
210
+ ║ ✓ STATE.md — phase set to SETUP ║
211
+ ║ ✓ memory/conventions.md ║
212
+ ║ ✓ memory/dependencies.md ║
213
+ ╠══════════════════════════════════════════╣
214
+ ║ Review these files and correct anything ║
215
+ ║ that looks wrong before proceeding. ║
216
+ ╠══════════════════════════════════════════╣
217
+ ║ Next step: ║
218
+ ║ /frame:research — start a feature ║
219
+ ║ /frame:fast — quick task < 30min ║
220
+ ║ /frame:doctor — verify installation ║
221
+ ╚══════════════════════════════════════════╝
222
+ ```
223
+
224
+ ## Result
225
+
226
+ - `.planning/MAP.md` — complete project map
227
+ - `CLAUDE.md` — stack and architecture sections filled
228
+ - `.planning/CONTEXT.md` — technical context filled
229
+ - `.planning/STATE.md` — status updated
230
+ - `.planning/memory/conventions.md` — conventions from scan
231
+ - `.planning/memory/dependencies.md` — dependencies from scan
@@ -0,0 +1,107 @@
1
+ # /frame:migrate -- Migration with Rollback Plan
2
+
3
+ Executes a migration with a plan and rollback strategy.
4
+
5
+ ## Instructions
6
+
7
+ Execute the migration: **$ARGUMENTS**
8
+
9
+ ### Step 1: Determine Migration Type
10
+
11
+ Identify the type from the argument:
12
+ - `db` — database migration (irreversible, requires a `down` script)
13
+ - `api` — API/interface changes
14
+ - `deps` — dependency updates
15
+ - `code` — code refactor/move (default)
16
+
17
+ ### Step 2: Analysis
18
+
19
+ Identify:
20
+ - Source: what is being migrated (from)
21
+ - Target: where it is being migrated (to)
22
+ - Scope: which files are affected (`grep -r "{area}" --include="*.ts" | head -20`)
23
+ - Risks: what could break
24
+
25
+ ### Step 3: Create Migration Plan
26
+
27
+ Create `docs/specs/migrations/{feature}/plan.md`:
28
+
29
+ ```markdown
30
+ # Migration Plan: {from} -> {to}
31
+
32
+ ## Type
33
+ {db | api | deps | code}
34
+
35
+ ## Overview
36
+ {What is being migrated and why}
37
+
38
+ ## Steps
39
+ ### Step 1: {description}
40
+ - Files: {files}
41
+ - Command: {command}
42
+ - Verify: {verification}
43
+
44
+ ### Step 2: {description}
45
+ - Files: {files}
46
+ - Command: {command}
47
+ - Verify: {verification}
48
+
49
+ ## Rollback Plan
50
+ ### Rollback Step 1
51
+ - Description: {what to revert}
52
+ - Command: {command}
53
+
54
+ ## Risks
55
+ - {risk 1}: {mitigation}
56
+ ```
57
+
58
+ ### Step 4: Create Checkpoint
59
+
60
+ ```
61
+ /frame:checkpoint create pre-migration-{feature}
62
+ ```
63
+
64
+ ### Step 5: Execute Migration
65
+
66
+ Execute step by step, verifying after each step:
67
+
68
+ ```
69
+ 1. Apply changes
70
+ 2. /frame:health (quality gates)
71
+ 3. If OK -> continue
72
+ 4. If FAIL -> /frame:rollback
73
+ ```
74
+
75
+ **For `db` type**: ensure a `down` script exists before running `up`.
76
+
77
+ ### Step 6: Git Commit
78
+
79
+ ```bash
80
+ git add {files}
81
+ git commit -m "refactor(migration): migrate {from} to {to}"
82
+ ```
83
+
84
+ ### Step 7: Update STATE.md
85
+
86
+ ```markdown
87
+ ## Current Position
88
+ - Phase: MIGRATE
89
+ - Feature: {area}
90
+ - Status: Migration complete — {from} -> {to}
91
+ ```
92
+
93
+ ## Rules
94
+
95
+ - **Checkpoint before migration** — via `/frame:checkpoint`, not manually
96
+ - **Rollback via `/frame:rollback`** — not manually
97
+ - **Quality gates via `/frame:health`** — no hardcoded commands
98
+ - **Step by step** — not everything at once
99
+ - **For `db` migrations** — `down` script is mandatory
100
+
101
+ ## Result
102
+
103
+ - Migration executed
104
+ - Plan saved to `docs/specs/migrations/{feature}/plan.md`
105
+ - Quality gates passed
106
+ - STATE.md updated
107
+ - Git commit created
@@ -0,0 +1,32 @@
1
+ # /frame:note -- Quick Memory Note
2
+
3
+ Add a quick note to memory without a full retrospective.
4
+
5
+ ## Instructions
6
+
7
+ Input: **$ARGUMENTS**
8
+
9
+ ### Step 1: Route by prefix
10
+
11
+ - Starts with `pattern:` → append to `.planning/memory/patterns.md` under `## Active`
12
+ - Starts with `decision:` → append to `.planning/memory/decisions.md`
13
+ - Starts with `anti:` → append to `.planning/memory/anti-patterns.md`
14
+ - No prefix → append to `.planning/memory/context.md`
15
+
16
+ Strip the prefix before saving.
17
+
18
+ ### Step 2: Append
19
+
20
+ Format: `- {date}: {text}`
21
+
22
+ Append to the appropriate file. Do not rewrite the file — append only.
23
+
24
+ ### Step 3: Confirm
25
+
26
+ Output one line: `Noted in {filename}: "{text}"`
27
+
28
+ ## Rules
29
+
30
+ - No research, no plan, no commit
31
+ - Append only — never overwrite existing content
32
+ - Date format: YYYY-MM-DD
@@ -0,0 +1,145 @@
1
+ # /frame:pause -- Save State
2
+
3
+ Saves current state and pauses work.
4
+
5
+ ## Instructions
6
+
7
+ Save the current state: **$ARGUMENTS**
8
+
9
+ ### Step 0: Fail-fast validation + mark IN_PROGRESS
10
+
11
+ Verify STATE.md exists:
12
+ ```bash
13
+ test -f .planning/STATE.md || { echo "ERROR: .planning/STATE.md not found. Run /frame:init first."; exit 1; }
14
+ ```
15
+
16
+ Immediately update status in `.planning/STATE.md`:
17
+ ```
18
+ Status: IN_PROGRESS (pausing)
19
+ ```
20
+
21
+ Capture the last commit hash BEFORE any changes:
22
+ ```bash
23
+ git rev-parse HEAD 2>/dev/null || echo "no-commits"
24
+ ```
25
+ Store in `lastCommit`.
26
+
27
+ ### Step 1: Read current STATE.md
28
+
29
+ Read `.planning/STATE.md` to understand the current phase, feature, and tasks:
30
+ ```bash
31
+ cat .planning/STATE.md
32
+ ```
33
+
34
+ Extract: current phase, feature, list of open (incomplete) tasks.
35
+
36
+ ### Step 2: Save uncommitted changes
37
+
38
+ Check for changes:
39
+ ```bash
40
+ git status --short
41
+ ```
42
+
43
+ If there are changes — offer two options:
44
+ - **WIP commit** (recommended): `git commit -m "WIP: pause — $ARGUMENTS"`
45
+ - **Stash** (if commit is undesirable): `git stash push -m "FRAME pause: $ARGUMENTS"`
46
+
47
+ Record in `hasStash`/`hasWip` accordingly.
48
+
49
+ ### Step 3: Update STATE.md
50
+
51
+ Update (do not overwrite) `.planning/STATE.md`, refreshing the status section:
52
+ ```markdown
53
+ ## Current Position
54
+ - Phase: {current phase}
55
+ - Feature: {current feature}
56
+ - Task: {completed}/{total}
57
+ - Status: PAUSED
58
+ - Paused at: {timestamp}
59
+ - Notes: {$ARGUMENTS}
60
+ ```
61
+
62
+ ### Step 4: Create pause-state.json
63
+
64
+ Create `.planning/pause-state.json`:
65
+
66
+ ```json
67
+ {
68
+ "timestamp": "{ISO timestamp}",
69
+ "phase": "{current phase}",
70
+ "feature": "{current feature}",
71
+ "task": "{completed}/{total}",
72
+ "lastCommit": "{hash}",
73
+ "notes": "{$ARGUMENTS}",
74
+ "hasStash": true/false,
75
+ "hasWip": true/false,
76
+ "stashMessage": "{stash or WIP commit message}",
77
+ "openTasks": ["{open task 1}", "{open task 2}"],
78
+ "resumeHint": "{specific next step — file, function, or task}"
79
+ }
80
+ ```
81
+
82
+ ### Step 5: Git Tag + Checkpoint
83
+
84
+ Create a checkpoint before pause:
85
+ ```bash
86
+ TIMESTAMP=$(date +%Y%m%d%H%M)
87
+ git tag "frame/pause-$TIMESTAMP" -m "FRAME pause: $ARGUMENTS"
88
+ ```
89
+
90
+ If autoCheckpoint is enabled, also create a phase checkpoint:
91
+ ```bash
92
+ PHASE=$(grep -oE 'Phase: .+' .planning/STATE.md 2>/dev/null | head -1 | sed 's/Phase: //' || echo "unknown")
93
+ if echo "research plan build review" | grep -q "$PHASE"; then
94
+ git tag "frame/checkpoint/$PHASE-$TIMESTAMP-pause" -m "Auto checkpoint before pause ($PHASE phase)"
95
+ fi
96
+ ```
97
+
98
+ ### Step 6: Save Context
99
+
100
+ Create `.planning/pause-history/{date}.md`:
101
+
102
+ ```markdown
103
+ # Pause: {date}
104
+
105
+ ## State
106
+ - Phase: {phase}
107
+ - Feature: {feature}
108
+ - Task: {completed}/{total}
109
+
110
+ ## What was done
111
+ {what was completed}
112
+
113
+ ## Open tasks
114
+ - [ ] {open task 1}
115
+ - [ ] {open task 2}
116
+
117
+ ## What's next
118
+ {resumeHint — specific next step}
119
+
120
+ ## Notes
121
+ {$ARGUMENTS}
122
+ ```
123
+
124
+ ## Output
125
+
126
+ ```
127
+ +======================================================================+
128
+ | FRAME PAUSED |
129
+ +======================================================================+
130
+ | State saved at: {timestamp} |
131
+ | Phase: {phase} |
132
+ | Feature: {feature} |
133
+ | Task: {completed}/{total} |
134
+ | |
135
+ | Resume with: /frame:resume |
136
+ +======================================================================+
137
+ ```
138
+
139
+ ## Result
140
+
141
+ - State read and updated (not overwritten)
142
+ - Changes saved (WIP commit or stash)
143
+ - Git tag created
144
+ - Open tasks and resumeHint recorded
145
+ - Pause history saved