@codebakers/cli 3.9.29 → 3.9.31
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/package.json +1 -1
- package/src/commands/go.ts +59 -15
- package/src/mcp/server.ts +48 -26
- package/tmpclaude-500f-cwd +1 -0
package/package.json
CHANGED
package/src/commands/go.ts
CHANGED
|
@@ -1560,8 +1560,16 @@ 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 v6.
|
|
1563
|
+
// v6.16 Bootstrap - SHORT template with magic phrase + rules at START and END
|
|
1564
|
+
const V6_CLAUDE_MD = `# CodeBakers v6.16
|
|
1565
|
+
|
|
1566
|
+
## 🪄 MAGIC PHRASE: "codebakers go"
|
|
1567
|
+
When user says "codebakers go" in chat, start the onboarding conversation:
|
|
1568
|
+
1. Ask: "Is this an existing project or are you starting fresh?" (1=existing, 2=new)
|
|
1569
|
+
2. If existing: "Great! What would you like to work on?"
|
|
1570
|
+
3. If new: "What do you want to build? Describe your project."
|
|
1571
|
+
4. Then call \`init_project()\` to set up CodeBakers files
|
|
1572
|
+
5. Continue helping them build
|
|
1565
1573
|
|
|
1566
1574
|
## 🚨 ALWAYS DO THIS (Critical - Read First)
|
|
1567
1575
|
1. ALWAYS call \`project_status()\` FIRST → If works show "🍪 CodeBakers is working..." / If fails show "⚠️ Not connected"
|
|
@@ -1583,7 +1591,7 @@ validate_complete({ feature: "name", files: [...] }) → Validate BEFORE done
|
|
|
1583
1591
|
\`\`\`
|
|
1584
1592
|
|
|
1585
1593
|
Header (after project_status succeeds): 🍪 CodeBakers is working on this...
|
|
1586
|
-
Header (if project_status fails): ⚠️ CodeBakers not connected
|
|
1594
|
+
Header (if project_status fails): ⚠️ CodeBakers not connected
|
|
1587
1595
|
Footer (after code): 🍪 **CodeBakers** | Patterns: X | TSC: ✅ | Tests: ✅
|
|
1588
1596
|
|
|
1589
1597
|
## 🚨 ALWAYS DO THIS (Critical - Repeated at End)
|
|
@@ -1593,7 +1601,10 @@ Footer (after code): 🍪 **CodeBakers** | Patterns: X | TSC: ✅ | Tests: ✅
|
|
|
1593
1601
|
4. Show footer after code responses
|
|
1594
1602
|
`;
|
|
1595
1603
|
|
|
1596
|
-
const V6_CURSORRULES = `# CodeBakers v6.
|
|
1604
|
+
const V6_CURSORRULES = `# CodeBakers v6.16
|
|
1605
|
+
|
|
1606
|
+
## 🪄 "codebakers go" = Start onboarding conversation
|
|
1607
|
+
Ask existing/new → Ask what to build → Call init_project() → Help them build
|
|
1597
1608
|
|
|
1598
1609
|
## 🚨 ALWAYS (Read First)
|
|
1599
1610
|
1. Call project_status() FIRST → 🍪 Working... or ⚠️ Not connected
|
|
@@ -1615,7 +1626,7 @@ const V6_CURSORRULES = `# CodeBakers v6.15
|
|
|
1615
1626
|
|
|
1616
1627
|
/**
|
|
1617
1628
|
* Complete project setup - handles everything:
|
|
1618
|
-
* -
|
|
1629
|
+
* - Ask user if existing or new project
|
|
1619
1630
|
* - Set up all tracking files
|
|
1620
1631
|
* - Configure Cursor and Claude Code MCP
|
|
1621
1632
|
* - Run guided questions for new projects
|
|
@@ -1624,11 +1635,40 @@ const V6_CURSORRULES = `# CodeBakers v6.15
|
|
|
1624
1635
|
async function setupProject(options: GoOptions = {}, auth?: AuthInfo): Promise<void> {
|
|
1625
1636
|
const cwd = process.cwd();
|
|
1626
1637
|
|
|
1627
|
-
//
|
|
1638
|
+
// Auto-detect non-interactive mode (e.g., running from Claude Code)
|
|
1639
|
+
const isNonInteractive = !process.stdin.isTTY;
|
|
1640
|
+
|
|
1641
|
+
// Detect if this looks like an existing project
|
|
1628
1642
|
const projectInfo = detectExistingProject(cwd);
|
|
1629
1643
|
|
|
1630
|
-
|
|
1631
|
-
|
|
1644
|
+
let isExistingProject: boolean;
|
|
1645
|
+
|
|
1646
|
+
if (isNonInteractive) {
|
|
1647
|
+
// Non-interactive: use auto-detection
|
|
1648
|
+
isExistingProject = projectInfo.exists;
|
|
1649
|
+
} else {
|
|
1650
|
+
// Interactive: ASK the user
|
|
1651
|
+
console.log(chalk.cyan('\n ━━━ CodeBakers Setup ━━━\n'));
|
|
1652
|
+
|
|
1653
|
+
if (projectInfo.exists) {
|
|
1654
|
+
// We detected existing code, but still ask
|
|
1655
|
+
console.log(chalk.gray(` Detected: ${projectInfo.files} files, ${projectInfo.stack.framework || 'unknown framework'}\n`));
|
|
1656
|
+
}
|
|
1657
|
+
|
|
1658
|
+
console.log(chalk.white(' Is this an existing project or are you starting fresh?\n'));
|
|
1659
|
+
console.log(chalk.gray(' 1. ') + chalk.cyan('EXISTING PROJECT') + chalk.gray(' - I already have code here'));
|
|
1660
|
+
console.log(chalk.gray(' 2. ') + chalk.cyan('NEW PROJECT') + chalk.gray(' - Starting from scratch\n'));
|
|
1661
|
+
|
|
1662
|
+
let projectChoice = '';
|
|
1663
|
+
while (!['1', '2'].includes(projectChoice)) {
|
|
1664
|
+
projectChoice = await prompt(' Enter 1 or 2: ');
|
|
1665
|
+
}
|
|
1666
|
+
|
|
1667
|
+
isExistingProject = projectChoice === '1';
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1670
|
+
if (isExistingProject) {
|
|
1671
|
+
// Existing project
|
|
1632
1672
|
await setupExistingProject(cwd, projectInfo, options, auth);
|
|
1633
1673
|
} else {
|
|
1634
1674
|
// New project
|
|
@@ -1637,15 +1677,19 @@ async function setupProject(options: GoOptions = {}, auth?: AuthInfo): Promise<v
|
|
|
1637
1677
|
}
|
|
1638
1678
|
|
|
1639
1679
|
async function setupNewProject(cwd: string, options: GoOptions = {}, auth?: AuthInfo): Promise<void> {
|
|
1640
|
-
console.log(chalk.cyan('\n ━━━ New Project Setup ━━━\n'));
|
|
1641
|
-
|
|
1642
1680
|
// Auto-detect non-interactive mode (e.g., running from Claude Code)
|
|
1643
1681
|
const isNonInteractive = !process.stdin.isTTY;
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1682
|
+
|
|
1683
|
+
if (isNonInteractive) {
|
|
1684
|
+
console.log(chalk.cyan('\n ━━━ New Project Setup ━━━\n'));
|
|
1685
|
+
if (!options.type) {
|
|
1686
|
+
console.log(chalk.yellow(' ⚡ Non-interactive mode detected - using defaults\n'));
|
|
1687
|
+
options.type = 'personal';
|
|
1688
|
+
options.describe = options.describe || 'chat';
|
|
1689
|
+
options.skipReview = true;
|
|
1690
|
+
}
|
|
1691
|
+
} else {
|
|
1692
|
+
console.log(chalk.green('\n ✓ Setting up as NEW PROJECT\n'));
|
|
1649
1693
|
}
|
|
1650
1694
|
|
|
1651
1695
|
let projectType: string;
|
package/src/mcp/server.ts
CHANGED
|
@@ -2808,10 +2808,18 @@ 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.16 to: ${projectName}\n`);
|
|
2812
2812
|
|
|
2813
|
-
// v6.
|
|
2814
|
-
const V6_CLAUDE_MD = `# CodeBakers v6.
|
|
2813
|
+
// v6.16 bootstrap content - magic phrase + rules at START and END
|
|
2814
|
+
const V6_CLAUDE_MD = `# CodeBakers v6.16
|
|
2815
|
+
|
|
2816
|
+
## 🪄 MAGIC PHRASE: "codebakers go"
|
|
2817
|
+
When user says "codebakers go" in chat, start the onboarding conversation:
|
|
2818
|
+
1. Ask: "Is this an existing project or are you starting fresh?" (1=existing, 2=new)
|
|
2819
|
+
2. If existing: "Great! What would you like to work on?"
|
|
2820
|
+
3. If new: "What do you want to build? Describe your project."
|
|
2821
|
+
4. Then call \`init_project()\` to set up CodeBakers files
|
|
2822
|
+
5. Continue helping them build
|
|
2815
2823
|
|
|
2816
2824
|
## 🚨 ALWAYS DO THIS (Critical - Read First)
|
|
2817
2825
|
1. ALWAYS call \`project_status()\` FIRST → If works show "🍪 CodeBakers is working..." / If fails show "⚠️ Not connected"
|
|
@@ -2833,7 +2841,7 @@ validate_complete({ feature: "name", files: [...] }) → Validate BEFORE done
|
|
|
2833
2841
|
\`\`\`
|
|
2834
2842
|
|
|
2835
2843
|
Header (after project_status succeeds): 🍪 CodeBakers is working on this...
|
|
2836
|
-
Header (if project_status fails): ⚠️ CodeBakers not connected
|
|
2844
|
+
Header (if project_status fails): ⚠️ CodeBakers not connected
|
|
2837
2845
|
Footer (after code): 🍪 **CodeBakers** | Patterns: X | TSC: ✅ | Tests: ✅
|
|
2838
2846
|
|
|
2839
2847
|
## 🚨 ALWAYS DO THIS (Critical - Repeated at End)
|
|
@@ -2843,7 +2851,10 @@ Footer (after code): 🍪 **CodeBakers** | Patterns: X | TSC: ✅ | Tests: ✅
|
|
|
2843
2851
|
4. Show footer after code responses
|
|
2844
2852
|
`;
|
|
2845
2853
|
|
|
2846
|
-
const V6_CURSORRULES = `# CodeBakers v6.
|
|
2854
|
+
const V6_CURSORRULES = `# CodeBakers v6.16
|
|
2855
|
+
|
|
2856
|
+
## 🪄 "codebakers go" = Start onboarding conversation
|
|
2857
|
+
Ask existing/new → Ask what to build → Call init_project() → Help them build
|
|
2847
2858
|
|
|
2848
2859
|
## 🚨 ALWAYS (Read First)
|
|
2849
2860
|
1. Call project_status() FIRST → 🍪 Working... or ⚠️ Not connected
|
|
@@ -2863,27 +2874,27 @@ Footer (after code): 🍪 **CodeBakers** | Patterns: X | TSC: ✅ | Tests: ✅
|
|
|
2863
2874
|
3. validate_complete() before done
|
|
2864
2875
|
`;
|
|
2865
2876
|
|
|
2866
|
-
// Check if already v6.
|
|
2877
|
+
// Check if already v6.16
|
|
2867
2878
|
const claudeMdPath = path.join(cwd, 'CLAUDE.md');
|
|
2868
2879
|
if (fs.existsSync(claudeMdPath)) {
|
|
2869
2880
|
const content = fs.readFileSync(claudeMdPath, 'utf-8');
|
|
2870
|
-
if (content.includes('v6.
|
|
2871
|
-
results.push('✓ CodeBakers v6.
|
|
2881
|
+
if (content.includes('v6.16') && content.includes('discover_patterns')) {
|
|
2882
|
+
results.push('✓ CodeBakers v6.16 already installed\n');
|
|
2872
2883
|
results.push('Patterns are server-enforced. Just call `discover_patterns` before coding!');
|
|
2873
2884
|
return {
|
|
2874
2885
|
content: [{ type: 'text' as const, text: results.join('\n') }],
|
|
2875
2886
|
};
|
|
2876
2887
|
}
|
|
2877
|
-
results.push('⚠️ Upgrading to v6.
|
|
2888
|
+
results.push('⚠️ Upgrading to v6.16 (server-enforced patterns)...\n');
|
|
2878
2889
|
}
|
|
2879
2890
|
|
|
2880
2891
|
try {
|
|
2881
|
-
// Write v6.
|
|
2892
|
+
// Write v6.16 bootstrap files
|
|
2882
2893
|
fs.writeFileSync(claudeMdPath, V6_CLAUDE_MD);
|
|
2883
|
-
results.push('✓ Created CLAUDE.md (v6.
|
|
2894
|
+
results.push('✓ Created CLAUDE.md (v6.16 bootstrap)');
|
|
2884
2895
|
|
|
2885
2896
|
fs.writeFileSync(path.join(cwd, '.cursorrules'), V6_CURSORRULES);
|
|
2886
|
-
results.push('✓ Created .cursorrules (v6.
|
|
2897
|
+
results.push('✓ Created .cursorrules (v6.16 bootstrap)');
|
|
2887
2898
|
|
|
2888
2899
|
// Remove old .claude folder if it exists (v5 → v6 migration)
|
|
2889
2900
|
const claudeDir = path.join(cwd, '.claude');
|
|
@@ -2930,7 +2941,7 @@ Footer (after code): 🍪 **CodeBakers** | Patterns: X | TSC: ✅ | Tests: ✅
|
|
|
2930
2941
|
fs.writeFileSync(stateFile, JSON.stringify(state, null, 2));
|
|
2931
2942
|
|
|
2932
2943
|
results.push('\n---\n');
|
|
2933
|
-
results.push('## ✅ CodeBakers v6.
|
|
2944
|
+
results.push('## ✅ CodeBakers v6.16 Installed!\n');
|
|
2934
2945
|
results.push('**How it works now:**');
|
|
2935
2946
|
results.push('1. Call `discover_patterns` before writing code');
|
|
2936
2947
|
results.push('2. Server returns all patterns and rules');
|
|
@@ -7475,7 +7486,7 @@ ${handlers.join('\n')}
|
|
|
7475
7486
|
}
|
|
7476
7487
|
|
|
7477
7488
|
/**
|
|
7478
|
-
* Update to CodeBakers v6.
|
|
7489
|
+
* Update to CodeBakers v6.16 - server-enforced patterns with magic phrase
|
|
7479
7490
|
* This is the MCP equivalent of the `codebakers upgrade` CLI command
|
|
7480
7491
|
*/
|
|
7481
7492
|
private async handleUpdatePatterns(args: { force?: boolean }) {
|
|
@@ -7485,10 +7496,18 @@ ${handlers.join('\n')}
|
|
|
7485
7496
|
const claudeDir = path.join(cwd, '.claude');
|
|
7486
7497
|
const codebakersJson = path.join(cwd, '.codebakers.json');
|
|
7487
7498
|
|
|
7488
|
-
let response = `# 🔄 CodeBakers v6.
|
|
7499
|
+
let response = `# 🔄 CodeBakers v6.16 Update\n\n`;
|
|
7489
7500
|
|
|
7490
|
-
// v6.
|
|
7491
|
-
const V6_CLAUDE_MD = `# CodeBakers v6.
|
|
7501
|
+
// v6.16 bootstrap content - magic phrase + rules at START and END
|
|
7502
|
+
const V6_CLAUDE_MD = `# CodeBakers v6.16
|
|
7503
|
+
|
|
7504
|
+
## 🪄 MAGIC PHRASE: "codebakers go"
|
|
7505
|
+
When user says "codebakers go" in chat, start the onboarding conversation:
|
|
7506
|
+
1. Ask: "Is this an existing project or are you starting fresh?" (1=existing, 2=new)
|
|
7507
|
+
2. If existing: "Great! What would you like to work on?"
|
|
7508
|
+
3. If new: "What do you want to build? Describe your project."
|
|
7509
|
+
4. Then call \`init_project()\` to set up CodeBakers files
|
|
7510
|
+
5. Continue helping them build
|
|
7492
7511
|
|
|
7493
7512
|
## 🚨 ALWAYS DO THIS (Critical - Read First)
|
|
7494
7513
|
1. ALWAYS call \`project_status()\` FIRST → If works show "🍪 CodeBakers is working..." / If fails show "⚠️ Not connected"
|
|
@@ -7510,7 +7529,7 @@ validate_complete({ feature: "name", files: [...] }) → Validate BEFORE done
|
|
|
7510
7529
|
\`\`\`
|
|
7511
7530
|
|
|
7512
7531
|
Header (after project_status succeeds): 🍪 CodeBakers is working on this...
|
|
7513
|
-
Header (if project_status fails): ⚠️ CodeBakers not connected
|
|
7532
|
+
Header (if project_status fails): ⚠️ CodeBakers not connected
|
|
7514
7533
|
Footer (after code): 🍪 **CodeBakers** | Patterns: X | TSC: ✅ | Tests: ✅
|
|
7515
7534
|
|
|
7516
7535
|
## 🚨 ALWAYS DO THIS (Critical - Repeated at End)
|
|
@@ -7520,7 +7539,10 @@ Footer (after code): 🍪 **CodeBakers** | Patterns: X | TSC: ✅ | Tests: ✅
|
|
|
7520
7539
|
4. Show footer after code responses
|
|
7521
7540
|
`;
|
|
7522
7541
|
|
|
7523
|
-
const V6_CURSORRULES = `# CodeBakers v6.
|
|
7542
|
+
const V6_CURSORRULES = `# CodeBakers v6.16
|
|
7543
|
+
|
|
7544
|
+
## 🪄 "codebakers go" = Start onboarding conversation
|
|
7545
|
+
Ask existing/new → Ask what to build → Call init_project() → Help them build
|
|
7524
7546
|
|
|
7525
7547
|
## 🚨 ALWAYS (Read First)
|
|
7526
7548
|
1. Call project_status() FIRST → 🍪 Working... or ⚠️ Not connected
|
|
@@ -7547,7 +7569,7 @@ Footer (after code): 🍪 **CodeBakers** | Patterns: X | TSC: ✅ | Tests: ✅
|
|
|
7547
7569
|
|
|
7548
7570
|
if (fs.existsSync(claudeMdPath)) {
|
|
7549
7571
|
const content = fs.readFileSync(claudeMdPath, 'utf-8');
|
|
7550
|
-
isV6 = content.includes('v6.
|
|
7572
|
+
isV6 = content.includes('v6.16') && content.includes('discover_patterns');
|
|
7551
7573
|
}
|
|
7552
7574
|
|
|
7553
7575
|
if (fs.existsSync(codebakersJson)) {
|
|
@@ -7561,11 +7583,11 @@ Footer (after code): 🍪 **CodeBakers** | Patterns: X | TSC: ✅ | Tests: ✅
|
|
|
7561
7583
|
|
|
7562
7584
|
response += `## Current Status\n`;
|
|
7563
7585
|
response += `- Version: ${currentVersion || 'Unknown'}\n`;
|
|
7564
|
-
response += `- v6.
|
|
7586
|
+
response += `- v6.16 (Server-Enforced): ${isV6 ? 'Yes ✓' : 'No'}\n\n`;
|
|
7565
7587
|
|
|
7566
7588
|
// Check if already on v6
|
|
7567
7589
|
if (isV6 && !force) {
|
|
7568
|
-
response += `✅ **Already on v6.
|
|
7590
|
+
response += `✅ **Already on v6.16!**\n\n`;
|
|
7569
7591
|
response += `Your patterns are server-enforced. Just use \`discover_patterns\` before coding.\n`;
|
|
7570
7592
|
response += `Use \`force: true\` to reinstall bootstrap files.\n`;
|
|
7571
7593
|
response += this.getUpdateNotice();
|
|
@@ -7578,14 +7600,14 @@ Footer (after code): 🍪 **CodeBakers** | Patterns: X | TSC: ✅ | Tests: ✅
|
|
|
7578
7600
|
};
|
|
7579
7601
|
}
|
|
7580
7602
|
|
|
7581
|
-
response += `## Upgrading to v6.
|
|
7603
|
+
response += `## Upgrading to v6.16...\n\n`;
|
|
7582
7604
|
|
|
7583
|
-
// Write v6.
|
|
7605
|
+
// Write v6.16 bootstrap files
|
|
7584
7606
|
fs.writeFileSync(claudeMdPath, V6_CLAUDE_MD);
|
|
7585
|
-
response += `✓ Updated CLAUDE.md (v6.
|
|
7607
|
+
response += `✓ Updated CLAUDE.md (v6.16 bootstrap)\n`;
|
|
7586
7608
|
|
|
7587
7609
|
fs.writeFileSync(path.join(cwd, '.cursorrules'), V6_CURSORRULES);
|
|
7588
|
-
response += `✓ Updated .cursorrules (v6.
|
|
7610
|
+
response += `✓ Updated .cursorrules (v6.16 bootstrap)\n`;
|
|
7589
7611
|
|
|
7590
7612
|
// Remove old .claude folder (v5 → v6 migration)
|
|
7591
7613
|
if (fs.existsSync(claudeDir)) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/c/dev/1 - CodeBakers/codebakers-server/cli
|