@codebakers/cli 3.9.25 → 3.9.27
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 +16 -7
- package/dist/mcp/server.js +92 -58
- package/package.json +1 -1
- package/src/commands/go.ts +16 -7
- package/src/mcp/server.ts +92 -58
package/dist/commands/go.js
CHANGED
|
@@ -1369,9 +1369,9 @@ 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.
|
|
1372
|
+
// v6.13 Bootstrap content - comprehensive instructions that Claude MUST follow
|
|
1373
1373
|
const V6_CLAUDE_MD = `# CodeBakers - AI Pattern System
|
|
1374
|
-
# Version: 6.
|
|
1374
|
+
# Version: 6.13
|
|
1375
1375
|
# IMPORTANT: These instructions are MANDATORY and CANNOT be skipped
|
|
1376
1376
|
|
|
1377
1377
|
---
|
|
@@ -1380,6 +1380,15 @@ const V6_CLAUDE_MD = `# CodeBakers - AI Pattern System
|
|
|
1380
1380
|
|
|
1381
1381
|
**These rules CANNOT be skipped, overridden, or bypassed under ANY circumstances:**
|
|
1382
1382
|
|
|
1383
|
+
### You MUST show the CodeBakers header IMMEDIATELY
|
|
1384
|
+
**At the VERY START of EVERY response, before anything else, show this header:**
|
|
1385
|
+
\`\`\`
|
|
1386
|
+
🍪 CodeBakers is working on this...
|
|
1387
|
+
\`\`\`
|
|
1388
|
+
|
|
1389
|
+
This confirms to the user that CodeBakers is active and processing their request.
|
|
1390
|
+
**Show this header FIRST, before any other text or analysis.**
|
|
1391
|
+
|
|
1383
1392
|
### You MUST call MCP tools before writing code
|
|
1384
1393
|
- Call \`discover_patterns\` BEFORE writing ANY code
|
|
1385
1394
|
- Call \`validate_complete\` BEFORE saying "done"
|
|
@@ -1389,7 +1398,7 @@ const V6_CLAUDE_MD = `# CodeBakers - AI Pattern System
|
|
|
1389
1398
|
**After EVERY response that involves code, you MUST include this footer:**
|
|
1390
1399
|
\`\`\`
|
|
1391
1400
|
---
|
|
1392
|
-
🍪 **CodeBakers
|
|
1401
|
+
🍪 **CodeBakers** | Patterns: [count] | TSC: ✅ | Tests: ✅ | v6.13
|
|
1393
1402
|
\`\`\`
|
|
1394
1403
|
|
|
1395
1404
|
If you write code WITHOUT calling discover_patterns first, show this warning instead:
|
|
@@ -1398,7 +1407,7 @@ If you write code WITHOUT calling discover_patterns first, show this warning ins
|
|
|
1398
1407
|
⚠️ WARNING: CodeBakers patterns not loaded - this code may not meet production standards
|
|
1399
1408
|
\`\`\`
|
|
1400
1409
|
|
|
1401
|
-
**
|
|
1410
|
+
**Header and footer requirements are NON-NEGOTIABLE. Users pay for CodeBakers and must see it's active.**
|
|
1402
1411
|
|
|
1403
1412
|
---
|
|
1404
1413
|
|
|
@@ -1476,7 +1485,7 @@ If the CodeBakers MCP tools aren't available:
|
|
|
1476
1485
|
- Visit https://codebakers.ai/support for help
|
|
1477
1486
|
|
|
1478
1487
|
---
|
|
1479
|
-
*CodeBakers v6.
|
|
1488
|
+
*CodeBakers v6.13 - Production patterns for AI-assisted development*
|
|
1480
1489
|
`;
|
|
1481
1490
|
const V6_CURSORRULES = `# CodeBakers - AI Pattern System (Cursor Rules)
|
|
1482
1491
|
# IMPORTANT: These instructions are MANDATORY
|
|
@@ -1490,7 +1499,7 @@ const V6_CURSORRULES = `# CodeBakers - AI Pattern System (Cursor Rules)
|
|
|
1490
1499
|
### You MUST show the CodeBakers footer after every code response
|
|
1491
1500
|
After EVERY response with code, include:
|
|
1492
1501
|
---
|
|
1493
|
-
🍪 **CodeBakers Active** | Patterns loaded | v6.
|
|
1502
|
+
🍪 **CodeBakers Active** | Patterns loaded | v6.13
|
|
1494
1503
|
|
|
1495
1504
|
If patterns not loaded, show warning instead:
|
|
1496
1505
|
---
|
|
@@ -1522,7 +1531,7 @@ discover_patterns({ task: "description", keywords: ["terms"] })
|
|
|
1522
1531
|
validate_complete({ feature: "name", files: ["paths"] })
|
|
1523
1532
|
|
|
1524
1533
|
---
|
|
1525
|
-
CodeBakers v6.
|
|
1534
|
+
CodeBakers v6.13
|
|
1526
1535
|
`;
|
|
1527
1536
|
/**
|
|
1528
1537
|
* Complete project setup - handles everything:
|
package/dist/mcp/server.js
CHANGED
|
@@ -61,7 +61,7 @@ class CodeBakersServer {
|
|
|
61
61
|
pendingUpdate = null;
|
|
62
62
|
lastUpdateCheck = 0;
|
|
63
63
|
updateCheckInterval = 60 * 60 * 1000; // Check every hour
|
|
64
|
-
currentSessionToken = null; // v6.
|
|
64
|
+
currentSessionToken = null; // v6.13: Server-side enforcement session
|
|
65
65
|
constructor() {
|
|
66
66
|
this.apiKey = (0, config_js_1.getApiKey)();
|
|
67
67
|
this.apiUrl = (0, config_js_1.getApiUrl)();
|
|
@@ -1094,13 +1094,13 @@ class CodeBakersServer {
|
|
|
1094
1094
|
},
|
|
1095
1095
|
{
|
|
1096
1096
|
name: 'update_patterns',
|
|
1097
|
-
description: 'Update to CodeBakers v6.
|
|
1097
|
+
description: 'Update to CodeBakers v6.13 server-enforced patterns. Use when user says "upgrade codebakers", "update patterns", or "sync codebakers". In v6.13, patterns are server-side - this tool installs minimal bootstrap files (CLAUDE.md and .cursorrules) and removes old .claude/ folder if present.',
|
|
1098
1098
|
inputSchema: {
|
|
1099
1099
|
type: 'object',
|
|
1100
1100
|
properties: {
|
|
1101
1101
|
force: {
|
|
1102
1102
|
type: 'boolean',
|
|
1103
|
-
description: 'Force reinstall even if already on v6.
|
|
1103
|
+
description: 'Force reinstall even if already on v6.13 (default: false)',
|
|
1104
1104
|
},
|
|
1105
1105
|
},
|
|
1106
1106
|
},
|
|
@@ -2466,56 +2466,73 @@ 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.13 to: ${projectName}\n`);
|
|
2470
|
+
// v6.13 bootstrap content - minimal files, patterns from server
|
|
2471
|
+
const V6_CLAUDE_MD = `# CodeBakers v6.13
|
|
2472
2472
|
|
|
2473
|
-
|
|
2473
|
+
## MANDATORY: Show You're Working
|
|
2474
2474
|
|
|
2475
|
+
**At the START of EVERY response, show this header:**
|
|
2475
2476
|
\`\`\`
|
|
2476
|
-
|
|
2477
|
-
Args: { task: "description of what you're building" }
|
|
2477
|
+
🍪 CodeBakers is working on this...
|
|
2478
2478
|
\`\`\`
|
|
2479
2479
|
|
|
2480
|
-
|
|
2481
|
-
- All coding patterns and rules you must follow
|
|
2482
|
-
- Test requirements
|
|
2483
|
-
- Validation instructions
|
|
2480
|
+
## MANDATORY: Call MCP Tools
|
|
2484
2481
|
|
|
2485
|
-
**
|
|
2482
|
+
**Before writing ANY code, call the \`discover_patterns\` MCP tool:**
|
|
2483
|
+
\`\`\`
|
|
2484
|
+
discover_patterns({ task: "description of what you're building" })
|
|
2485
|
+
\`\`\`
|
|
2486
|
+
|
|
2487
|
+
**Before saying "done", call \`validate_complete\`:**
|
|
2488
|
+
\`\`\`
|
|
2489
|
+
validate_complete({ feature: "feature name", files: ["path/to/file.ts"] })
|
|
2490
|
+
\`\`\`
|
|
2491
|
+
|
|
2492
|
+
## MANDATORY: Show Footer After Code
|
|
2486
2493
|
|
|
2494
|
+
**After ANY response with code, show:**
|
|
2495
|
+
\`\`\`
|
|
2487
2496
|
---
|
|
2488
|
-
|
|
2497
|
+
🍪 **CodeBakers** | Patterns: [count] | TSC: ✅ | Tests: ✅ | v6.13
|
|
2498
|
+
\`\`\`
|
|
2499
|
+
|
|
2500
|
+
---
|
|
2501
|
+
*CodeBakers v6.13 - Server-Enforced*
|
|
2489
2502
|
`;
|
|
2490
|
-
const V6_CURSORRULES = `# CodeBakers v6.
|
|
2503
|
+
const V6_CURSORRULES = `# CodeBakers v6.13
|
|
2504
|
+
|
|
2505
|
+
## Show You're Working
|
|
2506
|
+
At the START of EVERY response, show: 🍪 CodeBakers is working on this...
|
|
2491
2507
|
|
|
2492
|
-
|
|
2508
|
+
## Before Writing Code
|
|
2509
|
+
Call: discover_patterns({ task: "description" })
|
|
2493
2510
|
|
|
2494
|
-
|
|
2495
|
-
|
|
2511
|
+
## Before Saying Done
|
|
2512
|
+
Call: validate_complete({ feature: "name", files: ["path.ts"] })
|
|
2496
2513
|
|
|
2497
|
-
|
|
2498
|
-
|
|
2514
|
+
## After Code Responses
|
|
2515
|
+
Show: 🍪 **CodeBakers** | Patterns: [count] | TSC: ✅ | Tests: ✅ | v6.13
|
|
2499
2516
|
`;
|
|
2500
|
-
// Check if already v6
|
|
2517
|
+
// Check if already v6.13
|
|
2501
2518
|
const claudeMdPath = path.join(cwd, 'CLAUDE.md');
|
|
2502
2519
|
if (fs.existsSync(claudeMdPath)) {
|
|
2503
2520
|
const content = fs.readFileSync(claudeMdPath, 'utf-8');
|
|
2504
|
-
if (content.includes('v6.
|
|
2505
|
-
results.push('✓ CodeBakers v6.
|
|
2521
|
+
if (content.includes('v6.13') && content.includes('discover_patterns')) {
|
|
2522
|
+
results.push('✓ CodeBakers v6.13 already installed\n');
|
|
2506
2523
|
results.push('Patterns are server-enforced. Just call `discover_patterns` before coding!');
|
|
2507
2524
|
return {
|
|
2508
2525
|
content: [{ type: 'text', text: results.join('\n') }],
|
|
2509
2526
|
};
|
|
2510
2527
|
}
|
|
2511
|
-
results.push('⚠️ Upgrading to v6.
|
|
2528
|
+
results.push('⚠️ Upgrading to v6.13 (server-enforced patterns)...\n');
|
|
2512
2529
|
}
|
|
2513
2530
|
try {
|
|
2514
|
-
// Write v6.
|
|
2531
|
+
// Write v6.13 bootstrap files
|
|
2515
2532
|
fs.writeFileSync(claudeMdPath, V6_CLAUDE_MD);
|
|
2516
|
-
results.push('✓ Created CLAUDE.md (v6.
|
|
2533
|
+
results.push('✓ Created CLAUDE.md (v6.13 bootstrap)');
|
|
2517
2534
|
fs.writeFileSync(path.join(cwd, '.cursorrules'), V6_CURSORRULES);
|
|
2518
|
-
results.push('✓ Created .cursorrules (v6.
|
|
2535
|
+
results.push('✓ Created .cursorrules (v6.13 bootstrap)');
|
|
2519
2536
|
// Remove old .claude folder if it exists (v5 → v6 migration)
|
|
2520
2537
|
const claudeDir = path.join(cwd, '.claude');
|
|
2521
2538
|
if (fs.existsSync(claudeDir)) {
|
|
@@ -2560,7 +2577,7 @@ You cannot write code without calling this tool first.
|
|
|
2560
2577
|
state.updatedAt = new Date().toISOString();
|
|
2561
2578
|
fs.writeFileSync(stateFile, JSON.stringify(state, null, 2));
|
|
2562
2579
|
results.push('\n---\n');
|
|
2563
|
-
results.push('## ✅ CodeBakers v6.
|
|
2580
|
+
results.push('## ✅ CodeBakers v6.13 Installed!\n');
|
|
2564
2581
|
results.push('**How it works now:**');
|
|
2565
2582
|
results.push('1. Call `discover_patterns` before writing code');
|
|
2566
2583
|
results.push('2. Server returns all patterns and rules');
|
|
@@ -4183,7 +4200,7 @@ If you want AI features and prefer Claude over GPT (or want both as fallback).`,
|
|
|
4183
4200
|
};
|
|
4184
4201
|
}
|
|
4185
4202
|
/**
|
|
4186
|
-
* MANDATORY: Validate that a feature is complete before AI can say "done" (v6.
|
|
4203
|
+
* MANDATORY: Validate that a feature is complete before AI can say "done" (v6.13 Server-Side)
|
|
4187
4204
|
* Runs local checks (tests, TypeScript), then validates with server
|
|
4188
4205
|
*/
|
|
4189
4206
|
async handleValidateComplete(args) {
|
|
@@ -4539,7 +4556,7 @@ If you want AI features and prefer Claude over GPT (or want both as fallback).`,
|
|
|
4539
4556
|
}
|
|
4540
4557
|
}
|
|
4541
4558
|
/**
|
|
4542
|
-
* discover_patterns - START gate for pattern compliance (v6.
|
|
4559
|
+
* discover_patterns - START gate for pattern compliance (v6.13 Server-Side)
|
|
4543
4560
|
* MUST be called before writing any code
|
|
4544
4561
|
* Calls server API to get patterns and creates enforcement session
|
|
4545
4562
|
*/
|
|
@@ -6654,7 +6671,7 @@ ${handlers.join('\n')}
|
|
|
6654
6671
|
`;
|
|
6655
6672
|
}
|
|
6656
6673
|
/**
|
|
6657
|
-
* Update to CodeBakers v6.
|
|
6674
|
+
* Update to CodeBakers v6.13 - server-enforced patterns
|
|
6658
6675
|
* This is the MCP equivalent of the `codebakers upgrade` CLI command
|
|
6659
6676
|
*/
|
|
6660
6677
|
async handleUpdatePatterns(args) {
|
|
@@ -6663,36 +6680,53 @@ ${handlers.join('\n')}
|
|
|
6663
6680
|
const claudeMdPath = path.join(cwd, 'CLAUDE.md');
|
|
6664
6681
|
const claudeDir = path.join(cwd, '.claude');
|
|
6665
6682
|
const codebakersJson = path.join(cwd, '.codebakers.json');
|
|
6666
|
-
let response = `# 🔄 CodeBakers v6.
|
|
6667
|
-
// v6.
|
|
6668
|
-
const V6_CLAUDE_MD = `# CodeBakers v6.
|
|
6683
|
+
let response = `# 🔄 CodeBakers v6.13 Update\n\n`;
|
|
6684
|
+
// v6.13 bootstrap content
|
|
6685
|
+
const V6_CLAUDE_MD = `# CodeBakers v6.13
|
|
6669
6686
|
|
|
6670
|
-
|
|
6687
|
+
## MANDATORY: Show You're Working
|
|
6671
6688
|
|
|
6689
|
+
**At the START of EVERY response, show this header:**
|
|
6672
6690
|
\`\`\`
|
|
6673
|
-
|
|
6674
|
-
Args: { task: "description of what you're building" }
|
|
6691
|
+
🍪 CodeBakers is working on this...
|
|
6675
6692
|
\`\`\`
|
|
6676
6693
|
|
|
6677
|
-
|
|
6678
|
-
- All coding patterns and rules you must follow
|
|
6679
|
-
- Test requirements
|
|
6680
|
-
- Validation instructions
|
|
6694
|
+
## MANDATORY: Call MCP Tools
|
|
6681
6695
|
|
|
6682
|
-
**
|
|
6696
|
+
**Before writing ANY code, call the \`discover_patterns\` MCP tool:**
|
|
6697
|
+
\`\`\`
|
|
6698
|
+
discover_patterns({ task: "description of what you're building" })
|
|
6699
|
+
\`\`\`
|
|
6700
|
+
|
|
6701
|
+
**Before saying "done", call \`validate_complete\`:**
|
|
6702
|
+
\`\`\`
|
|
6703
|
+
validate_complete({ feature: "feature name", files: ["path/to/file.ts"] })
|
|
6704
|
+
\`\`\`
|
|
6705
|
+
|
|
6706
|
+
## MANDATORY: Show Footer After Code
|
|
6683
6707
|
|
|
6708
|
+
**After ANY response with code, show:**
|
|
6709
|
+
\`\`\`
|
|
6684
6710
|
---
|
|
6685
|
-
|
|
6711
|
+
🍪 **CodeBakers** | Patterns: [count] | TSC: ✅ | Tests: ✅ | v6.13
|
|
6712
|
+
\`\`\`
|
|
6713
|
+
|
|
6714
|
+
---
|
|
6715
|
+
*CodeBakers v6.13 - Server-Enforced*
|
|
6686
6716
|
`;
|
|
6687
|
-
const V6_CURSORRULES = `# CodeBakers v6.
|
|
6717
|
+
const V6_CURSORRULES = `# CodeBakers v6.13
|
|
6718
|
+
|
|
6719
|
+
## Show You're Working
|
|
6720
|
+
At the START of EVERY response, show: 🍪 CodeBakers is working on this...
|
|
6688
6721
|
|
|
6689
|
-
|
|
6722
|
+
## Before Writing Code
|
|
6723
|
+
Call: discover_patterns({ task: "description" })
|
|
6690
6724
|
|
|
6691
|
-
|
|
6692
|
-
|
|
6725
|
+
## Before Saying Done
|
|
6726
|
+
Call: validate_complete({ feature: "name", files: ["path.ts"] })
|
|
6693
6727
|
|
|
6694
|
-
|
|
6695
|
-
|
|
6728
|
+
## After Code Responses
|
|
6729
|
+
Show: 🍪 **CodeBakers** | Patterns: [count] | TSC: ✅ | Tests: ✅ | v6.13
|
|
6696
6730
|
`;
|
|
6697
6731
|
try {
|
|
6698
6732
|
// Check current version
|
|
@@ -6700,7 +6734,7 @@ You cannot write code without calling this tool first.
|
|
|
6700
6734
|
let isV6 = false;
|
|
6701
6735
|
if (fs.existsSync(claudeMdPath)) {
|
|
6702
6736
|
const content = fs.readFileSync(claudeMdPath, 'utf-8');
|
|
6703
|
-
isV6 = content.includes('v6.
|
|
6737
|
+
isV6 = content.includes('v6.13') && content.includes('discover_patterns');
|
|
6704
6738
|
}
|
|
6705
6739
|
if (fs.existsSync(codebakersJson)) {
|
|
6706
6740
|
try {
|
|
@@ -6713,10 +6747,10 @@ You cannot write code without calling this tool first.
|
|
|
6713
6747
|
}
|
|
6714
6748
|
response += `## Current Status\n`;
|
|
6715
6749
|
response += `- Version: ${currentVersion || 'Unknown'}\n`;
|
|
6716
|
-
response += `- v6.
|
|
6750
|
+
response += `- v6.13 (Server-Enforced): ${isV6 ? 'Yes ✓' : 'No'}\n\n`;
|
|
6717
6751
|
// Check if already on v6
|
|
6718
6752
|
if (isV6 && !force) {
|
|
6719
|
-
response += `✅ **Already on v6.
|
|
6753
|
+
response += `✅ **Already on v6.13!**\n\n`;
|
|
6720
6754
|
response += `Your patterns are server-enforced. Just use \`discover_patterns\` before coding.\n`;
|
|
6721
6755
|
response += `Use \`force: true\` to reinstall bootstrap files.\n`;
|
|
6722
6756
|
response += this.getUpdateNotice();
|
|
@@ -6727,12 +6761,12 @@ You cannot write code without calling this tool first.
|
|
|
6727
6761
|
}],
|
|
6728
6762
|
};
|
|
6729
6763
|
}
|
|
6730
|
-
response += `## Upgrading to v6.
|
|
6731
|
-
// Write v6.
|
|
6764
|
+
response += `## Upgrading to v6.13...\n\n`;
|
|
6765
|
+
// Write v6.13 bootstrap files
|
|
6732
6766
|
fs.writeFileSync(claudeMdPath, V6_CLAUDE_MD);
|
|
6733
|
-
response += `✓ Updated CLAUDE.md (v6.
|
|
6767
|
+
response += `✓ Updated CLAUDE.md (v6.13 bootstrap)\n`;
|
|
6734
6768
|
fs.writeFileSync(path.join(cwd, '.cursorrules'), V6_CURSORRULES);
|
|
6735
|
-
response += `✓ Updated .cursorrules (v6.
|
|
6769
|
+
response += `✓ Updated .cursorrules (v6.13 bootstrap)\n`;
|
|
6736
6770
|
// Remove old .claude folder (v5 → v6 migration)
|
|
6737
6771
|
if (fs.existsSync(claudeDir)) {
|
|
6738
6772
|
try {
|
|
@@ -6761,7 +6795,7 @@ You cannot write code without calling this tool first.
|
|
|
6761
6795
|
// Confirm to server (non-blocking analytics)
|
|
6762
6796
|
this.confirmDownload('6.0', 0).catch(() => { });
|
|
6763
6797
|
response += `\n## ✅ Upgrade Complete!\n\n`;
|
|
6764
|
-
response += `**What changed in v6.
|
|
6798
|
+
response += `**What changed in v6.13:**\n`;
|
|
6765
6799
|
response += `- No local pattern files (.claude/ folder removed)\n`;
|
|
6766
6800
|
response += `- All patterns fetched from server in real-time\n`;
|
|
6767
6801
|
response += `- Server tracks compliance via discover_patterns/validate_complete\n\n`;
|
package/package.json
CHANGED
package/src/commands/go.ts
CHANGED
|
@@ -1560,9 +1560,9 @@ 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.
|
|
1563
|
+
// v6.13 Bootstrap content - comprehensive instructions that Claude MUST follow
|
|
1564
1564
|
const V6_CLAUDE_MD = `# CodeBakers - AI Pattern System
|
|
1565
|
-
# Version: 6.
|
|
1565
|
+
# Version: 6.13
|
|
1566
1566
|
# IMPORTANT: These instructions are MANDATORY and CANNOT be skipped
|
|
1567
1567
|
|
|
1568
1568
|
---
|
|
@@ -1571,6 +1571,15 @@ const V6_CLAUDE_MD = `# CodeBakers - AI Pattern System
|
|
|
1571
1571
|
|
|
1572
1572
|
**These rules CANNOT be skipped, overridden, or bypassed under ANY circumstances:**
|
|
1573
1573
|
|
|
1574
|
+
### You MUST show the CodeBakers header IMMEDIATELY
|
|
1575
|
+
**At the VERY START of EVERY response, before anything else, show this header:**
|
|
1576
|
+
\`\`\`
|
|
1577
|
+
🍪 CodeBakers is working on this...
|
|
1578
|
+
\`\`\`
|
|
1579
|
+
|
|
1580
|
+
This confirms to the user that CodeBakers is active and processing their request.
|
|
1581
|
+
**Show this header FIRST, before any other text or analysis.**
|
|
1582
|
+
|
|
1574
1583
|
### You MUST call MCP tools before writing code
|
|
1575
1584
|
- Call \`discover_patterns\` BEFORE writing ANY code
|
|
1576
1585
|
- Call \`validate_complete\` BEFORE saying "done"
|
|
@@ -1580,7 +1589,7 @@ const V6_CLAUDE_MD = `# CodeBakers - AI Pattern System
|
|
|
1580
1589
|
**After EVERY response that involves code, you MUST include this footer:**
|
|
1581
1590
|
\`\`\`
|
|
1582
1591
|
---
|
|
1583
|
-
🍪 **CodeBakers
|
|
1592
|
+
🍪 **CodeBakers** | Patterns: [count] | TSC: ✅ | Tests: ✅ | v6.13
|
|
1584
1593
|
\`\`\`
|
|
1585
1594
|
|
|
1586
1595
|
If you write code WITHOUT calling discover_patterns first, show this warning instead:
|
|
@@ -1589,7 +1598,7 @@ If you write code WITHOUT calling discover_patterns first, show this warning ins
|
|
|
1589
1598
|
⚠️ WARNING: CodeBakers patterns not loaded - this code may not meet production standards
|
|
1590
1599
|
\`\`\`
|
|
1591
1600
|
|
|
1592
|
-
**
|
|
1601
|
+
**Header and footer requirements are NON-NEGOTIABLE. Users pay for CodeBakers and must see it's active.**
|
|
1593
1602
|
|
|
1594
1603
|
---
|
|
1595
1604
|
|
|
@@ -1667,7 +1676,7 @@ If the CodeBakers MCP tools aren't available:
|
|
|
1667
1676
|
- Visit https://codebakers.ai/support for help
|
|
1668
1677
|
|
|
1669
1678
|
---
|
|
1670
|
-
*CodeBakers v6.
|
|
1679
|
+
*CodeBakers v6.13 - Production patterns for AI-assisted development*
|
|
1671
1680
|
`;
|
|
1672
1681
|
|
|
1673
1682
|
const V6_CURSORRULES = `# CodeBakers - AI Pattern System (Cursor Rules)
|
|
@@ -1682,7 +1691,7 @@ const V6_CURSORRULES = `# CodeBakers - AI Pattern System (Cursor Rules)
|
|
|
1682
1691
|
### You MUST show the CodeBakers footer after every code response
|
|
1683
1692
|
After EVERY response with code, include:
|
|
1684
1693
|
---
|
|
1685
|
-
🍪 **CodeBakers Active** | Patterns loaded | v6.
|
|
1694
|
+
🍪 **CodeBakers Active** | Patterns loaded | v6.13
|
|
1686
1695
|
|
|
1687
1696
|
If patterns not loaded, show warning instead:
|
|
1688
1697
|
---
|
|
@@ -1714,7 +1723,7 @@ discover_patterns({ task: "description", keywords: ["terms"] })
|
|
|
1714
1723
|
validate_complete({ feature: "name", files: ["paths"] })
|
|
1715
1724
|
|
|
1716
1725
|
---
|
|
1717
|
-
CodeBakers v6.
|
|
1726
|
+
CodeBakers v6.13
|
|
1718
1727
|
`;
|
|
1719
1728
|
|
|
1720
1729
|
/**
|
package/src/mcp/server.ts
CHANGED
|
@@ -69,7 +69,7 @@ class CodeBakersServer {
|
|
|
69
69
|
private pendingUpdate: { current: string; latest: string } | null = null;
|
|
70
70
|
private lastUpdateCheck = 0;
|
|
71
71
|
private updateCheckInterval = 60 * 60 * 1000; // Check every hour
|
|
72
|
-
private currentSessionToken: string | null = null; // v6.
|
|
72
|
+
private currentSessionToken: string | null = null; // v6.13: Server-side enforcement session
|
|
73
73
|
|
|
74
74
|
constructor() {
|
|
75
75
|
this.apiKey = getApiKey();
|
|
@@ -1191,13 +1191,13 @@ class CodeBakersServer {
|
|
|
1191
1191
|
{
|
|
1192
1192
|
name: 'update_patterns',
|
|
1193
1193
|
description:
|
|
1194
|
-
'Update to CodeBakers v6.
|
|
1194
|
+
'Update to CodeBakers v6.13 server-enforced patterns. Use when user says "upgrade codebakers", "update patterns", or "sync codebakers". In v6.13, patterns are server-side - this tool installs minimal bootstrap files (CLAUDE.md and .cursorrules) and removes old .claude/ folder if present.',
|
|
1195
1195
|
inputSchema: {
|
|
1196
1196
|
type: 'object' as const,
|
|
1197
1197
|
properties: {
|
|
1198
1198
|
force: {
|
|
1199
1199
|
type: 'boolean',
|
|
1200
|
-
description: 'Force reinstall even if already on v6.
|
|
1200
|
+
description: 'Force reinstall even if already on v6.13 (default: false)',
|
|
1201
1201
|
},
|
|
1202
1202
|
},
|
|
1203
1203
|
},
|
|
@@ -2808,61 +2808,78 @@ 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.13 to: ${projectName}\n`);
|
|
2812
2812
|
|
|
2813
|
-
// v6.
|
|
2814
|
-
const V6_CLAUDE_MD = `# CodeBakers v6.
|
|
2813
|
+
// v6.13 bootstrap content - minimal files, patterns from server
|
|
2814
|
+
const V6_CLAUDE_MD = `# CodeBakers v6.13
|
|
2815
2815
|
|
|
2816
|
-
|
|
2816
|
+
## MANDATORY: Show You're Working
|
|
2817
2817
|
|
|
2818
|
+
**At the START of EVERY response, show this header:**
|
|
2818
2819
|
\`\`\`
|
|
2819
|
-
|
|
2820
|
-
Args: { task: "description of what you're building" }
|
|
2820
|
+
🍪 CodeBakers is working on this...
|
|
2821
2821
|
\`\`\`
|
|
2822
2822
|
|
|
2823
|
-
|
|
2824
|
-
- All coding patterns and rules you must follow
|
|
2825
|
-
- Test requirements
|
|
2826
|
-
- Validation instructions
|
|
2823
|
+
## MANDATORY: Call MCP Tools
|
|
2827
2824
|
|
|
2828
|
-
**
|
|
2825
|
+
**Before writing ANY code, call the \`discover_patterns\` MCP tool:**
|
|
2826
|
+
\`\`\`
|
|
2827
|
+
discover_patterns({ task: "description of what you're building" })
|
|
2828
|
+
\`\`\`
|
|
2829
|
+
|
|
2830
|
+
**Before saying "done", call \`validate_complete\`:**
|
|
2831
|
+
\`\`\`
|
|
2832
|
+
validate_complete({ feature: "feature name", files: ["path/to/file.ts"] })
|
|
2833
|
+
\`\`\`
|
|
2834
|
+
|
|
2835
|
+
## MANDATORY: Show Footer After Code
|
|
2829
2836
|
|
|
2837
|
+
**After ANY response with code, show:**
|
|
2838
|
+
\`\`\`
|
|
2830
2839
|
---
|
|
2831
|
-
|
|
2840
|
+
🍪 **CodeBakers** | Patterns: [count] | TSC: ✅ | Tests: ✅ | v6.13
|
|
2841
|
+
\`\`\`
|
|
2842
|
+
|
|
2843
|
+
---
|
|
2844
|
+
*CodeBakers v6.13 - Server-Enforced*
|
|
2832
2845
|
`;
|
|
2833
2846
|
|
|
2834
|
-
const V6_CURSORRULES = `# CodeBakers v6.
|
|
2847
|
+
const V6_CURSORRULES = `# CodeBakers v6.13
|
|
2848
|
+
|
|
2849
|
+
## Show You're Working
|
|
2850
|
+
At the START of EVERY response, show: 🍪 CodeBakers is working on this...
|
|
2835
2851
|
|
|
2836
|
-
|
|
2852
|
+
## Before Writing Code
|
|
2853
|
+
Call: discover_patterns({ task: "description" })
|
|
2837
2854
|
|
|
2838
|
-
|
|
2839
|
-
|
|
2855
|
+
## Before Saying Done
|
|
2856
|
+
Call: validate_complete({ feature: "name", files: ["path.ts"] })
|
|
2840
2857
|
|
|
2841
|
-
|
|
2842
|
-
|
|
2858
|
+
## After Code Responses
|
|
2859
|
+
Show: 🍪 **CodeBakers** | Patterns: [count] | TSC: ✅ | Tests: ✅ | v6.13
|
|
2843
2860
|
`;
|
|
2844
2861
|
|
|
2845
|
-
// Check if already v6
|
|
2862
|
+
// Check if already v6.13
|
|
2846
2863
|
const claudeMdPath = path.join(cwd, 'CLAUDE.md');
|
|
2847
2864
|
if (fs.existsSync(claudeMdPath)) {
|
|
2848
2865
|
const content = fs.readFileSync(claudeMdPath, 'utf-8');
|
|
2849
|
-
if (content.includes('v6.
|
|
2850
|
-
results.push('✓ CodeBakers v6.
|
|
2866
|
+
if (content.includes('v6.13') && content.includes('discover_patterns')) {
|
|
2867
|
+
results.push('✓ CodeBakers v6.13 already installed\n');
|
|
2851
2868
|
results.push('Patterns are server-enforced. Just call `discover_patterns` before coding!');
|
|
2852
2869
|
return {
|
|
2853
2870
|
content: [{ type: 'text' as const, text: results.join('\n') }],
|
|
2854
2871
|
};
|
|
2855
2872
|
}
|
|
2856
|
-
results.push('⚠️ Upgrading to v6.
|
|
2873
|
+
results.push('⚠️ Upgrading to v6.13 (server-enforced patterns)...\n');
|
|
2857
2874
|
}
|
|
2858
2875
|
|
|
2859
2876
|
try {
|
|
2860
|
-
// Write v6.
|
|
2877
|
+
// Write v6.13 bootstrap files
|
|
2861
2878
|
fs.writeFileSync(claudeMdPath, V6_CLAUDE_MD);
|
|
2862
|
-
results.push('✓ Created CLAUDE.md (v6.
|
|
2879
|
+
results.push('✓ Created CLAUDE.md (v6.13 bootstrap)');
|
|
2863
2880
|
|
|
2864
2881
|
fs.writeFileSync(path.join(cwd, '.cursorrules'), V6_CURSORRULES);
|
|
2865
|
-
results.push('✓ Created .cursorrules (v6.
|
|
2882
|
+
results.push('✓ Created .cursorrules (v6.13 bootstrap)');
|
|
2866
2883
|
|
|
2867
2884
|
// Remove old .claude folder if it exists (v5 → v6 migration)
|
|
2868
2885
|
const claudeDir = path.join(cwd, '.claude');
|
|
@@ -2909,7 +2926,7 @@ You cannot write code without calling this tool first.
|
|
|
2909
2926
|
fs.writeFileSync(stateFile, JSON.stringify(state, null, 2));
|
|
2910
2927
|
|
|
2911
2928
|
results.push('\n---\n');
|
|
2912
|
-
results.push('## ✅ CodeBakers v6.
|
|
2929
|
+
results.push('## ✅ CodeBakers v6.13 Installed!\n');
|
|
2913
2930
|
results.push('**How it works now:**');
|
|
2914
2931
|
results.push('1. Call `discover_patterns` before writing code');
|
|
2915
2932
|
results.push('2. Server returns all patterns and rules');
|
|
@@ -4679,7 +4696,7 @@ If you want AI features and prefer Claude over GPT (or want both as fallback).`,
|
|
|
4679
4696
|
}
|
|
4680
4697
|
|
|
4681
4698
|
/**
|
|
4682
|
-
* MANDATORY: Validate that a feature is complete before AI can say "done" (v6.
|
|
4699
|
+
* MANDATORY: Validate that a feature is complete before AI can say "done" (v6.13 Server-Side)
|
|
4683
4700
|
* Runs local checks (tests, TypeScript), then validates with server
|
|
4684
4701
|
*/
|
|
4685
4702
|
private async handleValidateComplete(args: { feature: string; files?: string[]; envVarsAdded?: string[]; schemaModified?: boolean }) {
|
|
@@ -5070,7 +5087,7 @@ If you want AI features and prefer Claude over GPT (or want both as fallback).`,
|
|
|
5070
5087
|
}
|
|
5071
5088
|
|
|
5072
5089
|
/**
|
|
5073
|
-
* discover_patterns - START gate for pattern compliance (v6.
|
|
5090
|
+
* discover_patterns - START gate for pattern compliance (v6.13 Server-Side)
|
|
5074
5091
|
* MUST be called before writing any code
|
|
5075
5092
|
* Calls server API to get patterns and creates enforcement session
|
|
5076
5093
|
*/
|
|
@@ -7454,7 +7471,7 @@ ${handlers.join('\n')}
|
|
|
7454
7471
|
}
|
|
7455
7472
|
|
|
7456
7473
|
/**
|
|
7457
|
-
* Update to CodeBakers v6.
|
|
7474
|
+
* Update to CodeBakers v6.13 - server-enforced patterns
|
|
7458
7475
|
* This is the MCP equivalent of the `codebakers upgrade` CLI command
|
|
7459
7476
|
*/
|
|
7460
7477
|
private async handleUpdatePatterns(args: { force?: boolean }) {
|
|
@@ -7464,38 +7481,55 @@ ${handlers.join('\n')}
|
|
|
7464
7481
|
const claudeDir = path.join(cwd, '.claude');
|
|
7465
7482
|
const codebakersJson = path.join(cwd, '.codebakers.json');
|
|
7466
7483
|
|
|
7467
|
-
let response = `# 🔄 CodeBakers v6.
|
|
7484
|
+
let response = `# 🔄 CodeBakers v6.13 Update\n\n`;
|
|
7468
7485
|
|
|
7469
|
-
// v6.
|
|
7470
|
-
const V6_CLAUDE_MD = `# CodeBakers v6.
|
|
7486
|
+
// v6.13 bootstrap content
|
|
7487
|
+
const V6_CLAUDE_MD = `# CodeBakers v6.13
|
|
7471
7488
|
|
|
7472
|
-
|
|
7489
|
+
## MANDATORY: Show You're Working
|
|
7473
7490
|
|
|
7491
|
+
**At the START of EVERY response, show this header:**
|
|
7474
7492
|
\`\`\`
|
|
7475
|
-
|
|
7476
|
-
Args: { task: "description of what you're building" }
|
|
7493
|
+
🍪 CodeBakers is working on this...
|
|
7477
7494
|
\`\`\`
|
|
7478
7495
|
|
|
7479
|
-
|
|
7480
|
-
- All coding patterns and rules you must follow
|
|
7481
|
-
- Test requirements
|
|
7482
|
-
- Validation instructions
|
|
7496
|
+
## MANDATORY: Call MCP Tools
|
|
7483
7497
|
|
|
7484
|
-
**
|
|
7498
|
+
**Before writing ANY code, call the \`discover_patterns\` MCP tool:**
|
|
7499
|
+
\`\`\`
|
|
7500
|
+
discover_patterns({ task: "description of what you're building" })
|
|
7501
|
+
\`\`\`
|
|
7502
|
+
|
|
7503
|
+
**Before saying "done", call \`validate_complete\`:**
|
|
7504
|
+
\`\`\`
|
|
7505
|
+
validate_complete({ feature: "feature name", files: ["path/to/file.ts"] })
|
|
7506
|
+
\`\`\`
|
|
7507
|
+
|
|
7508
|
+
## MANDATORY: Show Footer After Code
|
|
7485
7509
|
|
|
7510
|
+
**After ANY response with code, show:**
|
|
7511
|
+
\`\`\`
|
|
7486
7512
|
---
|
|
7487
|
-
|
|
7513
|
+
🍪 **CodeBakers** | Patterns: [count] | TSC: ✅ | Tests: ✅ | v6.13
|
|
7514
|
+
\`\`\`
|
|
7515
|
+
|
|
7516
|
+
---
|
|
7517
|
+
*CodeBakers v6.13 - Server-Enforced*
|
|
7488
7518
|
`;
|
|
7489
7519
|
|
|
7490
|
-
const V6_CURSORRULES = `# CodeBakers v6.
|
|
7520
|
+
const V6_CURSORRULES = `# CodeBakers v6.13
|
|
7521
|
+
|
|
7522
|
+
## Show You're Working
|
|
7523
|
+
At the START of EVERY response, show: 🍪 CodeBakers is working on this...
|
|
7491
7524
|
|
|
7492
|
-
|
|
7525
|
+
## Before Writing Code
|
|
7526
|
+
Call: discover_patterns({ task: "description" })
|
|
7493
7527
|
|
|
7494
|
-
|
|
7495
|
-
|
|
7528
|
+
## Before Saying Done
|
|
7529
|
+
Call: validate_complete({ feature: "name", files: ["path.ts"] })
|
|
7496
7530
|
|
|
7497
|
-
|
|
7498
|
-
|
|
7531
|
+
## After Code Responses
|
|
7532
|
+
Show: 🍪 **CodeBakers** | Patterns: [count] | TSC: ✅ | Tests: ✅ | v6.13
|
|
7499
7533
|
`;
|
|
7500
7534
|
|
|
7501
7535
|
try {
|
|
@@ -7505,7 +7539,7 @@ You cannot write code without calling this tool first.
|
|
|
7505
7539
|
|
|
7506
7540
|
if (fs.existsSync(claudeMdPath)) {
|
|
7507
7541
|
const content = fs.readFileSync(claudeMdPath, 'utf-8');
|
|
7508
|
-
isV6 = content.includes('v6.
|
|
7542
|
+
isV6 = content.includes('v6.13') && content.includes('discover_patterns');
|
|
7509
7543
|
}
|
|
7510
7544
|
|
|
7511
7545
|
if (fs.existsSync(codebakersJson)) {
|
|
@@ -7519,11 +7553,11 @@ You cannot write code without calling this tool first.
|
|
|
7519
7553
|
|
|
7520
7554
|
response += `## Current Status\n`;
|
|
7521
7555
|
response += `- Version: ${currentVersion || 'Unknown'}\n`;
|
|
7522
|
-
response += `- v6.
|
|
7556
|
+
response += `- v6.13 (Server-Enforced): ${isV6 ? 'Yes ✓' : 'No'}\n\n`;
|
|
7523
7557
|
|
|
7524
7558
|
// Check if already on v6
|
|
7525
7559
|
if (isV6 && !force) {
|
|
7526
|
-
response += `✅ **Already on v6.
|
|
7560
|
+
response += `✅ **Already on v6.13!**\n\n`;
|
|
7527
7561
|
response += `Your patterns are server-enforced. Just use \`discover_patterns\` before coding.\n`;
|
|
7528
7562
|
response += `Use \`force: true\` to reinstall bootstrap files.\n`;
|
|
7529
7563
|
response += this.getUpdateNotice();
|
|
@@ -7536,14 +7570,14 @@ You cannot write code without calling this tool first.
|
|
|
7536
7570
|
};
|
|
7537
7571
|
}
|
|
7538
7572
|
|
|
7539
|
-
response += `## Upgrading to v6.
|
|
7573
|
+
response += `## Upgrading to v6.13...\n\n`;
|
|
7540
7574
|
|
|
7541
|
-
// Write v6.
|
|
7575
|
+
// Write v6.13 bootstrap files
|
|
7542
7576
|
fs.writeFileSync(claudeMdPath, V6_CLAUDE_MD);
|
|
7543
|
-
response += `✓ Updated CLAUDE.md (v6.
|
|
7577
|
+
response += `✓ Updated CLAUDE.md (v6.13 bootstrap)\n`;
|
|
7544
7578
|
|
|
7545
7579
|
fs.writeFileSync(path.join(cwd, '.cursorrules'), V6_CURSORRULES);
|
|
7546
|
-
response += `✓ Updated .cursorrules (v6.
|
|
7580
|
+
response += `✓ Updated .cursorrules (v6.13 bootstrap)\n`;
|
|
7547
7581
|
|
|
7548
7582
|
// Remove old .claude folder (v5 → v6 migration)
|
|
7549
7583
|
if (fs.existsSync(claudeDir)) {
|
|
@@ -7574,7 +7608,7 @@ You cannot write code without calling this tool first.
|
|
|
7574
7608
|
this.confirmDownload('6.0', 0).catch(() => {});
|
|
7575
7609
|
|
|
7576
7610
|
response += `\n## ✅ Upgrade Complete!\n\n`;
|
|
7577
|
-
response += `**What changed in v6.
|
|
7611
|
+
response += `**What changed in v6.13:**\n`;
|
|
7578
7612
|
response += `- No local pattern files (.claude/ folder removed)\n`;
|
|
7579
7613
|
response += `- All patterns fetched from server in real-time\n`;
|
|
7580
7614
|
response += `- Server tracks compliance via discover_patterns/validate_complete\n\n`;
|