@musashishao/agent-kit 1.9.0 → 1.9.1

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 (125) hide show
  1. package/.agent/agents/ai-asset-factory.md +700 -0
  2. package/.agent/agents/ai-audio-factory.md +503 -0
  3. package/.agent/agents/game-developer.md +4 -4
  4. package/.agent/agents/orchestrator.md +113 -3
  5. package/.agent/agents/project-planner.md +67 -0
  6. package/.agent/agents/unity-mobile-master.md +949 -0
  7. package/.agent/mcp/config/registry.json +65 -51
  8. package/.agent/mcp/servers/notebooklm/README.md +114 -0
  9. package/.agent/mcp/servers/notebooklm/package.json +35 -0
  10. package/.agent/mcp/servers/notebooklm/src/auth/chrome.ts +225 -0
  11. package/.agent/mcp/servers/notebooklm/src/auth/index.ts +1 -0
  12. package/.agent/mcp/servers/notebooklm/src/index.ts +516 -0
  13. package/.agent/mcp/servers/notebooklm/src/services/index.ts +3 -0
  14. package/.agent/mcp/servers/notebooklm/src/services/library.ts +217 -0
  15. package/.agent/mcp/servers/notebooklm/src/services/notebooklm.ts +380 -0
  16. package/.agent/mcp/servers/notebooklm/tsconfig.json +15 -0
  17. package/.agent/mcp-gateway/README.md +169 -20
  18. package/.agent/mcp-gateway/package.json +22 -7
  19. package/.agent/mcp-gateway/src/auth/index.ts +55 -0
  20. package/.agent/mcp-gateway/src/auth/middleware.ts +242 -0
  21. package/.agent/mcp-gateway/src/auth/oauth.ts +462 -0
  22. package/.agent/mcp-gateway/src/auth/scopes.ts +227 -0
  23. package/.agent/mcp-gateway/src/index.ts +252 -105
  24. package/.agent/mcp-gateway/src/observability/index.ts +5 -0
  25. package/.agent/mcp-gateway/src/observability/otel.ts +405 -0
  26. package/.agent/mcp-gateway/src/transports/index.ts +5 -0
  27. package/.agent/mcp-gateway/src/transports/streamableHttp.ts +235 -0
  28. package/.agent/rules/CODEX.md +89 -0
  29. package/.agent/rules/CODE_RULES.md +73 -0
  30. package/.agent/rules/GEMINI.md +25 -0
  31. package/.agent/rules/MEMORY_STATE.md +110 -0
  32. package/.agent/rules/REFERENCE.md +33 -141
  33. package/.agent/rules/REF_SKILLS.md +116 -0
  34. package/.agent/rules/REF_WORKFLOWS.md +81 -0
  35. package/.agent/scripts/ak_cli.py +106 -5
  36. package/.agent/scripts/memory_manager.py +48 -9
  37. package/.agent/skills/anti-hallucination/SKILL.md +295 -0
  38. package/.agent/skills/anti-hallucination/scripts/check_hallucination.py +299 -0
  39. package/.agent/skills/bifurcation-analysis/SKILL.md +56 -0
  40. package/.agent/skills/brainstorming/SKILL.md +80 -6
  41. package/.agent/skills/decision-memory/SKILL.md +317 -0
  42. package/.agent/skills/emergence-detector/SKILL.md +230 -0
  43. package/.agent/skills/emergence-detector/scripts/check_emergence.py +265 -0
  44. package/.agent/skills/explained-qa/SKILL.md +142 -0
  45. package/.agent/skills/explained-qa/game-terminology.md +214 -0
  46. package/.agent/skills/game-development/ai-dialogue-engine/SKILL.md +442 -0
  47. package/.agent/skills/game-development/ai-graphics-generator/SKILL.md +463 -0
  48. package/.agent/skills/game-development/ai-playtest-framework/SKILL.md +570 -0
  49. package/.agent/skills/game-development/camera-systems/SKILL.md +607 -0
  50. package/.agent/skills/game-development/card-battle-engine/SKILL.md +618 -0
  51. package/.agent/skills/game-development/character-controller-3d/SKILL.md +908 -0
  52. package/.agent/skills/game-development/cloud-save-sync/SKILL.md +527 -0
  53. package/.agent/skills/game-development/combat-system/SKILL.md +748 -0
  54. package/.agent/skills/game-development/compliance-rating/SKILL.md +277 -0
  55. package/.agent/skills/game-development/crossplatform-build/SKILL.md +386 -0
  56. package/.agent/skills/game-development/cultivation-progression/SKILL.md +520 -0
  57. package/.agent/skills/game-development/data-driven-balance/SKILL.md +535 -0
  58. package/.agent/skills/game-development/game-analytics-integrator/SKILL.md +410 -0
  59. package/.agent/skills/game-development/game-audio-advanced/SKILL.md +646 -0
  60. package/.agent/skills/game-development/game-economy-designer/SKILL.md +375 -0
  61. package/.agent/skills/game-development/game-marketing/SKILL.md +85 -0
  62. package/.agent/skills/game-development/game-state-manager/SKILL.md +883 -0
  63. package/.agent/skills/game-development/hybrid-game-spec/SKILL.md +220 -0
  64. package/.agent/skills/game-development/inventory-quest/SKILL.md +747 -0
  65. package/.agent/skills/game-development/liveops/SKILL.md +308 -0
  66. package/.agent/skills/game-development/localization/SKILL.md +286 -0
  67. package/.agent/skills/game-development/mobile-input-patterns/SKILL.md +343 -0
  68. package/.agent/skills/game-development/monetization-strategy/SKILL.md +94 -0
  69. package/.agent/skills/game-development/multiplayer-master/SKILL.md +727 -0
  70. package/.agent/skills/game-development/narrative-branching/SKILL.md +593 -0
  71. package/.agent/skills/game-development/procedural-level-ai/SKILL.md +367 -0
  72. package/.agent/skills/game-development/prototyping-rapid/SKILL.md +205 -0
  73. package/.agent/skills/game-development/spec-ecosystem/SKILL.md +155 -0
  74. package/.agent/skills/game-development/spec-ecosystem/decision-log-format.md +129 -0
  75. package/.agent/skills/game-development/spec-ecosystem/templates/PLAN-template.md +178 -0
  76. package/.agent/skills/game-development/spec-ecosystem/templates/SPEC-template.md +110 -0
  77. package/.agent/skills/game-development/spec-ecosystem/templates/TASKS-template.md +156 -0
  78. package/.agent/skills/game-development/survival-systems/SKILL.md +493 -0
  79. package/.agent/skills/game-development/testing-qa/SKILL.md +270 -0
  80. package/.agent/skills/game-development/unity-mobile-optimization/SKILL.md +271 -0
  81. package/.agent/skills/intent-capture/SKILL.md +65 -0
  82. package/.agent/skills/mcp-composition/SKILL.md +362 -0
  83. package/.agent/skills/mcp-observability/SKILL.md +323 -0
  84. package/.agent/skills/mcp-security/SKILL.md +314 -0
  85. package/.agent/skills/trust-spectrum/SKILL.md +291 -0
  86. package/.agent/skills/vibe-coding-guard/SKILL.md +328 -0
  87. package/.agent/templates/AGENTS.game.md +63 -0
  88. package/.agent/templates/docs/WORKFLOW_GUIDE.en.md +100 -0
  89. package/.agent/templates/docs/WORKFLOW_GUIDE.vi.md +100 -0
  90. package/.agent/workflows/ai-agent.md +2 -0
  91. package/.agent/workflows/autofix.md +1 -0
  92. package/.agent/workflows/brainstorm.md +1 -0
  93. package/.agent/workflows/context.md +1 -0
  94. package/.agent/workflows/create.md +39 -8
  95. package/.agent/workflows/dashboard.md +1 -0
  96. package/.agent/workflows/debug.md +14 -0
  97. package/.agent/workflows/deploy.md +14 -0
  98. package/.agent/workflows/enhance.md +44 -0
  99. package/.agent/workflows/gamekit-init.md +177 -0
  100. package/.agent/workflows/gamekit-launch.md +338 -0
  101. package/.agent/workflows/gamekit-plan.md +204 -0
  102. package/.agent/workflows/gamekit-qa.md +153 -0
  103. package/.agent/workflows/gamekit-spec.md +243 -0
  104. package/.agent/workflows/gamekit-tasks.md +208 -0
  105. package/.agent/workflows/marketing.md +2 -0
  106. package/.agent/workflows/next.md +1 -0
  107. package/.agent/workflows/orchestrate.md +12 -0
  108. package/.agent/workflows/pentest.md +2 -0
  109. package/.agent/workflows/plan.md +42 -0
  110. package/.agent/workflows/preview.md +1 -0
  111. package/.agent/workflows/quality.md +1 -0
  112. package/.agent/workflows/saas.md +2 -0
  113. package/.agent/workflows/spec.md +42 -0
  114. package/.agent/workflows/status.md +1 -0
  115. package/.agent/workflows/test.md +14 -0
  116. package/.agent/workflows/ui-ux-pro-max.md +1 -0
  117. package/bin/cli.js +411 -111
  118. package/package.json +1 -2
  119. package/.agent/agents/game-asset-curator.md +0 -317
  120. package/.agent/agents/game-narrative-designer.md +0 -310
  121. package/.agent/agents/game-qa-agent.md +0 -441
  122. package/.agent/workflows/game-prototype.md +0 -154
  123. package/docs/AI_DATA_INFRASTRUCTURE.md +0 -288
  124. package/docs/CHANGELOG_AI_INFRA.md +0 -141
  125. package/docs/MIGRATION_GUIDE_V1.9.md +0 -55
package/bin/cli.js CHANGED
@@ -28,62 +28,182 @@ const log = {
28
28
  title: (msg) => console.log(`\n${colors.bright}${colors.magenta}${msg}${colors.reset}\n`)
29
29
  };
30
30
 
31
- function showHelp() {
32
- console.log(`
33
- ${colors.bright}${colors.cyan}🚀 Musa Agent Kit${colors.reset} v${VERSION}
34
-
35
- ${colors.bright}Usage:${colors.reset}
36
- npx ${PACKAGE_NAME} <command> [options]
37
-
38
- ${colors.bright}Commands:${colors.reset}
39
- ${colors.cyan}init${colors.reset} Install .agent folder into current project
40
- ${colors.cyan}ai${colors.reset} AI Infrastructure management (init, sync, status)
41
- ${colors.cyan}setup-codex${colors.reset} Sync workflows with Codex CLI slash commands
42
- ${colors.cyan}codex${colors.reset} Generate AGENTS.md for Codex CLI (use --template)
43
- ${colors.cyan}mcp${colors.reset} MCP server management (setup, list, build)
44
- ${colors.cyan}agents${colors.reset} List all available agents
45
- ${colors.cyan}skills${colors.reset} List all available skills
46
- ${colors.cyan}workflows${colors.reset} List all available workflows
47
- ${colors.cyan}doctor${colors.reset} Check configuration and diagnose issues
48
- ${colors.cyan}update${colors.reset} Update .agent folder to latest version
49
- ${colors.cyan}status${colors.reset} Check installation status
50
- ${colors.cyan}set-lang${colors.reset} Set Agent language (vi/en)
51
-
52
- ${colors.bright}AI Subcommands:${colors.reset}
53
- ${colors.cyan}ai init${colors.reset} Initialize AI infrastructure (AGENTS.md, Graph, RAG)
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
- ${colors.cyan}ai memory${colors.reset} Manage JSON memory (session, user, brain)
57
- ${colors.cyan}ai autofix${colors.reset} Autonomous repair loop (Run-Analyze-Fix)
58
- ${colors.cyan}ai dashboard${colors.reset} Open visual AI brain dashboard
31
+ // ============ TRANSLATIONS ============
32
+ const translations = {
33
+ en: {
34
+ title: '🚀 Musa Agent Kit',
35
+ usage: 'Usage:',
36
+ usageText: ` npx ${PACKAGE_NAME} <command> [options]`,
37
+ commands: 'Commands:',
38
+ init: 'Install .agent folder into current project',
39
+ ai: 'AI Infrastructure management (init, sync, status)',
40
+ setupCodex: 'Sync workflows with Codex CLI slash commands',
41
+ codex: 'Generate AGENTS.md for Codex CLI (use --template)',
42
+ mcp: 'MCP server management (setup, list, build)',
43
+ agents: 'List all available agents',
44
+ skills: 'List all available skills',
45
+ workflows: 'List all available workflows',
46
+ doctor: 'Check configuration and diagnose issues',
47
+ update: 'Update .agent folder to latest version',
48
+ status: 'Check installation status',
49
+ setLang: 'Set Agent language (vi/en)',
50
+ aiSubcommands: 'AI Subcommands:',
51
+ aiInit: 'Initialize AI infrastructure (AGENTS.md, Graph, RAG)',
52
+ aiStatus: 'Show AI infrastructure status',
53
+ aiConfig: 'Auto-configure AI hosts (Claude, Cursor, etc.)',
54
+ aiMemory: 'Manage JSON memory (session, user, brain)',
55
+ aiAutofix: 'Autonomous repair loop (Run-Analyze-Fix)',
56
+ aiDashboard: 'Open visual AI brain dashboard',
57
+ mcpSubcommands: 'MCP Subcommands:',
58
+ mcpSetup: 'Configure MCP servers for Claude/Cursor',
59
+ mcpList: 'List available MCP servers',
60
+ mcpBuild: 'Build MCP servers',
61
+ options: 'Options:',
62
+ optForce: 'Overwrite existing files',
63
+ optPath: 'Install in specific directory',
64
+ optPrefix: 'Custom prefix for slash commands (default: kit-)',
65
+ optTemplate: 'Template type: web, mobile, backend (for codex command)',
66
+ optClient: 'MCP client: claude, cursor (for mcp setup)',
67
+ optQuiet: 'Suppress output',
68
+ optHelp: 'Show this help message',
69
+ optVersion: 'Show version',
70
+ examples: 'Examples:',
71
+ exInit: 'npx @musashishao/agent-kit init',
72
+ exAiInit: 'Setup AI infrastructure',
73
+ exAiSync: 'Update after code changes',
74
+ exAiMemory: 'View session status',
75
+ exAiAutofix: 'Run autonomous fix',
76
+ exMcpSetup: 'npx @musashishao/agent-kit mcp setup --client claude',
77
+ exCodex: 'npx @musashishao/agent-kit codex --template web',
78
+ exDoctor: 'npx @musashishao/agent-kit doctor',
79
+ exSetLang: 'Switch to Vietnamese',
80
+ latestVersion: 'To ensure you have the latest version from NPM:'
81
+ },
82
+ vi: {
83
+ title: '🚀 Musa Agent Kit',
84
+ usage: 'Cách dùng:',
85
+ usageText: ` npx ${PACKAGE_NAME} <lệnh> [tùy chọn]`,
86
+ commands: 'Danh sách lệnh:',
87
+ init: 'Cài đặt thư mục .agent vào project hiện tại',
88
+ ai: 'Quản lý hạ tầng AI (init, sync, status)',
89
+ setupCodex: 'Đồng bộ workflow với slash commands của Codex CLI',
90
+ codex: 'Tạo file AGENTS.md cho Codex CLI (dùng --template)',
91
+ mcp: 'Quản lý MCP server (setup, list, build)',
92
+ agents: 'Liệt kê danh sách Agent hiện có',
93
+ skills: 'Liệt kê danh sách Skill hiện có',
94
+ workflows: 'Liệt kê danh sách Workflow hiện có',
95
+ doctor: 'Kiểm tra cấu hình và chẩn đoán lỗi',
96
+ update: 'Cập nhật thư mục .agent lên phiên bản mới nhất',
97
+ status: 'Kiểm tra trạng thái cài đặt',
98
+ setLang: 'Thiết lập ngôn ngữ Agent (vi/en)',
99
+ aiSubcommands: 'Các lệnh AI phụ:',
100
+ aiInit: 'Khởi tạo hạ tầng AI (AGENTS.md, Graph, RAG)',
101
+ aiStatus: 'Hiển thị trạng thái hạ tầng AI',
102
+ aiConfig: 'Tự động cấu hình AI hosts (Claude, Cursor, v.v.)',
103
+ aiMemory: 'Quản lý bộ nhớ JSON (session, user, brain)',
104
+ aiAutofix: 'Vòng lặp sửa lỗi tự động (Run-Analyze-Fix)',
105
+ aiDashboard: 'Mở dashboard trực quan cho AI brain',
106
+ mcpSubcommands: 'Các lệnh MCP phụ:',
107
+ mcpSetup: 'Cấu hình MCP servers cho Claude/Cursor',
108
+ mcpList: 'Liệt kê các MCP servers hiện có',
109
+ mcpBuild: 'Build các MCP servers',
110
+ options: 'Tùy chọn:',
111
+ optForce: 'Ghi đè lên các file hiện có',
112
+ optPath: 'Cài đặt vào một thư mục cụ thể',
113
+ optPrefix: 'Tiền tố tùy chỉnh cho slash commands (mặc định: kit-)',
114
+ optTemplate: 'Loại template: web, mobile, backend (cho lệnh codex)',
115
+ optClient: 'MCP client: claude, cursor (cho mcp setup)',
116
+ optQuiet: 'Tắt các thông báo đầu ra',
117
+ optHelp: 'Hiển thị thông tin trợ giúp này',
118
+ optVersion: 'Hiển thị phiên bản',
119
+ examples: 'Ví dụ:',
120
+ exInit: 'npx @musashishao/agent-kit init',
121
+ exAiInit: 'Thiết lập hạ tầng AI',
122
+ exAiSync: 'Cập nhật sau khi thay đổi code',
123
+ exAiMemory: 'Xem trạng thái session hiện tại',
124
+ exAiAutofix: 'Chạy vòng lặp sửa lỗi tự động',
125
+ exMcpSetup: 'npx @musashishao/agent-kit mcp setup --client claude',
126
+ exCodex: 'npx @musashishao/agent-kit codex --template web',
127
+ exDoctor: 'npx @musashishao/agent-kit doctor',
128
+ exSetLang: 'Chuyển sang tiếng Việt',
129
+ latestVersion: 'Đảm bảo bạn luôn có phiên bản mới nhất từ NPM:'
130
+ }
131
+ };
59
132
 
60
- ${colors.bright}MCP Subcommands:${colors.reset}
61
- ${colors.cyan}mcp setup${colors.reset} Configure MCP servers for Claude/Cursor
62
- ${colors.cyan}mcp list${colors.reset} List available MCP servers
63
- ${colors.cyan}mcp build${colors.reset} Build MCP servers
133
+ function getSystemLanguage() {
134
+ const agentDir = path.join(process.cwd(), '.agent');
135
+ const userJson = path.join(agentDir, 'memory', 'user.json');
136
+
137
+ if (fs.existsSync(userJson)) {
138
+ try {
139
+ const userData = JSON.parse(fs.readFileSync(userJson, 'utf-8'));
140
+ return (userData.preferences && userData.preferences.language) || 'en';
141
+ } catch (e) {
142
+ return 'en';
143
+ }
144
+ }
145
+ return 'en';
146
+ }
64
147
 
65
- ${colors.bright}Options:${colors.reset}
66
- --force Overwrite existing files
67
- --path <dir> Install in specific directory
68
- --prefix <str> Custom prefix for slash commands (default: kit-)
69
- --template <type> Template type: web, mobile, backend (for codex command)
70
- --client <name> MCP client: claude, cursor (for mcp setup)
71
- --quiet Suppress output
72
- --help Show this help message
73
- --version Show version
148
+ function showHelp() {
149
+ const lang = getSystemLanguage();
150
+ const t = translations[lang] || translations.en;
74
151
 
75
- ${colors.bright}Examples:${colors.reset}
76
- npx ${PACKAGE_NAME} init
77
- npx ${PACKAGE_NAME} ai init # Setup AI infrastructure
78
- npx ${PACKAGE_NAME} ai sync # Update after code changes
79
- npx ${PACKAGE_NAME} ai memory get # View session status
80
- npx ${PACKAGE_NAME} ai autofix "npm test" # Run autonomous fix
81
- npx ${PACKAGE_NAME} mcp setup --client claude
82
- npx ${PACKAGE_NAME} codex --template web
83
- npx ${PACKAGE_NAME} doctor
84
- npx ${PACKAGE_NAME} set-lang vi # Switch to Vietnamese
85
-
86
- ${colors.yellow}# To ensure you have the latest version from NPM:${colors.reset}
152
+ console.log(`
153
+ ${colors.bright}${colors.cyan}${t.title}${colors.reset} v${VERSION}
154
+
155
+ ${colors.bright}${t.usage}${colors.reset}
156
+ ${t.usageText}
157
+
158
+ ${colors.bright}${t.commands}${colors.reset}
159
+ ${colors.cyan}init${colors.reset} ${t.init}
160
+ ${colors.cyan}ai${colors.reset} ${t.ai}
161
+ ${colors.cyan}setup-codex${colors.reset} ${t.setupCodex}
162
+ ${colors.cyan}codex${colors.reset} ${t.codex}
163
+ ${colors.cyan}mcp${colors.reset} ${t.mcp}
164
+ ${colors.cyan}agents${colors.reset} ${t.agents}
165
+ ${colors.cyan}skills${colors.reset} ${t.skills}
166
+ ${colors.cyan}workflows${colors.reset} ${t.workflows}
167
+ ${colors.cyan}doctor${colors.reset} ${t.doctor}
168
+ ${colors.cyan}update${colors.reset} ${t.update}
169
+ ${colors.cyan}status${colors.reset} ${t.status}
170
+ ${colors.cyan}set-lang${colors.reset} ${t.setLang}
171
+
172
+ ${colors.bright}${t.aiSubcommands}${colors.reset}
173
+ ${colors.cyan}ai init${colors.reset} ${t.aiInit}
174
+ ${colors.cyan}ai status${colors.reset} ${t.aiStatus}
175
+ ${colors.cyan}ai config${colors.reset} ${t.aiConfig}
176
+ ${colors.cyan}ai memory${colors.reset} ${t.aiMemory}
177
+ ${colors.cyan}ai autofix${colors.reset} ${t.aiAutofix}
178
+ ${colors.cyan}ai dashboard${colors.reset} ${t.aiDashboard}
179
+
180
+ ${colors.bright}${t.mcpSubcommands}${colors.reset}
181
+ ${colors.cyan}mcp setup${colors.reset} ${t.mcpSetup}
182
+ ${colors.cyan}mcp list${colors.reset} ${t.mcpList}
183
+ ${colors.cyan}mcp build${colors.reset} ${t.mcpBuild}
184
+
185
+ ${colors.bright}${t.options}${colors.reset}
186
+ --force ${t.optForce}
187
+ --path <dir> ${t.optPath}
188
+ --prefix <str> ${t.optPrefix}
189
+ --template <type> ${t.optTemplate}
190
+ --client <name> ${t.optClient}
191
+ --quiet ${t.optQuiet}
192
+ --help ${t.optHelp}
193
+ --version ${t.optVersion}
194
+
195
+ ${colors.bright}${t.examples}${colors.reset}
196
+ ${t.exInit}
197
+ npx ${PACKAGE_NAME} ai init # ${t.exAiInit}
198
+ npx ${PACKAGE_NAME} ai sync # ${t.exAiSync}
199
+ npx ${PACKAGE_NAME} ai memory get # ${t.exAiMemory}
200
+ npx ${PACKAGE_NAME} ai autofix "npm test" # ${t.exAiAutofix}
201
+ ${t.exMcpSetup}
202
+ ${t.exCodex}
203
+ ${t.exDoctor}
204
+ npx ${PACKAGE_NAME} set-lang vi # ${t.exSetLang}
205
+
206
+ ${colors.yellow}# ${t.latestVersion}${colors.reset}
87
207
  npx ${PACKAGE_NAME}@latest update
88
208
  `);
89
209
  }
@@ -426,10 +546,15 @@ function skillsCommand() {
426
546
  }
427
547
 
428
548
  function workflowsCommand() {
429
- const agentDir = path.join(process.cwd(), '.agent');
549
+ const targetDir = process.env.AK_PROJECT_ROOT || process.cwd();
550
+ const agentDir = path.join(targetDir, '.agent');
430
551
  const workflowsDir = path.join(agentDir, 'workflows');
431
552
  const userJson = path.join(agentDir, 'memory', 'user.json');
432
553
 
554
+ // Find project root for docs
555
+ let projectRoot = targetDir;
556
+ const packageRoot = path.resolve(__dirname, '..');
557
+
433
558
  let language = 'en';
434
559
  if (fs.existsSync(userJson)) {
435
560
  try {
@@ -437,6 +562,32 @@ function workflowsCommand() {
437
562
  language = (userData.preferences && userData.preferences.language) || 'en';
438
563
  } catch (e) {}
439
564
  }
565
+
566
+ // Try to find WORKFLOW_GUIDE.md with language suffix in internal folders
567
+ const guidePaths = [
568
+ path.join(agentDir, 'templates', 'docs', `WORKFLOW_GUIDE.${language}.md`),
569
+ path.join(packageRoot, '.agent', 'templates', 'docs', `WORKFLOW_GUIDE.${language}.md`),
570
+ path.join(agentDir, 'templates', 'docs', 'WORKFLOW_GUIDE.md'),
571
+ path.join(packageRoot, '.agent', 'templates', 'docs', 'WORKFLOW_GUIDE.md'),
572
+ path.join(projectRoot, 'docs', `WORKFLOW_GUIDE.${language}.md`),
573
+ path.join(packageRoot, 'docs', `WORKFLOW_GUIDE.${language}.md`),
574
+ path.join(projectRoot, 'docs', 'WORKFLOW_GUIDE.md'),
575
+ path.join(packageRoot, 'docs', 'WORKFLOW_GUIDE.md')
576
+ ];
577
+
578
+ let guideContent = null;
579
+ for (const gp of guidePaths) {
580
+ if (fs.existsSync(gp)) {
581
+ guideContent = fs.readFileSync(gp, 'utf-8');
582
+ break;
583
+ }
584
+ }
585
+
586
+ if (guideContent) {
587
+ log.title('📚 AGENT KIT WORKFLOW GUIDE');
588
+ console.log(guideContent);
589
+ return;
590
+ }
440
591
 
441
592
  log.title('⚡ Available Workflows (Slash Commands)');
442
593
 
@@ -1183,11 +1334,59 @@ async function mcpSearch(searchArgs) {
1183
1334
  }
1184
1335
  }
1185
1336
 
1337
+ // Known MCP packages with special configurations
1338
+ const KNOWN_MCP_PACKAGES = {
1339
+ 'notebooklm-mcp': {
1340
+ displayName: 'NotebookLM (Agent Kit Custom)',
1341
+ serverName: 'notebooklm',
1342
+ command: 'node',
1343
+ args: ['.agent/mcp/servers/notebooklm/dist/index.js'],
1344
+ description: 'Chrome OAuth, skill-linking, Agent Kit native integration',
1345
+ authRequired: true,
1346
+ authInstructions: 'Say "Log me in to NotebookLM" in Claude/Cursor to authenticate via Google.',
1347
+ tools: [
1348
+ 'notebooklm_login',
1349
+ 'notebooklm_query',
1350
+ 'notebooklm_list_notebooks',
1351
+ 'notebooklm_library_add',
1352
+ 'notebooklm_library_search',
1353
+ 'notebooklm_skill_link'
1354
+ ],
1355
+ requiresBuild: true,
1356
+ buildCommand: 'cd .agent/mcp/servers/notebooklm && npm install && npm run build',
1357
+ },
1358
+ '@anthropic/mcp-server-github': {
1359
+ displayName: 'GitHub',
1360
+ serverName: 'github',
1361
+ command: 'npx',
1362
+ args: ['-y', '@anthropic/mcp-server-github'],
1363
+ description: 'GitHub API - repos, issues, PRs',
1364
+ envRequired: ['GITHUB_TOKEN'],
1365
+ },
1366
+ '@anthropic/mcp-server-filesystem': {
1367
+ displayName: 'Filesystem',
1368
+ serverName: 'filesystem',
1369
+ command: 'npx',
1370
+ args: ['-y', '@anthropic/mcp-server-filesystem', process.cwd()],
1371
+ description: 'Secure file system access',
1372
+ },
1373
+ 'playwright-mcp': {
1374
+ displayName: 'Playwright',
1375
+ serverName: 'playwright',
1376
+ command: 'npx',
1377
+ args: ['-y', 'playwright-mcp'],
1378
+ description: 'Browser automation with Playwright',
1379
+ },
1380
+ };
1381
+
1186
1382
  async function mcpInstall(installArgs, options) {
1187
1383
  const packageName = installArgs[0];
1188
1384
 
1189
1385
  if (!packageName) {
1190
1386
  log.error('Please provide a package name: mcp install <package>');
1387
+ log.info('Examples:');
1388
+ log.info(' mcp install notebooklm-mcp');
1389
+ log.info(' mcp install @anthropic/mcp-server-github');
1191
1390
  process.exit(1);
1192
1391
  }
1193
1392
 
@@ -1195,84 +1394,185 @@ async function mcpInstall(installArgs, options) {
1195
1394
 
1196
1395
  const agentDir = path.join(process.cwd(), '.agent');
1197
1396
  const mcpDir = path.join(agentDir, 'mcp');
1198
- const externalDir = path.join(mcpDir, 'external');
1397
+ const configDir = path.join(mcpDir, 'config');
1199
1398
 
1200
- // Create external directory if needed
1201
- if (!fs.existsSync(externalDir)) {
1202
- fs.mkdirSync(externalDir, { recursive: true });
1399
+ // Create config directory if needed
1400
+ if (!fs.existsSync(configDir)) {
1401
+ fs.mkdirSync(configDir, { recursive: true });
1203
1402
  }
1204
1403
 
1205
- try {
1206
- // Install package globally or in external dir
1207
- log.info(`Installing ${packageName}...`);
1208
-
1209
- execSync(`npm install ${packageName}`, {
1210
- cwd: externalDir,
1211
- stdio: 'pipe',
1212
- timeout: 120000
1213
- });
1214
-
1215
- log.success(`Installed ${packageName}`);
1404
+ // Check if this is a known package
1405
+ const knownPackage = KNOWN_MCP_PACKAGES[packageName];
1406
+ const serverName = knownPackage?.serverName || packageName.replace(/^@[^/]+\//, '').replace(/-mcp$/, '').replace(/^mcp-server-/, '');
1407
+
1408
+ log.info(`Server name: ${serverName}`);
1409
+
1410
+ // Build MCP config entry
1411
+ let mcpConfig;
1412
+ if (knownPackage) {
1413
+ mcpConfig = {
1414
+ command: knownPackage.command,
1415
+ args: knownPackage.args,
1416
+ };
1417
+ if (knownPackage.envRequired) {
1418
+ mcpConfig.env = {};
1419
+ for (const envVar of knownPackage.envRequired) {
1420
+ mcpConfig.env[envVar] = process.env[envVar] || `YOUR_${envVar}`;
1421
+ }
1422
+ }
1216
1423
 
1217
- // Try to find the package and get its binary
1218
- const packagePath = path.join(externalDir, 'node_modules', packageName);
1219
- let binPath = null;
1424
+ // Auto-build if required
1425
+ if (knownPackage.requiresBuild && knownPackage.buildCommand) {
1426
+ log.info('Building server (this may take a moment)...');
1427
+ try {
1428
+ execSync(knownPackage.buildCommand, {
1429
+ cwd: process.cwd(),
1430
+ stdio: 'pipe',
1431
+ timeout: 180000, // 3 minutes
1432
+ });
1433
+ log.success('Build completed');
1434
+ } catch (buildError) {
1435
+ log.error(`Build failed: ${buildError.message}`);
1436
+ log.info('You may need to run the build manually:');
1437
+ log.info(` ${knownPackage.buildCommand}`);
1438
+ }
1439
+ }
1440
+ } else {
1441
+ // Generic npx config for unknown packages
1442
+ mcpConfig = {
1443
+ command: 'npx',
1444
+ args: ['-y', `${packageName}@latest`],
1445
+ };
1446
+ }
1447
+
1448
+ // ========== Auto-configure Claude Desktop ==========
1449
+ const claudeConfigPath = path.join(os.homedir(), 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json');
1450
+ let claudeUpdated = false;
1451
+
1452
+ try {
1453
+ let claudeConfig = { mcpServers: {} };
1220
1454
 
1221
- if (fs.existsSync(path.join(packagePath, 'package.json'))) {
1222
- const pkg = JSON.parse(fs.readFileSync(path.join(packagePath, 'package.json'), 'utf-8'));
1223
-
1224
- if (pkg.bin) {
1225
- const binName = typeof pkg.bin === 'string' ? packageName : Object.keys(pkg.bin)[0];
1226
- const binFile = typeof pkg.bin === 'string' ? pkg.bin : pkg.bin[binName];
1227
- binPath = path.join(packagePath, binFile);
1228
- } else if (pkg.main) {
1229
- binPath = path.join(packagePath, pkg.main);
1455
+ if (fs.existsSync(claudeConfigPath)) {
1456
+ claudeConfig = JSON.parse(fs.readFileSync(claudeConfigPath, 'utf-8'));
1457
+ if (!claudeConfig.mcpServers) claudeConfig.mcpServers = {};
1458
+ } else {
1459
+ // Create directory if needed
1460
+ const claudeDir = path.dirname(claudeConfigPath);
1461
+ if (!fs.existsSync(claudeDir)) {
1462
+ fs.mkdirSync(claudeDir, { recursive: true });
1230
1463
  }
1231
1464
  }
1232
1465
 
1233
- // Save to installed registry
1234
- const registryPath = path.join(mcpDir, 'config', 'registry.json');
1235
- let registry = { installed: [] };
1466
+ // Add/update server config
1467
+ claudeConfig.mcpServers[serverName] = mcpConfig;
1236
1468
 
1237
- if (fs.existsSync(registryPath)) {
1238
- try {
1239
- registry = JSON.parse(fs.readFileSync(registryPath, 'utf-8'));
1240
- } catch {}
1469
+ fs.writeFileSync(claudeConfigPath, JSON.stringify(claudeConfig, null, 2));
1470
+ log.success(`Added "${serverName}" to Claude Desktop config`);
1471
+ claudeUpdated = true;
1472
+ } catch (err) {
1473
+ log.warn(`Could not update Claude Desktop config: ${err.message}`);
1474
+ }
1475
+
1476
+ // ========== Auto-configure Cursor ==========
1477
+ const cursorDir = path.join(process.cwd(), '.cursor');
1478
+ const cursorConfigPath = path.join(cursorDir, 'mcp.json');
1479
+ let cursorUpdated = false;
1480
+
1481
+ try {
1482
+ if (!fs.existsSync(cursorDir)) {
1483
+ fs.mkdirSync(cursorDir, { recursive: true });
1241
1484
  }
1242
1485
 
1243
- if (!registry.installed) registry.installed = [];
1244
-
1245
- // Add to installed list
1246
- const existing = registry.installed.findIndex(i => i.name === packageName);
1247
- const installInfo = {
1248
- name: packageName,
1249
- path: binPath || packagePath,
1250
- installedAt: new Date().toISOString()
1251
- };
1486
+ let cursorConfig = { mcpServers: {} };
1252
1487
 
1253
- if (existing >= 0) {
1254
- registry.installed[existing] = installInfo;
1255
- } else {
1256
- registry.installed.push(installInfo);
1488
+ if (fs.existsSync(cursorConfigPath)) {
1489
+ cursorConfig = JSON.parse(fs.readFileSync(cursorConfigPath, 'utf-8'));
1490
+ if (!cursorConfig.mcpServers) cursorConfig.mcpServers = {};
1257
1491
  }
1258
1492
 
1259
- fs.writeFileSync(registryPath, JSON.stringify(registry, null, 2));
1493
+ // Add/update server config
1494
+ cursorConfig.mcpServers[serverName] = mcpConfig;
1260
1495
 
1261
- console.log(`
1262
- ${colors.bright}${colors.green} Installation complete!${colors.reset}
1496
+ fs.writeFileSync(cursorConfigPath, JSON.stringify(cursorConfig, null, 2));
1497
+ log.success(`Added "${serverName}" to Cursor config (.cursor/mcp.json)`);
1498
+ cursorUpdated = true;
1499
+ } catch (err) {
1500
+ log.warn(`Could not update Cursor config: ${err.message}`);
1501
+ }
1502
+
1503
+ // ========== Save to registry ==========
1504
+ const registryPath = path.join(configDir, 'registry.json');
1505
+ let registry = { installed: [] };
1506
+
1507
+ if (fs.existsSync(registryPath)) {
1508
+ try {
1509
+ registry = JSON.parse(fs.readFileSync(registryPath, 'utf-8'));
1510
+ } catch {}
1511
+ }
1512
+
1513
+ if (!registry.installed) registry.installed = [];
1514
+
1515
+ const existing = registry.installed.findIndex(i => i.name === packageName);
1516
+ const installInfo = {
1517
+ name: packageName,
1518
+ serverName,
1519
+ config: mcpConfig,
1520
+ installedAt: new Date().toISOString(),
1521
+ claudeConfigured: claudeUpdated,
1522
+ cursorConfigured: cursorUpdated,
1523
+ };
1524
+
1525
+ if (existing >= 0) {
1526
+ registry.installed[existing] = installInfo;
1527
+ } else {
1528
+ registry.installed.push(installInfo);
1529
+ }
1530
+
1531
+ fs.writeFileSync(registryPath, JSON.stringify(registry, null, 2));
1532
+
1533
+ // ========== Output ==========
1534
+ console.log(`
1535
+ ${colors.bright}${colors.green}✔ MCP Server installed and configured!${colors.reset}
1263
1536
 
1264
1537
  ${colors.bright}Package:${colors.reset} ${packageName}
1265
- ${colors.bright}Location:${colors.reset} ${externalDir}/node_modules/${packageName}
1538
+ ${colors.bright}Server Name:${colors.reset} ${serverName}
1539
+ ${colors.bright}Configuration:${colors.reset}
1540
+ ${claudeUpdated ? `${colors.green}✓${colors.reset}` : `${colors.yellow}○${colors.reset}`} Claude Desktop
1541
+ ${cursorUpdated ? `${colors.green}✓${colors.reset}` : `${colors.yellow}○${colors.reset}`} Cursor
1542
+ `);
1266
1543
 
1267
- ${colors.bright}Next steps:${colors.reset}
1268
- 1. Run ${colors.cyan}npx @musashishao/agent-kit mcp setup --client claude${colors.reset}
1269
- 2. Restart Claude Desktop
1544
+ // Special instructions for known packages
1545
+ if (knownPackage) {
1546
+ console.log(`${colors.bright}Description:${colors.reset} ${knownPackage.description}`);
1547
+
1548
+ if (knownPackage.authRequired) {
1549
+ console.log(`
1550
+ ${colors.yellow}⚠️ Authentication Required:${colors.reset}
1551
+ ${knownPackage.authInstructions}
1270
1552
  `);
1553
+ }
1271
1554
 
1272
- } catch (error) {
1273
- log.error(`Installation failed: ${error.message}`);
1274
- process.exit(1);
1555
+ if (knownPackage.envRequired) {
1556
+ console.log(`${colors.yellow}⚠️ Environment Variables Required:${colors.reset}`);
1557
+ for (const envVar of knownPackage.envRequired) {
1558
+ console.log(` export ${envVar}="your-value"`);
1559
+ }
1560
+ console.log('');
1561
+ }
1562
+
1563
+ if (knownPackage.tools) {
1564
+ console.log(`${colors.bright}Available Tools:${colors.reset}`);
1565
+ for (const tool of knownPackage.tools) {
1566
+ console.log(` • ${colors.cyan}${tool}${colors.reset}`);
1567
+ }
1568
+ console.log('');
1569
+ }
1275
1570
  }
1571
+
1572
+ console.log(`${colors.bright}Next Steps:${colors.reset}
1573
+ 1. ${colors.cyan}Restart Claude Desktop${colors.reset} to load the new MCP server
1574
+ 2. ${knownPackage?.authRequired ? 'Authenticate when prompted' : 'Start using the new tools!'}
1575
+ `);
1276
1576
  }
1277
1577
 
1278
1578
  function mcpFeatured() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@musashishao/agent-kit",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "description": "AI Agent templates - Skills, Agents, Workflows, and AI-Ready Data Infrastructure Gateway",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -9,7 +9,6 @@
9
9
  },
10
10
  "files": [
11
11
  "bin",
12
- "docs",
13
12
  ".agent/.shared",
14
13
  ".agent/adr",
15
14
  ".agent/agents",