@drunkcoding/agents-and-skills 0.0.32 → 0.0.33

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.
@@ -12,7 +12,7 @@
12
12
  "name": "tech-graph",
13
13
  "source": "./plugins/tech-graph",
14
14
  "description": "6-step wizard for technical diagrams (SVG/PNG) via fireworks-tech-graph",
15
- "version": "0.0.32",
15
+ "version": "0.0.33",
16
16
  "category": "diagram",
17
17
  "keywords": [
18
18
  "diagram",
@@ -26,7 +26,7 @@
26
26
  "name": "html-effectiveness",
27
27
  "source": "./plugins/html-effectiveness",
28
28
  "description": "Generate self-contained interactive HTML reports from 20 upstream templates via a conversational agent.",
29
- "version": "0.0.32",
29
+ "version": "0.0.33",
30
30
  "category": "reports",
31
31
  "keywords": [
32
32
  "html",
@@ -41,7 +41,7 @@
41
41
  "name": "plugin-validator",
42
42
  "source": "./plugins/plugin-validator",
43
43
  "description": "Orchestrated validator for Claude Code plugins — validates skills, agents, commands, and hooks across every plugin under plugins/**.",
44
- "version": "0.0.32",
44
+ "version": "0.0.33",
45
45
  "category": "tooling",
46
46
  "keywords": [
47
47
  "validation",
@@ -57,7 +57,7 @@
57
57
  "name": "team-share",
58
58
  "source": "./plugins/team-share",
59
59
  "description": "Onboard your team with an interactive setup menu: install CodeGraph, build the Understand-Anything knowledge graph, and share Claude Code settings — run any combination, all idempotent.",
60
- "version": "0.0.32",
60
+ "version": "0.0.33",
61
61
  "category": "tooling",
62
62
  "keywords": [
63
63
  "onboarding",
@@ -73,7 +73,7 @@
73
73
  "name": "multica-tool",
74
74
  "source": "./plugins/multica-tool",
75
75
  "description": "Export, import, and sync Multica skills, agents, and squads between workspaces.",
76
- "version": "0.0.32",
76
+ "version": "0.0.33",
77
77
  "category": "workflow",
78
78
  "keywords": [
79
79
  "multica",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drunkcoding/agents-and-skills",
3
- "version": "0.0.32",
3
+ "version": "0.0.33",
4
4
  "description": "Personal collection of Claude Code skills and agents, installable via `npx skills`.",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "html-effectiveness",
3
3
  "displayName": "HTML Effectiveness Reports",
4
- "version": "0.0.32",
4
+ "version": "0.0.33",
5
5
  "description": "Generate self-contained interactive HTML reports from 20 upstream templates via a conversational agent.",
6
6
  "author": {
7
7
  "name": "Steven Hoang"
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "multica-tool",
3
- "version": "0.0.32",
3
+ "version": "0.0.33",
4
4
  "description": "Export, import, and sync Multica skills, agents, and squads between workspaces via the multica CLI."
5
5
  }
@@ -0,0 +1,71 @@
1
+ #!/usr/bin/env node
2
+ // Generate OpenCode discovery artifacts from the canonical Claude Code plugin.
3
+ // Source of truth: this plugin's skills/ + agents/ + commands/ + scripts/.
4
+ // Output: dist/opencode/{skills,agents,commands}/ — copy into .opencode/ (project)
5
+ // or ~/.config/opencode/ (global). Run: node plugins/multica-tool/scripts/build-dist.mjs
6
+ import { readFileSync, writeFileSync, mkdirSync, readdirSync, rmSync, copyFileSync } from "node:fs";
7
+ import { dirname, join } from "node:path";
8
+ import { fileURLToPath } from "node:url";
9
+
10
+ const PLUGIN_ROOT = dirname(dirname(fileURLToPath(import.meta.url)));
11
+ const REPO_ROOT = dirname(dirname(PLUGIN_ROOT));
12
+ const OUT = join(REPO_ROOT, "dist", "opencode");
13
+ const NAMES = ["export", "import", "sync"];
14
+ // Runtime scripts shared by every skill (exclude this generator).
15
+ const SCRIPTS = readdirSync(join(PLUGIN_ROOT, "scripts")).filter(
16
+ (f) => f.endsWith(".mjs") && f !== "build-dist.mjs",
17
+ );
18
+
19
+ // Naive frontmatter split — every source file uses single-line `key: value`.
20
+ function parse(text) {
21
+ const m = text.match(/^---\n([\s\S]*?)\n---\n([\s\S]*)$/);
22
+ if (!m) throw new Error("missing frontmatter");
23
+ const fm = {};
24
+ for (const line of m[1].split("\n")) {
25
+ const i = line.indexOf(":");
26
+ if (i !== -1) fm[line.slice(0, i).trim()] = line.slice(i + 1).trim();
27
+ }
28
+ return { fm, body: m[2] };
29
+ }
30
+
31
+ const read = (...p) => readFileSync(join(PLUGIN_ROOT, ...p), "utf8");
32
+ function write(rel, content) {
33
+ const abs = join(OUT, rel);
34
+ mkdirSync(dirname(abs), { recursive: true });
35
+ writeFileSync(abs, content);
36
+ }
37
+ // OpenCode resolves a skill's relative paths against the skill base dir it injects.
38
+ const toOpencodePath = (s) => s.replace(/"\$\{CLAUDE_PLUGIN_ROOT\}\/scripts\//g, '"scripts/');
39
+ const stripSelfPrefix = (s) => s.replace(/multica-tool:/g, "");
40
+
41
+ rmSync(OUT, { recursive: true, force: true });
42
+
43
+ for (const name of NAMES) {
44
+ // Skill: keep prose, rewrite script path, drop Claude-only allowed-tools, bundle scripts.
45
+ const skill = parse(read("skills", name, "SKILL.md"));
46
+ const fm = `---\nname: ${skill.fm.name}\ndescription: ${skill.fm.description}\n---\n`;
47
+ write(`skills/${name}/SKILL.md`, fm + toOpencodePath(skill.body));
48
+ for (const s of SCRIPTS) {
49
+ mkdirSync(join(OUT, "skills", name, "scripts"), { recursive: true });
50
+ copyFileSync(join(PLUGIN_ROOT, "scripts", s), join(OUT, "skills", name, "scripts", s));
51
+ }
52
+
53
+ // Command: description only; body invokes the local (unprefixed) skill name.
54
+ const cmd = parse(read("commands", `${name}.md`));
55
+ write(`commands/${name}.md`, `---\ndescription: ${stripSelfPrefix(cmd.fm.description)}\n---\n${stripSelfPrefix(cmd.body)}`);
56
+
57
+ // Agent: tools -> permission.bash; body unprefixed.
58
+ const agent = parse(read("agents", `${name}.md`));
59
+ const head = `---\ndescription: ${stripSelfPrefix(agent.fm.description)}\nmode: subagent\npermission:\n bash: allow\n---\n`;
60
+ write(`agents/${name}.md`, head + stripSelfPrefix(agent.body));
61
+ }
62
+
63
+ // Self-check: outputs must carry no Claude-only path/env and must bundle scripts.
64
+ for (const name of NAMES) {
65
+ const md = readFileSync(join(OUT, "skills", name, "SKILL.md"), "utf8");
66
+ if (md.includes("CLAUDE_PLUGIN_ROOT") || md.includes("plugins/multica-tool"))
67
+ throw new Error(`leaked Claude path in ${name}/SKILL.md`);
68
+ for (const s of SCRIPTS) readFileSync(join(OUT, "skills", name, "scripts", s)); // throws if missing
69
+ }
70
+
71
+ console.log(`Wrote OpenCode artifacts for [${NAMES.join(", ")}] to ${OUT}`);
@@ -13,7 +13,7 @@ Export a Multica resource (skill, agent, or squad) to a local bundle directory.
13
13
  Run the export script; it calls `multica auth status` internally and exits with an error message if unauthenticated:
14
14
 
15
15
  ```bash
16
- node plugins/multica-tool/scripts/multica-export.mjs --help 2>&1 || true
16
+ node "${CLAUDE_PLUGIN_ROOT}/scripts/multica-export.mjs" --help 2>&1 || true
17
17
  ```
18
18
 
19
19
  If `multica login` is required, surface that message verbatim and stop.
@@ -43,7 +43,7 @@ where `<slug>` is a lowercased, hyphenated form of the resource name.
43
43
  ## Step 4 — Run the export
44
44
 
45
45
  ```bash
46
- node plugins/multica-tool/scripts/multica-export.mjs \
46
+ node "${CLAUDE_PLUGIN_ROOT}/scripts/multica-export.mjs" \
47
47
  --scope <type> \
48
48
  --id <id> \
49
49
  --out <dir> \
@@ -33,7 +33,7 @@ For each distinct `sourceRuntimeId`, ask the user to pick a matching target runt
33
33
  ## Step 3 — Run the import
34
34
 
35
35
  ```bash
36
- node plugins/multica-tool/scripts/multica-import.mjs \
36
+ node "${CLAUDE_PLUGIN_ROOT}/scripts/multica-import.mjs" \
37
37
  --dir <folder> \
38
38
  --workspace <workspace-name> \
39
39
  --runtime-map <srcId1=dstId1,srcId2=dstId2,...>
@@ -33,7 +33,7 @@ For skills (which have no runtime dependency), an empty runtime map is acceptabl
33
33
  ## Step 3 — Run the sync
34
34
 
35
35
  ```bash
36
- node plugins/multica-tool/scripts/multica-sync.mjs \
36
+ node "${CLAUDE_PLUGIN_ROOT}/scripts/multica-sync.mjs" \
37
37
  <type> <name> from <src-ws> <dest-ws> \
38
38
  [--runtime-map <srcId1=dstId1,srcId2=dstId2,...>]
39
39
  ```
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "plugin-validator",
3
3
  "displayName": "Plugin Validator",
4
- "version": "0.0.32",
4
+ "version": "0.0.33",
5
5
  "description": "Orchestrated validator for Claude Code plugins — validates skills, agents, commands, and hooks across every plugin under plugins/**.",
6
6
  "author": {
7
7
  "name": "Steven Hoang"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "team-share",
3
3
  "displayName": "Team Share",
4
- "version": "0.0.32",
4
+ "version": "0.0.33",
5
5
  "description": "Onboard your team with an interactive setup menu: install CodeGraph, build the Understand-Anything knowledge graph, and share Claude Code settings — run any combination, all idempotent.",
6
6
  "author": {
7
7
  "name": "Steven Hoang"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tech-graph",
3
- "version": "0.0.32",
3
+ "version": "0.0.33",
4
4
  "description": "Step-by-step wizard for generating technical diagrams as SVG+PNG.",
5
5
  "author": {
6
6
  "name": "steven"