@ambystech/ambykit 1.1.0 → 1.2.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 (94) hide show
  1. package/CHANGELOG.md +127 -0
  2. package/README.md +60 -21
  3. package/dist/cli/dashboard.d.ts +13 -2
  4. package/dist/cli/dashboard.js +144 -23
  5. package/dist/cli/dashboard.js.map +1 -1
  6. package/dist/cli/ui/capabilities.js +20 -1
  7. package/dist/cli/ui/capabilities.js.map +1 -1
  8. package/dist/cli/ui/dashboard/attention.d.ts +10 -0
  9. package/dist/cli/ui/dashboard/attention.js +41 -0
  10. package/dist/cli/ui/dashboard/attention.js.map +1 -0
  11. package/dist/cli/ui/dashboard/burndown-chart.d.ts +16 -0
  12. package/dist/cli/ui/dashboard/burndown-chart.js +117 -0
  13. package/dist/cli/ui/dashboard/burndown-chart.js.map +1 -0
  14. package/dist/cli/ui/dashboard/cards.d.ts +25 -0
  15. package/dist/cli/ui/dashboard/cards.js +93 -0
  16. package/dist/cli/ui/dashboard/cards.js.map +1 -0
  17. package/dist/cli/ui/dashboard/feature-chart.d.ts +14 -0
  18. package/dist/cli/ui/dashboard/feature-chart.js +70 -0
  19. package/dist/cli/ui/dashboard/feature-chart.js.map +1 -0
  20. package/dist/cli/ui/dashboard/feature-view.d.ts +18 -0
  21. package/dist/cli/ui/dashboard/feature-view.js +95 -0
  22. package/dist/cli/ui/dashboard/feature-view.js.map +1 -0
  23. package/dist/cli/ui/dashboard/layout.d.ts +7 -0
  24. package/dist/cli/ui/dashboard/layout.js +12 -0
  25. package/dist/cli/ui/dashboard/layout.js.map +1 -0
  26. package/dist/cli/ui/dashboard/panel.d.ts +25 -0
  27. package/dist/cli/ui/dashboard/panel.js +92 -0
  28. package/dist/cli/ui/dashboard/panel.js.map +1 -0
  29. package/dist/cli/ui/dashboard/render-overview.d.ts +29 -0
  30. package/dist/cli/ui/dashboard/render-overview.js +125 -0
  31. package/dist/cli/ui/dashboard/render-overview.js.map +1 -0
  32. package/dist/cli/ui/dashboard/status-chart.d.ts +21 -0
  33. package/dist/cli/ui/dashboard/status-chart.js +93 -0
  34. package/dist/cli/ui/dashboard/status-chart.js.map +1 -0
  35. package/dist/cli/ui/dashboard/tokens.d.ts +988 -0
  36. package/dist/cli/ui/dashboard/tokens.js +1024 -0
  37. package/dist/cli/ui/dashboard/tokens.js.map +1 -0
  38. package/dist/cli/ui/dashboard/up-next.d.ts +13 -0
  39. package/dist/cli/ui/dashboard/up-next.js +41 -0
  40. package/dist/cli/ui/dashboard/up-next.js.map +1 -0
  41. package/dist/cli/ui/interactive/fullscreen.d.ts +6 -0
  42. package/dist/cli/ui/interactive/fullscreen.js +8 -0
  43. package/dist/cli/ui/interactive/fullscreen.js.map +1 -1
  44. package/dist/cli/ui/interactive/overview.d.ts +38 -0
  45. package/dist/cli/ui/interactive/overview.js +170 -0
  46. package/dist/cli/ui/interactive/overview.js.map +1 -0
  47. package/dist/cli/ui/theme.d.ts +13 -0
  48. package/dist/cli/ui/theme.js +17 -0
  49. package/dist/cli/ui/theme.js.map +1 -1
  50. package/dist/cli/ui/types.d.ts +4 -0
  51. package/dist/core/analyze.d.ts +6 -0
  52. package/dist/core/analyze.js +1 -1
  53. package/dist/core/analyze.js.map +1 -1
  54. package/dist/core/burndown.d.ts +62 -0
  55. package/dist/core/burndown.js +169 -0
  56. package/dist/core/burndown.js.map +1 -0
  57. package/dist/core/clarifications.d.ts +7 -0
  58. package/dist/core/clarifications.js +31 -0
  59. package/dist/core/clarifications.js.map +1 -0
  60. package/dist/core/dashboard.d.ts +7 -2
  61. package/dist/core/dashboard.js +24 -8
  62. package/dist/core/dashboard.js.map +1 -1
  63. package/dist/core/features.d.ts +14 -0
  64. package/dist/core/features.js +97 -0
  65. package/dist/core/features.js.map +1 -0
  66. package/dist/core/git.d.ts +5 -0
  67. package/dist/core/git.js +13 -0
  68. package/dist/core/git.js.map +1 -1
  69. package/dist/core/overview-types.d.ts +99 -0
  70. package/dist/core/overview-types.js +11 -0
  71. package/dist/core/overview-types.js.map +1 -0
  72. package/dist/core/overview.d.ts +42 -0
  73. package/dist/core/overview.js +259 -0
  74. package/dist/core/overview.js.map +1 -0
  75. package/docs/architecture.md +93 -0
  76. package/docs/artifacts/plan.md +31 -0
  77. package/docs/artifacts/spec.md +70 -0
  78. package/docs/artifacts/tasks.md +40 -0
  79. package/docs/artifacts/ui-design.md +59 -0
  80. package/docs/cli-reference.md +196 -0
  81. package/docs/concepts/constitution.md +35 -0
  82. package/docs/concepts/spec-driven-development.md +34 -0
  83. package/docs/contributing.md +50 -0
  84. package/docs/getting-started.md +106 -0
  85. package/docs/index.md +35 -0
  86. package/docs/tool-compatibility.md +78 -0
  87. package/docs/workflow.md +109 -0
  88. package/package.json +16 -4
  89. package/src/roles/architect.md +17 -0
  90. package/src/roles/developer.md +17 -0
  91. package/src/roles/pm.md +17 -0
  92. package/src/roles/qa.md +17 -0
  93. package/src/roles/tech-lead.md +17 -0
  94. package/src/roles/ux.md +17 -0
@@ -0,0 +1,196 @@
1
+ # CLI reference
2
+
3
+ `@ambystech/ambykit`, bin name `ambykit`. Run via `npx @ambystech/ambykit <command>` or install and
4
+ use `ambykit <command>`.
5
+
6
+ ## Global flags
7
+
8
+ - `--verbose` — detailed logging.
9
+ - `--dry-run` — show what would change without writing files.
10
+ - `--yes` — assume yes for prompts (non-interactive); skips interactive tool selection.
11
+
12
+ ## Terminal output
13
+
14
+ The CLI adapts its output to your terminal. It colorizes and uses box-drawing glyphs on an
15
+ interactive terminal, and **degrades cleanly** everywhere else so logs and pipes stay readable:
16
+
17
+ - Piped / redirected / non-interactive (CI): plain text, no color, no control sequences.
18
+ - `NO_COLOR` set: color is dropped (glyphs and words remain).
19
+ - Terminals without extended glyphs: an ASCII fallback (`[ok]`/`x`, `#`/`-` bars) is used.
20
+ - Narrow terminals: the dashboard switches to a stacked layout (and plain text below 60 columns),
21
+ and tables drop lower-priority columns rather than wrapping.
22
+ - `--json` output is always unstyled and byte-stable — safe to parse.
23
+
24
+ Multi-step commands (`init`, `add`, `sync`, `update`) show a spinner while working and a
25
+ created/updated/unchanged/skipped summary when done.
26
+
27
+ When a newer AmbyKit is published, an interactive command shows a yellow **"Update available"** callout
28
+ between the banner and its output, naming your installed and the latest version. It's suppressed on
29
+ non-interactive terminals and under `--json`, checks the registry at most once a day, and never blocks
30
+ on network failure. Run [`ambykit update`](#ambykit-update) to upgrade.
31
+
32
+ ## `ambykit init [dir]`
33
+
34
+ Scaffold AmbyKit in a project. Creates `.amby/` (constitution + `config.json`) and `specs/`, detects
35
+ installed assistants, lets you select targets, emits their native files, and writes the shared
36
+ `AGENTS.md` (+ `CLAUDE.md` bridge for Claude Code).
37
+
38
+ **Brownfield-safe.** `init` detects whether a project already exists (an existing rules file,
39
+ non-AmbyKit source files, or a git history) and reports the mode. For rules files it **merges** rather
40
+ than overwrites: existing content is preserved and only AmbyKit's `### AmbyKit usage` section is
41
+ added/updated in place. An existing file is backed up to `.amby/backups/` before it is changed, and a
42
+ section you hand-edited is left untouched (reported as skipped). Use `--dry-run` to preview.
43
+
44
+ ```bash
45
+ npx @ambystech/ambykit init
46
+ npx @ambystech/ambykit init . --yes
47
+ npx @ambystech/ambykit init --dry-run # preview merges, write nothing
48
+ ```
49
+
50
+ ## `ambykit add <tool…>`
51
+
52
+ Add or refresh integration for one or more targets (see [tool compatibility](./tool-compatibility.md)
53
+ for target names). On an interactive terminal, running it with **no target** opens a multi-select
54
+ prompt (`space` toggle, `enter` confirm, `esc` cancel); non-interactively it errors with the list of
55
+ available targets instead of blocking. `init` behaves the same when `--tools` is omitted.
56
+
57
+ ```bash
58
+ ambykit add cursor claude
59
+ ambykit add # interactive tool picker (TTY only)
60
+ ```
61
+
62
+ ## `ambykit sync`
63
+
64
+ Re-emit all configured tools from the neutral source. Run after upgrading AmbyKit or editing
65
+ `.amby/` templates/prompts. Project-scoped files only by default; user-level MCP files are opt-in.
66
+
67
+ `sync` is also the **update path** for existing docs: it merges AmbyKit's section into each configured
68
+ tool's rules file non-destructively (same rules as `init` — preserve, back up, skip hand-edits), so
69
+ running it keeps your agent docs current without a full re-init.
70
+
71
+ ```bash
72
+ ambykit sync
73
+ ambykit sync --dry-run
74
+ ```
75
+
76
+ Also installs any newly shipped templates, reference docs, and **roles** into `.amby/` (write-if-absent —
77
+ your edits are kept), warns when a role in `.amby/roles/` exceeds 150 words, and refuses to emit
78
+ when two roles share an id. Projects with roles get one native sub-agent per role for Claude Code,
79
+ OpenCode, and Copilot.
80
+
81
+ ## `ambykit restore [file]`
82
+
83
+ Recover an agent-doc file (`AGENTS.md`, `CLAUDE.md`, a tool's rules file) from the timestamped backup
84
+ AmbyKit writes to `.amby/backups/` before modifying it. With no argument, lists the backups available
85
+ to restore (newest first).
86
+
87
+ ```bash
88
+ ambykit restore # list available backups
89
+ ambykit restore CLAUDE.md # restore the most recent backup of CLAUDE.md
90
+ ambykit restore CLAUDE.md --dry-run
91
+ ```
92
+
93
+ ## `ambykit worktree <feature> | list | remove <feature>`
94
+
95
+ Per-feature **git worktrees** so several features can be worked on in parallel — by you or by
96
+ several assistants — without checkout switching. Each feature gets its own working copy at
97
+ `.worktrees/<feature>/` (gitignored) on branch `<feature>`, created from the repository's default
98
+ branch when the branch does not exist yet. Zero model tokens.
99
+
100
+ ```bash
101
+ ambykit worktree 004-slug # create .worktrees/004-slug on branch 004-slug
102
+ ambykit worktree list # feature, branch, clean/dirty/merged, path
103
+ ambykit worktree remove 004-slug # delete the working copy (branch is kept); --force if dirty
104
+ ambykit worktree 004-slug --dry-run # show the git command without running it
105
+ ```
106
+
107
+ Creating twice is a no-op; removing a missing one exits 0. `ambykit check` flags worktrees whose
108
+ branch is already merged. Opt in to automatic creation from `/amby.specify` by answering yes at
109
+ `ambykit init`, or set `"worktrees": true` in `.amby/config.json`. Inside a worktree, phases resolve
110
+ "the current feature" from the directory name.
111
+
112
+ ## `ambykit dashboard [story-id]`
113
+
114
+ Progress view over the story/task graph, computed locally from `specs/*/` files and, for the
115
+ burndown, read-only git history (no model tokens, no network, writes nothing).
116
+
117
+ - **No arg** — the overview, top to bottom:
118
+ - summary cards: features, stories, tasks done/total, overall completion;
119
+ - **story status** stacked bar with a legend (each status has its own fill pattern and glyph, so
120
+ it reads without color);
121
+ - **Attention** — dependency cycles and unknown references first, then blocked stories (status
122
+ `blocked`, or a `blocked-by` story that is not done), then stories waiting on an unfinished
123
+ `depends-on`;
124
+ - **Up next** — the next undone tasks whose story is not in Attention (`--next=N`, default 5);
125
+ - **burndown** — remaining vs. done tasks per day/week/month from the git history of `tasks.md`
126
+ (the last column is your working tree); shows "No history available" outside a git repo;
127
+ - **feature completion** — one row per feature with its bar, workflow phase (specified → designed →
128
+ planned → tasked → implementing → done) and open `[NEEDS CLARIFICATION]` count. A feature with no
129
+ `tasks.md` reads "not planned".
130
+
131
+ Unreadable files are skipped and named in a notice line. Off a TTY (pipes, CI) the same content is
132
+ printed as plain text.
133
+ - **`--feature=X`** — the feature view for one feature (`X` is its number, e.g. `014`, or its
134
+ directory name): artifacts present, open clarifications, status, the story table with a
135
+ `Waiting on` column, and Attention / Up next / burndown scoped to the feature.
136
+ - **`--status=X`** — narrow every widget to stories with that status.
137
+ - **`--stories`** — the previous story table (`Feat | Story | description | progress | status |
138
+ priority | blocked-by`) with an overall roll-up.
139
+ - **`story-id`** — detail for one story. Story ids **restart per feature**, so a bare `US-3` may
140
+ match several; qualify it with the feature ref as `NNN:US-3` (also accepts `NNN/US-3`). A bare id
141
+ that matches more than one feature prints the matches so you can pick.
142
+ - **`--interactive`** — the overview full screen (TTY only): `tab` moves focus between Attention, Up
143
+ next and Feature completion, `↑`/`↓` move, `enter` opens the feature view (and a story's tasks from
144
+ there), `esc` goes back, `f` filters by feature, `s` cycles the status filter, `q` quits. On a
145
+ non-interactive terminal it prints the plain overview.
146
+ - **`--json`** — the story list as JSON, unchanged from earlier releases.
147
+ - **`--json --overview`** — one object: `stories` (exactly the `--json` list) plus `summary`,
148
+ `statusCounts`, `features`, `attention`, `upNext`, `burndown`, `issues` and the applied `filters`.
149
+
150
+ ```bash
151
+ ambykit dashboard
152
+ ambykit dashboard --interactive # full-screen overview (TTY only)
153
+ ambykit dashboard --feature=014 # feature view
154
+ ambykit dashboard --next=10 # longer Up next list
155
+ ambykit dashboard --status=blocked
156
+ ambykit dashboard --stories # the story table
157
+ ambykit dashboard 001:US-3 # story detail (feature-qualified)
158
+ ambykit dashboard --json # story list
159
+ ambykit dashboard --json --overview # story list + every aggregate
160
+ ```
161
+
162
+ ## `ambykit analyze`
163
+
164
+ Validate the story dependency graph, computed locally from `specs/` (no model tokens): detects
165
+ **cycles** and **dangling references** (structural errors), and reports **blocked** vs **buildable**
166
+ stories and **orphans** (stories with no tasks). Exits non-zero on structural errors, so it can gate
167
+ CI. Complements the generative `/amby.analyze` phase.
168
+
169
+ ```bash
170
+ ambykit analyze
171
+ ambykit analyze --json
172
+ ```
173
+
174
+ ## `ambykit check`
175
+
176
+ Doctor: verify integrations are present and well-formed and that expected assistant CLIs are
177
+ installed. Reports drift between the neutral source and emitted files, worktrees whose branch is
178
+ already merged, and role problems in `.amby/roles/` (oversized roles, duplicate ids, shipped
179
+ defaults that were deleted — `ambykit sync` reinstalls those).
180
+
181
+ ## `ambykit update`
182
+
183
+ Update the AmbyKit CLI to the latest published version, then refresh this project's tool prompts.
184
+
185
+ When your CLI is **behind**, `update` installs the latest globally and asks you to **re-run** it — the
186
+ first run can only upgrade the CLI, and the re-run (now on the new version) regenerates the prompts. If
187
+ it can't self-update (an `npx` run, or a permissions error) it prints the exact `npm install -g`
188
+ command and leaves your install untouched. When the CLI is already current, it refreshes the configured
189
+ tools' files (a `.amby/` **and** `specs/` dir at the current directory); with nothing to do it prints
190
+ `Everything is up to date`.
191
+
192
+ ```bash
193
+ ambykit update # outdated: upgrades the CLI, then asks you to re-run
194
+ ambykit update # current: refreshes this project's tool prompts
195
+ ambykit update --dry-run # preview the prompt refresh
196
+ ```
@@ -0,0 +1,35 @@
1
+ # The constitution
2
+
3
+ The **constitution** (`.amby/constitution.md`) holds your project's non-negotiable, cross-feature
4
+ principles. It is written once with `/amby.constitution`, revised rarely, and referenced by every
5
+ later phase — the assistant must adhere to it when specifying, designing, planning, and implementing.
6
+
7
+ Think of it as durable guardrails, distinct from per-feature specs: specs change constantly, the
8
+ constitution almost never does.
9
+
10
+ ## What belongs in it
11
+
12
+ - **Code quality** — style, structure, review bars, "don't touch" boundaries.
13
+ - **Testing standards** — required coverage, test-first expectations, what "done" means.
14
+ - **UX consistency** — design principles, accessibility requirements, tone.
15
+ - **Performance & reliability** — budgets and SLAs the system must meet.
16
+ - **Security & compliance** — constraints that override convenience.
17
+ - **Architectural constraints** — patterns to follow, technologies to prefer or avoid.
18
+
19
+ ## What does not belong in it
20
+
21
+ - Feature requirements (those go in `spec.md`).
22
+ - Technology choices for a specific feature (those go in `plan.md`).
23
+ - Anything that changes per feature.
24
+
25
+ ## Format
26
+
27
+ Plain Markdown with numbered, named principles so they can be cited (e.g. "per Principle 3, tests
28
+ precede implementation"). Keep each principle short and imperative. AmbyKit ships a starter template;
29
+ `/amby.constitution` fills it in through a short interview and can amend it later.
30
+
31
+ ## Relationship to AGENTS.md
32
+
33
+ The constitution is *project governance for the SDD workflow*. `AGENTS.md` is *general repo context*
34
+ for the assistant (build commands, conventions). They complement each other; AmbyKit keeps them
35
+ separate so each stays focused.
@@ -0,0 +1,34 @@
1
+ # Spec-Driven Development
2
+
3
+ Spec-Driven Development (SDD) means the **specification is the primary artifact**, and code is
4
+ generated to satisfy it — not the other way around. With AI assistants, this matters more, not less:
5
+ an assistant is only as good as the requirements it's given, and a vague prompt yields plausible but
6
+ wrong software.
7
+
8
+ ## Principles
9
+
10
+ 1. **Separate WHAT from HOW.** The spec describes behavior and value with no technology decisions.
11
+ The plan describes the technical approach. Mixing them produces specs that can't be reviewed by
12
+ non-engineers and plans that re-litigate requirements.
13
+ 2. **Make requirements testable.** Every requirement should map to a test. AmbyKit uses
14
+ [EARS](https://alistairmavin.com/ears/) notation (WHEN/WHILE/IF … THE SYSTEM SHALL …) plus
15
+ Given/When/Then acceptance criteria so requirements are unambiguous and traceable.
16
+ 3. **Surface ambiguity, don't paper over it.** Unknowns become explicit `[NEEDS CLARIFICATION]`
17
+ markers that a dedicated phase resolves — the assistant never silently guesses.
18
+ 4. **Independent, prioritized stories.** Each user story is independently testable and carries a
19
+ priority, so an MVP is a subset of stories, and work can be ordered and parallelized.
20
+ 5. **Durable governance.** A project [constitution](./constitution.md) holds cross-feature principles
21
+ that every phase must honor.
22
+
23
+ ## Why "author once, emit per tool"
24
+
25
+ Teams use different assistants, and each reads a different config format. Writing the workflow once
26
+ and compiling it to every tool keeps a single source of truth and lets specs travel with the team.
27
+ See [architecture](../architecture.md).
28
+
29
+ ## How AmbyKit compares
30
+
31
+ AmbyKit draws on proven prior art — GitHub Spec-Kit's phase model and templates, Kiro's
32
+ requirements/design/tasks split and EARS usage, and the [AGENTS.md](https://agents.md) standard for
33
+ neutral instructions — and adds a **first-class UI design artifact** and a **cross-tool emitter**
34
+ model on top.
@@ -0,0 +1,50 @@
1
+ # Contributing
2
+
3
+ AmbyKit is built **with** AmbyKit. Read [`AGENTS.md`](../AGENTS.md) first — it has the golden rules
4
+ for working in this codebase.
5
+
6
+ ## Setup
7
+
8
+ ```bash
9
+ npm install
10
+ npm run build # compile to dist/ (ESM, NodeNext)
11
+ npm run typecheck # type-check only
12
+ npm test # vitest: emitter snapshot tests + CLI e2e
13
+ ```
14
+
15
+ Node ≥ 20, ESM only. Use `.js` extensions in relative imports.
16
+
17
+ ## The two golden rules
18
+
19
+ 1. **Author once, emit per tool.** Never hand-edit generated tool files (`.claude/commands/`,
20
+ `.github/prompts/`, …). Edit the neutral source in `src/templates/` or `src/prompts/`, then
21
+ `ambykit sync`.
22
+ 2. **Subclass, don't duplicate.** New tool = a `BaseEmitter` subclass; new CLI verb = a `BaseCommand`
23
+ subclass. Override only what differs.
24
+
25
+ ## Adding a tool emitter
26
+
27
+ 1. Read the tool's real format and add/verify a row in
28
+ [`docs/tool-compatibility.md`](./tool-compatibility.md). Don't guess formats.
29
+ 2. Create `src/emitters/<tool>.ts` extending `BaseEmitter`; set `commandSurface`, paths, and MCP
30
+ keys/scope; override only the differing hooks.
31
+ 3. Register it (and any VS Code-extension alias) in `src/emitters/index.ts`.
32
+ 4. Add a snapshot test asserting generated paths and frontmatter match the matrix.
33
+
34
+ ## Adding or changing a phase
35
+
36
+ 1. Edit the neutral `CommandSpec` in `src/prompts/` and any template in `src/templates/`.
37
+ 2. Keep it **token-frugal**: load only needed artifacts by `@path`, reference IDs instead of
38
+ restating, patch in place. See [architecture → token efficiency](./architecture.md).
39
+ 3. Run `ambykit sync` to regenerate this repo's own tool files and commit them.
40
+
41
+ ## Dogfooding & CI
42
+
43
+ Features are specced under `specs/` using the AmbyKit workflow. CI asserts `ambykit sync` produces no
44
+ diff, so the repo stays a faithful consumer of itself. If your change touches emitters or prompts,
45
+ run `ambykit sync` and include the regenerated files in your commit.
46
+
47
+ ## Commit / PR
48
+
49
+ - Keep changes small and focused; update docs and the compatibility matrix alongside code.
50
+ - Ensure `npm run typecheck` and `npm test` pass before opening a PR.
@@ -0,0 +1,106 @@
1
+ # Getting started
2
+
3
+ ## Requirements
4
+
5
+ - Node.js ≥ 20
6
+ - One or more supported AI coding assistants ([tool compatibility](./tool-compatibility.md))
7
+
8
+ ## 1. Initialize
9
+
10
+ From your project root:
11
+
12
+ ```bash
13
+ npx @ambystech/ambykit init
14
+ ```
15
+
16
+ `init` will:
17
+
18
+ 1. Create `.amby/` (your constitution + config) and a `specs/` directory.
19
+ 2. Detect installed assistants and let you pick which to target.
20
+ 3. Emit each selected tool's native command/rules files.
21
+ 4. Write a shared `AGENTS.md` (and a `CLAUDE.md` bridge for Claude Code).
22
+
23
+ Re-run any time to add a tool (`ambykit add cursor`) or refresh generated files (`ambykit sync`).
24
+
25
+ ### Already have a project (and a `CLAUDE.md` / `AGENTS.md`)?
26
+
27
+ `init` is **non-destructive**. If a rules file already exists, AmbyKit does **not** overwrite it — it
28
+ detects the existing project (an existing rules file, source files, or git history) and adds only its
29
+ own `### AmbyKit usage` section, leaving everything you wrote intact. Re-running is idempotent: the
30
+ section is updated in place, never duplicated. Before modifying an existing file it writes a
31
+ timestamped backup under `.amby/backups/`, and if you hand-edit AmbyKit's section it is left untouched
32
+ and reported as skipped. Preview any run with `--dry-run`; recover a file with
33
+ [`ambykit restore`](./cli-reference.md). Add `.amby/backups/` to your `.gitignore`.
34
+
35
+ ## 2. Set your constitution (once)
36
+
37
+ Inside your assistant:
38
+
39
+ ```
40
+ /amby.constitution
41
+ ```
42
+
43
+ This captures durable, cross-feature principles — code quality bars, testing standards, UX and
44
+ performance expectations. Every later phase honors it. See
45
+ [the constitution](./concepts/constitution.md).
46
+
47
+ ## 3. Specify a feature
48
+
49
+ ```
50
+ /amby.specify Add password reset via emailed one-time link
51
+ ```
52
+
53
+ Produces `specs/001-password-reset/spec.md` with user stories (`US-#`), EARS requirements (`FR-###`),
54
+ Given/When/Then acceptance criteria, and success criteria (`SC-###`). Ambiguities are flagged inline
55
+ as `[NEEDS CLARIFICATION: …]`.
56
+
57
+ ## 4. Clarify, design, plan, break down
58
+
59
+ ```
60
+ /amby.clarify # answer open questions; markers get resolved in place
61
+ /amby.design # ui.md + design-tokens.json (with a sign-off gate)
62
+ /amby.plan # plan.md — the technical HOW
63
+ /amby.tasks # tasks.md — ordered, dependency-aware checklist
64
+ /amby.analyze # cross-check spec ↔ plan ↔ tasks before you build
65
+ ```
66
+
67
+ Need to grow a feature that's already specced? `/amby.revise` continues the spec (or `ui.md`) **in
68
+ place** — adding stories and requirements and refining existing ones while preserving every stable
69
+ ID. Use it instead of `/amby.specify`, which starts a new feature.
70
+
71
+ ## 5. Implement and track
72
+
73
+ ```
74
+ /amby.implement # work through tasks.md, checking off tasks as it goes
75
+ /amby.converge # check the code against spec/plan/tasks; gaps become new tasks
76
+ ```
77
+
78
+ Repeat `implement → converge` until converge reports **converged** — it never edits code, only
79
+ appends tasks and updates story status.
80
+
81
+ From the terminal, watch progress across the story/task graph:
82
+
83
+ ```bash
84
+ npx ambykit dashboard # overview: progress, blockers, next tasks, burndown
85
+ npx ambykit dashboard 001:US-3 # detail for one story (qualify id with the feature ref)
86
+ ```
87
+
88
+ ## 6. Keep it current
89
+
90
+ ```bash
91
+ ambykit check # doctor: verify your integrations and report drift
92
+ ambykit update # update the CLI, then refresh this project's generated prompts
93
+ ```
94
+
95
+ ## Where things live
96
+
97
+ ```
98
+ .amby/constitution.md your project principles
99
+ .amby/config.json which tools are enabled
100
+ specs/NNN-feature/
101
+ spec.md ui.md design-tokens.json plan.md tasks.md
102
+ AGENTS.md shared instructions (native to most tools)
103
+ CLAUDE.md Claude Code bridge (imports @AGENTS.md)
104
+ ```
105
+
106
+ Next: [the workflow in detail](./workflow.md).
package/docs/index.md ADDED
@@ -0,0 +1,35 @@
1
+ # AmbyKit Documentation
2
+
3
+ AmbyKit is a **Spec-Driven Development (SDD)** framework for AI coding assistants. You describe
4
+ *what* to build as structured, testable artifacts; AmbyKit gives your assistant a disciplined
5
+ workflow to turn those artifacts into working software — and it works across every assistant your
6
+ team uses.
7
+
8
+ ## The core idea: WHAT before HOW
9
+
10
+ Most AI coding failures are requirements failures. AmbyKit separates the two concerns that usually
11
+ get tangled:
12
+
13
+ - **WHAT / WHY** — `spec.md`: user stories and testable requirements, with **no technology decisions**.
14
+ - **HOW** — `plan.md`: the technical approach, stack, and architecture, derived from the spec.
15
+
16
+ Between them sits a first-class **UI design** step (`ui.md` + `design-tokens.json`) that most spec
17
+ tools omit.
18
+
19
+ ## Author once, emit per tool
20
+
21
+ You write the workflow and artifacts once. AmbyKit's **emitters** compile them into each assistant's
22
+ native format — Claude Code, OpenCode, GitHub Copilot (VS Code + CLI), Cursor (+ CLI), Antigravity
23
+ (IDE + CLI). One source of truth, no per-tool drift. See [architecture](./architecture.md).
24
+
25
+ ## Read next
26
+
27
+ - [Getting started](./getting-started.md) — install and run your first feature.
28
+ - [The workflow](./workflow.md) — the eleven phases in order.
29
+ - Concepts: [Spec-Driven Development](./concepts/spec-driven-development.md) ·
30
+ [The constitution](./concepts/constitution.md)
31
+ - Artifacts: [spec](./artifacts/spec.md) · [UI design](./artifacts/ui-design.md) ·
32
+ [plan](./artifacts/plan.md) · [tasks](./artifacts/tasks.md)
33
+ - [Tool compatibility](./tool-compatibility.md) — exact paths & formats per assistant.
34
+ - [CLI reference](./cli-reference.md)
35
+ - [Architecture](./architecture.md) · [Contributing](./contributing.md)
@@ -0,0 +1,78 @@
1
+ # Tool compatibility
2
+
3
+ Exact paths and formats AmbyKit emits for each supported assistant. Verified against official docs
4
+ (mid-2026). This is the source of truth for the emitters in `src/emitters/` — keep it in sync when a
5
+ tool's format changes.
6
+
7
+ ## Selectable targets → emitters
8
+
9
+ Several targets share one emitter's output (why `BaseEmitter` + thin subclasses exist):
10
+
11
+ | Target | Emitter | Command surface |
12
+ |---|---|---|
13
+ | Claude Code (CLI) | `ClaudeEmitter` | `commands` |
14
+ | Claude Code (VS Code extension) | `ClaudeEmitter` | identical to CLI |
15
+ | GitHub Copilot (VS Code extension) | `CopilotEmitter` | `commands` |
16
+ | GitHub Copilot CLI (`copilot`) | `CopilotCliEmitter` | `skills` (no prompt files) |
17
+ | OpenCode | `OpenCodeEmitter` | `commands` |
18
+ | Cursor | `CursorEmitter` | `commands` |
19
+ | Cursor CLI (`cursor-agent`) | `CursorCliEmitter` | `none` (rules-only) |
20
+ | Antigravity (IDE) | `AntigravityEmitter` | `workflows` |
21
+ | Antigravity CLI (`agy`) | `AntigravityCliEmitter` | reuses Antigravity |
22
+ | Codex CLI (`codex`) | `CodexEmitter` | `skills` |
23
+
24
+ ## Matrix
25
+
26
+ | Concern | Claude Code | OpenCode | Copilot (VS Code) | Copilot CLI | Cursor | Cursor CLI | Antigravity | Codex CLI |
27
+ |---|---|---|---|---|---|---|---|---|
28
+ | Rules file | `CLAUDE.md` (+`@AGENTS.md` bridge) | `AGENTS.md` | `.github/copilot-instructions.md` + `AGENTS.md` | same as Copilot VS Code | `.cursor/rules/*.mdc` + `AGENTS.md` | Cursor config + `AGENTS.md` | `AGENTS.md` (+`GEMINI.md`) + `.agents/rules/*.md` | `AGENTS.md` |
29
+ | Commands/prompts | `.claude/commands/amby/*.md` | `.opencode/commands/*.md` | `.github/prompts/*.prompt.md` | **none** → skills | `.cursor/commands/*.md` | none | `.agents/workflows/*.md` | `.agents/skills/*/SKILL.md` |
30
+ | Command frontmatter | `description`, `argument-hint`, `allowed-tools`, `model` | `description`, `agent`, `model`, `subtask` | `description`, `name`, `agent`, `model`, `tools` | (skills) `name`, `description`, `allowed-tools` | plain body | — | `description` (+ `// turbo` line) | `name`, `description` |
31
+ | Scoped instructions | `.claude/rules/*.md` (`paths:`) | `instructions[]` in `opencode.json` | `.github/instructions/*.instructions.md` (`applyTo`) | same (`applyTo`, `excludeAgent`) | `.mdc` `globs`/`alwaysApply` | via `.mdc` | `.agents/rules/*.md` | nested `AGENTS.md`/`AGENTS.override.md` per directory (no glob key) |
32
+ | Args placeholder | `$ARGUMENTS`, `$N`, `$name` | `$ARGUMENTS`, `$1` | `${input:x}` | — | prompt text | — | steps in body | none — trailing free text only (AmbyKit reworks `$ARGUMENTS` into prose) |
33
+ | Agents | `.claude/agents/*.md` | `.opencode/agents/*.md` | `.github/agents/*.agent.md` | `.github/agents/*.agent.md` | UI modes (no file) | — | none (SDK only) | none (skills only) |
34
+ | Agent frontmatter | `name`*, `description`*, `tools`, `model` (body = system prompt) | `description`* (+`mode`, `permission`; filename = id) | `description`*, `name`, `tools` | same as Copilot VS Code | — | — | — | — |
35
+ | MCP file | `.mcp.json` | `opencode.json` → `mcp` | `.vscode/mcp.json` | `~/.copilot/mcp-config.json` (user) | `.cursor/mcp.json` | reads `.cursor/mcp.json` | `mcp_config.json` (user) | `.codex/config.toml` (TOML) — **out of scope**, AmbyKit does not write it |
36
+ | MCP top-level key | (per-server `type`) | `mcp` | `servers` | `mcpServers` | `mcpServers` | — | `mcpServers` | `mcp_servers.<id>` (not written) |
37
+ | AGENTS.md native | No (bridge) | Yes | Yes (opt-in) | Yes | Yes | Yes | Yes | Yes |
38
+
39
+ ## Gotchas the emitters encode
40
+
41
+ - **Claude Code does not read `AGENTS.md`.** Emit a `CLAUDE.md` whose first line is `@AGENTS.md` (or a
42
+ symlink) so there's a single shared rules source. This bridge line is preserved (re-added if missing)
43
+ when merging into an existing `CLAUDE.md`.
44
+ - **Rules files are merged, not overwritten.** Every rules file wraps AmbyKit's content in a
45
+ `### AmbyKit usage` section so it can be spliced into a file the user already authored; only that
46
+ section is AmbyKit's. (Command/prompt/skill/workflow files remain fully generated and overwritten.)
47
+ - **MCP top-level key differs**: `servers` (Copilot VS Code) vs `mcpServers` (Cursor, Copilot CLI,
48
+ Antigravity) vs `mcp` (OpenCode) vs per-server `type` blocks (Claude `.mcp.json`).
49
+ - **MCP scope differs**: Copilot CLI and Antigravity use **user-level** files outside the repo — AmbyKit
50
+ writes these only with explicit consent and excludes them from the "repo in sync" check.
51
+ - **Scoped-instruction key differs**: Copilot `applyTo` vs Cursor `globs` (+ `alwaysApply`).
52
+ - **Command surface differs**: Copilot CLI has no `.prompt.md`; phases map to `SKILL.md`. Antigravity
53
+ uses `.agents/workflows/*.md` with a `// turbo` line to auto-run a step. Cursor CLI is rules-only.
54
+ - **OpenCode** uses plural dirs (`agents/`, `commands/`) and `provider/model-id` model strings.
55
+ - **Antigravity** dir is `.agents/` (plural); `.agent/` is legacy read-compat.
56
+ - **Codex** shares the `.agents/` root with Antigravity but a different subdirectory (`skills/` vs
57
+ `workflows/`) — the two coexist without collision when both targets are selected. Codex's skills
58
+ frontmatter has no argument-placeholder key, so AmbyKit rewrites the neutral `$ARGUMENTS` token into
59
+ prose rather than leaving a literal, un-substituted placeholder in the emitted `SKILL.md`. Codex's
60
+ deprecated, user-level custom-prompts mechanism (`~/.codex/prompts/`, which does support
61
+ placeholders) is intentionally not targeted — see `specs/008-codex-integration/spec.md` FR-003/
62
+ FR-004. Codex also resolves nested `AGENTS.md`/`AGENTS.override.md` files per directory (closer
63
+ wins) with a 32 KiB combined-size cap; AmbyKit does not special-case this, consistent with every
64
+ other `AGENTS.md`-native tool.
65
+
66
+ ## To verify against a live install
67
+
68
+ Docs conflicted on a couple of points; confirm before shipping those emitters:
69
+
70
+ - Antigravity `.agents/` vs `.agent/` default on the targeted version.
71
+ - Whether the `agy` CLI's `--output-format json` exists.
72
+
73
+ ## Sources
74
+
75
+ Claude Code: code.claude.com/docs · OpenCode: opencode.ai/docs · Copilot: code.visualstudio.com/docs
76
+ and docs.github.com/copilot · Cursor: cursor.com/docs · Antigravity: antigravity.google/docs and
77
+ Google Cloud blog. Codex CLI: developers.openai.com/codex (skills, custom prompts, config reference,
78
+ AGENTS.md guide). AGENTS.md standard: agents.md.
@@ -0,0 +1,109 @@
1
+ # The AmbyKit workflow
2
+
3
+ Eleven phases, each a slash command in your assistant, each producing or updating one artifact. The
4
+ happy path is **specify → design → plan → tasks → implement**, with `constitution` once up front and
5
+ `clarify`/`revise`/`analyze`/`converge`/`review` when you need them.
6
+
7
+ | Phase | Command | Reads | Writes |
8
+ |---|---|---|---|
9
+ | Governance (once) | `/amby.constitution` | — | `.amby/constitution.md` |
10
+ | Specify (WHAT/WHY) | `/amby.specify` | constitution | `specs/NNN/spec.md` |
11
+ | Clarify | `/amby.clarify` | spec | spec (resolves markers) |
12
+ | Revise | `/amby.revise` | spec, ui | spec / ui (continues in place) |
13
+ | Design (UI) | `/amby.design` | spec | `ui.md`, `design-tokens.json` |
14
+ | Plan (HOW) | `/amby.plan` | spec, ui | `plan.md` (+ `data-model.md`, `contracts/`) |
15
+ | Tasks | `/amby.tasks` | plan | `tasks.md` |
16
+ | Analyze | `/amby.analyze` | all | consistency report |
17
+ | Implement | `/amby.implement` | tasks (one slice) | code + task/status updates |
18
+ | Converge | `/amby.converge` | spec, plan, tasks + code | `tasks.md` (appends gap tasks), story status |
19
+ | Review | `/amby.review` | any artifact + a role | findings (advisory); the artifact only with `--apply` |
20
+
21
+ ## 1. Constitution
22
+
23
+ Durable, project-wide principles that constrain every feature. Written once, revised rarely. See
24
+ [the constitution](./concepts/constitution.md).
25
+
26
+ ## 2. Specify — the WHAT and WHY
27
+
28
+ Describe the feature in business terms. The spec contains **no technology choices**. It defines user
29
+ stories with priorities, EARS functional requirements, Given/When/Then acceptance criteria, and
30
+ measurable success criteria. Unknowns become `[NEEDS CLARIFICATION: …]` markers rather than
31
+ guesses. See [the spec artifact](./artifacts/spec.md).
32
+
33
+ ## 3. Clarify
34
+
35
+ Walks the open `[NEEDS CLARIFICATION]` markers, asks you targeted questions, and edits **only** those
36
+ lines — cheap and non-destructive.
37
+
38
+ ## 4. Revise
39
+
40
+ Continues an existing feature: adds new user stories, requirements, and success criteria and refines
41
+ existing ones **in place**, preserving every stable ID. Distinct from `specify` (new feature) and
42
+ `clarify` (markers only). If the spec is already `done` it makes no edits and points you to
43
+ `/amby.specify`; otherwise it sets the spec `in-progress` and leaves completed stories untouched. Can
44
+ also extend an existing `ui.md`.
45
+
46
+ ## 5. Design — UI as a first-class artifact
47
+
48
+ Produces `ui.md` (layout/wireframe, component inventory with props and states, interaction criteria)
49
+ and `design-tokens.json` (primitive → semantic → component tokens). A **sign-off gate** makes the
50
+ approved UI binding for `plan`/`tasks`/`implement`. See [UI design](./artifacts/ui-design.md).
51
+
52
+ ## 6. Plan — the HOW
53
+
54
+ The first place technology appears. Chooses the stack and architecture consistent with the
55
+ constitution, and generates supporting artifacts (`data-model.md`, `contracts/`, `research.md`) as
56
+ needed. See [the plan artifact](./artifacts/plan.md).
57
+
58
+ ## 7. Tasks
59
+
60
+ Turns the plan into an ordered, dependency-aware checklist: stable `T###` IDs, `[P]` parallel
61
+ markers, `[US#]` story tags, and file paths, grouped so foundational work precedes feature work. See
62
+ [the tasks artifact](./artifacts/tasks.md).
63
+
64
+ ## 8. Analyze
65
+
66
+ Cross-checks spec ↔ plan ↔ tasks for coverage gaps and inconsistencies, and validates the story
67
+ **dependency graph** (cycles, dangling references, orphan stories, what's currently unblocked).
68
+
69
+ ## 9. Implement
70
+
71
+ Executes tasks one slice at a time, checking off `tasks.md` checkboxes and updating each story's
72
+ `status:` as it goes — which is what `ambykit dashboard` reports on.
73
+
74
+ ## 10. Converge
75
+
76
+ Closes the loop after implementation: checks the code against every `FR-###`/`SC-###`, plan
77
+ decision, and checked task; appends one unchecked task per gap under `## Convergence` in `tasks.md`
78
+ (`[VERIFY]` for inconclusive items); marks fully covered stories `done`. Append-only and idempotent —
79
+ it never edits source. Loop `implement → converge` until it reports **converged**.
80
+
81
+ ## 11. Review
82
+
83
+ Asks a *different* role to critique an artifact — QA on a spec or task list, the Architect on a
84
+ plan, the PM on a UI design, or any role via `--as <id>`. Findings are one per line, each tied to a
85
+ stable ID with severity and a suggested fix; nothing is modified. `--apply` patches the artifact in
86
+ place (IDs are never renumbered) and appends a `## Reviews` record. Advisory, like `analyze`.
87
+
88
+ ## Roles
89
+
90
+ Every phase acts as a role defined in `.amby/roles/<id>.md` (PM, UX Designer, Architect, Tech
91
+ Lead, Developer, QA by default — project-owned and editable, ≤ 150 words each). Phases load only
92
+ their role, by path; pass `--as <id>` to any phase for a one-run alternative perspective. `sync`
93
+ warns on oversized roles and refuses duplicate ids; `check` reports removed defaults.
94
+
95
+ ## Parallel features (worktrees)
96
+
97
+ Every feature has its own branch; `ambykit worktree <feature>` gives it its own **working copy** at
98
+ `.worktrees/<feature>/` so two features — or two assistants — can progress side by side with no
99
+ checkout switching. Inside a worktree, every phase resolves "the current feature" from the directory
100
+ name. Opt in at `ambykit init` (or `"worktrees": true` in `.amby/config.json`) and `/amby.specify`
101
+ creates the worktree for each new feature; `ambykit worktree list|remove` and `ambykit check` keep
102
+ them tidy.
103
+
104
+ ## Dependencies & prioritization
105
+
106
+ Stories and features carry `priority` (P1/P2/P3) and `depends-on`/`blocked-by` references by stable
107
+ ID. `tasks` orders work topologically within the foundational-first gate; `analyze` validates the
108
+ graph; `dashboard` shows blocked vs. buildable. See [the spec artifact](./artifacts/spec.md) for the
109
+ metadata shape.