@ambystech/ambykit 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 (144) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +94 -0
  3. package/dist/cli/add.d.ts +7 -0
  4. package/dist/cli/add.js +52 -0
  5. package/dist/cli/add.js.map +1 -0
  6. package/dist/cli/analyze.d.ts +12 -0
  7. package/dist/cli/analyze.js +48 -0
  8. package/dist/cli/analyze.js.map +1 -0
  9. package/dist/cli/banner.d.ts +3 -0
  10. package/dist/cli/banner.js +13 -0
  11. package/dist/cli/banner.js.map +1 -0
  12. package/dist/cli/base-command.d.ts +45 -0
  13. package/dist/cli/base-command.js +86 -0
  14. package/dist/cli/base-command.js.map +1 -0
  15. package/dist/cli/check.d.ts +7 -0
  16. package/dist/cli/check.js +45 -0
  17. package/dist/cli/check.js.map +1 -0
  18. package/dist/cli/dashboard.d.ts +11 -0
  19. package/dist/cli/dashboard.js +135 -0
  20. package/dist/cli/dashboard.js.map +1 -0
  21. package/dist/cli/emit.d.ts +7 -0
  22. package/dist/cli/emit.js +24 -0
  23. package/dist/cli/emit.js.map +1 -0
  24. package/dist/cli/fsops.d.ts +21 -0
  25. package/dist/cli/fsops.js +58 -0
  26. package/dist/cli/fsops.js.map +1 -0
  27. package/dist/cli/index.d.ts +7 -0
  28. package/dist/cli/index.js +87 -0
  29. package/dist/cli/index.js.map +1 -0
  30. package/dist/cli/init.d.ts +8 -0
  31. package/dist/cli/init.js +84 -0
  32. package/dist/cli/init.js.map +1 -0
  33. package/dist/cli/sync.d.ts +7 -0
  34. package/dist/cli/sync.js +48 -0
  35. package/dist/cli/sync.js.map +1 -0
  36. package/dist/cli/tool-options.d.ts +3 -0
  37. package/dist/cli/tool-options.js +6 -0
  38. package/dist/cli/tool-options.js.map +1 -0
  39. package/dist/cli/ui/capabilities.d.ts +17 -0
  40. package/dist/cli/ui/capabilities.js +30 -0
  41. package/dist/cli/ui/capabilities.js.map +1 -0
  42. package/dist/cli/ui/interactive/dashboard.d.ts +20 -0
  43. package/dist/cli/ui/interactive/dashboard.js +96 -0
  44. package/dist/cli/ui/interactive/dashboard.js.map +1 -0
  45. package/dist/cli/ui/interactive/fullscreen.d.ts +26 -0
  46. package/dist/cli/ui/interactive/fullscreen.js +46 -0
  47. package/dist/cli/ui/interactive/fullscreen.js.map +1 -0
  48. package/dist/cli/ui/interactive/prompt.d.ts +41 -0
  49. package/dist/cli/ui/interactive/prompt.js +108 -0
  50. package/dist/cli/ui/interactive/prompt.js.map +1 -0
  51. package/dist/cli/ui/progress.d.ts +28 -0
  52. package/dist/cli/ui/progress.js +64 -0
  53. package/dist/cli/ui/progress.js.map +1 -0
  54. package/dist/cli/ui/render.d.ts +21 -0
  55. package/dist/cli/ui/render.js +36 -0
  56. package/dist/cli/ui/render.js.map +1 -0
  57. package/dist/cli/ui/table.d.ts +7 -0
  58. package/dist/cli/ui/table.js +116 -0
  59. package/dist/cli/ui/table.js.map +1 -0
  60. package/dist/cli/ui/theme.d.ts +9 -0
  61. package/dist/cli/ui/theme.js +73 -0
  62. package/dist/cli/ui/theme.js.map +1 -0
  63. package/dist/cli/ui/types.d.ts +78 -0
  64. package/dist/cli/ui/types.js +7 -0
  65. package/dist/cli/ui/types.js.map +1 -0
  66. package/dist/cli/upgrade.d.ts +7 -0
  67. package/dist/cli/upgrade.js +27 -0
  68. package/dist/cli/upgrade.js.map +1 -0
  69. package/dist/core/analyze.d.ts +25 -0
  70. package/dist/core/analyze.js +107 -0
  71. package/dist/core/analyze.js.map +1 -0
  72. package/dist/core/command-spec.d.ts +5 -0
  73. package/dist/core/command-spec.js +47 -0
  74. package/dist/core/command-spec.js.map +1 -0
  75. package/dist/core/config.d.ts +7 -0
  76. package/dist/core/config.js +27 -0
  77. package/dist/core/config.js.map +1 -0
  78. package/dist/core/dashboard.d.ts +37 -0
  79. package/dist/core/dashboard.js +145 -0
  80. package/dist/core/dashboard.js.map +1 -0
  81. package/dist/core/index.d.ts +8 -0
  82. package/dist/core/index.js +9 -0
  83. package/dist/core/index.js.map +1 -0
  84. package/dist/core/paths.d.ts +13 -0
  85. package/dist/core/paths.js +45 -0
  86. package/dist/core/paths.js.map +1 -0
  87. package/dist/core/rules.d.ts +6 -0
  88. package/dist/core/rules.js +48 -0
  89. package/dist/core/rules.js.map +1 -0
  90. package/dist/core/scaffold.d.ts +15 -0
  91. package/dist/core/scaffold.js +43 -0
  92. package/dist/core/scaffold.js.map +1 -0
  93. package/dist/core/types.d.ts +53 -0
  94. package/dist/core/types.js +3 -0
  95. package/dist/core/types.js.map +1 -0
  96. package/dist/emitters/antigravity-cli.d.ts +10 -0
  97. package/dist/emitters/antigravity-cli.js +11 -0
  98. package/dist/emitters/antigravity-cli.js.map +1 -0
  99. package/dist/emitters/antigravity.d.ts +15 -0
  100. package/dist/emitters/antigravity.js +18 -0
  101. package/dist/emitters/antigravity.js.map +1 -0
  102. package/dist/emitters/base-emitter.d.ts +40 -0
  103. package/dist/emitters/base-emitter.js +72 -0
  104. package/dist/emitters/base-emitter.js.map +1 -0
  105. package/dist/emitters/claude.d.ts +16 -0
  106. package/dist/emitters/claude.js +40 -0
  107. package/dist/emitters/claude.js.map +1 -0
  108. package/dist/emitters/copilot-cli.d.ts +18 -0
  109. package/dist/emitters/copilot-cli.js +28 -0
  110. package/dist/emitters/copilot-cli.js.map +1 -0
  111. package/dist/emitters/copilot.d.ts +19 -0
  112. package/dist/emitters/copilot.js +39 -0
  113. package/dist/emitters/copilot.js.map +1 -0
  114. package/dist/emitters/cursor-cli.d.ts +12 -0
  115. package/dist/emitters/cursor-cli.js +12 -0
  116. package/dist/emitters/cursor-cli.js.map +1 -0
  117. package/dist/emitters/cursor.d.ts +16 -0
  118. package/dist/emitters/cursor.js +30 -0
  119. package/dist/emitters/cursor.js.map +1 -0
  120. package/dist/emitters/index.d.ts +28 -0
  121. package/dist/emitters/index.js +59 -0
  122. package/dist/emitters/index.js.map +1 -0
  123. package/dist/emitters/opencode.d.ts +14 -0
  124. package/dist/emitters/opencode.js +17 -0
  125. package/dist/emitters/opencode.js.map +1 -0
  126. package/dist/index.d.ts +3 -0
  127. package/dist/index.js +4 -0
  128. package/dist/index.js.map +1 -0
  129. package/package.json +68 -0
  130. package/src/prompts/analyze.md +26 -0
  131. package/src/prompts/clarify.md +21 -0
  132. package/src/prompts/constitution.md +22 -0
  133. package/src/prompts/design.md +27 -0
  134. package/src/prompts/implement.md +23 -0
  135. package/src/prompts/plan.md +26 -0
  136. package/src/prompts/specify.md +28 -0
  137. package/src/prompts/tasks.md +24 -0
  138. package/src/reference/design-conventions.md +58 -0
  139. package/src/templates/constitution.md +29 -0
  140. package/src/templates/design-tokens.json +41 -0
  141. package/src/templates/plan.md +38 -0
  142. package/src/templates/spec.md +53 -0
  143. package/src/templates/tasks.md +28 -0
  144. package/src/templates/ui.md +41 -0
@@ -0,0 +1,45 @@
1
+ import { fileURLToPath } from "node:url";
2
+ import { dirname, join, resolve } from "node:path";
3
+ import { existsSync } from "node:fs";
4
+ /**
5
+ * Resolve the installed package root (where src/prompts and src/templates live).
6
+ * Works both from compiled dist/ and when run through a loader against src/.
7
+ */
8
+ export function packageRoot() {
9
+ // this file is at <root>/src/core/paths.ts or <root>/dist/core/paths.js
10
+ const here = dirname(fileURLToPath(import.meta.url));
11
+ // walk up until we find a dir containing package.json
12
+ let dir = here;
13
+ for (let i = 0; i < 6; i++) {
14
+ if (existsSync(join(dir, "package.json")))
15
+ return dir;
16
+ dir = dirname(dir);
17
+ }
18
+ // fallback: two levels up from core/
19
+ return resolve(here, "..", "..");
20
+ }
21
+ /** Directory containing the neutral phase prompts. */
22
+ export function promptsDir() {
23
+ return join(packageRoot(), "src", "prompts");
24
+ }
25
+ /** Directory containing the neutral artifact templates. */
26
+ export function templatesDir() {
27
+ return join(packageRoot(), "src", "templates");
28
+ }
29
+ /** Directory containing on-demand reference docs (loaded by phases when needed). */
30
+ export function referenceDir() {
31
+ return join(packageRoot(), "src", "reference");
32
+ }
33
+ /** Find the project root by walking up from `start` looking for an `.amby` dir. */
34
+ export function findProjectRoot(start = process.cwd()) {
35
+ let dir = resolve(start);
36
+ for (;;) {
37
+ if (existsSync(join(dir, ".amby")))
38
+ return dir;
39
+ const parent = dirname(dir);
40
+ if (parent === dir)
41
+ return null;
42
+ dir = parent;
43
+ }
44
+ }
45
+ //# sourceMappingURL=paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/core/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC;;;GAGG;AACH,MAAM,UAAU,WAAW;IACzB,wEAAwE;IACxE,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACrD,sDAAsD;IACtD,IAAI,GAAG,GAAG,IAAI,CAAC;IACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3B,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;YAAE,OAAO,GAAG,CAAC;QACtD,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;IACD,qCAAqC;IACrC,OAAO,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACnC,CAAC;AAED,sDAAsD;AACtD,MAAM,UAAU,UAAU;IACxB,OAAO,IAAI,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;AAC/C,CAAC;AAED,2DAA2D;AAC3D,MAAM,UAAU,YAAY;IAC1B,OAAO,IAAI,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC;AACjD,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,YAAY;IAC1B,OAAO,IAAI,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC;AACjD,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,eAAe,CAAC,QAAgB,OAAO,CAAC,GAAG,EAAE;IAC3D,IAAI,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IACzB,SAAS,CAAC;QACR,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;YAAE,OAAO,GAAG,CAAC;QAC/C,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,MAAM,KAAK,GAAG;YAAE,OAAO,IAAI,CAAC;QAChC,GAAG,GAAG,MAAM,CAAC;IACf,CAAC;AACH,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { CommandSpec } from "./types.js";
2
+ /**
3
+ * Build the shared, tool-neutral AGENTS.md for a consumer project. Natively read by OpenCode,
4
+ * Copilot, Cursor, and Antigravity; Claude Code reads it via a CLAUDE.md `@AGENTS.md` bridge.
5
+ */
6
+ export declare function buildAgentsMd(projectName: string, specs: CommandSpec[]): string;
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Build the shared, tool-neutral AGENTS.md for a consumer project. Natively read by OpenCode,
3
+ * Copilot, Cursor, and Antigravity; Claude Code reads it via a CLAUDE.md `@AGENTS.md` bridge.
4
+ */
5
+ export function buildAgentsMd(projectName, specs) {
6
+ const rows = specs
7
+ .slice()
8
+ .sort((a, b) => phaseOrder(a.phase) - phaseOrder(b.phase))
9
+ .map((s) => `| \`/${s.name}\` | ${s.description} |`)
10
+ .join("\n");
11
+ return `# AGENTS.md — ${projectName}
12
+
13
+ This project uses **AmbyKit** for Spec-Driven Development. Build features by producing structured
14
+ artifacts before code: a constitution, specs (user stories + EARS requirements), UI design, a plan,
15
+ and an ordered task list.
16
+
17
+ ## Workflow commands
18
+
19
+ | Command | Purpose |
20
+ |---|---|
21
+ ${rows}
22
+
23
+ ## Rules for agents
24
+
25
+ - Read \`.amby/constitution.md\` and honor its principles in every phase.
26
+ - Specs (\`specs/NNN-*/spec.md\`) capture WHAT/WHY with **no technology choices**; plans capture HOW.
27
+ - Requirements use EARS (WHEN/WHILE/IF…THE SYSTEM SHALL…) with Given/When/Then acceptance criteria.
28
+ - Reference artifacts by stable id (US-#, FR-###, SC-###); don't restate them. Patch in place.
29
+ - Task checkboxes in \`tasks.md\` are the source of truth for progress (\`ambykit dashboard\`).
30
+
31
+ <!-- Managed by AmbyKit. Regenerate with \`ambykit sync\`. -->
32
+ `;
33
+ }
34
+ const PHASE_SEQUENCE = [
35
+ "constitution",
36
+ "specify",
37
+ "clarify",
38
+ "design",
39
+ "plan",
40
+ "tasks",
41
+ "analyze",
42
+ "implement",
43
+ ];
44
+ function phaseOrder(phase) {
45
+ const i = PHASE_SEQUENCE.indexOf(phase);
46
+ return i === -1 ? PHASE_SEQUENCE.length : i;
47
+ }
48
+ //# sourceMappingURL=rules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rules.js","sourceRoot":"","sources":["../../src/core/rules.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,WAAmB,EAAE,KAAoB;IACrE,MAAM,IAAI,GAAG,KAAK;SACf,KAAK,EAAE;SACP,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;SACzD,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,WAAW,IAAI,CAAC;SACnD,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,OAAO,iBAAiB,WAAW;;;;;;;;;;EAUnC,IAAI;;;;;;;;;;;CAWL,CAAC;AACF,CAAC;AAED,MAAM,cAAc,GAAG;IACrB,cAAc;IACd,SAAS;IACT,SAAS;IACT,QAAQ;IACR,MAAM;IACN,OAAO;IACP,SAAS;IACT,WAAW;CACZ,CAAC;AAEF,SAAS,UAAU,CAAC,KAAa;IAC/B,MAAM,CAAC,GAAG,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACxC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9C,CAAC"}
@@ -0,0 +1,15 @@
1
+ /** Artifact templates installed into a consumer's `.amby/templates/` (referenced by the prompts). */
2
+ export declare const ARTIFACT_TEMPLATES: readonly ["constitution.md", "spec.md", "ui.md", "design-tokens.json", "plan.md", "tasks.md"];
3
+ /** On-demand reference docs installed into a consumer's `.amby/reference/`. */
4
+ export declare const REFERENCE_DOCS: readonly ["design-conventions.md"];
5
+ export interface InstallResult {
6
+ created: string[];
7
+ present: string[];
8
+ }
9
+ /**
10
+ * Install the artifact templates and reference docs into a project's `.amby/`. Uses
11
+ * write-if-absent semantics: existing files are never overwritten, so a project can customize its
12
+ * templates and `sync`/`upgrade` will only add newly-introduced ones. The prompts reference these by
13
+ * `@.amby/templates/…` / `@.amby/reference/…`, so installing them wires the workflow.
14
+ */
15
+ export declare function installArtifactTemplates(projectRoot: string, dryRun?: boolean): InstallResult;
@@ -0,0 +1,43 @@
1
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
2
+ import { dirname, join } from "node:path";
3
+ import { referenceDir, templatesDir } from "./paths.js";
4
+ /** Artifact templates installed into a consumer's `.amby/templates/` (referenced by the prompts). */
5
+ export const ARTIFACT_TEMPLATES = [
6
+ "constitution.md",
7
+ "spec.md",
8
+ "ui.md",
9
+ "design-tokens.json",
10
+ "plan.md",
11
+ "tasks.md",
12
+ ];
13
+ /** On-demand reference docs installed into a consumer's `.amby/reference/`. */
14
+ export const REFERENCE_DOCS = ["design-conventions.md"];
15
+ /**
16
+ * Install the artifact templates and reference docs into a project's `.amby/`. Uses
17
+ * write-if-absent semantics: existing files are never overwritten, so a project can customize its
18
+ * templates and `sync`/`upgrade` will only add newly-introduced ones. The prompts reference these by
19
+ * `@.amby/templates/…` / `@.amby/reference/…`, so installing them wires the workflow.
20
+ */
21
+ export function installArtifactTemplates(projectRoot, dryRun = false) {
22
+ const result = { created: [], present: [] };
23
+ const copy = (srcAbs, destRel) => {
24
+ const destAbs = join(projectRoot, destRel);
25
+ if (existsSync(destAbs)) {
26
+ result.present.push(destRel);
27
+ return;
28
+ }
29
+ if (!dryRun) {
30
+ mkdirSync(dirname(destAbs), { recursive: true });
31
+ writeFileSync(destAbs, readFileSync(srcAbs, "utf8"), "utf8");
32
+ }
33
+ result.created.push(destRel);
34
+ };
35
+ for (const name of ARTIFACT_TEMPLATES) {
36
+ copy(join(templatesDir(), name), join(".amby", "templates", name));
37
+ }
38
+ for (const name of REFERENCE_DOCS) {
39
+ copy(join(referenceDir(), name), join(".amby", "reference", name));
40
+ }
41
+ return result;
42
+ }
43
+ //# sourceMappingURL=scaffold.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../../src/core/scaffold.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAExD,qGAAqG;AACrG,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,iBAAiB;IACjB,SAAS;IACT,OAAO;IACP,oBAAoB;IACpB,SAAS;IACT,UAAU;CACF,CAAC;AAEX,+EAA+E;AAC/E,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,uBAAuB,CAAU,CAAC;AAOjE;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,WAAmB,EAAE,MAAM,GAAG,KAAK;IAC1E,MAAM,MAAM,GAAkB,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAE3D,MAAM,IAAI,GAAG,CAAC,MAAc,EAAE,OAAe,EAAE,EAAE;QAC/C,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAC3C,IAAI,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;YACxB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC7B,OAAO;QACT,CAAC;QACD,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YACjD,aAAa,CAAC,OAAO,EAAE,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;QAC/D,CAAC;QACD,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC,CAAC;IAEF,KAAK,MAAM,IAAI,IAAI,kBAAkB,EAAE,CAAC;QACtC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC;IACrE,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,cAAc,EAAE,CAAC;QAClC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC;IACrE,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,53 @@
1
+ /** Core domain types shared across the CLI and emitters. */
2
+ /** The neutral, tool-agnostic definition of one workflow phase (loaded from src/prompts/*.md). */
3
+ export interface CommandSpec {
4
+ /** Short id, e.g. "specify". */
5
+ id: string;
6
+ /** Namespaced command name, e.g. "amby.specify". */
7
+ name: string;
8
+ /** One-line description shown in the tool's command list. */
9
+ description: string;
10
+ /** Hint for the command's argument, e.g. "<feature description>". */
11
+ argumentHint: string;
12
+ /** Workflow phase this command belongs to. */
13
+ phase: string;
14
+ /** Artifacts this phase reads (paths, may include NNN-slug placeholders). */
15
+ reads: string[];
16
+ /** Artifacts this phase writes. */
17
+ writes: string[];
18
+ /** Abstract tool capabilities the phase needs. */
19
+ allowedTools: AbstractTool[];
20
+ /** The prompt body (Markdown), verbatim minus surrounding whitespace. */
21
+ body: string;
22
+ }
23
+ /** Tool-agnostic capability names; emitters map these to each tool's concrete tool names. */
24
+ export type AbstractTool = "read" | "write" | "edit" | "bash";
25
+ /** A file an emitter wants to write, relative to a base directory. */
26
+ export interface EmittedFile {
27
+ /** Path relative to the project root (or user home when scope is "user"). */
28
+ path: string;
29
+ /** File contents. */
30
+ contents: string;
31
+ /** Where the path is rooted. */
32
+ scope: FileScope;
33
+ }
34
+ export type FileScope = "project" | "user";
35
+ /** Context an emitter needs to render rules/config for a project. */
36
+ export interface RulesContext {
37
+ /** Human project name. */
38
+ projectName: string;
39
+ /** The command specs being emitted (for a workflow summary in the rules file). */
40
+ specs: CommandSpec[];
41
+ /** Whether the emitter should also emit the shared rules file(s). */
42
+ manageRules: boolean;
43
+ }
44
+ /** Persisted project configuration at .amby/config.json. */
45
+ export interface AmbyConfig {
46
+ version: string;
47
+ /** Enabled target ids (see emitter registry). */
48
+ tools: string[];
49
+ /** When false, `sync` regenerates commands only, not AGENTS.md/CLAUDE.md. Default true. */
50
+ manageRules?: boolean;
51
+ }
52
+ /** How a tool materializes phase prompts. */
53
+ export type CommandSurface = "commands" | "skills" | "workflows" | "none";
@@ -0,0 +1,3 @@
1
+ /** Core domain types shared across the CLI and emitters. */
2
+ export {};
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA,4DAA4D"}
@@ -0,0 +1,10 @@
1
+ import { AntigravityEmitter } from "./antigravity.js";
2
+ /**
3
+ * Antigravity CLI (`agy`) emitter. The CLI runs on the same agent harness as the IDE and reads the
4
+ * same workspace files (`.agents/workflows/`, AGENTS.md). Only global/user paths differ, which
5
+ * AmbyKit does not manage — so this reuses the IDE emitter's output unchanged.
6
+ */
7
+ export declare class AntigravityCliEmitter extends AntigravityEmitter {
8
+ readonly toolId = "antigravity-cli";
9
+ readonly displayName = "Antigravity CLI";
10
+ }
@@ -0,0 +1,11 @@
1
+ import { AntigravityEmitter } from "./antigravity.js";
2
+ /**
3
+ * Antigravity CLI (`agy`) emitter. The CLI runs on the same agent harness as the IDE and reads the
4
+ * same workspace files (`.agents/workflows/`, AGENTS.md). Only global/user paths differ, which
5
+ * AmbyKit does not manage — so this reuses the IDE emitter's output unchanged.
6
+ */
7
+ export class AntigravityCliEmitter extends AntigravityEmitter {
8
+ toolId = "antigravity-cli";
9
+ displayName = "Antigravity CLI";
10
+ }
11
+ //# sourceMappingURL=antigravity-cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"antigravity-cli.js","sourceRoot":"","sources":["../../src/emitters/antigravity-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD;;;;GAIG;AACH,MAAM,OAAO,qBAAsB,SAAQ,kBAAkB;IACzC,MAAM,GAAG,iBAAiB,CAAC;IAC3B,WAAW,GAAG,iBAAiB,CAAC;CACnD"}
@@ -0,0 +1,15 @@
1
+ import type { CommandSpec, CommandSurface } from "../core/types.js";
2
+ import { BaseEmitter } from "./base-emitter.js";
3
+ /**
4
+ * Google Antigravity (IDE) emitter. Its file-based command surface is **workflows** at
5
+ * `.agents/workflows/*.md` (plural `.agents/`), with `description`-only frontmatter. Antigravity
6
+ * reads AGENTS.md natively, so no tool-specific rules file is emitted. There is no file-based agent
7
+ * format (SDK only). The `agy` CLI shares these workspace files (see AntigravityCliEmitter).
8
+ */
9
+ export declare class AntigravityEmitter extends BaseEmitter {
10
+ readonly toolId: string;
11
+ readonly displayName: string;
12
+ readonly commandSurface: CommandSurface;
13
+ readonly commandDir: string;
14
+ protected commandFrontmatter(spec: CommandSpec): Array<[string, string]>;
15
+ }
@@ -0,0 +1,18 @@
1
+ import { join } from "node:path";
2
+ import { BaseEmitter } from "./base-emitter.js";
3
+ /**
4
+ * Google Antigravity (IDE) emitter. Its file-based command surface is **workflows** at
5
+ * `.agents/workflows/*.md` (plural `.agents/`), with `description`-only frontmatter. Antigravity
6
+ * reads AGENTS.md natively, so no tool-specific rules file is emitted. There is no file-based agent
7
+ * format (SDK only). The `agy` CLI shares these workspace files (see AntigravityCliEmitter).
8
+ */
9
+ export class AntigravityEmitter extends BaseEmitter {
10
+ toolId = "antigravity";
11
+ displayName = "Antigravity (IDE)";
12
+ commandSurface = "workflows";
13
+ commandDir = join(".agents", "workflows");
14
+ commandFrontmatter(spec) {
15
+ return [["description", this.yamlQuote(spec.description)]];
16
+ }
17
+ }
18
+ //# sourceMappingURL=antigravity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"antigravity.js","sourceRoot":"","sources":["../../src/emitters/antigravity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,OAAO,kBAAmB,SAAQ,WAAW;IACxC,MAAM,GAAW,aAAa,CAAC;IAC/B,WAAW,GAAW,mBAAmB,CAAC;IAC1C,cAAc,GAAmB,WAAW,CAAC;IAC7C,UAAU,GAAW,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAExC,kBAAkB,CAAC,IAAiB;QACrD,OAAO,CAAC,CAAC,aAAa,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAC7D,CAAC;CACF"}
@@ -0,0 +1,40 @@
1
+ import type { AbstractTool, CommandSpec, CommandSurface, EmittedFile, RulesContext } from "../core/types.js";
2
+ /**
3
+ * Abstract base for all tool emitters. Holds the shared orchestration (the `emit` template method)
4
+ * and rendering helpers; subclasses override only what differs for their tool. Adding a tool should
5
+ * be a thin subclass — never a re-implementation of `emit`.
6
+ */
7
+ export declare abstract class BaseEmitter {
8
+ /** Stable id used in config and the registry, e.g. "claude". */
9
+ abstract readonly toolId: string;
10
+ /** Human-readable name for CLI output. */
11
+ abstract readonly displayName: string;
12
+ /** How this tool materializes phase prompts. */
13
+ abstract readonly commandSurface: CommandSurface;
14
+ /** Directory (relative to project root) that holds command/skill/workflow files. */
15
+ abstract readonly commandDir: string;
16
+ /** Map from abstract capability to this tool's concrete tool name. Override when emitting tools. */
17
+ protected readonly toolNameMap: Record<AbstractTool, string>;
18
+ /** Template method: orchestrates a full emit. Subclasses do not override this. */
19
+ emit(specs: CommandSpec[], ctx: RulesContext): EmittedFile[];
20
+ /** Tool-specific extra rules files (e.g. Claude's CLAUDE.md bridge). Default: none. */
21
+ protected rulesFiles(_ctx: RulesContext): EmittedFile[];
22
+ /** Full project-relative path of a spec's command file. */
23
+ protected commandFilePath(spec: CommandSpec): string;
24
+ /** File name for a spec's command. Default `<name>.md` (e.g. amby.specify.md). */
25
+ protected commandFileName(spec: CommandSpec): string;
26
+ /** Native frontmatter as ordered [key, serializedValue] pairs. */
27
+ protected abstract commandFrontmatter(spec: CommandSpec): Array<[string, string]>;
28
+ protected commandFile(spec: CommandSpec): EmittedFile;
29
+ /**
30
+ * Transform the neutral prompt body for this tool. Default: verbatim. Tools with a different
31
+ * argument-placeholder convention override this (e.g. Copilot swaps `$ARGUMENTS` for `${input:…}`).
32
+ */
33
+ protected transformBody(spec: CommandSpec): string;
34
+ protected generatedNotice(spec: CommandSpec): string;
35
+ protected renderFrontmatter(pairs: Array<[string, string]>): string;
36
+ /** Double-quote and escape a scalar so it is always valid YAML. */
37
+ protected yamlQuote(value: string): string;
38
+ /** Map abstract tool capabilities to this tool's concrete names, in a comma list. */
39
+ protected mappedTools(spec: CommandSpec): string;
40
+ }
@@ -0,0 +1,72 @@
1
+ import { join } from "node:path";
2
+ /**
3
+ * Abstract base for all tool emitters. Holds the shared orchestration (the `emit` template method)
4
+ * and rendering helpers; subclasses override only what differs for their tool. Adding a tool should
5
+ * be a thin subclass — never a re-implementation of `emit`.
6
+ */
7
+ export class BaseEmitter {
8
+ /** Map from abstract capability to this tool's concrete tool name. Override when emitting tools. */
9
+ toolNameMap = {
10
+ read: "read",
11
+ write: "write",
12
+ edit: "edit",
13
+ bash: "bash",
14
+ };
15
+ /** Template method: orchestrates a full emit. Subclasses do not override this. */
16
+ emit(specs, ctx) {
17
+ const files = [];
18
+ if (this.commandSurface !== "none") {
19
+ for (const spec of specs)
20
+ files.push(this.commandFile(spec));
21
+ }
22
+ if (ctx.manageRules)
23
+ files.push(...this.rulesFiles(ctx));
24
+ return files;
25
+ }
26
+ /** Tool-specific extra rules files (e.g. Claude's CLAUDE.md bridge). Default: none. */
27
+ rulesFiles(_ctx) {
28
+ return [];
29
+ }
30
+ // --- command file assembly (shared) ---
31
+ /** Full project-relative path of a spec's command file. */
32
+ commandFilePath(spec) {
33
+ return join(this.commandDir, this.commandFileName(spec));
34
+ }
35
+ /** File name for a spec's command. Default `<name>.md` (e.g. amby.specify.md). */
36
+ commandFileName(spec) {
37
+ return `${spec.name}.md`;
38
+ }
39
+ commandFile(spec) {
40
+ const pairs = this.commandFrontmatter(spec);
41
+ const notice = this.generatedNotice(spec);
42
+ const body = this.transformBody(spec);
43
+ // Tools with no command frontmatter (e.g. Cursor plain commands) get no `---` block.
44
+ const head = pairs.length > 0 ? `${this.renderFrontmatter(pairs)}\n` : "";
45
+ const contents = `${head}${notice}\n\n${body}\n`;
46
+ return { path: this.commandFilePath(spec), contents, scope: "project" };
47
+ }
48
+ /**
49
+ * Transform the neutral prompt body for this tool. Default: verbatim. Tools with a different
50
+ * argument-placeholder convention override this (e.g. Copilot swaps `$ARGUMENTS` for `${input:…}`).
51
+ */
52
+ transformBody(spec) {
53
+ return spec.body;
54
+ }
55
+ generatedNotice(spec) {
56
+ return `<!-- GENERATED by AmbyKit from src/prompts/${spec.id}.md — do not edit by hand; run \`ambykit sync\`. -->`;
57
+ }
58
+ // --- serialization helpers (shared) ---
59
+ renderFrontmatter(pairs) {
60
+ const body = pairs.map(([k, v]) => `${k}: ${v}`).join("\n");
61
+ return `---\n${body}\n---`;
62
+ }
63
+ /** Double-quote and escape a scalar so it is always valid YAML. */
64
+ yamlQuote(value) {
65
+ return `"${value.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
66
+ }
67
+ /** Map abstract tool capabilities to this tool's concrete names, in a comma list. */
68
+ mappedTools(spec) {
69
+ return spec.allowedTools.map((t) => this.toolNameMap[t]).join(", ");
70
+ }
71
+ }
72
+ //# sourceMappingURL=base-emitter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-emitter.js","sourceRoot":"","sources":["../../src/emitters/base-emitter.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,16 @@
1
+ import type { AbstractTool, CommandSpec, CommandSurface, EmittedFile, RulesContext } from "../core/types.js";
2
+ import { BaseEmitter } from "./base-emitter.js";
3
+ /**
4
+ * Claude Code emitter. Emits slash commands to `.claude/commands/amby.*.md` and a `CLAUDE.md`
5
+ * bridge that imports `@AGENTS.md` (Claude Code does not read AGENTS.md natively). The VS Code
6
+ * extension shares this exact output.
7
+ */
8
+ export declare class ClaudeEmitter extends BaseEmitter {
9
+ readonly toolId = "claude";
10
+ readonly displayName = "Claude Code";
11
+ readonly commandSurface: CommandSurface;
12
+ readonly commandDir = ".claude/commands";
13
+ protected readonly toolNameMap: Record<AbstractTool, string>;
14
+ protected commandFrontmatter(spec: CommandSpec): Array<[string, string]>;
15
+ protected rulesFiles(_ctx: RulesContext): EmittedFile[];
16
+ }
@@ -0,0 +1,40 @@
1
+ import { BaseEmitter } from "./base-emitter.js";
2
+ /**
3
+ * Claude Code emitter. Emits slash commands to `.claude/commands/amby.*.md` and a `CLAUDE.md`
4
+ * bridge that imports `@AGENTS.md` (Claude Code does not read AGENTS.md natively). The VS Code
5
+ * extension shares this exact output.
6
+ */
7
+ export class ClaudeEmitter extends BaseEmitter {
8
+ toolId = "claude";
9
+ displayName = "Claude Code";
10
+ commandSurface = "commands";
11
+ commandDir = ".claude/commands";
12
+ toolNameMap = {
13
+ read: "Read",
14
+ write: "Write",
15
+ edit: "Edit",
16
+ bash: "Bash",
17
+ };
18
+ commandFrontmatter(spec) {
19
+ return [
20
+ ["description", this.yamlQuote(spec.description)],
21
+ ["argument-hint", this.yamlQuote(spec.argumentHint)],
22
+ ["allowed-tools", this.mappedTools(spec)],
23
+ ];
24
+ }
25
+ rulesFiles(_ctx) {
26
+ const contents = `@AGENTS.md
27
+
28
+ # Claude Code
29
+
30
+ The shared, tool-neutral guidance is in \`@AGENTS.md\` above (imported). Claude Code does not read
31
+ \`AGENTS.md\` natively — the import on the first line is the bridge, so keep it there.
32
+
33
+ The AmbyKit workflow is available as \`/amby.*\` slash commands in \`.claude/commands/\`.
34
+
35
+ <!-- Managed by AmbyKit. Regenerate with \`ambykit sync\`. -->
36
+ `;
37
+ return [{ path: "CLAUDE.md", contents, scope: "project" }];
38
+ }
39
+ }
40
+ //# sourceMappingURL=claude.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claude.js","sourceRoot":"","sources":["../../src/emitters/claude.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;GAIG;AACH,MAAM,OAAO,aAAc,SAAQ,WAAW;IACnC,MAAM,GAAG,QAAQ,CAAC;IAClB,WAAW,GAAG,aAAa,CAAC;IAC5B,cAAc,GAAmB,UAAU,CAAC;IAC5C,UAAU,GAAG,kBAAkB,CAAC;IAEb,WAAW,GAAiC;QACtE,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,MAAM;KACb,CAAC;IAEiB,kBAAkB,CAAC,IAAiB;QACrD,OAAO;YACL,CAAC,aAAa,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YACjD,CAAC,eAAe,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YACpD,CAAC,eAAe,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;SAC1C,CAAC;IACJ,CAAC;IAEkB,UAAU,CAAC,IAAkB;QAC9C,MAAM,QAAQ,GAAG;;;;;;;;;;CAUpB,CAAC;QACE,OAAO,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IAC7D,CAAC;CACF"}
@@ -0,0 +1,18 @@
1
+ import type { CommandSpec, CommandSurface } from "../core/types.js";
2
+ import { CopilotEmitter } from "./copilot.js";
3
+ /**
4
+ * GitHub Copilot CLI (`copilot`) emitter. Reuses Copilot's `.github/` rules/instructions, but the
5
+ * CLI has no prompt-file surface — its file-based extension point is **skills**. Each phase becomes
6
+ * a skill at `.github/skills/amby-<id>/SKILL.md`. MCP for the CLI is a user-level file
7
+ * (`~/.copilot/mcp-config.json`), which AmbyKit only writes with explicit consent (not emitted here).
8
+ */
9
+ export declare class CopilotCliEmitter extends CopilotEmitter {
10
+ readonly toolId = "copilot-cli";
11
+ readonly displayName = "GitHub Copilot CLI";
12
+ readonly commandSurface: CommandSurface;
13
+ readonly commandDir: string;
14
+ /** Skill id: lowercase-hyphen, e.g. amby.specify → amby-specify. */
15
+ private skillName;
16
+ protected commandFilePath(spec: CommandSpec): string;
17
+ protected commandFrontmatter(spec: CommandSpec): Array<[string, string]>;
18
+ }
@@ -0,0 +1,28 @@
1
+ import { join } from "node:path";
2
+ import { CopilotEmitter } from "./copilot.js";
3
+ /**
4
+ * GitHub Copilot CLI (`copilot`) emitter. Reuses Copilot's `.github/` rules/instructions, but the
5
+ * CLI has no prompt-file surface — its file-based extension point is **skills**. Each phase becomes
6
+ * a skill at `.github/skills/amby-<id>/SKILL.md`. MCP for the CLI is a user-level file
7
+ * (`~/.copilot/mcp-config.json`), which AmbyKit only writes with explicit consent (not emitted here).
8
+ */
9
+ export class CopilotCliEmitter extends CopilotEmitter {
10
+ toolId = "copilot-cli";
11
+ displayName = "GitHub Copilot CLI";
12
+ commandSurface = "skills";
13
+ commandDir = join(".github", "skills");
14
+ /** Skill id: lowercase-hyphen, e.g. amby.specify → amby-specify. */
15
+ skillName(spec) {
16
+ return spec.name.replace(/\./g, "-").toLowerCase();
17
+ }
18
+ commandFilePath(spec) {
19
+ return join(this.commandDir, this.skillName(spec), "SKILL.md");
20
+ }
21
+ commandFrontmatter(spec) {
22
+ return [
23
+ ["name", this.skillName(spec)],
24
+ ["description", this.yamlQuote(spec.description)],
25
+ ];
26
+ }
27
+ }
28
+ //# sourceMappingURL=copilot-cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copilot-cli.js","sourceRoot":"","sources":["../../src/emitters/copilot-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,OAAO,iBAAkB,SAAQ,cAAc;IACjC,MAAM,GAAG,aAAa,CAAC;IACvB,WAAW,GAAG,oBAAoB,CAAC;IACnC,cAAc,GAAmB,QAAQ,CAAC;IAC1C,UAAU,GAAG,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAEzD,oEAAoE;IAC5D,SAAS,CAAC,IAAiB;QACjC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;IACrD,CAAC;IAEkB,eAAe,CAAC,IAAiB;QAClD,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,CAAC;IACjE,CAAC;IAEkB,kBAAkB,CAAC,IAAiB;QACrD,OAAO;YACL,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YAC9B,CAAC,aAAa,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SAClD,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,19 @@
1
+ import type { CommandSpec, CommandSurface, EmittedFile, RulesContext } from "../core/types.js";
2
+ import { BaseEmitter } from "./base-emitter.js";
3
+ /**
4
+ * GitHub Copilot (VS Code) emitter. Phase prompts become prompt files at
5
+ * `.github/prompts/*.prompt.md` (invoked as `/amby.*` in Copilot Chat); an always-on
6
+ * `.github/copilot-instructions.md` points at the shared AGENTS.md. Copilot uses `${input:…}` for
7
+ * arguments rather than `$ARGUMENTS`, so bodies are transformed.
8
+ */
9
+ export declare class CopilotEmitter extends BaseEmitter {
10
+ readonly toolId: string;
11
+ readonly displayName: string;
12
+ readonly commandSurface: CommandSurface;
13
+ readonly commandDir: string;
14
+ protected commandFileName(spec: CommandSpec): string;
15
+ protected commandFrontmatter(spec: CommandSpec): Array<[string, string]>;
16
+ /** Copilot substitutes `${input:name}`; map our single `$ARGUMENTS` token to it. */
17
+ protected transformBody(spec: CommandSpec): string;
18
+ protected rulesFiles(_ctx: RulesContext): EmittedFile[];
19
+ }
@@ -0,0 +1,39 @@
1
+ import { join } from "node:path";
2
+ import { BaseEmitter } from "./base-emitter.js";
3
+ /**
4
+ * GitHub Copilot (VS Code) emitter. Phase prompts become prompt files at
5
+ * `.github/prompts/*.prompt.md` (invoked as `/amby.*` in Copilot Chat); an always-on
6
+ * `.github/copilot-instructions.md` points at the shared AGENTS.md. Copilot uses `${input:…}` for
7
+ * arguments rather than `$ARGUMENTS`, so bodies are transformed.
8
+ */
9
+ export class CopilotEmitter extends BaseEmitter {
10
+ toolId = "copilot";
11
+ displayName = "GitHub Copilot (VS Code)";
12
+ commandSurface = "commands";
13
+ commandDir = join(".github", "prompts");
14
+ commandFileName(spec) {
15
+ return `${spec.name}.prompt.md`;
16
+ }
17
+ commandFrontmatter(spec) {
18
+ return [
19
+ ["description", this.yamlQuote(spec.description)],
20
+ ["argument-hint", this.yamlQuote(spec.argumentHint)],
21
+ ["agent", "agent"],
22
+ ];
23
+ }
24
+ /** Copilot substitutes `${input:name}`; map our single `$ARGUMENTS` token to it. */
25
+ transformBody(spec) {
26
+ return spec.body.replaceAll("$ARGUMENTS", "${input:args}");
27
+ }
28
+ rulesFiles(_ctx) {
29
+ const contents = `# GitHub Copilot instructions
30
+
31
+ This project uses **AmbyKit** for Spec-Driven Development. Follow the workflow and rules in
32
+ \`AGENTS.md\` (repository root). The \`/amby.*\` prompts under \`.github/prompts/\` drive the phases.
33
+
34
+ <!-- Managed by AmbyKit. Regenerate with \`ambykit sync\`. -->
35
+ `;
36
+ return [{ path: join(".github", "copilot-instructions.md"), contents, scope: "project" }];
37
+ }
38
+ }
39
+ //# sourceMappingURL=copilot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copilot.js","sourceRoot":"","sources":["../../src/emitters/copilot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,OAAO,cAAe,SAAQ,WAAW;IACpC,MAAM,GAAW,SAAS,CAAC;IAC3B,WAAW,GAAW,0BAA0B,CAAC;IACjD,cAAc,GAAmB,UAAU,CAAC;IAC5C,UAAU,GAAW,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAEtC,eAAe,CAAC,IAAiB;QAClD,OAAO,GAAG,IAAI,CAAC,IAAI,YAAY,CAAC;IAClC,CAAC;IAEkB,kBAAkB,CAAC,IAAiB;QACrD,OAAO;YACL,CAAC,aAAa,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YACjD,CAAC,eAAe,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YACpD,CAAC,OAAO,EAAE,OAAO,CAAC;SACnB,CAAC;IACJ,CAAC;IAED,oFAAoF;IACjE,aAAa,CAAC,IAAiB;QAChD,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;IAC7D,CAAC;IAEkB,UAAU,CAAC,IAAkB;QAC9C,MAAM,QAAQ,GAAG;;;;;;CAMpB,CAAC;QACE,OAAO,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,yBAAyB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IAC5F,CAAC;CACF"}
@@ -0,0 +1,12 @@
1
+ import type { CommandSurface } from "../core/types.js";
2
+ import { CursorEmitter } from "./cursor.js";
3
+ /**
4
+ * Cursor CLI (`cursor-agent`) emitter. The CLI shares Cursor's config but has no slash-command
5
+ * surface — it is rules-only. So it reuses `CursorEmitter`'s `.cursor/rules/*.mdc` (and the shared
6
+ * AGENTS.md) and emits no command files.
7
+ */
8
+ export declare class CursorCliEmitter extends CursorEmitter {
9
+ readonly toolId = "cursor-cli";
10
+ readonly displayName = "Cursor CLI";
11
+ readonly commandSurface: CommandSurface;
12
+ }
@@ -0,0 +1,12 @@
1
+ import { CursorEmitter } from "./cursor.js";
2
+ /**
3
+ * Cursor CLI (`cursor-agent`) emitter. The CLI shares Cursor's config but has no slash-command
4
+ * surface — it is rules-only. So it reuses `CursorEmitter`'s `.cursor/rules/*.mdc` (and the shared
5
+ * AGENTS.md) and emits no command files.
6
+ */
7
+ export class CursorCliEmitter extends CursorEmitter {
8
+ toolId = "cursor-cli";
9
+ displayName = "Cursor CLI";
10
+ commandSurface = "none";
11
+ }
12
+ //# sourceMappingURL=cursor-cli.js.map