@plumpslabs/kuma 2.3.9 → 2.3.12
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/dist/{agentDetector-G4RBMZ6X.js → agentDetector-YOWQVJFR.js} +8 -8
- package/dist/{chunk-L5WU2HTN.js → chunk-CRQ7WTPV.js} +243 -78
- package/dist/index.js +12 -12
- package/dist/{init-AJAESUZZ.js → init-OMETJFLM.js} +1 -1
- package/dist/{skillGenerator-F6YO4H5D.js → skillGenerator-RGXRSBX2.js} +20 -21
- package/package.json +1 -1
|
@@ -36,17 +36,17 @@ var AGENT_DETECTORS = [
|
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
type: "windsurf",
|
|
39
|
-
checkFiles: [
|
|
40
|
-
checkDirs: [],
|
|
39
|
+
checkFiles: [],
|
|
40
|
+
checkDirs: [".windsurf"],
|
|
41
41
|
priority: 70,
|
|
42
|
-
label: "Windsurf (.
|
|
42
|
+
label: "Windsurf (.windsurf/)"
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
type: "opencode",
|
|
46
|
-
checkFiles: ["
|
|
47
|
-
checkDirs: [],
|
|
46
|
+
checkFiles: [".agents/skills/kuma/SKILL.md"],
|
|
47
|
+
checkDirs: [".agents"],
|
|
48
48
|
priority: 65,
|
|
49
|
-
label: "OpenCode (
|
|
49
|
+
label: "OpenCode (.agents/skills/kuma/SKILL.md)"
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
type: "kiro",
|
|
@@ -152,11 +152,11 @@ function getSkillPath(type) {
|
|
|
152
152
|
return ".agents/skills/kuma/SKILL.md";
|
|
153
153
|
// Same path as Antigravity
|
|
154
154
|
case "opencode":
|
|
155
|
-
return "
|
|
155
|
+
return ".agents/skills/kuma/SKILL.md";
|
|
156
156
|
case "aider":
|
|
157
157
|
return "CONVENTIONS.md";
|
|
158
158
|
case "windsurf":
|
|
159
|
-
return ".
|
|
159
|
+
return ".windsurf/rules/kuma.md";
|
|
160
160
|
case "copilot":
|
|
161
161
|
return ".github/skills/kuma/SKILL.md";
|
|
162
162
|
case "qwen":
|
|
@@ -23,12 +23,12 @@ var ALL_CONFIG_TYPES = [
|
|
|
23
23
|
var CONFIG_LABELS = {
|
|
24
24
|
claude: "Claude Code (CLAUDE.md / plugin)",
|
|
25
25
|
cursor: "Cursor (.cursor/rules/*.mdc)",
|
|
26
|
-
windsurf: "Windsurf (.
|
|
26
|
+
windsurf: "Windsurf (.windsurf/rules/)",
|
|
27
27
|
copilot: "GitHub Copilot Editor (AGENTS.md + Skill)",
|
|
28
28
|
cline: "Cline (.clinerules/*.md)",
|
|
29
29
|
aider: "Aider (CONVENTIONS.md via .aider.conf.yml)",
|
|
30
30
|
antigravity: "Antigravity CLI (.agents/skills/)",
|
|
31
|
-
opencode: "OpenCode (
|
|
31
|
+
opencode: "OpenCode (AGENTS.md + skills)",
|
|
32
32
|
codex: "Codex CLI (AGENTS.md + .codex/config.toml)",
|
|
33
33
|
qwen: "Qwen Code (AGENTS.md + settings.json)",
|
|
34
34
|
kiro: "Kiro (.kiro/steering/*.md)",
|
|
@@ -42,7 +42,7 @@ function configFilePath(type) {
|
|
|
42
42
|
case "cursor":
|
|
43
43
|
return ".cursor/rules/kuma.mdc";
|
|
44
44
|
case "windsurf":
|
|
45
|
-
return ".
|
|
45
|
+
return ".windsurf/rules/kuma.md";
|
|
46
46
|
case "copilot":
|
|
47
47
|
return "AGENTS.md";
|
|
48
48
|
case "cline":
|
|
@@ -52,7 +52,7 @@ function configFilePath(type) {
|
|
|
52
52
|
case "antigravity":
|
|
53
53
|
return ".agents/skills/kuma/SKILL.md";
|
|
54
54
|
case "opencode":
|
|
55
|
-
return "
|
|
55
|
+
return "AGENTS.md";
|
|
56
56
|
case "codex":
|
|
57
57
|
return "AGENTS.md";
|
|
58
58
|
case "qwen":
|
|
@@ -66,8 +66,8 @@ function configFilePath(type) {
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
var BOOTSTRAP_LINES = [
|
|
69
|
-
"Kuma MCP tools are installed. All behavioral rules are in `.kuma/init.md`.",
|
|
70
|
-
|
|
69
|
+
"Kuma MCP tools are installed (kuma_context, kuma_memory, kuma_safety). All behavioral rules are in `.kuma/init.md`.",
|
|
70
|
+
'**Before coding, call `kuma_context({ action: "init" })`** to load project context and session memory.',
|
|
71
71
|
"Project knowledge persists in `.kuma/memories/*.md` across sessions."
|
|
72
72
|
].join("\n");
|
|
73
73
|
var KUMA_CORE_INSTRUCTIONS = BOOTSTRAP_LINES;
|
|
@@ -97,7 +97,12 @@ function windsurfRulesTemplate() {
|
|
|
97
97
|
return [
|
|
98
98
|
"# Kuma MCP \u2014 Windsurf",
|
|
99
99
|
"",
|
|
100
|
-
|
|
100
|
+
"Windsurf Cascade agent: Kuma MCP tools are installed.",
|
|
101
|
+
"All behavioral rules are in `.kuma/init.md`.",
|
|
102
|
+
"**Before coding, load project context via `kuma_init()`.**",
|
|
103
|
+
"Project knowledge persists in `.kuma/memories/*.md` across sessions.",
|
|
104
|
+
"",
|
|
105
|
+
"Also auto-detected as SKILL.md in `.windsurf/skills/` and `.agents/skills/`."
|
|
101
106
|
].join("\n");
|
|
102
107
|
}
|
|
103
108
|
function copilotTemplate() {
|
|
@@ -127,19 +132,15 @@ function aiderTemplate() {
|
|
|
127
132
|
KUMA_CORE_INSTRUCTIONS
|
|
128
133
|
].join("\n");
|
|
129
134
|
}
|
|
130
|
-
function
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
},
|
|
140
|
-
instructions: [".kuma/init.md"]
|
|
141
|
-
};
|
|
142
|
-
return JSON.stringify(config, null, 2) + "\n";
|
|
135
|
+
function opencodeAgentsMdTemplate() {
|
|
136
|
+
return [
|
|
137
|
+
"## Kuma MCP \u2014 OpenCode",
|
|
138
|
+
"",
|
|
139
|
+
KUMA_CORE_INSTRUCTIONS,
|
|
140
|
+
"",
|
|
141
|
+
"\u{1F4D6} Rules: `.kuma/init.md`",
|
|
142
|
+
"\u{1F9E0} Skill: `.agents/skills/kuma/SKILL.md`"
|
|
143
|
+
].join("\n");
|
|
143
144
|
}
|
|
144
145
|
function codexTemplate() {
|
|
145
146
|
return [
|
|
@@ -248,74 +249,201 @@ function antigravityMcpConfigTemplate() {
|
|
|
248
249
|
}
|
|
249
250
|
function generateInitMdContent() {
|
|
250
251
|
return [
|
|
251
|
-
"# Kuma Init \u2014
|
|
252
|
+
"# Kuma Init \u2014 Mandatory Workflow",
|
|
252
253
|
"",
|
|
253
254
|
"_(Auto-generated by `kuma init` \u2014 edit this file directly to customize rules)_",
|
|
254
255
|
"",
|
|
255
|
-
"
|
|
256
|
-
"",
|
|
257
|
-
"Kuma provides 3 pipeline-driven tools. Each action triggers a multi-step deterministic workflow internally.",
|
|
258
|
-
"",
|
|
259
|
-
"### \u{1F9E0} kuma_context \u2014 Context & Research (call FIRST every session)",
|
|
260
|
-
"",
|
|
261
|
-
'- `kuma_context({ action: "init" })` \u2014 Load project brief, detect stack, show structure',
|
|
262
|
-
'- **`kuma_context({ action: "research", scope: "..." })` \u2014 WAJIB before editing unfamiliar code**',
|
|
263
|
-
" - 5-step pipeline: load cache \u2192 check staleness \u2192 query graph \u2192 impact analysis \u2192 decision lookup",
|
|
264
|
-
'- `kuma_context({ action: "impact", target: "symbol" })` \u2014 Analyze change effects',
|
|
265
|
-
'- `kuma_context({ action: "navigate", target: "flow" })` \u2014 Trace code flow',
|
|
266
|
-
'- `kuma_context({ action: "changes" })` \u2014 View session change log',
|
|
267
|
-
'- `kuma_context({ action: "health" })` \u2014 Project health score 0-100',
|
|
268
|
-
"",
|
|
269
|
-
"### \u{1F4DD} kuma_memory \u2014 Decision & Knowledge",
|
|
256
|
+
"---",
|
|
270
257
|
"",
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
'
|
|
276
|
-
|
|
277
|
-
|
|
258
|
+
"## \u26A0\uFE0F SESSION WORKFLOW \u2014 Follow Steps in Order",
|
|
259
|
+
"",
|
|
260
|
+
"### STEP 1: Init Session (ALWAYS \u2014 Start of Session)",
|
|
261
|
+
"```",
|
|
262
|
+
'kuma_context({ action: "init" })',
|
|
263
|
+
"```",
|
|
264
|
+
"**When:** Every session start or project switch",
|
|
265
|
+
"**Why:** Load project brief, restore session memory, populate knowledge graph",
|
|
266
|
+
"",
|
|
267
|
+
"### STEP 2: Safety Guard (ALWAYS \u2014 Before Work)",
|
|
268
|
+
"```",
|
|
269
|
+
'kuma_safety({ action: "guard", guardGoal: "describe your intent" })',
|
|
270
|
+
"```",
|
|
271
|
+
"**When:** After STEP 1, before research or editing",
|
|
272
|
+
"**Why:** Detect anti-patterns, code drift, runaway loops upfront",
|
|
273
|
+
"",
|
|
274
|
+
"### STEP 3: Research (MANDATORY \u2014 Before Editing Unfamiliar Code)",
|
|
275
|
+
"```",
|
|
276
|
+
'kuma_context({ action: "research", scope: "<target area>" })',
|
|
277
|
+
"```",
|
|
278
|
+
"**When:** Every time you plan to edit code in an unfamiliar area",
|
|
279
|
+
"**Why:** 5-step pipeline: cache load \u2192 staleness check \u2192 graph query \u2192 impact analysis \u2192 decision lookup",
|
|
280
|
+
"",
|
|
281
|
+
"> \u26D4 DO NOT EDIT FILES BEFORE STEP 3 \u2014 Unless trivial/minor change",
|
|
282
|
+
"",
|
|
283
|
+
"### STEP 4: EDIT \u2014 Implement (Use Agent Native Tools)",
|
|
284
|
+
"```",
|
|
285
|
+
"# Use agent BUILT-IN tools to read, grep, edit, create files",
|
|
286
|
+
"# Kuma does NOT manage files \u2014 that's your agent's job",
|
|
287
|
+
"```",
|
|
288
|
+
"",
|
|
289
|
+
"**AUTO-RECORDED nodes/edges** (Kuma scanner detects these automatically):",
|
|
290
|
+
"- Files, Functions, Classes \u2192 created as graph nodes",
|
|
291
|
+
"- Imports, Calls, Extends \u2192 created as graph edges",
|
|
292
|
+
"- Variables, Components, Routes \u2192 created when detected",
|
|
293
|
+
"",
|
|
294
|
+
"**MANUAL \u2014 When to call these yourself:**",
|
|
295
|
+
'- `kuma_memory({ action: "research_save" })` \u2014 after exploring/learning something new',
|
|
296
|
+
'- `kuma_memory({ action: "decision" })` \u2014 after making an architecture/design choice',
|
|
297
|
+
'- `kuma_memory({ action: "context" })` \u2014 inject arbitrary context notes',
|
|
298
|
+
'- `kuma_memory({ action: "domain_rules" })` \u2014 record business rules',
|
|
299
|
+
'- `kuma_memory({ action: "arch_flow" })` \u2014 document architecture flow',
|
|
300
|
+
'- `kuma_memory({ action: "gotcha" })` \u2014 log known quirks/workarounds',
|
|
301
|
+
'- `kuma_memory({ action: "todo" })` \u2014 create persistent task',
|
|
302
|
+
'- `kuma_memory({ action: "mine" })` \u2014 extract historical decisions from git',
|
|
303
|
+
"",
|
|
304
|
+
"### STEP 5: Save Research (AFTER Editing)",
|
|
305
|
+
"```",
|
|
306
|
+
'kuma_memory({ action: "research_save", scope: "<area>", confidence: 0.8 })',
|
|
307
|
+
"```",
|
|
308
|
+
"**When:** After exploring a new area or finishing edits",
|
|
309
|
+
"**Why:** Persist findings into knowledge graph + research cache",
|
|
310
|
+
"",
|
|
311
|
+
"### STEP 6: Record Decision (AFTER Significant Changes)",
|
|
312
|
+
"```",
|
|
313
|
+
'kuma_memory({ action: "decision", decisionAction: "record", title: "...", outcome: "..." })',
|
|
314
|
+
"```",
|
|
315
|
+
"**When:** After making architecture/design decisions",
|
|
316
|
+
"**Why:** Saves ADR (Architecture Decision Record) to the decision log",
|
|
317
|
+
"",
|
|
318
|
+
"### STEP 7: Verify (AFTER Editing)",
|
|
319
|
+
"```",
|
|
320
|
+
'kuma_safety({ action: "verify", scope: "<area or file>" })',
|
|
321
|
+
"```",
|
|
322
|
+
"**When:** After edits are done, before switching tasks",
|
|
323
|
+
"**Why:** Auto-run scoped tests + AST code validation",
|
|
324
|
+
"",
|
|
325
|
+
"### STEP 8: Check Changes (BEFORE Commit / End of Session)",
|
|
326
|
+
"```",
|
|
327
|
+
'kuma_context({ action: "changes" })',
|
|
328
|
+
"```",
|
|
329
|
+
"**When:** End of session or before git commit",
|
|
330
|
+
"**Why:** Review all modifications made in this session",
|
|
278
331
|
"",
|
|
279
|
-
"
|
|
332
|
+
"---",
|
|
280
333
|
"",
|
|
281
|
-
|
|
282
|
-
'- **`kuma_safety({ action: "verify", scope: "..." })` \u2014 Auto-run scoped tests & verify correctness**',
|
|
283
|
-
'- `kuma_safety({ action: "check", ... })` \u2014 Pre-execution safety check',
|
|
284
|
-
'- `kuma_safety({ action: "audit" })` \u2014 Query safety audit trail',
|
|
285
|
-
'- `kuma_safety({ action: "lock", lockAction: "acquire", ... })` \u2014 Multi-agent file lock',
|
|
286
|
-
'- `kuma_safety({ action: "health" })` \u2014 Safety score 0-100',
|
|
287
|
-
'- `kuma_safety({ action: "override", ... })` \u2014 Logged safety bypass',
|
|
334
|
+
"## \u{1F4CB} Tool Reference",
|
|
288
335
|
"",
|
|
289
|
-
"
|
|
336
|
+
"### \u{1F9E0} kuma_context \u2014 Context & Research",
|
|
290
337
|
"",
|
|
291
|
-
"
|
|
338
|
+
"| Action | Description | When to Call |",
|
|
339
|
+
"|--------|-------------|--------------|",
|
|
340
|
+
"| `init` | Load project brief, restore session | STEP 1 \u2014 Every session |",
|
|
341
|
+
"| `research` | 5-step research pipeline | STEP 3 \u2014 Before edits |",
|
|
342
|
+
"| `impact` | Analyze change effects on symbol | After research, before design |",
|
|
343
|
+
"| `navigate` | Trace code flow | When need to understand call flow |",
|
|
344
|
+
"| `changes` | View session change log | STEP 8 \u2014 End of session |",
|
|
345
|
+
"| `health` | Project health score 0-100 | Periodic check |",
|
|
346
|
+
"| `digest` | Ultra-compact project briefing | Session start (alt to init) |",
|
|
347
|
+
"| `drift` | Detect memory staleness | When suspecting stale context |",
|
|
292
348
|
"",
|
|
293
|
-
|
|
349
|
+
"### \u{1F4DD} kuma_memory \u2014 Decision & Knowledge",
|
|
294
350
|
"",
|
|
295
|
-
"
|
|
296
|
-
"
|
|
351
|
+
"| Action | Description | When to Call |",
|
|
352
|
+
"|--------|-------------|--------------|",
|
|
353
|
+
"| `research_save` | Save research results | STEP 5 \u2014 After exploring/editing |",
|
|
354
|
+
"| `decision` | ADR-style decision record | STEP 6 \u2014 After major decisions |",
|
|
355
|
+
"| `mine` | Mine decisions from git log | When need historical context |",
|
|
356
|
+
"| `session` | Session summary | End of session |",
|
|
357
|
+
"| `heal` | Self-heal knowledge graph | When graph has errors |",
|
|
358
|
+
"| `search` | Search memories + graph | Find stored information |",
|
|
359
|
+
"| `todo` | Persistent todo CRUD | When managing tasks |",
|
|
360
|
+
"| `context` | Inject context notes | Manual \u2014 additional notes |",
|
|
361
|
+
"| `domain_rules` | Layer 1: business rules | Manual \u2014 record business rules |",
|
|
362
|
+
"| `arch_flow` | Layer 2: architecture flow | Manual \u2014 document architecture |",
|
|
363
|
+
"| `gotcha` | Layer 3: known gotchas | Manual \u2014 log quirks/legacy |",
|
|
364
|
+
"| `layers` | Show all 3 layers summary | Overview memory layers |",
|
|
297
365
|
"",
|
|
298
|
-
"
|
|
366
|
+
"### \u{1F6E1}\uFE0F kuma_safety \u2014 Safety & Policy",
|
|
299
367
|
"",
|
|
300
|
-
|
|
368
|
+
"| Action | Description | When to Call |",
|
|
369
|
+
"|--------|-------------|--------------|",
|
|
370
|
+
"| `guard` | Anti-pattern, drift, loop | STEP 2 \u2014 Before work |",
|
|
371
|
+
"| `verify` | Auto-run scoped tests | STEP 7 \u2014 After edits |",
|
|
372
|
+
"| `check` | Pre-execution safety check | Before risky operations |",
|
|
373
|
+
"| `audit` | Query safety audit trail | Security investigation |",
|
|
374
|
+
"| `lock` | Multi-agent file lock | Multi-agent collaboration |",
|
|
375
|
+
"| `health` | Safety score 0-100 | Periodic check |",
|
|
376
|
+
"| `policy` | Policy-as-Code engine | Evaluate command/file paths |",
|
|
377
|
+
"| `ast` | AST-based code validation | Code correctness checks |",
|
|
378
|
+
"| `checkpoint` | Create atomic snapshot | Before major refactors |",
|
|
379
|
+
"| `contract` | Pre/post-condition check | Contract verification |",
|
|
301
380
|
"",
|
|
302
|
-
"
|
|
381
|
+
"---",
|
|
303
382
|
"",
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
'
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
383
|
+
"## \u{1F4CA} Knowledge Graph \u2014 Node Types & Shapes",
|
|
384
|
+
"",
|
|
385
|
+
"Kuma's knowledge graph visualizes your project structure. Each node type has a unique shape:",
|
|
386
|
+
"",
|
|
387
|
+
"| Shape | Node Type | Description | Auto/Manual |",
|
|
388
|
+
"|-------|-----------|-------------|-------------|",
|
|
389
|
+
"| \u25A2 `box` | function | Functions (named/arrow) | AUTO by scanner |",
|
|
390
|
+
"| \u2B21 `hexagon` | class | Classes (TS/JS) | AUTO by scanner |",
|
|
391
|
+
"| \u25CB `ellipse` | module | Directory modules | AUTO by scanner |",
|
|
392
|
+
"| \u25C7 `diamond` | component | React/Vue components | AUTO by scanner |",
|
|
393
|
+
"| \u25A3 `square` | file | Source files | AUTO by scanner |",
|
|
394
|
+
"| \u25B2 `triangle` | route | API routes | AUTO by scanner |",
|
|
395
|
+
"| \u2B52 `star` | test | Test files/describes | AUTO by scanner |",
|
|
396
|
+
"| \u{1F4C4} `note` | context | Manual context notes | MANUAL \u2014 kuma_memory context |",
|
|
397
|
+
"| \u{1F3F7}\uFE0F `tag` | domain_rule | Business rules (Layer 1) | MANUAL \u2014 kuma_memory domain_rules |",
|
|
398
|
+
"| \u{1F500} `flow` | arch_flow | Architecture flows (Layer 2) | MANUAL \u2014 kuma_memory arch_flow |",
|
|
399
|
+
"| \u26A0\uFE0F `warning` | gotcha | Known gotchas (Layer 3) | MANUAL \u2014 kuma_memory gotcha |",
|
|
400
|
+
"| \u{1F4CC} `milestone` | decision | Architecture decisions | MANUAL \u2014 kuma_memory decision |",
|
|
401
|
+
"| \u2705 `checklist` | todo | Persistent todos | MANUAL \u2014 kuma_memory todo |",
|
|
402
|
+
"",
|
|
403
|
+
"**Edges (connections between nodes):**",
|
|
404
|
+
"- `imports` \u2014 file imports another (AUTO)",
|
|
405
|
+
"- `calls` \u2014 function calls another (AUTO)",
|
|
406
|
+
"- `defines` \u2014 file defines function/class (AUTO)",
|
|
407
|
+
"- `depends_on` \u2014 logical dependency (AUTO + MANUAL)",
|
|
408
|
+
"- `extends` \u2014 class extends class (AUTO)",
|
|
409
|
+
"- `contains` \u2014 file contains function (AUTO)",
|
|
410
|
+
"- `composes` \u2014 component contains sub-component (AUTO)",
|
|
411
|
+
"- `references` \u2014 node references context note (MANUAL)",
|
|
310
412
|
"",
|
|
311
|
-
"
|
|
413
|
+
"---",
|
|
312
414
|
"",
|
|
313
|
-
"
|
|
314
|
-
"
|
|
315
|
-
"
|
|
316
|
-
"
|
|
317
|
-
"
|
|
318
|
-
"
|
|
415
|
+
"## \u{1F4CC} Workflow Summary",
|
|
416
|
+
"",
|
|
417
|
+
"```",
|
|
418
|
+
"EVERY SESSION (Mandatory):",
|
|
419
|
+
" 1. kuma_context \u2192 init \u2014 Load project context",
|
|
420
|
+
" 2. kuma_safety \u2192 guard \u2014 Safety check",
|
|
421
|
+
" 3. kuma_context \u2192 research \u2014 Research target area",
|
|
422
|
+
" --- EDIT (use native tools) ---",
|
|
423
|
+
" 5. kuma_memory \u2192 research_save \u2014 Save findings",
|
|
424
|
+
" 6. kuma_memory \u2192 decision \u2014 Record decisions",
|
|
425
|
+
" 7. kuma_safety \u2192 verify \u2014 Verify correctness",
|
|
426
|
+
" 8. kuma_context \u2192 changes \u2014 Review changes",
|
|
427
|
+
"",
|
|
428
|
+
"MANUAL (When needed):",
|
|
429
|
+
" kuma_memory \u2192 domain_rules \u2014 Business rules (Layer 1)",
|
|
430
|
+
" kuma_memory \u2192 arch_flow \u2014 Architecture flow (Layer 2)",
|
|
431
|
+
" kuma_memory \u2192 gotcha \u2014 Known quirks (Layer 3)",
|
|
432
|
+
" kuma_memory \u2192 context \u2014 Additional notes",
|
|
433
|
+
" kuma_memory \u2192 todo \u2014 Task management",
|
|
434
|
+
" kuma_memory \u2192 mine \u2014 Historical context",
|
|
435
|
+
"```",
|
|
436
|
+
"",
|
|
437
|
+
"## \u{1F6AB} What Kuma Does NOT Do (Use Agent Native Tools)",
|
|
438
|
+
"",
|
|
439
|
+
"| Function | Correct Tool |",
|
|
440
|
+
"|----------|-------------|",
|
|
441
|
+
"| Edit files | Agent native edit tools |",
|
|
442
|
+
"| Search code | Agent native grep/search |",
|
|
443
|
+
"| Run commands | Agent native terminal |",
|
|
444
|
+
"| Create files | Agent native file creation |",
|
|
445
|
+
"| Git operations | Agent native git tools |",
|
|
446
|
+
"| Lint/test | Agent native run commands |",
|
|
319
447
|
"",
|
|
320
448
|
"---",
|
|
321
449
|
"_Generated by Kuma MCP - https://github.com/plumpslabs/kuma_"
|
|
@@ -329,7 +457,7 @@ var TEMPLATES = {
|
|
|
329
457
|
cline: clineRulesTemplate,
|
|
330
458
|
aider: aiderTemplate,
|
|
331
459
|
antigravity: antigravitySkillTemplate,
|
|
332
|
-
opencode:
|
|
460
|
+
opencode: opencodeAgentsMdTemplate,
|
|
333
461
|
codex: codexTemplate,
|
|
334
462
|
qwen: qwenTemplate,
|
|
335
463
|
kiro: kiroRulesTemplate,
|
|
@@ -337,7 +465,45 @@ var TEMPLATES = {
|
|
|
337
465
|
codewhale: codewhaleTemplate
|
|
338
466
|
};
|
|
339
467
|
var APPEND_SEPARATOR = "\n\n---\n_Generated by Kuma MCP - https://github.com/plumpslabs/kuma_\n\n";
|
|
340
|
-
function handleOpencodeSecondary(
|
|
468
|
+
function handleOpencodeSecondary(root, results) {
|
|
469
|
+
const skillPath = path.resolve(root, ".agents", "skills", "kuma", "SKILL.md");
|
|
470
|
+
if (results.some((r) => r.filePath === ".agents/skills/kuma/SKILL.md")) return;
|
|
471
|
+
try {
|
|
472
|
+
const dir = path.dirname(skillPath);
|
|
473
|
+
const content = [
|
|
474
|
+
"---",
|
|
475
|
+
"name: kuma-mcp",
|
|
476
|
+
"description: Kuma MCP \u2014 safety toolkit for AI coding agents. Research, memory, and safety guard.",
|
|
477
|
+
"---",
|
|
478
|
+
"",
|
|
479
|
+
"Kuma MCP tools are installed. All behavioral rules are in `.kuma/init.md`.",
|
|
480
|
+
"**Before coding, call `kuma_init()` to load project context and session memory.**",
|
|
481
|
+
"Project knowledge persists in `.kuma/memories/*.md` across sessions.",
|
|
482
|
+
"",
|
|
483
|
+
"\u{1F4D6} Read `.kuma/init.md` for detailed rules."
|
|
484
|
+
].join("\n");
|
|
485
|
+
if (fs.existsSync(skillPath)) {
|
|
486
|
+
const existing = fs.readFileSync(skillPath, "utf-8");
|
|
487
|
+
if (existing.includes("kuma-mcp")) {
|
|
488
|
+
results.push({ type: "opencode", filePath: ".agents/skills/kuma/SKILL.md", action: "skipped" });
|
|
489
|
+
return;
|
|
490
|
+
}
|
|
491
|
+
const newContent = existing.trimEnd() + "\n\n---\n\n" + content;
|
|
492
|
+
fs.writeFileSync(skillPath, newContent, "utf-8");
|
|
493
|
+
results.push({ type: "opencode", filePath: ".agents/skills/kuma/SKILL.md", action: "appended" });
|
|
494
|
+
} else {
|
|
495
|
+
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
496
|
+
fs.writeFileSync(skillPath, content, "utf-8");
|
|
497
|
+
results.push({ type: "opencode", filePath: ".agents/skills/kuma/SKILL.md", action: "created" });
|
|
498
|
+
}
|
|
499
|
+
} catch (err) {
|
|
500
|
+
results.push({
|
|
501
|
+
type: "opencode",
|
|
502
|
+
filePath: ".agents/skills/kuma/SKILL.md",
|
|
503
|
+
action: "error",
|
|
504
|
+
error: err instanceof Error ? err.message : String(err)
|
|
505
|
+
});
|
|
506
|
+
}
|
|
341
507
|
}
|
|
342
508
|
function handleCodexSecondary(root, results) {
|
|
343
509
|
const tomlPath = path.resolve(root, ".codex/config.toml");
|
|
@@ -412,7 +578,7 @@ function handleQwenSecondary(root, results) {
|
|
|
412
578
|
});
|
|
413
579
|
}
|
|
414
580
|
}
|
|
415
|
-
var AGENTS_MD_TYPES = ["codex", "qwen", "copilot"];
|
|
581
|
+
var AGENTS_MD_TYPES = ["opencode", "codex", "qwen", "copilot"];
|
|
416
582
|
function getAgentsMdHeader() {
|
|
417
583
|
return [
|
|
418
584
|
"# Kuma MCP - Combined Agent Instructions",
|
|
@@ -427,7 +593,7 @@ function getAgentsMdHeader() {
|
|
|
427
593
|
}
|
|
428
594
|
function getCombinedAgentsMd(selectedTypes) {
|
|
429
595
|
const sections = [getAgentsMdHeader()];
|
|
430
|
-
const agentOrder = ["codex", "qwen", "copilot"];
|
|
596
|
+
const agentOrder = ["opencode", "codex", "qwen", "copilot"];
|
|
431
597
|
for (const t of agentOrder) {
|
|
432
598
|
if (selectedTypes.has(t)) {
|
|
433
599
|
sections.push(TEMPLATES[t]());
|
|
@@ -666,6 +832,7 @@ function runInit(options) {
|
|
|
666
832
|
fs.writeFileSync(fullPath, combinedContent, "utf-8");
|
|
667
833
|
results.push({ type, filePath: relativePath, action: "created" });
|
|
668
834
|
}
|
|
835
|
+
if (selectedSet.has("opencode")) handleOpencodeSecondary(root, results);
|
|
669
836
|
if (selectedSet.has("codex")) handleCodexSecondary(root, results);
|
|
670
837
|
if (selectedSet.has("qwen")) handleQwenSecondary(root, results);
|
|
671
838
|
if (selectedSet.has("copilot")) handleCopilotSecondary(root, results);
|
|
@@ -710,8 +877,6 @@ function runInit(options) {
|
|
|
710
877
|
handleCodewhaleSecondary(root, results);
|
|
711
878
|
} else if (type === "aider") {
|
|
712
879
|
handleAiderSecondary(root, results);
|
|
713
|
-
} else if (type === "opencode") {
|
|
714
|
-
handleOpencodeSecondary(root, results);
|
|
715
880
|
}
|
|
716
881
|
}
|
|
717
882
|
} catch (err) {
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
ALL_CONFIG_TYPES,
|
|
9
9
|
formatInitResults,
|
|
10
10
|
runInit
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-CRQ7WTPV.js";
|
|
12
12
|
import {
|
|
13
13
|
formatDecisionTemplate,
|
|
14
14
|
getProactiveMemories,
|
|
@@ -2161,7 +2161,7 @@ async function handleVerify(params) {
|
|
|
2161
2161
|
function registerAllTools(server) {
|
|
2162
2162
|
server.tool(
|
|
2163
2163
|
"kuma_context",
|
|
2164
|
-
"**Call FIRST every session.** Understand your project before making changes
|
|
2164
|
+
"**Call FIRST every session.** Understand your project before making changes.\n\nWORKFLOW:\n\u2022 STEP 1 (ALWAYS): `init` \u2014 load project brief, restore session\n\u2022 STEP 3 (BEFORE edits): `research` \u2014 5-step pipeline (cache\u2192staleness\u2192graph\u2192impact\u2192decision)\n\u2022 STEP 8 (END of session): `changes` \u2014 review what you modified\n\nOther actions: impact (analyze changes), navigate (trace flow), health (score 0-100), digest (compact briefing), drift (detect staleness).",
|
|
2165
2165
|
{
|
|
2166
2166
|
action: z.enum(["init", "research", "impact", "navigate", "changes", "health", "rollback", "researches", "sync", "visualize", "digest", "drift", "progressive"]).describe("Action: init=project brief, research=5-step research pipeline (REQUIRED before edits), impact=analyze change effects, navigate=trace code flow, changes=view change log, rollback=undo a change by ID, researches=list all cached research, sync=unified batch state, visualize=Mermaid knowledge graph diagram, digest=ultra-compact <500 token project briefing (Issue #18), drift=detect memory staleness & code drift (Issue #20), progressive=progressive context loading (Issue #25), health=project health score"),
|
|
2167
2167
|
scope: z.string().optional().describe("Research scope for research/progressive action"),
|
|
@@ -2190,7 +2190,7 @@ function registerAllTools(server) {
|
|
|
2190
2190
|
);
|
|
2191
2191
|
server.tool(
|
|
2192
2192
|
"kuma_memory",
|
|
2193
|
-
"
|
|
2193
|
+
"**Call AFTER editing** to persist what you learned.\n\nAFTER EDITING (call these yourself):\n\u2022 STEP 5: `research_save` \u2014 save findings into knowledge graph\n\u2022 STEP 6: `decision` \u2014 record architecture decisions (ADR)\n\nMANUAL (call when you discover something):\n\u2022 `gotcha` \u2014 found a quirk/workaround/legacy issue? Log it!\n\u2022 `domain_rules` \u2014 uncovered business rules? Save them!\n\u2022 `arch_flow` \u2014 mapped out architecture flow? Document it!\n\u2022 `context` \u2014 need to inject extra notes? Use this!\n\u2022 `todo` \u2014 create persistent task items\n\u2022 `mine` \u2014 extract historical context from git log\n\nOther actions: session, heal, search, changes, benchmark, layers.",
|
|
2194
2194
|
{
|
|
2195
2195
|
action: z.enum(["decision", "mine", "research_save", "session", "heal", "search", "changes", "todo", "context", "benchmark", "decision_log", "domain_rules", "arch_flow", "gotcha", "layers", "federated", "gen_test", "trajectory", "skills"]).describe("Memory action: decision=ADR, mine=mine git log & comments, research_save=save, session=summary, heal=repair, search=search, changes=log, todo=manage todos, context=inject notes, benchmark=capture/diff, decision_log=manage decisions, domain_rules=Layer 1 business rules (Issue #17), arch_flow=Layer 2 architecture flow (Issue #17), gotcha=Layer 3 known gotchas (Issue #17/#21), layers=all 3 layers summary, federated=resolve federated kuma:// URI (Issue #27), gen_test=generate test from trajectory (Issue #28), trajectory=list trajectories, skills=list distilled skills"),
|
|
2196
2196
|
scope: z.string().optional().describe("Scope for research_save/search/todo/context/mine/federated"),
|
|
@@ -2257,7 +2257,7 @@ function registerAllTools(server) {
|
|
|
2257
2257
|
);
|
|
2258
2258
|
server.tool(
|
|
2259
2259
|
"kuma_safety",
|
|
2260
|
-
"Safety checks, policy enforcement,
|
|
2260
|
+
"Safety checks, policy enforcement, and auto-verification.\n\nWORKFLOW:\n\u2022 STEP 2 (BEFORE work): `guard` \u2014 detect anti-patterns, drift, runaway loops\n\u2022 STEP 7 (AFTER edits): `verify` \u2014 auto-run scoped tests + AST validation\n\nOther actions: check (pre-exec safety), audit (query trail), lock (multi-agent), health (score 0-100), policy (evaluate commands), ast (code validation), checkpoint (snapshot before refactors), contract (pre/post-condition check).",
|
|
2261
2261
|
{
|
|
2262
2262
|
action: z.enum(["guard", "verify", "check", "audit", "lock", "health", "override", "security", "gc", "doctor", "portability", "gitignore", "clean", "policy", "ast", "validate", "checkpoint", "rollback_label", "checkpoint_list", "contract"]).describe("Safety action: guard=anti-patterns, verify=auto-run scoped tests, check=pre-exec safety, audit=query trail, lock=multi-agent, health=score, security=scan leaks, gc=garbage collect, doctor=health check, portability=paths, gitignore=config, clean=purge scratch dir & drift, policy=Policy-as-Code engine (Issue #24), ast/validate=AST-based code validation (Issue #22), checkpoint=create atomic snapshot (Issue #29), rollback_label=restore from checkpoint (Issue #29), checkpoint_list=list checkpoints, contract=run contract checks (Issue #26), override=bypass"),
|
|
2263
2263
|
// Verify params
|
|
@@ -2340,12 +2340,12 @@ Usage:
|
|
|
2340
2340
|
Available config files:
|
|
2341
2341
|
--claude CLAUDE.md (Claude Code)
|
|
2342
2342
|
--cursor .cursor/rules/kuma.mdc (Cursor)
|
|
2343
|
-
--windsurf .
|
|
2343
|
+
--windsurf .windsurf/rules/kuma.md (Windsurf)
|
|
2344
2344
|
--copilot AGENTS.md + .github/skills/ (GitHub Copilot Editor)
|
|
2345
2345
|
--cline .clinerules/kuma.md (Cline)
|
|
2346
2346
|
--aider CONVENTIONS.md + .aider.conf.yml (Aider)
|
|
2347
2347
|
--antigravity .agents/skills/kuma/SKILL.md (Antigravity CLI)
|
|
2348
|
-
--opencode
|
|
2348
|
+
--opencode AGENTS.md + .agents/skills/ (OpenCode)
|
|
2349
2349
|
--codex AGENTS.md + .codex/ (Codex CLI - OpenAI)
|
|
2350
2350
|
--qwen AGENTS.md + settings.json (Qwen Code)
|
|
2351
2351
|
--kiro .kiro/steering/kuma.md (Kiro)
|
|
@@ -2556,7 +2556,7 @@ async function main() {
|
|
|
2556
2556
|
const matchaAgentsMd = path7.resolve(process.cwd(), "AGENTS.md");
|
|
2557
2557
|
const matchaWindsurfRules = path7.resolve(
|
|
2558
2558
|
process.cwd(),
|
|
2559
|
-
".
|
|
2559
|
+
".windsurf"
|
|
2560
2560
|
);
|
|
2561
2561
|
if (fs7.existsSync(matchaSkills) || fs7.existsSync(matchaAgents) || fs7.existsSync(matchaRootSkills) || fs7.existsSync(matchaAgentsMd) || fs7.existsSync(matchaWindsurfRules)) {
|
|
2562
2562
|
console.error(
|
|
@@ -2571,7 +2571,7 @@ async function main() {
|
|
|
2571
2571
|
});
|
|
2572
2572
|
(async () => {
|
|
2573
2573
|
try {
|
|
2574
|
-
const { generateInitMdContent } = await import("./init-
|
|
2574
|
+
const { generateInitMdContent } = await import("./init-OMETJFLM.js");
|
|
2575
2575
|
const fs7 = await import("fs");
|
|
2576
2576
|
const path7 = await import("path");
|
|
2577
2577
|
const initMdPath = path7.resolve(process.cwd(), ".kuma/init.md");
|
|
@@ -2587,8 +2587,8 @@ async function main() {
|
|
|
2587
2587
|
})();
|
|
2588
2588
|
(async () => {
|
|
2589
2589
|
try {
|
|
2590
|
-
const { detectAgent, getSkillPath, getAgentLabel } = await import("./agentDetector-
|
|
2591
|
-
const { generateSkill, getSecondaryFiles } = await import("./skillGenerator-
|
|
2590
|
+
const { detectAgent, getSkillPath, getAgentLabel } = await import("./agentDetector-YOWQVJFR.js");
|
|
2591
|
+
const { generateSkill, getSecondaryFiles } = await import("./skillGenerator-RGXRSBX2.js");
|
|
2592
2592
|
const fs7 = await import("fs");
|
|
2593
2593
|
const path7 = await import("path");
|
|
2594
2594
|
const detection = detectAgent();
|
|
@@ -2745,7 +2745,7 @@ function interactiveSelect() {
|
|
|
2745
2745
|
type: "cursor",
|
|
2746
2746
|
label: "2) Cursor (.cursor/rules/kuma.mdc)"
|
|
2747
2747
|
},
|
|
2748
|
-
{ type: "windsurf", label: "3) Windsurf (.
|
|
2748
|
+
{ type: "windsurf", label: "3) Windsurf (.windsurf/rules/kuma.md)" },
|
|
2749
2749
|
{
|
|
2750
2750
|
type: "copilot",
|
|
2751
2751
|
label: "4) GitHub Copilot Editor (AGENTS.md + Skill)"
|
|
@@ -2759,7 +2759,7 @@ function interactiveSelect() {
|
|
|
2759
2759
|
type: "antigravity",
|
|
2760
2760
|
label: "7) Antigravity CLI (.agents/skills/)"
|
|
2761
2761
|
},
|
|
2762
|
-
{ type: "opencode", label: "8) OpenCode (
|
|
2762
|
+
{ type: "opencode", label: "8) OpenCode (AGENTS.md + skills)" },
|
|
2763
2763
|
{
|
|
2764
2764
|
type: "codex",
|
|
2765
2765
|
label: "9) Codex CLI - OpenAI (AGENTS.md + .codex/config.toml)"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/utils/skillGenerator.ts
|
|
2
2
|
var BOOTSTRAP = [
|
|
3
|
-
"Kuma MCP tools are available. All behavioral rules are in `.kuma/init.md`.",
|
|
4
|
-
|
|
3
|
+
"Kuma MCP tools are available (kuma_context, kuma_memory, kuma_safety). All behavioral rules are in `.kuma/init.md`.",
|
|
4
|
+
'**Before coding, call `kuma_context({ action: "init" })`** to load project context and session memory.',
|
|
5
5
|
"Project knowledge persists in `.kuma/memories/*.md` across sessions."
|
|
6
6
|
].join("\n");
|
|
7
7
|
function generateSkill(type) {
|
|
@@ -141,17 +141,18 @@ function generateCodexConfigToml() {
|
|
|
141
141
|
].join("\n");
|
|
142
142
|
}
|
|
143
143
|
function generateOpencodeSkill() {
|
|
144
|
-
return
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
144
|
+
return [
|
|
145
|
+
"---",
|
|
146
|
+
"name: kuma-mcp",
|
|
147
|
+
"description: Kuma MCP \u2014 safety toolkit for AI coding agents. Research, memory, and safety guard.",
|
|
148
|
+
"---",
|
|
149
|
+
"",
|
|
150
|
+
"Kuma MCP tools are installed. All behavioral rules are in `.kuma/init.md`.",
|
|
151
|
+
"**Before coding, call `kuma_init()` to load project context and session memory.**",
|
|
152
|
+
"Project knowledge persists in `.kuma/memories/*.md` across sessions.",
|
|
153
|
+
"",
|
|
154
|
+
"\u{1F4D6} Read `.kuma/init.md` for detailed rules."
|
|
155
|
+
].join("\n");
|
|
155
156
|
}
|
|
156
157
|
function generateAiderSkill() {
|
|
157
158
|
return [
|
|
@@ -176,16 +177,14 @@ function generateAiderConfig() {
|
|
|
176
177
|
}
|
|
177
178
|
function generateWindsurfSkill() {
|
|
178
179
|
return [
|
|
179
|
-
"# Kuma MCP \u2014 Windsurf
|
|
180
|
+
"# Kuma MCP \u2014 Windsurf",
|
|
180
181
|
"",
|
|
181
|
-
|
|
182
|
+
"Windsurf Cascade agent: Kuma MCP tools are available.",
|
|
183
|
+
"All behavioral rules are in `.kuma/init.md`.",
|
|
184
|
+
"**Before coding, call `kuma_init()` to load project context.**",
|
|
185
|
+
"Project knowledge persists in `.kuma/memories/*.md` across sessions.",
|
|
182
186
|
"",
|
|
183
|
-
"
|
|
184
|
-
" \u2022 `kuma_init()` \u2014 load project context (call first)",
|
|
185
|
-
' \u2022 `kuma_guard({check: "all"})` \u2014 safety check',
|
|
186
|
-
' \u2022 `kuma_verify({action: "test"})` \u2014 verify after edits',
|
|
187
|
-
" \u2022 `.kuma/init.md` \u2014 full behavioral rules",
|
|
188
|
-
" \u2022 `.kuma/memories/` \u2014 persistent project knowledge"
|
|
187
|
+
"Also auto-detected via `.windsurf/skills/` and `.agents/skills/`."
|
|
189
188
|
].join("\n");
|
|
190
189
|
}
|
|
191
190
|
function generateCopilotSkill() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumpslabs/kuma",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.12",
|
|
4
4
|
"description": "Safety-first context & orchestration engine for AI coding agents. MCP server with mandatory research pipeline, knowledge graph, impact analysis, decision memory, and safety guard — works with any MCP client.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|