@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 @@
1
+ {"version":3,"file":"cursor-cli.js","sourceRoot":"","sources":["../../src/emitters/cursor-cli.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C;;;;GAIG;AACH,MAAM,OAAO,gBAAiB,SAAQ,aAAa;IAC/B,MAAM,GAAG,YAAY,CAAC;IACtB,WAAW,GAAG,YAAY,CAAC;IAC3B,cAAc,GAAmB,MAAM,CAAC;CAC3D"}
@@ -0,0 +1,16 @@
1
+ import type { CommandSpec, CommandSurface, EmittedFile, RulesContext } from "../core/types.js";
2
+ import { BaseEmitter } from "./base-emitter.js";
3
+ /**
4
+ * Cursor emitter. Commands go to `.cursor/commands/*.md` as plain prompt bodies (Cursor documents no
5
+ * command frontmatter schema). An always-applied `.cursor/rules/ambykit.mdc` points at AGENTS.md
6
+ * (which Cursor also reads natively).
7
+ */
8
+ export declare class CursorEmitter extends BaseEmitter {
9
+ readonly toolId: string;
10
+ readonly displayName: string;
11
+ readonly commandSurface: CommandSurface;
12
+ readonly commandDir: string;
13
+ /** Cursor commands are plain markdown — no frontmatter. */
14
+ protected commandFrontmatter(_spec: CommandSpec): Array<[string, string]>;
15
+ protected rulesFiles(_ctx: RulesContext): EmittedFile[];
16
+ }
@@ -0,0 +1,30 @@
1
+ import { join } from "node:path";
2
+ import { BaseEmitter } from "./base-emitter.js";
3
+ /**
4
+ * Cursor emitter. Commands go to `.cursor/commands/*.md` as plain prompt bodies (Cursor documents no
5
+ * command frontmatter schema). An always-applied `.cursor/rules/ambykit.mdc` points at AGENTS.md
6
+ * (which Cursor also reads natively).
7
+ */
8
+ export class CursorEmitter extends BaseEmitter {
9
+ toolId = "cursor";
10
+ displayName = "Cursor";
11
+ commandSurface = "commands";
12
+ commandDir = join(".cursor", "commands");
13
+ /** Cursor commands are plain markdown — no frontmatter. */
14
+ commandFrontmatter(_spec) {
15
+ return [];
16
+ }
17
+ rulesFiles(_ctx) {
18
+ const contents = `---
19
+ description: AmbyKit Spec-Driven Development workflow
20
+ alwaysApply: true
21
+ ---
22
+ This project uses **AmbyKit** for Spec-Driven Development. Follow the workflow and rules in
23
+ \`AGENTS.md\` (repository root). Use the \`/amby.*\` commands in \`.cursor/commands/\` to run each phase.
24
+
25
+ <!-- Managed by AmbyKit. Regenerate with \`ambykit sync\`. -->
26
+ `;
27
+ return [{ path: join(".cursor", "rules", "ambykit.mdc"), contents, scope: "project" }];
28
+ }
29
+ }
30
+ //# sourceMappingURL=cursor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../src/emitters/cursor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;GAIG;AACH,MAAM,OAAO,aAAc,SAAQ,WAAW;IACnC,MAAM,GAAW,QAAQ,CAAC;IAC1B,WAAW,GAAW,QAAQ,CAAC;IAC/B,cAAc,GAAmB,UAAU,CAAC;IAC5C,UAAU,GAAW,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAE1D,2DAA2D;IACxC,kBAAkB,CAAC,KAAkB;QACtD,OAAO,EAAE,CAAC;IACZ,CAAC;IAEkB,UAAU,CAAC,IAAkB;QAC9C,MAAM,QAAQ,GAAG;;;;;;;;CAQpB,CAAC;QACE,OAAO,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,aAAa,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IACzF,CAAC;CACF"}
@@ -0,0 +1,28 @@
1
+ import type { BaseEmitter } from "./base-emitter.js";
2
+ export { BaseEmitter } from "./base-emitter.js";
3
+ export { ClaudeEmitter } from "./claude.js";
4
+ export { CopilotEmitter } from "./copilot.js";
5
+ export { CopilotCliEmitter } from "./copilot-cli.js";
6
+ export { OpenCodeEmitter } from "./opencode.js";
7
+ export { CursorEmitter } from "./cursor.js";
8
+ export { CursorCliEmitter } from "./cursor-cli.js";
9
+ export { AntigravityEmitter } from "./antigravity.js";
10
+ export { AntigravityCliEmitter } from "./antigravity-cli.js";
11
+ /** A user-selectable target and the emitter it resolves to. */
12
+ export interface TargetDef {
13
+ /** Selectable id used on the CLI and in config. */
14
+ id: string;
15
+ displayName: string;
16
+ /** Emitter instance that produces this target's files. */
17
+ emitter: BaseEmitter;
18
+ /** True for targets that reuse another target's emitter output (e.g. VS Code extensions). */
19
+ alias?: boolean;
20
+ }
21
+ /**
22
+ * Registry of selectable targets → emitters. Several targets can share one emitter (VS Code
23
+ * extensions, CLIs that reuse a sibling's output). Adding a tool is a new emitter + entries here.
24
+ */
25
+ export declare const TARGETS: TargetDef[];
26
+ export declare function getTarget(id: string): TargetDef | undefined;
27
+ /** Distinct emitters for a set of target ids (deduped, so shared emitters emit once). */
28
+ export declare function emittersForTargets(ids: string[]): BaseEmitter[];
@@ -0,0 +1,59 @@
1
+ import { ClaudeEmitter } from "./claude.js";
2
+ import { CopilotEmitter } from "./copilot.js";
3
+ import { CopilotCliEmitter } from "./copilot-cli.js";
4
+ import { OpenCodeEmitter } from "./opencode.js";
5
+ import { CursorEmitter } from "./cursor.js";
6
+ import { CursorCliEmitter } from "./cursor-cli.js";
7
+ import { AntigravityEmitter } from "./antigravity.js";
8
+ import { AntigravityCliEmitter } from "./antigravity-cli.js";
9
+ export { BaseEmitter } from "./base-emitter.js";
10
+ export { ClaudeEmitter } from "./claude.js";
11
+ export { CopilotEmitter } from "./copilot.js";
12
+ export { CopilotCliEmitter } from "./copilot-cli.js";
13
+ export { OpenCodeEmitter } from "./opencode.js";
14
+ export { CursorEmitter } from "./cursor.js";
15
+ export { CursorCliEmitter } from "./cursor-cli.js";
16
+ export { AntigravityEmitter } from "./antigravity.js";
17
+ export { AntigravityCliEmitter } from "./antigravity-cli.js";
18
+ const claude = new ClaudeEmitter();
19
+ const copilot = new CopilotEmitter();
20
+ const copilotCli = new CopilotCliEmitter();
21
+ const opencode = new OpenCodeEmitter();
22
+ const cursor = new CursorEmitter();
23
+ const cursorCli = new CursorCliEmitter();
24
+ const antigravity = new AntigravityEmitter();
25
+ const antigravityCli = new AntigravityCliEmitter();
26
+ /**
27
+ * Registry of selectable targets → emitters. Several targets can share one emitter (VS Code
28
+ * extensions, CLIs that reuse a sibling's output). Adding a tool is a new emitter + entries here.
29
+ */
30
+ export const TARGETS = [
31
+ { id: "claude", displayName: "Claude Code (CLI)", emitter: claude },
32
+ { id: "claude-vscode", displayName: "Claude Code (VS Code)", emitter: claude, alias: true },
33
+ { id: "copilot", displayName: "GitHub Copilot (VS Code)", emitter: copilot },
34
+ { id: "copilot-cli", displayName: "GitHub Copilot CLI", emitter: copilotCli },
35
+ { id: "opencode", displayName: "OpenCode", emitter: opencode },
36
+ { id: "cursor", displayName: "Cursor", emitter: cursor },
37
+ { id: "cursor-cli", displayName: "Cursor CLI", emitter: cursorCli },
38
+ { id: "antigravity", displayName: "Antigravity (IDE)", emitter: antigravity },
39
+ { id: "antigravity-cli", displayName: "Antigravity CLI", emitter: antigravityCli },
40
+ ];
41
+ export function getTarget(id) {
42
+ return TARGETS.find((t) => t.id === id);
43
+ }
44
+ /** Distinct emitters for a set of target ids (deduped, so shared emitters emit once). */
45
+ export function emittersForTargets(ids) {
46
+ const seen = new Set();
47
+ const out = [];
48
+ for (const id of ids) {
49
+ const target = getTarget(id);
50
+ if (!target)
51
+ continue;
52
+ if (seen.has(target.emitter.toolId))
53
+ continue;
54
+ seen.add(target.emitter.toolId);
55
+ out.push(target.emitter);
56
+ }
57
+ return out;
58
+ }
59
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/emitters/index.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,14 @@
1
+ import type { CommandSpec, CommandSurface } from "../core/types.js";
2
+ import { BaseEmitter } from "./base-emitter.js";
3
+ /**
4
+ * OpenCode emitter. Commands go to `.opencode/commands/*.md` (plural dir; invoked as `/amby.*`).
5
+ * OpenCode reads AGENTS.md natively, so no tool-specific rules file is needed. `$ARGUMENTS` is
6
+ * supported natively, so bodies are emitted verbatim.
7
+ */
8
+ export declare class OpenCodeEmitter extends BaseEmitter {
9
+ readonly toolId = "opencode";
10
+ readonly displayName = "OpenCode";
11
+ readonly commandSurface: CommandSurface;
12
+ readonly commandDir: string;
13
+ protected commandFrontmatter(spec: CommandSpec): Array<[string, string]>;
14
+ }
@@ -0,0 +1,17 @@
1
+ import { join } from "node:path";
2
+ import { BaseEmitter } from "./base-emitter.js";
3
+ /**
4
+ * OpenCode emitter. Commands go to `.opencode/commands/*.md` (plural dir; invoked as `/amby.*`).
5
+ * OpenCode reads AGENTS.md natively, so no tool-specific rules file is needed. `$ARGUMENTS` is
6
+ * supported natively, so bodies are emitted verbatim.
7
+ */
8
+ export class OpenCodeEmitter extends BaseEmitter {
9
+ toolId = "opencode";
10
+ displayName = "OpenCode";
11
+ commandSurface = "commands";
12
+ commandDir = join(".opencode", "commands");
13
+ commandFrontmatter(spec) {
14
+ return [["description", this.yamlQuote(spec.description)]];
15
+ }
16
+ }
17
+ //# sourceMappingURL=opencode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opencode.js","sourceRoot":"","sources":["../../src/emitters/opencode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;GAIG;AACH,MAAM,OAAO,eAAgB,SAAQ,WAAW;IACrC,MAAM,GAAG,UAAU,CAAC;IACpB,WAAW,GAAG,UAAU,CAAC;IACzB,cAAc,GAAmB,UAAU,CAAC;IAC5C,UAAU,GAAG,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IAEjC,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,3 @@
1
+ /** Library entry point — re-exports the core model and emitters for programmatic use. */
2
+ export * from "./core/index.js";
3
+ export * from "./emitters/index.js";
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ /** Library entry point — re-exports the core model and emitters for programmatic use. */
2
+ export * from "./core/index.js";
3
+ export * from "./emitters/index.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "@ambystech/ambykit",
3
+ "version": "0.1.0",
4
+ "description": "Spec-Driven Development framework that helps AI coding assistants build better software — author your specs, user stories, UI design, plans and tasks once, and emit native config for Claude Code, OpenCode, GitHub Copilot, Cursor, Antigravity and more.",
5
+ "keywords": [
6
+ "spec-driven-development",
7
+ "sdd",
8
+ "ai",
9
+ "coding-assistant",
10
+ "claude-code",
11
+ "opencode",
12
+ "copilot",
13
+ "cursor",
14
+ "antigravity",
15
+ "agents.md"
16
+ ],
17
+ "license": "MIT",
18
+ "author": "ambystech",
19
+ "publisher": "Ambystech",
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/ambystechcom/AmbyKit.git"
23
+ },
24
+ "homepage": "https://github.com/ambystechcom/AmbyKit#readme",
25
+ "bugs": {
26
+ "url": "https://github.com/ambystechcom/AmbyKit/issues"
27
+ },
28
+ "type": "module",
29
+ "bin": {
30
+ "ambykit": "dist/cli/index.js"
31
+ },
32
+ "exports": {
33
+ ".": "./dist/index.js"
34
+ },
35
+ "files": [
36
+ "dist",
37
+ "src/templates",
38
+ "src/prompts",
39
+ "src/reference",
40
+ "README.md"
41
+ ],
42
+ "engines": {
43
+ "node": ">=20"
44
+ },
45
+ "scripts": {
46
+ "build": "tsc -p tsconfig.json",
47
+ "dev": "tsc -p tsconfig.json --watch",
48
+ "typecheck": "tsc -p tsconfig.json --noEmit",
49
+ "test": "vitest run",
50
+ "test:watch": "vitest",
51
+ "prepublishOnly": "npm run build"
52
+ },
53
+ "publishConfig": {
54
+ "access": "public"
55
+ },
56
+ "devDependencies": {
57
+ "typescript": "^5.6.0",
58
+ "vitest": "^2.1.0",
59
+ "@types/node": "^20.14.0"
60
+ },
61
+ "dependencies": {
62
+ "gray-matter": "^4.0.3",
63
+ "zod": "^3.23.0"
64
+ },
65
+ "allowScripts": {
66
+ "esbuild@0.21.5": true
67
+ }
68
+ }
@@ -0,0 +1,26 @@
1
+ ---
2
+ id: analyze
3
+ name: amby.analyze
4
+ description: Cross-check spec, plan, and tasks for coverage, consistency, and dependency-graph health.
5
+ argument-hint: "[feature id, defaults to current]"
6
+ phase: analyze
7
+ reads: [specs/NNN-slug/spec.md, specs/NNN-slug/plan.md, specs/NNN-slug/tasks.md]
8
+ writes: []
9
+ allowedTools: [read]
10
+ ---
11
+
12
+ Analyze feature `$ARGUMENTS` (default: the current feature) for consistency. Read-only — report, don't edit.
13
+
14
+ Check and report:
15
+
16
+ 1. **Coverage:** every `FR-###`/`US-#` in the spec is addressed by the plan and has at least one
17
+ task; every task maps to a real `US-#`. List orphans and gaps.
18
+ 2. **Consistency:** plan/tasks introduce no requirements absent from the spec (scope creep); UI
19
+ sign-off is present if the feature has UI.
20
+ 3. **Dependency graph:** validate `depends-on`/`blocked-by` across stories — detect **cycles**,
21
+ dangling references, and orphan stories. Report which stories are currently **blocked** vs
22
+ **buildable now**.
23
+ 4. **Clarity:** any remaining `[NEEDS CLARIFICATION]` markers.
24
+
25
+ Output a short, structured report (tables/bullets). Prefer machine-checkable facts over prose. Do not
26
+ modify any file.
@@ -0,0 +1,21 @@
1
+ ---
2
+ id: clarify
3
+ name: amby.clarify
4
+ description: Resolve the open [NEEDS CLARIFICATION] markers in a feature spec.
5
+ argument-hint: "[feature id, defaults to current]"
6
+ phase: clarify
7
+ reads: [specs/NNN-slug/spec.md]
8
+ writes: [specs/NNN-slug/spec.md]
9
+ allowedTools: [read, edit]
10
+ ---
11
+
12
+ Resolve open questions in the spec for feature `$ARGUMENTS` (default: the current feature).
13
+
14
+ 1. Read only that `spec.md`. Find every `[NEEDS CLARIFICATION: …]` marker.
15
+ 2. For each, ask the user one concise, specific question. Offer a sensible default when one exists.
16
+ 3. **Edit only the affected line(s)** — replace the marker with the resolved wording. Do not rewrite
17
+ the rest of the file (token-frugal, non-destructive).
18
+ 4. If an answer changes a requirement's testability, adjust just that `FR-###` or acceptance line.
19
+ 5. When no markers remain, set the spec `status: ready` and report a one-line summary.
20
+
21
+ Do not add scope. If the user raises new scope, note it as a new `US-#` rather than expanding others.
@@ -0,0 +1,22 @@
1
+ ---
2
+ id: constitution
3
+ name: amby.constitution
4
+ description: Create or amend the project constitution — durable, cross-feature principles.
5
+ argument-hint: "[area to add or change, optional]"
6
+ phase: constitution
7
+ reads: []
8
+ writes: [.amby/constitution.md]
9
+ allowedTools: [read, write, edit]
10
+ ---
11
+
12
+ Establish or update the project **constitution** at `.amby/constitution.md`.
13
+
14
+ 1. If the file is missing, create it from `@.amby/templates/constitution.md` and fill it in. If it
15
+ exists, amend only the section relevant to `$ARGUMENTS` (or, with no argument, review all principles briefly).
16
+ 2. Interview the user only where a principle is unclear — ask one focused question at a time.
17
+ 3. Keep each principle short, imperative, and **numbered** so later phases can cite it.
18
+ 4. Cover: code quality, testing standards, UX consistency, performance/reliability, security. Add
19
+ project-specific non-negotiables as needed.
20
+ 5. Bump the version and update the date. Do not restate feature requirements — those belong in specs.
21
+
22
+ Output only the edited constitution. Be concise.
@@ -0,0 +1,27 @@
1
+ ---
2
+ id: design
3
+ name: amby.design
4
+ description: Design the UI — wireframes, component specs, and design tokens — with a sign-off gate.
5
+ argument-hint: "[feature id, defaults to current]"
6
+ phase: design
7
+ reads: [specs/NNN-slug/spec.md]
8
+ writes: [specs/NNN-slug/ui.md, specs/NNN-slug/design-tokens.json]
9
+ allowedTools: [read, write, edit]
10
+ ---
11
+
12
+ Design the UI for feature `$ARGUMENTS` (default: the current feature).
13
+
14
+ Context: read that feature's `spec.md`, the templates `@.amby/templates/ui.md` +
15
+ `@.amby/templates/design-tokens.json`, and — for detailed rules — `@.amby/reference/design-conventions.md`.
16
+ Design for the spec's user stories.
17
+
18
+ 1. Write `ui.md` following the template: per story, a layout/wireframe (ASCII or embedded SVG), a
19
+ component inventory (props + full state set + token names), interaction criteria in
20
+ Given/When/Then tied to the `US-#`, and content/accessibility notes (WCAG AA).
21
+ 2. Write/extend `design-tokens.json` in three tiers — primitive → semantic → component. In `ui.md`
22
+ cite semantic/component token **names**, never raw values.
23
+ 3. Keep the UI consistent with any constitution UX principle (cite by number).
24
+ 4. **Sign-off gate:** present the design and ask the user to approve. On approval, check the sign-off
25
+ box and set `signed_off: true` (with reviewer + date) in the frontmatter. Until then it's a draft.
26
+
27
+ Downstream phases treat a signed-off UI as binding.
@@ -0,0 +1,23 @@
1
+ ---
2
+ id: implement
3
+ name: amby.implement
4
+ description: Execute the task list, checking off tasks and updating story status as you go.
5
+ argument-hint: "[task id or story id, defaults to next unblocked]"
6
+ phase: implement
7
+ reads: [specs/NNN-slug/tasks.md, specs/NNN-slug/plan.md]
8
+ writes: [specs/NNN-slug/tasks.md, specs/NNN-slug/spec.md]
9
+ allowedTools: [read, write, edit, bash]
10
+ ---
11
+
12
+ Implement work for `$ARGUMENTS` (default: the next unblocked task in priority order).
13
+
14
+ 1. From `tasks.md`, pick the target task(s). Respect the Foundational-before-features gate and the
15
+ story dependency graph — never start a task whose story is `blocked-by` unfinished work.
16
+ 2. Load **only** the slice you need: the task line, the relevant `plan.md` section, and the specific
17
+ files named. Don't read the whole spec tree (token-frugal).
18
+ 3. Implement to satisfy the mapped `FR-###`/acceptance criteria and the constitution. Add/adjust
19
+ tests for the acceptance criteria.
20
+ 4. **Patch in place:** flip the completed task's checkbox to `- [x]` in `tasks.md`; when all of a
21
+ story's tasks are done, set that story's `status: done` in `spec.md` (or `in-progress` while
22
+ partway). Don't rewrite untouched sections.
23
+ 5. Report what you did and the next unblocked task. Stop at a story checkpoint for review.
@@ -0,0 +1,26 @@
1
+ ---
2
+ id: plan
3
+ name: amby.plan
4
+ description: Produce the technical implementation plan (the HOW) from an approved spec and UI.
5
+ argument-hint: "[feature id, defaults to current]"
6
+ phase: plan
7
+ reads: [specs/NNN-slug/spec.md, specs/NNN-slug/ui.md, .amby/constitution.md]
8
+ writes: [specs/NNN-slug/plan.md, specs/NNN-slug/data-model.md, specs/NNN-slug/contracts/]
9
+ allowedTools: [read, write, edit]
10
+ ---
11
+
12
+ Write the implementation plan for feature `$ARGUMENTS` (default: the current feature).
13
+
14
+ Context: read that feature's `spec.md` and `ui.md`, plus `@.amby/constitution.md`.
15
+
16
+ 1. Write `plan.md` following `@.amby/templates/plan.md`: technical context (stack, libraries,
17
+ constraints), architecture, and a phased approach (Phase 0 research → Phase 1 foundation → feature phases).
18
+ 2. This is the **first artifact with technology decisions.** Ensure every choice honors the
19
+ constitution (cite principle numbers).
20
+ 3. Map each `FR-###`/`US-#` to how the design satisfies it. **Reference by ID — do not restate the
21
+ spec.** Flag any requirement you can't satisfy as a risk.
22
+ 4. Generate supporting artifacts only if needed: `data-model.md` (entities/invariants),
23
+ `contracts/` (API/interface specs), `research.md` (decisions with rationale).
24
+ 5. Do not invent requirements not in the spec; if you find a gap, note it and suggest a `clarify`.
25
+
26
+ Keep the plan lean; link to spec/UI rather than duplicating.
@@ -0,0 +1,28 @@
1
+ ---
2
+ id: specify
3
+ name: amby.specify
4
+ description: Turn a feature idea into a spec — user stories, EARS requirements, acceptance criteria.
5
+ argument-hint: "<feature description>"
6
+ phase: specify
7
+ reads: [.amby/constitution.md]
8
+ writes: [specs/NNN-slug/spec.md]
9
+ allowedTools: [read, write, edit]
10
+ ---
11
+
12
+ Write a specification for: **$ARGUMENTS**
13
+
14
+ Context: read `@.amby/constitution.md` and the structure of `@.amby/templates/spec.md` only. Do not
15
+ read other specs.
16
+
17
+ 1. Create the feature dir `specs/NNN-slug/` (next number, kebab-slug from the title) and write
18
+ `spec.md` following `@.amby/templates/spec.md`.
19
+ 2. Define **user stories** (`US-#`): role / capability / benefit, a priority (P1/P2/P3), why that
20
+ priority, an independent-test statement, and `depends-on`/`blocked-by` if any. Set `status: draft`.
21
+ 3. Write **acceptance criteria** in Given/When/Then per story.
22
+ 4. Write **functional requirements** (`FR-###`) in EARS notation (SHALL / WHEN / WHILE / IF-THEN /
23
+ WHERE). Each must be testable.
24
+ 5. Write measurable, tech-agnostic **success criteria** (`SC-###`).
25
+ 6. **Capture WHAT/WHY only — no technology choices.** Flag every unknown inline as
26
+ `[NEEDS CLARIFICATION: …]` instead of guessing.
27
+
28
+ Keep it tight. Reference the constitution by principle number where relevant; don't restate it.
@@ -0,0 +1,24 @@
1
+ ---
2
+ id: tasks
3
+ name: amby.tasks
4
+ description: Break the plan into an ordered, dependency-aware task checklist.
5
+ argument-hint: "[feature id, defaults to current]"
6
+ phase: tasks
7
+ reads: [specs/NNN-slug/plan.md, specs/NNN-slug/spec.md]
8
+ writes: [specs/NNN-slug/tasks.md]
9
+ allowedTools: [read, write, edit]
10
+ ---
11
+
12
+ Generate `tasks.md` for feature `$ARGUMENTS` (default: the current feature).
13
+
14
+ Context: read that feature's `plan.md` (and `spec.md` for story IDs/priorities/dependencies).
15
+
16
+ 1. Write tasks following `@.amby/templates/tasks.md` as checkbox lines:
17
+ `- [ ] [T###] [P?] [US#] description (file/path)`.
18
+ 2. Group into phases: **Setup → Foundational → User stories (by priority) → Polish**. Enforce the
19
+ gate: no user-story task before Foundational completes.
20
+ 3. Order tasks by the story **dependency graph** (`depends-on`/`blocked-by`) and priority. Mark
21
+ independent tasks `[P]`. Tag each task with its `[US#]`. End each story group with a checkpoint.
22
+ 4. Give every task a stable `T###` id and a concrete file path.
23
+
24
+ Do not start implementing. Keep descriptions to one line each.
@@ -0,0 +1,58 @@
1
+ # AmbyKit UI Design Conventions
2
+
3
+ > On-demand reference for `/amby.design`. Load this only when producing `ui.md` / `design-tokens.json`,
4
+ > so the design phase stays token-frugal.
5
+
6
+ ## Wireframe notation (ASCII)
7
+
8
+ Use a compact box-drawing sketch that shows structure and hierarchy, not pixels:
9
+
10
+ ```
11
+ +------------------------------------------+
12
+ | [logo] (Sign in) | <- header
13
+ +------------------------------------------+
14
+ | H1 Reset your password |
15
+ | ( email__________________________ ) | <- text input
16
+ | [ Send reset link ] | <- primary button
17
+ | » Back to sign in | <- link
18
+ +------------------------------------------+
19
+ ```
20
+
21
+ Conventions: `( … )` input, `[ … ]` button, `» …` link, `H1/H2` headings, `<- note` annotations.
22
+ Embed an `<svg>` instead when precise layout matters; keep it self-contained.
23
+
24
+ ## Component spec
25
+
26
+ For each component list exactly:
27
+
28
+ - **props** — name and type (e.g. `value: string`, `onSubmit: () => void`).
29
+ - **states** — cover the full set that applies: `default, hover, focus, active, disabled, loading,
30
+ error, empty, selected`.
31
+ - **tokens** — the semantic/component token names it consumes (never raw hex/px here).
32
+ - **behavior** — 1–3 Given/When/Then lines tied to the story's `US-#`.
33
+
34
+ ## Design tokens (three tiers)
35
+
36
+ Author `design-tokens.json` so decisions compose and stay consistent:
37
+
38
+ 1. **primitive** — raw values only (palette, spacing scale, radii, type). No usage meaning.
39
+ 2. **semantic** — usage aliases that reference primitives: `color.action`, `color.danger`,
40
+ `space.md`, `text.muted`.
41
+ 3. **component** — per-component values that reference semantics: `button.primary.bg`.
42
+
43
+ Reference with `{tier.path}` (e.g. `"{semantic.color.action}"`). Components and `ui.md` cite semantic
44
+ or component tokens — never primitives directly.
45
+
46
+ ## Accessibility checklist (WCAG AA)
47
+
48
+ - Contrast ≥ 4.5:1 for text (3:1 for large text / UI affordances).
49
+ - Every interactive element is keyboard-reachable; visible focus state defined.
50
+ - Inputs have labels; errors are announced (not color-only).
51
+ - Logical focus/tab order; landmarks/roles where structure needs them.
52
+ - Design the empty, loading, and error states — not just the happy path.
53
+
54
+ ## Sign-off
55
+
56
+ The design is a draft until reviewed. On approval, `/amby.design` sets `signed_off: true` (with
57
+ reviewer + date) in the `ui.md` frontmatter; downstream phases then treat the layout, components, and
58
+ tokens as binding constraints.
@@ -0,0 +1,29 @@
1
+ # Project Constitution — {{PROJECT_NAME}}
2
+
3
+ > Durable, cross-feature principles that every AmbyKit phase must honor. Written once, revised rarely.
4
+ > Cite principles by number in specs, plans, and reviews (e.g. "per Principle 3").
5
+
6
+ **Version:** {{VERSION}} · **Last updated:** {{DATE}}
7
+
8
+ ## Principle 1 — Code quality
9
+ {{CODE_QUALITY_PRINCIPLE}}
10
+ <!-- e.g. Code is reviewed before merge; no function exceeds one clear responsibility; public APIs are documented. -->
11
+
12
+ ## Principle 2 — Testing standards
13
+ {{TESTING_PRINCIPLE}}
14
+ <!-- e.g. Every functional requirement maps to a test; features ship with automated coverage of their acceptance criteria. -->
15
+
16
+ ## Principle 3 — UX consistency
17
+ {{UX_PRINCIPLE}}
18
+ <!-- e.g. Follows the design-token system; meets WCAG AA; empty/error/loading states are always designed. -->
19
+
20
+ ## Principle 4 — Performance & reliability
21
+ {{PERFORMANCE_PRINCIPLE}}
22
+ <!-- e.g. User-facing actions respond within 200ms p95; no unbounded queries. -->
23
+
24
+ ## Principle 5 — Security & compliance
25
+ {{SECURITY_PRINCIPLE}}
26
+ <!-- e.g. Secrets never committed; input validated at trust boundaries; least-privilege by default. -->
27
+
28
+ ## Additional principles
29
+ <!-- Add project-specific, non-negotiable constraints here. Keep each short and imperative. -->
@@ -0,0 +1,41 @@
1
+ {
2
+ "$schema": "https://ambystech.dev/schemas/design-tokens.json",
3
+ "primitive": {
4
+ "color": {
5
+ "blue-600": "#2563eb",
6
+ "gray-900": "#111827",
7
+ "gray-500": "#6b7280",
8
+ "gray-100": "#f3f4f6",
9
+ "red-600": "#dc2626",
10
+ "white": "#ffffff"
11
+ },
12
+ "space": { "1": "4px", "2": "8px", "3": "12px", "4": "16px", "6": "24px", "8": "32px" },
13
+ "radius": { "sm": "4px", "md": "8px", "lg": "16px" },
14
+ "font": { "sans": "system-ui, sans-serif", "size-md": "16px", "size-lg": "20px" }
15
+ },
16
+ "semantic": {
17
+ "color": {
18
+ "action": "{primitive.color.blue-600}",
19
+ "text": "{primitive.color.gray-900}",
20
+ "text-muted": "{primitive.color.gray-500}",
21
+ "surface": "{primitive.color.white}",
22
+ "danger": "{primitive.color.red-600}"
23
+ },
24
+ "space": { "sm": "{primitive.space.2}", "md": "{primitive.space.4}", "lg": "{primitive.space.6}" }
25
+ },
26
+ "component": {
27
+ "button": {
28
+ "primary": {
29
+ "bg": "{semantic.color.action}",
30
+ "fg": "{primitive.color.white}",
31
+ "radius": "{primitive.radius.sm}",
32
+ "padding": "{semantic.space.sm} {semantic.space.md}"
33
+ }
34
+ },
35
+ "input": {
36
+ "border": "{semantic.color.text-muted}",
37
+ "radius": "{primitive.radius.sm}",
38
+ "padding": "{semantic.space.sm}"
39
+ }
40
+ }
41
+ }
@@ -0,0 +1,38 @@
1
+ ---
2
+ feature: {{FEATURE_ID}}
3
+ status: draft
4
+ created: {{DATE}}
5
+ ---
6
+
7
+ # Implementation Plan — {{FEATURE_TITLE}}
8
+
9
+ > The HOW. First artifact where technology appears. Must satisfy every `FR-###` in `@spec.md` and
10
+ > honor the `@../../.amby/constitution.md`. Reference spec/UI by ID — do not restate them.
11
+
12
+ ## Technical context
13
+
14
+ - **Stack:** {{STACK}}
15
+ - **Key libraries:** {{LIBRARIES}}
16
+ - **Constraints driving choices:** {{CONSTRAINTS}} # cite constitution principles by number
17
+
18
+ ## Architecture
19
+
20
+ {{ARCHITECTURE_OVERVIEW}}
21
+ <!-- Components, boundaries, interactions. Diagrams welcome. -->
22
+
23
+ ## Phased approach
24
+
25
+ - **Phase 0 — Research:** {{RESEARCH}} → `research.md` (if needed)
26
+ - **Phase 1 — Foundation:** data model + contracts → `data-model.md`, `contracts/`
27
+ - **Phase 2+ — Features:** per user story, in priority/dependency order
28
+
29
+ ## Requirement mapping
30
+
31
+ | Requirement | How it's satisfied |
32
+ |---|---|
33
+ | FR-001 | {{APPROACH}} |
34
+ | US-1 | {{APPROACH}} |
35
+
36
+ ## Risks & decisions
37
+
38
+ - {{DECISION_AND_RATIONALE}}