@anysiteio/agent-skills 1.2.0 → 1.4.0

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.
@@ -124,7 +124,7 @@
124
124
  {
125
125
  "name": "anysite-cli",
126
126
  "description": "Command-line tool operator for anysite CLI. Handles web data extraction, batch API processing, multi-source dataset pipelines with scheduling/transforms/exports, and database operations. Execute anysite commands for LinkedIn, Instagram, Twitter data collection, dataset creation, SQL queries, and PostgreSQL/SQLite loading.",
127
- "version": "1.0.0",
127
+ "version": "1.3.0",
128
128
  "author": {
129
129
  "name": "Anysite Skills Contributors",
130
130
  "email": "support@anysite.io"
@@ -132,6 +132,18 @@
132
132
  "source": "./",
133
133
  "category": "productivity",
134
134
  "skills": ["./skills/anysite-cli"]
135
+ },
136
+ {
137
+ "name": "anysite-mcp-migration",
138
+ "description": "Migration assistant for updating anysite MCP skills, prompts, and agent instructions from v1 (individual tools) to v2 (universal meta-tools: execute, discover, get_page, query_cache, export_data). Automatically rewrites tool references, adds pagination/filtering/export capabilities, and validates migrated output.",
139
+ "version": "1.0.0",
140
+ "author": {
141
+ "name": "Anysite Skills Contributors",
142
+ "email": "support@anysite.io"
143
+ },
144
+ "source": "./",
145
+ "category": "productivity",
146
+ "skills": ["./skills/anysite-mcp-migration"]
135
147
  }
136
148
  ]
137
149
  }
package/bin/install.js CHANGED
@@ -2,56 +2,185 @@
2
2
 
3
3
  /**
4
4
  * Anysite Agent Skills installer for Claude Code
5
- * Automatically adds the marketplace and displays installation instructions
5
+ *
6
+ * Usage:
7
+ * npx @anysiteio/agent-skills # Install all skills
8
+ * npx @anysiteio/agent-skills --list # List available skills
9
+ * npx @anysiteio/agent-skills --skill lead-generation --skill person-analyzer
10
+ * npx @anysiteio/agent-skills --uninstall # Remove all installed skills
6
11
  */
7
12
 
8
- import { execSync } from 'child_process';
9
- import { fileURLToPath } from 'url';
10
- import { dirname, join } from 'path';
13
+ import { existsSync, mkdirSync, cpSync, rmSync, readdirSync, readFileSync } from "fs";
14
+ import { join, resolve } from "path";
15
+ import { fileURLToPath } from "url";
16
+ import { homedir } from "os";
11
17
 
12
18
  const __filename = fileURLToPath(import.meta.url);
13
- const __dirname = dirname(__filename);
14
-
15
- console.log('\nšŸš€ Installing Anysite Agent Skills...\n');
16
-
17
- // Check if we're in Claude Code environment
18
- try {
19
- console.log('šŸ“¦ Adding marketplace to Claude Code...\n');
20
-
21
- // Try to add marketplace via Claude Code CLI
22
- try {
23
- execSync('/plugin marketplace add https://github.com/anysiteio/agent-skills', {
24
- stdio: 'inherit'
25
- });
26
- console.log('\nāœ… Marketplace added successfully!\n');
27
- } catch (error) {
28
- console.log('āš ļø Could not add marketplace automatically.\n');
29
- console.log('Please run this command manually in Claude Code:\n');
30
- console.log(' /plugin marketplace add https://github.com/anysiteio/agent-skills\n');
19
+ const __dirname = resolve(fileURLToPath(import.meta.url), "..");
20
+ const SKILLS_SRC = resolve(__dirname, "..", "skills");
21
+ const CLAUDE_SKILLS_DIR = join(homedir(), ".claude", "skills");
22
+
23
+ // ── Parse args ──────────────────────────────────────────────────────────────
24
+
25
+ const args = process.argv.slice(2);
26
+ const flags = { list: false, uninstall: false, skills: [], help: false };
27
+
28
+ for (let i = 0; i < args.length; i++) {
29
+ if (args[i] === "--list" || args[i] === "-l") flags.list = true;
30
+ else if (args[i] === "--uninstall" || args[i] === "--remove") flags.uninstall = true;
31
+ else if (args[i] === "--help" || args[i] === "-h") flags.help = true;
32
+ else if (args[i] === "--skill" || args[i] === "-s") {
33
+ i++;
34
+ if (i < args.length) flags.skills.push(args[i]);
35
+ }
36
+ }
37
+
38
+ // ── Helpers ─────────────────────────────────────────────────────────────────
39
+
40
+ function getAvailableSkills() {
41
+ if (!existsSync(SKILLS_SRC)) return [];
42
+ return readdirSync(SKILLS_SRC, { withFileTypes: true })
43
+ .filter((d) => d.isDirectory() && existsSync(join(SKILLS_SRC, d.name, "SKILL.md")))
44
+ .map((d) => d.name)
45
+ .sort();
46
+ }
47
+
48
+ function getSkillDescription(name) {
49
+ const skillPath = join(SKILLS_SRC, name, "SKILL.md");
50
+ if (!existsSync(skillPath)) return "";
51
+ const content = readFileSync(skillPath, "utf-8");
52
+ const match = content.match(/^---\s*\n[\s\S]*?description:\s*(.+)\n[\s\S]*?^---/m);
53
+ return match ? match[1].trim().slice(0, 80) : "";
54
+ }
55
+
56
+ function getInstalledSkills() {
57
+ if (!existsSync(CLAUDE_SKILLS_DIR)) return [];
58
+ return readdirSync(CLAUDE_SKILLS_DIR, { withFileTypes: true })
59
+ .filter(
60
+ (d) =>
61
+ d.isDirectory() &&
62
+ d.name.startsWith("anysite-") &&
63
+ existsSync(join(CLAUDE_SKILLS_DIR, d.name, "SKILL.md"))
64
+ )
65
+ .map((d) => d.name)
66
+ .sort();
67
+ }
68
+
69
+ // ── Commands ────────────────────────────────────────────────────────────────
70
+
71
+ if (flags.help) {
72
+ console.log(`
73
+ Anysite Agent Skills — install skills for Claude Code
74
+
75
+ Usage:
76
+ npx @anysiteio/agent-skills Install all skills
77
+ npx @anysiteio/agent-skills --list List available skills
78
+ npx @anysiteio/agent-skills --skill NAME Install specific skill(s)
79
+ npx @anysiteio/agent-skills --uninstall Remove all anysite skills
80
+
81
+ Options:
82
+ --skill, -s NAME Install specific skill (repeatable)
83
+ --list, -l List available skills
84
+ --uninstall Remove installed anysite skills
85
+ --help, -h Show this help
86
+ `);
87
+ process.exit(0);
88
+ }
89
+
90
+ if (flags.list) {
91
+ const skills = getAvailableSkills();
92
+ const installed = new Set(getInstalledSkills());
93
+ console.log(`\nAvailable skills (${skills.length}):\n`);
94
+ for (const name of skills) {
95
+ const status = installed.has(name) ? " āœ“" : " ";
96
+ const desc = getSkillDescription(name);
97
+ console.log(`${status} ${name}`);
98
+ if (desc) console.log(` ${desc}`);
99
+ }
100
+ console.log();
101
+ process.exit(0);
102
+ }
103
+
104
+ if (flags.uninstall) {
105
+ const installed = getInstalledSkills();
106
+ // Also check for non-prefixed skills like skill-audit
107
+ const allInstalled = existsSync(CLAUDE_SKILLS_DIR)
108
+ ? readdirSync(CLAUDE_SKILLS_DIR, { withFileTypes: true })
109
+ .filter((d) => d.isDirectory())
110
+ .map((d) => d.name)
111
+ .filter((n) => getAvailableSkills().includes(n))
112
+ : [];
113
+
114
+ if (allInstalled.length === 0) {
115
+ console.log("\nNo anysite skills installed.\n");
116
+ process.exit(0);
31
117
  }
32
118
 
33
- console.log('šŸ“š Available Skills:');
34
- console.log(' • anysite-lead-generation');
35
- console.log(' • anysite-competitor-intelligence');
36
- console.log(' • anysite-influencer-discovery');
37
- console.log(' • anysite-content-analytics');
38
- console.log(' • anysite-trend-analysis');
39
- console.log(' • anysite-market-research');
40
- console.log(' • anysite-audience-analysis');
41
- console.log(' • anysite-brand-reputation');
42
- console.log(' • anysite-person-analyzer');
43
- console.log(' • anysite-vc-analyst');
44
- console.log(' • anysite-competitor-analyzer');
45
- console.log(' • skill-audit');
46
- console.log(' • anysite-cli\n');
47
-
48
- console.log('šŸ’” To install a skill, run in Claude Code:');
49
- console.log(' /plugin install anysite-lead-generation@anysite-skills\n');
50
-
51
- console.log('šŸ“– Documentation: https://github.com/anysiteio/agent-skills\n');
52
- console.log('šŸ”§ MCP Server: https://docs.anysite.io/mcp-server\n');
53
-
54
- } catch (error) {
55
- console.error('Error during installation:', error.message);
119
+ for (const name of allInstalled) {
120
+ const target = join(CLAUDE_SKILLS_DIR, name);
121
+ rmSync(target, { recursive: true, force: true });
122
+ console.log(` Removed ${name}`);
123
+ }
124
+ console.log(`\nUninstalled ${allInstalled.length} skill(s).\n`);
125
+ process.exit(0);
126
+ }
127
+
128
+ // ── Install ─────────────────────────────────────────────────────────────────
129
+
130
+ const available = getAvailableSkills();
131
+
132
+ if (available.length === 0) {
133
+ console.error("Error: no skills found in package. Please reinstall.");
56
134
  process.exit(1);
57
135
  }
136
+
137
+ // Resolve which skills to install
138
+ let toInstall = available;
139
+
140
+ if (flags.skills.length > 0) {
141
+ toInstall = [];
142
+ for (const input of flags.skills) {
143
+ // Allow short names: "lead-generation" -> "anysite-lead-generation"
144
+ const candidates = [input, `anysite-${input}`];
145
+ const match = candidates.find((c) => available.includes(c));
146
+ if (match) {
147
+ toInstall.push(match);
148
+ } else {
149
+ console.error(`Unknown skill: ${input}`);
150
+ console.error(`Available: ${available.join(", ")}`);
151
+ process.exit(1);
152
+ }
153
+ }
154
+ }
155
+
156
+ console.log(`\nInstalling ${toInstall.length} skill(s) to ${CLAUDE_SKILLS_DIR}\n`);
157
+
158
+ // Ensure target dir exists
159
+ mkdirSync(CLAUDE_SKILLS_DIR, { recursive: true });
160
+
161
+ let installed = 0;
162
+ let updated = 0;
163
+
164
+ for (const name of toInstall) {
165
+ const src = join(SKILLS_SRC, name);
166
+ const dest = join(CLAUDE_SKILLS_DIR, name);
167
+ const exists = existsSync(dest);
168
+
169
+ if (exists) {
170
+ rmSync(dest, { recursive: true, force: true });
171
+ updated++;
172
+ } else {
173
+ installed++;
174
+ }
175
+
176
+ cpSync(src, dest, { recursive: true });
177
+ console.log(` ${exists ? "↻" : "+"} ${name}`);
178
+ }
179
+
180
+ console.log();
181
+ if (installed > 0) console.log(` Installed: ${installed}`);
182
+ if (updated > 0) console.log(` Updated: ${updated}`);
183
+ console.log(` Location: ${CLAUDE_SKILLS_DIR}`);
184
+ console.log();
185
+ console.log("Skills are now available in Claude Code.");
186
+ console.log("Use /skill-name to invoke, or Claude will use them automatically.\n");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anysiteio/agent-skills",
3
- "version": "1.2.0",
3
+ "version": "1.4.0",
4
4
  "description": "Official anysite agent skills for LinkedIn intelligence, social media analysis, data extraction, and security auditing",
5
5
  "keywords": [
6
6
  "mcp",