@anysiteio/agent-skills 2.0.0 → 2.0.1

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/bin/install.js +41 -31
  2. package/package.json +1 -1
package/bin/install.js CHANGED
@@ -30,10 +30,11 @@ const PKG_VERSION = JSON.parse(readFileSync(join(PKG_ROOT, "package.json"), "utf
30
30
 
31
31
  const HOME = process.env.HOME || homedir();
32
32
  const CLAUDE_DIR = join(HOME, ".claude");
33
- const CLAUDE_SKILLS_DIR = join(CLAUDE_DIR, "skills");
34
33
  const CODEX_DIR = join(HOME, ".codex");
35
34
  const CODEX_CONFIG = join(CODEX_DIR, "config.toml");
36
- const MANIFEST_PATH = join(CLAUDE_SKILLS_DIR, ".anysite-skills.json");
35
+ // Both agents use the same skills convention: <dir>/skills/<name>/SKILL.md
36
+ const SKILLS_DST = { claude: join(CLAUDE_DIR, "skills"), codex: join(CODEX_DIR, "skills") };
37
+ const manifestPath = (dstRoot) => join(dstRoot, ".anysite-skills.json");
37
38
 
38
39
  const MCP_NAME = "anysite";
39
40
  const MCP_URL = "https://mcp.anysite.io/mcp";
@@ -73,8 +74,8 @@ function skillDescription(name) {
73
74
  } catch { return ""; }
74
75
  }
75
76
 
76
- function readManifest() {
77
- try { return JSON.parse(readFileSync(MANIFEST_PATH, "utf8")); } catch { return null; }
77
+ function readManifest(dstRoot) {
78
+ try { return JSON.parse(readFileSync(manifestPath(dstRoot), "utf8")); } catch { return null; }
78
79
  }
79
80
 
80
81
  function detectTargets() {
@@ -91,21 +92,21 @@ function hasClaudeCli() {
91
92
 
92
93
  // ── skills install / uninstall ──────────────────────────────────────────────
93
94
 
94
- function installSkills(names) {
95
- mkdirSync(CLAUDE_SKILLS_DIR, { recursive: true });
95
+ function installSkills(names, dstRoot) {
96
+ mkdirSync(dstRoot, { recursive: true });
96
97
  const installed = [];
97
98
  const missing = [];
98
99
  for (const name of names) {
99
100
  const src = join(SKILLS_SRC, name);
100
101
  if (!existsSync(join(src, "SKILL.md"))) { missing.push(name); continue; }
101
- const dst = join(CLAUDE_SKILLS_DIR, name);
102
+ const dst = join(dstRoot, name);
102
103
  rmSync(dst, { recursive: true, force: true });
103
104
  cpSync(src, dst, { recursive: true });
104
105
  installed.push(name);
105
106
  }
106
- const prev = readManifest();
107
+ const prev = readManifest(dstRoot);
107
108
  const all = [...new Set([...(prev?.skills ?? []), ...installed])].sort();
108
- writeFileSync(MANIFEST_PATH, JSON.stringify({
109
+ writeFileSync(manifestPath(dstRoot), JSON.stringify({
109
110
  version: PKG_VERSION,
110
111
  bundle: flags.bundle ?? prev?.bundle ?? null,
111
112
  installedAt: new Date().toISOString(),
@@ -114,21 +115,21 @@ function installSkills(names) {
114
115
  return { installed, missing };
115
116
  }
116
117
 
117
- function uninstallSkills() {
118
- const manifest = readManifest();
118
+ function uninstallSkills(dstRoot) {
119
+ const manifest = readManifest(dstRoot);
119
120
  const tracked = new Set(manifest?.skills ?? []);
120
121
  const removed = [];
121
- if (existsSync(CLAUDE_SKILLS_DIR)) {
122
- for (const d of readdirSync(CLAUDE_SKILLS_DIR, { withFileTypes: true })) {
122
+ if (existsSync(dstRoot)) {
123
+ for (const d of readdirSync(dstRoot, { withFileTypes: true })) {
123
124
  if (!d.isDirectory()) continue;
124
125
  // remove tracked skills plus legacy anysite-* installs; never touch anything else
125
126
  if (tracked.has(d.name) || d.name.startsWith("anysite-")) {
126
- rmSync(join(CLAUDE_SKILLS_DIR, d.name), { recursive: true, force: true });
127
+ rmSync(join(dstRoot, d.name), { recursive: true, force: true });
127
128
  removed.push(d.name);
128
129
  }
129
130
  }
130
131
  }
131
- rmSync(MANIFEST_PATH, { force: true });
132
+ rmSync(manifestPath(dstRoot), { force: true });
132
133
  return removed;
133
134
  }
134
135
 
@@ -170,8 +171,7 @@ if (flags.help) {
170
171
  }
171
172
 
172
173
  if (flags.list) {
173
- const manifest = readManifest();
174
- const installed = new Set(manifest?.skills ?? []);
174
+ const installed = new Set(detectTargets().flatMap((t) => readManifest(SKILLS_DST[t])?.skills ?? []));
175
175
  console.log("\nBundles:");
176
176
  for (const [name, b] of Object.entries(BUNDLES)) {
177
177
  console.log(` ${name} (${b.skills.length} skills) — ${b.description}`);
@@ -186,21 +186,27 @@ if (flags.list) {
186
186
  }
187
187
 
188
188
  if (flags.status) {
189
- const manifest = readManifest();
190
- if (!manifest) { console.log("\nNo anysite skills installed (no manifest found).\n"); process.exit(0); }
191
- console.log(`\nInstalled: ${manifest.skills.length} skills (package v${manifest.version}, ${manifest.installedAt})`);
192
- if (manifest.bundle) console.log(`Bundle: ${manifest.bundle}`);
193
- for (const s of manifest.skills) console.log(` ✓ ${s}`);
194
- console.log(`\nUpdate: npx @anysiteio/agent-skills@latest ${manifest.bundle ?? ""}\n`);
189
+ let any = false;
190
+ for (const t of detectTargets()) {
191
+ const manifest = readManifest(SKILLS_DST[t]);
192
+ if (!manifest) { console.log(`\n[${t}] no anysite skills installed.`); continue; }
193
+ any = true;
194
+ console.log(`\n[${t}] ${manifest.skills.length} skills (package v${manifest.version}, ${manifest.installedAt})${manifest.bundle ? `, bundle: ${manifest.bundle}` : ""}`);
195
+ for (const s of manifest.skills) console.log(` ✓ ${s}`);
196
+ if (any) console.log(`\nUpdate: npx @anysiteio/agent-skills@latest ${manifest.bundle ?? ""}`);
197
+ }
198
+ console.log("");
195
199
  process.exit(0);
196
200
  }
197
201
 
198
202
  if (flags.uninstall) {
199
- const removed = uninstallSkills();
200
- console.log(removed.length
201
- ? `\nRemoved ${removed.length} skills from ${CLAUDE_SKILLS_DIR}:\n ${removed.join("\n ")}\n`
202
- : "\nNothing to remove.\n");
203
- console.log(`The MCP entry is kept. To remove it: claude mcp remove ${MCP_NAME}\n`);
203
+ for (const t of detectTargets()) {
204
+ const removed = uninstallSkills(SKILLS_DST[t]);
205
+ console.log(removed.length
206
+ ? `\n[${t}] removed ${removed.length} skills from ${SKILLS_DST[t]}`
207
+ : `\n[${t}] nothing to remove.`);
208
+ }
209
+ console.log(`\nThe MCP entries are kept. To remove: claude mcp remove ${MCP_NAME} / edit ~/.codex/config.toml\n`);
204
210
  process.exit(0);
205
211
  }
206
212
 
@@ -218,9 +224,13 @@ if (!targets.length) {
218
224
  process.exit(1);
219
225
  }
220
226
 
221
- const { installed, missing } = installSkills(names);
222
- console.log(`\nSkills ${CLAUDE_SKILLS_DIR}: ${installed.length} installed${missing.length ? `, unknown: ${missing.join(", ")}` : ""}`);
223
- if (!installed.length) {
227
+ let installedTotal = 0;
228
+ for (const t of targets) {
229
+ const { installed, missing } = installSkills(names, SKILLS_DST[t]);
230
+ installedTotal += installed.length;
231
+ console.log(`\nSkills [${t}] → ${SKILLS_DST[t]}: ${installed.length} installed${missing.length ? `, unknown: ${missing.join(", ")}` : ""}`);
232
+ }
233
+ if (!installedTotal) {
224
234
  console.error("Nothing was installed — check skill names with --list.");
225
235
  process.exit(1);
226
236
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anysiteio/agent-skills",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Official anysite agent skills + one-line setup: installs skills into Claude Code / Codex and registers the anysite remote MCP server. Includes the GTM bundle (CRM enrichment, signals, prospecting).",
5
5
  "keywords": [
6
6
  "mcp",