agents-inc 0.155.0 → 0.157.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.
Files changed (173) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/dist/{chunk-PMUABBPG.js → chunk-24IGOJ7E.js} +9 -13
  3. package/dist/chunk-24IGOJ7E.js.map +1 -0
  4. package/dist/{chunk-H6UTKTLK.js → chunk-3E52LCYC.js} +98 -34
  5. package/dist/chunk-3E52LCYC.js.map +1 -0
  6. package/dist/{chunk-UMH2YZKG.js → chunk-4CIAZOTD.js} +4 -6
  7. package/dist/{chunk-UMH2YZKG.js.map → chunk-4CIAZOTD.js.map} +1 -1
  8. package/dist/{chunk-D2CAV7MG.js → chunk-4DMFK67G.js} +2 -2
  9. package/dist/{chunk-PNMM5HNX.js → chunk-4EPJWN7C.js} +9 -10
  10. package/dist/chunk-4EPJWN7C.js.map +1 -0
  11. package/dist/{chunk-MHRC3KRX.js → chunk-4KHUHPX4.js} +3 -3
  12. package/dist/chunk-4KHUHPX4.js.map +1 -0
  13. package/dist/{chunk-2H7UWE2G.js → chunk-CEGHC7L5.js} +13 -12
  14. package/dist/chunk-CEGHC7L5.js.map +1 -0
  15. package/dist/{chunk-MO5FGLVS.js → chunk-DCIC35R7.js} +11 -12
  16. package/dist/chunk-DCIC35R7.js.map +1 -0
  17. package/dist/{chunk-ILUVL7WM.js → chunk-DZD25NHW.js} +2 -2
  18. package/dist/{chunk-IO5YBKHV.js → chunk-G6G2FT2G.js} +10 -8
  19. package/dist/chunk-G6G2FT2G.js.map +1 -0
  20. package/dist/{chunk-RWOYPOMR.js → chunk-IGOFZG3S.js} +19 -5
  21. package/dist/chunk-IGOFZG3S.js.map +1 -0
  22. package/dist/{chunk-CLFHC2DK.js → chunk-K2VTGT45.js} +17 -18
  23. package/dist/chunk-K2VTGT45.js.map +1 -0
  24. package/dist/{chunk-YO2LTXB4.js → chunk-KTXVQ7OM.js} +115 -10
  25. package/dist/chunk-KTXVQ7OM.js.map +1 -0
  26. package/dist/{chunk-SY4X2LND.js → chunk-KUZBMEWR.js} +3 -3
  27. package/dist/{chunk-ZUAZHDKP.js → chunk-LDBVIPTP.js} +277 -40
  28. package/dist/chunk-LDBVIPTP.js.map +1 -0
  29. package/dist/{chunk-PCC4LBKB.js → chunk-MU2TQ5KK.js} +2 -2
  30. package/dist/{chunk-4G2YHZIM.js → chunk-O4K42CJB.js} +4 -6
  31. package/dist/{chunk-4G2YHZIM.js.map → chunk-O4K42CJB.js.map} +1 -1
  32. package/dist/{chunk-HXKOIWLU.js → chunk-P6OKOH62.js} +2 -6
  33. package/dist/chunk-P6OKOH62.js.map +1 -0
  34. package/dist/{chunk-IXRZAHZF.js → chunk-PGZSNNDA.js} +4 -4
  35. package/dist/{chunk-LJCNUP6M.js → chunk-PVPNVK3W.js} +2 -2
  36. package/dist/{chunk-4A4L3YIW.js → chunk-PXGDA2SY.js} +6 -7
  37. package/dist/chunk-PXGDA2SY.js.map +1 -0
  38. package/dist/{chunk-G47TDUK3.js → chunk-QNAMXQKF.js} +2 -2
  39. package/dist/{chunk-5OKLCVM4.js → chunk-QO4XD5V5.js} +3 -3
  40. package/dist/{chunk-5F2YR5XV.js → chunk-QXPMQBEI.js} +15 -5
  41. package/dist/chunk-QXPMQBEI.js.map +1 -0
  42. package/dist/{chunk-F5T6TV4Z.js → chunk-RLU2IXD3.js} +40 -14
  43. package/dist/chunk-RLU2IXD3.js.map +1 -0
  44. package/dist/{chunk-WCAUUBHO.js → chunk-RVXI5VQU.js} +14758 -14501
  45. package/dist/chunk-RVXI5VQU.js.map +1 -0
  46. package/dist/{chunk-WFRTHH3A.js → chunk-TZRXWFF5.js} +3 -3
  47. package/dist/{chunk-HG4JPXJT.js → chunk-V7PMQDDU.js} +23 -10
  48. package/dist/chunk-V7PMQDDU.js.map +1 -0
  49. package/dist/{chunk-Y5Y7XHVU.js → chunk-VI6U2PJG.js} +4 -4
  50. package/dist/{chunk-TBOVYLQJ.js → chunk-VTIDLRNA.js} +2 -2
  51. package/dist/{chunk-OKH64JZE.js → chunk-WCZNQECQ.js} +2 -2
  52. package/dist/{chunk-QWVXOCXO.js → chunk-WENBESZO.js} +7 -9
  53. package/dist/{chunk-QWVXOCXO.js.map → chunk-WENBESZO.js.map} +1 -1
  54. package/dist/{chunk-TNGMF4UX.js → chunk-XOZAKFTS.js} +12 -12
  55. package/dist/chunk-XOZAKFTS.js.map +1 -0
  56. package/dist/{chunk-6RLV45HN.js → chunk-YG5YPVTJ.js} +6 -6
  57. package/dist/chunk-YG5YPVTJ.js.map +1 -0
  58. package/dist/{chunk-HTYH7CKN.js → chunk-YKFCUVHG.js} +3 -3
  59. package/dist/{chunk-VPASBA7P.js → chunk-YXI3BTQQ.js} +2 -2
  60. package/dist/chunk-Z3H2K5PK.js +1352 -0
  61. package/dist/chunk-Z3H2K5PK.js.map +1 -0
  62. package/dist/{chunk-5QZAK6J7.js → chunk-ZAQ6WMJV.js} +50 -18
  63. package/dist/chunk-ZAQ6WMJV.js.map +1 -0
  64. package/dist/{chunk-GS2NZ3GD.js → chunk-ZBYVDXZG.js} +5 -5
  65. package/dist/chunk-ZBYVDXZG.js.map +1 -0
  66. package/dist/commands/build/marketplace.js +9 -12
  67. package/dist/commands/build/marketplace.js.map +1 -1
  68. package/dist/commands/build/plugins.js +9 -12
  69. package/dist/commands/build/plugins.js.map +1 -1
  70. package/dist/commands/compile.js +15 -19
  71. package/dist/commands/compile.js.map +1 -1
  72. package/dist/commands/doctor.js +75 -54
  73. package/dist/commands/doctor.js.map +1 -1
  74. package/dist/commands/edit.js +154 -109
  75. package/dist/commands/edit.js.map +1 -1
  76. package/dist/commands/eject.js +68 -38
  77. package/dist/commands/eject.js.map +1 -1
  78. package/dist/commands/init.js +36 -39
  79. package/dist/commands/list.js +8 -10
  80. package/dist/commands/list.js.map +1 -1
  81. package/dist/commands/new/marketplace.js +8 -11
  82. package/dist/commands/new/marketplace.js.map +1 -1
  83. package/dist/commands/search.js +10 -13
  84. package/dist/commands/search.js.map +1 -1
  85. package/dist/commands/share.js +8 -10
  86. package/dist/commands/share.js.map +1 -1
  87. package/dist/commands/uninstall.js +39 -28
  88. package/dist/commands/uninstall.js.map +1 -1
  89. package/dist/commands/update.js +7 -10
  90. package/dist/commands/update.js.map +1 -1
  91. package/dist/components/common/removal-plan-confirm.js +2 -2
  92. package/dist/components/common/select-list.js +2 -2
  93. package/dist/components/wizard/category-grid.js +4 -5
  94. package/dist/components/wizard/checkbox-grid.js +4 -4
  95. package/dist/components/wizard/domain-selection.js +9 -11
  96. package/dist/components/wizard/run-wizard-session.js +26 -28
  97. package/dist/components/wizard/scroll-affordance.js +2 -2
  98. package/dist/components/wizard/skill-agent-summary.js +5 -7
  99. package/dist/components/wizard/source-grid.js +5 -6
  100. package/dist/components/wizard/stack-selection.js +7 -9
  101. package/dist/components/wizard/step-agents.js +8 -10
  102. package/dist/components/wizard/step-build.js +7 -9
  103. package/dist/components/wizard/step-confirm.js +9 -11
  104. package/dist/components/wizard/step-sources.js +8 -10
  105. package/dist/components/wizard/step-stack.js +8 -10
  106. package/dist/components/wizard/summary-panel.js +8 -10
  107. package/dist/components/wizard/toast.js +2 -2
  108. package/dist/components/wizard/wizard-layout.js +12 -14
  109. package/dist/components/wizard/wizard-tabs.js +2 -4
  110. package/dist/components/wizard/wizard.js +25 -27
  111. package/dist/hooks/init.js +36 -39
  112. package/dist/hooks/init.js.map +1 -1
  113. package/dist/load-agent-defs-M6LRVISN.js +13 -0
  114. package/dist/recompile-project-agents-G7ZM25PC.js +17 -0
  115. package/dist/{source-loader-3DL3NYUX.js → source-loader-BIAEDR5R.js} +4 -8
  116. package/dist/src/agents/_templates/agent.liquid +2 -2
  117. package/dist/stores/wizard-store.js +6 -6
  118. package/package.json +1 -1
  119. package/src/agents/_templates/agent.liquid +2 -2
  120. package/src/schemas/custom-metadata.schema.json +1 -1
  121. package/src/schemas/marketplace.schema.json +2 -1
  122. package/dist/chunk-2H7UWE2G.js.map +0 -1
  123. package/dist/chunk-4A4L3YIW.js.map +0 -1
  124. package/dist/chunk-5F2YR5XV.js.map +0 -1
  125. package/dist/chunk-5QZAK6J7.js.map +0 -1
  126. package/dist/chunk-6RLV45HN.js.map +0 -1
  127. package/dist/chunk-CLFHC2DK.js.map +0 -1
  128. package/dist/chunk-F2AMBBIA.js +0 -64
  129. package/dist/chunk-F2AMBBIA.js.map +0 -1
  130. package/dist/chunk-F5T6TV4Z.js.map +0 -1
  131. package/dist/chunk-GS2NZ3GD.js.map +0 -1
  132. package/dist/chunk-H6UTKTLK.js.map +0 -1
  133. package/dist/chunk-HG4JPXJT.js.map +0 -1
  134. package/dist/chunk-HXKOIWLU.js.map +0 -1
  135. package/dist/chunk-IO5YBKHV.js.map +0 -1
  136. package/dist/chunk-MHRC3KRX.js.map +0 -1
  137. package/dist/chunk-MO5FGLVS.js.map +0 -1
  138. package/dist/chunk-PMUABBPG.js.map +0 -1
  139. package/dist/chunk-PNMM5HNX.js.map +0 -1
  140. package/dist/chunk-RWOYPOMR.js.map +0 -1
  141. package/dist/chunk-TNGMF4UX.js.map +0 -1
  142. package/dist/chunk-VASLW636.js +0 -23
  143. package/dist/chunk-VASLW636.js.map +0 -1
  144. package/dist/chunk-WCAUUBHO.js.map +0 -1
  145. package/dist/chunk-WUQ3MTPF.js +0 -173
  146. package/dist/chunk-WUQ3MTPF.js.map +0 -1
  147. package/dist/chunk-XAXJWXI4.js +0 -1667
  148. package/dist/chunk-XAXJWXI4.js.map +0 -1
  149. package/dist/chunk-YO2LTXB4.js.map +0 -1
  150. package/dist/chunk-ZUAZHDKP.js.map +0 -1
  151. package/dist/copy-local-skills-NSUTBVLJ.js +0 -14
  152. package/dist/load-agent-defs-X4E57I2U.js +0 -15
  153. package/dist/loader-G6BFG2VA.js +0 -24
  154. package/dist/recompile-project-agents-JE4MM72I.js +0 -20
  155. package/dist/recompile-project-agents-JE4MM72I.js.map +0 -1
  156. package/dist/source-loader-3DL3NYUX.js.map +0 -1
  157. /package/dist/{chunk-D2CAV7MG.js.map → chunk-4DMFK67G.js.map} +0 -0
  158. /package/dist/{chunk-ILUVL7WM.js.map → chunk-DZD25NHW.js.map} +0 -0
  159. /package/dist/{chunk-SY4X2LND.js.map → chunk-KUZBMEWR.js.map} +0 -0
  160. /package/dist/{chunk-PCC4LBKB.js.map → chunk-MU2TQ5KK.js.map} +0 -0
  161. /package/dist/{chunk-IXRZAHZF.js.map → chunk-PGZSNNDA.js.map} +0 -0
  162. /package/dist/{chunk-LJCNUP6M.js.map → chunk-PVPNVK3W.js.map} +0 -0
  163. /package/dist/{chunk-G47TDUK3.js.map → chunk-QNAMXQKF.js.map} +0 -0
  164. /package/dist/{chunk-5OKLCVM4.js.map → chunk-QO4XD5V5.js.map} +0 -0
  165. /package/dist/{chunk-WFRTHH3A.js.map → chunk-TZRXWFF5.js.map} +0 -0
  166. /package/dist/{chunk-Y5Y7XHVU.js.map → chunk-VI6U2PJG.js.map} +0 -0
  167. /package/dist/{chunk-TBOVYLQJ.js.map → chunk-VTIDLRNA.js.map} +0 -0
  168. /package/dist/{chunk-OKH64JZE.js.map → chunk-WCZNQECQ.js.map} +0 -0
  169. /package/dist/{chunk-HTYH7CKN.js.map → chunk-YKFCUVHG.js.map} +0 -0
  170. /package/dist/{chunk-VPASBA7P.js.map → chunk-YXI3BTQQ.js.map} +0 -0
  171. /package/dist/{copy-local-skills-NSUTBVLJ.js.map → load-agent-defs-M6LRVISN.js.map} +0 -0
  172. /package/dist/{load-agent-defs-X4E57I2U.js.map → recompile-project-agents-G7ZM25PC.js.map} +0 -0
  173. /package/dist/{loader-G6BFG2VA.js.map → source-loader-BIAEDR5R.js.map} +0 -0
@@ -1,1667 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- typedKeys
4
- } from "./chunk-VASLW636.js";
5
- import {
6
- AUTHOR_HANDLE_PATTERN,
7
- CLAUDE_SRC_DIR,
8
- DIRS,
9
- KEBAB_CASE_PATTERN,
10
- LOCAL_PSEUDO_CATEGORY,
11
- PROJECT_ROOT,
12
- STANDARD_DIRS,
13
- STANDARD_FILES
14
- } from "./chunk-IO5YBKHV.js";
15
-
16
- // src/cli/lib/loading/loader.ts
17
- import { parse as parseYaml2 } from "yaml";
18
- import path2 from "path";
19
- import { unique } from "remeda";
20
-
21
- // src/cli/utils/errors.ts
22
- function getErrorMessage(error) {
23
- return error instanceof Error ? error.message : String(error);
24
- }
25
-
26
- // src/cli/utils/frontmatter.ts
27
- import { parse as parseYaml } from "yaml";
28
- function extractFrontmatter(content) {
29
- const frontmatterRegex = /^---\r?\n([\s\S]*?)\r?\n---/;
30
- const match = content.match(frontmatterRegex);
31
- if (!match || !match[1]) {
32
- return null;
33
- }
34
- try {
35
- return parseYaml(match[1]);
36
- } catch {
37
- return null;
38
- }
39
- }
40
-
41
- // src/cli/utils/fs.ts
42
- import fs from "fs-extra";
43
- import fg from "fast-glob";
44
- import os from "os";
45
- import path from "path";
46
-
47
- // src/cli/lib/config-gate/gate-token.ts
48
- import { AsyncLocalStorage } from "async_hooks";
49
- var gateToken = new AsyncLocalStorage();
50
- var GlobalPairWriteViolation = class extends Error {
51
- constructor(targetPath) {
52
- super(
53
- `${targetPath} may only be written through config-gate \u2014 see src/cli/lib/config-gate/index.ts`
54
- );
55
- this.name = "GlobalPairWriteViolation";
56
- }
57
- };
58
- function withGateToken(fn) {
59
- return gateToken.run(true, fn);
60
- }
61
- function hasGateToken() {
62
- return gateToken.getStore() === true;
63
- }
64
- function assertGateToken(targetPath) {
65
- if (hasGateToken()) return;
66
- throw new GlobalPairWriteViolation(targetPath);
67
- }
68
-
69
- // src/cli/utils/fs.ts
70
- function isPathWithin(child, parent) {
71
- const resolvedChild = path.resolve(child);
72
- const resolvedParent = path.resolve(parent);
73
- return resolvedChild === resolvedParent || resolvedChild.startsWith(resolvedParent + path.sep);
74
- }
75
- async function readFile(filePath) {
76
- return fs.readFile(filePath, "utf-8");
77
- }
78
- async function readFileSafe(filePath, maxSizeBytes) {
79
- const stats = await fs.stat(filePath);
80
- if (stats.size > maxSizeBytes) {
81
- throw new Error(
82
- `File too large: '${filePath}' is ${stats.size} bytes (limit: ${maxSizeBytes} bytes)`
83
- );
84
- }
85
- return fs.readFile(filePath, "utf-8");
86
- }
87
- async function readFileOptional(filePath, fallback = "") {
88
- try {
89
- return await fs.readFile(filePath, "utf-8");
90
- } catch {
91
- return fallback;
92
- }
93
- }
94
- async function fileExists(filePath) {
95
- return fs.pathExists(filePath);
96
- }
97
- async function directoryExists(dirPath) {
98
- try {
99
- const stat = await fs.stat(dirPath);
100
- return stat.isDirectory();
101
- } catch {
102
- return false;
103
- }
104
- }
105
- async function listDirectories(dirPath) {
106
- try {
107
- const entries = await fs.readdir(dirPath, { withFileTypes: true });
108
- return entries.filter((e) => e.isDirectory()).map((e) => e.name);
109
- } catch {
110
- return [];
111
- }
112
- }
113
- async function glob(pattern, cwd, { dot = false } = {}) {
114
- return fg(pattern, { cwd, onlyFiles: true, dot });
115
- }
116
- function isGlobalPairPath(resolvedPath) {
117
- const globalConfigDir = path.join(os.homedir(), CLAUDE_SRC_DIR);
118
- return resolvedPath === path.join(globalConfigDir, STANDARD_FILES.CONFIG_TS) || resolvedPath === path.join(globalConfigDir, STANDARD_FILES.CONFIG_TYPES_TS);
119
- }
120
- async function writeFile(filePath, content) {
121
- const resolvedPath = path.resolve(filePath);
122
- if (isGlobalPairPath(resolvedPath)) assertGateToken(resolvedPath);
123
- await fs.ensureDir(path.dirname(filePath));
124
- await fs.writeFile(filePath, content, "utf-8");
125
- }
126
- async function ensureDir(dirPath) {
127
- await fs.ensureDir(dirPath);
128
- }
129
- async function remove(filePath) {
130
- await fs.remove(filePath);
131
- }
132
- async function isDirectoryEmpty(dirPath) {
133
- try {
134
- const entries = await fs.readdir(dirPath);
135
- return entries.length === 0;
136
- } catch {
137
- return true;
138
- }
139
- }
140
- async function removeDirIfEmpty(dir) {
141
- if (!await directoryExists(dir)) return false;
142
- if (!await isDirectoryEmpty(dir)) return false;
143
- await remove(dir);
144
- return true;
145
- }
146
- async function copy(src, dest) {
147
- await fs.copy(src, dest);
148
- }
149
-
150
- // src/cli/utils/logger.ts
151
- var verboseMode = false;
152
- function setVerbose(enabled) {
153
- verboseMode = enabled;
154
- }
155
- function verbose(msg) {
156
- if (verboseMode) {
157
- console.log(` ${msg}`);
158
- }
159
- }
160
- function log(msg) {
161
- console.log(msg);
162
- }
163
- var bufferMode = false;
164
- var messageBuffer = [];
165
- function enableBuffering() {
166
- bufferMode = true;
167
- messageBuffer = [];
168
- }
169
- function drainBuffer() {
170
- const messages = [...messageBuffer];
171
- messageBuffer = [];
172
- return messages;
173
- }
174
- function disableBuffering() {
175
- bufferMode = false;
176
- messageBuffer = [];
177
- }
178
- function warn(msg, options) {
179
- if (options?.suppressInTest && process.env.VITEST) {
180
- return;
181
- }
182
- if (bufferMode) {
183
- messageBuffer.push({ level: "warn", text: msg });
184
- return;
185
- }
186
- console.warn(` Warning: ${msg}`);
187
- }
188
-
189
- // src/cli/lib/schemas.ts
190
- import { z as z2 } from "zod";
191
- import { partition } from "remeda";
192
-
193
- // src/cli/lib/schema-validator.ts
194
- import "zod";
195
- function formatZodIssue(issue) {
196
- const path3 = issue.path.join(".");
197
- if (issue.code === "unrecognized_keys") {
198
- return `Unrecognized key: "${issue.keys.join('", "')}"`;
199
- }
200
- return path3 ? `${path3}: ${issue.message}` : issue.message;
201
- }
202
- function formatZodErrors(error) {
203
- return error.issues.map(formatZodIssue);
204
- }
205
-
206
- // src/cli/types/generated/source-types.ts
207
- var SKILL_SLUGS = [
208
- "ai-planning",
209
- "ai-reviewing",
210
- "angular-standalone",
211
- "ant-design",
212
- "anthropic-sdk",
213
- "api-performance",
214
- "api-planning",
215
- "api-reviewing",
216
- "apollo-server",
217
- "app-links",
218
- "appwrite",
219
- "astro",
220
- "auth-security",
221
- "aws-sdk",
222
- "axiom-pino-sentry",
223
- "base-ui",
224
- "better-auth-drizzle-hono",
225
- "biome",
226
- "ble-nfc",
227
- "bullmq",
228
- "chakra-ui",
229
- "changesets",
230
- "chroma",
231
- "clack",
232
- "claude-vision",
233
- "clerk",
234
- "cli-commander",
235
- "cli-planning",
236
- "cli-reviewing",
237
- "cloudflare-workers",
238
- "cockroachdb",
239
- "cohere-sdk",
240
- "component-library",
241
- "composable-components",
242
- "css-animations",
243
- "cva",
244
- "cypress-e2e",
245
- "d3",
246
- "date-fns",
247
- "design-tokens",
248
- "detox",
249
- "dnd-kit",
250
- "docker",
251
- "docusaurus",
252
- "drizzle",
253
- "eas",
254
- "edgedb",
255
- "elasticsearch",
256
- "electron",
257
- "electron-forge",
258
- "electron-ipc",
259
- "electron-multiwindow",
260
- "electron-security",
261
- "electron-storage",
262
- "electron-testing",
263
- "electron-ui",
264
- "electron-updater",
265
- "elevenlabs",
266
- "elysia",
267
- "error-boundaries",
268
- "eslint-prettier",
269
- "expo",
270
- "expo-router",
271
- "express",
272
- "expressive-typescript",
273
- "fastify",
274
- "file-upload-patterns",
275
- "firebase",
276
- "framer-motion",
277
- "gesture-handler",
278
- "git-hooks",
279
- "github-actions",
280
- "google-gemini-sdk",
281
- "graphql-apollo",
282
- "graphql-urql",
283
- "headless-ui",
284
- "hono",
285
- "huggingface-inference",
286
- "image-handling",
287
- "infra-reviewing",
288
- "jotai",
289
- "knex",
290
- "kubernetes",
291
- "langchain",
292
- "langfuse",
293
- "leaflet",
294
- "lexical",
295
- "litellm",
296
- "llamaindex",
297
- "maestro",
298
- "mantine",
299
- "mapbox",
300
- "meilisearch",
301
- "mercurius",
302
- "mistral-sdk",
303
- "mmkv",
304
- "mobx",
305
- "modal",
306
- "mongodb",
307
- "mongoose",
308
- "msw",
309
- "mui",
310
- "mysql",
311
- "native-js",
312
- "nativewind",
313
- "neon",
314
- "nestjs",
315
- "netlify",
316
- "next-intl",
317
- "nextauth",
318
- "nextjs",
319
- "ngrx-signalstore",
320
- "nuxt",
321
- "nx",
322
- "oclif-ink",
323
- "offline-first",
324
- "ollama",
325
- "openai-sdk",
326
- "openai-whisper",
327
- "openapi",
328
- "payload",
329
- "pinecone",
330
- "pinia",
331
- "planetscale",
332
- "playwright-e2e",
333
- "pnpm-workspaces",
334
- "postgresql",
335
- "posthog-analytics",
336
- "posthog-flags",
337
- "prisma",
338
- "promptfoo",
339
- "pulumi",
340
- "push",
341
- "qdrant",
342
- "qwik",
343
- "radix-ui",
344
- "react",
345
- "react-hook-form",
346
- "react-intl",
347
- "react-native",
348
- "react-native-paper",
349
- "react-native-performance",
350
- "react-native-security",
351
- "react-navigation",
352
- "react-query",
353
- "react-router",
354
- "react-testing-library",
355
- "react-three-fiber",
356
- "reanimated",
357
- "recharts",
358
- "redis",
359
- "redux-toolkit",
360
- "remix",
361
- "replicate",
362
- "research-methodology",
363
- "resend-react-email",
364
- "result-types",
365
- "reviewing",
366
- "rxjs",
367
- "sanity",
368
- "scss-modules",
369
- "sequelize",
370
- "service-workers",
371
- "setup-axiom-pino-sentry",
372
- "setup-env",
373
- "setup-posthog",
374
- "setup-resend",
375
- "shadcn-ui",
376
- "skia",
377
- "socket-io",
378
- "solidjs",
379
- "sqlite-powersync",
380
- "sse",
381
- "sst",
382
- "stack-detect",
383
- "storybook",
384
- "strapi",
385
- "strategies",
386
- "stripe",
387
- "supabase",
388
- "surrealdb",
389
- "svelte",
390
- "sveltekit",
391
- "swr",
392
- "tailwind",
393
- "tamagui",
394
- "tanstack-form",
395
- "tanstack-router",
396
- "tanstack-table",
397
- "tasks",
398
- "tauri",
399
- "tauri-backend",
400
- "tauri-bundling",
401
- "tauri-mobile",
402
- "tauri-multiwindow",
403
- "tauri-plugins",
404
- "tauri-security",
405
- "terraform",
406
- "theming",
407
- "tiptap",
408
- "together-ai",
409
- "tool-use-patterns",
410
- "trpc",
411
- "turborepo",
412
- "turborepo-ci",
413
- "turso",
414
- "typeorm",
415
- "typescript-config",
416
- "unistyles",
417
- "upstash",
418
- "vee-validate",
419
- "vercel",
420
- "vercel-ai-sdk",
421
- "vercel-kv",
422
- "vercel-postgres",
423
- "view-transitions",
424
- "vision-camera",
425
- "visual-regression",
426
- "vite",
427
- "vitepress",
428
- "vitest",
429
- "vue-composition-api",
430
- "vue-i18n",
431
- "vue-test-utils",
432
- "vuetify",
433
- "vueuse",
434
- "watermelondb",
435
- "weaviate",
436
- "web-accessibility",
437
- "web-performance",
438
- "web-planning",
439
- "web-reviewing",
440
- "webhooks",
441
- "websockets",
442
- "xquik",
443
- "yoga",
444
- "zod-validation",
445
- "zustand"
446
- ];
447
- var SKILL_IDS = [
448
- "ai-infrastructure-huggingface-inference",
449
- "ai-infrastructure-litellm",
450
- "ai-infrastructure-modal",
451
- "ai-infrastructure-ollama",
452
- "ai-infrastructure-replicate",
453
- "ai-infrastructure-together-ai",
454
- "ai-observability-langfuse",
455
- "ai-observability-promptfoo",
456
- "ai-orchestration-langchain",
457
- "ai-orchestration-llamaindex",
458
- "ai-orchestration-vercel-ai-sdk",
459
- "ai-patterns-tool-use-patterns",
460
- "ai-provider-anthropic-sdk",
461
- "ai-provider-claude-vision",
462
- "ai-provider-cohere-sdk",
463
- "ai-provider-elevenlabs",
464
- "ai-provider-google-gemini-sdk",
465
- "ai-provider-mistral-sdk",
466
- "ai-provider-openai-sdk",
467
- "ai-provider-openai-whisper",
468
- "api-analytics-posthog-analytics",
469
- "api-analytics-setup-posthog",
470
- "api-auth-better-auth-drizzle-hono",
471
- "api-auth-clerk",
472
- "api-auth-nextauth",
473
- "api-baas-appwrite",
474
- "api-baas-firebase",
475
- "api-baas-neon",
476
- "api-baas-planetscale",
477
- "api-baas-supabase",
478
- "api-baas-turso",
479
- "api-caching-strategies",
480
- "api-cms-payload",
481
- "api-cms-sanity",
482
- "api-cms-strapi",
483
- "api-commerce-stripe",
484
- "api-database-cockroachdb",
485
- "api-database-drizzle",
486
- "api-database-edgedb",
487
- "api-database-knex",
488
- "api-database-mongodb",
489
- "api-database-mongoose",
490
- "api-database-mysql",
491
- "api-database-postgresql",
492
- "api-database-prisma",
493
- "api-database-redis",
494
- "api-database-sequelize",
495
- "api-database-surrealdb",
496
- "api-database-typeorm",
497
- "api-database-upstash",
498
- "api-database-vercel-kv",
499
- "api-database-vercel-postgres",
500
- "api-email-resend-react-email",
501
- "api-email-setup-resend",
502
- "api-flags-posthog-flags",
503
- "api-framework-elysia",
504
- "api-framework-express",
505
- "api-framework-fastify",
506
- "api-framework-hono",
507
- "api-framework-nestjs",
508
- "api-graphql-apollo-server",
509
- "api-graphql-mercurius",
510
- "api-graphql-yoga",
511
- "api-messaging-webhooks",
512
- "api-observability-axiom-pino-sentry",
513
- "api-observability-setup-axiom-pino-sentry",
514
- "api-performance-api-performance",
515
- "api-queue-bullmq",
516
- "api-search-elasticsearch",
517
- "api-search-meilisearch",
518
- "api-search-xquik",
519
- "api-specs-openapi",
520
- "api-vector-db-chroma",
521
- "api-vector-db-pinecone",
522
- "api-vector-db-qdrant",
523
- "api-vector-db-weaviate",
524
- "cli-framework-cli-commander",
525
- "cli-framework-oclif-ink",
526
- "cli-prompts-clack",
527
- "desktop-backend-tauri",
528
- "desktop-framework-electron",
529
- "desktop-framework-tauri",
530
- "desktop-ipc-electron",
531
- "desktop-mobile-tauri",
532
- "desktop-multiwindow-electron",
533
- "desktop-multiwindow-tauri",
534
- "desktop-packaging-electron-forge",
535
- "desktop-packaging-tauri",
536
- "desktop-plugins-tauri",
537
- "desktop-security-electron",
538
- "desktop-security-tauri",
539
- "desktop-storage-electron",
540
- "desktop-testing-electron",
541
- "desktop-ui-electron",
542
- "desktop-updates-electron-updater",
543
- "infra-ci-cd-docker",
544
- "infra-ci-cd-github-actions",
545
- "infra-ci-cd-turborepo-ci",
546
- "infra-config-setup-env",
547
- "infra-containers-kubernetes",
548
- "infra-iac-pulumi",
549
- "infra-iac-sst",
550
- "infra-iac-terraform",
551
- "infra-platform-aws-sdk",
552
- "infra-platform-cloudflare-workers",
553
- "infra-platform-netlify",
554
- "infra-platform-vercel",
555
- "meta-config-stack-detect",
556
- "meta-design-composable-components",
557
- "meta-design-expressive-typescript",
558
- "meta-methodology-research-methodology",
559
- "meta-planning-ai-planning",
560
- "meta-planning-api-planning",
561
- "meta-planning-cli-planning",
562
- "meta-planning-web-planning",
563
- "meta-reviewing-ai-reviewing",
564
- "meta-reviewing-api-reviewing",
565
- "meta-reviewing-cli-reviewing",
566
- "meta-reviewing-infra-reviewing",
567
- "meta-reviewing-reviewing",
568
- "meta-reviewing-web-reviewing",
569
- "mobile-animation-gesture-handler",
570
- "mobile-animation-reanimated",
571
- "mobile-animation-skia",
572
- "mobile-background-tasks",
573
- "mobile-camera-vision-camera",
574
- "mobile-deep-linking-app-links",
575
- "mobile-deployment-eas",
576
- "mobile-framework-expo",
577
- "mobile-framework-react-native",
578
- "mobile-hardware-ble-nfc",
579
- "mobile-navigation-expo-router",
580
- "mobile-navigation-react-navigation",
581
- "mobile-notifications-push",
582
- "mobile-performance-react-native",
583
- "mobile-security-react-native",
584
- "mobile-storage-mmkv",
585
- "mobile-storage-sqlite-powersync",
586
- "mobile-storage-watermelondb",
587
- "mobile-styling-nativewind",
588
- "mobile-styling-unistyles",
589
- "mobile-testing-detox",
590
- "mobile-testing-maestro",
591
- "mobile-ui-components-react-native-paper",
592
- "mobile-ui-components-tamagui",
593
- "shared-monorepo-nx",
594
- "shared-monorepo-pnpm-workspaces",
595
- "shared-monorepo-turborepo",
596
- "shared-security-auth-security",
597
- "shared-tooling-biome",
598
- "shared-tooling-changesets",
599
- "shared-tooling-eslint-prettier",
600
- "shared-tooling-git-hooks",
601
- "shared-tooling-typescript-config",
602
- "web-3d-react-three-fiber",
603
- "web-accessibility-web-accessibility",
604
- "web-animation-css-animations",
605
- "web-animation-framer-motion",
606
- "web-animation-view-transitions",
607
- "web-data-fetching-graphql-apollo",
608
- "web-data-fetching-graphql-urql",
609
- "web-data-fetching-swr",
610
- "web-data-fetching-trpc",
611
- "web-dataviz-d3",
612
- "web-dataviz-recharts",
613
- "web-dnd-dnd-kit",
614
- "web-editor-lexical",
615
- "web-editor-tiptap",
616
- "web-error-handling-error-boundaries",
617
- "web-error-handling-result-types",
618
- "web-files-file-upload-patterns",
619
- "web-files-image-handling",
620
- "web-forms-react-hook-form",
621
- "web-forms-tanstack-form",
622
- "web-forms-vee-validate",
623
- "web-forms-zod-validation",
624
- "web-framework-angular-standalone",
625
- "web-framework-react",
626
- "web-framework-solidjs",
627
- "web-framework-svelte",
628
- "web-framework-vue-composition-api",
629
- "web-i18n-next-intl",
630
- "web-i18n-react-intl",
631
- "web-i18n-vue-i18n",
632
- "web-maps-leaflet",
633
- "web-maps-mapbox",
634
- "web-meta-framework-astro",
635
- "web-meta-framework-docusaurus",
636
- "web-meta-framework-nextjs",
637
- "web-meta-framework-nuxt",
638
- "web-meta-framework-qwik",
639
- "web-meta-framework-remix",
640
- "web-meta-framework-sveltekit",
641
- "web-meta-framework-vitepress",
642
- "web-mocks-msw",
643
- "web-performance-web-performance",
644
- "web-pwa-offline-first",
645
- "web-pwa-service-workers",
646
- "web-realtime-socket-io",
647
- "web-realtime-sse",
648
- "web-realtime-websockets",
649
- "web-routing-react-router",
650
- "web-routing-tanstack-router",
651
- "web-server-state-react-query",
652
- "web-state-jotai",
653
- "web-state-mobx",
654
- "web-state-ngrx-signalstore",
655
- "web-state-pinia",
656
- "web-state-redux-toolkit",
657
- "web-state-zustand",
658
- "web-styling-cva",
659
- "web-styling-design-tokens",
660
- "web-styling-scss-modules",
661
- "web-styling-tailwind",
662
- "web-styling-theming",
663
- "web-testing-cypress-e2e",
664
- "web-testing-playwright-e2e",
665
- "web-testing-react-testing-library",
666
- "web-testing-visual-regression",
667
- "web-testing-vitest",
668
- "web-testing-vue-test-utils",
669
- "web-tooling-component-library",
670
- "web-tooling-storybook",
671
- "web-tooling-vite",
672
- "web-ui-ant-design",
673
- "web-ui-base-ui",
674
- "web-ui-chakra-ui",
675
- "web-ui-headless-ui",
676
- "web-ui-mantine",
677
- "web-ui-mui",
678
- "web-ui-radix-ui",
679
- "web-ui-shadcn-ui",
680
- "web-ui-tanstack-table",
681
- "web-ui-vuetify",
682
- "web-utilities-date-fns",
683
- "web-utilities-native-js",
684
- "web-utilities-rxjs",
685
- "web-utilities-vueuse"
686
- ];
687
- var CATEGORIES = [
688
- "ai-infrastructure",
689
- "ai-observability",
690
- "ai-orchestration",
691
- "ai-patterns",
692
- "ai-provider",
693
- "api-analytics",
694
- "api-api",
695
- "api-auth",
696
- "api-baas",
697
- "api-caching",
698
- "api-cms",
699
- "api-commerce",
700
- "api-db-host",
701
- "api-document",
702
- "api-email",
703
- "api-graphql",
704
- "api-kv",
705
- "api-messaging",
706
- "api-observability",
707
- "api-orm",
708
- "api-performance",
709
- "api-queue",
710
- "api-search",
711
- "api-specs",
712
- "api-sql-engine",
713
- "api-vector-db",
714
- "cli-framework",
715
- "cli-prompts",
716
- "desktop-backend",
717
- "desktop-framework",
718
- "desktop-ipc",
719
- "desktop-mobile",
720
- "desktop-multiwindow",
721
- "desktop-packaging",
722
- "desktop-plugins",
723
- "desktop-security",
724
- "desktop-storage",
725
- "desktop-testing",
726
- "desktop-ui",
727
- "desktop-updates",
728
- "infra-ci-cd",
729
- "infra-config",
730
- "infra-containers",
731
- "infra-iac",
732
- "infra-platform",
733
- "meta-design",
734
- "meta-methodology",
735
- "meta-planning",
736
- "meta-reviewing",
737
- "mobile-animation",
738
- "mobile-background",
739
- "mobile-camera",
740
- "mobile-deep-linking",
741
- "mobile-deployment",
742
- "mobile-framework",
743
- "mobile-hardware",
744
- "mobile-navigation",
745
- "mobile-notifications",
746
- "mobile-performance",
747
- "mobile-security",
748
- "mobile-storage",
749
- "mobile-styling",
750
- "mobile-testing",
751
- "mobile-ui-components",
752
- "shared-lint",
753
- "shared-monorepo",
754
- "shared-security",
755
- "shared-task-runner",
756
- "shared-tooling",
757
- "web-3d",
758
- "web-accessibility",
759
- "web-animation",
760
- "web-client-state",
761
- "web-dataviz",
762
- "web-dnd",
763
- "web-docs",
764
- "web-e2e",
765
- "web-editor",
766
- "web-error-handling",
767
- "web-file-upload",
768
- "web-files",
769
- "web-form-library",
770
- "web-forms",
771
- "web-framework",
772
- "web-graphql-client",
773
- "web-i18n",
774
- "web-maps",
775
- "web-meta-framework",
776
- "web-mocking",
777
- "web-performance",
778
- "web-pwa",
779
- "web-realtime",
780
- "web-routing",
781
- "web-rpc",
782
- "web-server-state",
783
- "web-streaming",
784
- "web-styling",
785
- "web-testing",
786
- "web-tooling",
787
- "web-ui-components",
788
- "web-ui-kit",
789
- "web-utilities"
790
- ];
791
- var DOMAINS = [
792
- "ai",
793
- "api",
794
- "cli",
795
- "desktop",
796
- "infra",
797
- "meta",
798
- "mobile",
799
- "shared",
800
- "web"
801
- ];
802
- var AGENT_NAMES = [
803
- "agent-summoner",
804
- "ai-developer",
805
- "ai-researcher",
806
- "ai-tester",
807
- "api-developer",
808
- "api-researcher",
809
- "api-tester",
810
- "cli-developer",
811
- "cli-researcher",
812
- "cli-tester",
813
- "codex-keeper",
814
- "convention-keeper",
815
- "pm",
816
- "reviewer",
817
- "skill-summoner",
818
- "web-developer",
819
- "web-researcher",
820
- "web-tester"
821
- ];
822
-
823
- // src/cli/utils/type-guards.ts
824
- function isRecord(value) {
825
- return typeof value === "object" && value !== null && !Array.isArray(value);
826
- }
827
- function isDomain(value) {
828
- return DOMAINS.includes(value);
829
- }
830
- function isAgentName(value) {
831
- return AGENT_NAMES.includes(value);
832
- }
833
- function isSkillId(value) {
834
- return SKILL_IDS.includes(value);
835
- }
836
- function isSkillAssignment(value) {
837
- if (typeof value !== "object" || value === null) return false;
838
- return typeof value.id === "string";
839
- }
840
-
841
- // src/cli/types/matrix.ts
842
- var MODEL_NAMES = ["sonnet", "opus", "haiku", "fable", "inherit"];
843
- var EFFORT_NAMES = ["low", "medium", "high", "xhigh", "max"];
844
- var PERMISSION_MODES = [
845
- "default",
846
- "acceptEdits",
847
- "dontAsk",
848
- "bypassPermissions",
849
- "plan",
850
- "delegate"
851
- ];
852
-
853
- // src/cli/lib/schemas.ts
854
- var modelNameSchema = z2.enum(MODEL_NAMES);
855
- var effortLevelSchema = z2.enum(EFFORT_NAMES);
856
- var permissionModeSchema = z2.enum(PERMISSION_MODES);
857
- var skillSlugSchema = z2.enum(SKILL_SLUGS);
858
- var categoryPathSchema = z2.string().refine(
859
- (val) => {
860
- if (val === LOCAL_PSEUDO_CATEGORY) return true;
861
- if (CATEGORIES.includes(val)) return true;
862
- return KEBAB_CASE_PATTERN.test(val);
863
- },
864
- {
865
- message: "Must be a valid category path (e.g., 'web-framework', 'shared-testing', or 'local')"
866
- }
867
- );
868
- var agentHookActionSchema = z2.object({
869
- type: z2.enum(["command", "script", "prompt"]),
870
- command: z2.string().exactOptional(),
871
- script: z2.string().exactOptional(),
872
- prompt: z2.string().exactOptional()
873
- });
874
- var agentHookDefinitionSchema = z2.object({
875
- matcher: z2.string().exactOptional(),
876
- hooks: z2.array(agentHookActionSchema).exactOptional()
877
- });
878
- var hooksRecordSchema = z2.record(z2.string(), z2.array(agentHookDefinitionSchema));
879
- var strictAgentHookDefinitionSchema = z2.object({
880
- matcher: z2.string().exactOptional(),
881
- hooks: z2.array(agentHookActionSchema).min(1)
882
- });
883
- var strictHooksRecordSchema = z2.record(
884
- z2.string(),
885
- z2.array(strictAgentHookDefinitionSchema)
886
- );
887
- var skillAssignmentSchema = z2.object({
888
- id: z2.string(),
889
- preloaded: z2.boolean().exactOptional(),
890
- local: z2.boolean().exactOptional(),
891
- path: z2.string().exactOptional()
892
- });
893
- var skillFrontmatterLoaderSchema = z2.object({
894
- /** Lenient (any string): local/custom skills have non-builtin IDs */
895
- name: z2.string(),
896
- description: z2.string(),
897
- model: modelNameSchema.exactOptional()
898
- });
899
- var skillMetadataLoaderSchema = z2.object({
900
- category: categoryPathSchema.exactOptional(),
901
- author: z2.string().exactOptional(),
902
- domain: z2.string(),
903
- custom: z2.boolean().exactOptional()
904
- }).passthrough();
905
- var matrixRawMetadataSchema = z2.object({
906
- category: categoryPathSchema,
907
- author: z2.string(),
908
- displayName: z2.string().exactOptional(),
909
- slug: z2.string(),
910
- cliDescription: z2.string().exactOptional(),
911
- usageGuidance: z2.string().exactOptional(),
912
- // Boundary cast: domain is a string at the YAML parse boundary; narrowed to Domain type
913
- domain: z2.string(),
914
- custom: z2.boolean().exactOptional()
915
- });
916
- var pluginAuthorSchema = z2.object({
917
- name: z2.string().min(1),
918
- email: z2.string().exactOptional()
919
- });
920
- var pluginManifestObjectSchema = z2.object({
921
- name: z2.string(),
922
- version: z2.string().exactOptional(),
923
- description: z2.string().exactOptional(),
924
- author: pluginAuthorSchema.exactOptional(),
925
- /** Lenient: a plugin authored elsewhere may carry any category string or none at all */
926
- category: z2.string().exactOptional(),
927
- keywords: z2.array(z2.string()).exactOptional(),
928
- commands: z2.union([z2.string(), z2.array(z2.string())]).exactOptional(),
929
- agents: z2.union([z2.string(), z2.array(z2.string())]).exactOptional(),
930
- skills: z2.union([z2.string(), z2.array(z2.string())]).exactOptional(),
931
- hooks: z2.union([z2.string(), hooksRecordSchema]).exactOptional()
932
- });
933
- var pluginManifestSchema = pluginManifestObjectSchema;
934
- var pluginManifestValidationSchema = pluginManifestObjectSchema.strict();
935
- var agentYamlConfigSchema = z2.object({
936
- id: z2.string(),
937
- title: z2.string(),
938
- description: z2.string(),
939
- model: modelNameSchema.exactOptional(),
940
- effort: effortLevelSchema.exactOptional(),
941
- tools: z2.array(z2.string()),
942
- disallowedTools: z2.array(z2.string()).exactOptional(),
943
- permissionMode: permissionModeSchema.exactOptional(),
944
- hooks: hooksRecordSchema.exactOptional(),
945
- outputFormat: z2.string().exactOptional(),
946
- domain: z2.string().exactOptional(),
947
- custom: z2.boolean().exactOptional()
948
- });
949
- var skillAssignmentElementSchema = z2.union([
950
- z2.string(),
951
- skillAssignmentSchema
952
- ]);
953
- var stackAgentConfigSchema = z2.record(
954
- z2.string(),
955
- z2.union([skillAssignmentElementSchema, z2.array(skillAssignmentElementSchema)])
956
- );
957
- var RENAMED_CONFIG_FIELDS = { source: "marketplace" };
958
- var RENAMED_SKILL_ENTRY_FIELDS = { source: "origin" };
959
- function renamedFieldMessage(oldKey, newKey) {
960
- return `"${oldKey}" was renamed to "${newKey}". Rename the key in this config \u2014 the CLI does not read "${oldKey}" any more and will not fall back to it.`;
961
- }
962
- function reportRenamedKeys(record, renames, path3, ctx) {
963
- for (const [oldKey, newKey] of Object.entries(renames)) {
964
- if (!(oldKey in record)) continue;
965
- ctx.addIssue({
966
- code: "custom",
967
- path: [...path3, oldKey],
968
- message: renamedFieldMessage(oldKey, newKey)
969
- });
970
- }
971
- }
972
- function refuseRenamedFields(config, ctx) {
973
- if (!isRecord(config)) return;
974
- reportRenamedKeys(config, RENAMED_CONFIG_FIELDS, [], ctx);
975
- const { skills } = config;
976
- if (!Array.isArray(skills)) return;
977
- for (const [index, entry] of skills.entries()) {
978
- if (!isRecord(entry)) continue;
979
- reportRenamedKeys(entry, RENAMED_SKILL_ENTRY_FIELDS, ["skills", index], ctx);
980
- }
981
- }
982
- var renamedFieldGuard = z2.unknown().superRefine(refuseRenamedFields);
983
- var projectConfigFields = z2.object({
984
- /** Project/plugin name in kebab-case */
985
- name: z2.string().exactOptional(),
986
- description: z2.string().exactOptional(),
987
- /** Per-agent configuration with scope (e.g., [{ name: "web-developer", scope: "project" }]) */
988
- agents: z2.array(
989
- z2.object({
990
- name: z2.string(),
991
- scope: z2.enum(["project", "global"]),
992
- /** Per-agent overrides of the agent's own metadata defaults */
993
- model: modelNameSchema.exactOptional(),
994
- effort: effortLevelSchema.exactOptional(),
995
- excluded: z2.boolean().exactOptional()
996
- })
997
- ).exactOptional(),
998
- /** Per-skill configuration with scope and provenance */
999
- skills: z2.array(
1000
- z2.object({
1001
- id: z2.string(),
1002
- scope: z2.enum(["project", "global"]),
1003
- origin: z2.string(),
1004
- excluded: z2.boolean().exactOptional()
1005
- })
1006
- ).exactOptional(),
1007
- /** Author handle (e.g., "@vince") */
1008
- author: z2.string().exactOptional(),
1009
- /** Selected domains from the wizard (persisted for edit mode restoration) */
1010
- selectedDomains: z2.array(z2.string()).exactOptional(),
1011
- /** Agent-to-category-to-skill mappings from selected stack (accepts same formats as stacks.ts) */
1012
- stack: z2.record(z2.string(), stackAgentConfigSchema).exactOptional(),
1013
- /** The marketplace this install reads skills from, as a path or URL (e.g., "github:my-org/skills") */
1014
- marketplace: z2.string().exactOptional(),
1015
- /** The name that marketplace's manifest gives it, which plugins are registered under */
1016
- marketplaceName: z2.string().exactOptional(),
1017
- /** Separate source for agents when different from skills source */
1018
- agentsSource: z2.string().exactOptional(),
1019
- /** Tracked project installation paths (global config only) */
1020
- projects: z2.array(z2.string()).exactOptional()
1021
- }).passthrough();
1022
- var projectConfigLoaderSchema = renamedFieldGuard.pipe(projectConfigFields);
1023
- var categoryDefinitionSchema = z2.object({
1024
- id: z2.string(),
1025
- displayName: z2.string(),
1026
- description: z2.string(),
1027
- domain: z2.string().exactOptional(),
1028
- exclusive: z2.boolean(),
1029
- required: z2.boolean(),
1030
- order: z2.number(),
1031
- icon: z2.string().exactOptional()
1032
- });
1033
- var skillRefInRules = skillSlugSchema;
1034
- var skillGroupRuleSchema = z2.object({
1035
- skills: z2.array(skillRefInRules).min(2),
1036
- reason: z2.string()
1037
- });
1038
- var conflictRuleSchema = skillGroupRuleSchema;
1039
- var discourageRuleSchema = skillGroupRuleSchema;
1040
- var requireRuleSchema = z2.object({
1041
- skill: skillRefInRules,
1042
- needs: z2.array(skillRefInRules).min(1),
1043
- needsAny: z2.boolean().exactOptional(),
1044
- reason: z2.string()
1045
- });
1046
- var alternativeGroupSchema = z2.object({
1047
- purpose: z2.string(),
1048
- skills: z2.array(skillRefInRules).min(1)
1049
- });
1050
- var relationshipDefinitionsSchema = z2.object({
1051
- conflicts: z2.array(conflictRuleSchema),
1052
- discourages: z2.array(discourageRuleSchema),
1053
- requires: z2.array(requireRuleSchema),
1054
- alternatives: z2.array(alternativeGroupSchema)
1055
- });
1056
- var skillCategoriesFileSchema = z2.object({
1057
- version: z2.string(),
1058
- categories: z2.record(z2.string(), categoryDefinitionSchema)
1059
- });
1060
- var skillRulesFileSchema = z2.object({
1061
- version: z2.string(),
1062
- relationships: relationshipDefinitionsSchema.exactOptional()
1063
- });
1064
- var localRawMetadataSchema = z2.object({
1065
- /** Short name shown in the wizard grid (e.g., "my-custom-react") */
1066
- displayName: z2.string(),
1067
- /** Kebab-case short key for alias resolution (e.g., "react") */
1068
- slug: z2.string(),
1069
- /** One-line description for the wizard */
1070
- cliDescription: z2.string().exactOptional(),
1071
- /** Category to place this skill in (e.g., "web-framework") */
1072
- category: categoryPathSchema,
1073
- /** When an AI agent should invoke this skill */
1074
- usageGuidance: z2.string().exactOptional(),
1075
- /** Domain this skill belongs to (e.g., "web", "api", "cli") */
1076
- domain: z2.string(),
1077
- /** True if this skill was created outside the CLI's built-in vocabulary */
1078
- custom: z2.boolean().exactOptional()
1079
- }).passthrough();
1080
- var localSkillMetadataSchema = z2.object({
1081
- forkedFrom: z2.object({
1082
- /** Original skill ID before forking — lenient (any string) since custom/extra-source skills have non-builtin IDs */
1083
- skillId: z2.string(),
1084
- /** SHA hash of the original content at fork time (for diff detection) */
1085
- contentHash: z2.string(),
1086
- /** ISO date when the fork was created */
1087
- date: z2.string(),
1088
- /** Source URL the skill was installed from (e.g., "github:agents-inc/skills") */
1089
- source: z2.string().exactOptional(),
1090
- /** Directory inside that repository, for a skill only its own bytes can install again */
1091
- path: z2.string().exactOptional()
1092
- }).exactOptional()
1093
- }).passthrough();
1094
- var stackSchema = z2.object({
1095
- id: z2.string().min(1),
1096
- name: z2.string().min(1),
1097
- description: z2.string(),
1098
- /** Maps agent IDs to their category-to-skill assignments */
1099
- agents: z2.record(z2.string(), stackAgentConfigSchema),
1100
- /** High-level philosophy guiding this stack's technology choices */
1101
- philosophy: z2.string().exactOptional()
1102
- });
1103
- var stacksConfigSchema = z2.object({
1104
- stacks: z2.array(stackSchema).min(1)
1105
- });
1106
- var marketplaceRemoteSourceSchema = z2.object({
1107
- source: z2.enum(["github", "url"]),
1108
- repo: z2.string().exactOptional(),
1109
- url: z2.string().exactOptional(),
1110
- ref: z2.string().exactOptional()
1111
- });
1112
- var marketplacePluginSchema = z2.object({
1113
- name: z2.string().min(1),
1114
- /** Local directory path (relative to pluginRoot) or remote source config */
1115
- source: z2.union([z2.string(), marketplaceRemoteSourceSchema]),
1116
- description: z2.string().exactOptional(),
1117
- version: z2.string().exactOptional(),
1118
- author: pluginAuthorSchema.exactOptional(),
1119
- /** Lenient: external data may have any category string or none at all */
1120
- category: z2.string().exactOptional(),
1121
- keywords: z2.array(z2.string()).exactOptional()
1122
- });
1123
- var marketplaceOwnerSchema = pluginAuthorSchema;
1124
- var marketplaceMetadataSchema = z2.object({
1125
- /** Base directory for resolving plugin source paths (e.g., "plugins/") */
1126
- pluginRoot: z2.string().exactOptional()
1127
- });
1128
- var marketplaceSchema = z2.object({
1129
- $schema: z2.string().exactOptional(),
1130
- name: z2.string().min(1),
1131
- version: z2.string().min(1),
1132
- description: z2.string().exactOptional(),
1133
- owner: marketplaceOwnerSchema,
1134
- metadata: marketplaceMetadataSchema.exactOptional(),
1135
- plugins: z2.array(marketplacePluginSchema).min(1)
1136
- });
1137
- var sourceRevalidationSchema = z2.object({
1138
- /** The tarball URL giget resolved for this source. */
1139
- tar: z2.string().min(1),
1140
- etag: z2.string().min(1).exactOptional()
1141
- });
1142
- var permissionConfigSchema = z2.object({
1143
- /** Tool names or patterns to explicitly allow */
1144
- allow: z2.array(z2.string()).exactOptional(),
1145
- /** Tool names or patterns to explicitly deny */
1146
- deny: z2.array(z2.string()).exactOptional()
1147
- });
1148
- var settingsFileSchema = z2.object({
1149
- permissions: permissionConfigSchema.exactOptional()
1150
- }).passthrough();
1151
- var brandingConfigSchema = z2.object({
1152
- /** Custom CLI name (e.g., "Acme Dev Tools") */
1153
- name: z2.string().exactOptional(),
1154
- /** Custom tagline shown in wizard header */
1155
- tagline: z2.string().exactOptional()
1156
- });
1157
- var projectSourceConfigFields = z2.object({
1158
- /** The marketplace this install reads skills from, as a path or URL */
1159
- marketplace: z2.string().exactOptional(),
1160
- /** Author handle for this project's config */
1161
- author: z2.string().exactOptional(),
1162
- /** The name that marketplace's manifest gives it, which plugins are registered under */
1163
- marketplaceName: z2.string().exactOptional(),
1164
- /** Separate source for agent definitions (when different from skills) */
1165
- agentsSource: z2.string().exactOptional(),
1166
- /** Branding overrides for white-labeling the CLI */
1167
- branding: brandingConfigSchema.exactOptional(),
1168
- /** Custom skills directory override (default: "src/skills") */
1169
- skillsDir: z2.string().exactOptional(),
1170
- /** Custom agents directory override (default: "src/agents") */
1171
- agentsDir: z2.string().exactOptional(),
1172
- /** Custom stacks file path override (default: "config/stacks.ts") */
1173
- stacksFile: z2.string().exactOptional(),
1174
- /** Custom categories file path override (default: "config/skill-categories.ts") */
1175
- categoriesFile: z2.string().exactOptional(),
1176
- /** Custom rules file path override (default: "config/skill-rules.ts") */
1177
- rulesFile: z2.string().exactOptional()
1178
- }).passthrough();
1179
- var projectSourceConfigSchema = renamedFieldGuard.pipe(projectSourceConfigFields);
1180
- var agentYamlGenerationSchema = z2.object({
1181
- $schema: z2.string().exactOptional(),
1182
- id: z2.string().min(1),
1183
- title: z2.string().min(1),
1184
- description: z2.string().min(1),
1185
- model: modelNameSchema.exactOptional(),
1186
- effort: effortLevelSchema.exactOptional(),
1187
- tools: z2.array(z2.string()).min(1),
1188
- disallowedTools: z2.array(z2.string()).exactOptional(),
1189
- permissionMode: permissionModeSchema.exactOptional(),
1190
- hooks: strictHooksRecordSchema.exactOptional(),
1191
- outputFormat: z2.string().exactOptional(),
1192
- domain: z2.string().exactOptional(),
1193
- custom: z2.boolean().exactOptional()
1194
- }).strict();
1195
- var agentFrontmatterValidationSchema = z2.object({
1196
- /** Agent name in kebab-case (becomes the Task tool identifier) */
1197
- name: z2.string().regex(KEBAB_CASE_PATTERN).min(1),
1198
- description: z2.string().min(1),
1199
- /** Comma-separated list of allowed tools */
1200
- tools: z2.string().exactOptional(),
1201
- /** Comma-separated list of denied tools */
1202
- disallowedTools: z2.string().exactOptional(),
1203
- model: modelNameSchema.exactOptional(),
1204
- effort: effortLevelSchema.exactOptional(),
1205
- permissionMode: permissionModeSchema.exactOptional(),
1206
- /** Skill names to preload (embed in agent prompt) */
1207
- skills: z2.array(z2.string().min(1)).exactOptional(),
1208
- hooks: strictHooksRecordSchema.exactOptional()
1209
- }).strict();
1210
- var skillFrontmatterValidationSchema = z2.object({
1211
- name: z2.string().min(1),
1212
- description: z2.string().min(1),
1213
- /** If true, Claude cannot invoke this skill on its own */
1214
- "disable-model-invocation": z2.boolean().exactOptional(),
1215
- /** If true, user can invoke this skill directly */
1216
- "user-invocable": z2.boolean().exactOptional(),
1217
- /** Comma-separated list of tools this skill can use */
1218
- "allowed-tools": z2.string().exactOptional(),
1219
- model: modelNameSchema.exactOptional(),
1220
- /** "fork" means skill runs in a forked context (separate conversation) */
1221
- context: z2.enum(["fork"]).exactOptional(),
1222
- /** Agent name this skill is scoped to */
1223
- agent: z2.string().exactOptional(),
1224
- /** Hint text shown when user invokes the skill */
1225
- "argument-hint": z2.string().exactOptional()
1226
- }).strict();
1227
- var forkedFromSchema = z2.object({
1228
- /** Original skill ID */
1229
- skillId: z2.string(),
1230
- /** Version of the original at fork time */
1231
- version: z2.number().int().min(1).exactOptional(),
1232
- /** Content hash of the original at fork time */
1233
- contentHash: z2.string(),
1234
- /** Source URL or identifier */
1235
- source: z2.string().exactOptional(),
1236
- /** Directory inside that source, for a skill only its own bytes can install again */
1237
- path: z2.string().exactOptional(),
1238
- /** ISO date of the fork */
1239
- date: z2.string()
1240
- });
1241
- var CLI_DESCRIPTION_MAX_LENGTH = 60;
1242
- var skillMetadataBaseSchema = z2.object({
1243
- /** Author handle — must start with @ (e.g., "@vince") */
1244
- author: z2.string().regex(AUTHOR_HANDLE_PATTERN),
1245
- /** Short display name for the wizard grid (max 30 chars) */
1246
- displayName: z2.string().min(1).max(30),
1247
- /** One-line description for the wizard (max 60 chars recommended; over-length is a validation warning) */
1248
- cliDescription: z2.string().min(1).max(CLI_DESCRIPTION_MAX_LENGTH),
1249
- /** When an AI agent should invoke this skill (min 10 chars to ensure usefulness) */
1250
- usageGuidance: z2.string().min(10),
1251
- /** 7-char hex SHA of skill content (for change detection) */
1252
- contentHash: z2.string().regex(/^[a-f0-9]{7}$/).exactOptional(),
1253
- /** ISO date of last update */
1254
- updated: z2.string().exactOptional(),
1255
- /** Provenance tracking when skill was forked from another */
1256
- forkedFrom: forkedFromSchema.exactOptional(),
1257
- /** Domain assignment from metadata */
1258
- domain: z2.string().exactOptional(),
1259
- /** True if this skill was created outside the CLI's built-in vocabulary */
1260
- custom: z2.boolean().exactOptional()
1261
- });
1262
- var metadataValidationSchema = skillMetadataBaseSchema.extend({
1263
- /** Domain-prefixed category — must be a known built-in category */
1264
- category: z2.enum(CATEGORIES),
1265
- /** Kebab-case short key — must be a known built-in slug */
1266
- slug: z2.enum(SKILL_SLUGS)
1267
- }).strict();
1268
- var customMetadataValidationSchema = skillMetadataBaseSchema.extend({
1269
- /** Any string category — custom skills may define their own categories */
1270
- category: z2.string(),
1271
- /** Kebab-case short key for alias resolution, search, and relationship rules */
1272
- slug: z2.string().regex(/^[a-z][a-z0-9-]*$/).min(1).max(50)
1273
- });
1274
- var stackSkillAssignmentSchema = z2.object({
1275
- id: z2.string().min(1),
1276
- /** If true, skill content is embedded in the compiled agent prompt */
1277
- preloaded: z2.boolean().exactOptional()
1278
- }).strict();
1279
- var stackConfigValidationSchema = z2.object({
1280
- /** Unique stack identifier in kebab-case */
1281
- id: z2.string().regex(KEBAB_CASE_PATTERN).exactOptional(),
1282
- name: z2.string().min(1),
1283
- version: z2.string(),
1284
- author: z2.string().min(1),
1285
- description: z2.string().exactOptional(),
1286
- /** ISO date when this stack was first created */
1287
- created: z2.string().exactOptional(),
1288
- /** ISO date of last update */
1289
- updated: z2.string().exactOptional(),
1290
- /** Primary framework this stack is designed for (e.g., "nextjs", "remix") */
1291
- framework: z2.string().exactOptional(),
1292
- /** All skills used in this stack (flat list, at least one required) */
1293
- skills: z2.array(stackSkillAssignmentSchema).min(1),
1294
- /** Agent IDs this stack compiles (at least one required) */
1295
- agents: z2.array(z2.string().regex(KEBAB_CASE_PATTERN)).min(1),
1296
- /** Per-agent skill assignments: { agentId: { category: [skillAssignment] } } */
1297
- agentSkills: z2.record(z2.string(), z2.record(z2.string(), z2.array(stackSkillAssignmentSchema))).exactOptional(),
1298
- /** High-level philosophy guiding technology choices */
1299
- philosophy: z2.string().exactOptional(),
1300
- /** Guiding principles for agents using this stack */
1301
- principles: z2.array(z2.string().min(1)).exactOptional(),
1302
- tags: z2.array(z2.string().regex(KEBAB_CASE_PATTERN)).exactOptional(),
1303
- /** Per-skill overrides: alternative suggestions and lock status */
1304
- overrides: z2.record(
1305
- z2.string(),
1306
- z2.object({
1307
- /** Suggested alternative skill IDs if this one is swapped */
1308
- alternatives: z2.array(z2.string().min(1)).exactOptional(),
1309
- /** If true, this skill cannot be swapped by the user */
1310
- locked: z2.boolean().exactOptional()
1311
- }).strict()
1312
- ).exactOptional(),
1313
- /** Community metrics for sorting/ranking */
1314
- metrics: z2.object({
1315
- upvotes: z2.number().int().min(0).exactOptional(),
1316
- downloads: z2.number().int().min(0).exactOptional()
1317
- }).strict().exactOptional(),
1318
- /** Lifecycle hooks triggered by file changes or commands */
1319
- hooks: strictHooksRecordSchema.exactOptional()
1320
- }).strict();
1321
- function formatZodIssues(issues) {
1322
- return issues.map(formatZodIssue).join("; ");
1323
- }
1324
- function validateSkillMetadata(rawMetadata) {
1325
- const schema = isCustomMetadata(rawMetadata) ? customMetadataValidationSchema : metadataValidationSchema;
1326
- return schema.safeParse(rawMetadata);
1327
- }
1328
- function describeMetadataSchemaFailure(issues, rawMetadata) {
1329
- const [absent, malformed] = partition(issues, (issue) => isAbsentField(issue, rawMetadata));
1330
- return [
1331
- ...absent.length > 0 ? [nameMissingFields(absent)] : [],
1332
- ...malformed.map(formatZodIssue)
1333
- ].join("; ");
1334
- }
1335
- function isAbsentField(issue, rawMetadata) {
1336
- const [field, ...nested] = issue.path;
1337
- return nested.length === 0 && typeof field === "string" && rawMetadata[field] === void 0;
1338
- }
1339
- function nameMissingFields(absent) {
1340
- const fields = absent.map((issue) => issue.path.join("."));
1341
- return `missing required ${fields.length === 1 ? "field" : "fields"}: ${fields.join(", ")}`;
1342
- }
1343
- function isOverLengthCliDescription(issue) {
1344
- return issue.code === "too_big" && issue.path.length === 1 && issue.path[0] === "cliDescription";
1345
- }
1346
- function readCliDescription(raw) {
1347
- if (raw == null || typeof raw !== "object") return void 0;
1348
- const value = raw.cliDescription;
1349
- return typeof value === "string" ? value : void 0;
1350
- }
1351
- function formatOverLengthWarning(issue, cliDescription) {
1352
- if (cliDescription === void 0) return formatZodIssue(issue);
1353
- return `cliDescription is ${cliDescription.length} characters \u2014 exceeds the recommended maximum of ${CLI_DESCRIPTION_MAX_LENGTH}`;
1354
- }
1355
- function splitMetadataValidationIssues(error, rawMetadata) {
1356
- const [overLength, hardFailures] = partition(error.issues, isOverLengthCliDescription);
1357
- const cliDescription = readCliDescription(rawMetadata);
1358
- const warnings = overLength.map((issue) => formatOverLengthWarning(issue, cliDescription));
1359
- return { errors: hardFailures.map(formatZodIssue), warnings };
1360
- }
1361
- function validateNestingDepth(value, maxDepth) {
1362
- function check(val, depth) {
1363
- if (depth > maxDepth) return false;
1364
- if (Array.isArray(val)) {
1365
- return val.every((item) => check(item, depth + 1));
1366
- }
1367
- if (val !== null && typeof val === "object") {
1368
- return Object.values(val).every((v) => check(v, depth + 1));
1369
- }
1370
- return true;
1371
- }
1372
- return check(value, 0);
1373
- }
1374
- function isCustomMetadata(raw) {
1375
- if (raw == null || typeof raw !== "object") return false;
1376
- if (!("custom" in raw)) return false;
1377
- return raw.custom === true;
1378
- }
1379
- function warnUnknownFields(parsed, expectedKeys, context) {
1380
- const expectedSet = new Set(expectedKeys);
1381
- const unknownKeys = Object.keys(parsed).filter((k) => !expectedSet.has(k));
1382
- if (unknownKeys.length > 0) {
1383
- warn(`Unknown fields in ${context}: ${unknownKeys.join(", ")}`);
1384
- }
1385
- }
1386
-
1387
- // src/cli/lib/loading/loader.ts
1388
- async function readSkillMetadata(metadataPath) {
1389
- let parsed;
1390
- try {
1391
- parsed = parseYaml2(await readFile(metadataPath));
1392
- } catch (error) {
1393
- return { usable: false, reason: getErrorMessage(error) };
1394
- }
1395
- if (!isFieldMapping(parsed)) {
1396
- return { usable: false, reason: `expected metadata fields, found ${nameYamlValue(parsed)}` };
1397
- }
1398
- const validated = localRawMetadataSchema.safeParse(parsed);
1399
- if (!validated.success) {
1400
- return { usable: false, reason: describeMetadataSchemaFailure(validated.error.issues, parsed) };
1401
- }
1402
- return { usable: true, metadata: validated.data };
1403
- }
1404
- function isFieldMapping(value) {
1405
- return typeof value === "object" && value !== null && !Array.isArray(value);
1406
- }
1407
- function nameYamlValue(value) {
1408
- if (value === null || value === void 0) return "an empty file";
1409
- if (Array.isArray(value)) return "a list";
1410
- return `a ${typeof value}`;
1411
- }
1412
- function parseFrontmatter(content, filePath) {
1413
- const rawFrontmatter = extractFrontmatter(content);
1414
- if (rawFrontmatter === null) return null;
1415
- const parsed = skillFrontmatterLoaderSchema.safeParse(rawFrontmatter);
1416
- if (!parsed.success) {
1417
- const location = filePath ?? "unknown file";
1418
- warn(`Invalid SKILL.md frontmatter in '${location}': ${formatZodIssues(parsed.error.issues)}`);
1419
- return null;
1420
- }
1421
- return parsed.data;
1422
- }
1423
- async function loadAgentsFromDir(agentsDir, sourceRoot, options) {
1424
- const agents = {};
1425
- const files = await glob(`**/${STANDARD_FILES.AGENT_METADATA_YAML}`, agentsDir);
1426
- for (const file of files) {
1427
- const fullPath = path2.join(agentsDir, file);
1428
- try {
1429
- const content = await readFile(fullPath);
1430
- const config = agentYamlConfigSchema.parse(parseYaml2(content));
1431
- agents[config.id] = {
1432
- title: config.title,
1433
- description: config.description,
1434
- ...config.model !== void 0 && { model: config.model },
1435
- tools: config.tools,
1436
- path: path2.dirname(file),
1437
- sourceRoot,
1438
- ...options.agentBaseDir ? { agentBaseDir: options.agentBaseDir } : {},
1439
- ...config.domain ? { domain: config.domain } : {},
1440
- ...options.includeCustomFlag && config.custom === true ? { custom: true } : {}
1441
- };
1442
- verbose(`Loaded ${options.verboseLabel}: ${config.id} from ${file}`);
1443
- } catch (error) {
1444
- warn(`Skipping invalid metadata.yaml at '${fullPath}': ${getErrorMessage(error)}`);
1445
- }
1446
- }
1447
- return agents;
1448
- }
1449
- async function loadAllAgents(projectRoot) {
1450
- return loadAgentsFromDir(path2.join(projectRoot, DIRS.agents), projectRoot, {
1451
- includeCustomFlag: true,
1452
- verboseLabel: "agent"
1453
- });
1454
- }
1455
- async function loadMergedAgents(sourcePath) {
1456
- const [cliAgents, sourceAgents] = await Promise.all([
1457
- loadAllAgents(PROJECT_ROOT),
1458
- loadAllAgents(sourcePath)
1459
- ]);
1460
- return { ...cliAgents, ...sourceAgents };
1461
- }
1462
- async function loadProjectAgents(projectRoot) {
1463
- const projectAgentsDir = path2.join(projectRoot, CLAUDE_SRC_DIR, STANDARD_DIRS.AGENTS);
1464
- if (!await directoryExists(projectAgentsDir)) {
1465
- verbose(`No project agents directory at ${projectAgentsDir}`);
1466
- const noAgents = {};
1467
- return noAgents;
1468
- }
1469
- return loadAgentsFromDir(projectAgentsDir, projectRoot, {
1470
- // Project agents are in .claude-src/agents/
1471
- agentBaseDir: `${CLAUDE_SRC_DIR}/agents`,
1472
- verboseLabel: "project agent"
1473
- });
1474
- }
1475
- async function buildIdToDirectoryPathMap(skillsDir) {
1476
- const files = await glob(`**/${STANDARD_FILES.SKILL_MD}`, skillsDir);
1477
- const parsed = await Promise.all(
1478
- files.map(async (file) => {
1479
- const fullPath = path2.join(skillsDir, file);
1480
- return { file, frontmatter: parseFrontmatter(await readFile(fullPath), fullPath) };
1481
- })
1482
- );
1483
- return Object.fromEntries(
1484
- parsed.filter(
1485
- (entry) => Boolean(entry.frontmatter?.name)
1486
- ).flatMap(({ file, frontmatter }) => {
1487
- const directoryPath = file.replace(`/${STANDARD_FILES.SKILL_MD}`, "");
1488
- return [
1489
- [frontmatter.name, directoryPath],
1490
- [directoryPath, directoryPath]
1491
- ];
1492
- })
1493
- );
1494
- }
1495
- async function loadSkillsByIds(skillIds, projectRoot) {
1496
- const skills = {};
1497
- const skillsDir = path2.join(projectRoot, DIRS.skills);
1498
- const idToDirectoryPath = await buildIdToDirectoryPathMap(skillsDir);
1499
- const expandDirectoryRef = (skillId) => {
1500
- const childSkills = typedKeys(idToDirectoryPath).filter(
1501
- (id) => idToDirectoryPath[id]?.startsWith(`${skillId}/`)
1502
- );
1503
- if (childSkills.length === 0) {
1504
- warn(`Unknown skill reference '${skillId}'`);
1505
- return [];
1506
- }
1507
- verbose(`Expanded directory '${skillId}' to ${childSkills.length} skills`);
1508
- return childSkills;
1509
- };
1510
- const uniqueSkillIds = unique(
1511
- skillIds.flatMap(({ id }) => idToDirectoryPath[id] ? [id] : expandDirectoryRef(id))
1512
- );
1513
- for (const skillId of uniqueSkillIds) {
1514
- const directoryPath = idToDirectoryPath[skillId];
1515
- if (!directoryPath) {
1516
- warn(`Could not find skill '${skillId}': no matching skill found`);
1517
- continue;
1518
- }
1519
- const skillPath = path2.join(skillsDir, directoryPath);
1520
- const skillMdPath = path2.join(skillPath, STANDARD_FILES.SKILL_MD);
1521
- try {
1522
- const content = await readFile(skillMdPath);
1523
- const frontmatter = parseFrontmatter(content, skillMdPath);
1524
- if (!frontmatter) {
1525
- warn(`Skipping '${skillId}': missing or invalid frontmatter`);
1526
- continue;
1527
- }
1528
- const canonicalId = frontmatter.name;
1529
- const skillDef = {
1530
- id: canonicalId,
1531
- path: `${DIRS.skills}/${directoryPath}/`,
1532
- description: frontmatter.description
1533
- };
1534
- skills[canonicalId] = skillDef;
1535
- verbose(`Loaded skill: ${canonicalId} (from ${directoryPath})`);
1536
- } catch (error) {
1537
- warn(`Could not load skill '${skillId}': ${getErrorMessage(error)}`);
1538
- }
1539
- }
1540
- return skills;
1541
- }
1542
- async function loadSkillsFromDir(skillsDir, options = {}) {
1543
- const { pathPrefix = "", requireMetadata = false } = options;
1544
- const skills = {};
1545
- const unusableMetadata = [];
1546
- if (!await directoryExists(skillsDir)) {
1547
- return { skills, unusableMetadata };
1548
- }
1549
- const skillFiles = await glob(`**/${STANDARD_FILES.SKILL_MD}`, skillsDir);
1550
- for (const skillFile of skillFiles) {
1551
- const skillPath = path2.join(skillsDir, skillFile);
1552
- const skillDir = path2.dirname(skillPath);
1553
- const relativePath = path2.relative(skillsDir, skillDir);
1554
- const skillDirName = path2.basename(skillDir);
1555
- const displayPath = pathPrefix ? `${pathPrefix}/${relativePath}/` : `${relativePath}/`;
1556
- if (requireMetadata) {
1557
- const metadataPath = path2.join(skillDir, STANDARD_FILES.METADATA_YAML);
1558
- if (!await fileExists(metadataPath)) {
1559
- warn(
1560
- `Skill '${skillDirName}' in '${displayPath}' is missing ${STANDARD_FILES.METADATA_YAML} \u2014 skipped. Add ${STANDARD_FILES.METADATA_YAML} to register it with the CLI.`
1561
- );
1562
- continue;
1563
- }
1564
- const metadata = await readSkillMetadata(metadataPath);
1565
- if (!metadata.usable) {
1566
- unusableMetadata.push({ skillDirName, metadataPath, reason: metadata.reason });
1567
- verbose(` Unusable ${STANDARD_FILES.METADATA_YAML} in '${skillDirName}'`);
1568
- continue;
1569
- }
1570
- }
1571
- try {
1572
- const content = await readFile(skillPath);
1573
- const frontmatter = parseFrontmatter(content, skillPath);
1574
- if (!frontmatter?.name) {
1575
- warn(`Skipping skill in '${skillDirName}': missing or invalid frontmatter name`);
1576
- continue;
1577
- }
1578
- const canonicalId = frontmatter.name;
1579
- skills[canonicalId] = {
1580
- id: canonicalId,
1581
- path: displayPath,
1582
- description: frontmatter.description || ""
1583
- };
1584
- verbose(` Loaded skill: ${canonicalId}`);
1585
- } catch (error) {
1586
- verbose(` Failed to load skill: ${skillFile} - ${getErrorMessage(error)}`);
1587
- }
1588
- }
1589
- return { skills, unusableMetadata };
1590
- }
1591
- async function loadPluginSkills(pluginDir) {
1592
- const { skills } = await loadSkillsFromDir(path2.join(pluginDir, "skills"), {
1593
- pathPrefix: "skills",
1594
- requireMetadata: false
1595
- });
1596
- return skills;
1597
- }
1598
-
1599
- export {
1600
- getErrorMessage,
1601
- GlobalPairWriteViolation,
1602
- withGateToken,
1603
- assertGateToken,
1604
- isPathWithin,
1605
- readFile,
1606
- readFileSafe,
1607
- readFileOptional,
1608
- fileExists,
1609
- directoryExists,
1610
- listDirectories,
1611
- glob,
1612
- writeFile,
1613
- ensureDir,
1614
- remove,
1615
- isDirectoryEmpty,
1616
- removeDirIfEmpty,
1617
- copy,
1618
- setVerbose,
1619
- verbose,
1620
- log,
1621
- enableBuffering,
1622
- drainBuffer,
1623
- disableBuffering,
1624
- warn,
1625
- formatZodErrors,
1626
- AGENT_NAMES,
1627
- isRecord,
1628
- isDomain,
1629
- isAgentName,
1630
- isSkillId,
1631
- isSkillAssignment,
1632
- MODEL_NAMES,
1633
- EFFORT_NAMES,
1634
- skillMetadataLoaderSchema,
1635
- matrixRawMetadataSchema,
1636
- pluginManifestSchema,
1637
- pluginManifestValidationSchema,
1638
- projectConfigLoaderSchema,
1639
- skillCategoriesFileSchema,
1640
- skillRulesFileSchema,
1641
- localSkillMetadataSchema,
1642
- stacksConfigSchema,
1643
- marketplaceSchema,
1644
- sourceRevalidationSchema,
1645
- settingsFileSchema,
1646
- projectSourceConfigSchema,
1647
- agentYamlGenerationSchema,
1648
- agentFrontmatterValidationSchema,
1649
- skillFrontmatterValidationSchema,
1650
- metadataValidationSchema,
1651
- stackConfigValidationSchema,
1652
- formatZodIssues,
1653
- validateSkillMetadata,
1654
- splitMetadataValidationIssues,
1655
- validateNestingDepth,
1656
- warnUnknownFields,
1657
- extractFrontmatter,
1658
- readSkillMetadata,
1659
- parseFrontmatter,
1660
- loadAllAgents,
1661
- loadMergedAgents,
1662
- loadProjectAgents,
1663
- loadSkillsByIds,
1664
- loadSkillsFromDir,
1665
- loadPluginSkills
1666
- };
1667
- //# sourceMappingURL=chunk-XAXJWXI4.js.map