@musashishao/agent-kit 1.2.2 → 1.3.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.
- package/.agent/mcp-gateway/README.md +121 -0
- package/.agent/mcp-gateway/dist/index.d.ts +11 -0
- package/.agent/mcp-gateway/dist/index.js +504 -0
- package/.agent/mcp-gateway/dist/sync/debouncer.d.ts +56 -0
- package/.agent/mcp-gateway/dist/sync/debouncer.js +112 -0
- package/.agent/mcp-gateway/dist/sync/incremental_syncer.d.ts +58 -0
- package/.agent/mcp-gateway/dist/sync/incremental_syncer.js +172 -0
- package/.agent/mcp-gateway/dist/sync/index.d.ts +6 -0
- package/.agent/mcp-gateway/dist/sync/index.js +6 -0
- package/.agent/mcp-gateway/dist/sync/timestamp_checker.d.ts +69 -0
- package/.agent/mcp-gateway/dist/sync/timestamp_checker.js +169 -0
- package/.agent/mcp-gateway/package.json +28 -0
- package/.agent/mcp-gateway/src/index.ts +608 -0
- package/.agent/mcp-gateway/src/sync/debouncer.ts +129 -0
- package/.agent/mcp-gateway/src/sync/incremental_syncer.ts +237 -0
- package/.agent/mcp-gateway/src/sync/index.ts +7 -0
- package/.agent/mcp-gateway/src/sync/timestamp_checker.ts +194 -0
- package/.agent/scripts/ak_cli.py +533 -0
- package/.agent/scripts/setup_host.py +557 -0
- package/.agent/scripts/verify_install.py +174 -0
- package/.agent/skills/app-builder/SKILL.md +51 -1
- package/.agent/skills/app-builder/scripts/generate_ai_infra.py +510 -0
- package/.agent/skills/documentation-templates/SKILL.md +9 -1
- package/.agent/skills/documentation-templates/agents-template.md +202 -0
- package/.agent/skills/graph-mapper/SKILL.md +211 -0
- package/.agent/skills/graph-mapper/scripts/generate_graph.py +503 -0
- package/.agent/skills/rag-engineering/SKILL.md +342 -0
- package/.agent/skills/rag-engineering/chunking-strategies.md +229 -0
- package/.agent/skills/rag-engineering/contextual-retrieval.md +261 -0
- package/.agent/skills/rag-engineering/hybrid-search.md +356 -0
- package/.agent/skills/rag-engineering/scripts/chunk_code.py +606 -0
- package/.agent/templates/mcp_configs/claude_desktop.json +14 -0
- package/.agent/templates/mcp_configs/cursor.json +13 -0
- package/.agent/templates/mcp_configs/vscode.json +13 -0
- package/.agent/workflows/create.md +70 -2
- package/bin/cli.js +91 -0
- package/docs/AI_DATA_INFRASTRUCTURE.md +288 -0
- package/docs/CHANGELOG_AI_INFRA.md +111 -0
- package/package.json +7 -2
|
@@ -10,7 +10,7 @@ $ARGUMENTS
|
|
|
10
10
|
|
|
11
11
|
## Task
|
|
12
12
|
|
|
13
|
-
This command starts a new application creation process
|
|
13
|
+
This command starts a new application creation process with **AI-Ready Infrastructure**.
|
|
14
14
|
|
|
15
15
|
### Steps:
|
|
16
16
|
|
|
@@ -31,12 +31,67 @@ This command starts a new application creation process.
|
|
|
31
31
|
- `backend-specialist` → API
|
|
32
32
|
- `frontend-specialist` → UI
|
|
33
33
|
|
|
34
|
-
4. **
|
|
34
|
+
4. **AI Infrastructure Setup** ⭐ NEW
|
|
35
|
+
- Generate `AGENTS.md` using `documentation-templates/agents-template.md`
|
|
36
|
+
- Create `.agent/` directory structure:
|
|
37
|
+
```
|
|
38
|
+
.agent/
|
|
39
|
+
├── AGENTS.md # AI Navigation Map
|
|
40
|
+
├── graph.json # Dependency graph (generated)
|
|
41
|
+
└── rag/ # RAG data directory
|
|
42
|
+
└── chunks.json # Code chunks (generated later)
|
|
43
|
+
```
|
|
44
|
+
- Run `graph-mapper` script to generate initial dependency graph
|
|
45
|
+
- Configure `.cursor/mcp.json` or equivalent for MCP servers
|
|
46
|
+
|
|
47
|
+
5. **Preview**
|
|
35
48
|
- Start with `auto_preview.py` when complete
|
|
36
49
|
- Present URL to user
|
|
37
50
|
|
|
38
51
|
---
|
|
39
52
|
|
|
53
|
+
## AI Infrastructure Generation
|
|
54
|
+
|
|
55
|
+
After building the application, automatically generate:
|
|
56
|
+
|
|
57
|
+
### Step 4.1: Generate AGENTS.md
|
|
58
|
+
|
|
59
|
+
Create `AGENTS.md` in project root with:
|
|
60
|
+
- Project name and status
|
|
61
|
+
- Tech stack detected from package.json/requirements.txt
|
|
62
|
+
- Directory structure explanation
|
|
63
|
+
- Coding conventions based on detected linter config
|
|
64
|
+
- Available commands (from package.json scripts)
|
|
65
|
+
|
|
66
|
+
Template: `.agent/skills/documentation-templates/agents-template.md`
|
|
67
|
+
|
|
68
|
+
### Step 4.2: Generate Dependency Graph
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# Run graph-mapper to create dependency map
|
|
72
|
+
python .agent/skills/graph-mapper/scripts/generate_graph.py \
|
|
73
|
+
--src ./src \
|
|
74
|
+
--output .agent/graph.json \
|
|
75
|
+
--format both
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
This creates:
|
|
79
|
+
- `.agent/graph.json` - Machine-readable graph
|
|
80
|
+
- `.agent/graph.md` - Human-readable dependency docs
|
|
81
|
+
|
|
82
|
+
### Step 4.3: Setup RAG Structure
|
|
83
|
+
|
|
84
|
+
Create directory structure for future RAG indexing:
|
|
85
|
+
```
|
|
86
|
+
.agent/rag/
|
|
87
|
+
├── .gitkeep
|
|
88
|
+
└── README.md (instructions for chunking)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
The `rag-engineering` skill can later be used to index the codebase.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
40
95
|
## Usage Examples
|
|
41
96
|
|
|
42
97
|
```
|
|
@@ -57,3 +112,16 @@ If request is unclear, ask these questions:
|
|
|
57
112
|
- Who will use it?
|
|
58
113
|
|
|
59
114
|
Use defaults, add details later.
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Output Checklist
|
|
119
|
+
|
|
120
|
+
After `/create` completes, verify:
|
|
121
|
+
|
|
122
|
+
- [ ] Application code is generated
|
|
123
|
+
- [ ] `AGENTS.md` exists in project root
|
|
124
|
+
- [ ] `.agent/graph.json` exists with dependencies
|
|
125
|
+
- [ ] Preview is running and accessible
|
|
126
|
+
- [ ] User can continue development with AI assistance
|
|
127
|
+
|
package/bin/cli.js
CHANGED
|
@@ -37,6 +37,7 @@ ${colors.bright}Usage:${colors.reset}
|
|
|
37
37
|
|
|
38
38
|
${colors.bright}Commands:${colors.reset}
|
|
39
39
|
${colors.cyan}init${colors.reset} Install .agent folder into current project
|
|
40
|
+
${colors.cyan}ai${colors.reset} AI Infrastructure management (init, sync, status)
|
|
40
41
|
${colors.cyan}setup-codex${colors.reset} Sync workflows with Codex CLI slash commands
|
|
41
42
|
${colors.cyan}codex${colors.reset} Generate AGENTS.md for Codex CLI (use --template)
|
|
42
43
|
${colors.cyan}mcp${colors.reset} MCP server management (setup, list, build)
|
|
@@ -47,6 +48,12 @@ ${colors.bright}Commands:${colors.reset}
|
|
|
47
48
|
${colors.cyan}update${colors.reset} Update .agent folder to latest version
|
|
48
49
|
${colors.cyan}status${colors.reset} Check installation status
|
|
49
50
|
|
|
51
|
+
${colors.bright}AI Subcommands:${colors.reset}
|
|
52
|
+
${colors.cyan}ai init${colors.reset} Initialize AI infrastructure (AGENTS.md, Graph, RAG)
|
|
53
|
+
${colors.cyan}ai sync${colors.reset} Sync AI data after code changes
|
|
54
|
+
${colors.cyan}ai status${colors.reset} Show AI infrastructure status
|
|
55
|
+
${colors.cyan}ai config${colors.reset} Auto-configure AI hosts (Claude, Cursor, etc.)
|
|
56
|
+
|
|
50
57
|
${colors.bright}MCP Subcommands:${colors.reset}
|
|
51
58
|
${colors.cyan}mcp setup${colors.reset} Configure MCP servers for Claude/Cursor
|
|
52
59
|
${colors.cyan}mcp list${colors.reset} List available MCP servers
|
|
@@ -64,6 +71,8 @@ ${colors.bright}Options:${colors.reset}
|
|
|
64
71
|
|
|
65
72
|
${colors.bright}Examples:${colors.reset}
|
|
66
73
|
npx ${PACKAGE_NAME} init
|
|
74
|
+
npx ${PACKAGE_NAME} ai init # Setup AI infrastructure
|
|
75
|
+
npx ${PACKAGE_NAME} ai sync # Update after code changes
|
|
67
76
|
npx ${PACKAGE_NAME} mcp setup --client claude
|
|
68
77
|
npx ${PACKAGE_NAME} codex --template web
|
|
69
78
|
npx ${PACKAGE_NAME} doctor
|
|
@@ -517,6 +526,85 @@ function doctorCommand() {
|
|
|
517
526
|
}
|
|
518
527
|
}
|
|
519
528
|
|
|
529
|
+
// ============================================================================
|
|
530
|
+
// AI Infrastructure Command
|
|
531
|
+
// ============================================================================
|
|
532
|
+
|
|
533
|
+
function aiCommand(subArgs, options) {
|
|
534
|
+
const subCommand = subArgs[0];
|
|
535
|
+
const agentDir = path.join(process.cwd(), '.agent');
|
|
536
|
+
const cliScript = path.join(agentDir, 'scripts', 'ak_cli.py');
|
|
537
|
+
|
|
538
|
+
// Show help if no subcommand
|
|
539
|
+
if (!subCommand || subCommand === '--help' || subCommand === '-h') {
|
|
540
|
+
console.log(`
|
|
541
|
+
${colors.bright}${colors.cyan}🤖 Agent Kit AI Infrastructure${colors.reset}
|
|
542
|
+
|
|
543
|
+
${colors.bright}Subcommands:${colors.reset}
|
|
544
|
+
${colors.cyan}ai init${colors.reset} Initialize AI infrastructure (AGENTS.md, Graph, RAG)
|
|
545
|
+
${colors.cyan}ai sync${colors.reset} Sync AI data after code changes
|
|
546
|
+
${colors.cyan}ai status${colors.reset} Show AI infrastructure status
|
|
547
|
+
${colors.cyan}ai config${colors.reset} Auto-configure AI hosts (Claude, Cursor, etc.)
|
|
548
|
+
|
|
549
|
+
${colors.bright}Options:${colors.reset}
|
|
550
|
+
--force Force regenerate existing files
|
|
551
|
+
--target Sync target: all, graph, rag (for sync command)
|
|
552
|
+
|
|
553
|
+
${colors.bright}Examples:${colors.reset}
|
|
554
|
+
npx @musashishao/agent-kit ai init
|
|
555
|
+
npx @musashishao/agent-kit ai sync
|
|
556
|
+
npx @musashishao/agent-kit ai sync --target graph
|
|
557
|
+
npx @musashishao/agent-kit ai config --list
|
|
558
|
+
`);
|
|
559
|
+
return;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
// Check if CLI script exists
|
|
563
|
+
if (!fs.existsSync(cliScript)) {
|
|
564
|
+
log.error('AI CLI script not found. Make sure Agent Kit is properly installed.');
|
|
565
|
+
log.info('Run: npx @musashishao/agent-kit init');
|
|
566
|
+
process.exit(1);
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
// Build arguments for Python script
|
|
570
|
+
const pythonArgs = [cliScript, subCommand];
|
|
571
|
+
|
|
572
|
+
// Pass through relevant options
|
|
573
|
+
if (options.force) {
|
|
574
|
+
pythonArgs.push('--force');
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
// Find --target option
|
|
578
|
+
const targetIndex = subArgs.indexOf('--target');
|
|
579
|
+
if (targetIndex !== -1 && subArgs[targetIndex + 1]) {
|
|
580
|
+
pythonArgs.push('--target', subArgs[targetIndex + 1]);
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
// Find --list option
|
|
584
|
+
if (subArgs.includes('--list')) {
|
|
585
|
+
pythonArgs.push('--list');
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
// Find --copy option
|
|
589
|
+
if (subArgs.includes('--copy')) {
|
|
590
|
+
pythonArgs.push('--copy');
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
// Execute Python CLI
|
|
594
|
+
try {
|
|
595
|
+
const { spawnSync } = require('child_process');
|
|
596
|
+
const result = spawnSync('python3', pythonArgs, {
|
|
597
|
+
cwd: process.cwd(),
|
|
598
|
+
stdio: 'inherit',
|
|
599
|
+
});
|
|
600
|
+
|
|
601
|
+
process.exit(result.status || 0);
|
|
602
|
+
} catch (error) {
|
|
603
|
+
log.error(`Failed to run AI command: ${error.message}`);
|
|
604
|
+
process.exit(1);
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
|
|
520
608
|
// ============================================================================
|
|
521
609
|
// MCP Command
|
|
522
610
|
// ============================================================================
|
|
@@ -1251,6 +1339,9 @@ switch (command) {
|
|
|
1251
1339
|
case 'status':
|
|
1252
1340
|
statusCommand();
|
|
1253
1341
|
break;
|
|
1342
|
+
case 'ai':
|
|
1343
|
+
aiCommand(args.slice(1), options);
|
|
1344
|
+
break;
|
|
1254
1345
|
case '--version':
|
|
1255
1346
|
case '-v':
|
|
1256
1347
|
showVersion();
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
# AI Data Infrastructure - User Guide
|
|
2
|
+
|
|
3
|
+
> Transform your project into an "AI-Ready" smart repository with Agent Kit's integrated data infrastructure.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 🎯 Overview
|
|
8
|
+
|
|
9
|
+
Agent Kit provides a 4-layer AI Data Infrastructure that makes your project deeply understandable to AI agents:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
13
|
+
│ AI DATA INFRASTRUCTURE │
|
|
14
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
15
|
+
│ Layer 1: AGENTS.md → Project overview & navigation │
|
|
16
|
+
│ Layer 2: graph-mapper → Dependency relationships │
|
|
17
|
+
│ Layer 3: rag-engineering → Semantic code search │
|
|
18
|
+
│ Layer 4: MCP Gateway → Live connection to AI agents │
|
|
19
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 🚀 Quick Start
|
|
25
|
+
|
|
26
|
+
### For New Projects
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# Create a new project with AI infrastructure
|
|
30
|
+
npx @musashishao/agent-kit init
|
|
31
|
+
npx @musashishao/agent-kit ai init
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### For Existing Projects
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# Add AI infrastructure to existing project
|
|
38
|
+
cd your-project
|
|
39
|
+
npx @musashishao/agent-kit init
|
|
40
|
+
npx @musashishao/agent-kit ai init
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
After initialization, your project will have:
|
|
44
|
+
- `AGENTS.md` - AI navigation map
|
|
45
|
+
- `.agent/graph.json` - Dependency graph
|
|
46
|
+
- `.agent/mcp-gateway/` - MCP server for AI connectivity
|
|
47
|
+
- `.cursor/mcp.json` - Auto-configured for Cursor
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## 📋 Commands Reference
|
|
52
|
+
|
|
53
|
+
### `ai init`
|
|
54
|
+
Initialize AI infrastructure for your project.
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npx @musashishao/agent-kit ai init
|
|
58
|
+
npx @musashishao/agent-kit ai init --force # Regenerate existing files
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**What it does:**
|
|
62
|
+
1. Creates `.agent/` directory structure
|
|
63
|
+
2. Generates `AGENTS.md` with auto-detected tech stack
|
|
64
|
+
3. Builds dependency graph from your source code
|
|
65
|
+
4. Configures AI hosts (Claude, Cursor, VS Code)
|
|
66
|
+
|
|
67
|
+
### `ai sync`
|
|
68
|
+
Update AI data after code changes.
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
npx @musashishao/agent-kit ai sync # Sync everything
|
|
72
|
+
npx @musashishao/agent-kit ai sync --target graph # Sync only graph
|
|
73
|
+
npx @musashishao/agent-kit ai sync --target rag # Sync only RAG
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**When to use:**
|
|
77
|
+
- After significant code changes
|
|
78
|
+
- After adding/removing files
|
|
79
|
+
- Before major AI-assisted refactoring
|
|
80
|
+
|
|
81
|
+
### `ai status`
|
|
82
|
+
Show current AI infrastructure status.
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
npx @musashishao/agent-kit ai status
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**Output example:**
|
|
89
|
+
```
|
|
90
|
+
📊 Agent Kit Status
|
|
91
|
+
📦 Core Components:
|
|
92
|
+
✅ AGENTS.md
|
|
93
|
+
✅ MCP Gateway
|
|
94
|
+
✅ Dependency Graph
|
|
95
|
+
❌ RAG Chunks: Not found
|
|
96
|
+
|
|
97
|
+
⏰ Sync Status:
|
|
98
|
+
Last sync: 2026-01-24T16:50:00
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### `ai config`
|
|
102
|
+
Configure AI hosts to use Agent Kit.
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
npx @musashishao/agent-kit ai config # Auto-configure all
|
|
106
|
+
npx @musashishao/agent-kit ai config --list # List detected hosts
|
|
107
|
+
npx @musashishao/agent-kit ai config --copy # Copy config to clipboard
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## 🔧 How It Works
|
|
113
|
+
|
|
114
|
+
### Auto-Sync (Magic!)
|
|
115
|
+
|
|
116
|
+
When AI agents query your project through the MCP Gateway, the system automatically:
|
|
117
|
+
|
|
118
|
+
1. **Checks timestamps** - Are source files newer than cached data?
|
|
119
|
+
2. **Syncs if needed** - Only updates changed files (incremental)
|
|
120
|
+
3. **Debounces** - Prevents excessive syncing (30s cooldown)
|
|
121
|
+
4. **Returns fresh data** - AI always gets accurate information
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
AI asks "What does login.ts do?"
|
|
125
|
+
│
|
|
126
|
+
▼
|
|
127
|
+
MCP Gateway checks: Is data fresh?
|
|
128
|
+
│
|
|
129
|
+
┌───┴───┐
|
|
130
|
+
│ │
|
|
131
|
+
YES NO
|
|
132
|
+
│ │
|
|
133
|
+
▼ ▼
|
|
134
|
+
Return Auto-sync
|
|
135
|
+
cached changed files
|
|
136
|
+
data │
|
|
137
|
+
▼
|
|
138
|
+
Return fresh data
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Impact Analysis
|
|
142
|
+
|
|
143
|
+
Before editing a file, ask AI: "What will be affected if I change auth.ts?"
|
|
144
|
+
|
|
145
|
+
The system uses the dependency graph to show:
|
|
146
|
+
- Which files import `auth.ts`
|
|
147
|
+
- Which files import THOSE files
|
|
148
|
+
- Total impact radius
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## 📁 File Structure
|
|
153
|
+
|
|
154
|
+
After initialization, your project will have:
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
your-project/
|
|
158
|
+
├── AGENTS.md # AI navigation map (Layer 1)
|
|
159
|
+
├── .agent/
|
|
160
|
+
│ ├── graph.json # Dependency graph (Layer 2)
|
|
161
|
+
│ ├── graph.md # Human-readable dependencies
|
|
162
|
+
│ ├── mcp-gateway/ # MCP server (Layer 4)
|
|
163
|
+
│ │ ├── src/
|
|
164
|
+
│ │ └── dist/
|
|
165
|
+
│ ├── rag/ # RAG data (Layer 3)
|
|
166
|
+
│ │ └── chunks.json
|
|
167
|
+
│ ├── .cache/ # Sync timestamps
|
|
168
|
+
│ └── scripts/ # CLI scripts
|
|
169
|
+
├── .cursor/
|
|
170
|
+
│ └── mcp.json # Cursor MCP config
|
|
171
|
+
└── .vscode/
|
|
172
|
+
└── settings.json # VS Code MCP config (if applicable)
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## 🔌 MCP Tools Available
|
|
178
|
+
|
|
179
|
+
When connected via MCP, AI agents have access to:
|
|
180
|
+
|
|
181
|
+
| Tool | Description |
|
|
182
|
+
|------|-------------|
|
|
183
|
+
| `get_project_context` | Read project overview from AGENTS.md |
|
|
184
|
+
| `analyze_dependencies` | Get imports/exports for a file |
|
|
185
|
+
| `search_code_logic` | Semantic search through codebase |
|
|
186
|
+
| `get_impact_zone` | Find all affected files for a change |
|
|
187
|
+
| `force_sync` | Manually refresh all AI data |
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## 🎯 Best Practices
|
|
192
|
+
|
|
193
|
+
### 1. Keep AGENTS.md Updated
|
|
194
|
+
While auto-generated, customize `AGENTS.md` with:
|
|
195
|
+
- Current sprint focus
|
|
196
|
+
- Team conventions not in linter config
|
|
197
|
+
- Known gotchas
|
|
198
|
+
|
|
199
|
+
### 2. Sync Before Big Changes
|
|
200
|
+
```bash
|
|
201
|
+
npx @musashishao/agent-kit ai sync
|
|
202
|
+
```
|
|
203
|
+
Then ask AI to help with refactoring.
|
|
204
|
+
|
|
205
|
+
### 3. Use Impact Analysis
|
|
206
|
+
Before editing shared utilities:
|
|
207
|
+
```
|
|
208
|
+
Me: What happens if I change the Button component?
|
|
209
|
+
AI: [Uses get_impact_zone] Button is imported by 12 components...
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### 4. Trust the Auto-Sync
|
|
213
|
+
You don't need to manually sync after every save. The MCP Gateway handles this automatically when AI makes queries.
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## 🔍 Troubleshooting
|
|
218
|
+
|
|
219
|
+
### "MCP Gateway not found"
|
|
220
|
+
```bash
|
|
221
|
+
cd .agent/mcp-gateway
|
|
222
|
+
npm install
|
|
223
|
+
npm run build
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### "Dependency graph is empty"
|
|
227
|
+
Make sure you have a `src/` or `app/` directory with code files.
|
|
228
|
+
|
|
229
|
+
### "AI host not configured"
|
|
230
|
+
```bash
|
|
231
|
+
npx @musashishao/agent-kit ai config --copy
|
|
232
|
+
# Paste into your AI host's MCP settings
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### "Sync takes too long"
|
|
236
|
+
For large projects (100k+ LOC), initial sync may take 30-60 seconds. Subsequent syncs are incremental and faster.
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## 🏗️ Architecture
|
|
241
|
+
|
|
242
|
+
```
|
|
243
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
244
|
+
│ YOUR PROJECT │
|
|
245
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
246
|
+
│ │
|
|
247
|
+
│ Source Code AI Infrastructure │
|
|
248
|
+
│ ┌─────────┐ ┌────────────────────────────────────┐ │
|
|
249
|
+
│ │ src/ │◄────────►│ AGENTS.md (Navigation Map) │ │
|
|
250
|
+
│ │ app/ │ │ graph.json (Dependency Graph) │ │
|
|
251
|
+
│ │ lib/ │ │ rag/chunks.json (Code Chunks) │ │
|
|
252
|
+
│ └─────────┘ └────────────────────────────────────┘ │
|
|
253
|
+
│ ▲ │
|
|
254
|
+
│ │ │
|
|
255
|
+
│ ┌─────────────┴─────────────┐ │
|
|
256
|
+
│ │ MCP GATEWAY SERVER │ │
|
|
257
|
+
│ │ │ │
|
|
258
|
+
│ │ • Auto-sync on query │ │
|
|
259
|
+
│ │ • Debounced updates │ │
|
|
260
|
+
│ │ • Incremental changes │ │
|
|
261
|
+
│ └─────────────┬─────────────┘ │
|
|
262
|
+
│ │ │
|
|
263
|
+
└──────────────────────────────────────┼──────────────────────────┘
|
|
264
|
+
│ MCP Protocol
|
|
265
|
+
▼
|
|
266
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
267
|
+
│ AI HOSTS │
|
|
268
|
+
│ │
|
|
269
|
+
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
|
|
270
|
+
│ │ Claude │ │ Cursor │ │ Antigravity │ │
|
|
271
|
+
│ │ Desktop │ │ / Windsurf │ │ IDE / Codex │ │
|
|
272
|
+
│ └──────────────┘ └──────────────┘ └──────────────┘ │
|
|
273
|
+
│ │
|
|
274
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## 📚 Related Documentation
|
|
280
|
+
|
|
281
|
+
- [AGENTS.md Template](/.agent/skills/documentation-templates/agents-template.md)
|
|
282
|
+
- [Graph Mapper Skill](/.agent/skills/graph-mapper/SKILL.md)
|
|
283
|
+
- [RAG Engineering Skill](/.agent/skills/rag-engineering/SKILL.md)
|
|
284
|
+
- [MCP Builder Skill](/.agent/skills/mcp-builder/SKILL.md)
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
*Generated by Agent Kit v1.0.0*
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# AI Data Infrastructure - Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the AI Data Infrastructure are documented here.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## [1.0.0] - 2026-01-24
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
#### Phase 1: MCP Gateway Server Core
|
|
12
|
+
- Created MCP Gateway Server (`/.agent/mcp-gateway/`)
|
|
13
|
+
- Implemented 5 MCP tools:
|
|
14
|
+
- `get_project_context` - Read AGENTS.md sections
|
|
15
|
+
- `analyze_dependencies` - Query dependency graph
|
|
16
|
+
- `search_code_logic` - Semantic code search
|
|
17
|
+
- `get_impact_zone` - Find affected files for changes
|
|
18
|
+
- `force_sync` - Refresh all AI data
|
|
19
|
+
- TypeScript implementation with strict mode
|
|
20
|
+
- Compatible with Claude Desktop, Cursor, VS Code, Windsurf
|
|
21
|
+
|
|
22
|
+
#### Phase 2: Auto-Sync Engine
|
|
23
|
+
- `TimestampChecker` - Tracks file modification times
|
|
24
|
+
- `IncrementalSyncer` - Updates only changed files
|
|
25
|
+
- `Debouncer` - 30-second cooldown between syncs
|
|
26
|
+
- Integrated auto-sync into MCP tools
|
|
27
|
+
- Just-in-time data refresh on AI queries
|
|
28
|
+
|
|
29
|
+
#### Phase 3: Auto-Config System
|
|
30
|
+
- `setup_host.py` - Auto-configures AI hosts
|
|
31
|
+
- Config templates for Claude Desktop, Cursor, VS Code
|
|
32
|
+
- OS detection (Mac, Windows, Linux)
|
|
33
|
+
- Backup before modifying existing configs
|
|
34
|
+
- Clipboard copy for manual setup
|
|
35
|
+
- `verify_install.py` - Installation health check
|
|
36
|
+
|
|
37
|
+
#### Phase 4: CLI Wrapper
|
|
38
|
+
- `ak_cli.py` - Main CLI entry point
|
|
39
|
+
- Commands:
|
|
40
|
+
- `ai init` - Initialize AI infrastructure
|
|
41
|
+
- `ai sync` - Sync AI data
|
|
42
|
+
- `ai status` - Show infrastructure status
|
|
43
|
+
- `ai config` - Configure AI hosts
|
|
44
|
+
- Integrated into `bin/cli.js` as `ai` subcommand group
|
|
45
|
+
|
|
46
|
+
#### Phase 5: Documentation
|
|
47
|
+
- `docs/AI_DATA_INFRASTRUCTURE.md` - Comprehensive user guide
|
|
48
|
+
- Updated `ARCHITECTURE.md` with AI Infrastructure section
|
|
49
|
+
- Added skill references and documentation links
|
|
50
|
+
|
|
51
|
+
### New Skills Added
|
|
52
|
+
- `graph-mapper` - Lightweight Knowledge Graph generator
|
|
53
|
+
- `rag-engineering` - Smart code chunking and semantic search
|
|
54
|
+
- `documentation-templates/agents-template.md` - AGENTS.md template
|
|
55
|
+
|
|
56
|
+
### Updated Skills
|
|
57
|
+
- `app-builder` - Added AI Infrastructure generation step
|
|
58
|
+
- `documentation-templates` - Added AGENTS.md reference
|
|
59
|
+
|
|
60
|
+
### Updated Workflows
|
|
61
|
+
- `/create` - Now includes AI Infrastructure setup (Step 4)
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## File Summary
|
|
66
|
+
|
|
67
|
+
| Category | Files Created |
|
|
68
|
+
|----------|---------------|
|
|
69
|
+
| **MCP Gateway** | 8 files (`/mcp-gateway/src/`) |
|
|
70
|
+
| **Skills** | 9 files (`graph-mapper/`, `rag-engineering/`) |
|
|
71
|
+
| **Scripts** | 4 files (`ak_cli.py`, `setup_host.py`, etc.) |
|
|
72
|
+
| **Templates** | 4 files (`mcp_configs/`, `agents-template.md`) |
|
|
73
|
+
| **Documentation** | 2 files |
|
|
74
|
+
| **Total** | ~27 new files |
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Architecture
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
Agent Kit v5.0+ with AI Data Infrastructure
|
|
82
|
+
============================================
|
|
83
|
+
|
|
84
|
+
┌─────────────────────────────────────────┐
|
|
85
|
+
│ USER PROJECT │
|
|
86
|
+
└───────────────────┬─────────────────────┘
|
|
87
|
+
│
|
|
88
|
+
┌───────────────────▼─────────────────────┐
|
|
89
|
+
│ AI DATA INFRASTRUCTURE │
|
|
90
|
+
│ │
|
|
91
|
+
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
|
|
92
|
+
│ │AGENTS.md│ │ Graph │ │ RAG │ │
|
|
93
|
+
│ │ (Map) │ │ (KG) │ │(Chunks) │ │
|
|
94
|
+
│ └────┬────┘ └────┬────┘ └────┬────┘ │
|
|
95
|
+
│ └───────────┼───────────┘ │
|
|
96
|
+
│ │ │
|
|
97
|
+
│ ┌────────▼────────┐ │
|
|
98
|
+
│ │ MCP GATEWAY │ │
|
|
99
|
+
│ │ (Auto-Sync) │ │
|
|
100
|
+
│ └────────┬────────┘ │
|
|
101
|
+
└───────────────────┼─────────────────────┘
|
|
102
|
+
│ MCP Protocol
|
|
103
|
+
┌───────────────────▼─────────────────────┐
|
|
104
|
+
│ AI HOSTS │
|
|
105
|
+
│ Claude │ Cursor │ Windsurf │ Codex │
|
|
106
|
+
└─────────────────────────────────────────┘
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
*Documented by Agent Kit on 2026-01-24*
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@musashishao/agent-kit",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "AI Agent templates - Skills, Agents, Workflows, and
|
|
3
|
+
"version": "1.3.0",
|
|
4
|
+
"description": "AI Agent templates - Skills, Agents, Workflows, and AI-Ready Data Infrastructure Gateway",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"agent-kit": "./bin/cli.js",
|
|
@@ -9,9 +9,14 @@
|
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"bin",
|
|
12
|
+
"docs",
|
|
12
13
|
".agent/agents",
|
|
13
14
|
".agent/mcp",
|
|
15
|
+
".agent/mcp-gateway/dist",
|
|
16
|
+
".agent/mcp-gateway/package.json",
|
|
17
|
+
".agent/mcp-gateway/src",
|
|
14
18
|
".agent/rules",
|
|
19
|
+
".agent/scripts",
|
|
15
20
|
".agent/skills",
|
|
16
21
|
".agent/templates",
|
|
17
22
|
".agent/workflows",
|