@ambystech/ambykit 1.0.0 → 1.1.1

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 (86) hide show
  1. package/CHANGELOG.md +103 -0
  2. package/README.md +65 -21
  3. package/dist/cli/check.d.ts +2 -0
  4. package/dist/cli/check.js +39 -0
  5. package/dist/cli/check.js.map +1 -1
  6. package/dist/cli/index.js +2 -0
  7. package/dist/cli/index.js.map +1 -1
  8. package/dist/cli/init.js +17 -3
  9. package/dist/cli/init.js.map +1 -1
  10. package/dist/cli/sync.js +10 -0
  11. package/dist/cli/sync.js.map +1 -1
  12. package/dist/cli/ui/interactive/prompt.d.ts +11 -0
  13. package/dist/cli/ui/interactive/prompt.js +37 -0
  14. package/dist/cli/ui/interactive/prompt.js.map +1 -1
  15. package/dist/cli/worktree.d.ts +18 -0
  16. package/dist/cli/worktree.js +161 -0
  17. package/dist/cli/worktree.js.map +1 -0
  18. package/dist/core/command-spec.js +2 -0
  19. package/dist/core/command-spec.js.map +1 -1
  20. package/dist/core/config.js +1 -0
  21. package/dist/core/config.js.map +1 -1
  22. package/dist/core/emit.js +2 -1
  23. package/dist/core/emit.js.map +1 -1
  24. package/dist/core/git.d.ts +33 -0
  25. package/dist/core/git.js +104 -0
  26. package/dist/core/git.js.map +1 -0
  27. package/dist/core/index.d.ts +3 -0
  28. package/dist/core/index.js +3 -0
  29. package/dist/core/index.js.map +1 -1
  30. package/dist/core/paths.d.ts +2 -0
  31. package/dist/core/paths.js +4 -0
  32. package/dist/core/paths.js.map +1 -1
  33. package/dist/core/roles.d.ts +19 -0
  34. package/dist/core/roles.js +59 -0
  35. package/dist/core/roles.js.map +1 -0
  36. package/dist/core/rules.js +6 -1
  37. package/dist/core/rules.js.map +1 -1
  38. package/dist/core/scaffold.d.ts +2 -0
  39. package/dist/core/scaffold.js +6 -1
  40. package/dist/core/scaffold.js.map +1 -1
  41. package/dist/core/types.d.ts +18 -0
  42. package/dist/core/worktree.d.ts +78 -0
  43. package/dist/core/worktree.js +121 -0
  44. package/dist/core/worktree.js.map +1 -0
  45. package/dist/emitters/base-emitter.d.ts +19 -2
  46. package/dist/emitters/base-emitter.js +43 -3
  47. package/dist/emitters/base-emitter.js.map +1 -1
  48. package/dist/emitters/claude.d.ts +3 -1
  49. package/dist/emitters/claude.js +12 -0
  50. package/dist/emitters/claude.js.map +1 -1
  51. package/dist/emitters/copilot.d.ts +3 -1
  52. package/dist/emitters/copilot.js +11 -0
  53. package/dist/emitters/copilot.js.map +1 -1
  54. package/dist/emitters/opencode.d.ts +3 -1
  55. package/dist/emitters/opencode.js +11 -0
  56. package/dist/emitters/opencode.js.map +1 -1
  57. package/docs/architecture.md +93 -0
  58. package/docs/artifacts/plan.md +31 -0
  59. package/docs/artifacts/spec.md +70 -0
  60. package/docs/artifacts/tasks.md +40 -0
  61. package/docs/artifacts/ui-design.md +59 -0
  62. package/docs/cli-reference.md +167 -0
  63. package/docs/concepts/constitution.md +35 -0
  64. package/docs/concepts/spec-driven-development.md +34 -0
  65. package/docs/contributing.md +50 -0
  66. package/docs/getting-started.md +106 -0
  67. package/docs/index.md +35 -0
  68. package/docs/tool-compatibility.md +78 -0
  69. package/docs/workflow.md +109 -0
  70. package/package.json +15 -3
  71. package/src/prompts/analyze.md +1 -0
  72. package/src/prompts/clarify.md +1 -0
  73. package/src/prompts/converge.md +27 -0
  74. package/src/prompts/design.md +1 -0
  75. package/src/prompts/implement.md +1 -0
  76. package/src/prompts/plan.md +1 -0
  77. package/src/prompts/review.md +24 -0
  78. package/src/prompts/revise.md +1 -0
  79. package/src/prompts/specify.md +6 -2
  80. package/src/prompts/tasks.md +1 -0
  81. package/src/roles/architect.md +17 -0
  82. package/src/roles/developer.md +17 -0
  83. package/src/roles/pm.md +17 -0
  84. package/src/roles/qa.md +17 -0
  85. package/src/roles/tech-lead.md +17 -0
  86. package/src/roles/ux.md +17 -0
@@ -0,0 +1,70 @@
1
+ # Artifact: `spec.md`
2
+
3
+ The specification defines **WHAT** to build and **WHY**, with no technology decisions. Produced by
4
+ `/amby.specify`, refined by `/amby.clarify`. One `spec.md` per feature under `specs/NNN-feature/`.
5
+
6
+ ## Sections
7
+
8
+ 1. **Metadata** — feature ID/slug, branch, status, created date.
9
+ 2. **User Scenarios & Testing** — the user stories.
10
+ 3. **Requirements** — EARS functional requirements.
11
+ 4. **Success Criteria** — measurable, tech-agnostic outcomes.
12
+ 5. **Edge Cases** and **Assumptions**.
13
+
14
+ ## User stories
15
+
16
+ Each story is independently testable and prioritized:
17
+
18
+ ```markdown
19
+ ### US-1 — Reset password via email (priority: P1)
20
+
21
+ As a registered user, I want to reset my password via an emailed one-time link,
22
+ so that I can regain access without contacting support.
23
+
24
+ - **Why P1:** account lockout is the top support driver.
25
+ - **Independent test:** can be demoed alone as a viable slice.
26
+ - **depends-on:** [] # e.g. [US-0] to block until a prerequisite ships
27
+ - **status:** draft # draft | ready | in-progress | blocked | done
28
+
29
+ **Acceptance criteria**
30
+ - Given a registered email, When a reset is requested, Then a one-time link is sent within 30s.
31
+ - Given an expired link, When it is opened, Then the user is told it expired and offered a new one.
32
+ ```
33
+
34
+ ## Functional requirements (EARS)
35
+
36
+ Numbered `FR-###`, using [EARS](https://alistairmavin.com/ears/) patterns — unambiguous and directly
37
+ testable:
38
+
39
+ ```markdown
40
+ - FR-001 WHEN a reset is requested for a known email, THE SYSTEM SHALL send a one-time link.
41
+ - FR-002 WHILE a reset link is unused and unexpired, THE SYSTEM SHALL accept it exactly once.
42
+ - FR-003 IF a reset link is older than 15 minutes, THEN THE SYSTEM SHALL reject it.
43
+ - FR-004 WHERE email delivery is configured, THE SYSTEM SHALL record a delivery audit entry.
44
+ ```
45
+
46
+ EARS keywords: **ubiquitous** (SHALL), **WHEN** (event), **WHILE** (state), **IF/THEN** (unwanted
47
+ behavior), **WHERE** (optional feature).
48
+
49
+ ## Success criteria
50
+
51
+ ```markdown
52
+ - SC-001 95% of reset emails are delivered within 30 seconds.
53
+ - SC-002 Password reset completion rate ≥ 80% for users who start it.
54
+ ```
55
+
56
+ ## Ambiguity markers
57
+
58
+ Unknowns are flagged inline, never guessed:
59
+
60
+ ```markdown
61
+ - FR-005 THE SYSTEM SHALL lock the account after [NEEDS CLARIFICATION: how many?] failed attempts.
62
+ ```
63
+
64
+ `/amby.clarify` walks these, asks you, and edits only those lines.
65
+
66
+ ## IDs & traceability
67
+
68
+ Stable IDs (`US-#`, `FR-###`, `SC-###`) let downstream artifacts reference the spec instead of
69
+ restating it. `tasks.md` tags each task with its `[US#]`; `analyze` builds a traceability view
70
+ story → requirements → tasks and validates the `depends-on`/`blocked-by` graph.
@@ -0,0 +1,40 @@
1
+ # Artifact: `tasks.md`
2
+
3
+ An ordered, dependency-aware checklist that turns the plan into executable work. Produced by
4
+ `/amby.tasks`; consumed by `/amby.implement` and by `ambykit dashboard`.
5
+
6
+ ## Task line format
7
+
8
+ ```
9
+ - [ ] [T001] [P] [US1] Create reset_tokens table and migration (db/migrations/003_reset_tokens.sql)
10
+ ```
11
+
12
+ - **checkbox** `- [ ]` / `- [x]` — completion state; the **source of truth** for `dashboard` progress.
13
+ - **`T###`** — stable task ID.
14
+ - **`[P]`** — optional; the task is parallelizable with its siblings.
15
+ - **`[US#]`** — the user story this task serves (enables story-level progress roll-up).
16
+ - **description (file path)** — what to do and where.
17
+
18
+ ## Phase grouping
19
+
20
+ Tasks are grouped so structure precedes features:
21
+
22
+ 1. **Setup** — tooling, scaffolding.
23
+ 2. **Foundational** — shared infrastructure that everything depends on. **Blocks all feature work.**
24
+ 3. **User stories** — grouped by story and priority, each ending in a checkpoint (a demoable slice).
25
+ 4. **Polish** — hardening, docs, cleanup.
26
+
27
+ The **foundational-before-features** gate is enforced: no user-story task starts until foundational
28
+ tasks complete.
29
+
30
+ ## Ordering & dependencies
31
+
32
+ `/amby.tasks` orders tasks by the story **dependency graph** (`depends-on`/`blocked-by`) and
33
+ **priority**, within the phase gate. `[P]` marks tasks that can run concurrently. This supports
34
+ MVP-first, incremental, or parallel-team execution.
35
+
36
+ ## Status flow
37
+
38
+ As `/amby.implement` completes work it flips checkboxes to `- [x]` and updates the corresponding
39
+ story's `status:` in `spec.md`. `ambykit dashboard` reads both — counting checked tasks per `[US#]`
40
+ tag — to report `X of Y tasks done`, `%`, and status per story.
@@ -0,0 +1,59 @@
1
+ # Artifact: `ui.md` + `design-tokens.json`
2
+
3
+ UI design is a **first-class artifact** in AmbyKit — the step most spec tools skip. Produced by
4
+ `/amby.design` from the spec, with a **sign-off gate**: once you approve it, the UI is binding for
5
+ `plan`, `tasks`, and `implement`.
6
+
7
+ ## `ui.md`
8
+
9
+ Captures the interface for each relevant user story:
10
+
11
+ 1. **Layout / wireframe** — ASCII sketch or embedded SVG showing structure and hierarchy.
12
+ 2. **Component inventory** — each component with its props, states (default/hover/disabled/loading/
13
+ error/empty), and the design tokens it uses.
14
+ 3. **Interaction criteria** — behavior in Given/When/Then, tied back to the story's `US-#`.
15
+ 4. **Content & accessibility** — copy, empty/error states, focus order, contrast, ARIA needs.
16
+
17
+ ```markdown
18
+ ## US-1 — Reset request form
19
+
20
+ Layout:
21
+ +------------------------------------------+
22
+ | Reset your password |
23
+ | [ email____________________ ] |
24
+ | ( Send reset link ) |
25
+ | Back to sign in |
26
+ +------------------------------------------+
27
+
28
+ ### Component: EmailField
29
+ - props: value, onChange, invalid
30
+ - states: default, focus, invalid, disabled
31
+ - tokens: color.semantic.input.border, space.md, radius.sm
32
+
33
+ ### Interaction
34
+ - Given an empty email, When "Send reset link" is pressed, Then the field shows an inline error.
35
+ ```
36
+
37
+ ## `design-tokens.json`
38
+
39
+ Design decisions as data, in three tiers so they compose and stay consistent
40
+ ([why tiers](https://martinfowler.com/articles/design-token-based-ui-architecture.html)):
41
+
42
+ ```jsonc
43
+ {
44
+ "primitive": { "color": { "blue-600": "#2563eb" }, "space": { "4": "16px" } },
45
+ "semantic": { "color": { "action": "{primitive.color.blue-600}" },
46
+ "space": { "md": "{primitive.space.4}" } },
47
+ "component": { "button": { "primary": { "bg": "{semantic.color.action}" } } }
48
+ }
49
+ ```
50
+
51
+ - **primitive** — raw values (palette, scale). No usage meaning.
52
+ - **semantic** — usage-based aliases (`action`, `danger`, `md`).
53
+ - **component** — per-component values referencing semantic tokens.
54
+
55
+ ## The sign-off gate
56
+
57
+ `/amby.design` presents the UI for review. On approval it records the sign-off in `ui.md`; later
58
+ phases treat the approved layout, components, and tokens as constraints rather than suggestions. This
59
+ keeps generated code aligned with an intentional design instead of an ad-hoc one.
@@ -0,0 +1,167 @@
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 drops lower-priority columns rather than wrapping.
21
+ - `--json` output is always unstyled and byte-stable — safe to parse.
22
+
23
+ Multi-step commands (`init`, `add`, `sync`, `update`) show a spinner while working and a
24
+ created/updated/unchanged/skipped summary when done.
25
+
26
+ When a newer AmbyKit is published, an interactive command shows a yellow **"Update available"** callout
27
+ between the banner and its output, naming your installed and the latest version. It's suppressed on
28
+ non-interactive terminals and under `--json`, checks the registry at most once a day, and never blocks
29
+ on network failure. Run [`ambykit update`](#ambykit-update) to upgrade.
30
+
31
+ ## `ambykit init [dir]`
32
+
33
+ Scaffold AmbyKit in a project. Creates `.amby/` (constitution + `config.json`) and `specs/`, detects
34
+ installed assistants, lets you select targets, emits their native files, and writes the shared
35
+ `AGENTS.md` (+ `CLAUDE.md` bridge for Claude Code).
36
+
37
+ **Brownfield-safe.** `init` detects whether a project already exists (an existing rules file,
38
+ non-AmbyKit source files, or a git history) and reports the mode. For rules files it **merges** rather
39
+ than overwrites: existing content is preserved and only AmbyKit's `### AmbyKit usage` section is
40
+ added/updated in place. An existing file is backed up to `.amby/backups/` before it is changed, and a
41
+ section you hand-edited is left untouched (reported as skipped). Use `--dry-run` to preview.
42
+
43
+ ```bash
44
+ npx @ambystech/ambykit init
45
+ npx @ambystech/ambykit init . --yes
46
+ npx @ambystech/ambykit init --dry-run # preview merges, write nothing
47
+ ```
48
+
49
+ ## `ambykit add <tool…>`
50
+
51
+ Add or refresh integration for one or more targets (see [tool compatibility](./tool-compatibility.md)
52
+ for target names). On an interactive terminal, running it with **no target** opens a multi-select
53
+ prompt (`space` toggle, `enter` confirm, `esc` cancel); non-interactively it errors with the list of
54
+ available targets instead of blocking. `init` behaves the same when `--tools` is omitted.
55
+
56
+ ```bash
57
+ ambykit add cursor claude
58
+ ambykit add # interactive tool picker (TTY only)
59
+ ```
60
+
61
+ ## `ambykit sync`
62
+
63
+ Re-emit all configured tools from the neutral source. Run after upgrading AmbyKit or editing
64
+ `.amby/` templates/prompts. Project-scoped files only by default; user-level MCP files are opt-in.
65
+
66
+ `sync` is also the **update path** for existing docs: it merges AmbyKit's section into each configured
67
+ tool's rules file non-destructively (same rules as `init` — preserve, back up, skip hand-edits), so
68
+ running it keeps your agent docs current without a full re-init.
69
+
70
+ ```bash
71
+ ambykit sync
72
+ ambykit sync --dry-run
73
+ ```
74
+
75
+ Also installs any newly shipped templates, reference docs, and **roles** into `.amby/` (write-if-absent —
76
+ your edits are kept), warns when a role in `.amby/roles/` exceeds 150 words, and refuses to emit
77
+ when two roles share an id. Projects with roles get one native sub-agent per role for Claude Code,
78
+ OpenCode, and Copilot.
79
+
80
+ ## `ambykit restore [file]`
81
+
82
+ Recover an agent-doc file (`AGENTS.md`, `CLAUDE.md`, a tool's rules file) from the timestamped backup
83
+ AmbyKit writes to `.amby/backups/` before modifying it. With no argument, lists the backups available
84
+ to restore (newest first).
85
+
86
+ ```bash
87
+ ambykit restore # list available backups
88
+ ambykit restore CLAUDE.md # restore the most recent backup of CLAUDE.md
89
+ ambykit restore CLAUDE.md --dry-run
90
+ ```
91
+
92
+ ## `ambykit worktree <feature> | list | remove <feature>`
93
+
94
+ Per-feature **git worktrees** so several features can be worked on in parallel — by you or by
95
+ several assistants — without checkout switching. Each feature gets its own working copy at
96
+ `.worktrees/<feature>/` (gitignored) on branch `<feature>`, created from the repository's default
97
+ branch when the branch does not exist yet. Zero model tokens.
98
+
99
+ ```bash
100
+ ambykit worktree 004-slug # create .worktrees/004-slug on branch 004-slug
101
+ ambykit worktree list # feature, branch, clean/dirty/merged, path
102
+ ambykit worktree remove 004-slug # delete the working copy (branch is kept); --force if dirty
103
+ ambykit worktree 004-slug --dry-run # show the git command without running it
104
+ ```
105
+
106
+ Creating twice is a no-op; removing a missing one exits 0. `ambykit check` flags worktrees whose
107
+ branch is already merged. Opt in to automatic creation from `/amby.specify` by answering yes at
108
+ `ambykit init`, or set `"worktrees": true` in `.amby/config.json`. Inside a worktree, phases resolve
109
+ "the current feature" from the directory name.
110
+
111
+ ## `ambykit dashboard [story-id]`
112
+
113
+ Progress view over the story/task graph, computed locally from `specs/*/spec.md` + `tasks.md` (no
114
+ model tokens).
115
+
116
+ - **No arg** — a table of all user stories: `Feat | Story | description | X of Y tasks | % | status | priority | blocked-by`, with an overall roll-up.
117
+ - **`story-id`** — detail for one story. Story ids **restart per feature**, so a bare `US-3` may
118
+ match several; qualify it with the feature ref as `NNN:US-3` (also accepts `NNN/US-3`). A bare id
119
+ that matches more than one feature prints the matches so you can pick.
120
+ - **`--interactive`** — opt-in full-screen navigable view (TTY only): `↑`/`↓` move, `enter` opens a
121
+ story's tasks, `←`/`esc` goes back, `q` quits. On a non-interactive terminal it falls back to the
122
+ one-shot table.
123
+
124
+ ```bash
125
+ ambykit dashboard
126
+ ambykit dashboard --interactive # full-screen navigable view (TTY only)
127
+ ambykit dashboard 001:US-3 # feature-qualified (recommended)
128
+ ambykit dashboard --status blocked
129
+ ambykit dashboard --feature 001-password-reset
130
+ ambykit dashboard --json
131
+ ```
132
+
133
+ ## `ambykit analyze`
134
+
135
+ Validate the story dependency graph, computed locally from `specs/` (no model tokens): detects
136
+ **cycles** and **dangling references** (structural errors), and reports **blocked** vs **buildable**
137
+ stories and **orphans** (stories with no tasks). Exits non-zero on structural errors, so it can gate
138
+ CI. Complements the generative `/amby.analyze` phase.
139
+
140
+ ```bash
141
+ ambykit analyze
142
+ ambykit analyze --json
143
+ ```
144
+
145
+ ## `ambykit check`
146
+
147
+ Doctor: verify integrations are present and well-formed and that expected assistant CLIs are
148
+ installed. Reports drift between the neutral source and emitted files, worktrees whose branch is
149
+ already merged, and role problems in `.amby/roles/` (oversized roles, duplicate ids, shipped
150
+ defaults that were deleted — `ambykit sync` reinstalls those).
151
+
152
+ ## `ambykit update`
153
+
154
+ Update the AmbyKit CLI to the latest published version, then refresh this project's tool prompts.
155
+
156
+ When your CLI is **behind**, `update` installs the latest globally and asks you to **re-run** it — the
157
+ first run can only upgrade the CLI, and the re-run (now on the new version) regenerates the prompts. If
158
+ it can't self-update (an `npx` run, or a permissions error) it prints the exact `npm install -g`
159
+ command and leaves your install untouched. When the CLI is already current, it refreshes the configured
160
+ tools' files (a `.amby/` **and** `specs/` dir at the current directory); with nothing to do it prints
161
+ `Everything is up to date`.
162
+
163
+ ```bash
164
+ ambykit update # outdated: upgrades the CLI, then asks you to re-run
165
+ ambykit update # current: refreshes this project's tool prompts
166
+ ambykit update --dry-run # preview the prompt refresh
167
+ ```
@@ -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 # table of all stories with % complete
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)