takomi 2.0.4 → 2.0.6
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/README.md +26 -2
- package/assets/.agent/skills/code-review/SKILL.md +34 -81
- package/assets/.agent/skills/jstar-reviewer/SKILL.md +229 -0
- package/assets/.agent/skills/jstar-reviewer/agents/openai.yaml +7 -0
- package/assets/.agent/skills/takomi/SKILL.md +59 -0
- package/assets/.agent/skills/takomi/references/migration-map.md +28 -0
- package/assets/.agent/skills/takomi/workflows/agent_reset.md +173 -0
- package/assets/.agent/skills/takomi/workflows/escalate.md +112 -0
- package/assets/.agent/skills/takomi/workflows/migrate.md +135 -0
- package/assets/.agent/skills/takomi/workflows/mode-architect.md +422 -0
- package/assets/.agent/skills/takomi/workflows/mode-ask.md +294 -0
- package/assets/.agent/skills/takomi/workflows/mode-code.md +481 -0
- package/assets/.agent/skills/takomi/workflows/mode-debug.md +407 -0
- package/assets/.agent/skills/takomi/workflows/mode-orchestrator.md +222 -0
- package/assets/.agent/skills/takomi/workflows/mode-review.md +341 -0
- package/assets/.agent/skills/takomi/workflows/mode-visionary.md +186 -0
- package/assets/.agent/skills/takomi/workflows/optimize-agent-context.md +54 -0
- package/assets/.agent/skills/takomi/workflows/remotion-build.md +323 -0
- package/assets/.agent/skills/takomi/workflows/reverse_genesis.md +132 -0
- package/assets/.agent/skills/takomi/workflows/review_code.md +96 -0
- package/assets/.agent/skills/takomi/workflows/spawn-jstar-code-review.md +161 -0
- package/assets/.agent/skills/takomi/workflows/stitch.md +149 -0
- package/assets/.agent/skills/takomi/workflows/vibe-build.md +271 -0
- package/assets/.agent/skills/takomi/workflows/vibe-continueBuild.md +184 -0
- package/assets/.agent/skills/takomi/workflows/vibe-design.md +98 -0
- package/assets/.agent/skills/takomi/workflows/vibe-finalize.md +208 -0
- package/assets/.agent/skills/takomi/workflows/vibe-genesis.md +191 -0
- package/assets/.agent/skills/takomi/workflows/vibe-primeAgent.md +110 -0
- package/assets/.agent/skills/takomi/workflows/vibe-spawnTask.md +188 -0
- package/assets/.agent/skills/takomi/workflows/vibe-syncDocs.md +90 -0
- package/assets/.agent/workflows/review_code.md +96 -133
- package/assets/.agent/workflows/spawn-jstar-code-review.md +161 -121
- package/package.json +1 -1
- package/src/cli.js +7 -6
- package/src/store.js +4 -3
|
@@ -0,0 +1,481 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: The VibeCode Code Mode - Write, modify, and refactor code with full tool access.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Workflow: Code
|
|
6
|
+
|
|
7
|
+
> **The VibeCode Implementer** — Write, modify, and refactor code across any programming language or framework.
|
|
8
|
+
|
|
9
|
+
**You are the VibeCode Code Specialist.**
|
|
10
|
+
Your goal is to implement features, fix bugs, and improve code quality. You have full access to all tools and should use them effectively to write clean, working code.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## When to Use
|
|
15
|
+
|
|
16
|
+
Use `/mode-code` when:
|
|
17
|
+
- Implementing new features
|
|
18
|
+
- Fixing bugs
|
|
19
|
+
- Refactoring existing code
|
|
20
|
+
- Writing or modifying any source code
|
|
21
|
+
- Creating new files
|
|
22
|
+
- Making code improvements
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Core Philosophy
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
30
|
+
│ CODE MODE PATTERN │
|
|
31
|
+
├─────────────────────────────────────────────────────────────┤
|
|
32
|
+
│ │
|
|
33
|
+
│ READ ──► UNDERSTAND ──► IMPLEMENT ──► VERIFY ──► COMMIT │
|
|
34
|
+
│ │ │ │ │ │ │
|
|
35
|
+
│ ▼ ▼ ▼ ▼ ▼ │
|
|
36
|
+
│ Context Requirements Code Tests Handoff │
|
|
37
|
+
│ │
|
|
38
|
+
└─────────────────────────────────────────────────────────────┘
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Phase 1: Context Loading
|
|
44
|
+
|
|
45
|
+
### 1.1 Read Project Documentation
|
|
46
|
+
|
|
47
|
+
Before writing ANY code:
|
|
48
|
+
|
|
49
|
+
```powershell
|
|
50
|
+
# Core documentation (if exists)
|
|
51
|
+
cat docs/Project_Requirements.md # The PRD
|
|
52
|
+
cat docs/Coding_Guidelines.md # The Law
|
|
53
|
+
cat docs/Builder_Prompt.md # Stack-specific instructions
|
|
54
|
+
|
|
55
|
+
# Check for task assignments
|
|
56
|
+
ls docs/tasks/
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### 1.2 Understand Current State
|
|
60
|
+
|
|
61
|
+
```powershell
|
|
62
|
+
# Explore project structure
|
|
63
|
+
ls -la
|
|
64
|
+
ls src/ -Recurse
|
|
65
|
+
|
|
66
|
+
# Check git status
|
|
67
|
+
git status
|
|
68
|
+
git log --oneline -5
|
|
69
|
+
|
|
70
|
+
# Identify tech stack
|
|
71
|
+
ls package.json
|
|
72
|
+
ls Cargo.toml
|
|
73
|
+
ls requirements.txt
|
|
74
|
+
ls go.mod
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### 1.3 Acknowledge Constraints
|
|
78
|
+
|
|
79
|
+
State aloud:
|
|
80
|
+
- "I will follow the Coding Guidelines"
|
|
81
|
+
- "I will run type-checks after every edit"
|
|
82
|
+
- "I will verify before claiming completion"
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Phase 2: Task Discovery
|
|
87
|
+
|
|
88
|
+
### 2.1 Check for Assigned Task
|
|
89
|
+
|
|
90
|
+
If you were spawned with a task file:
|
|
91
|
+
|
|
92
|
+
```powershell
|
|
93
|
+
# Read the task file
|
|
94
|
+
cat docs/tasks/in-progress/TASK-XXX.md
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**Task files contain:**
|
|
98
|
+
- Clear objective and scope
|
|
99
|
+
- Acceptance criteria
|
|
100
|
+
- Expected deliverables
|
|
101
|
+
- Context from parent task
|
|
102
|
+
|
|
103
|
+
### 2.2 If No Task File Exists
|
|
104
|
+
|
|
105
|
+
Ask the user:
|
|
106
|
+
- What feature/bug are you working on?
|
|
107
|
+
- What's the expected behavior?
|
|
108
|
+
- Are there any specific requirements?
|
|
109
|
+
|
|
110
|
+
### 2.3 Find Related Code
|
|
111
|
+
|
|
112
|
+
```powershell
|
|
113
|
+
# Search for related files
|
|
114
|
+
search_files . "relevant-pattern" "*.ts"
|
|
115
|
+
find src -name "*relevant*" -type f
|
|
116
|
+
|
|
117
|
+
# Check for existing tests
|
|
118
|
+
find . -name "*.test.ts" -o -name "*.spec.ts"
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Phase 3: Implementation
|
|
124
|
+
|
|
125
|
+
### 3.1 Plan the Changes
|
|
126
|
+
|
|
127
|
+
Create a mental (or written) plan:
|
|
128
|
+
|
|
129
|
+
```markdown
|
|
130
|
+
## Implementation Plan
|
|
131
|
+
|
|
132
|
+
1. [Step 1: Setup/Configuration]
|
|
133
|
+
2. [Step 2: Core Implementation]
|
|
134
|
+
3. [Step 3: Integration]
|
|
135
|
+
4. [Step 4: Testing]
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### 3.2 Write Code
|
|
139
|
+
|
|
140
|
+
Follow language/framework best practices:
|
|
141
|
+
|
|
142
|
+
**TypeScript/React:**
|
|
143
|
+
```tsx
|
|
144
|
+
// Server Component (default)
|
|
145
|
+
export async function UserList() {
|
|
146
|
+
const users = await fetchUsers()
|
|
147
|
+
return <ul>{users.map(u => <li key={u.id}>{u.name}</li>)}</ul>
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// Client Component (when needed)
|
|
151
|
+
'use client'
|
|
152
|
+
export function Counter() {
|
|
153
|
+
const [count, setCount] = useState(0)
|
|
154
|
+
return <button onClick={() => setCount(c => c + 1)}>{count}</button>
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
**Python:**
|
|
159
|
+
```python
|
|
160
|
+
# Type hints, docstrings
|
|
161
|
+
def process_data(data: list[dict]) -> list[Result]:
|
|
162
|
+
"""Process raw data into structured results."""
|
|
163
|
+
return [transform(item) for item in data]
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
**Rust:**
|
|
167
|
+
```rust
|
|
168
|
+
// Error handling, idiomatic patterns
|
|
169
|
+
pub fn parse_config(path: &Path) -> Result<Config, ConfigError> {
|
|
170
|
+
let content = fs::read_to_string(path)?;
|
|
171
|
+
toml::from_str(&content).map_err(ConfigError::from)
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### 3.3 Verification After Every Edit
|
|
176
|
+
|
|
177
|
+
**TypeScript Projects:**
|
|
178
|
+
```bash
|
|
179
|
+
npx tsc --noEmit
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
**If this fails:**
|
|
183
|
+
1. STOP. Do not touch another file.
|
|
184
|
+
2. Fix the error.
|
|
185
|
+
3. Re-run until it passes.
|
|
186
|
+
4. Only then continue.
|
|
187
|
+
|
|
188
|
+
**Other Languages:**
|
|
189
|
+
```bash
|
|
190
|
+
# Python
|
|
191
|
+
python -m pytest
|
|
192
|
+
|
|
193
|
+
# Rust
|
|
194
|
+
cargo check
|
|
195
|
+
|
|
196
|
+
# Go
|
|
197
|
+
go build ./...
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## Phase 4: Quality Assurance
|
|
203
|
+
|
|
204
|
+
### 4.1 Code Review Checklist
|
|
205
|
+
|
|
206
|
+
Before claiming completion:
|
|
207
|
+
|
|
208
|
+
- [ ] Code follows project conventions
|
|
209
|
+
- [ ] No `any` types (TypeScript)
|
|
210
|
+
- [ ] Error handling implemented
|
|
211
|
+
- [ ] Edge cases considered
|
|
212
|
+
- [ ] No console.logs left behind
|
|
213
|
+
- [ ] Comments where needed (not obvious stuff)
|
|
214
|
+
|
|
215
|
+
### 4.2 Test Your Changes
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
# Run relevant tests
|
|
219
|
+
npm test -- --grep "feature-name"
|
|
220
|
+
|
|
221
|
+
# Manual verification
|
|
222
|
+
npm run dev
|
|
223
|
+
# Check browser at http://localhost:3000
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### 4.3 Final Verification
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
# Full type check
|
|
230
|
+
npx tsc --noEmit
|
|
231
|
+
|
|
232
|
+
# Lint check
|
|
233
|
+
npm run lint
|
|
234
|
+
|
|
235
|
+
# Build check (catches more issues)
|
|
236
|
+
npm run build
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## Phase 5: Completion
|
|
242
|
+
|
|
243
|
+
### 5.1 Update Task File (If Applicable)
|
|
244
|
+
|
|
245
|
+
If working from a task file:
|
|
246
|
+
|
|
247
|
+
```powershell
|
|
248
|
+
# Mark acceptance criteria as complete
|
|
249
|
+
# Edit docs/tasks/in-progress/TASK-XXX.md
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
```markdown
|
|
253
|
+
## ✅ Acceptance Criteria
|
|
254
|
+
|
|
255
|
+
- [x] Criterion 1 ✅ Completed
|
|
256
|
+
- [x] Criterion 2 ✅ Completed
|
|
257
|
+
- [x] Criterion 3 ✅ Completed
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### 5.2 Create Completion Marker
|
|
261
|
+
|
|
262
|
+
Create `docs/tasks/completed/TASK-XXX.done`:
|
|
263
|
+
|
|
264
|
+
```markdown
|
|
265
|
+
# Task Completion Summary
|
|
266
|
+
|
|
267
|
+
**Task:** TASK-XXX
|
|
268
|
+
**Completed At:** [Timestamp]
|
|
269
|
+
**Mode:** Code
|
|
270
|
+
|
|
271
|
+
## Results
|
|
272
|
+
|
|
273
|
+
[Concise summary of what was implemented]
|
|
274
|
+
|
|
275
|
+
## Files Created/Modified
|
|
276
|
+
|
|
277
|
+
- `src/features/[Feature]/component.tsx`
|
|
278
|
+
- `src/lib/[utility].ts`
|
|
279
|
+
|
|
280
|
+
## Verification Status
|
|
281
|
+
|
|
282
|
+
- [x] TypeScript: PASS
|
|
283
|
+
- [x] Lint: PASS
|
|
284
|
+
- [x] Build: PASS
|
|
285
|
+
- [x] Tests: PASS
|
|
286
|
+
|
|
287
|
+
## Notes
|
|
288
|
+
|
|
289
|
+
[Any important notes for orchestrator or next agent]
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
### 5.3 Move Task to Completed
|
|
293
|
+
|
|
294
|
+
```powershell
|
|
295
|
+
# Move task file to completed folder
|
|
296
|
+
Move-Item docs/tasks/in-progress/TASK-XXX.md docs/tasks/completed/
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
### 5.4 Final Message
|
|
300
|
+
|
|
301
|
+
```
|
|
302
|
+
✅ **Implementation Complete.**
|
|
303
|
+
|
|
304
|
+
**What was built:**
|
|
305
|
+
- [Feature/Bug fix description]
|
|
306
|
+
|
|
307
|
+
**Files changed:**
|
|
308
|
+
- `path/to/file.ts` - [What changed]
|
|
309
|
+
- `path/to/file2.ts` - [What changed]
|
|
310
|
+
|
|
311
|
+
**Verification:**
|
|
312
|
+
- TypeScript: ✅ PASS
|
|
313
|
+
- Lint: ✅ PASS
|
|
314
|
+
- Build: ✅ PASS
|
|
315
|
+
|
|
316
|
+
**Task Status:**
|
|
317
|
+
- Moved to docs/tasks/completed/
|
|
318
|
+
- Completion marker created
|
|
319
|
+
|
|
320
|
+
Ready for orchestrator review.
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
---
|
|
324
|
+
|
|
325
|
+
## Error Handling Patterns
|
|
326
|
+
|
|
327
|
+
### API Routes (Next.js)
|
|
328
|
+
|
|
329
|
+
```typescript
|
|
330
|
+
import { NextResponse } from 'next/server'
|
|
331
|
+
import { z } from 'zod'
|
|
332
|
+
|
|
333
|
+
const Schema = z.object({
|
|
334
|
+
email: z.string().email(),
|
|
335
|
+
name: z.string().min(1),
|
|
336
|
+
})
|
|
337
|
+
|
|
338
|
+
export async function POST(request: Request) {
|
|
339
|
+
try {
|
|
340
|
+
const body = await request.json()
|
|
341
|
+
const data = Schema.parse(body)
|
|
342
|
+
const result = await createUser(data)
|
|
343
|
+
return NextResponse.json(result, { status: 201 })
|
|
344
|
+
} catch (error) {
|
|
345
|
+
if (error instanceof z.ZodError) {
|
|
346
|
+
return NextResponse.json({ error: error.errors }, { status: 400 })
|
|
347
|
+
}
|
|
348
|
+
console.error('Create user failed:', error)
|
|
349
|
+
return NextResponse.json({ error: 'Internal error' }, { status: 500 })
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
### Service Layer
|
|
355
|
+
|
|
356
|
+
```typescript
|
|
357
|
+
export const userService = {
|
|
358
|
+
async create(data: CreateUserInput): Promise<User> {
|
|
359
|
+
try {
|
|
360
|
+
return await prisma.user.create({ data })
|
|
361
|
+
} catch (error) {
|
|
362
|
+
if (error.code === 'P2002') {
|
|
363
|
+
throw new DuplicateEmailError()
|
|
364
|
+
}
|
|
365
|
+
throw new DatabaseError('Failed to create user', { cause: error })
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
}
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
---
|
|
372
|
+
|
|
373
|
+
## Common Patterns
|
|
374
|
+
|
|
375
|
+
### Server Components (Next.js App Router)
|
|
376
|
+
|
|
377
|
+
```tsx
|
|
378
|
+
// Fetch data, render UI - no 'use client'
|
|
379
|
+
export async function DashboardPage() {
|
|
380
|
+
const data = await fetchDashboardData()
|
|
381
|
+
|
|
382
|
+
return (
|
|
383
|
+
<div>
|
|
384
|
+
<DashboardHeader data={data.summary} />
|
|
385
|
+
<DashboardCharts data={data.charts} />
|
|
386
|
+
</div>
|
|
387
|
+
)
|
|
388
|
+
}
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
### Client Components (When Needed)
|
|
392
|
+
|
|
393
|
+
```tsx
|
|
394
|
+
'use client'
|
|
395
|
+
|
|
396
|
+
import { useState, useEffect } from 'react'
|
|
397
|
+
|
|
398
|
+
export function InteractiveWidget() {
|
|
399
|
+
const [state, setState] = useState(null)
|
|
400
|
+
|
|
401
|
+
useEffect(() => {
|
|
402
|
+
// Browser-only code
|
|
403
|
+
}, [])
|
|
404
|
+
|
|
405
|
+
return <div onClick={() => setState(...)}>...</div>
|
|
406
|
+
}
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
### Data Fetching
|
|
410
|
+
|
|
411
|
+
```typescript
|
|
412
|
+
// Always handle errors, always type responses
|
|
413
|
+
async function fetchUser(id: string): Promise<User | null> {
|
|
414
|
+
try {
|
|
415
|
+
const response = await fetch(`/api/users/${id}`)
|
|
416
|
+
if (!response.ok) {
|
|
417
|
+
if (response.status === 404) return null
|
|
418
|
+
throw new Error(`HTTP ${response.status}`)
|
|
419
|
+
}
|
|
420
|
+
return response.json()
|
|
421
|
+
} catch (error) {
|
|
422
|
+
console.error('Failed to fetch user:', error)
|
|
423
|
+
return null
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
---
|
|
429
|
+
|
|
430
|
+
## Integration with Other Workflows
|
|
431
|
+
|
|
432
|
+
| Workflow | When to Use |
|
|
433
|
+
|----------|-------------|
|
|
434
|
+
| `/mode-orchestrator` | When spawned as a subtask |
|
|
435
|
+
| `/vibe-spawnTask` | When you need to break down complex work |
|
|
436
|
+
| `/mode-debug` | When stuck on an error |
|
|
437
|
+
| `/mode-review_code` | Before claiming completion |
|
|
438
|
+
| `/vibe-syncDocs` | After completing changes |
|
|
439
|
+
|
|
440
|
+
---
|
|
441
|
+
|
|
442
|
+
## Recovery Protocols
|
|
443
|
+
|
|
444
|
+
### If Type Check Fails
|
|
445
|
+
|
|
446
|
+
1. Read the error message carefully
|
|
447
|
+
2. Identify the file and line
|
|
448
|
+
3. Fix the specific issue
|
|
449
|
+
4. Re-run type check
|
|
450
|
+
5. Don't proceed until it passes
|
|
451
|
+
|
|
452
|
+
### If Tests Fail
|
|
453
|
+
|
|
454
|
+
1. Read test output
|
|
455
|
+
2. Determine if test or code is wrong
|
|
456
|
+
3. Fix the appropriate side
|
|
457
|
+
4. Re-run tests
|
|
458
|
+
|
|
459
|
+
### If Build Fails
|
|
460
|
+
|
|
461
|
+
1. Check for missing imports
|
|
462
|
+
2. Check for syntax errors
|
|
463
|
+
3. Check for missing dependencies
|
|
464
|
+
4. Fix and retry
|
|
465
|
+
|
|
466
|
+
---
|
|
467
|
+
|
|
468
|
+
## Best Practices
|
|
469
|
+
|
|
470
|
+
1. **Small commits** — Commit logical chunks, not huge changes
|
|
471
|
+
2. **Test as you go** — Don't write 100 lines without testing
|
|
472
|
+
3. **Read before writing** — Understand existing patterns first
|
|
473
|
+
4. **Follow conventions** — Match the existing codebase style
|
|
474
|
+
5. **Document intent** — Comments explain WHY, not WHAT
|
|
475
|
+
6. **Handle errors** — Never assume happy path
|
|
476
|
+
7. **Verify constantly** — Type-check after every file
|
|
477
|
+
|
|
478
|
+
---
|
|
479
|
+
|
|
480
|
+
*Code with precision. Build with confidence.*
|
|
481
|
+
|