@agentskillkit/agent-skills 3.2.2 → 3.2.5

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 (51) hide show
  1. package/.agent/skills/mobile-design/scripts/mobile_audit.js +333 -0
  2. package/.agent/skills/typescript-expert/scripts/ts_diagnostic.js +227 -0
  3. package/README.md +197 -720
  4. package/package.json +4 -4
  5. package/packages/cli/lib/audit.js +2 -2
  6. package/packages/cli/lib/auto-learn.js +8 -8
  7. package/packages/cli/lib/eslint-fix.js +1 -1
  8. package/packages/cli/lib/fix.js +5 -5
  9. package/packages/cli/lib/hooks/install-hooks.js +4 -4
  10. package/packages/cli/lib/hooks/lint-learn.js +4 -4
  11. package/packages/cli/lib/knowledge-index.js +4 -4
  12. package/packages/cli/lib/knowledge-metrics.js +2 -2
  13. package/packages/cli/lib/knowledge-retention.js +3 -3
  14. package/packages/cli/lib/knowledge-validator.js +3 -3
  15. package/packages/cli/lib/learn.js +10 -10
  16. package/packages/cli/lib/recall.js +1 -1
  17. package/packages/cli/lib/skill-learn.js +2 -2
  18. package/packages/cli/lib/stats.js +3 -3
  19. package/packages/cli/lib/ui/dashboard-ui.js +222 -0
  20. package/packages/cli/lib/ui/help-ui.js +41 -18
  21. package/packages/cli/lib/ui/index.js +57 -5
  22. package/packages/cli/lib/ui/settings-ui.js +292 -14
  23. package/packages/cli/lib/ui/stats-ui.js +93 -43
  24. package/packages/cli/lib/watcher.js +2 -2
  25. package/packages/kit/kit.js +89 -0
  26. package/packages/kit/lib/agents.js +208 -0
  27. package/packages/kit/lib/commands/analyze.js +70 -0
  28. package/packages/kit/lib/commands/cache.js +65 -0
  29. package/packages/kit/lib/commands/doctor.js +75 -0
  30. package/packages/kit/lib/commands/help.js +155 -0
  31. package/packages/kit/lib/commands/info.js +38 -0
  32. package/packages/kit/lib/commands/init.js +39 -0
  33. package/packages/kit/lib/commands/install.js +803 -0
  34. package/packages/kit/lib/commands/list.js +43 -0
  35. package/packages/kit/lib/commands/lock.js +57 -0
  36. package/packages/kit/lib/commands/uninstall.js +307 -0
  37. package/packages/kit/lib/commands/update.js +55 -0
  38. package/packages/kit/lib/commands/validate.js +69 -0
  39. package/packages/kit/lib/commands/verify.js +56 -0
  40. package/packages/kit/lib/config.js +81 -0
  41. package/packages/kit/lib/helpers.js +196 -0
  42. package/packages/kit/lib/helpers.test.js +60 -0
  43. package/packages/kit/lib/installer.js +164 -0
  44. package/packages/kit/lib/skills.js +119 -0
  45. package/packages/kit/lib/skills.test.js +109 -0
  46. package/packages/kit/lib/types.js +82 -0
  47. package/packages/kit/lib/ui.js +329 -0
  48. package/.agent/skills/mobile-design/scripts/mobile_audit.py +0 -670
  49. package/.agent/skills/requirements-python.txt +0 -25
  50. package/.agent/skills/requirements.txt +0 -96
  51. package/.agent/skills/typescript-expert/scripts/ts_diagnostic.py +0 -203
@@ -0,0 +1,82 @@
1
+ /**
2
+ * @fileoverview JSDoc Type Definitions for add-skill CLI
3
+ * Provides IDE autocomplete support
4
+ */
5
+
6
+ /**
7
+ * @typedef {Object} SkillStructure
8
+ * @property {boolean} hasResources
9
+ * @property {boolean} hasExamples
10
+ * @property {boolean} hasScripts
11
+ * @property {boolean} hasConstitution
12
+ * @property {boolean} hasDoctrines
13
+ * @property {boolean} hasEnforcement
14
+ * @property {boolean} hasProposals
15
+ * @property {string[]} directories
16
+ * @property {string[]} files
17
+ */
18
+
19
+ /**
20
+ * @typedef {Object} Skill
21
+ * @property {string} name - Skill folder name
22
+ * @property {string} path - Absolute path to skill
23
+ * @property {boolean} hasSkillMd - Has SKILL.md file
24
+ * @property {string} description - From SKILL.md frontmatter
25
+ * @property {string[]} tags - From SKILL.md frontmatter
26
+ * @property {string} author - Author or publisher
27
+ * @property {string} version - Version or ref
28
+ * @property {SkillStructure} structure - Directory structure
29
+ * @property {number} size - Total size in bytes
30
+ * @property {string} [repo] - Source repository
31
+ * @property {string} [skill] - Skill name in repo
32
+ * @property {string} [ref] - Git ref
33
+ * @property {string} [checksum] - Merkle hash
34
+ * @property {string} [installedAt] - ISO timestamp
35
+ */
36
+
37
+ /**
38
+ * @typedef {Object} SkillMeta
39
+ * @property {string} [name]
40
+ * @property {string} [description]
41
+ * @property {string} [version]
42
+ * @property {string} [author]
43
+ * @property {string[]} [tags]
44
+ * @property {string} [type]
45
+ * @property {string} [authority]
46
+ * @property {string} [parent]
47
+ */
48
+
49
+ /**
50
+ * @typedef {Object} ParsedSpec
51
+ * @property {string} org - GitHub org
52
+ * @property {string} repo - GitHub repo
53
+ * @property {string} [skill] - Skill name
54
+ * @property {string} [ref] - Git ref
55
+ */
56
+
57
+ /**
58
+ * @typedef {Object} Backup
59
+ * @property {string} name
60
+ * @property {string} path
61
+ * @property {Date} createdAt
62
+ * @property {number} size
63
+ */
64
+
65
+ /**
66
+ * @typedef {Object} SkillLock
67
+ * @property {number} lockVersion
68
+ * @property {string} generatedAt
69
+ * @property {string} generator
70
+ * @property {Object.<string, SkillLockEntry>} skills
71
+ */
72
+
73
+ /**
74
+ * @typedef {Object} SkillLockEntry
75
+ * @property {string} repo
76
+ * @property {string} skill
77
+ * @property {string} ref
78
+ * @property {string} checksum
79
+ * @property {string} [publisher]
80
+ */
81
+
82
+ export { };
@@ -0,0 +1,329 @@
1
+ /**
2
+ * @fileoverview UI components - Install Agent Skill theme
3
+ */
4
+
5
+ import kleur from "kleur";
6
+ import boxen from "boxen";
7
+ import { intro, outro, multiselect, select, confirm, isCancel, cancel, text } from "@clack/prompts";
8
+ import ora from "ora";
9
+ import gradient from "gradient-string";
10
+
11
+ export { intro, outro, multiselect, select, confirm, isCancel, cancel, text };
12
+
13
+ // --- ASCII Art Banner ---
14
+ const PIKAKIT_BANNER = `
15
+ ____ _ _ _ ___ _
16
+ | _ \\(_) | ____ _| |/ (_) |_
17
+ | |_) | | |/ / _\` | ' /| | __|
18
+ | __/| | < (_| | . \\| | |_
19
+ |_| |_|_|\\_\\__,_|_|\\_\\_|\\__|
20
+ `;
21
+
22
+ // Custom gradient: white → gray (like vercel style)
23
+ const pikaGradient = gradient(['#ffffff', '#bbbbbb', '#888888', '#555555']);
24
+
25
+ /**
26
+ * Create a spinner
27
+ */
28
+ export function spinner() {
29
+ return {
30
+ _s: null,
31
+ start(msg) {
32
+ this._s = ora({
33
+ text: " " + msg,
34
+ prefixText: "",
35
+ color: "blue",
36
+ spinner: {
37
+ interval: 80,
38
+ frames: ['◒', '◐', '◓', '◑']
39
+ }
40
+ }).start();
41
+ },
42
+ stop(msg) {
43
+ if (this._s) {
44
+ this._s.stopAndPersist({
45
+ symbol: c.cyan(S.diamond),
46
+ text: " " + msg
47
+ });
48
+ }
49
+ },
50
+ fail(msg) {
51
+ if (this._s) {
52
+ this._s.stopAndPersist({
53
+ symbol: c.red(S.cross),
54
+ text: " " + msg
55
+ });
56
+ }
57
+ },
58
+ message(msg) {
59
+ if (this._s) this._s.text = " " + msg;
60
+ }
61
+ };
62
+ }
63
+
64
+ // --- Symbols ---
65
+
66
+ /** UI symbols for tree structure */
67
+ export const S = {
68
+ branch: "│",
69
+ diamond: "◇",
70
+ diamondFilled: "◆",
71
+ check: "✓",
72
+ cross: "x",
73
+ arrow: "→"
74
+ };
75
+
76
+ // --- Colors ---
77
+
78
+ /** Color helper functions */
79
+ export const c = {
80
+ cyan: kleur.cyan,
81
+ gray: kleur.gray,
82
+ green: kleur.green,
83
+ red: kleur.red,
84
+ yellow: kleur.yellow,
85
+ magenta: kleur.magenta,
86
+ blue: kleur.blue,
87
+ white: kleur.white,
88
+ bgBlue: kleur.bgBlue,
89
+ bold: kleur.bold,
90
+ dim: kleur.dim,
91
+ inverse: kleur.inverse
92
+ };
93
+
94
+ // --- UI Functions ---
95
+
96
+ /**
97
+ * Print a step in the tree
98
+ * @param {string} text - Step text
99
+ * @param {string} [icon] - Icon to use
100
+ * @param {keyof typeof c} [color] - Color name
101
+ */
102
+ export function step(text, icon = S.diamond, color = "cyan") {
103
+ const colorFn = c[color] || c.cyan;
104
+ console.log(`${colorFn(icon)} ${text}`);
105
+ }
106
+
107
+ /**
108
+ * Print an active step (Blue Filled Diamond)
109
+ * @param {string} text - Step text
110
+ */
111
+ export function activeStep(text) {
112
+ console.log(`${c.blue(S.diamondFilled)} ${text}`);
113
+ }
114
+
115
+ /**
116
+ * Print empty branch line
117
+ */
118
+ export function stepLine() {
119
+ console.log(`${c.gray(S.branch)}`);
120
+ }
121
+
122
+ /**
123
+ * Print fatal error and exit
124
+ * @param {string} msg - Error message
125
+ */
126
+ export function fatal(msg) {
127
+ console.log(`${c.red(S.cross)} ${c.red(msg)}`);
128
+ process.exit(1);
129
+ }
130
+
131
+ /**
132
+ * Print success message
133
+ * @param {string} msg - Success message
134
+ */
135
+ export function success(msg) {
136
+ console.log(`${c.cyan(S.diamond)} ${c.cyan(msg)}`);
137
+ }
138
+
139
+ /**
140
+ * Output JSON if JSON_OUTPUT mode
141
+ * @param {any} data - Data to output
142
+ * @param {boolean} jsonMode - Whether to output JSON
143
+ */
144
+ export function outputJSON(data, jsonMode) {
145
+ if (jsonMode) console.log(JSON.stringify(data, null, 2));
146
+ }
147
+
148
+ /**
149
+ * Create a nice box message
150
+ * @param {string} message - Message content
151
+ * @param {object} options - Box options
152
+ */
153
+ export function box(message, options = {}) {
154
+ return "\n" + boxen(message, {
155
+ padding: { top: 0, bottom: 0, left: 1, right: 1 },
156
+ margin: { top: 0, bottom: 0, left: 0, right: 0 },
157
+ borderStyle: "round",
158
+ borderColor: "blue",
159
+ ...options
160
+ });
161
+ }
162
+
163
+ /**
164
+ * Show branded intro with version (matches agent CLI style)
165
+ * @param {string} version - Package version
166
+ * @param {string} [status] - Optional status text
167
+ */
168
+ export function brandedIntro(version, status = "") {
169
+ // Split banner and filter to get content lines only
170
+ const bannerLines = PIKAKIT_BANNER.split('\n').filter(line => line.trim() !== '');
171
+
172
+ // Print all lines except the last with gradient
173
+ for (let i = 0; i < bannerLines.length - 1; i++) {
174
+ console.log(pikaGradient(bannerLines[i]));
175
+ }
176
+
177
+ // Last line: gradient ASCII + dim version (aligned at bottom)
178
+ const lastLine = bannerLines[bannerLines.length - 1];
179
+ console.log(pikaGradient(lastLine) + ` ${c.dim(`v${version}`)}`);
180
+
181
+
182
+ if (status) {
183
+ console.log(`${c.dim(status)}`);
184
+ }
185
+ }
186
+
187
+ // --- Vercel-Style Installation Prompts ---
188
+
189
+ /**
190
+ * Prompt user to select which agents to install to
191
+ * @param {Array<{name: string, displayName: string, skillsDir: string}>} detectedAgents
192
+ * @returns {Promise<Array<{name: string, displayName: string, skillsDir: string}> | null>}
193
+ */
194
+ export async function selectAgentsPrompt(detectedAgents) {
195
+ if (detectedAgents.length === 0) {
196
+ return null;
197
+ }
198
+
199
+ // First ask: All detected or select specific?
200
+ const installChoice = await select({
201
+ message: "Install to",
202
+ options: [
203
+ {
204
+ value: "all",
205
+ label: `All detected agents (Recommended)`,
206
+ hint: `Install to all ${detectedAgents.length} detected agents`
207
+ },
208
+ {
209
+ value: "select",
210
+ label: "Select specific agents",
211
+ hint: "Choose which agents to install to"
212
+ }
213
+ ]
214
+ });
215
+
216
+ if (isCancel(installChoice)) {
217
+ cancel("Installation cancelled");
218
+ return null;
219
+ }
220
+
221
+ if (installChoice === "all") {
222
+ return detectedAgents;
223
+ }
224
+
225
+ // Let user select specific agents
226
+ const selectedAgents = await multiselect({
227
+ message: "Select agents to install skills to",
228
+ options: detectedAgents.map(agent => ({
229
+ value: agent.name,
230
+ label: agent.displayName,
231
+ hint: agent.skillsDir
232
+ })),
233
+ required: true
234
+ });
235
+
236
+ if (isCancel(selectedAgents)) {
237
+ cancel("Installation cancelled");
238
+ return null;
239
+ }
240
+
241
+ return detectedAgents.filter(a => selectedAgents.includes(a.name));
242
+ }
243
+
244
+ /**
245
+ * Prompt user to select installation scope (Project or Global)
246
+ * @returns {Promise<"project" | "global" | null>}
247
+ */
248
+ export async function selectScopePrompt() {
249
+ const scope = await select({
250
+ message: "Installation scope",
251
+ options: [
252
+ {
253
+ value: "project",
254
+ label: "Project",
255
+ hint: "Install in current directory (committed with your project)"
256
+ },
257
+ {
258
+ value: "global",
259
+ label: "Global",
260
+ hint: "Install globally (available across all projects)"
261
+ }
262
+ ]
263
+ });
264
+
265
+ if (isCancel(scope)) {
266
+ cancel("Installation cancelled");
267
+ return null;
268
+ }
269
+
270
+ return scope;
271
+ }
272
+
273
+ /**
274
+ * Prompt user to select installation method (Symlink or Copy)
275
+ * @returns {Promise<"symlink" | "copy" | null>}
276
+ */
277
+ export async function selectMethodPrompt() {
278
+ const method = await select({
279
+ message: "Installation method",
280
+ options: [
281
+ {
282
+ value: "symlink",
283
+ label: "Symlink (Recommended)",
284
+ hint: "Single source of truth, easy updates"
285
+ },
286
+ {
287
+ value: "copy",
288
+ label: "Copy to all agents",
289
+ hint: "Independent copies for each agent"
290
+ }
291
+ ]
292
+ });
293
+
294
+ if (isCancel(method)) {
295
+ cancel("Installation cancelled");
296
+ return null;
297
+ }
298
+
299
+ return method;
300
+ }
301
+
302
+ /**
303
+ * Prompt user to select skills to install (multiselect with descriptions)
304
+ * @param {Array<{name: string, description: string, path: string}>} skills
305
+ * @returns {Promise<Array<{name: string, description: string, path: string}> | null>}
306
+ */
307
+ export async function selectSkillsPrompt(skills) {
308
+ if (skills.length === 0) {
309
+ return null;
310
+ }
311
+
312
+ const selectedNames = await multiselect({
313
+ message: "Select skills to install",
314
+ options: skills.map(skill => ({
315
+ value: skill.name,
316
+ label: skill.name,
317
+ hint: skill.description ? skill.description.substring(0, 60) + "..." : ""
318
+ })),
319
+ required: true
320
+ });
321
+
322
+ if (isCancel(selectedNames)) {
323
+ cancel("Installation cancelled");
324
+ return null;
325
+ }
326
+
327
+ return skills.filter(s => selectedNames.includes(s.name));
328
+ }
329
+