@simpleapps-com/augur-skills 0.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.
@@ -0,0 +1,2 @@
1
+
2
+ export { }
package/dist/index.js ADDED
@@ -0,0 +1,193 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/index.ts
4
+ import { createRequire } from "module";
5
+ import { Command } from "commander";
6
+
7
+ // src/commands/list.ts
8
+ import chalk2 from "chalk";
9
+
10
+ // src/registry.ts
11
+ import path2 from "path";
12
+ import fs from "fs-extra";
13
+
14
+ // src/utils/paths.ts
15
+ import path from "path";
16
+ import os from "os";
17
+ function getSkillsDir(scope) {
18
+ if (scope === "user") {
19
+ return path.join(os.homedir(), ".claude", "skills");
20
+ }
21
+ return path.join(process.cwd(), ".claude", "skills");
22
+ }
23
+ function getBundledSkillsDir() {
24
+ return path.resolve(import.meta.dirname, "..", "skills");
25
+ }
26
+
27
+ // src/registry.ts
28
+ async function getRegistry() {
29
+ const skillsDir = getBundledSkillsDir();
30
+ const exists = await fs.pathExists(skillsDir);
31
+ if (!exists) return [];
32
+ const entries = [];
33
+ const plugins = await fs.readdir(skillsDir);
34
+ for (const plugin of plugins) {
35
+ const pluginPath = path2.join(skillsDir, plugin);
36
+ const stat = await fs.stat(pluginPath);
37
+ if (!stat.isDirectory()) continue;
38
+ const skills = await fs.readdir(pluginPath);
39
+ for (const skill of skills) {
40
+ const skillPath = path2.join(pluginPath, skill);
41
+ const skillStat = await fs.stat(skillPath);
42
+ if (!skillStat.isDirectory()) continue;
43
+ const skillMd = path2.join(skillPath, "SKILL.md");
44
+ if (await fs.pathExists(skillMd)) {
45
+ entries.push({
46
+ plugin,
47
+ skill,
48
+ name: `${plugin}:${skill}`,
49
+ sourcePath: skillPath
50
+ });
51
+ }
52
+ }
53
+ }
54
+ return entries;
55
+ }
56
+ function filterEntries(entries, query) {
57
+ if (query.includes(":")) {
58
+ return entries.filter((e) => e.name === query);
59
+ }
60
+ return entries.filter((e) => e.plugin === query);
61
+ }
62
+
63
+ // src/utils/logger.ts
64
+ import chalk from "chalk";
65
+ var logger = {
66
+ info: (msg) => console.log(chalk.blue("info"), msg),
67
+ success: (msg) => console.log(chalk.green("success"), msg),
68
+ warn: (msg) => console.log(chalk.yellow("warn"), msg),
69
+ error: (msg) => console.error(chalk.red("error"), msg)
70
+ };
71
+
72
+ // src/commands/list.ts
73
+ async function listCommand() {
74
+ const entries = await getRegistry();
75
+ if (entries.length === 0) {
76
+ logger.info("No skills available yet. Plugins will be added in future releases.");
77
+ return;
78
+ }
79
+ console.log(chalk2.bold("\nAvailable Skills:\n"));
80
+ const byPlugin = /* @__PURE__ */ new Map();
81
+ for (const entry of entries) {
82
+ const skills = byPlugin.get(entry.plugin) ?? [];
83
+ skills.push(entry.skill);
84
+ byPlugin.set(entry.plugin, skills);
85
+ }
86
+ for (const [plugin, skills] of byPlugin) {
87
+ console.log(chalk2.cyan(` ${plugin}`));
88
+ for (const skill of skills) {
89
+ console.log(` - ${plugin}:${skill}`);
90
+ }
91
+ console.log();
92
+ }
93
+ console.log(
94
+ chalk2.dim(`${entries.length} skill(s) across ${byPlugin.size} plugin(s)
95
+ `)
96
+ );
97
+ }
98
+
99
+ // src/installer.ts
100
+ import path3 from "path";
101
+ import fs2 from "fs-extra";
102
+ async function installSkills(entries, scope) {
103
+ const skillsDir = getSkillsDir(scope);
104
+ const results = [];
105
+ for (const entry of entries) {
106
+ const targetPath = path3.join(skillsDir, entry.skill);
107
+ await fs2.ensureDir(targetPath);
108
+ await fs2.copy(entry.sourcePath, targetPath, { overwrite: true });
109
+ results.push({ skill: entry.name, targetPath });
110
+ }
111
+ return results;
112
+ }
113
+ async function uninstallSkills(pluginName, scope) {
114
+ const skillsDir = getSkillsDir(scope);
115
+ const removed = [];
116
+ if (!await fs2.pathExists(skillsDir)) return removed;
117
+ const dirs = await fs2.readdir(skillsDir);
118
+ for (const dir of dirs) {
119
+ const dirPath = path3.join(skillsDir, dir);
120
+ const stat = await fs2.stat(dirPath);
121
+ if (!stat.isDirectory()) continue;
122
+ const skillMd = path3.join(dirPath, "SKILL.md");
123
+ if (await fs2.pathExists(skillMd)) {
124
+ const content = await fs2.readFile(skillMd, "utf-8");
125
+ if (content.includes(`plugin: ${pluginName}`) || dir.startsWith(pluginName)) {
126
+ await fs2.remove(dirPath);
127
+ removed.push(dir);
128
+ }
129
+ }
130
+ }
131
+ return removed;
132
+ }
133
+
134
+ // src/commands/install.ts
135
+ async function installCommand(query, options) {
136
+ const entries = await getRegistry();
137
+ if (entries.length === 0) {
138
+ logger.warn("No skills available yet. Plugins will be added in future releases.");
139
+ return;
140
+ }
141
+ const matched = filterEntries(entries, query);
142
+ if (matched.length === 0) {
143
+ logger.error(`No skills found matching "${query}".`);
144
+ logger.info("Run 'augur-skills list' to see available skills.");
145
+ return;
146
+ }
147
+ const results = await installSkills(matched, options.scope);
148
+ for (const result of results) {
149
+ logger.success(`Installed ${result.skill} -> ${result.targetPath}`);
150
+ }
151
+ logger.info(
152
+ `${results.length} skill(s) installed (scope: ${options.scope}).`
153
+ );
154
+ }
155
+
156
+ // src/commands/uninstall.ts
157
+ async function uninstallCommand(pluginName, options) {
158
+ const removed = await uninstallSkills(pluginName, options.scope);
159
+ if (removed.length === 0) {
160
+ logger.warn(`No installed skills found for plugin "${pluginName}".`);
161
+ return;
162
+ }
163
+ for (const name of removed) {
164
+ logger.success(`Uninstalled ${name}`);
165
+ }
166
+ logger.info(
167
+ `${removed.length} skill(s) uninstalled (scope: ${options.scope}).`
168
+ );
169
+ }
170
+
171
+ // src/index.ts
172
+ var require2 = createRequire(import.meta.url);
173
+ var pkg = require2("../package.json");
174
+ var program = new Command();
175
+ program.name("augur-skills").description("Install curated Claude Code skills").version(pkg.version);
176
+ program.command("list").description("List all available skills").action(listCommand);
177
+ program.command("install <query>").description(
178
+ "Install skills by plugin name or plugin:skill (e.g., web-quality or web-quality:accessibility)"
179
+ ).option(
180
+ "-s, --scope <scope>",
181
+ 'Install scope: "user" (default) or "project"',
182
+ "user"
183
+ ).action((query, options) => {
184
+ return installCommand(query, options);
185
+ });
186
+ program.command("uninstall <plugin>").description("Uninstall all skills from a plugin").option(
187
+ "-s, --scope <scope>",
188
+ 'Uninstall scope: "user" (default) or "project"',
189
+ "user"
190
+ ).action((plugin, options) => {
191
+ return uninstallCommand(plugin, options);
192
+ });
193
+ program.parse();
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@simpleapps-com/augur-skills",
3
+ "version": "0.0.1",
4
+ "description": "Install curated Claude Code skills",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "bin": {
8
+ "augur-skills": "./dist/index.js"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "skills"
13
+ ],
14
+ "scripts": {
15
+ "build": "tsup",
16
+ "typecheck": "tsc --noEmit",
17
+ "lint": "tsc --noEmit",
18
+ "test": "vitest run",
19
+ "test:coverage": "vitest run --coverage"
20
+ },
21
+ "dependencies": {
22
+ "chalk": "^5.3.0",
23
+ "commander": "^12.0.0",
24
+ "fs-extra": "^11.2.0"
25
+ },
26
+ "devDependencies": {
27
+ "@types/fs-extra": "^11.0.4",
28
+ "@types/node": "^20.11.0",
29
+ "@vitest/coverage-v8": "^2.0.0",
30
+ "tsup": "^8.0.0",
31
+ "typescript": "^5.5.0",
32
+ "vitest": "^2.0.0"
33
+ },
34
+ "engines": {
35
+ "node": ">=18.0.0"
36
+ }
37
+ }