@ambystech/ambykit 1.0.0 → 1.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 (66) hide show
  1. package/README.md +5 -0
  2. package/dist/cli/check.d.ts +2 -0
  3. package/dist/cli/check.js +39 -0
  4. package/dist/cli/check.js.map +1 -1
  5. package/dist/cli/index.js +2 -0
  6. package/dist/cli/index.js.map +1 -1
  7. package/dist/cli/init.js +17 -3
  8. package/dist/cli/init.js.map +1 -1
  9. package/dist/cli/sync.js +10 -0
  10. package/dist/cli/sync.js.map +1 -1
  11. package/dist/cli/ui/interactive/prompt.d.ts +11 -0
  12. package/dist/cli/ui/interactive/prompt.js +37 -0
  13. package/dist/cli/ui/interactive/prompt.js.map +1 -1
  14. package/dist/cli/worktree.d.ts +18 -0
  15. package/dist/cli/worktree.js +161 -0
  16. package/dist/cli/worktree.js.map +1 -0
  17. package/dist/core/command-spec.js +2 -0
  18. package/dist/core/command-spec.js.map +1 -1
  19. package/dist/core/config.js +1 -0
  20. package/dist/core/config.js.map +1 -1
  21. package/dist/core/emit.js +2 -1
  22. package/dist/core/emit.js.map +1 -1
  23. package/dist/core/git.d.ts +33 -0
  24. package/dist/core/git.js +104 -0
  25. package/dist/core/git.js.map +1 -0
  26. package/dist/core/index.d.ts +3 -0
  27. package/dist/core/index.js +3 -0
  28. package/dist/core/index.js.map +1 -1
  29. package/dist/core/paths.d.ts +2 -0
  30. package/dist/core/paths.js +4 -0
  31. package/dist/core/paths.js.map +1 -1
  32. package/dist/core/roles.d.ts +19 -0
  33. package/dist/core/roles.js +59 -0
  34. package/dist/core/roles.js.map +1 -0
  35. package/dist/core/rules.js +6 -1
  36. package/dist/core/rules.js.map +1 -1
  37. package/dist/core/scaffold.d.ts +2 -0
  38. package/dist/core/scaffold.js +6 -1
  39. package/dist/core/scaffold.js.map +1 -1
  40. package/dist/core/types.d.ts +18 -0
  41. package/dist/core/worktree.d.ts +78 -0
  42. package/dist/core/worktree.js +121 -0
  43. package/dist/core/worktree.js.map +1 -0
  44. package/dist/emitters/base-emitter.d.ts +19 -2
  45. package/dist/emitters/base-emitter.js +43 -3
  46. package/dist/emitters/base-emitter.js.map +1 -1
  47. package/dist/emitters/claude.d.ts +3 -1
  48. package/dist/emitters/claude.js +12 -0
  49. package/dist/emitters/claude.js.map +1 -1
  50. package/dist/emitters/copilot.d.ts +3 -1
  51. package/dist/emitters/copilot.js +11 -0
  52. package/dist/emitters/copilot.js.map +1 -1
  53. package/dist/emitters/opencode.d.ts +3 -1
  54. package/dist/emitters/opencode.js +11 -0
  55. package/dist/emitters/opencode.js.map +1 -1
  56. package/package.json +1 -1
  57. package/src/prompts/analyze.md +1 -0
  58. package/src/prompts/clarify.md +1 -0
  59. package/src/prompts/converge.md +27 -0
  60. package/src/prompts/design.md +1 -0
  61. package/src/prompts/implement.md +1 -0
  62. package/src/prompts/plan.md +1 -0
  63. package/src/prompts/review.md +24 -0
  64. package/src/prompts/revise.md +1 -0
  65. package/src/prompts/specify.md +6 -2
  66. package/src/prompts/tasks.md +1 -0
@@ -1,4 +1,4 @@
1
- import type { AbstractTool, CommandSpec, CommandSurface, EmittedFile, RulesContext } from "../core/types.js";
1
+ import type { Role, AbstractTool, CommandSpec, CommandSurface, EmittedFile, RulesContext } from "../core/types.js";
2
2
  /**
3
3
  * Abstract base for all tool emitters. Holds the shared orchestration (the `emit` template method)
4
4
  * and rendering helpers; subclasses override only what differs for their tool. Adding a tool should
@@ -17,6 +17,16 @@ export declare abstract class BaseEmitter {
17
17
  protected readonly toolNameMap: Record<AbstractTool, string>;
18
18
  /** Template method: orchestrates a full emit. Subclasses do not override this. */
19
19
  emit(specs: CommandSpec[], ctx: RulesContext): EmittedFile[];
20
+ /**
21
+ * Native persona/sub-agent files, one per role (feature 013, FR-009). Default: none — only
22
+ * targets whose agent-file format is verified in `docs/tool-compatibility.md` override this.
23
+ */
24
+ protected roleFiles(_roles: Role[], _ctx: RulesContext): EmittedFile[];
25
+ /** Persona file name stem shared by every native format: `amby-<role id>`. */
26
+ protected personaName(role: Role): string;
27
+ /** Persona system prompt: the role body plus a pointer to the shared workflow rules. */
28
+ protected personaBody(role: Role): string;
29
+ protected personaDescription(role: Role): string;
20
30
  /** Tool-specific extra rules files (e.g. Claude's CLAUDE.md bridge). Default: none. */
21
31
  protected rulesFiles(_ctx: RulesContext): EmittedFile[];
22
32
  /** Full project-relative path of a spec's command file. */
@@ -25,12 +35,19 @@ export declare abstract class BaseEmitter {
25
35
  protected commandFileName(spec: CommandSpec): string;
26
36
  /** Native frontmatter as ordered [key, serializedValue] pairs. */
27
37
  protected abstract commandFrontmatter(spec: CommandSpec): Array<[string, string]>;
28
- protected commandFile(spec: CommandSpec): EmittedFile;
38
+ protected commandFile(spec: CommandSpec, ctx?: RulesContext): EmittedFile;
29
39
  /**
30
40
  * Transform the neutral prompt body for this tool. Default: verbatim. Tools with a different
31
41
  * argument-placeholder convention override this (e.g. Copilot swaps `$ARGUMENTS` for `${input:…}`).
32
42
  */
33
43
  protected transformBody(spec: CommandSpec): string;
44
+ /**
45
+ * One sentence binding the phase to its role (feature 013, FR-003/FR-005). Emitted only when the
46
+ * project has roles installed and the spec names one; otherwise nothing, so projects without
47
+ * `.amby/roles/` get byte-identical output (FR-004). The role is referenced by path, never
48
+ * inlined (Principle 3).
49
+ */
50
+ protected roleLine(spec: CommandSpec, ctx?: RulesContext): string | null;
34
51
  protected generatedNotice(spec: CommandSpec): string;
35
52
  protected renderFrontmatter(pairs: Array<[string, string]>): string;
36
53
  /** Double-quote and escape a scalar so it is always valid YAML. */
@@ -1,4 +1,5 @@
1
1
  import { join } from "node:path/posix";
2
+ import { roleForSpec } from "../core/roles.js";
2
3
  /**
3
4
  * Abstract base for all tool emitters. Holds the shared orchestration (the `emit` template method)
4
5
  * and rendering helpers; subclasses override only what differs for their tool. Adding a tool should
@@ -17,12 +18,34 @@ export class BaseEmitter {
17
18
  const files = [];
18
19
  if (this.commandSurface !== "none") {
19
20
  for (const spec of specs)
20
- files.push(this.commandFile(spec));
21
+ files.push(this.commandFile(spec, ctx));
21
22
  }
22
23
  if (ctx.manageRules)
23
24
  files.push(...this.rulesFiles(ctx));
25
+ if (ctx.roles && ctx.roles.length > 0)
26
+ files.push(...this.roleFiles(ctx.roles, ctx));
24
27
  return files;
25
28
  }
29
+ /**
30
+ * Native persona/sub-agent files, one per role (feature 013, FR-009). Default: none — only
31
+ * targets whose agent-file format is verified in `docs/tool-compatibility.md` override this.
32
+ */
33
+ roleFiles(_roles, _ctx) {
34
+ return [];
35
+ }
36
+ /** Persona file name stem shared by every native format: `amby-<role id>`. */
37
+ personaName(role) {
38
+ return `amby-${role.id}`;
39
+ }
40
+ /** Persona system prompt: the role body plus a pointer to the shared workflow rules. */
41
+ personaBody(role) {
42
+ return `<!-- GENERATED by AmbyKit from .amby/roles/${role.id}.md — do not edit by hand; run \`ambykit sync\`. -->\n\n` +
43
+ `You are the **${role.name}** on this project.\n\n${role.body}\n\n` +
44
+ "Follow the AmbyKit workflow and rules in `AGENTS.md`; artifacts live under `specs/`.";
45
+ }
46
+ personaDescription(role) {
47
+ return `${role.name} — AmbyKit role for ${role.phases.length ? role.phases.join("/") : "reviews"}; use for that perspective.`;
48
+ }
26
49
  /** Tool-specific extra rules files (e.g. Claude's CLAUDE.md bridge). Default: none. */
27
50
  rulesFiles(_ctx) {
28
51
  return [];
@@ -36,10 +59,13 @@ export class BaseEmitter {
36
59
  commandFileName(spec) {
37
60
  return `${spec.name}.md`;
38
61
  }
39
- commandFile(spec) {
62
+ commandFile(spec, ctx) {
40
63
  const pairs = this.commandFrontmatter(spec);
41
64
  const notice = this.generatedNotice(spec);
42
- const body = this.transformBody(spec);
65
+ const roleLine = this.roleLine(spec, ctx);
66
+ // The role line is prepended *before* transformBody so tool-specific placeholder rewrites
67
+ // (e.g. Copilot's `$ARGUMENTS`) apply to its `--as` clause too.
68
+ const body = this.transformBody(roleLine ? { ...spec, body: `${roleLine}\n\n${spec.body}` } : spec);
43
69
  // Tools with no command frontmatter (e.g. Cursor plain commands) get no `---` block.
44
70
  const head = pairs.length > 0 ? `${this.renderFrontmatter(pairs)}\n` : "";
45
71
  const contents = `${head}${notice}\n\n${body}\n`;
@@ -52,6 +78,20 @@ export class BaseEmitter {
52
78
  transformBody(spec) {
53
79
  return spec.body;
54
80
  }
81
+ /**
82
+ * One sentence binding the phase to its role (feature 013, FR-003/FR-005). Emitted only when the
83
+ * project has roles installed and the spec names one; otherwise nothing, so projects without
84
+ * `.amby/roles/` get byte-identical output (FR-004). The role is referenced by path, never
85
+ * inlined (Principle 3).
86
+ */
87
+ roleLine(spec, ctx) {
88
+ const role = roleForSpec(ctx?.roles ?? [], spec.role);
89
+ if (!role)
90
+ return null;
91
+ return (`Act as the **${role.name}** in \`@.amby/roles/${role.id}.md\` and say so in your first line. ` +
92
+ "If `$ARGUMENTS` contains `--as <id>`, use `@.amby/roles/<id>.md` instead; if that file is " +
93
+ "missing, stop and list the files in `.amby/roles/`.");
94
+ }
55
95
  generatedNotice(spec) {
56
96
  return `<!-- GENERATED by AmbyKit from src/prompts/${spec.id}.md — do not edit by hand; run \`ambykit sync\`. -->`;
57
97
  }
@@ -1 +1 @@
1
- {"version":3,"file":"base-emitter.js","sourceRoot":"","sources":["../../src/emitters/base-emitter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AASvC;;;;GAIG;AACH,MAAM,OAAgB,WAAW;IAS/B,oGAAoG;IACjF,WAAW,GAAiC;QAC7D,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,MAAM;KACb,CAAC;IAEF,kFAAkF;IAClF,IAAI,CAAC,KAAoB,EAAE,GAAiB;QAC1C,MAAM,KAAK,GAAkB,EAAE,CAAC;QAChC,IAAI,IAAI,CAAC,cAAc,KAAK,MAAM,EAAE,CAAC;YACnC,KAAK,MAAM,IAAI,IAAI,K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AI,GAAG,WAAW,CAAC,GAAG,EAAE,KAAK,IAAI,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QACtD,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC;QACvB,OAAO,CACL,gBAAgB,IAAI,CAAC,IAAI,wBAAwB,IAAI,CAAC,EAAE,uCAAuC;YAC/F,4FAA4F;YAC5F,qDAAqD,CACtD,CAAC;IACJ,CAAC;IAES,eAAe,CAAC,IAAiB;QACzC,OAAO,8CAA8C,IAAI,CAAC,EAAE,sDAAsD,CAAC;IACrH,CAAC;IAED,yCAAyC;IAE/B,iBAAiB,CAAC,KAA8B;QACxD,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5D,OAAO,QAAQ,IAAI,OAAO,CAAC;IAC7B,CAAC;IAED,mEAAmE;IACzD,SAAS,CAAC,KAAa;QAC/B,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAClE,CAAC;IAED,qFAAqF;IAC3E,WAAW,CAAC,IAAiB;QACrC,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtE,CAAC;CACF"}
@@ -1,4 +1,4 @@
1
- import type { AbstractTool, CommandSpec, CommandSurface, EmittedFile, RulesContext } from "../core/types.js";
1
+ import type { AbstractTool, CommandSpec, CommandSurface, EmittedFile, Role, RulesContext } from "../core/types.js";
2
2
  import { BaseEmitter } from "./base-emitter.js";
3
3
  /**
4
4
  * Claude Code emitter. Emits slash commands to `.claude/commands/amby.*.md` and a `CLAUDE.md`
@@ -12,5 +12,7 @@ export declare class ClaudeEmitter extends BaseEmitter {
12
12
  readonly commandDir = ".claude/commands";
13
13
  protected readonly toolNameMap: Record<AbstractTool, string>;
14
14
  protected commandFrontmatter(spec: CommandSpec): Array<[string, string]>;
15
+ /** Sub-agents at `.claude/agents/<name>.md` — `name` + `description` required (verified, feature 013). */
16
+ protected roleFiles(roles: Role[], _ctx: RulesContext): EmittedFile[];
15
17
  protected rulesFiles(_ctx: RulesContext): EmittedFile[];
16
18
  }
@@ -23,6 +23,18 @@ export class ClaudeEmitter extends BaseEmitter {
23
23
  ["allowed-tools", this.mappedTools(spec)],
24
24
  ];
25
25
  }
26
+ /** Sub-agents at `.claude/agents/<name>.md` — `name` + `description` required (verified, feature 013). */
27
+ roleFiles(roles, _ctx) {
28
+ return roles.map((role) => ({
29
+ path: `.claude/agents/${this.personaName(role)}.md`,
30
+ contents: `${this.renderFrontmatter([
31
+ ["name", this.personaName(role)],
32
+ ["description", this.yamlQuote(this.personaDescription(role))],
33
+ ["tools", "Read, Grep, Glob"],
34
+ ])}\n${this.personaBody(role)}\n`,
35
+ scope: "project",
36
+ }));
37
+ }
26
38
  rulesFiles(_ctx) {
27
39
  // The `@AGENTS.md` import must stay on line 1 (Claude does not read AGENTS.md natively). It is
28
40
  // the `requiredPrefix` so a brownfield merge re-adds it if missing (FR-011); the AmbyKit body is
@@ -1 +1 @@
1
- {"version":3,"file":"claude.js","sourceRoot":"","sources":["../../src/emitters/claude.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,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,kBAAk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
@@ -1,4 +1,4 @@
1
- import type { CommandSpec, CommandSurface, EmittedFile, RulesContext } from "../core/types.js";
1
+ import type { CommandSpec, CommandSurface, EmittedFile, Role, RulesContext } from "../core/types.js";
2
2
  import { BaseEmitter } from "./base-emitter.js";
3
3
  /**
4
4
  * GitHub Copilot (VS Code) emitter. Phase prompts become prompt files at
@@ -15,5 +15,7 @@ export declare class CopilotEmitter extends BaseEmitter {
15
15
  protected commandFrontmatter(spec: CommandSpec): Array<[string, string]>;
16
16
  /** Copilot substitutes `${input:name}`; map our single `$ARGUMENTS` token to it. */
17
17
  protected transformBody(spec: CommandSpec): string;
18
+ /** Custom agents at `.github/agents/<name>.agent.md` — `description` required; all environments incl. CLI (verified, feature 013). */
19
+ protected roleFiles(roles: Role[], _ctx: RulesContext): EmittedFile[];
18
20
  protected rulesFiles(_ctx: RulesContext): EmittedFile[];
19
21
  }
@@ -26,6 +26,17 @@ export class CopilotEmitter extends BaseEmitter {
26
26
  transformBody(spec) {
27
27
  return spec.body.replaceAll("$ARGUMENTS", "${input:args}");
28
28
  }
29
+ /** Custom agents at `.github/agents/<name>.agent.md` — `description` required; all environments incl. CLI (verified, feature 013). */
30
+ roleFiles(roles, _ctx) {
31
+ return roles.map((role) => ({
32
+ path: join(".github", "agents", `${this.personaName(role)}.agent.md`),
33
+ contents: `${this.renderFrontmatter([
34
+ ["name", this.personaName(role)],
35
+ ["description", this.yamlQuote(this.personaDescription(role))],
36
+ ])}\n${this.personaBody(role)}\n`,
37
+ scope: "project",
38
+ }));
39
+ }
29
40
  rulesFiles(_ctx) {
30
41
  const region = buildPointerRegion("The `/amby.*` prompts under `.github/prompts/` drive the phases.");
31
42
  const contents = `# GitHub Copilot instructions\n\n${region}`;
@@ -1 +1 @@
1
- {"version":3,"file":"copilot.js","sourceRoot":"","sources":["../../src/emitters/copilot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,OAAO,EAAE,kBAAkB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AAC,WAAW,CAAC,IAAI,CAAC,IAAI;YACnC,KAAK,EAAE,SAAS;SACjB,CAAC,CAAC,CAAC;IACN,CAAC;IAEkB,UAAU,CAAC,IAAkB;QAC9C,MAAM,MAAM,GAAG,kBAAkB,CAAC,kEAAkE,CAAC,CAAC;QACtG,MAAM,QAAQ,GAAG,oCAAoC,MAAM,EAAE,CAAC;QAC9D,OAAO;YACL,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,yBAAyB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE;SAClG,CAAC;IACJ,CAAC;CACF"}
@@ -1,4 +1,4 @@
1
- import type { CommandSpec, CommandSurface } from "../core/types.js";
1
+ import type { CommandSpec, CommandSurface, EmittedFile, Role, RulesContext } from "../core/types.js";
2
2
  import { BaseEmitter } from "./base-emitter.js";
3
3
  /**
4
4
  * OpenCode emitter. Commands go to `.opencode/commands/*.md` (plural dir; invoked as `/amby.*`).
@@ -11,4 +11,6 @@ export declare class OpenCodeEmitter extends BaseEmitter {
11
11
  readonly commandSurface: CommandSurface;
12
12
  readonly commandDir: string;
13
13
  protected commandFrontmatter(spec: CommandSpec): Array<[string, string]>;
14
+ /** Agents at `.opencode/agents/<id>.md` — filename is the id; `description` required (verified, feature 013). */
15
+ protected roleFiles(roles: Role[], _ctx: RulesContext): EmittedFile[];
14
16
  }
@@ -13,5 +13,16 @@ export class OpenCodeEmitter extends BaseEmitter {
13
13
  commandFrontmatter(spec) {
14
14
  return [["description", this.yamlQuote(spec.description)]];
15
15
  }
16
+ /** Agents at `.opencode/agents/<id>.md` — filename is the id; `description` required (verified, feature 013). */
17
+ roleFiles(roles, _ctx) {
18
+ return roles.map((role) => ({
19
+ path: join(".opencode", "agents", `${this.personaName(role)}.md`),
20
+ contents: `${this.renderFrontmatter([
21
+ ["description", this.yamlQuote(this.personaDescription(role))],
22
+ ["mode", "subagent"],
23
+ ])}\n${this.personaBody(role)}\n`,
24
+ scope: "project",
25
+ }));
26
+ }
16
27
  }
17
28
  //# sourceMappingURL=opencode.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"opencode.js","sourceRoot":"","sources":["../../src/emitters/opencode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,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"}
1
+ {"version":3,"file":"opencode.js","sourceRoot":"","sources":["../../src/emitters/opencode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,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;IAED,iHAAiH;IAC9F,SAAS,CAAC,KAAa,EAAE,IAAkB;QAC5D,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAC1B,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC;YACjE,QAAQ,EACN,GAAG,IAAI,CAAC,iBAAiB,CAAC;gBACxB,CAAC,aAAa,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;gBAC9D,CAAC,MAAM,EAAE,UAAU,CAAC;aACrB,CAAC,KAAK,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI;YACnC,KAAK,EAAE,SAAS;SACjB,CAAC,CAAC,CAAC;IACN,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ambystech/ambykit",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
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
5
  "keywords": [
6
6
  "spec-driven-development",
@@ -4,6 +4,7 @@ name: amby.analyze
4
4
  description: Cross-check spec, plan, and tasks for coverage, consistency, and dependency-graph health.
5
5
  argument-hint: "[feature id, defaults to current]"
6
6
  phase: analyze
7
+ role: qa
7
8
  reads: [specs/NNN-slug/spec.md, specs/NNN-slug/plan.md, specs/NNN-slug/tasks.md]
8
9
  writes: []
9
10
  allowedTools: [read]
@@ -4,6 +4,7 @@ name: amby.clarify
4
4
  description: Resolve the open [NEEDS CLARIFICATION] markers in a feature spec.
5
5
  argument-hint: "[feature id, defaults to current]"
6
6
  phase: clarify
7
+ role: pm
7
8
  reads: [specs/NNN-slug/spec.md]
8
9
  writes: [specs/NNN-slug/spec.md]
9
10
  allowedTools: [read, edit]
@@ -0,0 +1,27 @@
1
+ ---
2
+ id: converge
3
+ name: amby.converge
4
+ description: Check the codebase against spec, plan, and tasks after implementing; append gap tasks, never edit code.
5
+ argument-hint: "[feature id, defaults to current]"
6
+ phase: converge
7
+ role: qa
8
+ reads: [specs/NNN-slug/spec.md, specs/NNN-slug/plan.md, specs/NNN-slug/tasks.md]
9
+ writes: [specs/NNN-slug/tasks.md, specs/NNN-slug/spec.md]
10
+ allowedTools: [read, edit]
11
+ ---
12
+
13
+ Converge feature `$ARGUMENTS` (default: the current feature): does the code satisfy its artifacts?
14
+ Never edit source code — only that feature's `tasks.md` and `spec.md` are writable.
15
+
16
+ 1. No `tasks.md` → stop, say to run `/amby.tasks`. No `plan.md` → converge on spec + tasks and say so.
17
+ 2. For every `FR-###`/`SC-###`, plan decision (incl. `data-model.md`/`contracts/`), and checked
18
+ `T###`: look for evidence only in files the plan/tasks name. Classify **covered**, **gap**
19
+ (absent), or **unverified** (inconclusive). Skip items the plan marks deferred/out of scope.
20
+ 3. **Append, don't rewrite.** Under `## Convergence` in `tasks.md` (create at the end if absent) add
21
+ `- [ ] [T###] [US#] … (closes FR-…)` per gap and `- [ ] [T###] [US#] [VERIFY] …` per unverified
22
+ item. Continue IDs from the highest `T###` anywhere in the file; skip items already listed
23
+ unchecked there. Nothing to add → leave the file untouched.
24
+ 4. In `spec.md`, patch only `status:` lines: a story → `done` when every FR/SC it maps to is
25
+ covered; the feature → `done` when all stories are.
26
+ 5. Report: **converged** (no gaps) or **gaps found (N)**, counts per class, and a table of every ID
27
+ with its class and a one-line reason for each gap/unverified item.
@@ -4,6 +4,7 @@ name: amby.design
4
4
  description: Design the UI — wireframes, component specs, and design tokens — with a sign-off gate.
5
5
  argument-hint: "[feature id, defaults to current]"
6
6
  phase: design
7
+ role: ux
7
8
  reads: [specs/NNN-slug/spec.md]
8
9
  writes: [specs/NNN-slug/ui.md, specs/NNN-slug/design-tokens.json]
9
10
  allowedTools: [read, write, edit]
@@ -4,6 +4,7 @@ name: amby.implement
4
4
  description: Execute the task list, checking off tasks and updating story status as you go.
5
5
  argument-hint: "[task id or story id, defaults to next unblocked]"
6
6
  phase: implement
7
+ role: developer
7
8
  reads: [specs/NNN-slug/tasks.md, specs/NNN-slug/plan.md]
8
9
  writes: [specs/NNN-slug/tasks.md, specs/NNN-slug/spec.md]
9
10
  allowedTools: [read, write, edit, bash]
@@ -4,6 +4,7 @@ name: amby.plan
4
4
  description: Produce the technical implementation plan (the HOW) from an approved spec and UI.
5
5
  argument-hint: "[feature id, defaults to current]"
6
6
  phase: plan
7
+ role: architect
7
8
  reads: [specs/NNN-slug/spec.md, specs/NNN-slug/ui.md, .amby/constitution.md]
8
9
  writes: [specs/NNN-slug/plan.md, specs/NNN-slug/data-model.md, specs/NNN-slug/contracts/]
9
10
  allowedTools: [read, write, edit]
@@ -0,0 +1,24 @@
1
+ ---
2
+ id: review
3
+ name: amby.review
4
+ description: Review an artifact from another role's perspective — findings by stable ID, advisory only.
5
+ argument-hint: "<artifact path> [--as <role id>] [--apply]"
6
+ phase: review
7
+ reads: [.amby/roles/*.md]
8
+ writes: []
9
+ allowedTools: [read, edit]
10
+ ---
11
+
12
+ Review `$ARGUMENTS` (an artifact path, e.g. `specs/NNN-slug/spec.md`) as a **different** role.
13
+ If the path does not exist, stop and name the phase that produces it.
14
+
15
+ 1. Pick the reviewer: `--as <id>` → `@.amby/roles/<id>.md`; otherwise QA for a spec or tasks,
16
+ Architect for a plan, PM for a UI design. If the file is missing, stop and list `.amby/roles/`.
17
+ Say which role you are acting as in your first line.
18
+ 2. Read only the artifact (and its spec, if reviewing a plan or tasks). Apply the role's focus
19
+ checklist. Produce findings, one per line: `ID · severity (high/med/low) · finding · fix` —
20
+ every finding names a stable ID (`US-#`, `FR-###`, `SC-###`, `T###`). Modify nothing.
21
+ 3. Only with `--apply`: patch the artifact in place for each finding, preserving every existing ID
22
+ (never renumber), then append under a `## Reviews` heading at the end:
23
+ `- <date> · <role> · <n> findings applied` — or `approved` when there were none.
24
+ 4. This is advisory: no phase waits on a review. End with the findings count and the next phase to run.
@@ -4,6 +4,7 @@ name: amby.revise
4
4
  description: Continue an existing feature's spec (or design) — add and refine in place, with a done-guard.
5
5
  argument-hint: "[feature id, defaults to current] + what to add or refine"
6
6
  phase: revise
7
+ role: pm
7
8
  reads: [specs/NNN-slug/spec.md, specs/NNN-slug/ui.md]
8
9
  writes: [specs/NNN-slug/spec.md, specs/NNN-slug/ui.md]
9
10
  allowedTools: [read, edit]
@@ -4,9 +4,10 @@ name: amby.specify
4
4
  description: Turn a feature idea into a spec — user stories, EARS requirements, acceptance criteria.
5
5
  argument-hint: "<feature description>"
6
6
  phase: specify
7
- reads: [.amby/constitution.md]
7
+ role: pm
8
+ reads: [.amby/constitution.md, .amby/config.json]
8
9
  writes: [specs/NNN-slug/spec.md]
9
- allowedTools: [read, write, edit]
10
+ allowedTools: [read, write, edit, bash]
10
11
  ---
11
12
 
12
13
  Write a specification for: **$ARGUMENTS**
@@ -24,5 +25,8 @@ read other specs.
24
25
  5. Write measurable, tech-agnostic **success criteria** (`SC-###`).
25
26
  6. **Capture WHAT/WHY only — no technology choices.** Flag every unknown inline as
26
27
  `[NEEDS CLARIFICATION: …]` instead of guessing.
28
+ 7. If `.amby/config.json` has `"worktrees": true` and this is a git repo, run
29
+ `ambykit worktree NNN-slug` (the only command to run) and tell the user to continue in
30
+ `.worktrees/NNN-slug/`. Otherwise skip this step (say why if isolation was enabled but git is absent).
27
31
 
28
32
  Keep it tight. Reference the constitution by principle number where relevant; don't restate it.
@@ -4,6 +4,7 @@ name: amby.tasks
4
4
  description: Break the plan into an ordered, dependency-aware task checklist.
5
5
  argument-hint: "[feature id, defaults to current]"
6
6
  phase: tasks
7
+ role: tech-lead
7
8
  reads: [specs/NNN-slug/plan.md, specs/NNN-slug/spec.md]
8
9
  writes: [specs/NNN-slug/tasks.md]
9
10
  allowedTools: [read, write, edit]