claudekit-cli 3.36.0-dev.8 → 3.36.0-dev.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +127 -20
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -10508,7 +10508,7 @@ var require_gray_matter = __commonJS((exports, module) => {
10508
10508
  // src/commands/portable/converters/direct-copy.ts
10509
10509
  import { readFileSync } from "node:fs";
10510
10510
  import { extname } from "node:path";
10511
- function convertDirectCopy(item) {
10511
+ function convertDirectCopy(item, provider) {
10512
10512
  let content;
10513
10513
  try {
10514
10514
  content = readFileSync(item.sourcePath, "utf-8");
@@ -10519,6 +10519,12 @@ function convertDirectCopy(item) {
10519
10519
  content = item.body;
10520
10520
  }
10521
10521
  }
10522
+ if (provider && provider !== "claude-code") {
10523
+ const targetDir = PROVIDER_CONFIG_DIR[provider];
10524
+ if (targetDir) {
10525
+ content = content.replace(/\.claude\//g, targetDir);
10526
+ }
10527
+ }
10522
10528
  const namespacedName = item.name.includes("/") || item.name.includes("\\") ? item.name.replace(/\\/g, "/") : item.segments && item.segments.length > 0 ? item.segments.join("/") : item.name;
10523
10529
  const sourceExtension = extname(item.sourcePath);
10524
10530
  let filename;
@@ -10533,9 +10539,25 @@ function convertDirectCopy(item) {
10533
10539
  warnings: []
10534
10540
  };
10535
10541
  }
10536
- var import_gray_matter;
10542
+ var import_gray_matter, PROVIDER_CONFIG_DIR;
10537
10543
  var init_direct_copy = __esm(() => {
10538
10544
  import_gray_matter = __toESM(require_gray_matter(), 1);
10545
+ PROVIDER_CONFIG_DIR = {
10546
+ opencode: ".opencode/",
10547
+ droid: ".factory/",
10548
+ windsurf: ".windsurf/",
10549
+ antigravity: ".agent/",
10550
+ cursor: ".cursor/",
10551
+ roo: ".roo/",
10552
+ kilo: ".kilocode/",
10553
+ goose: ".goose/",
10554
+ "gemini-cli": ".gemini/",
10555
+ amp: ".agents/",
10556
+ cline: ".cline/",
10557
+ openhands: ".openhands/",
10558
+ codex: ".codex/",
10559
+ "github-copilot": ".github/"
10560
+ };
10539
10561
  });
10540
10562
 
10541
10563
  // src/commands/portable/converters/fm-strip.ts
@@ -10652,12 +10674,84 @@ ${item.body}
10652
10674
  warnings: []
10653
10675
  };
10654
10676
  }
10677
+ function replaceClaudePathsForOpenCode(content) {
10678
+ return content.replace(/\.claude\//g, ".opencode/");
10679
+ }
10680
+ function convertOpenCodeAgent(item) {
10681
+ const warnings = [];
10682
+ const agentName = item.frontmatter.name || item.name;
10683
+ const mode = agentName === "brainstormer" ? "primary" : "subagent";
10684
+ let toolsObj = null;
10685
+ if (item.frontmatter.tools) {
10686
+ const sourceTools = item.frontmatter.tools.split(",").map((t) => t.trim());
10687
+ const mapped = new Set;
10688
+ for (const tool of sourceTools) {
10689
+ const key = OPENCODE_TOOL_MAP[tool];
10690
+ if (key)
10691
+ mapped.add(key);
10692
+ }
10693
+ if (mapped.size > 0) {
10694
+ toolsObj = {};
10695
+ for (const key of mapped) {
10696
+ toolsObj[key] = true;
10697
+ }
10698
+ }
10699
+ }
10700
+ const fmLines = ["---"];
10701
+ const desc = (item.description || `Agent: ${agentName}`).replace(/\n/g, " ").trim();
10702
+ const truncatedDesc = desc.length > 200 ? `${desc.slice(0, 197)}...` : desc;
10703
+ fmLines.push(`description: ${JSON.stringify(truncatedDesc)}`);
10704
+ fmLines.push(`mode: ${mode}`);
10705
+ if (toolsObj) {
10706
+ fmLines.push("tools:");
10707
+ for (const [key, val] of Object.entries(toolsObj)) {
10708
+ fmLines.push(` ${key}: ${val}`);
10709
+ }
10710
+ }
10711
+ fmLines.push("---");
10712
+ const body = replaceClaudePathsForOpenCode(item.body);
10713
+ const content = `${fmLines.join(`
10714
+ `)}
10715
+
10716
+ ${body}
10717
+ `;
10718
+ return {
10719
+ content,
10720
+ filename: `${item.name}.md`,
10721
+ warnings
10722
+ };
10723
+ }
10724
+ function convertOpenCodeCommand(item) {
10725
+ const fmLines = ["---"];
10726
+ const desc = (item.description || `Command: ${item.name}`).replace(/\n/g, " ").trim();
10727
+ const truncatedDesc = desc.length > 200 ? `${desc.slice(0, 197)}...` : desc;
10728
+ fmLines.push(`description: ${JSON.stringify(truncatedDesc)}`);
10729
+ if (item.frontmatter.agent) {
10730
+ fmLines.push(`agent: ${JSON.stringify(item.frontmatter.agent)}`);
10731
+ }
10732
+ fmLines.push("---");
10733
+ const body = replaceClaudePathsForOpenCode(item.body);
10734
+ const content = `${fmLines.join(`
10735
+ `)}
10736
+
10737
+ ${body}
10738
+ `;
10739
+ return {
10740
+ content,
10741
+ filename: `${item.name}.md`,
10742
+ warnings: []
10743
+ };
10744
+ }
10655
10745
  function convertFmToFm(item, provider) {
10656
10746
  switch (provider) {
10657
10747
  case "github-copilot":
10658
10748
  return convertForCopilot(item);
10659
10749
  case "cursor":
10660
10750
  return convertForCursor(item);
10751
+ case "opencode":
10752
+ if (item.type === "command")
10753
+ return convertOpenCodeCommand(item);
10754
+ return convertOpenCodeAgent(item);
10661
10755
  default:
10662
10756
  return {
10663
10757
  content: item.body,
@@ -10666,7 +10760,7 @@ function convertFmToFm(item, provider) {
10666
10760
  };
10667
10761
  }
10668
10762
  }
10669
- var COPILOT_TOOL_MAP;
10763
+ var COPILOT_TOOL_MAP, OPENCODE_TOOL_MAP;
10670
10764
  var init_fm_to_fm = __esm(() => {
10671
10765
  COPILOT_TOOL_MAP = {
10672
10766
  Read: "read",
@@ -10679,6 +10773,18 @@ var init_fm_to_fm = __esm(() => {
10679
10773
  WebFetch: "fetch",
10680
10774
  WebSearch: "fetch"
10681
10775
  };
10776
+ OPENCODE_TOOL_MAP = {
10777
+ Read: "read",
10778
+ Glob: "glob",
10779
+ Grep: "grep",
10780
+ Edit: "edit",
10781
+ Write: "write",
10782
+ MultiEdit: "patch",
10783
+ Bash: "bash",
10784
+ WebFetch: "webfetch",
10785
+ WebSearch: "websearch",
10786
+ NotebookEdit: "edit"
10787
+ };
10682
10788
  });
10683
10789
 
10684
10790
  // src/commands/portable/converters/fm-to-json.ts
@@ -10913,20 +11019,20 @@ var init_provider_registry = __esm(() => {
10913
11019
  agents: {
10914
11020
  projectPath: ".opencode/agents",
10915
11021
  globalPath: join(home, ".config/opencode/agents"),
10916
- format: "direct-copy",
11022
+ format: "fm-to-fm",
10917
11023
  writeStrategy: "per-file",
10918
11024
  fileExtension: ".md"
10919
11025
  },
10920
11026
  commands: {
10921
11027
  projectPath: ".opencode/commands",
10922
11028
  globalPath: join(home, ".config/opencode/commands"),
10923
- format: "direct-copy",
11029
+ format: "fm-to-fm",
10924
11030
  writeStrategy: "per-file",
10925
11031
  fileExtension: ".md"
10926
11032
  },
10927
11033
  skills: {
10928
- projectPath: ".opencode/skill",
10929
- globalPath: join(home, ".config/opencode/skill"),
11034
+ projectPath: ".opencode/skills",
11035
+ globalPath: join(home, ".config/opencode/skills"),
10930
11036
  format: "direct-copy",
10931
11037
  writeStrategy: "per-file",
10932
11038
  fileExtension: ".md"
@@ -10952,11 +11058,11 @@ var init_provider_registry = __esm(() => {
10952
11058
  join(cwd, "opencode.jsonc"),
10953
11059
  join(cwd, ".opencode/agents"),
10954
11060
  join(cwd, ".opencode/commands"),
10955
- join(cwd, ".opencode/skill"),
11061
+ join(cwd, ".opencode/skills"),
10956
11062
  join(home, ".config/opencode/AGENTS.md"),
10957
11063
  join(home, ".config/opencode/agents"),
10958
11064
  join(home, ".config/opencode/commands"),
10959
- join(home, ".config/opencode/skill")
11065
+ join(home, ".config/opencode/skills")
10960
11066
  ])
10961
11067
  },
10962
11068
  "github-copilot": {
@@ -11404,8 +11510,8 @@ var init_provider_registry = __esm(() => {
11404
11510
  displayName: "Amp",
11405
11511
  subagents: "full",
11406
11512
  agents: {
11407
- projectPath: "AGENTS.md",
11408
- globalPath: join(home, ".config/AGENTS.md"),
11513
+ projectPath: "AGENT.md",
11514
+ globalPath: join(home, ".config/AGENT.md"),
11409
11515
  format: "fm-strip",
11410
11516
  writeStrategy: "merge-single",
11411
11517
  fileExtension: ".md"
@@ -11419,8 +11525,8 @@ var init_provider_registry = __esm(() => {
11419
11525
  fileExtension: ".md"
11420
11526
  },
11421
11527
  config: {
11422
- projectPath: "AGENTS.md",
11423
- globalPath: join(home, ".config/AGENTS.md"),
11528
+ projectPath: "AGENT.md",
11529
+ globalPath: join(home, ".config/AGENT.md"),
11424
11530
  format: "md-strip",
11425
11531
  writeStrategy: "merge-single",
11426
11532
  fileExtension: ".md"
@@ -11437,7 +11543,8 @@ var init_provider_registry = __esm(() => {
11437
11543
  detect: async () => hasAnyInstallSignal([
11438
11544
  join(cwd, ".amp/rules"),
11439
11545
  join(cwd, ".agents/skills"),
11440
- join(home, ".config/AGENTS.md"),
11546
+ join(cwd, "AGENT.md"),
11547
+ join(home, ".config/AGENT.md"),
11441
11548
  join(home, ".config/amp/rules"),
11442
11549
  join(home, ".config/agents/skills")
11443
11550
  ])
@@ -11502,8 +11609,8 @@ var init_provider_registry = __esm(() => {
11502
11609
  agents: {
11503
11610
  projectPath: ".clinerules",
11504
11611
  globalPath: null,
11505
- format: "fm-to-json",
11506
- writeStrategy: "json-merge",
11612
+ format: "fm-strip",
11613
+ writeStrategy: "per-file",
11507
11614
  fileExtension: ".md"
11508
11615
  },
11509
11616
  commands: null,
@@ -11916,7 +12023,7 @@ function convertItem(item, format, provider) {
11916
12023
  try {
11917
12024
  switch (format) {
11918
12025
  case "direct-copy":
11919
- return convertDirectCopy(item);
12026
+ return convertDirectCopy(item, provider);
11920
12027
  case "fm-to-fm":
11921
12028
  return convertFmToFm(item, provider);
11922
12029
  case "fm-to-yaml":
@@ -53211,8 +53318,8 @@ var init_agents = __esm(() => {
53211
53318
  opencode: {
53212
53319
  name: "opencode",
53213
53320
  displayName: "OpenCode",
53214
- projectPath: ".opencode/skill",
53215
- globalPath: join32(home6, ".config/opencode/skill"),
53321
+ projectPath: ".opencode/skills",
53322
+ globalPath: join32(home6, ".config/opencode/skills"),
53216
53323
  detect: async () => existsSync26(join32(home6, ".config/opencode"))
53217
53324
  },
53218
53325
  goose: {
@@ -54822,7 +54929,7 @@ var package_default;
54822
54929
  var init_package = __esm(() => {
54823
54930
  package_default = {
54824
54931
  name: "claudekit-cli",
54825
- version: "3.36.0-dev.8",
54932
+ version: "3.36.0-dev.9",
54826
54933
  description: "CLI tool for bootstrapping and updating ClaudeKit projects",
54827
54934
  type: "module",
54828
54935
  repository: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claudekit-cli",
3
- "version": "3.36.0-dev.8",
3
+ "version": "3.36.0-dev.9",
4
4
  "description": "CLI tool for bootstrapping and updating ClaudeKit projects",
5
5
  "type": "module",
6
6
  "repository": {