@sporesec/arcana 3.0.2 → 4.0.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.
- package/dist/cli.js +25 -298
- package/dist/command-defs.d.ts +28 -0
- package/dist/command-defs.js +414 -0
- package/dist/commands/audit.js +18 -4
- package/dist/commands/clean.d.ts +1 -0
- package/dist/commands/clean.js +80 -0
- package/dist/commands/compress.d.ts +5 -0
- package/dist/commands/compress.js +38 -0
- package/dist/commands/config.js +40 -26
- package/dist/commands/create.js +2 -0
- package/dist/commands/curate.d.ts +39 -0
- package/dist/commands/curate.js +222 -0
- package/dist/commands/diff.js +2 -0
- package/dist/commands/doctor.d.ts +1 -0
- package/dist/commands/doctor.js +61 -2
- package/dist/commands/import-cmd.js +5 -0
- package/dist/commands/index.d.ts +5 -0
- package/dist/commands/index.js +107 -0
- package/dist/commands/info.js +19 -8
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.js +71 -0
- package/dist/commands/install.js +2 -0
- package/dist/commands/list.js +8 -0
- package/dist/commands/load.d.ts +10 -0
- package/dist/commands/load.js +130 -0
- package/dist/commands/lock.js +35 -24
- package/dist/commands/mcp.d.ts +4 -0
- package/dist/commands/mcp.js +87 -0
- package/dist/commands/outdated.js +8 -6
- package/dist/commands/providers.js +29 -21
- package/dist/commands/recommend.js +11 -3
- package/dist/commands/remember.d.ts +12 -0
- package/dist/commands/remember.js +111 -0
- package/dist/commands/scan.d.ts +2 -0
- package/dist/commands/scan.js +46 -8
- package/dist/commands/search.js +6 -0
- package/dist/commands/uninstall.js +36 -0
- package/dist/commands/update.js +27 -0
- package/dist/commands/validate.js +8 -0
- package/dist/commands/verify.js +2 -0
- package/dist/compress/engine.d.ts +21 -0
- package/dist/compress/engine.js +106 -0
- package/dist/compress/index.d.ts +7 -0
- package/dist/compress/index.js +10 -0
- package/dist/compress/rules/generic.d.ts +1 -0
- package/dist/compress/rules/generic.js +9 -0
- package/dist/compress/rules/git.d.ts +1 -0
- package/dist/compress/rules/git.js +113 -0
- package/dist/compress/rules/npm.d.ts +1 -0
- package/dist/compress/rules/npm.js +99 -0
- package/dist/compress/rules/test-runner.d.ts +1 -0
- package/dist/compress/rules/test-runner.js +103 -0
- package/dist/compress/rules/tsc.d.ts +1 -0
- package/dist/compress/rules/tsc.js +39 -0
- package/dist/compress/tracker.d.ts +16 -0
- package/dist/compress/tracker.js +45 -0
- package/dist/constants.d.ts +12 -0
- package/dist/constants.js +29 -0
- package/dist/interactive/helpers.js +1 -0
- package/dist/interactive/menu.js +6 -1
- package/dist/interactive/optimize-flow.js +4 -4
- package/dist/mcp/install.d.ts +10 -0
- package/dist/mcp/install.js +109 -0
- package/dist/mcp/registry.d.ts +11 -0
- package/dist/mcp/registry.js +27 -0
- package/dist/providers/anthropics.d.ts +4 -0
- package/dist/providers/anthropics.js +10 -0
- package/dist/registry.js +4 -0
- package/dist/session/trim.d.ts +23 -0
- package/dist/session/trim.js +132 -0
- package/dist/utils/cache.js +2 -2
- package/dist/utils/config.d.ts +2 -0
- package/dist/utils/config.js +33 -14
- package/dist/utils/help.js +16 -8
- package/dist/utils/install-core.js +23 -1
- package/dist/utils/memory.d.ts +25 -0
- package/dist/utils/memory.js +103 -0
- package/dist/utils/project-context.js +4 -0
- package/dist/utils/scanner.d.ts +22 -1
- package/dist/utils/scanner.js +81 -9
- package/dist/utils/sessions.d.ts +2 -0
- package/dist/utils/sessions.js +36 -0
- package/dist/utils/ui.js +5 -0
- package/dist/utils/usage.d.ts +17 -0
- package/dist/utils/usage.js +83 -0
- package/package.json +42 -7
- package/dist/command-registry.d.ts +0 -10
- package/dist/command-registry.js +0 -65
- package/dist/commands/benchmark.d.ts +0 -4
- package/dist/commands/benchmark.js +0 -178
- package/dist/commands/compact.d.ts +0 -6
- package/dist/commands/compact.js +0 -239
- package/dist/commands/optimize.d.ts +0 -3
- package/dist/commands/optimize.js +0 -356
- package/dist/commands/profile.d.ts +0 -3
- package/dist/commands/profile.js +0 -274
- package/dist/commands/stats.d.ts +0 -3
- package/dist/commands/stats.js +0 -210
- package/dist/commands/team.d.ts +0 -3
- package/dist/commands/team.js +0 -291
- package/dist/interactive.d.ts +0 -1
- package/dist/interactive.js +0 -841
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
export const COMMANDS = [
|
|
2
|
+
// ── Getting Started ─────────────────────────────────────────
|
|
3
|
+
{
|
|
4
|
+
command: "init",
|
|
5
|
+
description: "Initialize arcana in current project",
|
|
6
|
+
group: "GETTING STARTED",
|
|
7
|
+
options: [
|
|
8
|
+
{
|
|
9
|
+
flags: "-t, --tool <name>",
|
|
10
|
+
description: "Target tool (claude, cursor, codex, gemini, antigravity, windsurf, aider, all)",
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
module: "./commands/init.js",
|
|
14
|
+
handler: "initCommand",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
command: "doctor",
|
|
18
|
+
description: "Check environment and diagnose issues",
|
|
19
|
+
group: "GETTING STARTED",
|
|
20
|
+
options: [
|
|
21
|
+
{ flags: "-f, --fix", description: "Auto-fix issues where possible" },
|
|
22
|
+
{ flags: "-j, --json", description: "Output as JSON" },
|
|
23
|
+
],
|
|
24
|
+
module: "./commands/doctor.js",
|
|
25
|
+
handler: "doctorCommand",
|
|
26
|
+
},
|
|
27
|
+
// ── Skills ──────────────────────────────────────────────────
|
|
28
|
+
{
|
|
29
|
+
command: "list",
|
|
30
|
+
description: "List available skills",
|
|
31
|
+
group: "SKILLS",
|
|
32
|
+
options: [
|
|
33
|
+
{ flags: "-p, --provider <name>", description: "Provider to list from" },
|
|
34
|
+
{ flags: "-a, --all", description: "List from all providers" },
|
|
35
|
+
{ flags: "--installed", description: "Show only installed skills" },
|
|
36
|
+
{ flags: "--no-cache", description: "Bypass skill cache" },
|
|
37
|
+
{ flags: "-j, --json", description: "Output as JSON" },
|
|
38
|
+
],
|
|
39
|
+
helpText: "\nExamples:\n arcana list\n arcana list --installed\n arcana list --all --no-cache",
|
|
40
|
+
module: "./commands/list.js",
|
|
41
|
+
handler: "listCommand",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
command: "search <query>",
|
|
45
|
+
description: "Search for skills across providers",
|
|
46
|
+
group: "SKILLS",
|
|
47
|
+
options: [
|
|
48
|
+
{ flags: "-p, --provider <name>", description: "Limit search to provider" },
|
|
49
|
+
{ flags: "--no-cache", description: "Bypass skill cache" },
|
|
50
|
+
{ flags: "-t, --tag <tag>", description: "Filter by tech stack tag" },
|
|
51
|
+
{ flags: "-s, --smart", description: "Context-aware ranking (uses project detection)" },
|
|
52
|
+
{ flags: "-j, --json", description: "Output as JSON" },
|
|
53
|
+
],
|
|
54
|
+
helpText: '\nExamples:\n arcana search testing\n arcana search "code review"\n arcana search react --tag typescript\n arcana search api --smart',
|
|
55
|
+
module: "./commands/search.js",
|
|
56
|
+
handler: "searchCommand",
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
command: "info <skill>",
|
|
60
|
+
description: "Show skill details",
|
|
61
|
+
group: "SKILLS",
|
|
62
|
+
options: [
|
|
63
|
+
{ flags: "-p, --provider <name>", description: "Provider to search" },
|
|
64
|
+
{ flags: "-j, --json", description: "Output as JSON" },
|
|
65
|
+
],
|
|
66
|
+
module: "./commands/info.js",
|
|
67
|
+
handler: "infoCommand",
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
command: "install [skills...]",
|
|
71
|
+
description: "Install one or more skills",
|
|
72
|
+
group: "SKILLS",
|
|
73
|
+
options: [
|
|
74
|
+
{ flags: "-p, --provider <name>", description: "Provider to install from" },
|
|
75
|
+
{ flags: "-a, --all", description: "Install all skills" },
|
|
76
|
+
{ flags: "-f, --force", description: "Reinstall even if already installed" },
|
|
77
|
+
{ flags: "--dry-run", description: "Show what would be installed without installing" },
|
|
78
|
+
{ flags: "-j, --json", description: "Output as JSON" },
|
|
79
|
+
{ flags: "--no-check", description: "Skip conflict detection" },
|
|
80
|
+
],
|
|
81
|
+
helpText: "\nExamples:\n arcana install code-reviewer\n arcana install skill1 skill2 skill3\n arcana install --all --force",
|
|
82
|
+
module: "./commands/install.js",
|
|
83
|
+
handler: "installCommand",
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
command: "update [skills...]",
|
|
87
|
+
description: "Update installed skills",
|
|
88
|
+
group: "SKILLS",
|
|
89
|
+
options: [
|
|
90
|
+
{ flags: "-a, --all", description: "Update all installed skills" },
|
|
91
|
+
{ flags: "-p, --provider <name>", description: "Update from specific provider" },
|
|
92
|
+
{ flags: "-n, --dry-run", description: "Show what would be updated without updating" },
|
|
93
|
+
{ flags: "-j, --json", description: "Output as JSON" },
|
|
94
|
+
],
|
|
95
|
+
helpText: "\nExamples:\n arcana update code-reviewer\n arcana update skill1 skill2\n arcana update --all --dry-run",
|
|
96
|
+
module: "./commands/update.js",
|
|
97
|
+
handler: "updateCommand",
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
command: "uninstall [skills...]",
|
|
101
|
+
description: "Uninstall one or more skills",
|
|
102
|
+
group: "SKILLS",
|
|
103
|
+
options: [
|
|
104
|
+
{ flags: "-y, --yes", description: "Skip confirmation prompt" },
|
|
105
|
+
{ flags: "-j, --json", description: "Output as JSON" },
|
|
106
|
+
],
|
|
107
|
+
helpText: "\nExamples:\n arcana uninstall code-reviewer\n arcana uninstall skill1 skill2 --yes",
|
|
108
|
+
module: "./commands/uninstall.js",
|
|
109
|
+
handler: "uninstallCommand",
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
command: "recommend",
|
|
113
|
+
description: "Get smart skill recommendations for current project",
|
|
114
|
+
group: "SKILLS",
|
|
115
|
+
options: [
|
|
116
|
+
{ flags: "-j, --json", description: "Output as JSON" },
|
|
117
|
+
{ flags: "-l, --limit <n>", description: "Max results per category", parseAs: "int" },
|
|
118
|
+
{ flags: "-p, --provider <name>", description: "Limit to provider" },
|
|
119
|
+
],
|
|
120
|
+
helpText: "\nExamples:\n arcana recommend\n arcana recommend --json\n arcana recommend --limit 5",
|
|
121
|
+
module: "./commands/recommend.js",
|
|
122
|
+
handler: "recommendCommand",
|
|
123
|
+
},
|
|
124
|
+
// ── Context Intelligence ────────────────────────────────────
|
|
125
|
+
{
|
|
126
|
+
command: "curate",
|
|
127
|
+
description: "Auto-generate _active.md with budget-aware, project-relevant skills",
|
|
128
|
+
group: "CONTEXT",
|
|
129
|
+
options: [
|
|
130
|
+
{ flags: "-b, --budget <pct>", description: "Max % of context window for skills (default: 30)", parseAs: "int" },
|
|
131
|
+
{ flags: "-m, --model <name>", description: "Target model for context budget (e.g. claude-opus-4.6, gpt-5.4)" },
|
|
132
|
+
{ flags: "-i, --include <skills...>", description: "Force-include specific skills" },
|
|
133
|
+
{ flags: "-j, --json", description: "Output as JSON" },
|
|
134
|
+
],
|
|
135
|
+
helpText: "\nExamples:\n arcana curate\n arcana curate --model gpt-5.4 --budget 40\n arcana curate --include golang-pro typescript",
|
|
136
|
+
module: "./commands/curate.js",
|
|
137
|
+
handler: "curateCommand",
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
command: "compress [command...]",
|
|
141
|
+
description: "Run a command with output compression (saves tokens)",
|
|
142
|
+
group: "CONTEXT",
|
|
143
|
+
options: [
|
|
144
|
+
{ flags: "--stdin", description: "Read from stdin instead of running a command" },
|
|
145
|
+
{ flags: "-t, --tool <name>", description: "Tool type hint for compression rules (git, npm, tsc, vitest)" },
|
|
146
|
+
{ flags: "-j, --json", description: "Output stats as JSON" },
|
|
147
|
+
],
|
|
148
|
+
allowUnknownOption: true,
|
|
149
|
+
module: "./commands/compress.js",
|
|
150
|
+
handler: "compressCommand",
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
command: "remember [content...]",
|
|
154
|
+
description: "Save a fact or preference for cross-session persistence",
|
|
155
|
+
group: "CONTEXT",
|
|
156
|
+
options: [
|
|
157
|
+
{ flags: "-t, --tag <tags...>", description: "Tags for the memory" },
|
|
158
|
+
{ flags: "-j, --json", description: "Output as JSON" },
|
|
159
|
+
],
|
|
160
|
+
helpText: '\nExamples:\n arcana remember "always use pnpm"\n arcana remember "use vitest" --tag testing',
|
|
161
|
+
module: "./commands/remember.js",
|
|
162
|
+
handler: "rememberCommand",
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
command: "recall [query...]",
|
|
166
|
+
description: "Search saved memories",
|
|
167
|
+
group: "CONTEXT",
|
|
168
|
+
options: [
|
|
169
|
+
{ flags: "-a, --all", description: "List all memories" },
|
|
170
|
+
{ flags: "-p, --project <name>", description: "Filter by project" },
|
|
171
|
+
{ flags: "-j, --json", description: "Output as JSON" },
|
|
172
|
+
],
|
|
173
|
+
helpText: '\nExamples:\n arcana recall "package manager"\n arcana recall --all\n arcana recall --project arcana',
|
|
174
|
+
module: "./commands/remember.js",
|
|
175
|
+
handler: "recallCommand",
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
command: "forget <id>",
|
|
179
|
+
description: "Remove a saved memory by ID",
|
|
180
|
+
group: "CONTEXT",
|
|
181
|
+
options: [{ flags: "-j, --json", description: "Output as JSON" }],
|
|
182
|
+
module: "./commands/remember.js",
|
|
183
|
+
handler: "forgetCommand",
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
command: "mcp <action> [name]",
|
|
187
|
+
description: "Manage MCP servers (list, install, remove, status)",
|
|
188
|
+
group: "CONTEXT",
|
|
189
|
+
options: [
|
|
190
|
+
{ flags: "-t, --tool <name>", description: "Target tool: claude or cursor (default: claude)" },
|
|
191
|
+
{ flags: "-j, --json", description: "Output as JSON" },
|
|
192
|
+
],
|
|
193
|
+
helpText: "\nActions:\n list Show available MCP servers\n install <name> Install an MCP server\n remove <name> Remove an MCP server\n status Show configured MCP servers\n\nExamples:\n arcana mcp list\n arcana mcp install context7\n arcana mcp status",
|
|
194
|
+
module: "./commands/mcp.js",
|
|
195
|
+
handler: "mcpCommand",
|
|
196
|
+
},
|
|
197
|
+
// ── Development ─────────────────────────────────────────────
|
|
198
|
+
{
|
|
199
|
+
command: "create <name>",
|
|
200
|
+
description: "Create a new skill from template",
|
|
201
|
+
group: "DEVELOPMENT",
|
|
202
|
+
module: "./commands/create.js",
|
|
203
|
+
handler: "createCommand",
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
command: "validate [skill]",
|
|
207
|
+
description: "Validate skill structure and metadata",
|
|
208
|
+
group: "DEVELOPMENT",
|
|
209
|
+
options: [
|
|
210
|
+
{ flags: "-a, --all", description: "Validate all installed skills" },
|
|
211
|
+
{ flags: "-f, --fix", description: "Auto-fix common issues" },
|
|
212
|
+
{ flags: "-j, --json", description: "Output as JSON" },
|
|
213
|
+
{ flags: "--source <dir>", description: "Validate from source directory instead of install dir" },
|
|
214
|
+
{ flags: "--cross", description: "Run cross-validation (marketplace sync, companions, orphans)" },
|
|
215
|
+
{
|
|
216
|
+
flags: "--min-score <n>",
|
|
217
|
+
description: "Minimum quality score (0-100), fail if any skill scores below",
|
|
218
|
+
parseAs: "int",
|
|
219
|
+
},
|
|
220
|
+
],
|
|
221
|
+
module: "./commands/validate.js",
|
|
222
|
+
handler: "validateCommand",
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
command: "audit [skill]",
|
|
226
|
+
description: "Audit skill quality (code examples, BAD/GOOD pairs, structure)",
|
|
227
|
+
group: "DEVELOPMENT",
|
|
228
|
+
options: [
|
|
229
|
+
{ flags: "-a, --all", description: "Audit all installed skills" },
|
|
230
|
+
{ flags: "-j, --json", description: "Output as JSON" },
|
|
231
|
+
{ flags: "--source <dir>", description: "Audit from source directory instead of install dir" },
|
|
232
|
+
],
|
|
233
|
+
module: "./commands/audit.js",
|
|
234
|
+
handler: "auditCommand",
|
|
235
|
+
},
|
|
236
|
+
// ── Security ────────────────────────────────────────────────
|
|
237
|
+
{
|
|
238
|
+
command: "scan [skill]",
|
|
239
|
+
description: "Scan skills for security threats (prompt injection, malware, credential theft)",
|
|
240
|
+
group: "SECURITY",
|
|
241
|
+
options: [
|
|
242
|
+
{ flags: "-a, --all", description: "Scan all installed skills" },
|
|
243
|
+
{ flags: "--strict", description: "Scan all lines including BAD/DON'T examples (no scope filtering)" },
|
|
244
|
+
{ flags: "-v, --verbose", description: "Show suppressed findings from BAD/DON'T blocks" },
|
|
245
|
+
{ flags: "-j, --json", description: "Output as JSON" },
|
|
246
|
+
],
|
|
247
|
+
helpText: "\nExamples:\n arcana scan code-reviewer\n arcana scan --all\n arcana scan --all --strict\n arcana scan --all --json",
|
|
248
|
+
module: "./commands/scan.js",
|
|
249
|
+
handler: "scanCommand",
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
command: "verify [skill]",
|
|
253
|
+
description: "Verify installed skill integrity against lockfile",
|
|
254
|
+
group: "SECURITY",
|
|
255
|
+
options: [
|
|
256
|
+
{ flags: "-a, --all", description: "Verify all installed skills" },
|
|
257
|
+
{ flags: "-j, --json", description: "Output as JSON" },
|
|
258
|
+
],
|
|
259
|
+
helpText: "\nExamples:\n arcana verify code-reviewer\n arcana verify --all\n arcana verify --all --json",
|
|
260
|
+
module: "./commands/verify.js",
|
|
261
|
+
handler: "verifyCommand",
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
command: "lock",
|
|
265
|
+
description: "Generate or validate lockfile from installed skills",
|
|
266
|
+
group: "SECURITY",
|
|
267
|
+
options: [
|
|
268
|
+
{ flags: "--ci", description: "Validate lockfile matches installed skills (CI mode)" },
|
|
269
|
+
{ flags: "-j, --json", description: "Output as JSON" },
|
|
270
|
+
],
|
|
271
|
+
helpText: "\nExamples:\n arcana lock\n arcana lock --ci\n arcana lock --json",
|
|
272
|
+
module: "./commands/lock.js",
|
|
273
|
+
handler: "lockCommand",
|
|
274
|
+
},
|
|
275
|
+
// ── Inspection ──────────────────────────────────────────────
|
|
276
|
+
{
|
|
277
|
+
command: "diff <skill>",
|
|
278
|
+
description: "Show changes between installed and remote skill version",
|
|
279
|
+
group: "INSPECTION",
|
|
280
|
+
options: [
|
|
281
|
+
{ flags: "-p, --provider <name>", description: "Provider to compare against" },
|
|
282
|
+
{ flags: "-j, --json", description: "Output as JSON" },
|
|
283
|
+
],
|
|
284
|
+
helpText: "\nExamples:\n arcana diff code-reviewer\n arcana diff code-reviewer --json",
|
|
285
|
+
module: "./commands/diff.js",
|
|
286
|
+
handler: "diffCommand",
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
command: "outdated",
|
|
290
|
+
description: "List skills with newer versions available",
|
|
291
|
+
group: "INSPECTION",
|
|
292
|
+
options: [
|
|
293
|
+
{ flags: "-p, --provider <name>", description: "Check against specific provider" },
|
|
294
|
+
{ flags: "-j, --json", description: "Output as JSON" },
|
|
295
|
+
],
|
|
296
|
+
module: "./commands/outdated.js",
|
|
297
|
+
handler: "outdatedCommand",
|
|
298
|
+
},
|
|
299
|
+
// ── Configuration ───────────────────────────────────────────
|
|
300
|
+
{
|
|
301
|
+
command: "config [action] [value]",
|
|
302
|
+
description: "View or modify arcana configuration",
|
|
303
|
+
group: "CONFIGURATION",
|
|
304
|
+
options: [{ flags: "-j, --json", description: "Output as JSON" }],
|
|
305
|
+
helpText: "\nExamples:\n arcana config\n arcana config path\n arcana config defaultProvider arcana\n arcana config reset",
|
|
306
|
+
module: "./commands/config.js",
|
|
307
|
+
handler: "configCommand",
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
command: "providers",
|
|
311
|
+
description: "Manage skill providers",
|
|
312
|
+
group: "CONFIGURATION",
|
|
313
|
+
options: [
|
|
314
|
+
{ flags: "--add <owner/repo>", description: "Add a GitHub provider" },
|
|
315
|
+
{ flags: "--remove <name>", description: "Remove a provider" },
|
|
316
|
+
{ flags: "--json", description: "Output as JSON" },
|
|
317
|
+
],
|
|
318
|
+
module: "./commands/providers.js",
|
|
319
|
+
handler: "providersCommand",
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
command: "clean",
|
|
323
|
+
description: "Remove orphaned data, session bloat, and trim sessions",
|
|
324
|
+
group: "CONFIGURATION",
|
|
325
|
+
options: [
|
|
326
|
+
{ flags: "-n, --dry-run", description: "Show what would be removed without deleting" },
|
|
327
|
+
{ flags: "--aggressive", description: "Delete all session logs regardless of age" },
|
|
328
|
+
{
|
|
329
|
+
flags: "--keep-days <days>",
|
|
330
|
+
description: "Keep main session logs newer than N days (default: 30)",
|
|
331
|
+
parseAs: "int",
|
|
332
|
+
},
|
|
333
|
+
{ flags: "--trim", description: "Trim bloat from the latest session (large tool results, base64)" },
|
|
334
|
+
{ flags: "--json", description: "Output as JSON" },
|
|
335
|
+
],
|
|
336
|
+
module: "./commands/clean.js",
|
|
337
|
+
handler: "cleanCommand",
|
|
338
|
+
},
|
|
339
|
+
// ── Portability ─────────────────────────────────────────────
|
|
340
|
+
{
|
|
341
|
+
command: "export",
|
|
342
|
+
description: "Export installed skills as a manifest",
|
|
343
|
+
group: "WORKFLOW",
|
|
344
|
+
options: [
|
|
345
|
+
{ flags: "--sbom", description: "Export as SPDX-lite software bill of materials" },
|
|
346
|
+
{ flags: "-j, --json", description: "Output as JSON (default)" },
|
|
347
|
+
],
|
|
348
|
+
module: "./commands/export-cmd.js",
|
|
349
|
+
handler: "exportCommand",
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
command: "import <file>",
|
|
353
|
+
description: "Import and install skills from a manifest file",
|
|
354
|
+
group: "WORKFLOW",
|
|
355
|
+
options: [
|
|
356
|
+
{ flags: "-f, --force", description: "Reinstall even if already installed" },
|
|
357
|
+
{ flags: "-j, --json", description: "Output as JSON" },
|
|
358
|
+
],
|
|
359
|
+
helpText: "\nExamples:\n arcana import manifest.json\n arcana import manifest.json --force",
|
|
360
|
+
module: "./commands/import-cmd.js",
|
|
361
|
+
handler: "importCommand",
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
command: "completions <shell>",
|
|
365
|
+
description: "Generate shell completion scripts",
|
|
366
|
+
group: "WORKFLOW",
|
|
367
|
+
options: [{ flags: "-j, --json", description: "Output as JSON" }],
|
|
368
|
+
helpText: "\nSupported shells: bash, zsh, fish\n\nExamples:\n arcana completions bash >> ~/.bashrc\n arcana completions zsh >> ~/.zshrc\n arcana completions fish > ~/.config/fish/completions/arcana.fish",
|
|
369
|
+
module: "./commands/completions.js",
|
|
370
|
+
handler: "completionsCommand",
|
|
371
|
+
},
|
|
372
|
+
// ── Progressive Disclosure ──────────────────────────────────
|
|
373
|
+
{
|
|
374
|
+
command: "index",
|
|
375
|
+
description: "Generate skill metadata index for on-demand loading",
|
|
376
|
+
group: "DISCLOSURE",
|
|
377
|
+
options: [{ flags: "-j, --json", description: "Output as JSON" }],
|
|
378
|
+
module: "./commands/index.js",
|
|
379
|
+
handler: "indexCommand",
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
command: "load [skills...]",
|
|
383
|
+
description: "Load full skill content on demand",
|
|
384
|
+
group: "DISCLOSURE",
|
|
385
|
+
options: [
|
|
386
|
+
{ flags: "--append", description: "Write loaded skills to _loaded.md aggregate file" },
|
|
387
|
+
{ flags: "-j, --json", description: "Output as JSON" },
|
|
388
|
+
],
|
|
389
|
+
helpText: "\nExamples:\n arcana load golang-pro\n arcana load golang-pro typescript\n arcana load golang-pro --append",
|
|
390
|
+
module: "./commands/load.js",
|
|
391
|
+
handler: "loadCommand",
|
|
392
|
+
},
|
|
393
|
+
];
|
|
394
|
+
// ── Derived utilities (replaces command-registry.ts) ──────────
|
|
395
|
+
export function getCommandNames() {
|
|
396
|
+
return COMMANDS.map((c) => c.command.split(/\s/)[0]);
|
|
397
|
+
}
|
|
398
|
+
export function getGroupedCommands() {
|
|
399
|
+
const groups = {};
|
|
400
|
+
for (const cmd of COMMANDS) {
|
|
401
|
+
const name = cmd.command.split(/\s/)[0];
|
|
402
|
+
const entry = { name, usage: cmd.command, description: cmd.description, group: cmd.group };
|
|
403
|
+
(groups[cmd.group] ??= []).push(entry);
|
|
404
|
+
}
|
|
405
|
+
return groups;
|
|
406
|
+
}
|
|
407
|
+
export function findClosestCommand(input) {
|
|
408
|
+
const prefix = input.slice(0, 3).toLowerCase();
|
|
409
|
+
const names = getCommandNames();
|
|
410
|
+
return names.find((n) => n.startsWith(prefix));
|
|
411
|
+
}
|
|
412
|
+
export function getCliReference() {
|
|
413
|
+
return COMMANDS.map((c) => `arcana ${c.command}`).join("\n");
|
|
414
|
+
}
|
package/dist/commands/audit.js
CHANGED
|
@@ -3,6 +3,7 @@ import { join, resolve } from "node:path";
|
|
|
3
3
|
import { getInstallDir } from "../utils/fs.js";
|
|
4
4
|
import { extractFrontmatter, parseFrontmatter } from "../utils/frontmatter.js";
|
|
5
5
|
import { ui, banner } from "../utils/ui.js";
|
|
6
|
+
import { SKILL_MAX_LINES } from "../constants.js";
|
|
6
7
|
export function auditSkill(skillDir, skillName) {
|
|
7
8
|
const checks = [];
|
|
8
9
|
let score = 0;
|
|
@@ -60,11 +61,17 @@ export function auditSkill(skillDir, skillName) {
|
|
|
60
61
|
});
|
|
61
62
|
if (!isCapabilityList)
|
|
62
63
|
score += 15;
|
|
63
|
-
// 7. Reasonable length (50-
|
|
64
|
-
const goodLength = lineCount >= 50 && lineCount <=
|
|
65
|
-
checks.push({
|
|
64
|
+
// 7. Reasonable length (50-300 lines)
|
|
65
|
+
const goodLength = lineCount >= 50 && lineCount <= SKILL_MAX_LINES;
|
|
66
|
+
checks.push({
|
|
67
|
+
name: `Reasonable length (50-${SKILL_MAX_LINES} lines)`,
|
|
68
|
+
passed: goodLength,
|
|
69
|
+
detail: `${lineCount} lines`,
|
|
70
|
+
});
|
|
66
71
|
if (goodLength)
|
|
67
72
|
score += 10;
|
|
73
|
+
if (lineCount > SKILL_MAX_LINES)
|
|
74
|
+
score -= 10;
|
|
68
75
|
// 8. Has scripts/ or references/ directory (bonus)
|
|
69
76
|
const hasScripts = existsSync(join(skillDir, "scripts"));
|
|
70
77
|
const hasRefs = existsSync(join(skillDir, "references")) || existsSync(join(skillDir, "rules"));
|
|
@@ -92,7 +99,7 @@ export function auditSkill(skillDir, skillName) {
|
|
|
92
99
|
checks.push({ name: "Has numbered steps (3+)", passed: hasSteps, detail: `${numberedSteps} steps` });
|
|
93
100
|
if (hasSteps)
|
|
94
101
|
score += 5;
|
|
95
|
-
// Rating (max possible: 110)
|
|
102
|
+
// Rating (max possible: 110, penalty can reduce below 0)
|
|
96
103
|
let rating;
|
|
97
104
|
if (score >= 90)
|
|
98
105
|
rating = "PERFECT";
|
|
@@ -105,6 +112,7 @@ export function auditSkill(skillDir, skillName) {
|
|
|
105
112
|
return { skill: skillName, rating, score, checks };
|
|
106
113
|
}
|
|
107
114
|
export async function auditCommand(skill, opts) {
|
|
115
|
+
/* v8 ignore next */
|
|
108
116
|
if (!opts.json)
|
|
109
117
|
banner();
|
|
110
118
|
const baseDir = opts.source ? resolve(opts.source) : getInstallDir();
|
|
@@ -113,8 +121,10 @@ export async function auditCommand(skill, opts) {
|
|
|
113
121
|
console.log(JSON.stringify({ results: [] }));
|
|
114
122
|
}
|
|
115
123
|
else {
|
|
124
|
+
/* v8 ignore start */
|
|
116
125
|
console.log(ui.dim(" No skills installed."));
|
|
117
126
|
console.log();
|
|
127
|
+
/* v8 ignore stop */
|
|
118
128
|
}
|
|
119
129
|
return;
|
|
120
130
|
}
|
|
@@ -137,10 +147,12 @@ export async function auditCommand(skill, opts) {
|
|
|
137
147
|
console.log(JSON.stringify({ error: "Specify a skill name or use --all" }));
|
|
138
148
|
}
|
|
139
149
|
else {
|
|
150
|
+
/* v8 ignore start */
|
|
140
151
|
console.log(ui.error(" Specify a skill name or use --all"));
|
|
141
152
|
console.log(ui.dim(" Usage: arcana audit <skill>"));
|
|
142
153
|
console.log(ui.dim(" arcana audit --all [--json]"));
|
|
143
154
|
console.log();
|
|
155
|
+
/* v8 ignore stop */
|
|
144
156
|
}
|
|
145
157
|
process.exit(1);
|
|
146
158
|
}
|
|
@@ -157,6 +169,7 @@ export async function auditCommand(skill, opts) {
|
|
|
157
169
|
console.log(JSON.stringify({ results }, null, 2));
|
|
158
170
|
return;
|
|
159
171
|
}
|
|
172
|
+
/* v8 ignore start */
|
|
160
173
|
const counts = { PERFECT: 0, STRONG: 0, ADEQUATE: 0, WEAK: 0 };
|
|
161
174
|
for (const r of results) {
|
|
162
175
|
counts[r.rating]++;
|
|
@@ -187,4 +200,5 @@ export async function auditCommand(skill, opts) {
|
|
|
187
200
|
parts.push(ui.error(`${counts.WEAK} weak`));
|
|
188
201
|
console.log(` ${parts.join(ui.dim(" | "))}`);
|
|
189
202
|
console.log();
|
|
203
|
+
/* v8 ignore stop */
|
|
190
204
|
}
|