@plumpslabs/kuma 2.3.14 → 2.3.16
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.
|
@@ -70,17 +70,23 @@ var BOOTSTRAP_LINES = [
|
|
|
70
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
|
"",
|
|
73
|
-
"\u26A0\uFE0F **MANDATORY WORKFLOW** \u2014 Follow in order every session:",
|
|
73
|
+
"\u26A0\uFE0F **MANDATORY WORKFLOW** \u2014 Follow in order every session (including research-only):",
|
|
74
74
|
"",
|
|
75
|
-
' 1. `kuma_context({ action: "init" })`
|
|
76
|
-
' 2. `kuma_safety({ action: "guard" })`
|
|
75
|
+
' 1. `kuma_context({ action: "init" })` \u2014 Load context (START HERE)',
|
|
76
|
+
' 2. `kuma_safety({ action: "guard" })` \u2014 Safety check before work',
|
|
77
77
|
' 3. `kuma_context({ action: "research", scope: "<area>" })` \u2014 Research before editing',
|
|
78
|
-
" 4. *(edit using native tools)*",
|
|
79
|
-
' 5. `kuma_memory({ action: "research_save",
|
|
80
|
-
' 6. `
|
|
81
|
-
' 7. `
|
|
78
|
+
" 4. *(edit/read using native tools)*",
|
|
79
|
+
' 5. `kuma_memory({ action: "research_save", ... })` \u2014 IMMEDIATELY after every read/grep (inline)',
|
|
80
|
+
' 6. `kuma_memory({ action: "gotcha" })` \u2014 IMMEDIATELY when bug/quirks found (inline)',
|
|
81
|
+
' 7. `kuma_memory({ action: "arch_flow" })` \u2014 IMMEDIATELY after tracing each flow hop (inline)',
|
|
82
|
+
' 8. `kuma_memory({ action: "decision" })` \u2014 IMMEDIATELY when choosing between options (inline)',
|
|
83
|
+
' 9. `kuma_safety({ action: "verify", ... })` \u2014 Run tests / confirm nothing broken',
|
|
84
|
+
' 10. `kuma_context({ action: "changes" })` \u2014 Review session activity',
|
|
82
85
|
"",
|
|
83
|
-
"\
|
|
86
|
+
"\u{1F504} Record findings INLINE as you work \u2014 not just at steps 5-8. Every read/grep = mini research_save.",
|
|
87
|
+
"\u{1F9E0} Knowledge graph is persistent \u2014 nodes/edges accumulate across sessions, getting richer over time.",
|
|
88
|
+
"",
|
|
89
|
+
"\u26D4 Do NOT skip steps 5-10 after research \u2014 even if no code was changed.",
|
|
84
90
|
"\u{1F4D6} Full rules: `.kuma/init.md`",
|
|
85
91
|
"\u{1F9E0} Tools: `kuma_context` | `kuma_memory` | `kuma_safety`"
|
|
86
92
|
].join("\n");
|
|
@@ -294,54 +300,71 @@ function generateInitMdContent() {
|
|
|
294
300
|
"",
|
|
295
301
|
"> \u26D4 DO NOT EDIT FILES BEFORE STEP 3 \u2014 Unless trivial/minor change",
|
|
296
302
|
"",
|
|
297
|
-
"### STEP 4: EDIT \u2014 Implement (Use Agent Native Tools)",
|
|
303
|
+
"### STEP 4: EDIT/READ \u2014 Implement (Use Agent Native Tools)",
|
|
298
304
|
"```",
|
|
299
305
|
"# Use agent BUILT-IN tools to read, grep, edit, create files",
|
|
300
306
|
"# Kuma does NOT manage files \u2014 that's your agent's job",
|
|
301
307
|
"```",
|
|
302
308
|
"",
|
|
309
|
+
"> \u26A0\uFE0F **Research-only sessions included.** Workflow ini wajib meskipun session hanya membaca/riset tanpa code changes.",
|
|
310
|
+
"",
|
|
311
|
+
"> \u{1F9E0} **Graph Philosophy:** Record findings INLINE as you work, not just at the end. Every time you read a",
|
|
312
|
+
"> file, grep a pattern, or trace a flow \u2014 call `research_save` immediately to persist file/func/import nodes.",
|
|
313
|
+
"> The knowledge graph accumulates across sessions. The more you use it, the richer it becomes.",
|
|
314
|
+
"",
|
|
303
315
|
"**AUTO-RECORDED nodes/edges** (Kuma scanner detects these automatically):",
|
|
304
316
|
"- Files, Functions, Classes \u2192 created as graph nodes",
|
|
305
317
|
"- Imports, Calls, Extends \u2192 created as graph edges",
|
|
306
318
|
"- Variables, Components, Routes \u2192 created when detected",
|
|
307
319
|
"",
|
|
308
|
-
"**
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
"",
|
|
318
|
-
"
|
|
320
|
+
"**RECORD INLINE \u2014 Don't wait for steps 5-8:**",
|
|
321
|
+
"- After EVERY `read` that finds new files \u2192 call `research_save` mini (persist file nodes)",
|
|
322
|
+
"- After EVERY `grep` that discovers new functions \u2192 call `research_save` (persist function nodes)",
|
|
323
|
+
"- When you discover a bug/quirk \u2192 call `gotcha` IMMEDIATELY (not at step 6)",
|
|
324
|
+
"- When you trace a data flow hop \u2192 call `arch_flow` IMMEDIATELY (not at step 7)",
|
|
325
|
+
"- When you choose between options \u2192 call `decision` IMMEDIATELY (not at step 8)",
|
|
326
|
+
"",
|
|
327
|
+
"### STEP 5: Save Research (RECORD INLINE \u2014 After Every Read/Grep)",
|
|
328
|
+
"```",
|
|
329
|
+
'kuma_memory({ action: "research_save", scope: "<file or area>", confidence: 0.8 })',
|
|
330
|
+
"```",
|
|
331
|
+
"**When:** After EVERY read/grep that discovers new files, functions, imports, or patterns. Don't wait \u2014 record inline!",
|
|
332
|
+
"**Why:** Persist findings into knowledge graph + research cache. Graph grows richer across sessions.",
|
|
333
|
+
"",
|
|
334
|
+
"### STEP 6: Record Gotchas (RECORD INLINE \u2014 When Bug Found)",
|
|
335
|
+
"```",
|
|
336
|
+
'kuma_memory({ action: "gotcha", filePath: "<file>", description: "...", severity: "medium" })',
|
|
337
|
+
"```",
|
|
338
|
+
"**When:** IMMEDIATELY when you discover bugs, quirks, unexpected behavior, or workarounds. Record INLINE, don't save for later.",
|
|
339
|
+
"**Why:** Prevents future agents from hitting the same issues. Every bug = a gotcha. Skip now = lost forever.",
|
|
340
|
+
"",
|
|
341
|
+
"### STEP 7: Record Arch Flow (RECORD INLINE \u2014 When Tracing Flow)",
|
|
319
342
|
"```",
|
|
320
|
-
'kuma_memory({ action: "
|
|
343
|
+
'kuma_memory({ action: "arch_flow", content: "..." })',
|
|
321
344
|
"```",
|
|
322
|
-
"**When:**
|
|
323
|
-
"**Why:**
|
|
345
|
+
"**When:** IMMEDIATELY after tracing EACH hop in a data/control flow. Record INLINE, then continue tracing the next hop.",
|
|
346
|
+
"**Why:** Architecture knowledge dissipates fast. Record each hop before moving to the next file/task.",
|
|
324
347
|
"",
|
|
325
|
-
"### STEP
|
|
348
|
+
"### STEP 8: Record Decision (RECORD INLINE \u2014 When Choosing)",
|
|
326
349
|
"```",
|
|
327
350
|
'kuma_memory({ action: "decision", decisionAction: "record", title: "...", outcome: "..." })',
|
|
328
351
|
"```",
|
|
329
|
-
"**When:**
|
|
330
|
-
"**Why:** Saves ADR (Architecture Decision Record)
|
|
352
|
+
"**When:** IMMEDIATELY when you choose between 2+ options, uncover an architecture pattern, or identify a root cause.",
|
|
353
|
+
"**Why:** Saves ADR (Architecture Decision Record). Bukan cuma code changes \u2014 temuan, tradeoffs, root causes juga.",
|
|
331
354
|
"",
|
|
332
|
-
"### STEP
|
|
355
|
+
"### STEP 9: Verify (MANDATORY \u2014 After Research/Editing)",
|
|
333
356
|
"```",
|
|
334
357
|
'kuma_safety({ action: "verify", scope: "<area or file>" })',
|
|
335
358
|
"```",
|
|
336
|
-
"**When:** After edits are done, before switching tasks",
|
|
337
|
-
|
|
359
|
+
"**When:** After research/edits are done, before switching tasks. Even for research-only \u2014 confirms nothing is broken.",
|
|
360
|
+
'**Why:** Auto-run scoped tests + AST code validation. If no test framework, at minimum report "No tests to run".',
|
|
338
361
|
"",
|
|
339
|
-
"### STEP
|
|
362
|
+
"### STEP 10: Check Changes (MANDATORY \u2014 End of Session)",
|
|
340
363
|
"```",
|
|
341
364
|
'kuma_context({ action: "changes" })',
|
|
342
365
|
"```",
|
|
343
|
-
"**When:** End of session or before git commit",
|
|
344
|
-
"**Why:**
|
|
366
|
+
"**When:** End of session or before git commit. Even 0 changes = valid result to confirm.",
|
|
367
|
+
"**Why:** View session log of all modifications + tool calls made in this session.",
|
|
345
368
|
"",
|
|
346
369
|
"---",
|
|
347
370
|
"",
|
|
@@ -355,7 +378,7 @@ function generateInitMdContent() {
|
|
|
355
378
|
"| `research` | 5-step research pipeline | STEP 3 \u2014 Before edits |",
|
|
356
379
|
"| `impact` | Analyze change effects on symbol | After research, before design |",
|
|
357
380
|
"| `navigate` | Trace code flow | When need to understand call flow |",
|
|
358
|
-
"| `changes` | View session change log | STEP
|
|
381
|
+
"| `changes` | View session change log | STEP 10 \u2014 End of session |",
|
|
359
382
|
"| `health` | Project health score 0-100 | Periodic check |",
|
|
360
383
|
"| `digest` | Ultra-compact project briefing | Session start (alt to init) |",
|
|
361
384
|
"| `drift` | Detect memory staleness | When suspecting stale context |",
|
|
@@ -364,17 +387,17 @@ function generateInitMdContent() {
|
|
|
364
387
|
"",
|
|
365
388
|
"| Action | Description | When to Call |",
|
|
366
389
|
"|--------|-------------|--------------|",
|
|
367
|
-
"| `research_save` | Save research results | STEP 5 \u2014
|
|
368
|
-
"| `
|
|
390
|
+
"| `research_save` | Save research results | STEP 5 \u2014 IMMEDIATELY after every read/grep (inline) |",
|
|
391
|
+
"| `gotcha` | Record bugs/quirks/workarounds | STEP 6 \u2014 IMMEDIATELY when bug found (inline) |",
|
|
392
|
+
"| `arch_flow` | Document architecture flow | STEP 7 \u2014 IMMEDIATELY after each flow hop (inline) |",
|
|
393
|
+
"| `decision` | ADR-style decision record | STEP 8 \u2014 IMMEDIATELY when choosing (inline) |",
|
|
369
394
|
"| `mine` | Mine decisions from git log | When need historical context |",
|
|
370
395
|
"| `session` | Session summary | End of session |",
|
|
371
396
|
"| `heal` | Self-heal knowledge graph | When graph has errors |",
|
|
372
397
|
"| `search` | Search memories + graph | Find stored information |",
|
|
373
398
|
"| `todo` | Persistent todo CRUD | When managing tasks |",
|
|
374
|
-
"| `context` | Inject context notes |
|
|
375
|
-
"| `domain_rules` | Layer 1: business rules |
|
|
376
|
-
"| `arch_flow` | Layer 2: architecture flow | Manual \u2014 document architecture |",
|
|
377
|
-
"| `gotcha` | Layer 3: known gotchas | Manual \u2014 log quirks/legacy |",
|
|
399
|
+
"| `context` | Inject context notes | Additional notes when needed |",
|
|
400
|
+
"| `domain_rules` | Layer 1: business rules | Record business rules when discovered |",
|
|
378
401
|
"| `layers` | Show all 3 layers summary | Overview memory layers |",
|
|
379
402
|
"",
|
|
380
403
|
"### \u{1F6E1}\uFE0F kuma_safety \u2014 Safety & Policy",
|
|
@@ -382,7 +405,7 @@ function generateInitMdContent() {
|
|
|
382
405
|
"| Action | Description | When to Call |",
|
|
383
406
|
"|--------|-------------|--------------|",
|
|
384
407
|
"| `guard` | Anti-pattern, drift, loop | STEP 2 \u2014 Before work |",
|
|
385
|
-
"| `verify` | Auto-run scoped tests | STEP
|
|
408
|
+
"| `verify` | Auto-run scoped tests + validation | STEP 9 \u2014 After research/edits |",
|
|
386
409
|
"| `check` | Pre-execution safety check | Before risky operations |",
|
|
387
410
|
"| `audit` | Query safety audit trail | Security investigation |",
|
|
388
411
|
"| `lock` | Multi-agent file lock | Multi-agent collaboration |",
|
|
@@ -429,20 +452,23 @@ function generateInitMdContent() {
|
|
|
429
452
|
"## \u{1F4CC} Workflow Summary",
|
|
430
453
|
"",
|
|
431
454
|
"```",
|
|
432
|
-
"EVERY SESSION (Mandatory):",
|
|
433
|
-
" 1. kuma_context \u2192 init
|
|
434
|
-
" 2. kuma_safety \u2192 guard
|
|
435
|
-
" 3. kuma_context \u2192 research
|
|
436
|
-
" --- EDIT (use native tools) ---",
|
|
437
|
-
" 5. kuma_memory \u2192 research_save
|
|
438
|
-
" 6. kuma_memory \u2192
|
|
439
|
-
" 7.
|
|
440
|
-
" 8.
|
|
441
|
-
"",
|
|
442
|
-
"
|
|
455
|
+
"EVERY SESSION (Mandatory \u2014 including research-only):",
|
|
456
|
+
" 1. kuma_context \u2192 init \u2014 Load project context",
|
|
457
|
+
" 2. kuma_safety \u2192 guard \u2014 Safety check",
|
|
458
|
+
" 3. kuma_context \u2192 research \u2014 Research target area",
|
|
459
|
+
" --- EDIT/READ (use native tools) ---",
|
|
460
|
+
" 5. kuma_memory \u2192 research_save \u2014 Save findings (inline after every read/grep)",
|
|
461
|
+
" 6. kuma_memory \u2192 gotcha \u2014 Record bugs/quirks (inline when found)",
|
|
462
|
+
" 7. kuma_memory \u2192 arch_flow \u2014 Record data flow (inline after each hop)",
|
|
463
|
+
" 8. kuma_memory \u2192 decision \u2014 Record key decisions (inline when choosing)",
|
|
464
|
+
" 9. kuma_safety \u2192 verify \u2014 Run tests / confirm nothing broken",
|
|
465
|
+
" 10. kuma_context \u2192 changes \u2014 Review session activity",
|
|
466
|
+
"",
|
|
467
|
+
"\u{1F504} Record INLINE as you work \u2014 not just at steps 5-8. Every read/grep = mini research_save.",
|
|
468
|
+
"\u{1F9E0} Graph is persistent \u2014 nodes/edges accumulate across sessions.",
|
|
469
|
+
"",
|
|
470
|
+
"ON DISCOVERY (When needed):",
|
|
443
471
|
" kuma_memory \u2192 domain_rules \u2014 Business rules (Layer 1)",
|
|
444
|
-
" kuma_memory \u2192 arch_flow \u2014 Architecture flow (Layer 2)",
|
|
445
|
-
" kuma_memory \u2192 gotcha \u2014 Known quirks (Layer 3)",
|
|
446
472
|
" kuma_memory \u2192 context \u2014 Additional notes",
|
|
447
473
|
" kuma_memory \u2192 todo \u2014 Task management",
|
|
448
474
|
" kuma_memory \u2192 mine \u2014 Historical context",
|
|
@@ -494,15 +520,21 @@ function handleOpencodeSecondary(root, results) {
|
|
|
494
520
|
'**Before coding, call `kuma_kuma_context({ action: "init" })`** to load project context and session memory.',
|
|
495
521
|
"Project knowledge persists in `.kuma/memories/*.md` across sessions.",
|
|
496
522
|
"",
|
|
497
|
-
"\u26A0\uFE0F **MANDATORY WORKFLOW** \u2014 Follow in order every session:",
|
|
523
|
+
"\u26A0\uFE0F **MANDATORY WORKFLOW** \u2014 Follow in order every session (including research-only):",
|
|
498
524
|
"",
|
|
499
|
-
' 1. `kuma_kuma_context({ action: "init" })`
|
|
500
|
-
' 2. `kuma_kuma_safety({ action: "guard" })`
|
|
501
|
-
' 3. `kuma_kuma_context({ action: "research", scope: "<area>" })`
|
|
502
|
-
" 4. *(edit using native tools)*",
|
|
503
|
-
' 5. `kuma_kuma_memory({ action: "research_save",
|
|
504
|
-
' 6. `
|
|
505
|
-
' 7. `
|
|
525
|
+
' 1. `kuma_kuma_context({ action: "init" })` \u2014 Load context (START HERE)',
|
|
526
|
+
' 2. `kuma_kuma_safety({ action: "guard" })` \u2014 Safety check before work',
|
|
527
|
+
' 3. `kuma_kuma_context({ action: "research", scope: "<area>" })` \u2014 Research before editing',
|
|
528
|
+
" 4. *(edit/read using native tools)*",
|
|
529
|
+
' 5. `kuma_kuma_memory({ action: "research_save", ... })` \u2014 Save findings (inline after every read/grep)',
|
|
530
|
+
' 6. `kuma_kuma_memory({ action: "gotcha" })` \u2014 Record bugs/quirks (inline when found)',
|
|
531
|
+
' 7. `kuma_kuma_memory({ action: "arch_flow" })` \u2014 Record data flow (inline after each hop)',
|
|
532
|
+
' 8. `kuma_kuma_memory({ action: "decision" })` \u2014 Record key decisions (inline when choosing)',
|
|
533
|
+
' 9. `kuma_kuma_safety({ action: "verify", ... })` \u2014 Run tests / confirm nothing broken',
|
|
534
|
+
' 10. `kuma_kuma_context({ action: "changes" })` \u2014 Review session activity',
|
|
535
|
+
"",
|
|
536
|
+
"\u{1F504} Record findings INLINE as you work \u2014 Every read/grep = mini research_save.",
|
|
537
|
+
"\u{1F9E0} Graph is persistent \u2014 nodes/edges accumulate across sessions.",
|
|
506
538
|
"",
|
|
507
539
|
"\u26A0\uFE0F **OpenCode platform note:** Tool names are prefixed with `kuma_kuma_*`",
|
|
508
540
|
" (server name `kuma` + already-prefixed tool name `kuma_context`).",
|
|
@@ -614,19 +646,28 @@ function getCombinedAgentsMd(selectedTypes) {
|
|
|
614
646
|
"",
|
|
615
647
|
"---",
|
|
616
648
|
"",
|
|
649
|
+
'> \u26A0\uFE0F **WARNING:** Agent often skip steps due to "research-only" bias. Do NOT skip.',
|
|
650
|
+
"> Follow the full 10-step workflow even for read-only investigations.",
|
|
651
|
+
"",
|
|
617
652
|
"## \u26A0\uFE0F MANDATORY WORKFLOW",
|
|
618
653
|
"",
|
|
619
|
-
"Follow these steps in order every session (
|
|
654
|
+
"Follow these steps in order every session (including research-only):",
|
|
620
655
|
"",
|
|
621
|
-
' 1. `[kuma_]context({ action: "init" })`
|
|
622
|
-
' 2. `[kuma_]safety({ action: "guard" })`
|
|
656
|
+
' 1. `[kuma_]context({ action: "init" })` \u2014 Load project context (START HERE)',
|
|
657
|
+
' 2. `[kuma_]safety({ action: "guard" })` \u2014 Safety check before editing',
|
|
623
658
|
' 3. `[kuma_]context({ action: "research", scope: "<area>" })` \u2014 Research before editing',
|
|
624
|
-
" 4. *(edit using native tools)*",
|
|
625
|
-
' 5. `[kuma_]memory({ action: "research_save", ... })`
|
|
626
|
-
' 6. `[kuma_]
|
|
627
|
-
' 7. `[kuma_]
|
|
659
|
+
" 4. *(edit/read using native tools)*",
|
|
660
|
+
' 5. `[kuma_]memory({ action: "research_save", ... })` \u2014 Save all findings',
|
|
661
|
+
' 6. `[kuma_]memory({ action: "gotcha" })` \u2014 Record bugs/quirks found',
|
|
662
|
+
' 7. `[kuma_]memory({ action: "arch_flow" })` \u2014 Record data flow if mapped',
|
|
663
|
+
' 8. `[kuma_]memory({ action: "decision" })` \u2014 Record key findings/decisions',
|
|
664
|
+
' 9. `[kuma_]safety({ action: "verify", ... })` \u2014 Run tests / confirm nothing broken',
|
|
665
|
+
' 10. `[kuma_]context({ action: "changes" })` \u2014 Review session activity',
|
|
666
|
+
"",
|
|
667
|
+
"\u{1F504} Record findings INLINE as you work \u2014 Every read/grep = mini research_save.",
|
|
668
|
+
"\u{1F9E0} Graph is persistent \u2014 nodes/edges accumulate across sessions.",
|
|
628
669
|
"",
|
|
629
|
-
"\u26D4
|
|
670
|
+
"\u26D4 Do NOT skip steps 5-10 after research \u2014 even if no code was changed.",
|
|
630
671
|
"",
|
|
631
672
|
"Replace `[kuma_]` with the correct prefix for your platform (see below).",
|
|
632
673
|
"",
|
|
@@ -820,6 +861,62 @@ function handleOpenclawSecondary(root, results) {
|
|
|
820
861
|
});
|
|
821
862
|
}
|
|
822
863
|
}
|
|
864
|
+
function handleQuickrefGeneration(root, results) {
|
|
865
|
+
const quickrefPath = path.resolve(root, ".kuma/quickref.md");
|
|
866
|
+
const content = [
|
|
867
|
+
"# Kuma Quick Reference",
|
|
868
|
+
"",
|
|
869
|
+
"_(Auto-generated by `kuma init` \u2014 simplified workflow cheat sheet)_",
|
|
870
|
+
"",
|
|
871
|
+
"## Every Session (Mandatory \u2014 including research-only)",
|
|
872
|
+
"",
|
|
873
|
+
' 1. `kuma_context({ action: "init" })` \u2014 Load context',
|
|
874
|
+
' 2. `kuma_safety({ action: "guard" })` \u2014 Safety check',
|
|
875
|
+
' 3. `kuma_context({ action: "research", scope: "<area>" })` \u2014 Research',
|
|
876
|
+
" 4. *(edit/read using native tools)*",
|
|
877
|
+
' 5. `kuma_memory({ action: "research_save", ... })` \u2014 Save findings (inline after every read)',
|
|
878
|
+
' 6. `kuma_memory({ action: "gotcha" })` \u2014 Gotchas (inline when found)',
|
|
879
|
+
' 7. `kuma_memory({ action: "arch_flow" })` \u2014 Arch flow (inline after each hop)',
|
|
880
|
+
' 8. `kuma_memory({ action: "decision" })` \u2014 Decision (inline when choosing)',
|
|
881
|
+
' 9. `kuma_safety({ action: "verify", ... })` \u2014 Verify',
|
|
882
|
+
' 10. `kuma_context({ action: "changes" })` \u2014 Review changes',
|
|
883
|
+
"",
|
|
884
|
+
"\u{1F504} Record INLINE as you work \u2014 Every read/grep = mini research_save.",
|
|
885
|
+
"\u{1F9E0} Graph is persistent \u2014 accumulates across sessions.",
|
|
886
|
+
"",
|
|
887
|
+
"\u26D4 Steps 5-10 are mandatory even for research-only sessions!",
|
|
888
|
+
"",
|
|
889
|
+
"## Platform Tool Names",
|
|
890
|
+
"",
|
|
891
|
+
"- **OpenCode:** Use `kuma_kuma_*` prefix (e.g. `kuma_kuma_context`)",
|
|
892
|
+
"- **Other platforms:** Use `kuma_*` directly (e.g. `kuma_context`)",
|
|
893
|
+
"",
|
|
894
|
+
"\u{1F4D6} Full rules: `.kuma/init.md`",
|
|
895
|
+
"_Generated by Kuma MCP - https://github.com/plumpslabs/kuma_"
|
|
896
|
+
].join("\n");
|
|
897
|
+
try {
|
|
898
|
+
const kumaDir = path.dirname(quickrefPath);
|
|
899
|
+
if (!fs.existsSync(kumaDir)) fs.mkdirSync(kumaDir, { recursive: true });
|
|
900
|
+
if (fs.existsSync(quickrefPath)) {
|
|
901
|
+
const existing = fs.readFileSync(quickrefPath, "utf-8");
|
|
902
|
+
if (existing.includes("_Generated by Kuma MCP_")) {
|
|
903
|
+
results.push({ type: "claude", filePath: ".kuma/quickref.md", action: "skipped" });
|
|
904
|
+
return;
|
|
905
|
+
}
|
|
906
|
+
results.push({ type: "claude", filePath: ".kuma/quickref.md", action: "skipped" });
|
|
907
|
+
} else {
|
|
908
|
+
fs.writeFileSync(quickrefPath, content, "utf-8");
|
|
909
|
+
results.push({ type: "claude", filePath: ".kuma/quickref.md", action: "created" });
|
|
910
|
+
}
|
|
911
|
+
} catch (err) {
|
|
912
|
+
results.push({
|
|
913
|
+
type: "claude",
|
|
914
|
+
filePath: ".kuma/quickref.md",
|
|
915
|
+
action: "error",
|
|
916
|
+
error: err instanceof Error ? err.message : String(err)
|
|
917
|
+
});
|
|
918
|
+
}
|
|
919
|
+
}
|
|
823
920
|
function handleInitMdGeneration(root, results) {
|
|
824
921
|
const initMdPath = path.resolve(root, ".kuma/init.md");
|
|
825
922
|
try {
|
|
@@ -845,6 +942,7 @@ function handleInitMdGeneration(root, results) {
|
|
|
845
942
|
error: err instanceof Error ? err.message : String(err)
|
|
846
943
|
});
|
|
847
944
|
}
|
|
945
|
+
handleQuickrefGeneration(root, results);
|
|
848
946
|
}
|
|
849
947
|
function handleCodewhaleSecondary(root, results) {
|
|
850
948
|
const mcpPath = path.resolve(root, ".codewhale/mcp.json");
|
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-S7BQGNHQ.js";
|
|
12
12
|
import {
|
|
13
13
|
formatDecisionTemplate,
|
|
14
14
|
getProactiveMemories,
|
|
@@ -2190,7 +2190,7 @@ function registerAllTools(server) {
|
|
|
2190
2190
|
);
|
|
2191
2191
|
server.tool(
|
|
2192
2192
|
"kuma_memory",
|
|
2193
|
-
"**Call AFTER editing**
|
|
2193
|
+
"**Call AFTER research/editing every session** (including research-only). Record INLINE as you work.\n\nRECORD INLINE (call IMMEDIATELY during research):\n\u2022 STEP 5: `research_save` \u2014 every read/grep that finds new files/functions. Don't wait!\n\u2022 STEP 6: `gotcha` \u2014 IMMEDIATELY when you discover bugs/quirks. Record INLINE, not at the end.\n\u2022 STEP 7: `arch_flow` \u2014 IMMEDIATELY after EACH flow hop trace. Record before next task.\n\u2022 STEP 8: `decision` \u2014 IMMEDIATELY when choosing between options or finding architecture patterns.\n\nON DISCOVERY (when you encounter something):\n\u2022 `domain_rules` \u2014 uncovered business rules? Save them!\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, and auto-verification.\n\nWORKFLOW:\n\u2022 STEP 2 (BEFORE work): `guard` \u2014 detect anti-patterns, drift, runaway loops\n\u2022 STEP
|
|
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 9 (AFTER research/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
|
|
@@ -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-P3DAC23E.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");
|
|
@@ -2588,7 +2588,7 @@ async function main() {
|
|
|
2588
2588
|
(async () => {
|
|
2589
2589
|
try {
|
|
2590
2590
|
const { detectAgent, getSkillPath, getAgentLabel } = await import("./agentDetector-YOWQVJFR.js");
|
|
2591
|
-
const { generateSkill, getSecondaryFiles } = await import("./skillGenerator-
|
|
2591
|
+
const { generateSkill, getSecondaryFiles } = await import("./skillGenerator-GYEDLFZP.js");
|
|
2592
2592
|
const fs7 = await import("fs");
|
|
2593
2593
|
const path7 = await import("path");
|
|
2594
2594
|
const detection = detectAgent();
|
|
@@ -4,17 +4,23 @@ var BOOTSTRAP = [
|
|
|
4
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
|
"",
|
|
7
|
-
"\u26A0\uFE0F **MANDATORY WORKFLOW** \u2014 Follow in order every session:",
|
|
7
|
+
"\u26A0\uFE0F **MANDATORY WORKFLOW** \u2014 Follow in order every session (including research-only):",
|
|
8
8
|
"",
|
|
9
|
-
' 1. `kuma_context({ action: "init" })`
|
|
10
|
-
' 2. `kuma_safety({ action: "guard" })`
|
|
9
|
+
' 1. `kuma_context({ action: "init" })` \u2014 Load context (START HERE)',
|
|
10
|
+
' 2. `kuma_safety({ action: "guard" })` \u2014 Safety check before work',
|
|
11
11
|
' 3. `kuma_context({ action: "research", scope: "<area>" })` \u2014 Research before editing',
|
|
12
|
-
" 4. *(edit using native tools)*",
|
|
13
|
-
' 5. `kuma_memory({ action: "research_save",
|
|
14
|
-
' 6. `
|
|
15
|
-
' 7. `
|
|
12
|
+
" 4. *(edit/read using native tools)*",
|
|
13
|
+
' 5. `kuma_memory({ action: "research_save", ... })` \u2014 Save findings (inline after every read/grep)',
|
|
14
|
+
' 6. `kuma_memory({ action: "gotcha" })` \u2014 Record bugs/quirks (inline when found)',
|
|
15
|
+
' 7. `kuma_memory({ action: "arch_flow" })` \u2014 Record data flow (inline after each hop)',
|
|
16
|
+
' 8. `kuma_memory({ action: "decision" })` \u2014 Record key decisions (inline when choosing)',
|
|
17
|
+
' 9. `kuma_safety({ action: "verify", ... })` \u2014 Run tests / confirm nothing broken',
|
|
18
|
+
' 10. `kuma_context({ action: "changes" })` \u2014 Review session activity',
|
|
16
19
|
"",
|
|
17
|
-
"\
|
|
20
|
+
"\u{1F504} Record findings INLINE as you work \u2014 Every read/grep = mini research_save.",
|
|
21
|
+
"\u{1F9E0} Knowledge graph is persistent \u2014 nodes/edges accumulate across sessions, getting richer over time.",
|
|
22
|
+
"",
|
|
23
|
+
"\u26D4 Do NOT skip steps 5-10 after research \u2014 even if no code was changed.",
|
|
18
24
|
"\u{1F4D6} Full rules: `.kuma/init.md`",
|
|
19
25
|
"\u{1F9E0} Tools: `kuma_context` | `kuma_memory` | `kuma_safety`"
|
|
20
26
|
].join("\n");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumpslabs/kuma",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.16",
|
|
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",
|