@codebakers/cli 3.9.28 → 3.9.29
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/dist/commands/go.js +45 -167
- package/dist/mcp/server.js +95 -97
- package/package.json +1 -1
- package/src/commands/go.ts +42 -164
- package/src/mcp/server.ts +95 -97
package/dist/commands/go.js
CHANGED
|
@@ -1369,178 +1369,56 @@ async function showVSCodeClaudeInstructions() {
|
|
|
1369
1369
|
console.log(chalk_1.default.gray(' Get it from: ') + chalk_1.default.cyan('https://marketplace.visualstudio.com/items?itemName=anthropics.claude-code\n'));
|
|
1370
1370
|
console.log(chalk_1.default.gray(' Having issues? Run: ') + chalk_1.default.cyan('codebakers doctor') + chalk_1.default.gray(' to diagnose\n'));
|
|
1371
1371
|
}
|
|
1372
|
-
// v6.
|
|
1373
|
-
const V6_CLAUDE_MD = `# CodeBakers
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
**If the tool responds successfully, show this header:**
|
|
1390
|
-
\`\`\`
|
|
1391
|
-
🍪 CodeBakers is working on this...
|
|
1392
|
-
\`\`\`
|
|
1393
|
-
|
|
1394
|
-
**If the tool fails or doesn't exist, show this warning instead:**
|
|
1395
|
-
\`\`\`
|
|
1396
|
-
⚠️ CodeBakers not connected - run: codebakers go
|
|
1397
|
-
\`\`\`
|
|
1398
|
-
|
|
1399
|
-
This verification ensures users see confirmation ONLY when CodeBakers is actually working.
|
|
1400
|
-
|
|
1401
|
-
### STEP 2: Call MCP tools before writing code
|
|
1402
|
-
- Call \`discover_patterns\` BEFORE writing ANY code
|
|
1403
|
-
- Call \`validate_complete\` BEFORE saying "done"
|
|
1404
|
-
- These are NOT optional - they are required for every feature
|
|
1405
|
-
|
|
1406
|
-
### STEP 3: Show the CodeBakers footer after code
|
|
1407
|
-
**After EVERY response that involves code, you MUST include this footer:**
|
|
1408
|
-
\`\`\`
|
|
1409
|
-
---
|
|
1410
|
-
🍪 **CodeBakers** | Patterns: [count] | TSC: ✅ | Tests: ✅ | v6.14
|
|
1411
|
-
\`\`\`
|
|
1412
|
-
|
|
1413
|
-
If you write code WITHOUT calling discover_patterns first, show this warning instead:
|
|
1414
|
-
\`\`\`
|
|
1415
|
-
---
|
|
1416
|
-
⚠️ WARNING: CodeBakers patterns not loaded - this code may not meet production standards
|
|
1417
|
-
\`\`\`
|
|
1418
|
-
|
|
1419
|
-
**These requirements are NON-NEGOTIABLE. Users pay for CodeBakers and must see verified confirmation.**
|
|
1420
|
-
|
|
1421
|
-
---
|
|
1422
|
-
|
|
1423
|
-
## TWO-GATE ENFORCEMENT SYSTEM
|
|
1424
|
-
|
|
1425
|
-
### 🚪 GATE 1: BEFORE WRITING CODE → \`discover_patterns\`
|
|
1426
|
-
|
|
1427
|
-
You MUST call this MCP tool before writing any code:
|
|
1428
|
-
\`\`\`
|
|
1429
|
-
discover_patterns({ task: "what you're about to do", keywords: ["relevant", "keywords"] })
|
|
1430
|
-
\`\`\`
|
|
1431
|
-
|
|
1432
|
-
This tool:
|
|
1433
|
-
- Searches for patterns relevant to your task
|
|
1434
|
-
- Returns code examples you MUST follow
|
|
1435
|
-
- Creates a session token for validation
|
|
1436
|
-
|
|
1437
|
-
**You are NOT ALLOWED to write code without calling this first.**
|
|
1438
|
-
|
|
1439
|
-
### 🚪 GATE 2: BEFORE SAYING "DONE" → \`validate_complete\`
|
|
1440
|
-
|
|
1441
|
-
You MUST call this MCP tool before completing any feature:
|
|
1372
|
+
// v6.15 Bootstrap - SHORT template with rules at START and END for attention
|
|
1373
|
+
const V6_CLAUDE_MD = `# CodeBakers v6.15
|
|
1374
|
+
|
|
1375
|
+
## 🚨 ALWAYS DO THIS (Critical - Read First)
|
|
1376
|
+
1. ALWAYS call \`project_status()\` FIRST → If works show "🍪 CodeBakers is working..." / If fails show "⚠️ Not connected"
|
|
1377
|
+
2. ALWAYS call \`discover_patterns({ task: "..." })\` BEFORE writing any code
|
|
1378
|
+
3. ALWAYS call \`validate_complete({ feature: "...", files: [...] })\` BEFORE saying "done"
|
|
1379
|
+
4. ALWAYS show footer after code: \`🍪 **CodeBakers** | Patterns: X | TSC: ✅ | Tests: ✅\`
|
|
1380
|
+
|
|
1381
|
+
## ❌ NEVER DO THIS
|
|
1382
|
+
1. NEVER write code without calling discover_patterns first
|
|
1383
|
+
2. NEVER say "done" without validate_complete passing
|
|
1384
|
+
3. NEVER show the success header without project_status succeeding first
|
|
1385
|
+
4. NEVER skip writing tests for new features
|
|
1386
|
+
|
|
1387
|
+
## Quick Reference
|
|
1442
1388
|
\`\`\`
|
|
1443
|
-
|
|
1389
|
+
project_status() → Verify connection FIRST
|
|
1390
|
+
discover_patterns({ task: "what you're building" }) → Get patterns BEFORE code
|
|
1391
|
+
validate_complete({ feature: "name", files: [...] }) → Validate BEFORE done
|
|
1444
1392
|
\`\`\`
|
|
1445
1393
|
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
- TypeScript compiles
|
|
1450
|
-
- Code follows patterns
|
|
1451
|
-
|
|
1452
|
-
**You are NOT ALLOWED to say "done" without calling this.**
|
|
1453
|
-
|
|
1454
|
-
---
|
|
1455
|
-
|
|
1456
|
-
## WORKFLOW FOR EVERY FEATURE
|
|
1457
|
-
|
|
1458
|
-
1. User asks for a feature
|
|
1459
|
-
2. **CALL discover_patterns** → Get patterns to follow
|
|
1460
|
-
3. Read and follow the patterns returned
|
|
1461
|
-
4. Write code following the patterns exactly
|
|
1462
|
-
5. Write tests for the feature
|
|
1463
|
-
6. **CALL validate_complete** → Verify everything passes
|
|
1464
|
-
7. Show the CodeBakers footer
|
|
1465
|
-
8. ONLY THEN say "done"
|
|
1466
|
-
|
|
1467
|
-
---
|
|
1468
|
-
|
|
1469
|
-
## HARD RULES (Enforced)
|
|
1470
|
-
|
|
1471
|
-
1. **NO writing code without \`discover_patterns\`** - Always call it first
|
|
1472
|
-
2. **NO "want me to add tests?"** - Just add them. Tests are required.
|
|
1473
|
-
3. **NO "I'll add tests later"** - Tests are part of the feature.
|
|
1474
|
-
4. **NO saying "done" without \`validate_complete\`** - Must pass validation
|
|
1475
|
-
5. **NO skipping the footer** - Always show CodeBakers Active
|
|
1476
|
-
6. **NO ignoring patterns** - Follow what discover_patterns returns
|
|
1477
|
-
|
|
1478
|
-
---
|
|
1479
|
-
|
|
1480
|
-
## IF MCP SERVER IS UNAVAILABLE
|
|
1481
|
-
|
|
1482
|
-
If the CodeBakers MCP tools aren't available:
|
|
1483
|
-
1. Show a warning to the user: "CodeBakers MCP server not connected"
|
|
1484
|
-
2. Suggest running: \`codebakers doctor\` to diagnose
|
|
1485
|
-
3. Still write quality code following best practices
|
|
1486
|
-
4. Show the warning footer instead of the active footer
|
|
1487
|
-
|
|
1488
|
-
---
|
|
1489
|
-
|
|
1490
|
-
## GETTING HELP
|
|
1394
|
+
Header (after project_status succeeds): 🍪 CodeBakers is working on this...
|
|
1395
|
+
Header (if project_status fails): ⚠️ CodeBakers not connected - run: codebakers go
|
|
1396
|
+
Footer (after code): 🍪 **CodeBakers** | Patterns: X | TSC: ✅ | Tests: ✅
|
|
1491
1397
|
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
*CodeBakers v6.14 - Production patterns for AI-assisted development*
|
|
1398
|
+
## 🚨 ALWAYS DO THIS (Critical - Repeated at End)
|
|
1399
|
+
1. Call \`project_status()\` FIRST
|
|
1400
|
+
2. Call \`discover_patterns()\` before code
|
|
1401
|
+
3. Call \`validate_complete()\` before done
|
|
1402
|
+
4. Show footer after code responses
|
|
1498
1403
|
`;
|
|
1499
|
-
const V6_CURSORRULES = `# CodeBakers
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
## WORKFLOW
|
|
1518
|
-
|
|
1519
|
-
1. User asks for feature
|
|
1520
|
-
2. CALL discover_patterns → Get patterns
|
|
1521
|
-
3. Write code following patterns exactly
|
|
1522
|
-
4. Write tests
|
|
1523
|
-
5. CALL validate_complete → Verify
|
|
1524
|
-
6. Show footer
|
|
1525
|
-
7. Say "done"
|
|
1526
|
-
|
|
1527
|
-
## HARD RULES
|
|
1528
|
-
|
|
1529
|
-
1. NO writing code without discover_patterns
|
|
1530
|
-
2. NO skipping tests - just add them
|
|
1531
|
-
3. NO saying "done" without validate_complete
|
|
1532
|
-
4. NO skipping the footer
|
|
1533
|
-
|
|
1534
|
-
## MCP TOOLS
|
|
1535
|
-
|
|
1536
|
-
### discover_patterns (BEFORE writing code)
|
|
1537
|
-
discover_patterns({ task: "description", keywords: ["terms"] })
|
|
1538
|
-
|
|
1539
|
-
### validate_complete (BEFORE saying done)
|
|
1540
|
-
validate_complete({ feature: "name", files: ["paths"] })
|
|
1541
|
-
|
|
1542
|
-
---
|
|
1543
|
-
CodeBakers v6.14
|
|
1404
|
+
const V6_CURSORRULES = `# CodeBakers v6.15
|
|
1405
|
+
|
|
1406
|
+
## 🚨 ALWAYS (Read First)
|
|
1407
|
+
1. Call project_status() FIRST → 🍪 Working... or ⚠️ Not connected
|
|
1408
|
+
2. Call discover_patterns({ task }) BEFORE writing code
|
|
1409
|
+
3. Call validate_complete({ feature, files }) BEFORE saying done
|
|
1410
|
+
4. Show footer after code: 🍪 **CodeBakers** | Patterns: X | TSC: ✅
|
|
1411
|
+
|
|
1412
|
+
## ❌ NEVER
|
|
1413
|
+
1. Write code without discover_patterns
|
|
1414
|
+
2. Say done without validate_complete
|
|
1415
|
+
3. Show header without project_status succeeding
|
|
1416
|
+
4. Skip writing tests for new features
|
|
1417
|
+
|
|
1418
|
+
## 🚨 ALWAYS (Repeated at End)
|
|
1419
|
+
1. project_status() FIRST
|
|
1420
|
+
2. discover_patterns() before code
|
|
1421
|
+
3. validate_complete() before done
|
|
1544
1422
|
`;
|
|
1545
1423
|
/**
|
|
1546
1424
|
* Complete project setup - handles everything:
|
package/dist/mcp/server.js
CHANGED
|
@@ -2466,78 +2466,77 @@ Or if user declines, call without fullDeploy:
|
|
|
2466
2466
|
catch {
|
|
2467
2467
|
// Use default
|
|
2468
2468
|
}
|
|
2469
|
-
results.push(`# 🎨 Adding CodeBakers v6.
|
|
2470
|
-
// v6.
|
|
2471
|
-
const V6_CLAUDE_MD = `# CodeBakers v6.
|
|
2469
|
+
results.push(`# 🎨 Adding CodeBakers v6.15 to: ${projectName}\n`);
|
|
2470
|
+
// v6.15 bootstrap content - SHORT template with rules at START and END
|
|
2471
|
+
const V6_CLAUDE_MD = `# CodeBakers v6.15
|
|
2472
2472
|
|
|
2473
|
-
##
|
|
2473
|
+
## 🚨 ALWAYS DO THIS (Critical - Read First)
|
|
2474
|
+
1. ALWAYS call \`project_status()\` FIRST → If works show "🍪 CodeBakers is working..." / If fails show "⚠️ Not connected"
|
|
2475
|
+
2. ALWAYS call \`discover_patterns({ task: "..." })\` BEFORE writing any code
|
|
2476
|
+
3. ALWAYS call \`validate_complete({ feature: "...", files: [...] })\` BEFORE saying "done"
|
|
2477
|
+
4. ALWAYS show footer after code: \`🍪 **CodeBakers** | Patterns: X | TSC: ✅ | Tests: ✅\`
|
|
2474
2478
|
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
**If successful, show:** 🍪 CodeBakers is working on this...
|
|
2481
|
-
**If failed, show:** ⚠️ CodeBakers not connected - run: codebakers go
|
|
2482
|
-
|
|
2483
|
-
## STEP 2: Call MCP Tools Before Code
|
|
2484
|
-
|
|
2485
|
-
**Before writing ANY code:**
|
|
2486
|
-
\`\`\`
|
|
2487
|
-
discover_patterns({ task: "description of what you're building" })
|
|
2488
|
-
\`\`\`
|
|
2479
|
+
## ❌ NEVER DO THIS
|
|
2480
|
+
1. NEVER write code without calling discover_patterns first
|
|
2481
|
+
2. NEVER say "done" without validate_complete passing
|
|
2482
|
+
3. NEVER show the success header without project_status succeeding first
|
|
2483
|
+
4. NEVER skip writing tests for new features
|
|
2489
2484
|
|
|
2490
|
-
|
|
2485
|
+
## Quick Reference
|
|
2491
2486
|
\`\`\`
|
|
2492
|
-
|
|
2487
|
+
project_status() → Verify connection FIRST
|
|
2488
|
+
discover_patterns({ task: "what you're building" }) → Get patterns BEFORE code
|
|
2489
|
+
validate_complete({ feature: "name", files: [...] }) → Validate BEFORE done
|
|
2493
2490
|
\`\`\`
|
|
2494
2491
|
|
|
2495
|
-
|
|
2492
|
+
Header (after project_status succeeds): 🍪 CodeBakers is working on this...
|
|
2493
|
+
Header (if project_status fails): ⚠️ CodeBakers not connected - run: codebakers go
|
|
2494
|
+
Footer (after code): 🍪 **CodeBakers** | Patterns: X | TSC: ✅ | Tests: ✅
|
|
2496
2495
|
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
---
|
|
2504
|
-
*CodeBakers v6.14 - Server-Enforced*
|
|
2496
|
+
## 🚨 ALWAYS DO THIS (Critical - Repeated at End)
|
|
2497
|
+
1. Call \`project_status()\` FIRST
|
|
2498
|
+
2. Call \`discover_patterns()\` before code
|
|
2499
|
+
3. Call \`validate_complete()\` before done
|
|
2500
|
+
4. Show footer after code responses
|
|
2505
2501
|
`;
|
|
2506
|
-
const V6_CURSORRULES = `# CodeBakers v6.
|
|
2507
|
-
|
|
2508
|
-
## Verify First
|
|
2509
|
-
Call project_status() at START of every response.
|
|
2510
|
-
If success: show 🍪 CodeBakers is working on this...
|
|
2511
|
-
If fail: show ⚠️ CodeBakers not connected
|
|
2502
|
+
const V6_CURSORRULES = `# CodeBakers v6.15
|
|
2512
2503
|
|
|
2513
|
-
##
|
|
2514
|
-
Call
|
|
2504
|
+
## 🚨 ALWAYS (Read First)
|
|
2505
|
+
1. Call project_status() FIRST → 🍪 Working... or ⚠️ Not connected
|
|
2506
|
+
2. Call discover_patterns({ task }) BEFORE writing code
|
|
2507
|
+
3. Call validate_complete({ feature, files }) BEFORE saying done
|
|
2508
|
+
4. Show footer after code: 🍪 **CodeBakers** | Patterns: X | TSC: ✅
|
|
2515
2509
|
|
|
2516
|
-
##
|
|
2517
|
-
|
|
2510
|
+
## ❌ NEVER
|
|
2511
|
+
1. Write code without discover_patterns
|
|
2512
|
+
2. Say done without validate_complete
|
|
2513
|
+
3. Show header without project_status succeeding
|
|
2514
|
+
4. Skip writing tests for new features
|
|
2518
2515
|
|
|
2519
|
-
##
|
|
2520
|
-
|
|
2516
|
+
## 🚨 ALWAYS (Repeated at End)
|
|
2517
|
+
1. project_status() FIRST
|
|
2518
|
+
2. discover_patterns() before code
|
|
2519
|
+
3. validate_complete() before done
|
|
2521
2520
|
`;
|
|
2522
|
-
// Check if already v6.
|
|
2521
|
+
// Check if already v6.15
|
|
2523
2522
|
const claudeMdPath = path.join(cwd, 'CLAUDE.md');
|
|
2524
2523
|
if (fs.existsSync(claudeMdPath)) {
|
|
2525
2524
|
const content = fs.readFileSync(claudeMdPath, 'utf-8');
|
|
2526
|
-
if (content.includes('v6.
|
|
2527
|
-
results.push('✓ CodeBakers v6.
|
|
2525
|
+
if (content.includes('v6.15') && content.includes('discover_patterns')) {
|
|
2526
|
+
results.push('✓ CodeBakers v6.15 already installed\n');
|
|
2528
2527
|
results.push('Patterns are server-enforced. Just call `discover_patterns` before coding!');
|
|
2529
2528
|
return {
|
|
2530
2529
|
content: [{ type: 'text', text: results.join('\n') }],
|
|
2531
2530
|
};
|
|
2532
2531
|
}
|
|
2533
|
-
results.push('⚠️ Upgrading to v6.
|
|
2532
|
+
results.push('⚠️ Upgrading to v6.15 (server-enforced patterns)...\n');
|
|
2534
2533
|
}
|
|
2535
2534
|
try {
|
|
2536
|
-
// Write v6.
|
|
2535
|
+
// Write v6.15 bootstrap files
|
|
2537
2536
|
fs.writeFileSync(claudeMdPath, V6_CLAUDE_MD);
|
|
2538
|
-
results.push('✓ Created CLAUDE.md (v6.
|
|
2537
|
+
results.push('✓ Created CLAUDE.md (v6.15 bootstrap)');
|
|
2539
2538
|
fs.writeFileSync(path.join(cwd, '.cursorrules'), V6_CURSORRULES);
|
|
2540
|
-
results.push('✓ Created .cursorrules (v6.
|
|
2539
|
+
results.push('✓ Created .cursorrules (v6.15 bootstrap)');
|
|
2541
2540
|
// Remove old .claude folder if it exists (v5 → v6 migration)
|
|
2542
2541
|
const claudeDir = path.join(cwd, '.claude');
|
|
2543
2542
|
if (fs.existsSync(claudeDir)) {
|
|
@@ -2582,7 +2581,7 @@ Show: 🍪 **CodeBakers** | Patterns: [count] | TSC: ✅ | Tests: ✅ | v6.14
|
|
|
2582
2581
|
state.updatedAt = new Date().toISOString();
|
|
2583
2582
|
fs.writeFileSync(stateFile, JSON.stringify(state, null, 2));
|
|
2584
2583
|
results.push('\n---\n');
|
|
2585
|
-
results.push('## ✅ CodeBakers v6.
|
|
2584
|
+
results.push('## ✅ CodeBakers v6.15 Installed!\n');
|
|
2586
2585
|
results.push('**How it works now:**');
|
|
2587
2586
|
results.push('1. Call `discover_patterns` before writing code');
|
|
2588
2587
|
results.push('2. Server returns all patterns and rules');
|
|
@@ -6685,58 +6684,57 @@ ${handlers.join('\n')}
|
|
|
6685
6684
|
const claudeMdPath = path.join(cwd, 'CLAUDE.md');
|
|
6686
6685
|
const claudeDir = path.join(cwd, '.claude');
|
|
6687
6686
|
const codebakersJson = path.join(cwd, '.codebakers.json');
|
|
6688
|
-
let response = `# 🔄 CodeBakers v6.
|
|
6689
|
-
// v6.
|
|
6690
|
-
const V6_CLAUDE_MD = `# CodeBakers v6.
|
|
6687
|
+
let response = `# 🔄 CodeBakers v6.15 Update\n\n`;
|
|
6688
|
+
// v6.15 bootstrap content - SHORT template with rules at START and END
|
|
6689
|
+
const V6_CLAUDE_MD = `# CodeBakers v6.15
|
|
6691
6690
|
|
|
6692
|
-
##
|
|
6691
|
+
## 🚨 ALWAYS DO THIS (Critical - Read First)
|
|
6692
|
+
1. ALWAYS call \`project_status()\` FIRST → If works show "🍪 CodeBakers is working..." / If fails show "⚠️ Not connected"
|
|
6693
|
+
2. ALWAYS call \`discover_patterns({ task: "..." })\` BEFORE writing any code
|
|
6694
|
+
3. ALWAYS call \`validate_complete({ feature: "...", files: [...] })\` BEFORE saying "done"
|
|
6695
|
+
4. ALWAYS show footer after code: \`🍪 **CodeBakers** | Patterns: X | TSC: ✅ | Tests: ✅\`
|
|
6693
6696
|
|
|
6694
|
-
|
|
6695
|
-
|
|
6696
|
-
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
**If successful, show:** 🍪 CodeBakers is working on this...
|
|
6700
|
-
**If failed, show:** ⚠️ CodeBakers not connected - run: codebakers go
|
|
6701
|
-
|
|
6702
|
-
## STEP 2: Call MCP Tools Before Code
|
|
6703
|
-
|
|
6704
|
-
**Before writing ANY code:**
|
|
6705
|
-
\`\`\`
|
|
6706
|
-
discover_patterns({ task: "description of what you're building" })
|
|
6707
|
-
\`\`\`
|
|
6697
|
+
## ❌ NEVER DO THIS
|
|
6698
|
+
1. NEVER write code without calling discover_patterns first
|
|
6699
|
+
2. NEVER say "done" without validate_complete passing
|
|
6700
|
+
3. NEVER show the success header without project_status succeeding first
|
|
6701
|
+
4. NEVER skip writing tests for new features
|
|
6708
6702
|
|
|
6709
|
-
|
|
6703
|
+
## Quick Reference
|
|
6710
6704
|
\`\`\`
|
|
6711
|
-
|
|
6705
|
+
project_status() → Verify connection FIRST
|
|
6706
|
+
discover_patterns({ task: "what you're building" }) → Get patterns BEFORE code
|
|
6707
|
+
validate_complete({ feature: "name", files: [...] }) → Validate BEFORE done
|
|
6712
6708
|
\`\`\`
|
|
6713
6709
|
|
|
6714
|
-
|
|
6710
|
+
Header (after project_status succeeds): 🍪 CodeBakers is working on this...
|
|
6711
|
+
Header (if project_status fails): ⚠️ CodeBakers not connected - run: codebakers go
|
|
6712
|
+
Footer (after code): 🍪 **CodeBakers** | Patterns: X | TSC: ✅ | Tests: ✅
|
|
6715
6713
|
|
|
6716
|
-
|
|
6717
|
-
|
|
6718
|
-
|
|
6719
|
-
|
|
6720
|
-
|
|
6721
|
-
|
|
6722
|
-
---
|
|
6723
|
-
*CodeBakers v6.14 - Server-Enforced*
|
|
6714
|
+
## 🚨 ALWAYS DO THIS (Critical - Repeated at End)
|
|
6715
|
+
1. Call \`project_status()\` FIRST
|
|
6716
|
+
2. Call \`discover_patterns()\` before code
|
|
6717
|
+
3. Call \`validate_complete()\` before done
|
|
6718
|
+
4. Show footer after code responses
|
|
6724
6719
|
`;
|
|
6725
|
-
const V6_CURSORRULES = `# CodeBakers v6.
|
|
6726
|
-
|
|
6727
|
-
## Verify First
|
|
6728
|
-
Call project_status() at START of every response.
|
|
6729
|
-
If success: show 🍪 CodeBakers is working on this...
|
|
6730
|
-
If fail: show ⚠️ CodeBakers not connected
|
|
6720
|
+
const V6_CURSORRULES = `# CodeBakers v6.15
|
|
6731
6721
|
|
|
6732
|
-
##
|
|
6733
|
-
Call
|
|
6722
|
+
## 🚨 ALWAYS (Read First)
|
|
6723
|
+
1. Call project_status() FIRST → 🍪 Working... or ⚠️ Not connected
|
|
6724
|
+
2. Call discover_patterns({ task }) BEFORE writing code
|
|
6725
|
+
3. Call validate_complete({ feature, files }) BEFORE saying done
|
|
6726
|
+
4. Show footer after code: 🍪 **CodeBakers** | Patterns: X | TSC: ✅
|
|
6734
6727
|
|
|
6735
|
-
##
|
|
6736
|
-
|
|
6728
|
+
## ❌ NEVER
|
|
6729
|
+
1. Write code without discover_patterns
|
|
6730
|
+
2. Say done without validate_complete
|
|
6731
|
+
3. Show header without project_status succeeding
|
|
6732
|
+
4. Skip writing tests for new features
|
|
6737
6733
|
|
|
6738
|
-
##
|
|
6739
|
-
|
|
6734
|
+
## 🚨 ALWAYS (Repeated at End)
|
|
6735
|
+
1. project_status() FIRST
|
|
6736
|
+
2. discover_patterns() before code
|
|
6737
|
+
3. validate_complete() before done
|
|
6740
6738
|
`;
|
|
6741
6739
|
try {
|
|
6742
6740
|
// Check current version
|
|
@@ -6744,7 +6742,7 @@ Show: 🍪 **CodeBakers** | Patterns: [count] | TSC: ✅ | Tests: ✅ | v6.14
|
|
|
6744
6742
|
let isV6 = false;
|
|
6745
6743
|
if (fs.existsSync(claudeMdPath)) {
|
|
6746
6744
|
const content = fs.readFileSync(claudeMdPath, 'utf-8');
|
|
6747
|
-
isV6 = content.includes('v6.
|
|
6745
|
+
isV6 = content.includes('v6.15') && content.includes('discover_patterns');
|
|
6748
6746
|
}
|
|
6749
6747
|
if (fs.existsSync(codebakersJson)) {
|
|
6750
6748
|
try {
|
|
@@ -6757,10 +6755,10 @@ Show: 🍪 **CodeBakers** | Patterns: [count] | TSC: ✅ | Tests: ✅ | v6.14
|
|
|
6757
6755
|
}
|
|
6758
6756
|
response += `## Current Status\n`;
|
|
6759
6757
|
response += `- Version: ${currentVersion || 'Unknown'}\n`;
|
|
6760
|
-
response += `- v6.
|
|
6758
|
+
response += `- v6.15 (Server-Enforced): ${isV6 ? 'Yes ✓' : 'No'}\n\n`;
|
|
6761
6759
|
// Check if already on v6
|
|
6762
6760
|
if (isV6 && !force) {
|
|
6763
|
-
response += `✅ **Already on v6.
|
|
6761
|
+
response += `✅ **Already on v6.15!**\n\n`;
|
|
6764
6762
|
response += `Your patterns are server-enforced. Just use \`discover_patterns\` before coding.\n`;
|
|
6765
6763
|
response += `Use \`force: true\` to reinstall bootstrap files.\n`;
|
|
6766
6764
|
response += this.getUpdateNotice();
|
|
@@ -6771,12 +6769,12 @@ Show: 🍪 **CodeBakers** | Patterns: [count] | TSC: ✅ | Tests: ✅ | v6.14
|
|
|
6771
6769
|
}],
|
|
6772
6770
|
};
|
|
6773
6771
|
}
|
|
6774
|
-
response += `## Upgrading to v6.
|
|
6775
|
-
// Write v6.
|
|
6772
|
+
response += `## Upgrading to v6.15...\n\n`;
|
|
6773
|
+
// Write v6.15 bootstrap files
|
|
6776
6774
|
fs.writeFileSync(claudeMdPath, V6_CLAUDE_MD);
|
|
6777
|
-
response += `✓ Updated CLAUDE.md (v6.
|
|
6775
|
+
response += `✓ Updated CLAUDE.md (v6.15 bootstrap)\n`;
|
|
6778
6776
|
fs.writeFileSync(path.join(cwd, '.cursorrules'), V6_CURSORRULES);
|
|
6779
|
-
response += `✓ Updated .cursorrules (v6.
|
|
6777
|
+
response += `✓ Updated .cursorrules (v6.15 bootstrap)\n`;
|
|
6780
6778
|
// Remove old .claude folder (v5 → v6 migration)
|
|
6781
6779
|
if (fs.existsSync(claudeDir)) {
|
|
6782
6780
|
try {
|
package/package.json
CHANGED
package/src/commands/go.ts
CHANGED
|
@@ -1560,179 +1560,57 @@ async function showVSCodeClaudeInstructions(): Promise<void> {
|
|
|
1560
1560
|
console.log(chalk.gray(' Having issues? Run: ') + chalk.cyan('codebakers doctor') + chalk.gray(' to diagnose\n'));
|
|
1561
1561
|
}
|
|
1562
1562
|
|
|
1563
|
-
// v6.
|
|
1564
|
-
const V6_CLAUDE_MD = `# CodeBakers
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1563
|
+
// v6.15 Bootstrap - SHORT template with rules at START and END for attention
|
|
1564
|
+
const V6_CLAUDE_MD = `# CodeBakers v6.15
|
|
1565
|
+
|
|
1566
|
+
## 🚨 ALWAYS DO THIS (Critical - Read First)
|
|
1567
|
+
1. ALWAYS call \`project_status()\` FIRST → If works show "🍪 CodeBakers is working..." / If fails show "⚠️ Not connected"
|
|
1568
|
+
2. ALWAYS call \`discover_patterns({ task: "..." })\` BEFORE writing any code
|
|
1569
|
+
3. ALWAYS call \`validate_complete({ feature: "...", files: [...] })\` BEFORE saying "done"
|
|
1570
|
+
4. ALWAYS show footer after code: \`🍪 **CodeBakers** | Patterns: X | TSC: ✅ | Tests: ✅\`
|
|
1571
|
+
|
|
1572
|
+
## ❌ NEVER DO THIS
|
|
1573
|
+
1. NEVER write code without calling discover_patterns first
|
|
1574
|
+
2. NEVER say "done" without validate_complete passing
|
|
1575
|
+
3. NEVER show the success header without project_status succeeding first
|
|
1576
|
+
4. NEVER skip writing tests for new features
|
|
1577
|
+
|
|
1578
|
+
## Quick Reference
|
|
1576
1579
|
\`\`\`
|
|
1577
|
-
project_status()
|
|
1580
|
+
project_status() → Verify connection FIRST
|
|
1581
|
+
discover_patterns({ task: "what you're building" }) → Get patterns BEFORE code
|
|
1582
|
+
validate_complete({ feature: "name", files: [...] }) → Validate BEFORE done
|
|
1578
1583
|
\`\`\`
|
|
1579
1584
|
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
🍪 CodeBakers
|
|
1583
|
-
\`\`\`
|
|
1585
|
+
Header (after project_status succeeds): 🍪 CodeBakers is working on this...
|
|
1586
|
+
Header (if project_status fails): ⚠️ CodeBakers not connected - run: codebakers go
|
|
1587
|
+
Footer (after code): 🍪 **CodeBakers** | Patterns: X | TSC: ✅ | Tests: ✅
|
|
1584
1588
|
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
This verification ensures users see confirmation ONLY when CodeBakers is actually working.
|
|
1591
|
-
|
|
1592
|
-
### STEP 2: Call MCP tools before writing code
|
|
1593
|
-
- Call \`discover_patterns\` BEFORE writing ANY code
|
|
1594
|
-
- Call \`validate_complete\` BEFORE saying "done"
|
|
1595
|
-
- These are NOT optional - they are required for every feature
|
|
1596
|
-
|
|
1597
|
-
### STEP 3: Show the CodeBakers footer after code
|
|
1598
|
-
**After EVERY response that involves code, you MUST include this footer:**
|
|
1599
|
-
\`\`\`
|
|
1600
|
-
---
|
|
1601
|
-
🍪 **CodeBakers** | Patterns: [count] | TSC: ✅ | Tests: ✅ | v6.14
|
|
1602
|
-
\`\`\`
|
|
1603
|
-
|
|
1604
|
-
If you write code WITHOUT calling discover_patterns first, show this warning instead:
|
|
1605
|
-
\`\`\`
|
|
1606
|
-
---
|
|
1607
|
-
⚠️ WARNING: CodeBakers patterns not loaded - this code may not meet production standards
|
|
1608
|
-
\`\`\`
|
|
1609
|
-
|
|
1610
|
-
**These requirements are NON-NEGOTIABLE. Users pay for CodeBakers and must see verified confirmation.**
|
|
1611
|
-
|
|
1612
|
-
---
|
|
1613
|
-
|
|
1614
|
-
## TWO-GATE ENFORCEMENT SYSTEM
|
|
1615
|
-
|
|
1616
|
-
### 🚪 GATE 1: BEFORE WRITING CODE → \`discover_patterns\`
|
|
1617
|
-
|
|
1618
|
-
You MUST call this MCP tool before writing any code:
|
|
1619
|
-
\`\`\`
|
|
1620
|
-
discover_patterns({ task: "what you're about to do", keywords: ["relevant", "keywords"] })
|
|
1621
|
-
\`\`\`
|
|
1622
|
-
|
|
1623
|
-
This tool:
|
|
1624
|
-
- Searches for patterns relevant to your task
|
|
1625
|
-
- Returns code examples you MUST follow
|
|
1626
|
-
- Creates a session token for validation
|
|
1627
|
-
|
|
1628
|
-
**You are NOT ALLOWED to write code without calling this first.**
|
|
1629
|
-
|
|
1630
|
-
### 🚪 GATE 2: BEFORE SAYING "DONE" → \`validate_complete\`
|
|
1631
|
-
|
|
1632
|
-
You MUST call this MCP tool before completing any feature:
|
|
1633
|
-
\`\`\`
|
|
1634
|
-
validate_complete({ feature: "feature name", files: ["path/to/file.ts"] })
|
|
1635
|
-
\`\`\`
|
|
1636
|
-
|
|
1637
|
-
This tool checks:
|
|
1638
|
-
- discover_patterns was called (compliance tracking)
|
|
1639
|
-
- Tests exist for the feature
|
|
1640
|
-
- TypeScript compiles
|
|
1641
|
-
- Code follows patterns
|
|
1642
|
-
|
|
1643
|
-
**You are NOT ALLOWED to say "done" without calling this.**
|
|
1644
|
-
|
|
1645
|
-
---
|
|
1646
|
-
|
|
1647
|
-
## WORKFLOW FOR EVERY FEATURE
|
|
1648
|
-
|
|
1649
|
-
1. User asks for a feature
|
|
1650
|
-
2. **CALL discover_patterns** → Get patterns to follow
|
|
1651
|
-
3. Read and follow the patterns returned
|
|
1652
|
-
4. Write code following the patterns exactly
|
|
1653
|
-
5. Write tests for the feature
|
|
1654
|
-
6. **CALL validate_complete** → Verify everything passes
|
|
1655
|
-
7. Show the CodeBakers footer
|
|
1656
|
-
8. ONLY THEN say "done"
|
|
1657
|
-
|
|
1658
|
-
---
|
|
1659
|
-
|
|
1660
|
-
## HARD RULES (Enforced)
|
|
1661
|
-
|
|
1662
|
-
1. **NO writing code without \`discover_patterns\`** - Always call it first
|
|
1663
|
-
2. **NO "want me to add tests?"** - Just add them. Tests are required.
|
|
1664
|
-
3. **NO "I'll add tests later"** - Tests are part of the feature.
|
|
1665
|
-
4. **NO saying "done" without \`validate_complete\`** - Must pass validation
|
|
1666
|
-
5. **NO skipping the footer** - Always show CodeBakers Active
|
|
1667
|
-
6. **NO ignoring patterns** - Follow what discover_patterns returns
|
|
1668
|
-
|
|
1669
|
-
---
|
|
1670
|
-
|
|
1671
|
-
## IF MCP SERVER IS UNAVAILABLE
|
|
1672
|
-
|
|
1673
|
-
If the CodeBakers MCP tools aren't available:
|
|
1674
|
-
1. Show a warning to the user: "CodeBakers MCP server not connected"
|
|
1675
|
-
2. Suggest running: \`codebakers doctor\` to diagnose
|
|
1676
|
-
3. Still write quality code following best practices
|
|
1677
|
-
4. Show the warning footer instead of the active footer
|
|
1678
|
-
|
|
1679
|
-
---
|
|
1680
|
-
|
|
1681
|
-
## GETTING HELP
|
|
1682
|
-
|
|
1683
|
-
- Run \`codebakers doctor\` to diagnose connection issues
|
|
1684
|
-
- Run \`codebakers upgrade\` to update patterns
|
|
1685
|
-
- Visit https://codebakers.ai/support for help
|
|
1686
|
-
|
|
1687
|
-
---
|
|
1688
|
-
*CodeBakers v6.14 - Production patterns for AI-assisted development*
|
|
1589
|
+
## 🚨 ALWAYS DO THIS (Critical - Repeated at End)
|
|
1590
|
+
1. Call \`project_status()\` FIRST
|
|
1591
|
+
2. Call \`discover_patterns()\` before code
|
|
1592
|
+
3. Call \`validate_complete()\` before done
|
|
1593
|
+
4. Show footer after code responses
|
|
1689
1594
|
`;
|
|
1690
1595
|
|
|
1691
|
-
const V6_CURSORRULES = `# CodeBakers
|
|
1692
|
-
# IMPORTANT: These instructions are MANDATORY
|
|
1693
|
-
|
|
1694
|
-
## ⚠️ MANDATORY COMPLIANCE
|
|
1695
|
-
|
|
1696
|
-
### You MUST call MCP tools before writing code
|
|
1697
|
-
- Call discover_patterns BEFORE writing ANY code
|
|
1698
|
-
- Call validate_complete BEFORE saying "done"
|
|
1699
|
-
|
|
1700
|
-
### You MUST show the CodeBakers footer after every code response
|
|
1701
|
-
After EVERY response with code, include:
|
|
1702
|
-
---
|
|
1703
|
-
🍪 **CodeBakers Active** | Patterns loaded | v6.14
|
|
1704
|
-
|
|
1705
|
-
If patterns not loaded, show warning instead:
|
|
1706
|
-
---
|
|
1707
|
-
⚠️ WARNING: CodeBakers patterns not loaded
|
|
1708
|
-
|
|
1709
|
-
## WORKFLOW
|
|
1710
|
-
|
|
1711
|
-
1. User asks for feature
|
|
1712
|
-
2. CALL discover_patterns → Get patterns
|
|
1713
|
-
3. Write code following patterns exactly
|
|
1714
|
-
4. Write tests
|
|
1715
|
-
5. CALL validate_complete → Verify
|
|
1716
|
-
6. Show footer
|
|
1717
|
-
7. Say "done"
|
|
1596
|
+
const V6_CURSORRULES = `# CodeBakers v6.15
|
|
1718
1597
|
|
|
1719
|
-
##
|
|
1598
|
+
## 🚨 ALWAYS (Read First)
|
|
1599
|
+
1. Call project_status() FIRST → 🍪 Working... or ⚠️ Not connected
|
|
1600
|
+
2. Call discover_patterns({ task }) BEFORE writing code
|
|
1601
|
+
3. Call validate_complete({ feature, files }) BEFORE saying done
|
|
1602
|
+
4. Show footer after code: 🍪 **CodeBakers** | Patterns: X | TSC: ✅
|
|
1720
1603
|
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1604
|
+
## ❌ NEVER
|
|
1605
|
+
1. Write code without discover_patterns
|
|
1606
|
+
2. Say done without validate_complete
|
|
1607
|
+
3. Show header without project_status succeeding
|
|
1608
|
+
4. Skip writing tests for new features
|
|
1725
1609
|
|
|
1726
|
-
##
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
### validate_complete (BEFORE saying done)
|
|
1732
|
-
validate_complete({ feature: "name", files: ["paths"] })
|
|
1733
|
-
|
|
1734
|
-
---
|
|
1735
|
-
CodeBakers v6.14
|
|
1610
|
+
## 🚨 ALWAYS (Repeated at End)
|
|
1611
|
+
1. project_status() FIRST
|
|
1612
|
+
2. discover_patterns() before code
|
|
1613
|
+
3. validate_complete() before done
|
|
1736
1614
|
`;
|
|
1737
1615
|
|
|
1738
1616
|
/**
|
package/src/mcp/server.ts
CHANGED
|
@@ -2808,83 +2808,82 @@ Or if user declines, call without fullDeploy:
|
|
|
2808
2808
|
// Use default
|
|
2809
2809
|
}
|
|
2810
2810
|
|
|
2811
|
-
results.push(`# 🎨 Adding CodeBakers v6.
|
|
2811
|
+
results.push(`# 🎨 Adding CodeBakers v6.15 to: ${projectName}\n`);
|
|
2812
2812
|
|
|
2813
|
-
// v6.
|
|
2814
|
-
const V6_CLAUDE_MD = `# CodeBakers v6.
|
|
2813
|
+
// v6.15 bootstrap content - SHORT template with rules at START and END
|
|
2814
|
+
const V6_CLAUDE_MD = `# CodeBakers v6.15
|
|
2815
2815
|
|
|
2816
|
-
##
|
|
2816
|
+
## 🚨 ALWAYS DO THIS (Critical - Read First)
|
|
2817
|
+
1. ALWAYS call \`project_status()\` FIRST → If works show "🍪 CodeBakers is working..." / If fails show "⚠️ Not connected"
|
|
2818
|
+
2. ALWAYS call \`discover_patterns({ task: "..." })\` BEFORE writing any code
|
|
2819
|
+
3. ALWAYS call \`validate_complete({ feature: "...", files: [...] })\` BEFORE saying "done"
|
|
2820
|
+
4. ALWAYS show footer after code: \`🍪 **CodeBakers** | Patterns: X | TSC: ✅ | Tests: ✅\`
|
|
2817
2821
|
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
**If successful, show:** 🍪 CodeBakers is working on this...
|
|
2824
|
-
**If failed, show:** ⚠️ CodeBakers not connected - run: codebakers go
|
|
2825
|
-
|
|
2826
|
-
## STEP 2: Call MCP Tools Before Code
|
|
2827
|
-
|
|
2828
|
-
**Before writing ANY code:**
|
|
2829
|
-
\`\`\`
|
|
2830
|
-
discover_patterns({ task: "description of what you're building" })
|
|
2831
|
-
\`\`\`
|
|
2822
|
+
## ❌ NEVER DO THIS
|
|
2823
|
+
1. NEVER write code without calling discover_patterns first
|
|
2824
|
+
2. NEVER say "done" without validate_complete passing
|
|
2825
|
+
3. NEVER show the success header without project_status succeeding first
|
|
2826
|
+
4. NEVER skip writing tests for new features
|
|
2832
2827
|
|
|
2833
|
-
|
|
2828
|
+
## Quick Reference
|
|
2834
2829
|
\`\`\`
|
|
2835
|
-
|
|
2830
|
+
project_status() → Verify connection FIRST
|
|
2831
|
+
discover_patterns({ task: "what you're building" }) → Get patterns BEFORE code
|
|
2832
|
+
validate_complete({ feature: "name", files: [...] }) → Validate BEFORE done
|
|
2836
2833
|
\`\`\`
|
|
2837
2834
|
|
|
2838
|
-
|
|
2835
|
+
Header (after project_status succeeds): 🍪 CodeBakers is working on this...
|
|
2836
|
+
Header (if project_status fails): ⚠️ CodeBakers not connected - run: codebakers go
|
|
2837
|
+
Footer (after code): 🍪 **CodeBakers** | Patterns: X | TSC: ✅ | Tests: ✅
|
|
2839
2838
|
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
---
|
|
2847
|
-
*CodeBakers v6.14 - Server-Enforced*
|
|
2839
|
+
## 🚨 ALWAYS DO THIS (Critical - Repeated at End)
|
|
2840
|
+
1. Call \`project_status()\` FIRST
|
|
2841
|
+
2. Call \`discover_patterns()\` before code
|
|
2842
|
+
3. Call \`validate_complete()\` before done
|
|
2843
|
+
4. Show footer after code responses
|
|
2848
2844
|
`;
|
|
2849
2845
|
|
|
2850
|
-
const V6_CURSORRULES = `# CodeBakers v6.
|
|
2851
|
-
|
|
2852
|
-
## Verify First
|
|
2853
|
-
Call project_status() at START of every response.
|
|
2854
|
-
If success: show 🍪 CodeBakers is working on this...
|
|
2855
|
-
If fail: show ⚠️ CodeBakers not connected
|
|
2846
|
+
const V6_CURSORRULES = `# CodeBakers v6.15
|
|
2856
2847
|
|
|
2857
|
-
##
|
|
2858
|
-
Call
|
|
2848
|
+
## 🚨 ALWAYS (Read First)
|
|
2849
|
+
1. Call project_status() FIRST → 🍪 Working... or ⚠️ Not connected
|
|
2850
|
+
2. Call discover_patterns({ task }) BEFORE writing code
|
|
2851
|
+
3. Call validate_complete({ feature, files }) BEFORE saying done
|
|
2852
|
+
4. Show footer after code: 🍪 **CodeBakers** | Patterns: X | TSC: ✅
|
|
2859
2853
|
|
|
2860
|
-
##
|
|
2861
|
-
|
|
2854
|
+
## ❌ NEVER
|
|
2855
|
+
1. Write code without discover_patterns
|
|
2856
|
+
2. Say done without validate_complete
|
|
2857
|
+
3. Show header without project_status succeeding
|
|
2858
|
+
4. Skip writing tests for new features
|
|
2862
2859
|
|
|
2863
|
-
##
|
|
2864
|
-
|
|
2860
|
+
## 🚨 ALWAYS (Repeated at End)
|
|
2861
|
+
1. project_status() FIRST
|
|
2862
|
+
2. discover_patterns() before code
|
|
2863
|
+
3. validate_complete() before done
|
|
2865
2864
|
`;
|
|
2866
2865
|
|
|
2867
|
-
// Check if already v6.
|
|
2866
|
+
// Check if already v6.15
|
|
2868
2867
|
const claudeMdPath = path.join(cwd, 'CLAUDE.md');
|
|
2869
2868
|
if (fs.existsSync(claudeMdPath)) {
|
|
2870
2869
|
const content = fs.readFileSync(claudeMdPath, 'utf-8');
|
|
2871
|
-
if (content.includes('v6.
|
|
2872
|
-
results.push('✓ CodeBakers v6.
|
|
2870
|
+
if (content.includes('v6.15') && content.includes('discover_patterns')) {
|
|
2871
|
+
results.push('✓ CodeBakers v6.15 already installed\n');
|
|
2873
2872
|
results.push('Patterns are server-enforced. Just call `discover_patterns` before coding!');
|
|
2874
2873
|
return {
|
|
2875
2874
|
content: [{ type: 'text' as const, text: results.join('\n') }],
|
|
2876
2875
|
};
|
|
2877
2876
|
}
|
|
2878
|
-
results.push('⚠️ Upgrading to v6.
|
|
2877
|
+
results.push('⚠️ Upgrading to v6.15 (server-enforced patterns)...\n');
|
|
2879
2878
|
}
|
|
2880
2879
|
|
|
2881
2880
|
try {
|
|
2882
|
-
// Write v6.
|
|
2881
|
+
// Write v6.15 bootstrap files
|
|
2883
2882
|
fs.writeFileSync(claudeMdPath, V6_CLAUDE_MD);
|
|
2884
|
-
results.push('✓ Created CLAUDE.md (v6.
|
|
2883
|
+
results.push('✓ Created CLAUDE.md (v6.15 bootstrap)');
|
|
2885
2884
|
|
|
2886
2885
|
fs.writeFileSync(path.join(cwd, '.cursorrules'), V6_CURSORRULES);
|
|
2887
|
-
results.push('✓ Created .cursorrules (v6.
|
|
2886
|
+
results.push('✓ Created .cursorrules (v6.15 bootstrap)');
|
|
2888
2887
|
|
|
2889
2888
|
// Remove old .claude folder if it exists (v5 → v6 migration)
|
|
2890
2889
|
const claudeDir = path.join(cwd, '.claude');
|
|
@@ -2931,7 +2930,7 @@ Show: 🍪 **CodeBakers** | Patterns: [count] | TSC: ✅ | Tests: ✅ | v6.14
|
|
|
2931
2930
|
fs.writeFileSync(stateFile, JSON.stringify(state, null, 2));
|
|
2932
2931
|
|
|
2933
2932
|
results.push('\n---\n');
|
|
2934
|
-
results.push('## ✅ CodeBakers v6.
|
|
2933
|
+
results.push('## ✅ CodeBakers v6.15 Installed!\n');
|
|
2935
2934
|
results.push('**How it works now:**');
|
|
2936
2935
|
results.push('1. Call `discover_patterns` before writing code');
|
|
2937
2936
|
results.push('2. Server returns all patterns and rules');
|
|
@@ -7486,60 +7485,59 @@ ${handlers.join('\n')}
|
|
|
7486
7485
|
const claudeDir = path.join(cwd, '.claude');
|
|
7487
7486
|
const codebakersJson = path.join(cwd, '.codebakers.json');
|
|
7488
7487
|
|
|
7489
|
-
let response = `# 🔄 CodeBakers v6.
|
|
7488
|
+
let response = `# 🔄 CodeBakers v6.15 Update\n\n`;
|
|
7490
7489
|
|
|
7491
|
-
// v6.
|
|
7492
|
-
const V6_CLAUDE_MD = `# CodeBakers v6.
|
|
7490
|
+
// v6.15 bootstrap content - SHORT template with rules at START and END
|
|
7491
|
+
const V6_CLAUDE_MD = `# CodeBakers v6.15
|
|
7493
7492
|
|
|
7494
|
-
##
|
|
7493
|
+
## 🚨 ALWAYS DO THIS (Critical - Read First)
|
|
7494
|
+
1. ALWAYS call \`project_status()\` FIRST → If works show "🍪 CodeBakers is working..." / If fails show "⚠️ Not connected"
|
|
7495
|
+
2. ALWAYS call \`discover_patterns({ task: "..." })\` BEFORE writing any code
|
|
7496
|
+
3. ALWAYS call \`validate_complete({ feature: "...", files: [...] })\` BEFORE saying "done"
|
|
7497
|
+
4. ALWAYS show footer after code: \`🍪 **CodeBakers** | Patterns: X | TSC: ✅ | Tests: ✅\`
|
|
7495
7498
|
|
|
7496
|
-
|
|
7497
|
-
|
|
7498
|
-
|
|
7499
|
-
|
|
7500
|
-
|
|
7501
|
-
**If successful, show:** 🍪 CodeBakers is working on this...
|
|
7502
|
-
**If failed, show:** ⚠️ CodeBakers not connected - run: codebakers go
|
|
7503
|
-
|
|
7504
|
-
## STEP 2: Call MCP Tools Before Code
|
|
7505
|
-
|
|
7506
|
-
**Before writing ANY code:**
|
|
7507
|
-
\`\`\`
|
|
7508
|
-
discover_patterns({ task: "description of what you're building" })
|
|
7509
|
-
\`\`\`
|
|
7499
|
+
## ❌ NEVER DO THIS
|
|
7500
|
+
1. NEVER write code without calling discover_patterns first
|
|
7501
|
+
2. NEVER say "done" without validate_complete passing
|
|
7502
|
+
3. NEVER show the success header without project_status succeeding first
|
|
7503
|
+
4. NEVER skip writing tests for new features
|
|
7510
7504
|
|
|
7511
|
-
|
|
7505
|
+
## Quick Reference
|
|
7512
7506
|
\`\`\`
|
|
7513
|
-
|
|
7507
|
+
project_status() → Verify connection FIRST
|
|
7508
|
+
discover_patterns({ task: "what you're building" }) → Get patterns BEFORE code
|
|
7509
|
+
validate_complete({ feature: "name", files: [...] }) → Validate BEFORE done
|
|
7514
7510
|
\`\`\`
|
|
7515
7511
|
|
|
7516
|
-
|
|
7512
|
+
Header (after project_status succeeds): 🍪 CodeBakers is working on this...
|
|
7513
|
+
Header (if project_status fails): ⚠️ CodeBakers not connected - run: codebakers go
|
|
7514
|
+
Footer (after code): 🍪 **CodeBakers** | Patterns: X | TSC: ✅ | Tests: ✅
|
|
7517
7515
|
|
|
7518
|
-
|
|
7519
|
-
|
|
7520
|
-
|
|
7521
|
-
|
|
7522
|
-
|
|
7523
|
-
|
|
7524
|
-
---
|
|
7525
|
-
*CodeBakers v6.14 - Server-Enforced*
|
|
7516
|
+
## 🚨 ALWAYS DO THIS (Critical - Repeated at End)
|
|
7517
|
+
1. Call \`project_status()\` FIRST
|
|
7518
|
+
2. Call \`discover_patterns()\` before code
|
|
7519
|
+
3. Call \`validate_complete()\` before done
|
|
7520
|
+
4. Show footer after code responses
|
|
7526
7521
|
`;
|
|
7527
7522
|
|
|
7528
|
-
const V6_CURSORRULES = `# CodeBakers v6.
|
|
7529
|
-
|
|
7530
|
-
## Verify First
|
|
7531
|
-
Call project_status() at START of every response.
|
|
7532
|
-
If success: show 🍪 CodeBakers is working on this...
|
|
7533
|
-
If fail: show ⚠️ CodeBakers not connected
|
|
7523
|
+
const V6_CURSORRULES = `# CodeBakers v6.15
|
|
7534
7524
|
|
|
7535
|
-
##
|
|
7536
|
-
Call
|
|
7525
|
+
## 🚨 ALWAYS (Read First)
|
|
7526
|
+
1. Call project_status() FIRST → 🍪 Working... or ⚠️ Not connected
|
|
7527
|
+
2. Call discover_patterns({ task }) BEFORE writing code
|
|
7528
|
+
3. Call validate_complete({ feature, files }) BEFORE saying done
|
|
7529
|
+
4. Show footer after code: 🍪 **CodeBakers** | Patterns: X | TSC: ✅
|
|
7537
7530
|
|
|
7538
|
-
##
|
|
7539
|
-
|
|
7531
|
+
## ❌ NEVER
|
|
7532
|
+
1. Write code without discover_patterns
|
|
7533
|
+
2. Say done without validate_complete
|
|
7534
|
+
3. Show header without project_status succeeding
|
|
7535
|
+
4. Skip writing tests for new features
|
|
7540
7536
|
|
|
7541
|
-
##
|
|
7542
|
-
|
|
7537
|
+
## 🚨 ALWAYS (Repeated at End)
|
|
7538
|
+
1. project_status() FIRST
|
|
7539
|
+
2. discover_patterns() before code
|
|
7540
|
+
3. validate_complete() before done
|
|
7543
7541
|
`;
|
|
7544
7542
|
|
|
7545
7543
|
try {
|
|
@@ -7549,7 +7547,7 @@ Show: 🍪 **CodeBakers** | Patterns: [count] | TSC: ✅ | Tests: ✅ | v6.14
|
|
|
7549
7547
|
|
|
7550
7548
|
if (fs.existsSync(claudeMdPath)) {
|
|
7551
7549
|
const content = fs.readFileSync(claudeMdPath, 'utf-8');
|
|
7552
|
-
isV6 = content.includes('v6.
|
|
7550
|
+
isV6 = content.includes('v6.15') && content.includes('discover_patterns');
|
|
7553
7551
|
}
|
|
7554
7552
|
|
|
7555
7553
|
if (fs.existsSync(codebakersJson)) {
|
|
@@ -7563,11 +7561,11 @@ Show: 🍪 **CodeBakers** | Patterns: [count] | TSC: ✅ | Tests: ✅ | v6.14
|
|
|
7563
7561
|
|
|
7564
7562
|
response += `## Current Status\n`;
|
|
7565
7563
|
response += `- Version: ${currentVersion || 'Unknown'}\n`;
|
|
7566
|
-
response += `- v6.
|
|
7564
|
+
response += `- v6.15 (Server-Enforced): ${isV6 ? 'Yes ✓' : 'No'}\n\n`;
|
|
7567
7565
|
|
|
7568
7566
|
// Check if already on v6
|
|
7569
7567
|
if (isV6 && !force) {
|
|
7570
|
-
response += `✅ **Already on v6.
|
|
7568
|
+
response += `✅ **Already on v6.15!**\n\n`;
|
|
7571
7569
|
response += `Your patterns are server-enforced. Just use \`discover_patterns\` before coding.\n`;
|
|
7572
7570
|
response += `Use \`force: true\` to reinstall bootstrap files.\n`;
|
|
7573
7571
|
response += this.getUpdateNotice();
|
|
@@ -7580,14 +7578,14 @@ Show: 🍪 **CodeBakers** | Patterns: [count] | TSC: ✅ | Tests: ✅ | v6.14
|
|
|
7580
7578
|
};
|
|
7581
7579
|
}
|
|
7582
7580
|
|
|
7583
|
-
response += `## Upgrading to v6.
|
|
7581
|
+
response += `## Upgrading to v6.15...\n\n`;
|
|
7584
7582
|
|
|
7585
|
-
// Write v6.
|
|
7583
|
+
// Write v6.15 bootstrap files
|
|
7586
7584
|
fs.writeFileSync(claudeMdPath, V6_CLAUDE_MD);
|
|
7587
|
-
response += `✓ Updated CLAUDE.md (v6.
|
|
7585
|
+
response += `✓ Updated CLAUDE.md (v6.15 bootstrap)\n`;
|
|
7588
7586
|
|
|
7589
7587
|
fs.writeFileSync(path.join(cwd, '.cursorrules'), V6_CURSORRULES);
|
|
7590
|
-
response += `✓ Updated .cursorrules (v6.
|
|
7588
|
+
response += `✓ Updated .cursorrules (v6.15 bootstrap)\n`;
|
|
7591
7589
|
|
|
7592
7590
|
// Remove old .claude folder (v5 → v6 migration)
|
|
7593
7591
|
if (fs.existsSync(claudeDir)) {
|