takomi 2.0.4 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/README.md +26 -2
  2. package/assets/.agent/skills/takomi/SKILL.md +59 -0
  3. package/assets/.agent/skills/takomi/references/migration-map.md +28 -0
  4. package/assets/.agent/skills/takomi/workflows/agent_reset.md +173 -0
  5. package/assets/.agent/skills/takomi/workflows/escalate.md +112 -0
  6. package/assets/.agent/skills/takomi/workflows/migrate.md +135 -0
  7. package/assets/.agent/skills/takomi/workflows/mode-architect.md +422 -0
  8. package/assets/.agent/skills/takomi/workflows/mode-ask.md +294 -0
  9. package/assets/.agent/skills/takomi/workflows/mode-code.md +481 -0
  10. package/assets/.agent/skills/takomi/workflows/mode-debug.md +407 -0
  11. package/assets/.agent/skills/takomi/workflows/mode-orchestrator.md +222 -0
  12. package/assets/.agent/skills/takomi/workflows/mode-review.md +341 -0
  13. package/assets/.agent/skills/takomi/workflows/mode-visionary.md +186 -0
  14. package/assets/.agent/skills/takomi/workflows/optimize-agent-context.md +54 -0
  15. package/assets/.agent/skills/takomi/workflows/remotion-build.md +323 -0
  16. package/assets/.agent/skills/takomi/workflows/reverse_genesis.md +132 -0
  17. package/assets/.agent/skills/takomi/workflows/review_code.md +133 -0
  18. package/assets/.agent/skills/takomi/workflows/spawn-jstar-code-review.md +121 -0
  19. package/assets/.agent/skills/takomi/workflows/stitch.md +149 -0
  20. package/assets/.agent/skills/takomi/workflows/vibe-build.md +271 -0
  21. package/assets/.agent/skills/takomi/workflows/vibe-continueBuild.md +184 -0
  22. package/assets/.agent/skills/takomi/workflows/vibe-design.md +98 -0
  23. package/assets/.agent/skills/takomi/workflows/vibe-finalize.md +208 -0
  24. package/assets/.agent/skills/takomi/workflows/vibe-genesis.md +191 -0
  25. package/assets/.agent/skills/takomi/workflows/vibe-primeAgent.md +110 -0
  26. package/assets/.agent/skills/takomi/workflows/vibe-spawnTask.md +188 -0
  27. package/assets/.agent/skills/takomi/workflows/vibe-syncDocs.md +90 -0
  28. package/package.json +1 -1
  29. package/src/cli.js +7 -6
  30. package/src/store.js +4 -3
@@ -0,0 +1,323 @@
1
+ ---
2
+ description: The Remotion Builder - Generate a detailed video spec, get approval, then build. Two-phase workflow for programmatic video creation.
3
+ ---
4
+
5
+ # Remotion Builder Workflow
6
+
7
+ > **Purpose**: Create programmatic videos using Remotion. This workflow forces mandatory rule reading, detailed planning, and an asset audit before any code is written.
8
+
9
+ ---
10
+
11
+ ## ⚠️ CRITICAL: MANDATORY RULE READING
12
+
13
+ **YOU ARE NOT SMART ENOUGH TO GUESS REMOTION PATTERNS.**
14
+
15
+ Before writing ANY Remotion code, you MUST read the relevant rule files. Do NOT proceed without reading these. Do NOT assume you know what you're doing.
16
+
17
+ ### Step 0.1: Read the Main Skill
18
+ // turbo
19
+ ```bash
20
+ cat ".agent/skills/remotion/SKILL.md"
21
+ ```
22
+
23
+ ### Step 0.2: Read REQUIRED Rule Files
24
+
25
+ Based on what the video needs, you MUST read the corresponding rule files. This is NOT optional.
26
+
27
+ **For ANY animation work (ALWAYS READ THESE):**
28
+ // turbo
29
+ ```bash
30
+ cat ".agent/skills/remotion/rules/animations.md"
31
+ cat ".agent/skills/remotion/rules/timing.md"
32
+ cat ".agent/skills/remotion/rules/sequencing.md"
33
+ ```
34
+
35
+ **If using scene transitions:**
36
+ // turbo
37
+ ```bash
38
+ cat ".agent/skills/remotion/rules/transitions.md"
39
+ ```
40
+
41
+ **If using text animations (typewriter, highlights, etc):**
42
+ // turbo
43
+ ```bash
44
+ cat ".agent/skills/remotion/rules/text-animations.md"
45
+ cat ".agent/skills/remotion/rules/fonts.md"
46
+ ```
47
+
48
+ **If using images, videos, or audio:**
49
+ // turbo
50
+ ```bash
51
+ cat ".agent/skills/remotion/rules/assets.md"
52
+ cat ".agent/skills/remotion/rules/images.md"
53
+ cat ".agent/skills/remotion/rules/videos.md"
54
+ cat ".agent/skills/remotion/rules/audio.md"
55
+ ```
56
+
57
+ **If using 3D elements:**
58
+ // turbo
59
+ ```bash
60
+ cat ".agent/skills/remotion/rules/3d.md"
61
+ ```
62
+
63
+ **If using captions/subtitles:**
64
+ // turbo
65
+ ```bash
66
+ cat ".agent/skills/remotion/rules/display-captions.md"
67
+ cat ".agent/skills/remotion/rules/transcribe-captions.md"
68
+ ```
69
+
70
+ **If using charts/data visualization:**
71
+ // turbo
72
+ ```bash
73
+ cat ".agent/skills/remotion/rules/charts.md"
74
+ ```
75
+
76
+ **If using Lottie animations:**
77
+ // turbo
78
+ ```bash
79
+ cat ".agent/skills/remotion/rules/lottie.md"
80
+ ```
81
+
82
+ **If using GIFs:**
83
+ // turbo
84
+ ```bash
85
+ cat ".agent/skills/remotion/rules/gifs.md"
86
+ ```
87
+
88
+ > ⛔ **DO NOT PROCEED TO PHASE 1 UNTIL YOU HAVE READ THE RELEVANT RULES.**
89
+
90
+ ---
91
+
92
+ ## PHASE 1: Video Specification
93
+
94
+ Generate a **Video Spec Document** in `docs/remotion/[video_name]_spec.md`.
95
+
96
+ ### Step 1.1: Generate the Video Spec
97
+
98
+ Create the spec with this structure:
99
+
100
+ ```markdown
101
+ # 🎬 Video Spec: [Video Name]
102
+
103
+ ## Overview
104
+ | Property | Value |
105
+ |----------|-------|
106
+ | **Type** | [Main/Short/B-Roll/Intro/Outro] |
107
+ | **Duration** | [X seconds] (Y frames @ Zfps) |
108
+ | **Resolution** | [WxH] |
109
+ | **FPS** | 30 |
110
+ | **Composition ID** | `[CompositionId]` |
111
+
112
+ ## Rules I Read Before Writing This Spec
113
+ - [x] animations.md
114
+ - [x] timing.md
115
+ - [x] sequencing.md
116
+ - [ ] transitions.md (if applicable)
117
+ - [ ] text-animations.md (if applicable)
118
+ - [ ] ... (list all rules you read)
119
+
120
+ ## Creative Direction
121
+ [1-2 sentences describing the visual concept]
122
+
123
+ ### Color Palette
124
+ | Color | Hex | Usage |
125
+ |-------|-----|-------|
126
+ | Primary | #XXXXXX | [usage] |
127
+
128
+ ### Typography
129
+ | Font | Weight | Size | Usage |
130
+ |------|--------|------|-------|
131
+ | [Font Name] | [weight] | [px] | [usage] |
132
+
133
+ ---
134
+
135
+ ## Scene Breakdown
136
+
137
+ ### Scene 1: [Name] (0s - Xs)
138
+ **Duration**: X seconds (Y frames)
139
+
140
+ #### Visual Elements
141
+ - [ ] Element 1: [Description]
142
+
143
+ #### Animations (from timing.md / animations.md)
144
+ | Element | Type | Start | End | Easing |
145
+ |---------|------|-------|-----|--------|
146
+ | [Element] | [fadeIn/spring/interpolate] | X | Y | [spring({damping:200}) / Easing.out(Easing.exp)] |
147
+
148
+ #### Code Approach
149
+ \```tsx
150
+ // Frame-by-frame animation using useCurrentFrame() - NEVER CSS transitions
151
+ const frame = useCurrentFrame();
152
+ const opacity = interpolate(frame, [0, 30], [0, 1], { extrapolateRight: 'clamp' });
153
+ \```
154
+
155
+ ---
156
+
157
+ ## Technical Requirements
158
+
159
+ ### Props Schema (Zod)
160
+ \```ts
161
+ import { z } from "zod";
162
+ export const [Id]Schema = z.object({ ... });
163
+ \```
164
+
165
+ ### Critical Rules (MEMORIZE THESE)
166
+ > ⛔ FORBIDDEN: CSS transitions, CSS animations, Tailwind animation classes
167
+ > ✅ REQUIRED: All animations via useCurrentFrame() + interpolate()/spring()
168
+ > ✅ REQUIRED: premountFor={1 * fps} on all <Sequence> components
169
+ > ✅ REQUIRED: staticFile() for public folder assets
170
+ > ✅ REQUIRED: Clamp extrapolation to prevent values going beyond range
171
+ ```
172
+
173
+ ### Step 1.2: Request Approval
174
+
175
+ Use `notify_user` with `BlockedOnUser: true` to request spec approval.
176
+
177
+ ---
178
+
179
+ ## PHASE 2: Asset Audit
180
+
181
+ After spec approval, generate an **Asset Manifest**.
182
+
183
+ ### Step 2.1: Generate Asset Manifest
184
+
185
+ Create `docs/remotion/[video_name]_assets.md`:
186
+
187
+ ```markdown
188
+ # 🎨 Asset Manifest: [Video Name]
189
+
190
+ ## 1. Code-Generatable Components ✅
191
+ *These can be built entirely with React/SVG code*
192
+
193
+ | Component | Description | Complexity |
194
+ |-----------|-------------|------------|
195
+ | `ComponentName.tsx` | Description | Low/Medium/High |
196
+
197
+ ---
198
+
199
+ ## 2. Image Prompts for User 🖼️
200
+ *I CANNOT generate these myself. I am providing prompts for YOU to generate.*
201
+
202
+ > **Instructions for User:**
203
+ > Use these prompts with your preferred image generation tool (Midjourney, DALL-E, generate_image tool, etc.)
204
+ > After generating, save the images to `public/assets/[video_name]/`
205
+
206
+ | Asset | Prompt | Size | Save As |
207
+ |-------|--------|------|---------|
208
+ | Background | "Abstract dark gradient with subtle grid pattern, cyberpunk aesthetic, 16:9 aspect ratio" | 1920x1080 | `bg_hero.png` |
209
+ | Logo Icon | "Minimal geometric logo, neon cyan glow, dark background, icon style, square" | 512x512 | `logo.png` |
210
+
211
+ **Total prompts**: X images for you to generate
212
+
213
+ ---
214
+
215
+ ## 3. External Assets Needed 📦
216
+ *These require you to provide - stock footage, your logos, audio files*
217
+
218
+ | Asset | Type | Description | Action |
219
+ |-------|------|-------------|--------|
220
+ | Your Logo | SVG/PNG | Your brand logo | You provide |
221
+ | Background Music | MP3 | Ambient tech music | Source from [Epidemic Sound](https://epidemicsound.com) |
222
+ | Screen Recording | MP4 | Demo of your app | You record |
223
+
224
+ ---
225
+
226
+ ## 4. Your Choices ⚡
227
+
228
+ Tell me for each:
229
+
230
+ | Item | Options |
231
+ |------|---------|
232
+ | UI Mockups | [ ] I'll build code components / [ ] I'll provide screenshots |
233
+ | Background | [ ] Generate with prompt above / [ ] I'll provide my own |
234
+ | Logo | [ ] Generate with prompt above / [ ] I'll provide my own |
235
+
236
+ ---
237
+
238
+ ## After You Decide
239
+
240
+ **If you want me to proceed with code components:**
241
+ Reply: "Build the components"
242
+
243
+ **If you want to generate images first:**
244
+ Run the prompts yourself, then reply: "Assets ready in public/assets/[folder]"
245
+
246
+ **If you're providing your own assets:**
247
+ Reply: "I'm providing: [list files] - they're in public/assets/[folder]"
248
+ ```
249
+
250
+ ### Step 2.2: Wait for User
251
+
252
+ Use `notify_user` with `BlockedOnUser: true`. Do NOT proceed until user responds with their choices.
253
+
254
+ ---
255
+
256
+ ## PHASE 3: Component Building
257
+
258
+ Only after user confirms assets OR chooses code-gen:
259
+
260
+ ### Step 3.1: Create Components
261
+
262
+ For each component in the manifest:
263
+ 1. Re-read the relevant rule files (animations.md, timing.md, etc.)
264
+ 2. Create the component following patterns from the rules EXACTLY
265
+ 3. Use `useCurrentFrame()` for ALL animations
266
+ 4. NEVER use CSS transitions or Tailwind animation classes
267
+
268
+ ### Step 3.2: Create Main Composition
269
+
270
+ 1. Import all components
271
+ 2. Set up `<Sequence>` structure per the spec
272
+ 3. Add `premountFor={1 * fps}` to every Sequence
273
+ 4. Register in `Root.tsx`
274
+
275
+ ---
276
+
277
+ ## PHASE 4: Verification
278
+
279
+ ### Step 4.1: Start Studio
280
+ // turbo
281
+ ```bash
282
+ pnpm start
283
+ ```
284
+
285
+ ### Step 4.2: Manual Verification
286
+ 1. Open composition in browser
287
+ 2. Scrub through timeline
288
+ 3. Verify all animations trigger at correct frames
289
+ 4. Check console for errors
290
+
291
+ ---
292
+
293
+ ## Quick Reference (From Rules)
294
+
295
+ ### Interpolation (from timing.md)
296
+ ```tsx
297
+ const opacity = interpolate(frame, [0, 30], [0, 1], {
298
+ extrapolateRight: 'clamp',
299
+ extrapolateLeft: 'clamp',
300
+ });
301
+ ```
302
+
303
+ ### Spring (from timing.md)
304
+ ```tsx
305
+ const scale = spring({
306
+ frame,
307
+ fps,
308
+ config: { damping: 200 }, // Smooth, no bounce
309
+ });
310
+ ```
311
+
312
+ ### Sequence (from sequencing.md)
313
+ ```tsx
314
+ <Sequence from={1 * fps} durationInFrames={2 * fps} premountFor={1 * fps}>
315
+ <MyComponent />
316
+ </Sequence>
317
+ ```
318
+
319
+ ### Assets (from assets.md)
320
+ ```tsx
321
+ import { Img, staticFile } from 'remotion';
322
+ <Img src={staticFile('image.png')} />
323
+ ```
@@ -0,0 +1,132 @@
1
+ ---
2
+ description: Onboard an AI to an existing codebase by generating an "Autopsy Report".
3
+ ---
4
+ # Workflow: Reverse Genesis (Codebase Onboarding)
5
+
6
+ **System Instruction:**
7
+ This workflow is the OPPOSITE of `/init_vibecode_genesis`.
8
+ Instead of planning a NEW project, you are **onboarding to an EXISTING codebase**.
9
+
10
+ Your job is to generate a **Project Autopsy Report** — a comprehensive analysis of the current state of the code.
11
+
12
+ ---
13
+
14
+ ## Steps
15
+
16
+ ### 1. Reconnaissance (Auto-Scan)
17
+
18
+ **A. Project Overview:**
19
+ ```bash
20
+ cat README.md 2>/dev/null || echo "No README found"
21
+ cat docs/Project_Requirements.md 2>/dev/null || echo "No PRD found"
22
+ ```
23
+
24
+ **B. Tech Stack Detection:**
25
+ ```bash
26
+ # Node/JS
27
+ cat package.json 2>/dev/null | head -50
28
+ # Python
29
+ cat requirements.txt 2>/dev/null || cat pyproject.toml 2>/dev/null
30
+ # Rust
31
+ cat Cargo.toml 2>/dev/null
32
+ ```
33
+
34
+ **C. Architecture Scan:**
35
+ ```bash
36
+ # List top-level structure
37
+ ls -la
38
+ # List source structure
39
+ find src -type f -name "*.ts" -o -name "*.py" -o -name "*.rs" 2>/dev/null | head -30
40
+ ```
41
+
42
+ **D. Database Schema (if applicable):**
43
+ ```bash
44
+ cat prisma/schema.prisma 2>/dev/null | head -100
45
+ ```
46
+
47
+ **E. Recent Activity:**
48
+ ```bash
49
+ git log --oneline -10
50
+ ```
51
+
52
+ ### 2. Generate Autopsy Report
53
+ Create `docs/autopsy_report.md` with the following:
54
+
55
+ ```markdown
56
+ # Project Autopsy Report
57
+
58
+ **Generated:** [Current Date/Time]
59
+ **Purpose:** Onboard a new AI Orchestrator to this existing codebase.
60
+
61
+ ---
62
+
63
+ ## 1. Project Elevator Pitch
64
+ [One-sentence purpose of this application]
65
+
66
+ ## 2. Core Technology Stack
67
+ | Category | Technology |
68
+ | :--- | :--- |
69
+ | Language | TypeScript / Python / etc. |
70
+ | Framework | Next.js / FastAPI / etc. |
71
+ | Database | PostgreSQL / SQLite / etc. |
72
+ | Key Libraries | [List major dependencies] |
73
+
74
+ ## 3. Inferred Architecture
75
+ [Describe the architectural pattern observed]
76
+ - e.g., "Next.js App Router with Feature-Sliced Design"
77
+ - e.g., "Modular Python with central event bus"
78
+
79
+ ## 4. Key Modules & Responsibilities
80
+ | File/Module | Responsibility |
81
+ | :--- | :--- |
82
+ | `src/app/` | Next.js pages and routes |
83
+ | `src/features/` | Domain-specific logic |
84
+ | `src/lib/` | Shared utilities |
85
+
86
+ ## 5. Inferred Coding Conventions
87
+ - **Naming:** snake_case / PascalCase / camelCase
88
+ - **Components:** Server Components by default
89
+ - **Validation:** Zod for all inputs
90
+ - **Styling:** Tailwind CSS utility-first
91
+
92
+ ## 6. Entry Points
93
+ - Main: `src/app/page.tsx` or `main.py`
94
+ - API: `src/app/api/`
95
+
96
+ ## 7. Current State
97
+ **Recent Commits:**
98
+ [List from git log]
99
+
100
+ **Open Issues:**
101
+ [List from gh issue list]
102
+
103
+ ---
104
+
105
+ ## MISSION BRIEFING (For Orchestrator)
106
+
107
+ You have now assimilated this codebase.
108
+
109
+ **Your Directive:**
110
+ 1. Acknowledge you understand the existing architecture.
111
+ 2. Adopt the project's coding conventions.
112
+ 3. Ask the user: "What would you like to build or fix?"
113
+ ```
114
+
115
+ ### 3. Full File Embedding (Optional)
116
+ If the project is complex, embed key files directly:
117
+ - `src/lib/utils.ts`
118
+ - Main config files
119
+ - Core business logic
120
+
121
+ ### 4. Confirmation
122
+ Tell the user:
123
+ "🔬 **Autopsy Report Generated.**
124
+ Saved to: `docs/autopsy_report.md`
125
+
126
+ This report contains:
127
+ - Tech stack analysis
128
+ - Architecture breakdown
129
+ - Coding conventions
130
+ - Current state
131
+
132
+ To onboard a new AI, paste this report into the new session."
@@ -0,0 +1,133 @@
1
+ ---
2
+ description: Run the J-Star Code Reviewer loop to analyze and fix code quality issues.
3
+ ---
4
+
5
+ # J-Star Code Review Workflow
6
+
7
+ This workflow executes the J-Star Reviewer on staged changes, allowing the agent to iteratively fix issues.
8
+
9
+ ## 1. Build the Brain (Required once)
10
+ If you haven't indexed the project yet, or if major files have changed, run:
11
+ // turbo
12
+ ```bash
13
+ jstar init
14
+ ```
15
+
16
+ ## 2. Stage Current Changes
17
+ Ensure all recent changes are staged so the reviewer can see them.
18
+ // turbo
19
+ ```bash
20
+ git add .
21
+ ```
22
+
23
+ ## 3. Run Reviewer
24
+ Execute the review pipeline.
25
+
26
+ ### Standard Review (Staged Changes)
27
+ ```bash
28
+ jstar review
29
+ ```
30
+ *Use this when changes are staged but not yet committed.*
31
+
32
+ ### Retroactive Review (Oops Mode)
33
+ If you already committed changes but forgot to review:
34
+ ```bash
35
+ jstar review --last
36
+ ```
37
+ *Equivalent to checking the last commit `HEAD~1..HEAD`.*
38
+
39
+ ### Branch/PR Review
40
+ If working on a feature branch, check against main:
41
+ ```bash
42
+ jstar review --pr
43
+ ```
44
+ *Equivalent to `git diff main...HEAD`. Use this for full feature verification.*
45
+
46
+ ## 4. Analyze and Fix
47
+ **Agent Instructions:**
48
+ 1. **Read the Output**: Check `.jstar/last-review.md` or the console summary.
49
+ 2. **Prioritize**: Focus *only* on **P0_CRITICAL** and **P1_HIGH** issues first.
50
+ 3. **Looping Strategy**:
51
+ - **IF** P0/P1 issues are found:
52
+ - Apply fixes to the code.
53
+ - Stage changes: `git add .`
54
+ - (Optional) Re-index if you added new files: `jstar init`
55
+ - Restart this workflow (Stage -> Review).
56
+ - **IF** only P2_MEDIUM issues remain:
57
+ - You may fix them if they are quick/obvious.
58
+ - Otherwise, consider the code "Good Enough" and stop.
59
+ - **MAX LOOPS**: 3. Do not run this cycle more than 3 times. If issues persist, stop and ask the user.
60
+
61
+ ## 5. Handling False Positives (Debate Mode)
62
+
63
+ If the reviewer flags correct code as an issue (e.g., security false positives), use **Headless Chat** to resolve it.
64
+
65
+ **Protocol:**
66
+ 1. **Start Session:**
67
+ Use the `run_command` tool to start the background process:
68
+ ```bash
69
+ jstar chat --headless
70
+ ```
71
+ *Note: Capture the `CommandId` returned by this tool.*
72
+
73
+ 2. **List Issues (Get IDs):**
74
+ Use `send_command_input` with the `CommandId`:
75
+ ```json
76
+ {"action": "list"}
77
+ ```
78
+ *Wait for output. Identify the numeric `id` of the issue you want to challenge.*
79
+
80
+ 3. **Debate:**
81
+ Use `send_command_input` to explain why it's a false positive:
82
+ ```json
83
+ {"action": "debate", "issueId": 0, "argument": "This is correct because..."}
84
+ ```
85
+ *Use the integer `id` from step 2.*
86
+
87
+ 4. **Verify Result:**
88
+ Check the output for `"status": "resolved"` and `"verdict": "LGTM"`.
89
+
90
+ 5. **Exit:**
91
+ Terminate the session cleanly:
92
+ ```json
93
+ {"action": "exit"}
94
+ ```
95
+
96
+ ---
97
+
98
+ ## AI Agent Mode (Headless)
99
+
100
+ For programmatic interaction without TUI navigation, use headless mode.
101
+
102
+ ### JSON Review (One-Shot)
103
+ Get findings as JSON for parsing:
104
+ // turbo
105
+ ```bash
106
+ jstar review --json > .jstar/report.json
107
+ ```
108
+
109
+ ### Headless Chat (Interactive Protocol)
110
+ For debating specific issues via stdin/stdout:
111
+ ```bash
112
+ echo '{"action": "list"}' | jstar chat --headless
113
+ ```
114
+
115
+ **Commands:**
116
+ | Action | Parameters | Description |
117
+ |--------|------------|-------------|
118
+ | `list` | — | List all current issues |
119
+ | `debate` | `issueId`, `argument` | Challenge an issue |
120
+ | `ignore` | `issueId` | Mark issue as ignored |
121
+ | `exit` | — | End session, get final report |
122
+
123
+ See [Headless Mode Docs](../docs/features/headless-mode.md) for full protocol.
124
+
125
+ ### AI Fix Cycle
126
+ ```
127
+ 1. jstar review --json → Parse findings
128
+ 2. Apply code fixes
129
+ 3. git add . → Stage changes
130
+ 4. jstar init → Update brain (if new files added)
131
+ 5. jstar review --json → Verify fixes
132
+ 6. Repeat until P0/P1 = 0
133
+ ```
@@ -0,0 +1,121 @@
1
+ ---
2
+ description: Spawn J Star Code Review bot into the current repository
3
+ ---
4
+
5
+ # /spawn-jstar - Add J Star Reviewer v2 to Any Project
6
+
7
+ Works with **any programming language** — TypeScript, Python, Rust, Go, etc.
8
+
9
+ ## Prerequisites
10
+ - Node.js 18+ installed on your machine
11
+
12
+ ## Steps
13
+
14
+ ### 1. Install the CLI Globally (One Time) use pnpm by default else revert to npm
15
+ // turbo
16
+ ```bash
17
+ pnpm install -g jstar-reviewer
18
+ ```
19
+
20
+ ### 2. Run your First Command
21
+ // turbo
22
+ ```bash
23
+ jstar setup
24
+ ```
25
+ *(Or simply run `jstar review` if you already have your keys ready)*
26
+
27
+ This **auto-creates** (or updates):
28
+ - `.jstar/` directory
29
+ - `.env.example` with required variables
30
+ - `.gitignore` (appends `.jstar/` and `.env.local`)
31
+
32
+
33
+ ### 3. Configure Environment Variables
34
+ ```bash
35
+ cp .env.example .env.local
36
+ ```
37
+
38
+ Edit `.env.local` and add your API keys:
39
+ ```env
40
+ GEMINI_API_KEY=your_gemini_api_key_here
41
+ GROQ_API_KEY=your_groq_api_key_here
42
+ ```
43
+
44
+ **Where to get keys:**
45
+ - Google API Key: [Google AI Studio](https://aistudio.google.com/apikey)
46
+ - Groq API Key: [console.groq.com](https://console.groq.com)
47
+
48
+ ### 4. Index Your Codebase (Build the Brain)
49
+ ```bash
50
+ jstar init
51
+ ```
52
+
53
+ This scans your codebase and creates embeddings for context-aware reviews.
54
+
55
+ ### 5. (Optional) Create Rules File
56
+ Create `.jstar/rules.md` with your project-specific coding guidelines:
57
+
58
+ ```markdown
59
+ # Project Coding Rules
60
+
61
+ ## General
62
+ - Follow PEP 8 (Python) / Google Style Guide
63
+ - Add docstrings to all public functions
64
+
65
+
66
+
67
+ ## Security
68
+ - Never log sensitive data
69
+ - Validate all user inputs
70
+ ```
71
+
72
+ ### 6. Understanding Review Modes
73
+ Before running a review, understand the available modes:
74
+
75
+ | Mode | Command | Best For |
76
+ | :--- | :--- | :--- |
77
+ | **Standard** | `jstar review` | checking staged changes *before* committing. |
78
+ | **Retroactive** | `jstar review --last` | checking the *last commit* (if you forgot to review). |
79
+ | **Pull Request** | `jstar review --pr` | checking an entire feature branch against `main`. |
80
+
81
+ ### 7. Run Your First Review
82
+
83
+ **Agent Instruction:** Ask the user: *"Would you like to run the review yourself, or should I run a headless check for you?"*
84
+
85
+ #### Option A: User Runs It (Recommended)
86
+ The user runs the interactive TUI command in their terminal:
87
+ ```bash
88
+ jstar review
89
+ ```
90
+
91
+ #### Option B: Agent Runs It (Headless)
92
+ If the user asks YOU to do it, use the headless flag to avoid hanging:
93
+ // turbo
94
+ ```bash
95
+ jstar review --headless
96
+ ```
97
+ *(This outputs JSON-formatted results that you can parse)*
98
+
99
+ The dashboard will be saved to `.jstar/last-review.md`.
100
+
101
+ ## Done! 🎉
102
+
103
+ **CLI Commands:**
104
+ | Command | Description |
105
+ |---------|-------------|
106
+ | `jstar setup` | Create config files in current project |
107
+ | `jstar init` | Index codebase (after major changes) |
108
+ | `jstar review` | Review staged changes (Default) |
109
+ | `jstar review --last` | Review last commit (Retroactive) |
110
+ | `jstar review --pr` | Review branch against main (PR Mode) |
111
+
112
+ **Output:**
113
+ - Console: Quick summary with severity counts
114
+ - `.jstar/last-review.md`: Full dashboard with fix prompts
115
+
116
+ ## Alternative: Without Global Install
117
+
118
+ If you don't want to install globally:
119
+ ```bash
120
+ npx jstar-reviewer review
121
+ ```