@azerate/claudette-mcp 1.4.0 → 1.5.0

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.
Files changed (3) hide show
  1. package/README.md +33 -8
  2. package/dist/index.js +241 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -63,6 +63,9 @@ Add to `~/.claude.json`:
63
63
  | Tool | Description |
64
64
  |------|-------------|
65
65
  | `get_changes` | Get pending git changes (modified, added, deleted files) |
66
+ | `get_branch_info` | Get current branch, behind/ahead status, sync state |
67
+ | `create_branch` | Create a new feature branch from main/master |
68
+ | `sync_branch` | Rebase or merge current branch with main |
66
69
  | `get_checkpoints` | List saved checkpoints (git stash snapshots) |
67
70
  | `create_checkpoint` | Create a checkpoint before risky changes |
68
71
  | `restore_checkpoint` | Restore workspace to a previous checkpoint |
@@ -77,6 +80,8 @@ Add to `~/.claude.json`:
77
80
  | `generate_commit_message` | Generate a commit message from changes |
78
81
  | `approve_commit` | Stage and commit with the provided message |
79
82
  | `approve_push` | Push committed changes to remote |
83
+ | `approve_write_tests` | Mark the write tests step as complete |
84
+ | `approve_code_review` | Mark the code review step as complete |
80
85
 
81
86
  ### Project Memory
82
87
 
@@ -111,26 +116,46 @@ Add to `~/.claude.json`:
111
116
 
112
117
  ## Workflow Pipeline
113
118
 
114
- The workflow feature provides a guided development process:
119
+ The workflow feature provides a 10-step guided development process with best-practice Git support:
115
120
 
116
121
  ```
117
122
  trigger_workflow()
118
123
  |
119
124
  v
120
- [AUTOMATIC]
121
- 1. Lint (with auto-fix)
122
- 2. Type checking
125
+ [AUTOMATIC CHECKS]
126
+ 1. Type checking (tsc --noEmit)
127
+ 2. Lint/Format (eslint --fix)
123
128
  3. Run tests
124
- 4. Coverage analysis
129
+ 4. Coverage analysis (files needing tests)
125
130
  5. Benchmarks (optional)
126
131
  |
127
132
  v
128
133
  [HUMAN GATES]
129
- 6. Review & Commit (approve_commit)
130
- 7. Push (approve_push)
131
- 8. Create PR
134
+ 6. Write Tests (if coverage found gaps)
135
+ 7. Commit (approve_commit)
136
+ 8. Push (approve_push)
137
+ 9. Create PR (skipped if on main)
138
+ 10. Code Review (approve_code_review)
132
139
  ```
133
140
 
141
+ ### Branch Management
142
+
143
+ Best practice: Work on feature branches, not directly on main.
144
+
145
+ ```
146
+ # Check current branch status
147
+ get_branch_info(workspace_path="/path/to/project")
148
+
149
+ # Create a feature branch
150
+ create_branch(workspace_path="/path/to/project", branch_name="feature/my-feature")
151
+
152
+ # Sync with latest main (rebase)
153
+ sync_branch(workspace_path="/path/to/project", method="rebase")
154
+ ```
155
+
156
+ The workflow enforces feature branch usage by default (`requireFeatureBranch: true`).
157
+ Toggle this in the UI or set in `.claudette/workflow-config.json`.
158
+
134
159
  ## Example Usage
135
160
 
136
161
  ```
package/dist/index.js CHANGED
@@ -521,6 +521,97 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
521
521
  required: ["workspace_path"],
522
522
  },
523
523
  },
524
+ {
525
+ name: "approve_write_tests",
526
+ description: "Mark the write tests step as complete after tests have been written for uncovered files.",
527
+ inputSchema: {
528
+ type: "object",
529
+ properties: {
530
+ workspace_path: {
531
+ type: "string",
532
+ description: "Path to the workspace directory",
533
+ },
534
+ tests_written: {
535
+ type: "number",
536
+ description: "Number of test files written",
537
+ },
538
+ },
539
+ required: ["workspace_path", "tests_written"],
540
+ },
541
+ },
542
+ {
543
+ name: "approve_code_review",
544
+ description: "Mark the code review step as complete after the PR has been reviewed and approved.",
545
+ inputSchema: {
546
+ type: "object",
547
+ properties: {
548
+ workspace_path: {
549
+ type: "string",
550
+ description: "Path to the workspace directory",
551
+ },
552
+ reviewer: {
553
+ type: "string",
554
+ description: "Name of the reviewer (optional)",
555
+ },
556
+ },
557
+ required: ["workspace_path"],
558
+ },
559
+ },
560
+ {
561
+ name: "get_branch_info",
562
+ description: "Get current git branch information including branch name, whether it's main/master, and behind/ahead counts relative to origin and main branch.",
563
+ inputSchema: {
564
+ type: "object",
565
+ properties: {
566
+ workspace_path: {
567
+ type: "string",
568
+ description: "Path to the workspace directory",
569
+ },
570
+ fetch: {
571
+ type: "boolean",
572
+ description: "Whether to fetch from remote first (slower but more accurate). Default: false",
573
+ },
574
+ },
575
+ required: ["workspace_path"],
576
+ },
577
+ },
578
+ {
579
+ name: "create_branch",
580
+ description: "Create a new feature branch from main/master. Best practice: always create feature branches for new work instead of committing directly to main.",
581
+ inputSchema: {
582
+ type: "object",
583
+ properties: {
584
+ workspace_path: {
585
+ type: "string",
586
+ description: "Path to the workspace directory",
587
+ },
588
+ branch_name: {
589
+ type: "string",
590
+ description: "Name for the new branch (e.g., 'feature/add-login', 'fix/button-alignment')",
591
+ },
592
+ },
593
+ required: ["workspace_path", "branch_name"],
594
+ },
595
+ },
596
+ {
597
+ name: "sync_branch",
598
+ description: "Sync current branch with main/master by rebasing or merging. Use when your branch is behind main to incorporate latest changes.",
599
+ inputSchema: {
600
+ type: "object",
601
+ properties: {
602
+ workspace_path: {
603
+ type: "string",
604
+ description: "Path to the workspace directory",
605
+ },
606
+ method: {
607
+ type: "string",
608
+ enum: ["rebase", "merge"],
609
+ description: "Sync method: 'rebase' (cleaner history, default) or 'merge' (preserves branch history)",
610
+ },
611
+ },
612
+ required: ["workspace_path"],
613
+ },
614
+ },
524
615
  ],
525
616
  };
526
617
  });
@@ -1341,6 +1432,156 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
1341
1432
  return { content: [{ type: "text", text: `Error pushing changes: ${err.message}` }] };
1342
1433
  }
1343
1434
  }
1435
+ case "approve_write_tests": {
1436
+ const workspacePath = args?.workspace_path;
1437
+ const testsWritten = args?.tests_written;
1438
+ if (!workspacePath) {
1439
+ return { content: [{ type: "text", text: "Error: workspace_path is required" }] };
1440
+ }
1441
+ if (testsWritten === undefined) {
1442
+ return { content: [{ type: "text", text: "Error: tests_written is required" }] };
1443
+ }
1444
+ try {
1445
+ const response = await fetch(`${CLAUDETTE_API}/api/workflow/write-tests`, {
1446
+ method: "POST",
1447
+ headers: { "Content-Type": "application/json" },
1448
+ body: JSON.stringify({ path: workspacePath, testsWritten }),
1449
+ });
1450
+ const result = await response.json();
1451
+ if (result.status === 'passed') {
1452
+ return { content: [{ type: "text", text: `✅ Write tests step complete!\n\nTests written: ${result.testsWritten}\n\nWorkflow advanced to commit stage.` }] };
1453
+ }
1454
+ else {
1455
+ return { content: [{ type: "text", text: `❌ Failed: ${result.error}` }] };
1456
+ }
1457
+ }
1458
+ catch (err) {
1459
+ return { content: [{ type: "text", text: `Error: ${err.message}` }] };
1460
+ }
1461
+ }
1462
+ case "approve_code_review": {
1463
+ const workspacePath = args?.workspace_path;
1464
+ const reviewer = args?.reviewer;
1465
+ if (!workspacePath) {
1466
+ return { content: [{ type: "text", text: "Error: workspace_path is required" }] };
1467
+ }
1468
+ try {
1469
+ const response = await fetch(`${CLAUDETTE_API}/api/workflow/code-review`, {
1470
+ method: "POST",
1471
+ headers: { "Content-Type": "application/json" },
1472
+ body: JSON.stringify({ path: workspacePath, reviewer }),
1473
+ });
1474
+ const result = await response.json();
1475
+ if (result.status === 'passed') {
1476
+ return { content: [{ type: "text", text: `✅ Code review approved!\n\n${result.reviewer ? `Reviewer: ${result.reviewer}\n` : ''}Workflow complete.` }] };
1477
+ }
1478
+ else {
1479
+ return { content: [{ type: "text", text: `❌ Failed: ${result.error}` }] };
1480
+ }
1481
+ }
1482
+ catch (err) {
1483
+ return { content: [{ type: "text", text: `Error: ${err.message}` }] };
1484
+ }
1485
+ }
1486
+ case "get_branch_info": {
1487
+ const workspacePath = args?.workspace_path;
1488
+ const doFetch = args?.fetch ?? false;
1489
+ if (!workspacePath) {
1490
+ return { content: [{ type: "text", text: "Error: workspace_path is required" }] };
1491
+ }
1492
+ try {
1493
+ const response = await fetch(`${CLAUDETTE_API}/api/workflow/branch?path=${encodeURIComponent(workspacePath)}&fetch=${doFetch}`);
1494
+ const info = await response.json();
1495
+ let output = `Branch Info\n${'='.repeat(50)}\n\n`;
1496
+ output += `Current Branch: ${info.current}\n`;
1497
+ output += `Is Main/Master: ${info.isMain ? 'Yes' : 'No'}\n`;
1498
+ output += `Main Branch: ${info.mainBranch}\n`;
1499
+ output += `Has Remote Tracking: ${info.hasRemote ? 'Yes' : 'No'}\n`;
1500
+ if (!info.isMain) {
1501
+ output += `\nSync Status:\n`;
1502
+ output += `────────────────────────────────────────\n`;
1503
+ if (info.behindMain > 0) {
1504
+ output += `⚠️ Behind ${info.mainBranch}: ${info.behindMain} commit(s)\n`;
1505
+ output += ` Run sync_branch to update\n`;
1506
+ }
1507
+ else {
1508
+ output += `✅ Up to date with ${info.mainBranch}\n`;
1509
+ }
1510
+ }
1511
+ if (info.hasRemote) {
1512
+ output += `\nRemote Status:\n`;
1513
+ output += `────────────────────────────────────────\n`;
1514
+ if (info.behindRemote > 0) {
1515
+ output += `⚠️ Behind origin: ${info.behindRemote} commit(s) - pull needed\n`;
1516
+ }
1517
+ if (info.aheadRemote > 0) {
1518
+ output += `📤 Ahead of origin: ${info.aheadRemote} commit(s) - push needed\n`;
1519
+ }
1520
+ if (info.behindRemote === 0 && info.aheadRemote === 0) {
1521
+ output += `✅ In sync with origin\n`;
1522
+ }
1523
+ }
1524
+ if (info.isMain) {
1525
+ output += `\n⚠️ Best Practice: Create a feature branch instead of committing to ${info.mainBranch}\n`;
1526
+ output += ` Use create_branch to start a new feature branch\n`;
1527
+ }
1528
+ return { content: [{ type: "text", text: output }] };
1529
+ }
1530
+ catch (err) {
1531
+ return { content: [{ type: "text", text: `Error: ${err.message}` }] };
1532
+ }
1533
+ }
1534
+ case "create_branch": {
1535
+ const workspacePath = args?.workspace_path;
1536
+ const branchName = args?.branch_name;
1537
+ if (!workspacePath) {
1538
+ return { content: [{ type: "text", text: "Error: workspace_path is required" }] };
1539
+ }
1540
+ if (!branchName) {
1541
+ return { content: [{ type: "text", text: "Error: branch_name is required" }] };
1542
+ }
1543
+ try {
1544
+ const response = await fetch(`${CLAUDETTE_API}/api/workflow/branch`, {
1545
+ method: "POST",
1546
+ headers: { "Content-Type": "application/json" },
1547
+ body: JSON.stringify({ path: workspacePath, name: branchName }),
1548
+ });
1549
+ const result = await response.json();
1550
+ if (result.success) {
1551
+ return { content: [{ type: "text", text: `✅ Created and switched to branch: ${result.branch}\n\nYou can now make changes and commit to this branch.` }] };
1552
+ }
1553
+ else {
1554
+ return { content: [{ type: "text", text: `❌ Failed to create branch: ${result.error}` }] };
1555
+ }
1556
+ }
1557
+ catch (err) {
1558
+ return { content: [{ type: "text", text: `Error: ${err.message}` }] };
1559
+ }
1560
+ }
1561
+ case "sync_branch": {
1562
+ const workspacePath = args?.workspace_path;
1563
+ const method = args?.method ?? 'rebase';
1564
+ if (!workspacePath) {
1565
+ return { content: [{ type: "text", text: "Error: workspace_path is required" }] };
1566
+ }
1567
+ try {
1568
+ const response = await fetch(`${CLAUDETTE_API}/api/workflow/sync`, {
1569
+ method: "POST",
1570
+ headers: { "Content-Type": "application/json" },
1571
+ body: JSON.stringify({ path: workspacePath, method }),
1572
+ });
1573
+ const result = await response.json();
1574
+ if (result.success) {
1575
+ return { content: [{ type: "text", text: `✅ Branch synced successfully using ${method}!\n\nYour branch is now up to date with main.` }] };
1576
+ }
1577
+ else {
1578
+ return { content: [{ type: "text", text: `❌ Sync failed: ${result.error}` }] };
1579
+ }
1580
+ }
1581
+ catch (err) {
1582
+ return { content: [{ type: "text", text: `Error: ${err.message}` }] };
1583
+ }
1584
+ }
1344
1585
  default:
1345
1586
  return { content: [{ type: "text", text: `Unknown tool: ${name}` }] };
1346
1587
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azerate/claudette-mcp",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "MCP server for Claudette IDE - TypeScript errors, git changes, checkpoints, memory, and script management",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",