@plumpslabs/kuma 2.3.10 → 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-3OTNKKBS.js → agentDetector-YOWQVJFR.js} +4 -4
- package/dist/{chunk-J2CBDLXB.js → chunk-CRQ7WTPV.js} +200 -76
- package/dist/index.js +9 -9
- package/dist/{init-LLP6JDFR.js → init-OMETJFLM.js} +1 -1
- package/dist/{skillGenerator-ILZFWO5O.js → skillGenerator-RGXRSBX2.js} +14 -13
- package/package.json +1 -1
|
@@ -43,10 +43,10 @@ var AGENT_DETECTORS = [
|
|
|
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,7 +152,7 @@ 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":
|
|
@@ -28,7 +28,7 @@ var CONFIG_LABELS = {
|
|
|
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)",
|
|
@@ -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;
|
|
@@ -132,19 +132,15 @@ function aiderTemplate() {
|
|
|
132
132
|
KUMA_CORE_INSTRUCTIONS
|
|
133
133
|
].join("\n");
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
},
|
|
145
|
-
instructions: [".kuma/init.md"]
|
|
146
|
-
};
|
|
147
|
-
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");
|
|
148
144
|
}
|
|
149
145
|
function codexTemplate() {
|
|
150
146
|
return [
|
|
@@ -253,74 +249,201 @@ function antigravityMcpConfigTemplate() {
|
|
|
253
249
|
}
|
|
254
250
|
function generateInitMdContent() {
|
|
255
251
|
return [
|
|
256
|
-
"# Kuma Init \u2014
|
|
252
|
+
"# Kuma Init \u2014 Mandatory Workflow",
|
|
257
253
|
"",
|
|
258
254
|
"_(Auto-generated by `kuma init` \u2014 edit this file directly to customize rules)_",
|
|
259
255
|
"",
|
|
260
|
-
"
|
|
261
|
-
"",
|
|
262
|
-
"Kuma provides 3 pipeline-driven tools. Each action triggers a multi-step deterministic workflow internally.",
|
|
263
|
-
"",
|
|
264
|
-
"### \u{1F9E0} kuma_context \u2014 Context & Research (call FIRST every session)",
|
|
265
|
-
"",
|
|
266
|
-
'- `kuma_context({ action: "init" })` \u2014 Load project brief, detect stack, show structure',
|
|
267
|
-
'- **`kuma_context({ action: "research", scope: "..." })` \u2014 WAJIB before editing unfamiliar code**',
|
|
268
|
-
" - 5-step pipeline: load cache \u2192 check staleness \u2192 query graph \u2192 impact analysis \u2192 decision lookup",
|
|
269
|
-
'- `kuma_context({ action: "impact", target: "symbol" })` \u2014 Analyze change effects',
|
|
270
|
-
'- `kuma_context({ action: "navigate", target: "flow" })` \u2014 Trace code flow',
|
|
271
|
-
'- `kuma_context({ action: "changes" })` \u2014 View session change log',
|
|
272
|
-
'- `kuma_context({ action: "health" })` \u2014 Project health score 0-100',
|
|
273
|
-
"",
|
|
274
|
-
"### \u{1F4DD} kuma_memory \u2014 Decision & Knowledge",
|
|
256
|
+
"---",
|
|
275
257
|
"",
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
'
|
|
281
|
-
|
|
282
|
-
|
|
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",
|
|
283
331
|
"",
|
|
284
|
-
"
|
|
332
|
+
"---",
|
|
285
333
|
"",
|
|
286
|
-
|
|
287
|
-
'- **`kuma_safety({ action: "verify", scope: "..." })` \u2014 Auto-run scoped tests & verify correctness**',
|
|
288
|
-
'- `kuma_safety({ action: "check", ... })` \u2014 Pre-execution safety check',
|
|
289
|
-
'- `kuma_safety({ action: "audit" })` \u2014 Query safety audit trail',
|
|
290
|
-
'- `kuma_safety({ action: "lock", lockAction: "acquire", ... })` \u2014 Multi-agent file lock',
|
|
291
|
-
'- `kuma_safety({ action: "health" })` \u2014 Safety score 0-100',
|
|
292
|
-
'- `kuma_safety({ action: "override", ... })` \u2014 Logged safety bypass',
|
|
334
|
+
"## \u{1F4CB} Tool Reference",
|
|
293
335
|
"",
|
|
294
|
-
"
|
|
336
|
+
"### \u{1F9E0} kuma_context \u2014 Context & Research",
|
|
295
337
|
"",
|
|
296
|
-
"
|
|
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 |",
|
|
297
348
|
"",
|
|
298
|
-
|
|
349
|
+
"### \u{1F4DD} kuma_memory \u2014 Decision & Knowledge",
|
|
299
350
|
"",
|
|
300
|
-
"
|
|
301
|
-
"
|
|
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 |",
|
|
302
365
|
"",
|
|
303
|
-
"
|
|
366
|
+
"### \u{1F6E1}\uFE0F kuma_safety \u2014 Safety & Policy",
|
|
304
367
|
"",
|
|
305
|
-
|
|
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 |",
|
|
306
380
|
"",
|
|
307
|
-
"
|
|
381
|
+
"---",
|
|
308
382
|
"",
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
'
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
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)",
|
|
315
412
|
"",
|
|
316
|
-
"
|
|
413
|
+
"---",
|
|
317
414
|
"",
|
|
318
|
-
"
|
|
319
|
-
"
|
|
320
|
-
"
|
|
321
|
-
"
|
|
322
|
-
"
|
|
323
|
-
"
|
|
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 |",
|
|
324
447
|
"",
|
|
325
448
|
"---",
|
|
326
449
|
"_Generated by Kuma MCP - https://github.com/plumpslabs/kuma_"
|
|
@@ -334,7 +457,7 @@ var TEMPLATES = {
|
|
|
334
457
|
cline: clineRulesTemplate,
|
|
335
458
|
aider: aiderTemplate,
|
|
336
459
|
antigravity: antigravitySkillTemplate,
|
|
337
|
-
opencode:
|
|
460
|
+
opencode: opencodeAgentsMdTemplate,
|
|
338
461
|
codex: codexTemplate,
|
|
339
462
|
qwen: qwenTemplate,
|
|
340
463
|
kiro: kiroRulesTemplate,
|
|
@@ -357,7 +480,7 @@ function handleOpencodeSecondary(root, results) {
|
|
|
357
480
|
"**Before coding, call `kuma_init()` to load project context and session memory.**",
|
|
358
481
|
"Project knowledge persists in `.kuma/memories/*.md` across sessions.",
|
|
359
482
|
"",
|
|
360
|
-
"
|
|
483
|
+
"\u{1F4D6} Read `.kuma/init.md` for detailed rules."
|
|
361
484
|
].join("\n");
|
|
362
485
|
if (fs.existsSync(skillPath)) {
|
|
363
486
|
const existing = fs.readFileSync(skillPath, "utf-8");
|
|
@@ -365,7 +488,9 @@ function handleOpencodeSecondary(root, results) {
|
|
|
365
488
|
results.push({ type: "opencode", filePath: ".agents/skills/kuma/SKILL.md", action: "skipped" });
|
|
366
489
|
return;
|
|
367
490
|
}
|
|
368
|
-
|
|
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" });
|
|
369
494
|
} else {
|
|
370
495
|
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
371
496
|
fs.writeFileSync(skillPath, content, "utf-8");
|
|
@@ -453,7 +578,7 @@ function handleQwenSecondary(root, results) {
|
|
|
453
578
|
});
|
|
454
579
|
}
|
|
455
580
|
}
|
|
456
|
-
var AGENTS_MD_TYPES = ["codex", "qwen", "copilot"];
|
|
581
|
+
var AGENTS_MD_TYPES = ["opencode", "codex", "qwen", "copilot"];
|
|
457
582
|
function getAgentsMdHeader() {
|
|
458
583
|
return [
|
|
459
584
|
"# Kuma MCP - Combined Agent Instructions",
|
|
@@ -468,7 +593,7 @@ function getAgentsMdHeader() {
|
|
|
468
593
|
}
|
|
469
594
|
function getCombinedAgentsMd(selectedTypes) {
|
|
470
595
|
const sections = [getAgentsMdHeader()];
|
|
471
|
-
const agentOrder = ["codex", "qwen", "copilot"];
|
|
596
|
+
const agentOrder = ["opencode", "codex", "qwen", "copilot"];
|
|
472
597
|
for (const t of agentOrder) {
|
|
473
598
|
if (selectedTypes.has(t)) {
|
|
474
599
|
sections.push(TEMPLATES[t]());
|
|
@@ -707,6 +832,7 @@ function runInit(options) {
|
|
|
707
832
|
fs.writeFileSync(fullPath, combinedContent, "utf-8");
|
|
708
833
|
results.push({ type, filePath: relativePath, action: "created" });
|
|
709
834
|
}
|
|
835
|
+
if (selectedSet.has("opencode")) handleOpencodeSecondary(root, results);
|
|
710
836
|
if (selectedSet.has("codex")) handleCodexSecondary(root, results);
|
|
711
837
|
if (selectedSet.has("qwen")) handleQwenSecondary(root, results);
|
|
712
838
|
if (selectedSet.has("copilot")) handleCopilotSecondary(root, results);
|
|
@@ -751,8 +877,6 @@ function runInit(options) {
|
|
|
751
877
|
handleCodewhaleSecondary(root, results);
|
|
752
878
|
} else if (type === "aider") {
|
|
753
879
|
handleAiderSecondary(root, results);
|
|
754
|
-
} else if (type === "opencode") {
|
|
755
|
-
handleOpencodeSecondary(root, results);
|
|
756
880
|
}
|
|
757
881
|
}
|
|
758
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
|
|
@@ -2345,7 +2345,7 @@ Available config files:
|
|
|
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)
|
|
@@ -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();
|
|
@@ -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 [
|
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",
|