@plumpslabs/kuma 2.3.12 → 2.3.14

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.
@@ -66,9 +66,23 @@ function configFilePath(type) {
66
66
  }
67
67
  }
68
68
  var BOOTSTRAP_LINES = [
69
- "Kuma MCP tools are installed (kuma_context, kuma_memory, kuma_safety). All behavioral rules are in `.kuma/init.md`.",
69
+ "Kuma MCP tools are installed (kuma_context, kuma_memory, kuma_safety).",
70
70
  '**Before coding, call `kuma_context({ action: "init" })`** to load project context and session memory.',
71
- "Project knowledge persists in `.kuma/memories/*.md` across sessions."
71
+ "Project knowledge persists in `.kuma/memories/*.md` across sessions.",
72
+ "",
73
+ "\u26A0\uFE0F **MANDATORY WORKFLOW** \u2014 Follow in order every session:",
74
+ "",
75
+ ' 1. `kuma_context({ action: "init" })` \u2014 Load context (START HERE)',
76
+ ' 2. `kuma_safety({ action: "guard" })` \u2014 Safety check before work',
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", scope: "<area>" })` \u2014 Save findings',
80
+ ' 6. `kuma_safety({ action: "verify", scope: "<area>" })` \u2014 Verify changes',
81
+ ' 7. `kuma_context({ action: "changes" })` \u2014 Review changes',
82
+ "",
83
+ "\u26D4 Skipping workflow = stale context, missed decisions, unverified code.",
84
+ "\u{1F4D6} Full rules: `.kuma/init.md`",
85
+ "\u{1F9E0} Tools: `kuma_context` | `kuma_memory` | `kuma_safety`"
72
86
  ].join("\n");
73
87
  var KUMA_CORE_INSTRUCTIONS = BOOTSTRAP_LINES;
74
88
  function claudeTemplate() {
@@ -476,11 +490,24 @@ function handleOpencodeSecondary(root, results) {
476
490
  "description: Kuma MCP \u2014 safety toolkit for AI coding agents. Research, memory, and safety guard.",
477
491
  "---",
478
492
  "",
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.**",
493
+ "Kuma MCP tools are installed (kuma_kuma_context, kuma_kuma_memory, kuma_kuma_safety).",
494
+ '**Before coding, call `kuma_kuma_context({ action: "init" })`** to load project context and session memory.',
481
495
  "Project knowledge persists in `.kuma/memories/*.md` across sessions.",
482
496
  "",
483
- "\u{1F4D6} Read `.kuma/init.md` for detailed rules."
497
+ "\u26A0\uFE0F **MANDATORY WORKFLOW** \u2014 Follow in order every session:",
498
+ "",
499
+ ' 1. `kuma_kuma_context({ action: "init" })` \u2014 Load context (START HERE)',
500
+ ' 2. `kuma_kuma_safety({ action: "guard" })` \u2014 Safety check before work',
501
+ ' 3. `kuma_kuma_context({ action: "research", scope: "<area>" })` \u2014 Research before editing',
502
+ " 4. *(edit using native tools)*",
503
+ ' 5. `kuma_kuma_memory({ action: "research_save", scope: "<area>" })` \u2014 Save findings',
504
+ ' 6. `kuma_kuma_safety({ action: "verify", scope: "<area>" })` \u2014 Verify changes',
505
+ ' 7. `kuma_kuma_context({ action: "changes" })` \u2014 Review changes',
506
+ "",
507
+ "\u26A0\uFE0F **OpenCode platform note:** Tool names are prefixed with `kuma_kuma_*`",
508
+ " (server name `kuma` + already-prefixed tool name `kuma_context`).",
509
+ "",
510
+ "\u{1F4D6} Full rules: `.kuma/init.md`"
484
511
  ].join("\n");
485
512
  if (fs.existsSync(skillPath)) {
486
513
  const existing = fs.readFileSync(skillPath, "utf-8");
@@ -579,27 +606,84 @@ function handleQwenSecondary(root, results) {
579
606
  }
580
607
  }
581
608
  var AGENTS_MD_TYPES = ["opencode", "codex", "qwen", "copilot"];
582
- function getAgentsMdHeader() {
583
- return [
584
- "# Kuma MCP - Combined Agent Instructions",
609
+ function getCombinedAgentsMd(selectedTypes) {
610
+ const lines = [
611
+ "# Kuma MCP \u2014 Combined Agent Instructions",
612
+ "",
613
+ "This file contains behavioral rules for AI coding agents. Unused sections can be safely removed.",
614
+ "",
615
+ "---",
616
+ "",
617
+ "## \u26A0\uFE0F MANDATORY WORKFLOW",
618
+ "",
619
+ "Follow these steps in order every session (all platforms):",
620
+ "",
621
+ ' 1. `[kuma_]context({ action: "init" })` \u2014 Load project context (START HERE)',
622
+ ' 2. `[kuma_]safety({ action: "guard" })` \u2014 Safety check before editing',
623
+ ' 3. `[kuma_]context({ action: "research", scope: "<area>" })` \u2014 Research before editing',
624
+ " 4. *(edit using native tools)*",
625
+ ' 5. `[kuma_]memory({ action: "research_save", ... })` \u2014 Save findings',
626
+ ' 6. `[kuma_]safety({ action: "verify", ... })` \u2014 Verify correctness',
627
+ ' 7. `[kuma_]context({ action: "changes" })` \u2014 Review changes',
628
+ "",
629
+ "\u26D4 Skipping workflow = stale context, missed decisions, unverified code.",
585
630
  "",
586
- "This file contains instructions for AI coding agents that read AGENTS.md.",
587
- "Each section applies to a specific agent. Unused sections can be safely removed.",
631
+ "Replace `[kuma_]` with the correct prefix for your platform (see below).",
588
632
  "",
589
633
  "---",
590
- "_Generated by Kuma MCP - https://github.com/plumpslabs/kuma_",
591
634
  ""
592
- ].join("\n");
593
- }
594
- function getCombinedAgentsMd(selectedTypes) {
595
- const sections = [getAgentsMdHeader()];
596
- const agentOrder = ["opencode", "codex", "qwen", "copilot"];
597
- for (const t of agentOrder) {
598
- if (selectedTypes.has(t)) {
599
- sections.push(TEMPLATES[t]());
600
- }
635
+ ];
636
+ if (selectedTypes.has("opencode")) {
637
+ lines.push(
638
+ "### OpenCode",
639
+ "",
640
+ "OpenCode adds the MCP server name (`kuma`) as a prefix to tool names.",
641
+ "The server-registered names (kuma_context, kuma_memory, kuma_safety) become:",
642
+ "",
643
+ "| Action | Call this |",
644
+ "|--------|-----------|",
645
+ '| Init | `kuma_kuma_context({ action: "init" })` |',
646
+ '| Guard | `kuma_kuma_safety({ action: "guard" })` |',
647
+ '| Research | `kuma_kuma_context({ action: "research", scope: "..." })` |',
648
+ '| Save | `kuma_kuma_memory({ action: "research_save", ... })` |',
649
+ '| Verify | `kuma_kuma_safety({ action: "verify", ... })` |',
650
+ '| Changes | `kuma_kuma_context({ action: "changes" })` |',
651
+ "",
652
+ "\u{1F4D6} Skill: `.agents/skills/kuma/SKILL.md`",
653
+ "",
654
+ "---",
655
+ ""
656
+ );
657
+ }
658
+ const nonOpenCode = Array.from(selectedTypes).filter((t) => t !== "opencode");
659
+ if (nonOpenCode.length > 0) {
660
+ lines.push(
661
+ "### Other Platforms",
662
+ "",
663
+ ...nonOpenCode.map((t) => `- ${CONFIG_LABELS[t]}`),
664
+ "",
665
+ "Tool names are registered directly \u2014 no server prefix added:",
666
+ "",
667
+ "| Action | Call this |",
668
+ "|--------|-----------|",
669
+ '| Init | `kuma_context({ action: "init" })` |',
670
+ '| Guard | `kuma_safety({ action: "guard" })` |',
671
+ '| Research | `kuma_context({ action: "research", scope: "..." })` |',
672
+ '| Save | `kuma_memory({ action: "research_save", ... })` |',
673
+ '| Verify | `kuma_safety({ action: "verify", ... })` |',
674
+ '| Changes | `kuma_context({ action: "changes" })` |',
675
+ "",
676
+ "---",
677
+ ""
678
+ );
601
679
  }
602
- return sections.join("\n\n---\n\n");
680
+ lines.push(
681
+ "\u{1F4D6} Rules: `.kuma/init.md`",
682
+ "\u{1F9E0} Memories: `.kuma/memories/*.md`",
683
+ "",
684
+ "_Generated by Kuma MCP - https://github.com/plumpslabs/kuma_"
685
+ );
686
+ return lines.join("\n");
603
687
  }
604
688
  function handleAntigravityMcpConfig(root, results) {
605
689
  const mcpPath = path.resolve(root, ".agents/mcp_config.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-CRQ7WTPV.js";
11
+ } from "./chunk-LRO3HWGC.js";
12
12
  import {
13
13
  formatDecisionTemplate,
14
14
  getProactiveMemories,
@@ -2571,7 +2571,7 @@ async function main() {
2571
2571
  });
2572
2572
  (async () => {
2573
2573
  try {
2574
- const { generateInitMdContent } = await import("./init-OMETJFLM.js");
2574
+ const { generateInitMdContent } = await import("./init-7MWMONZL.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-RGXRSBX2.js");
2591
+ const { generateSkill, getSecondaryFiles } = await import("./skillGenerator-JIHFTNH6.js");
2592
2592
  const fs7 = await import("fs");
2593
2593
  const path7 = await import("path");
2594
2594
  const detection = detectAgent();
@@ -4,7 +4,7 @@ import {
4
4
  formatInitResults,
5
5
  generateInitMdContent,
6
6
  runInit
7
- } from "./chunk-CRQ7WTPV.js";
7
+ } from "./chunk-LRO3HWGC.js";
8
8
  import "./chunk-E2KFPEBT.js";
9
9
  export {
10
10
  ALL_CONFIG_TYPES,
@@ -1,8 +1,22 @@
1
1
  // src/utils/skillGenerator.ts
2
2
  var BOOTSTRAP = [
3
- "Kuma MCP tools are available (kuma_context, kuma_memory, kuma_safety). All behavioral rules are in `.kuma/init.md`.",
3
+ "Kuma MCP tools are available (kuma_context, kuma_memory, kuma_safety).",
4
4
  '**Before coding, call `kuma_context({ action: "init" })`** to load project context and session memory.',
5
- "Project knowledge persists in `.kuma/memories/*.md` across sessions."
5
+ "Project knowledge persists in `.kuma/memories/*.md` across sessions.",
6
+ "",
7
+ "\u26A0\uFE0F **MANDATORY WORKFLOW** \u2014 Follow in order every session:",
8
+ "",
9
+ ' 1. `kuma_context({ action: "init" })` \u2014 Load context (START HERE)',
10
+ ' 2. `kuma_safety({ action: "guard" })` \u2014 Safety check before work',
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", scope: "<area>" })` \u2014 Save findings',
14
+ ' 6. `kuma_safety({ action: "verify", scope: "<area>" })` \u2014 Verify changes',
15
+ ' 7. `kuma_context({ action: "changes" })` \u2014 Review changes',
16
+ "",
17
+ "\u26D4 Skipping workflow = stale context, missed decisions, unverified code.",
18
+ "\u{1F4D6} Full rules: `.kuma/init.md`",
19
+ "\u{1F9E0} Tools: `kuma_context` | `kuma_memory` | `kuma_safety`"
6
20
  ].join("\n");
7
21
  function generateSkill(type) {
8
22
  switch (type) {
@@ -60,8 +74,9 @@ function generateClaudeSkill() {
60
74
  BOOTSTRAP,
61
75
  "",
62
76
  "\u{1F4D6} **Usage:**",
63
- " \u2022 `kuma_init()` \u2014 load project context (call first)",
64
- ' \u2022 `kuma_guard({check: "all"})` \u2014 safety check before risky ops',
77
+ ' \u2022 `kuma_context({ action: "init" })` \u2014 load project context (call first)',
78
+ ' \u2022 `kuma_safety({ action: "guard" })` \u2014 safety check before risky ops',
79
+ ' \u2022 `kuma_safety({ action: "verify", scope: "<area>" })` \u2014 verify after edits',
65
80
  " \u2022 `.kuma/init.md` \u2014 full behavioral rules",
66
81
  " \u2022 `.kuma/memories/` \u2014 persistent project knowledge"
67
82
  ].join("\n");
@@ -76,9 +91,9 @@ function generateCursorSkill() {
76
91
  BOOTSTRAP,
77
92
  "",
78
93
  "\u{1F4D6} **Usage:**",
79
- " \u2022 `kuma_init()` \u2014 load project context (call first)",
80
- ' \u2022 `kuma_guard({check: "all"})` \u2014 safety check before risky ops',
81
- ' \u2022 `kuma_verify({action: "test"})` \u2014 verify after edits',
94
+ ' \u2022 `kuma_context({ action: "init" })` \u2014 load project context (call first)',
95
+ ' \u2022 `kuma_safety({ action: "guard" })` \u2014 safety check before risky ops',
96
+ ' \u2022 `kuma_safety({ action: "verify", scope: "<area>" })` \u2014 verify after edits',
82
97
  " \u2022 `.kuma/init.md` \u2014 full behavioral rules",
83
98
  " \u2022 `.kuma/memories/` \u2014 persistent project knowledge"
84
99
  ].join("\n");
@@ -94,8 +109,9 @@ function generateClineSkill() {
94
109
  BOOTSTRAP,
95
110
  "",
96
111
  "\u{1F4D6} **Usage:**",
97
- " \u2022 `kuma_init()` \u2014 load project context (call first)",
98
- ' \u2022 `kuma_guard({check: "all"})` \u2014 safety check before risky ops',
112
+ ' \u2022 `kuma_context({ action: "init" })` \u2014 load project context (call first)',
113
+ ' \u2022 `kuma_safety({ action: "guard" })` \u2014 safety check before risky ops',
114
+ ' \u2022 `kuma_safety({ action: "verify", scope: "<area>" })` \u2014 verify after edits',
99
115
  " \u2022 `.kuma/init.md` \u2014 full behavioral rules"
100
116
  ].join("\n");
101
117
  }
@@ -109,9 +125,9 @@ function generateAntigravitySkill() {
109
125
  BOOTSTRAP,
110
126
  "",
111
127
  "\u{1F4D6} **Usage:**",
112
- " \u2022 `kuma_init()` \u2014 load project context (call first)",
113
- ' \u2022 `kuma_guard({check: "all"})` \u2014 safety check',
114
- ' \u2022 `kuma_verify({action: "test"})` \u2014 verify after edits',
128
+ ' \u2022 `kuma_context({ action: "init" })` \u2014 load project context (call first)',
129
+ ' \u2022 `kuma_safety({ action: "guard" })` \u2014 safety check',
130
+ ' \u2022 `kuma_safety({ action: "verify", scope: "<area>" })` \u2014 verify after edits',
115
131
  " \u2022 `.kuma/init.md` \u2014 full behavioral rules"
116
132
  ].join("\n");
117
133
  }
@@ -147,9 +163,11 @@ function generateOpencodeSkill() {
147
163
  "description: Kuma MCP \u2014 safety toolkit for AI coding agents. Research, memory, and safety guard.",
148
164
  "---",
149
165
  "",
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.",
166
+ "\u26A0\uFE0F **OpenCode platform note:** Tool names use `kuma_kuma_*` prefix",
167
+ " (server name `kuma` + already-prefixed `kuma_context`).",
168
+ ' Example: `kuma_kuma_context({ action: "init" })`',
169
+ "",
170
+ BOOTSTRAP,
153
171
  "",
154
172
  "\u{1F4D6} Read `.kuma/init.md` for detailed rules."
155
173
  ].join("\n");
@@ -161,8 +179,9 @@ function generateAiderSkill() {
161
179
  BOOTSTRAP,
162
180
  "",
163
181
  "\u{1F4D6} **Usage:**",
164
- " \u2022 `kuma_init()` \u2014 load project context (call first)",
165
- ' \u2022 `kuma_guard({check: "all"})` \u2014 safety check',
182
+ ' \u2022 `kuma_context({ action: "init" })` \u2014 load project context (call first)',
183
+ ' \u2022 `kuma_safety({ action: "guard" })` \u2014 safety check',
184
+ ' \u2022 `kuma_safety({ action: "verify", scope: "<area>" })` \u2014 verify after edits',
166
185
  " \u2022 `.kuma/init.md` \u2014 full behavioral rules"
167
186
  ].join("\n");
168
187
  }
@@ -179,10 +198,7 @@ function generateWindsurfSkill() {
179
198
  return [
180
199
  "# Kuma MCP \u2014 Windsurf",
181
200
  "",
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.",
201
+ BOOTSTRAP,
186
202
  "",
187
203
  "Also auto-detected via `.windsurf/skills/` and `.agents/skills/`."
188
204
  ].join("\n");
@@ -197,8 +213,9 @@ function generateCopilotSkill() {
197
213
  BOOTSTRAP,
198
214
  "",
199
215
  "\u{1F4D6} **Usage:**",
200
- " \u2022 `kuma_init()` \u2014 load project context (call first)",
201
- ' \u2022 `kuma_guard({check: "all"})` \u2014 safety check',
216
+ ' \u2022 `kuma_context({ action: "init" })` \u2014 load project context (call first)',
217
+ ' \u2022 `kuma_safety({ action: "guard" })` \u2014 safety check',
218
+ ' \u2022 `kuma_safety({ action: "verify", scope: "<area>" })` \u2014 verify after edits',
202
219
  " \u2022 `.kuma/init.md` \u2014 full behavioral rules"
203
220
  ].join("\n");
204
221
  }
@@ -209,8 +226,9 @@ function generateQwenSkill() {
209
226
  BOOTSTRAP,
210
227
  "",
211
228
  "\u{1F4D6} **Usage:**",
212
- " \u2022 `kuma_init()` \u2014 load project context (call first)",
213
- ' \u2022 `kuma_guard({check: "all"})` \u2014 safety check',
229
+ ' \u2022 `kuma_context({ action: "init" })` \u2014 load project context (call first)',
230
+ ' \u2022 `kuma_safety({ action: "guard" })` \u2014 safety check',
231
+ ' \u2022 `kuma_safety({ action: "verify", scope: "<area>" })` \u2014 verify after edits',
214
232
  " \u2022 `.kuma/init.md` \u2014 full behavioral rules"
215
233
  ].join("\n");
216
234
  }
@@ -236,9 +254,9 @@ function generateKiroSkill() {
236
254
  BOOTSTRAP,
237
255
  "",
238
256
  "\u{1F4D6} **Usage:**",
239
- " \u2022 `kuma_init()` \u2014 load project context (call first)",
240
- ' \u2022 `kuma_guard({check: "all"})` \u2014 safety check',
241
- ' \u2022 `kuma_verify({action: "test"})` \u2014 verify after edits',
257
+ ' \u2022 `kuma_context({ action: "init" })` \u2014 load project context (call first)',
258
+ ' \u2022 `kuma_safety({ action: "guard" })` \u2014 safety check',
259
+ ' \u2022 `kuma_safety({ action: "verify", scope: "<area>" })` \u2014 verify after edits',
242
260
  " \u2022 `.kuma/init.md` \u2014 full behavioral rules"
243
261
  ].join("\n");
244
262
  }
@@ -252,8 +270,9 @@ function generateOpenclawSkill() {
252
270
  BOOTSTRAP,
253
271
  "",
254
272
  "\u{1F4D6} **Usage:**",
255
- " \u2022 `kuma_init()` \u2014 load project context (call first)",
256
- ' \u2022 `kuma_guard({check: "all"})` \u2014 safety check',
273
+ ' \u2022 `kuma_context({ action: "init" })` \u2014 load project context (call first)',
274
+ ' \u2022 `kuma_safety({ action: "guard" })` \u2014 safety check',
275
+ ' \u2022 `kuma_safety({ action: "verify", scope: "<area>" })` \u2014 verify after edits',
257
276
  " \u2022 `.kuma/init.md` \u2014 full behavioral rules"
258
277
  ].join("\n");
259
278
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumpslabs/kuma",
3
- "version": "2.3.12",
3
+ "version": "2.3.14",
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",