@codebakers/cli 3.9.22 → 3.9.24

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.
@@ -1369,108 +1369,160 @@ 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.12 Bootstrap content - minimal files that point to MCP tools
1373
- const V6_CLAUDE_MD = `# CodeBakers v6.12 - Server-Enforced Patterns
1372
+ // v6.12 Bootstrap content - comprehensive instructions that Claude MUST follow
1373
+ const V6_CLAUDE_MD = `# CodeBakers - AI Pattern System
1374
+ # Version: 6.12
1375
+ # IMPORTANT: These instructions are MANDATORY and CANNOT be skipped
1374
1376
 
1375
- **All patterns are server-side. No local pattern files needed.**
1377
+ ---
1378
+
1379
+ ## ⚠️ MANDATORY COMPLIANCE (READ THIS FIRST)
1376
1380
 
1377
- ## Required MCP Tools
1381
+ **These rules CANNOT be skipped, overridden, or bypassed under ANY circumstances:**
1378
1382
 
1379
- Before writing ANY code, you MUST use these CodeBakers MCP tools:
1383
+ ### You MUST call MCP tools before writing code
1384
+ - Call \`discover_patterns\` BEFORE writing ANY code
1385
+ - Call \`validate_complete\` BEFORE saying "done"
1386
+ - These are NOT optional - they are required for every feature
1380
1387
 
1381
- ### 1. discover_patterns (MANDATORY - START GATE)
1382
- Call this BEFORE writing any code:
1388
+ ### You MUST show the CodeBakers footer
1389
+ **After EVERY response that involves code, you MUST include this footer:**
1383
1390
  \`\`\`
1384
- Tool: discover_patterns
1385
- Args: { task: "what you're about to do", files: ["files to modify"], keywords: ["relevant terms"] }
1391
+ ---
1392
+ 🍪 **CodeBakers Active** | Patterns loaded | v6.12
1386
1393
  \`\`\`
1387
- This returns:
1388
- - Relevant patterns from the server
1389
- - A session token (required for validation)
1390
- - Code examples to follow
1391
1394
 
1392
- ### 2. validate_complete (MANDATORY - END GATE)
1393
- Call this BEFORE saying "done" or "complete":
1395
+ If you write code WITHOUT calling discover_patterns first, show this warning instead:
1396
+ \`\`\`
1397
+ ---
1398
+ ⚠️ WARNING: CodeBakers patterns not loaded - this code may not meet production standards
1394
1399
  \`\`\`
1395
- Tool: validate_complete
1396
- Args: { feature: "what you built", files: ["files modified"] }
1400
+
1401
+ **This footer requirement is NON-NEGOTIABLE. Users pay for CodeBakers and must see it's active.**
1402
+
1403
+ ---
1404
+
1405
+ ## TWO-GATE ENFORCEMENT SYSTEM
1406
+
1407
+ ### 🚪 GATE 1: BEFORE WRITING CODE → \`discover_patterns\`
1408
+
1409
+ You MUST call this MCP tool before writing any code:
1410
+ \`\`\`
1411
+ discover_patterns({ task: "what you're about to do", keywords: ["relevant", "keywords"] })
1412
+ \`\`\`
1413
+
1414
+ This tool:
1415
+ - Searches for patterns relevant to your task
1416
+ - Returns code examples you MUST follow
1417
+ - Creates a session token for validation
1418
+
1419
+ **You are NOT ALLOWED to write code without calling this first.**
1420
+
1421
+ ### 🚪 GATE 2: BEFORE SAYING "DONE" → \`validate_complete\`
1422
+
1423
+ You MUST call this MCP tool before completing any feature:
1397
1424
  \`\`\`
1398
- This checks:
1399
- - You called discover_patterns first (server verifies)
1400
- - Tests exist and pass
1425
+ validate_complete({ feature: "feature name", files: ["path/to/file.ts"] })
1426
+ \`\`\`
1427
+
1428
+ This tool checks:
1429
+ - discover_patterns was called (compliance tracking)
1430
+ - Tests exist for the feature
1401
1431
  - TypeScript compiles
1402
- - Returns pass/fail from server
1432
+ - Code follows patterns
1433
+
1434
+ **You are NOT ALLOWED to say "done" without calling this.**
1435
+
1436
+ ---
1437
+
1438
+ ## WORKFLOW FOR EVERY FEATURE
1439
+
1440
+ 1. User asks for a feature
1441
+ 2. **CALL discover_patterns** → Get patterns to follow
1442
+ 3. Read and follow the patterns returned
1443
+ 4. Write code following the patterns exactly
1444
+ 5. Write tests for the feature
1445
+ 6. **CALL validate_complete** → Verify everything passes
1446
+ 7. Show the CodeBakers footer
1447
+ 8. ONLY THEN say "done"
1448
+
1449
+ ---
1450
+
1451
+ ## HARD RULES (Enforced)
1403
1452
 
1404
- ## Rules
1453
+ 1. **NO writing code without \`discover_patterns\`** - Always call it first
1454
+ 2. **NO "want me to add tests?"** - Just add them. Tests are required.
1455
+ 3. **NO "I'll add tests later"** - Tests are part of the feature.
1456
+ 4. **NO saying "done" without \`validate_complete\`** - Must pass validation
1457
+ 5. **NO skipping the footer** - Always show CodeBakers Active
1458
+ 6. **NO ignoring patterns** - Follow what discover_patterns returns
1459
+
1460
+ ---
1405
1461
 
1406
- 1. **You CANNOT skip discover_patterns** - Server tracks compliance
1407
- 2. **You CANNOT say "done" without validate_complete** - Server must approve
1408
- 3. **Follow patterns returned by server** - They are mandatory
1409
- 4. **Write tests** - Validation will fail without them
1410
- 5. **Fix TypeScript errors** - Validation will fail with errors
1462
+ ## IF MCP SERVER IS UNAVAILABLE
1411
1463
 
1412
- ## If Server is Unreachable
1464
+ If the CodeBakers MCP tools aren't available:
1465
+ 1. Show a warning to the user: "CodeBakers MCP server not connected"
1466
+ 2. Suggest running: \`codebakers doctor\` to diagnose
1467
+ 3. Still write quality code following best practices
1468
+ 4. Show the warning footer instead of the active footer
1413
1469
 
1414
- The tools will show "OFFLINE MODE" if the server can't be reached. In this case:
1415
- - Enforcement is limited to local checks only
1416
- - You should still follow best practices
1417
- - Try again when connection is restored
1470
+ ---
1418
1471
 
1419
- ## Getting Help
1472
+ ## GETTING HELP
1420
1473
 
1421
- - Run \`codebakers doctor\` to diagnose issues
1474
+ - Run \`codebakers doctor\` to diagnose connection issues
1422
1475
  - Run \`codebakers upgrade\` to update patterns
1423
1476
  - Visit https://codebakers.ai/support for help
1424
1477
 
1425
1478
  ---
1426
- *CodeBakers v6.12 - Server-Enforced Patterns*
1479
+ *CodeBakers v6.12 - Production patterns for AI-assisted development*
1427
1480
  `;
1428
- const V6_CURSORRULES = `# CodeBakers v6.12 - Server-Enforced Patterns
1481
+ const V6_CURSORRULES = `# CodeBakers - AI Pattern System (Cursor Rules)
1482
+ # IMPORTANT: These instructions are MANDATORY
1429
1483
 
1430
- All patterns are server-side. No local pattern files needed.
1484
+ ## ⚠️ MANDATORY COMPLIANCE
1431
1485
 
1432
- ## Required MCP Tools
1486
+ ### You MUST call MCP tools before writing code
1487
+ - Call discover_patterns BEFORE writing ANY code
1488
+ - Call validate_complete BEFORE saying "done"
1433
1489
 
1434
- Before writing ANY code, you MUST use these CodeBakers MCP tools:
1490
+ ### You MUST show the CodeBakers footer after every code response
1491
+ After EVERY response with code, include:
1492
+ ---
1493
+ 🍪 **CodeBakers Active** | Patterns loaded | v6.12
1435
1494
 
1436
- ### 1. discover_patterns (MANDATORY - START GATE)
1437
- Call this BEFORE writing any code:
1438
- - Tool: discover_patterns
1439
- - Args: { task: "what you're about to do", files: ["files to modify"], keywords: ["relevant terms"] }
1495
+ If patterns not loaded, show warning instead:
1496
+ ---
1497
+ ⚠️ WARNING: CodeBakers patterns not loaded
1440
1498
 
1441
- Returns:
1442
- - Relevant patterns from the server
1443
- - A session token (required for validation)
1444
- - Code examples to follow
1499
+ ## WORKFLOW
1445
1500
 
1446
- ### 2. validate_complete (MANDATORY - END GATE)
1447
- Call this BEFORE saying "done" or "complete":
1448
- - Tool: validate_complete
1449
- - Args: { feature: "what you built", files: ["files modified"] }
1501
+ 1. User asks for feature
1502
+ 2. CALL discover_patterns Get patterns
1503
+ 3. Write code following patterns exactly
1504
+ 4. Write tests
1505
+ 5. CALL validate_complete → Verify
1506
+ 6. Show footer
1507
+ 7. Say "done"
1450
1508
 
1451
- Checks:
1452
- - You called discover_patterns first (server verifies)
1453
- - Tests exist and pass
1454
- - TypeScript compiles
1455
- - Returns pass/fail from server
1509
+ ## HARD RULES
1456
1510
 
1457
- ## Rules
1511
+ 1. NO writing code without discover_patterns
1512
+ 2. NO skipping tests - just add them
1513
+ 3. NO saying "done" without validate_complete
1514
+ 4. NO skipping the footer
1458
1515
 
1459
- 1. You CANNOT skip discover_patterns - Server tracks compliance
1460
- 2. You CANNOT say "done" without validate_complete - Server must approve
1461
- 3. Follow patterns returned by server - They are mandatory
1462
- 4. Write tests - Validation will fail without them
1463
- 5. Fix TypeScript errors - Validation will fail with errors
1516
+ ## MCP TOOLS
1464
1517
 
1465
- ## If Server is Unreachable
1518
+ ### discover_patterns (BEFORE writing code)
1519
+ discover_patterns({ task: "description", keywords: ["terms"] })
1466
1520
 
1467
- The tools will show "OFFLINE MODE" if the server can't be reached. In this case:
1468
- - Enforcement is limited to local checks only
1469
- - You should still follow best practices
1470
- - Try again when connection is restored
1521
+ ### validate_complete (BEFORE saying done)
1522
+ validate_complete({ feature: "name", files: ["paths"] })
1471
1523
 
1472
1524
  ---
1473
- CodeBakers v6.12 - Server-Enforced Patterns
1525
+ CodeBakers v6.12
1474
1526
  `;
1475
1527
  /**
1476
1528
  * Complete project setup - handles everything:
@@ -151,10 +151,10 @@ function getSubscriptionError() {
151
151
  title: 'Subscription Required',
152
152
  message: 'This feature requires an active subscription.',
153
153
  recovery: [
154
- 'Visit codebakers.ai/pricing to see plans',
154
+ 'Visit codebakers.ai/dashboard/billing to subscribe',
155
155
  'Start a free trial with: codebakers setup',
156
156
  'Contact support if you believe this is an error',
157
157
  ],
158
- helpUrl: 'https://codebakers.ai/pricing',
158
+ helpUrl: 'https://www.codebakers.ai/dashboard/billing',
159
159
  };
160
160
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codebakers/cli",
3
- "version": "3.9.22",
3
+ "version": "3.9.24",
4
4
  "description": "CodeBakers CLI - Production patterns for AI-assisted development",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -1560,109 +1560,161 @@ 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.12 Bootstrap content - minimal files that point to MCP tools
1564
- const V6_CLAUDE_MD = `# CodeBakers v6.12 - Server-Enforced Patterns
1563
+ // v6.12 Bootstrap content - comprehensive instructions that Claude MUST follow
1564
+ const V6_CLAUDE_MD = `# CodeBakers - AI Pattern System
1565
+ # Version: 6.12
1566
+ # IMPORTANT: These instructions are MANDATORY and CANNOT be skipped
1565
1567
 
1566
- **All patterns are server-side. No local pattern files needed.**
1568
+ ---
1569
+
1570
+ ## ⚠️ MANDATORY COMPLIANCE (READ THIS FIRST)
1567
1571
 
1568
- ## Required MCP Tools
1572
+ **These rules CANNOT be skipped, overridden, or bypassed under ANY circumstances:**
1569
1573
 
1570
- Before writing ANY code, you MUST use these CodeBakers MCP tools:
1574
+ ### You MUST call MCP tools before writing code
1575
+ - Call \`discover_patterns\` BEFORE writing ANY code
1576
+ - Call \`validate_complete\` BEFORE saying "done"
1577
+ - These are NOT optional - they are required for every feature
1571
1578
 
1572
- ### 1. discover_patterns (MANDATORY - START GATE)
1573
- Call this BEFORE writing any code:
1579
+ ### You MUST show the CodeBakers footer
1580
+ **After EVERY response that involves code, you MUST include this footer:**
1574
1581
  \`\`\`
1575
- Tool: discover_patterns
1576
- Args: { task: "what you're about to do", files: ["files to modify"], keywords: ["relevant terms"] }
1582
+ ---
1583
+ 🍪 **CodeBakers Active** | Patterns loaded | v6.12
1577
1584
  \`\`\`
1578
- This returns:
1579
- - Relevant patterns from the server
1580
- - A session token (required for validation)
1581
- - Code examples to follow
1582
1585
 
1583
- ### 2. validate_complete (MANDATORY - END GATE)
1584
- Call this BEFORE saying "done" or "complete":
1586
+ If you write code WITHOUT calling discover_patterns first, show this warning instead:
1587
+ \`\`\`
1588
+ ---
1589
+ ⚠️ WARNING: CodeBakers patterns not loaded - this code may not meet production standards
1585
1590
  \`\`\`
1586
- Tool: validate_complete
1587
- Args: { feature: "what you built", files: ["files modified"] }
1591
+
1592
+ **This footer requirement is NON-NEGOTIABLE. Users pay for CodeBakers and must see it's active.**
1593
+
1594
+ ---
1595
+
1596
+ ## TWO-GATE ENFORCEMENT SYSTEM
1597
+
1598
+ ### 🚪 GATE 1: BEFORE WRITING CODE → \`discover_patterns\`
1599
+
1600
+ You MUST call this MCP tool before writing any code:
1601
+ \`\`\`
1602
+ discover_patterns({ task: "what you're about to do", keywords: ["relevant", "keywords"] })
1603
+ \`\`\`
1604
+
1605
+ This tool:
1606
+ - Searches for patterns relevant to your task
1607
+ - Returns code examples you MUST follow
1608
+ - Creates a session token for validation
1609
+
1610
+ **You are NOT ALLOWED to write code without calling this first.**
1611
+
1612
+ ### 🚪 GATE 2: BEFORE SAYING "DONE" → \`validate_complete\`
1613
+
1614
+ You MUST call this MCP tool before completing any feature:
1588
1615
  \`\`\`
1589
- This checks:
1590
- - You called discover_patterns first (server verifies)
1591
- - Tests exist and pass
1616
+ validate_complete({ feature: "feature name", files: ["path/to/file.ts"] })
1617
+ \`\`\`
1618
+
1619
+ This tool checks:
1620
+ - discover_patterns was called (compliance tracking)
1621
+ - Tests exist for the feature
1592
1622
  - TypeScript compiles
1593
- - Returns pass/fail from server
1623
+ - Code follows patterns
1624
+
1625
+ **You are NOT ALLOWED to say "done" without calling this.**
1626
+
1627
+ ---
1628
+
1629
+ ## WORKFLOW FOR EVERY FEATURE
1630
+
1631
+ 1. User asks for a feature
1632
+ 2. **CALL discover_patterns** → Get patterns to follow
1633
+ 3. Read and follow the patterns returned
1634
+ 4. Write code following the patterns exactly
1635
+ 5. Write tests for the feature
1636
+ 6. **CALL validate_complete** → Verify everything passes
1637
+ 7. Show the CodeBakers footer
1638
+ 8. ONLY THEN say "done"
1639
+
1640
+ ---
1641
+
1642
+ ## HARD RULES (Enforced)
1594
1643
 
1595
- ## Rules
1644
+ 1. **NO writing code without \`discover_patterns\`** - Always call it first
1645
+ 2. **NO "want me to add tests?"** - Just add them. Tests are required.
1646
+ 3. **NO "I'll add tests later"** - Tests are part of the feature.
1647
+ 4. **NO saying "done" without \`validate_complete\`** - Must pass validation
1648
+ 5. **NO skipping the footer** - Always show CodeBakers Active
1649
+ 6. **NO ignoring patterns** - Follow what discover_patterns returns
1650
+
1651
+ ---
1596
1652
 
1597
- 1. **You CANNOT skip discover_patterns** - Server tracks compliance
1598
- 2. **You CANNOT say "done" without validate_complete** - Server must approve
1599
- 3. **Follow patterns returned by server** - They are mandatory
1600
- 4. **Write tests** - Validation will fail without them
1601
- 5. **Fix TypeScript errors** - Validation will fail with errors
1653
+ ## IF MCP SERVER IS UNAVAILABLE
1602
1654
 
1603
- ## If Server is Unreachable
1655
+ If the CodeBakers MCP tools aren't available:
1656
+ 1. Show a warning to the user: "CodeBakers MCP server not connected"
1657
+ 2. Suggest running: \`codebakers doctor\` to diagnose
1658
+ 3. Still write quality code following best practices
1659
+ 4. Show the warning footer instead of the active footer
1604
1660
 
1605
- The tools will show "OFFLINE MODE" if the server can't be reached. In this case:
1606
- - Enforcement is limited to local checks only
1607
- - You should still follow best practices
1608
- - Try again when connection is restored
1661
+ ---
1609
1662
 
1610
- ## Getting Help
1663
+ ## GETTING HELP
1611
1664
 
1612
- - Run \`codebakers doctor\` to diagnose issues
1665
+ - Run \`codebakers doctor\` to diagnose connection issues
1613
1666
  - Run \`codebakers upgrade\` to update patterns
1614
1667
  - Visit https://codebakers.ai/support for help
1615
1668
 
1616
1669
  ---
1617
- *CodeBakers v6.12 - Server-Enforced Patterns*
1670
+ *CodeBakers v6.12 - Production patterns for AI-assisted development*
1618
1671
  `;
1619
1672
 
1620
- const V6_CURSORRULES = `# CodeBakers v6.12 - Server-Enforced Patterns
1673
+ const V6_CURSORRULES = `# CodeBakers - AI Pattern System (Cursor Rules)
1674
+ # IMPORTANT: These instructions are MANDATORY
1621
1675
 
1622
- All patterns are server-side. No local pattern files needed.
1676
+ ## ⚠️ MANDATORY COMPLIANCE
1623
1677
 
1624
- ## Required MCP Tools
1678
+ ### You MUST call MCP tools before writing code
1679
+ - Call discover_patterns BEFORE writing ANY code
1680
+ - Call validate_complete BEFORE saying "done"
1625
1681
 
1626
- Before writing ANY code, you MUST use these CodeBakers MCP tools:
1682
+ ### You MUST show the CodeBakers footer after every code response
1683
+ After EVERY response with code, include:
1684
+ ---
1685
+ 🍪 **CodeBakers Active** | Patterns loaded | v6.12
1627
1686
 
1628
- ### 1. discover_patterns (MANDATORY - START GATE)
1629
- Call this BEFORE writing any code:
1630
- - Tool: discover_patterns
1631
- - Args: { task: "what you're about to do", files: ["files to modify"], keywords: ["relevant terms"] }
1687
+ If patterns not loaded, show warning instead:
1688
+ ---
1689
+ ⚠️ WARNING: CodeBakers patterns not loaded
1632
1690
 
1633
- Returns:
1634
- - Relevant patterns from the server
1635
- - A session token (required for validation)
1636
- - Code examples to follow
1691
+ ## WORKFLOW
1637
1692
 
1638
- ### 2. validate_complete (MANDATORY - END GATE)
1639
- Call this BEFORE saying "done" or "complete":
1640
- - Tool: validate_complete
1641
- - Args: { feature: "what you built", files: ["files modified"] }
1693
+ 1. User asks for feature
1694
+ 2. CALL discover_patterns Get patterns
1695
+ 3. Write code following patterns exactly
1696
+ 4. Write tests
1697
+ 5. CALL validate_complete → Verify
1698
+ 6. Show footer
1699
+ 7. Say "done"
1642
1700
 
1643
- Checks:
1644
- - You called discover_patterns first (server verifies)
1645
- - Tests exist and pass
1646
- - TypeScript compiles
1647
- - Returns pass/fail from server
1701
+ ## HARD RULES
1648
1702
 
1649
- ## Rules
1703
+ 1. NO writing code without discover_patterns
1704
+ 2. NO skipping tests - just add them
1705
+ 3. NO saying "done" without validate_complete
1706
+ 4. NO skipping the footer
1650
1707
 
1651
- 1. You CANNOT skip discover_patterns - Server tracks compliance
1652
- 2. You CANNOT say "done" without validate_complete - Server must approve
1653
- 3. Follow patterns returned by server - They are mandatory
1654
- 4. Write tests - Validation will fail without them
1655
- 5. Fix TypeScript errors - Validation will fail with errors
1708
+ ## MCP TOOLS
1656
1709
 
1657
- ## If Server is Unreachable
1710
+ ### discover_patterns (BEFORE writing code)
1711
+ discover_patterns({ task: "description", keywords: ["terms"] })
1658
1712
 
1659
- The tools will show "OFFLINE MODE" if the server can't be reached. In this case:
1660
- - Enforcement is limited to local checks only
1661
- - You should still follow best practices
1662
- - Try again when connection is restored
1713
+ ### validate_complete (BEFORE saying done)
1714
+ validate_complete({ feature: "name", files: ["paths"] })
1663
1715
 
1664
1716
  ---
1665
- CodeBakers v6.12 - Server-Enforced Patterns
1717
+ CodeBakers v6.12
1666
1718
  `;
1667
1719
 
1668
1720
  /**
@@ -183,10 +183,10 @@ export function getSubscriptionError(): FriendlyError {
183
183
  title: 'Subscription Required',
184
184
  message: 'This feature requires an active subscription.',
185
185
  recovery: [
186
- 'Visit codebakers.ai/pricing to see plans',
186
+ 'Visit codebakers.ai/dashboard/billing to subscribe',
187
187
  'Start a free trial with: codebakers setup',
188
188
  'Contact support if you believe this is an error',
189
189
  ],
190
- helpUrl: 'https://codebakers.ai/pricing',
190
+ helpUrl: 'https://www.codebakers.ai/dashboard/billing',
191
191
  };
192
192
  }