@ai-plugin-marketplace/core 0.1.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 (136) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +67 -0
  3. package/dist/config.d.ts +47 -0
  4. package/dist/config.d.ts.map +1 -0
  5. package/dist/config.js +38 -0
  6. package/dist/config.js.map +1 -0
  7. package/dist/core.d.ts +291 -0
  8. package/dist/index.d.ts +15 -0
  9. package/dist/index.d.ts.map +1 -0
  10. package/dist/index.js +13 -0
  11. package/dist/index.js.map +1 -0
  12. package/dist/pipeline/build.d.ts +90 -0
  13. package/dist/pipeline/build.d.ts.map +1 -0
  14. package/dist/pipeline/build.js +224 -0
  15. package/dist/pipeline/build.js.map +1 -0
  16. package/dist/pipeline/discover.d.ts +37 -0
  17. package/dist/pipeline/discover.d.ts.map +1 -0
  18. package/dist/pipeline/discover.js +71 -0
  19. package/dist/pipeline/discover.js.map +1 -0
  20. package/dist/pipeline/init-template.d.ts +33 -0
  21. package/dist/pipeline/init-template.d.ts.map +1 -0
  22. package/dist/pipeline/init-template.js +142 -0
  23. package/dist/pipeline/init-template.js.map +1 -0
  24. package/dist/pipeline/init.d.ts +39 -0
  25. package/dist/pipeline/init.d.ts.map +1 -0
  26. package/dist/pipeline/init.js +84 -0
  27. package/dist/pipeline/init.js.map +1 -0
  28. package/dist/pipeline/load-config.d.ts +47 -0
  29. package/dist/pipeline/load-config.d.ts.map +1 -0
  30. package/dist/pipeline/load-config.js +106 -0
  31. package/dist/pipeline/load-config.js.map +1 -0
  32. package/dist/pipeline/operations.d.ts +70 -0
  33. package/dist/pipeline/operations.d.ts.map +1 -0
  34. package/dist/pipeline/operations.js +100 -0
  35. package/dist/pipeline/operations.js.map +1 -0
  36. package/dist/pipeline/scaffold.d.ts +105 -0
  37. package/dist/pipeline/scaffold.d.ts.map +1 -0
  38. package/dist/pipeline/scaffold.js +422 -0
  39. package/dist/pipeline/scaffold.js.map +1 -0
  40. package/dist/pipeline/sentinel.d.ts +127 -0
  41. package/dist/pipeline/sentinel.d.ts.map +1 -0
  42. package/dist/pipeline/sentinel.js +263 -0
  43. package/dist/pipeline/sentinel.js.map +1 -0
  44. package/dist/pipeline/types.d.ts +178 -0
  45. package/dist/pipeline/types.d.ts.map +1 -0
  46. package/dist/pipeline/types.js +26 -0
  47. package/dist/pipeline/types.js.map +1 -0
  48. package/dist/pipeline/validate.d.ts +90 -0
  49. package/dist/pipeline/validate.d.ts.map +1 -0
  50. package/dist/pipeline/validate.js +617 -0
  51. package/dist/pipeline/validate.js.map +1 -0
  52. package/dist/targets/claude/scaffold.d.ts +32 -0
  53. package/dist/targets/claude/scaffold.d.ts.map +1 -0
  54. package/dist/targets/claude/scaffold.js +48 -0
  55. package/dist/targets/claude/scaffold.js.map +1 -0
  56. package/dist/targets/claude/schemas.d.ts +119 -0
  57. package/dist/targets/claude/schemas.d.ts.map +1 -0
  58. package/dist/targets/claude/schemas.js +204 -0
  59. package/dist/targets/claude/schemas.js.map +1 -0
  60. package/dist/targets/claude/transform.d.ts +40 -0
  61. package/dist/targets/claude/transform.d.ts.map +1 -0
  62. package/dist/targets/claude/transform.js +48 -0
  63. package/dist/targets/claude/transform.js.map +1 -0
  64. package/dist/targets/claude/validate.d.ts +25 -0
  65. package/dist/targets/claude/validate.d.ts.map +1 -0
  66. package/dist/targets/claude/validate.js +263 -0
  67. package/dist/targets/claude/validate.js.map +1 -0
  68. package/dist/targets/cursor/scaffold.d.ts +29 -0
  69. package/dist/targets/cursor/scaffold.d.ts.map +1 -0
  70. package/dist/targets/cursor/scaffold.js +45 -0
  71. package/dist/targets/cursor/scaffold.js.map +1 -0
  72. package/dist/targets/cursor/schemas.d.ts +49 -0
  73. package/dist/targets/cursor/schemas.d.ts.map +1 -0
  74. package/dist/targets/cursor/schemas.js +125 -0
  75. package/dist/targets/cursor/schemas.js.map +1 -0
  76. package/dist/targets/cursor/validate.d.ts +28 -0
  77. package/dist/targets/cursor/validate.d.ts.map +1 -0
  78. package/dist/targets/cursor/validate.js +181 -0
  79. package/dist/targets/cursor/validate.js.map +1 -0
  80. package/dist/targets/gemini/bundle.d.ts +25 -0
  81. package/dist/targets/gemini/bundle.d.ts.map +1 -0
  82. package/dist/targets/gemini/bundle.js +149 -0
  83. package/dist/targets/gemini/bundle.js.map +1 -0
  84. package/dist/targets/gemini/scaffold.d.ts +28 -0
  85. package/dist/targets/gemini/scaffold.d.ts.map +1 -0
  86. package/dist/targets/gemini/scaffold.js +57 -0
  87. package/dist/targets/gemini/scaffold.js.map +1 -0
  88. package/dist/targets/gemini/schemas.d.ts +53 -0
  89. package/dist/targets/gemini/schemas.d.ts.map +1 -0
  90. package/dist/targets/gemini/schemas.js +72 -0
  91. package/dist/targets/gemini/schemas.js.map +1 -0
  92. package/dist/targets/gemini/transform.d.ts +106 -0
  93. package/dist/targets/gemini/transform.d.ts.map +1 -0
  94. package/dist/targets/gemini/transform.js +137 -0
  95. package/dist/targets/gemini/transform.js.map +1 -0
  96. package/dist/targets/gemini/validate.d.ts +26 -0
  97. package/dist/targets/gemini/validate.d.ts.map +1 -0
  98. package/dist/targets/gemini/validate.js +146 -0
  99. package/dist/targets/gemini/validate.js.map +1 -0
  100. package/dist/targets/kiro/bundle.d.ts +32 -0
  101. package/dist/targets/kiro/bundle.d.ts.map +1 -0
  102. package/dist/targets/kiro/bundle.js +106 -0
  103. package/dist/targets/kiro/bundle.js.map +1 -0
  104. package/dist/targets/kiro/scaffold.d.ts +28 -0
  105. package/dist/targets/kiro/scaffold.d.ts.map +1 -0
  106. package/dist/targets/kiro/scaffold.js +55 -0
  107. package/dist/targets/kiro/scaffold.js.map +1 -0
  108. package/dist/targets/kiro/schemas.d.ts +100 -0
  109. package/dist/targets/kiro/schemas.d.ts.map +1 -0
  110. package/dist/targets/kiro/schemas.js +147 -0
  111. package/dist/targets/kiro/schemas.js.map +1 -0
  112. package/dist/targets/kiro/transform.d.ts +53 -0
  113. package/dist/targets/kiro/transform.d.ts.map +1 -0
  114. package/dist/targets/kiro/transform.js +113 -0
  115. package/dist/targets/kiro/transform.js.map +1 -0
  116. package/dist/targets/kiro/validate.d.ts +36 -0
  117. package/dist/targets/kiro/validate.d.ts.map +1 -0
  118. package/dist/targets/kiro/validate.js +232 -0
  119. package/dist/targets/kiro/validate.js.map +1 -0
  120. package/dist/targets/scaffold-kit.d.ts +56 -0
  121. package/dist/targets/scaffold-kit.d.ts.map +1 -0
  122. package/dist/targets/scaffold-kit.js +33 -0
  123. package/dist/targets/scaffold-kit.js.map +1 -0
  124. package/dist/targets/vercel/scaffold.d.ts +34 -0
  125. package/dist/targets/vercel/scaffold.d.ts.map +1 -0
  126. package/dist/targets/vercel/scaffold.js +58 -0
  127. package/dist/targets/vercel/scaffold.js.map +1 -0
  128. package/dist/targets/vercel/schemas.d.ts +42 -0
  129. package/dist/targets/vercel/schemas.d.ts.map +1 -0
  130. package/dist/targets/vercel/schemas.js +69 -0
  131. package/dist/targets/vercel/schemas.js.map +1 -0
  132. package/dist/targets/vercel/validate.d.ts +28 -0
  133. package/dist/targets/vercel/validate.d.ts.map +1 -0
  134. package/dist/targets/vercel/validate.js +180 -0
  135. package/dist/targets/vercel/validate.js.map +1 -0
  136. package/package.json +50 -0
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Scaffold templates for the Claude Code target.
3
+ *
4
+ * `scaffoldClaudeFiles` is a pure function: it returns the skeleton files this target
5
+ * contributes to a new plugin (relative paths + content) without touching the filesystem.
6
+ * The pipeline orchestrator (`pipeline/scaffold.ts`) performs the actual writes.
7
+ *
8
+ * Every manifest carries `schemaVersion: "0.1.0"` per §12.2. Content is intentionally minimal
9
+ * but valid against `claudePluginManifestSchema`. No generated-file sentinels are emitted — these
10
+ * are author-authored skeleton files, not toolkit-generated artifacts (§4.3).
11
+ *
12
+ * This module must not import from any sibling targets/<other>/ folder (§3.4).
13
+ *
14
+ * @see docs/specs/architecture.md §4 (plugin source layout)
15
+ * @see docs/specs/architecture.md §6.4 (compatibility-assist)
16
+ * @see docs/specs/architecture.md §12.2 (schemaVersion on every manifest)
17
+ * @see docs/specs/architecture.md §12.5 (per-target scaffold.ts)
18
+ */
19
+ import { type ScaffoldedFile, type TargetScaffoldOptions } from '../scaffold-kit.js';
20
+ /**
21
+ * Produce the Claude Code skeleton files for a plugin.
22
+ *
23
+ * The minimum required artifact (§6.2, mirrored by `TARGET_MIN_REQUIRED.claude`) is
24
+ * `.claude-plugin/plugin.json`. The manifest is kept minimal — no `hooks`/`mcpServers` paths are
25
+ * declared, so no companion files are required to keep it valid.
26
+ *
27
+ * @param pluginName - Plugin identity; written verbatim as the manifest `name`.
28
+ * @param opts - Optional description and add-target placeholder behaviour.
29
+ * @returns Files contributed by this target, with paths relative to the plugin directory.
30
+ */
31
+ export declare function scaffoldClaudeFiles(pluginName: string, opts?: TargetScaffoldOptions): ScaffoldedFile[];
32
+ //# sourceMappingURL=scaffold.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../../src/targets/claude/scaffold.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC3B,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,MAAM,EAClB,IAAI,GAAE,qBAA0B,GAC/B,cAAc,EAAE,CAiBlB"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Scaffold templates for the Claude Code target.
3
+ *
4
+ * `scaffoldClaudeFiles` is a pure function: it returns the skeleton files this target
5
+ * contributes to a new plugin (relative paths + content) without touching the filesystem.
6
+ * The pipeline orchestrator (`pipeline/scaffold.ts`) performs the actual writes.
7
+ *
8
+ * Every manifest carries `schemaVersion: "0.1.0"` per §12.2. Content is intentionally minimal
9
+ * but valid against `claudePluginManifestSchema`. No generated-file sentinels are emitted — these
10
+ * are author-authored skeleton files, not toolkit-generated artifacts (§4.3).
11
+ *
12
+ * This module must not import from any sibling targets/<other>/ folder (§3.4).
13
+ *
14
+ * @see docs/specs/architecture.md §4 (plugin source layout)
15
+ * @see docs/specs/architecture.md §6.4 (compatibility-assist)
16
+ * @see docs/specs/architecture.md §12.2 (schemaVersion on every manifest)
17
+ * @see docs/specs/architecture.md §12.5 (per-target scaffold.ts)
18
+ */
19
+ import { resolveDescription, SCHEMA_VERSION, } from '../scaffold-kit.js';
20
+ /**
21
+ * Produce the Claude Code skeleton files for a plugin.
22
+ *
23
+ * The minimum required artifact (§6.2, mirrored by `TARGET_MIN_REQUIRED.claude`) is
24
+ * `.claude-plugin/plugin.json`. The manifest is kept minimal — no `hooks`/`mcpServers` paths are
25
+ * declared, so no companion files are required to keep it valid.
26
+ *
27
+ * @param pluginName - Plugin identity; written verbatim as the manifest `name`.
28
+ * @param opts - Optional description and add-target placeholder behaviour.
29
+ * @returns Files contributed by this target, with paths relative to the plugin directory.
30
+ */
31
+ export function scaffoldClaudeFiles(pluginName, opts = {}) {
32
+ const description = resolveDescription(pluginName, opts);
33
+ const manifest = {
34
+ schemaVersion: SCHEMA_VERSION,
35
+ name: pluginName,
36
+ version: '0.0.1',
37
+ // `description` is optional and constrained to min length 1; omit it in placeholder mode
38
+ // (add-target) so the skeleton stays schema-valid while leaving the field for the author.
39
+ ...(description !== '' ? { description } : {}),
40
+ };
41
+ return [
42
+ {
43
+ path: '.claude-plugin/plugin.json',
44
+ content: `${JSON.stringify(manifest, null, 2)}\n`,
45
+ },
46
+ ];
47
+ }
48
+ //# sourceMappingURL=scaffold.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../../../src/targets/claude/scaffold.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EACL,kBAAkB,EAClB,cAAc,GAGf,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;;;;GAUG;AACH,MAAM,UAAU,mBAAmB,CACjC,UAAkB,EAClB,OAA8B,EAAE;IAEhC,MAAM,WAAW,GAAG,kBAAkB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IACzD,MAAM,QAAQ,GAA4B;QACxC,aAAa,EAAE,cAAc;QAC7B,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,OAAO;QAChB,yFAAyF;QACzF,0FAA0F;QAC1F,GAAG,CAAC,WAAW,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC/C,CAAC;IAEF,OAAO;QACL;YACE,IAAI,EAAE,4BAA4B;YAClC,OAAO,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI;SAClD;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,119 @@
1
+ /**
2
+ * Zod schemas for Claude Code target manifests.
3
+ *
4
+ * These schemas are internal to @ai-plugin-marketplace/core — they are not exported from the
5
+ * package root. Per §3.4 of the architecture spec, this module must not import from any sibling
6
+ * targets/<other>/ folder.
7
+ *
8
+ * Strictness policy: `.strict()` is used wherever the canonical JSON Schema sets
9
+ * `additionalProperties: false`. `.loose()` (passthrough) is reserved for agent frontmatter,
10
+ * which is free-form markdown context where authors may add platform-specific keys.
11
+ *
12
+ * schemaVersion: every top-level manifest schema accepts `schemaVersion` as an optional
13
+ * unvalidated string per §9.4 and §12.2. Validators do not check it in v0.1.0; it is reserved
14
+ * for future migrex adoption.
15
+ */
16
+ import { z } from 'zod';
17
+ /**
18
+ * Schema for `.claude-plugin/plugin.json`.
19
+ *
20
+ * Mirrors the canonical JSON Schema at
21
+ * `schemas/plugin.json` in the template repo. Strict (`additionalProperties: false`).
22
+ * `schemaVersion` is accepted but not validated (§9.4 / §12.2).
23
+ */
24
+ export declare const claudePluginManifestSchema: z.ZodObject<{
25
+ schemaVersion: z.ZodOptional<z.ZodString>;
26
+ name: z.ZodString;
27
+ version: z.ZodOptional<z.ZodString>;
28
+ description: z.ZodOptional<z.ZodString>;
29
+ author: z.ZodOptional<z.ZodObject<{
30
+ name: z.ZodString;
31
+ email: z.ZodOptional<z.ZodString>;
32
+ url: z.ZodOptional<z.ZodString>;
33
+ }, z.core.$strict>>;
34
+ homepage: z.ZodOptional<z.ZodString>;
35
+ repository: z.ZodOptional<z.ZodString>;
36
+ license: z.ZodOptional<z.ZodString>;
37
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
38
+ hooks: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
39
+ commands: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
40
+ agents: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
41
+ skills: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
42
+ outputStyles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
43
+ mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
44
+ lspServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
45
+ settings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
46
+ }, z.core.$strict>;
47
+ /**
48
+ * Schema for `.mcp.json` (Claude MCP configuration).
49
+ *
50
+ * `mcpServers` maps server name → server config. Strict at the top level.
51
+ * `schemaVersion` accepted but not validated per §9.4 / §12.2.
52
+ */
53
+ export declare const claudeMcpConfigSchema: z.ZodObject<{
54
+ schemaVersion: z.ZodOptional<z.ZodString>;
55
+ mcpServers: z.ZodRecord<z.ZodString, z.ZodObject<{
56
+ command: z.ZodString;
57
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
58
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
59
+ }, z.core.$strict>>;
60
+ }, z.core.$strict>;
61
+ /**
62
+ * A single hook entry: a command to run.
63
+ */
64
+ export declare const claudeHookEntrySchema: z.ZodObject<{
65
+ type: z.ZodLiteral<"command">;
66
+ command: z.ZodString;
67
+ }, z.core.$strict>;
68
+ /**
69
+ * A hook matcher: optional regex filter + description + list of hook entries to run.
70
+ */
71
+ export declare const claudeHookMatcherSchema: z.ZodObject<{
72
+ matcher: z.ZodOptional<z.ZodString>;
73
+ description: z.ZodOptional<z.ZodString>;
74
+ hooks: z.ZodArray<z.ZodObject<{
75
+ type: z.ZodLiteral<"command">;
76
+ command: z.ZodString;
77
+ }, z.core.$strict>>;
78
+ }, z.core.$strict>;
79
+ /**
80
+ * Schema for `hooks/claude.json`.
81
+ *
82
+ * Top level: `{ hooks: Record<ClaudeHookEvent, ClaudeHookMatcher[]> }`. Strict.
83
+ * `schemaVersion` accepted but not validated per §9.4 / §12.2.
84
+ */
85
+ export declare const claudeHooksFileSchema: z.ZodObject<{
86
+ schemaVersion: z.ZodOptional<z.ZodString>;
87
+ hooks: z.ZodRecord<z.ZodEnum<{
88
+ PreToolUse: "PreToolUse";
89
+ PostToolUse: "PostToolUse";
90
+ Stop: "Stop";
91
+ UserPromptSubmit: "UserPromptSubmit";
92
+ }> & z.core.$partial, z.ZodArray<z.ZodObject<{
93
+ matcher: z.ZodOptional<z.ZodString>;
94
+ description: z.ZodOptional<z.ZodString>;
95
+ hooks: z.ZodArray<z.ZodObject<{
96
+ type: z.ZodLiteral<"command">;
97
+ command: z.ZodString;
98
+ }, z.core.$strict>>;
99
+ }, z.core.$strict>>>;
100
+ }, z.core.$strict>;
101
+ export type ClaudeHooksFile = z.infer<typeof claudeHooksFileSchema>;
102
+ /**
103
+ * Schema for the YAML frontmatter of `agents/*.md` files.
104
+ *
105
+ * Permissive (`.loose()` / passthrough) because frontmatter is free-form markdown context
106
+ * where authors may add platform-specific keys. The transform layer (Stage 3) handles
107
+ * tool-name lookup and its errors — `tools` here is an unvalidated string array.
108
+ *
109
+ * `schemaVersion` accepted but not validated per §9.4 / §12.2.
110
+ */
111
+ export declare const claudeAgentFrontmatterSchema: z.ZodObject<{
112
+ schemaVersion: z.ZodOptional<z.ZodString>;
113
+ name: z.ZodString;
114
+ description: z.ZodString;
115
+ tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
116
+ model: z.ZodOptional<z.ZodString>;
117
+ color: z.ZodOptional<z.ZodString>;
118
+ }, z.core.$loose>;
119
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/targets/claude/schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAsBxB;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;kBAoF5B,CAAC;AAkBZ;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB;;;;;;;kBAOvB,CAAC;AAWZ;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;kBAKvB,CAAC;AAEZ;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;kBAMzB,CAAC;AAEZ;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;kBAOvB,CAAC;AAEZ,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAMpE;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B;;;;;;;iBAuB/B,CAAC"}
@@ -0,0 +1,204 @@
1
+ /**
2
+ * Zod schemas for Claude Code target manifests.
3
+ *
4
+ * These schemas are internal to @ai-plugin-marketplace/core — they are not exported from the
5
+ * package root. Per §3.4 of the architecture spec, this module must not import from any sibling
6
+ * targets/<other>/ folder.
7
+ *
8
+ * Strictness policy: `.strict()` is used wherever the canonical JSON Schema sets
9
+ * `additionalProperties: false`. `.loose()` (passthrough) is reserved for agent frontmatter,
10
+ * which is free-form markdown context where authors may add platform-specific keys.
11
+ *
12
+ * schemaVersion: every top-level manifest schema accepts `schemaVersion` as an optional
13
+ * unvalidated string per §9.4 and §12.2. Validators do not check it in v0.1.0; it is reserved
14
+ * for future migrex adoption.
15
+ */
16
+ import { z } from 'zod';
17
+ // ---------------------------------------------------------------------------
18
+ // Shared sub-schemas
19
+ // ---------------------------------------------------------------------------
20
+ /**
21
+ * Author object in the plugin manifest. Strict per JSON Schema
22
+ * (`additionalProperties: false`).
23
+ */
24
+ const claudePluginAuthorSchema = z
25
+ .object({
26
+ name: z.string(),
27
+ email: z.string().optional(),
28
+ url: z.string().optional(),
29
+ })
30
+ .strict();
31
+ // ---------------------------------------------------------------------------
32
+ // claudePluginManifestSchema
33
+ // ---------------------------------------------------------------------------
34
+ /**
35
+ * Schema for `.claude-plugin/plugin.json`.
36
+ *
37
+ * Mirrors the canonical JSON Schema at
38
+ * `schemas/plugin.json` in the template repo. Strict (`additionalProperties: false`).
39
+ * `schemaVersion` is accepted but not validated (§9.4 / §12.2).
40
+ */
41
+ export const claudePluginManifestSchema = z
42
+ .object({
43
+ /** Reserved for future migrex adoption. Accepted but not validated in v0.1.0. */
44
+ schemaVersion: z.string().optional(),
45
+ /** Plugin name: lowercase, hyphens, no spaces; must start with a letter. Max 64 chars. */
46
+ name: z
47
+ .string()
48
+ .regex(/^[a-z][a-z0-9-]*$/, 'name must be lowercase alphanumeric with hyphens, starting with a letter')
49
+ .max(64),
50
+ /** Semantic version string (optional). */
51
+ version: z
52
+ .string()
53
+ .regex(/^\d+\.\d+\.\d+/, 'version must be a valid semver string')
54
+ .optional(),
55
+ /** What this plugin does. */
56
+ description: z.string().min(1).max(1024).optional(),
57
+ /** Plugin author information. */
58
+ author: claudePluginAuthorSchema.optional(),
59
+ /** Plugin homepage URL. */
60
+ homepage: z.string().optional(),
61
+ /** Source repository URL or shorthand. */
62
+ repository: z.string().optional(),
63
+ /** SPDX license identifier. */
64
+ license: z.string().optional(),
65
+ /** Discovery keywords. */
66
+ keywords: z.array(z.string()).optional(),
67
+ /**
68
+ * Hooks configuration — relative path to a `.json` file (must start with `./` and end
69
+ * with `.json`), or an inline hooks configuration object.
70
+ */
71
+ hooks: z
72
+ .union([z.string().regex(/^\.\/.*\.json$/), z.record(z.string(), z.unknown())])
73
+ .optional(),
74
+ /**
75
+ * Commands — relative path starting with `./`, an array of such paths, or a record of
76
+ * command name → command object.
77
+ */
78
+ commands: z
79
+ .union([
80
+ z.string().regex(/^\.\//),
81
+ z.array(z.string().regex(/^\.\//)),
82
+ z.record(z.string(), z.unknown()),
83
+ ])
84
+ .optional(),
85
+ /**
86
+ * Agent definitions — relative `.md` path or array of such paths.
87
+ * Must start with `./` and end with `.md`.
88
+ */
89
+ agents: z
90
+ .union([z.string().regex(/^\.\/.+\.md$/), z.array(z.string().regex(/^\.\/.+\.md$/))])
91
+ .optional(),
92
+ /**
93
+ * Skill definitions — relative path to a skill directory or array of such paths.
94
+ * Must start with `./`.
95
+ */
96
+ skills: z.union([z.string().regex(/^\.\//), z.array(z.string().regex(/^\.\//))]).optional(),
97
+ /** Output style configuration. */
98
+ outputStyles: z.record(z.string(), z.unknown()).optional(),
99
+ /** MCP server configuration. */
100
+ mcpServers: z.record(z.string(), z.unknown()).optional(),
101
+ /** LSP server configuration. */
102
+ lspServers: z.record(z.string(), z.unknown()).optional(),
103
+ /** Plugin settings configuration. */
104
+ settings: z.record(z.string(), z.unknown()).optional(),
105
+ })
106
+ .strict();
107
+ // ---------------------------------------------------------------------------
108
+ // claudeMcpConfigSchema
109
+ // ---------------------------------------------------------------------------
110
+ /**
111
+ * Schema for a single MCP server entry. Strict: only `command`, `args`, and `env` are
112
+ * accepted — matching the Claude `.mcp.json` format.
113
+ */
114
+ const claudeMcpServerSchema = z
115
+ .object({
116
+ command: z.string(),
117
+ args: z.array(z.string()).optional(),
118
+ env: z.record(z.string(), z.string()).optional(),
119
+ })
120
+ .strict();
121
+ /**
122
+ * Schema for `.mcp.json` (Claude MCP configuration).
123
+ *
124
+ * `mcpServers` maps server name → server config. Strict at the top level.
125
+ * `schemaVersion` accepted but not validated per §9.4 / §12.2.
126
+ */
127
+ export const claudeMcpConfigSchema = z
128
+ .object({
129
+ /** Reserved for future migrex adoption. Accepted but not validated in v0.1.0. */
130
+ schemaVersion: z.string().optional(),
131
+ mcpServers: z.record(z.string(), claudeMcpServerSchema),
132
+ })
133
+ .strict();
134
+ // ---------------------------------------------------------------------------
135
+ // claudeHooksFileSchema
136
+ // ---------------------------------------------------------------------------
137
+ /**
138
+ * Known Claude Code hook event types. Unknown events are rejected at the schema level.
139
+ */
140
+ const claudeHookEventSchema = z.enum(['PreToolUse', 'PostToolUse', 'Stop', 'UserPromptSubmit']);
141
+ /**
142
+ * A single hook entry: a command to run.
143
+ */
144
+ export const claudeHookEntrySchema = z
145
+ .object({
146
+ type: z.literal('command'),
147
+ command: z.string(),
148
+ })
149
+ .strict();
150
+ /**
151
+ * A hook matcher: optional regex filter + description + list of hook entries to run.
152
+ */
153
+ export const claudeHookMatcherSchema = z
154
+ .object({
155
+ matcher: z.string().optional(),
156
+ description: z.string().optional(),
157
+ hooks: z.array(claudeHookEntrySchema),
158
+ })
159
+ .strict();
160
+ /**
161
+ * Schema for `hooks/claude.json`.
162
+ *
163
+ * Top level: `{ hooks: Record<ClaudeHookEvent, ClaudeHookMatcher[]> }`. Strict.
164
+ * `schemaVersion` accepted but not validated per §9.4 / §12.2.
165
+ */
166
+ export const claudeHooksFileSchema = z
167
+ .object({
168
+ /** Reserved for future migrex adoption. Accepted but not validated in v0.1.0. */
169
+ schemaVersion: z.string().optional(),
170
+ hooks: z.partialRecord(claudeHookEventSchema, z.array(claudeHookMatcherSchema)),
171
+ })
172
+ .strict();
173
+ // ---------------------------------------------------------------------------
174
+ // claudeAgentFrontmatterSchema
175
+ // ---------------------------------------------------------------------------
176
+ /**
177
+ * Schema for the YAML frontmatter of `agents/*.md` files.
178
+ *
179
+ * Permissive (`.loose()` / passthrough) because frontmatter is free-form markdown context
180
+ * where authors may add platform-specific keys. The transform layer (Stage 3) handles
181
+ * tool-name lookup and its errors — `tools` here is an unvalidated string array.
182
+ *
183
+ * `schemaVersion` accepted but not validated per §9.4 / §12.2.
184
+ */
185
+ export const claudeAgentFrontmatterSchema = z
186
+ .object({
187
+ /** Reserved for future migrex adoption. Accepted but not validated in v0.1.0. */
188
+ schemaVersion: z.string().optional(),
189
+ /** Agent display name. Required. */
190
+ name: z.string(),
191
+ /** What this agent does. Required. */
192
+ description: z.string(),
193
+ /**
194
+ * Tools the agent may use. Unvalidated strings — the Claude tool enum is enforced in
195
+ * Stage 3's transform layer, not here.
196
+ */
197
+ tools: z.array(z.string()).optional(),
198
+ /** Model hint (e.g. 'opus', 'sonnet', 'haiku'). Not validated against an enum. */
199
+ model: z.string().optional(),
200
+ /** Display color hint. */
201
+ color: z.string().optional(),
202
+ })
203
+ .loose();
204
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../src/targets/claude/schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8EAA8E;AAC9E,qBAAqB;AACrB,8EAA8E;AAE9E;;;GAGG;AACH,MAAM,wBAAwB,GAAG,CAAC;KAC/B,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC3B,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,8EAA8E;AAC9E,6BAA6B;AAC7B,8EAA8E;AAE9E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC;KACxC,MAAM,CAAC;IACN,iF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W,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAAC;CACtC,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC;KACnC,MAAM,CAAC;IACN,iFAAiF;IACjF,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAEpC,KAAK,EAAE,CAAC,CAAC,aAAa,CAAC,qBAAqB,EAAE,CAAC,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;CAChF,CAAC;KACD,MAAM,EAAE,CAAC;AAIZ,8EAA8E;AAC9E,+BAA+B;AAC/B,8EAA8E;AAE9E;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC;KAC1C,MAAM,CAAC;IACN,iFAAiF;IACjF,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAEpC,oCAAoC;IACpC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAEhB,sCAAsC;IACtC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IAEvB;;;OAGG;IACH,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAErC,kFAAkF;IAClF,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAE5B,0BAA0B;IAC1B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC;KACD,KAAK,EAAE,CAAC"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Mechanical transformations for the Claude Code target.
3
+ *
4
+ * Per §7.1 of the architecture spec, every function here is a pure function driven by
5
+ * committed logic, bounded to the Claude target. No filesystem I/O; no cross-target
6
+ * imports; no tool-name translation (Claude is the source dialect — §7.3).
7
+ *
8
+ * @see docs/specs/architecture.md §7.2, §12.4, §12.5
9
+ */
10
+ import type { ClaudeHooksFile } from './schemas.js';
11
+ /**
12
+ * Parse YAML hook source and validate against the Claude hooks schema.
13
+ * Pure — takes a string, returns validated data. Throws {@link ZodError} on bad shape.
14
+ *
15
+ * @param yamlContent - Raw YAML string (contents of `hooks/claude.yaml`).
16
+ * @returns Validated {@link ClaudeHooksFile}.
17
+ * @throws {ZodError} If the parsed value does not match the hooks schema.
18
+ * @throws {Error} If the YAML itself is malformed.
19
+ */
20
+ export declare function parseClaudeHooksYaml(yamlContent: string): ClaudeHooksFile;
21
+ /**
22
+ * Serialize validated hooks data as pretty-printed JSON matching the current
23
+ * `build-hooks.ts` output: 2-space indent, trailing newline.
24
+ *
25
+ * @param data - Validated {@link ClaudeHooksFile}.
26
+ * @returns JSON string with 2-space indentation and a trailing `\n`.
27
+ */
28
+ export declare function serializeClaudeHooksJson(data: ClaudeHooksFile): string;
29
+ /**
30
+ * Convenience: one-shot YAML string → JSON string conversion with validation.
31
+ * Matches the end-to-end behavior of the current `src/build-hooks.ts`:
32
+ * parse YAML, validate against the hooks schema, serialize as pretty JSON.
33
+ *
34
+ * @param yamlContent - Raw YAML string (contents of `hooks/claude.yaml`).
35
+ * @returns Pretty-printed JSON string with trailing newline.
36
+ * @throws {ZodError} If the parsed value does not match the hooks schema.
37
+ * @throws {Error} If the YAML itself is malformed.
38
+ */
39
+ export declare function convertClaudeHooksYamlToJson(yamlContent: string): string;
40
+ //# sourceMappingURL=transform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../src/targets/claude/transform.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAGpD;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,eAAe,CAGzE;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAEtE;AAED;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAExE"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Mechanical transformations for the Claude Code target.
3
+ *
4
+ * Per §7.1 of the architecture spec, every function here is a pure function driven by
5
+ * committed logic, bounded to the Claude target. No filesystem I/O; no cross-target
6
+ * imports; no tool-name translation (Claude is the source dialect — §7.3).
7
+ *
8
+ * @see docs/specs/architecture.md §7.2, §12.4, §12.5
9
+ */
10
+ import { parse as parseYaml } from 'yaml';
11
+ import { claudeHooksFileSchema } from './schemas.js';
12
+ /**
13
+ * Parse YAML hook source and validate against the Claude hooks schema.
14
+ * Pure — takes a string, returns validated data. Throws {@link ZodError} on bad shape.
15
+ *
16
+ * @param yamlContent - Raw YAML string (contents of `hooks/claude.yaml`).
17
+ * @returns Validated {@link ClaudeHooksFile}.
18
+ * @throws {ZodError} If the parsed value does not match the hooks schema.
19
+ * @throws {Error} If the YAML itself is malformed.
20
+ */
21
+ export function parseClaudeHooksYaml(yamlContent) {
22
+ const parsed = parseYaml(yamlContent);
23
+ return claudeHooksFileSchema.parse(parsed);
24
+ }
25
+ /**
26
+ * Serialize validated hooks data as pretty-printed JSON matching the current
27
+ * `build-hooks.ts` output: 2-space indent, trailing newline.
28
+ *
29
+ * @param data - Validated {@link ClaudeHooksFile}.
30
+ * @returns JSON string with 2-space indentation and a trailing `\n`.
31
+ */
32
+ export function serializeClaudeHooksJson(data) {
33
+ return JSON.stringify(data, null, 2) + '\n';
34
+ }
35
+ /**
36
+ * Convenience: one-shot YAML string → JSON string conversion with validation.
37
+ * Matches the end-to-end behavior of the current `src/build-hooks.ts`:
38
+ * parse YAML, validate against the hooks schema, serialize as pretty JSON.
39
+ *
40
+ * @param yamlContent - Raw YAML string (contents of `hooks/claude.yaml`).
41
+ * @returns Pretty-printed JSON string with trailing newline.
42
+ * @throws {ZodError} If the parsed value does not match the hooks schema.
43
+ * @throws {Error} If the YAML itself is malformed.
44
+ */
45
+ export function convertClaudeHooksYamlToJson(yamlContent) {
46
+ return serializeClaudeHooksJson(parseClaudeHooksYaml(yamlContent));
47
+ }
48
+ //# sourceMappingURL=transform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transform.js","sourceRoot":"","sources":["../../../src/targets/claude/transform.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAE1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAErD;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAAC,WAAmB;IACtD,MAAM,MAAM,GAAY,SAAS,CAAC,WAAW,CAAC,CAAC;IAC/C,OAAO,qBAAqB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAC7C,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CAAC,IAAqB;IAC5D,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC;AAC9C,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,4BAA4B,CAAC,WAAmB;IAC9D,OAAO,wBAAwB,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC,CAAC;AACrE,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Per-target validators for the Claude Code target.
3
+ *
4
+ * These checks go beyond schema shape validation — they verify filesystem facts and
5
+ * cross-file consistency within the Claude target. Schema shape errors are caught by
6
+ * `claudePluginManifestSchema` (Stage 2); the checks here require reading the filesystem.
7
+ *
8
+ * Cross-target concerns (envelope-adherence, name-consistency, mcp-key-sync,
9
+ * marketplace-registration, freshness) are out of scope for this module.
10
+ *
11
+ * @see docs/specs/architecture.md §10 (validation contract), §8.1 (Finding types)
12
+ * @see docs/specs/architecture.md §12.5 (internal module shape)
13
+ */
14
+ import type { Finding } from '../../pipeline/types.js';
15
+ /**
16
+ * Run all Claude-specific validators against a plugin directory.
17
+ *
18
+ * `pluginDir` is the absolute path to a `plugins/<name>/` directory.
19
+ * Returns zero or more Findings. Callers combine these with other targets'
20
+ * findings and the cross-target findings in the pipeline validator.
21
+ *
22
+ * All findings emitted here use `plugin: path.basename(pluginDir)`.
23
+ */
24
+ export declare function validateClaudePlugin(pluginDir: string): Finding[];
25
+ //# sourceMappingURL=validate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../src/targets/claude/validate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAOH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AA4UvD;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,EAAE,CAQjE"}