@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,42 @@
1
+ import { type StoryProgress } from "./dashboard.js";
2
+ import { type AttentionItem, type FeatureRow, type FeatureSnapshot, type Filters, type Overview, type OverviewOptions, type ParseIssue, type Phase, type Status, type Summary } from "./overview-types.js";
3
+ /**
4
+ * Compute the dashboard overview from feature snapshots (feature 014). Pure — no filesystem, no
5
+ * model tokens (FR-001). Filters apply once, before any aggregate, so every widget agrees (FR-011).
6
+ * Dependencies resolve against the unfiltered set, so a filtered story still sees its blockers.
7
+ */
8
+ export declare function computeOverview(features: FeatureSnapshot[], filters?: Filters, opts?: OverviewOptions, issues?: ParseIssue[]): Overview;
9
+ /**
10
+ * Narrow features to the filters (I-9). `feature` matches the ref (`014`) or the directory name.
11
+ * With a status filter, each feature keeps only matching stories and their tasks; features left with
12
+ * no matching story drop out.
13
+ */
14
+ export declare function applyFilters(features: FeatureSnapshot[], filters: Filters): FeatureSnapshot[];
15
+ /** Headline numbers for the summary cards (FR-002, I-1). */
16
+ export declare function summarize(features: FeatureSnapshot[]): Summary;
17
+ /** A feature is done when it has stories and every one is done. */
18
+ export declare function isFeatureDone(f: FeatureSnapshot): boolean;
19
+ /** Map a story's status onto the fixed set; empty or unknown values count as `other` (I-2). */
20
+ export declare function statusOf(s: StoryProgress): Status;
21
+ /** Story count per status, in display order, zero entries omitted (FR-003). */
22
+ export declare function statusCounts(features: FeatureSnapshot[]): Partial<Record<Status, number>>;
23
+ /**
24
+ * The furthest workflow step a feature has reached (ui.md US-5 PhaseLabel, I-7). A missing `ui.md`
25
+ * never blocks later phases.
26
+ */
27
+ export declare function phaseOf(f: FeatureSnapshot): Phase;
28
+ /** One row of the feature completion chart (FR-004, FR-005, FR-010). */
29
+ export declare function featureRow(f: FeatureSnapshot): FeatureRow;
30
+ /** Feature-qualified, unambiguous story key for display, e.g. `014:US-3` or `008-alpha:US-1`. */
31
+ export declare function storyLabel(f: FeatureSnapshot, s: StoryProgress): string;
32
+ /**
33
+ * Attention items for the scoped stories (FR-007, FR-008, I-4): graph problems first, then blocked
34
+ * (status `blocked` or a `blocked-by` target not done — done blockers are dropped), then waiting (a
35
+ * `depends-on` target not done). Each story appears once, in its highest-ranked kind.
36
+ */
37
+ export declare function attentionItems(all: FeatureSnapshot[], scoped: FeatureSnapshot[]): AttentionItem[];
38
+ /**
39
+ * Next ready tasks (FR-009, I-6): undone tasks whose story is not in Attention (unassigned tasks
40
+ * allowed), in feature order then `T###`, capped. `allDone` means nothing is left open at all.
41
+ */
42
+ export declare function upNext(scoped: FeatureSnapshot[], attention: AttentionItem[], cap: number): Overview["upNext"];
@@ -0,0 +1,259 @@
1
+ import { canonicalStoryId } from "./dashboard.js";
2
+ import { STATUS_ORDER, } from "./overview-types.js";
3
+ /**
4
+ * Compute the dashboard overview from feature snapshots (feature 014). Pure — no filesystem, no
5
+ * model tokens (FR-001). Filters apply once, before any aggregate, so every widget agrees (FR-011).
6
+ * Dependencies resolve against the unfiltered set, so a filtered story still sees its blockers.
7
+ */
8
+ export function computeOverview(features, filters = {}, opts = { upNextCap: 5 }, issues = []) {
9
+ const scoped = applyFilters(features, filters);
10
+ const attention = attentionItems(features, scoped);
11
+ return {
12
+ summary: summarize(scoped),
13
+ statusCounts: statusCounts(scoped),
14
+ features: scoped.map(featureRow),
15
+ attention,
16
+ upNext: upNext(scoped, attention, opts.upNextCap),
17
+ issues,
18
+ };
19
+ }
20
+ /**
21
+ * Narrow features to the filters (I-9). `feature` matches the ref (`014`) or the directory name.
22
+ * With a status filter, each feature keeps only matching stories and their tasks; features left with
23
+ * no matching story drop out.
24
+ */
25
+ export function applyFilters(features, filters) {
26
+ let out = features;
27
+ if (filters.feature) {
28
+ const f = filters.feature;
29
+ out = out.filter((x) => x.ref === f || x.dir === f || x.displayRef === f);
30
+ }
31
+ if (filters.status) {
32
+ const status = filters.status.toLowerCase();
33
+ out = out
34
+ .map((x) => {
35
+ const stories = x.stories.filter((s) => s.status === status);
36
+ const ids = new Set(stories.map((s) => s.id));
37
+ const tasks = x.tasks ? x.tasks.filter((t) => t.story !== null && ids.has(t.story)) : null;
38
+ return { ...x, stories, tasks };
39
+ })
40
+ .filter((x) => x.stories.length > 0);
41
+ }
42
+ return out;
43
+ }
44
+ /** Headline numbers for the summary cards (FR-002, I-1). */
45
+ export function summarize(features) {
46
+ const stories = features.flatMap((f) => f.stories);
47
+ const tasks = features.flatMap((f) => f.tasks ?? []);
48
+ const tasksDone = tasks.filter((t) => t.done).length;
49
+ return {
50
+ features: features.length,
51
+ featuresDone: features.filter(isFeatureDone).length,
52
+ stories: stories.length,
53
+ storiesDone: stories.filter((s) => s.status === "done").length,
54
+ tasksDone,
55
+ tasksTotal: tasks.length,
56
+ percent: percentOf(tasksDone, tasks.length),
57
+ };
58
+ }
59
+ /** A feature is done when it has stories and every one is done. */
60
+ export function isFeatureDone(f) {
61
+ return f.stories.length > 0 && f.stories.every((s) => s.status === "done");
62
+ }
63
+ /** Map a story's status onto the fixed set; empty or unknown values count as `other` (I-2). */
64
+ export function statusOf(s) {
65
+ return STATUS_ORDER.includes(s.status) && s.status !== "other"
66
+ ? s.status
67
+ : "other";
68
+ }
69
+ /** Story count per status, in display order, zero entries omitted (FR-003). */
70
+ export function statusCounts(features) {
71
+ const counts = {};
72
+ const all = features.flatMap((f) => f.stories);
73
+ for (const status of STATUS_ORDER) {
74
+ const n = all.filter((s) => statusOf(s) === status).length;
75
+ if (n > 0)
76
+ counts[status] = n;
77
+ }
78
+ return counts;
79
+ }
80
+ /**
81
+ * The furthest workflow step a feature has reached (ui.md US-5 PhaseLabel, I-7). A missing `ui.md`
82
+ * never blocks later phases.
83
+ */
84
+ export function phaseOf(f) {
85
+ if (isFeatureDone(f))
86
+ return "done";
87
+ if (f.tasks !== null)
88
+ return f.tasks.some((t) => t.done) ? "implementing" : "tasked";
89
+ if (f.artifacts.plan)
90
+ return "planned";
91
+ if (f.artifacts.ui)
92
+ return "designed";
93
+ return "specified";
94
+ }
95
+ /** One row of the feature completion chart (FR-004, FR-005, FR-010). */
96
+ export function featureRow(f) {
97
+ const tasks = f.tasks ? { done: f.tasks.filter((t) => t.done).length, total: f.tasks.length } : null;
98
+ return {
99
+ ref: f.displayRef,
100
+ name: f.dir,
101
+ tasks,
102
+ percent: tasks ? percentOf(tasks.done, tasks.total) : null,
103
+ phase: phaseOf(f),
104
+ clarifications: f.clarifications.length,
105
+ };
106
+ }
107
+ /** Feature-qualified, unambiguous story key for display, e.g. `014:US-3` or `008-alpha:US-1`. */
108
+ export function storyLabel(f, s) {
109
+ return `${f.displayRef}:${s.displayId}`;
110
+ }
111
+ /**
112
+ * Index stories by a collision-safe key (`dir:id`). `StoryProgress.key` uses the feature number,
113
+ * which two `008-*` features share, so the overview keys by directory instead.
114
+ */
115
+ function indexStories(features) {
116
+ const index = new Map();
117
+ for (const feature of features) {
118
+ for (const story of feature.stories)
119
+ index.set(`${feature.dir}:${story.id}`, { feature, story });
120
+ }
121
+ return index;
122
+ }
123
+ /** Resolve a dependency to a node key: bare ids stay in the story's feature; `NNN:US-1` targets NNN. */
124
+ function resolveDep(features, from, dep) {
125
+ const qualified = /^(\d+)[:/]?(US\d+)$/.exec(canonicalStoryId(dep));
126
+ if (qualified) {
127
+ const target = features.find((f) => f.ref === qualified[1]);
128
+ return `${target?.dir ?? qualified[1]}:${qualified[2]}`;
129
+ }
130
+ return `${from.dir}:${canonicalStoryId(dep)}`;
131
+ }
132
+ /** How a dependency target reads from the referencing story: local id, or qualified when cross-feature. */
133
+ function depLabel(from, target, dep) {
134
+ if (!target)
135
+ return prettyId(dep);
136
+ return target.feature.dir === from.dir ? target.story.displayId : storyLabel(target.feature, target.story);
137
+ }
138
+ /** Keys of every node that sits on a dependency cycle (DFS with coloring). */
139
+ function cycleKeys(index, edges) {
140
+ const color = new Map();
141
+ const stack = [];
142
+ const onCycle = new Set();
143
+ const visit = (key) => {
144
+ color.set(key, 1);
145
+ stack.push(key);
146
+ for (const next of edges(index.get(key))) {
147
+ if (!index.has(next))
148
+ continue;
149
+ const c = color.get(next) ?? 0;
150
+ if (c === 1)
151
+ for (const k of stack.slice(stack.indexOf(next)))
152
+ onCycle.add(k);
153
+ else if (c === 0)
154
+ visit(next);
155
+ }
156
+ stack.pop();
157
+ color.set(key, 2);
158
+ };
159
+ for (const key of index.keys())
160
+ if (!color.has(key))
161
+ visit(key);
162
+ return onCycle;
163
+ }
164
+ /**
165
+ * Attention items for the scoped stories (FR-007, FR-008, I-4): graph problems first, then blocked
166
+ * (status `blocked` or a `blocked-by` target not done — done blockers are dropped), then waiting (a
167
+ * `depends-on` target not done). Each story appears once, in its highest-ranked kind.
168
+ */
169
+ export function attentionItems(all, scoped) {
170
+ const index = indexStories(all);
171
+ const deps = (n, list) => list.map((d) => resolveDep(all, n.feature, d));
172
+ const onCycle = cycleKeys(index, (n) => deps(n, [...n.story.dependsOn, ...n.story.blockedBy]));
173
+ const isDone = (key) => index.get(key)?.story.status === "done";
174
+ const problems = [];
175
+ const blocked = [];
176
+ const waiting = [];
177
+ for (const feature of scoped) {
178
+ for (const story of feature.stories) {
179
+ if (story.status === "done")
180
+ continue;
181
+ const key = storyLabel(feature, story);
182
+ const node = { feature, story };
183
+ const label = (dep) => depLabel(feature, index.get(resolveDep(all, feature, dep)), dep);
184
+ const refs = [
185
+ ...story.dependsOn.map((dep) => ({ field: "depends-on", dep })),
186
+ ...story.blockedBy.map((dep) => ({ field: "blocked-by", dep })),
187
+ ];
188
+ const unknown = refs.filter((r) => !index.has(resolveDep(all, feature, r.dep)));
189
+ if (unknown.length > 0) {
190
+ problems.push({
191
+ key,
192
+ kind: "graph-problem",
193
+ refs: unknown.map((r) => prettyId(r.dep)),
194
+ reason: `${unknown.map((r) => `${r.field} ${prettyId(r.dep)}`).join(", ")} — unknown story`,
195
+ });
196
+ continue;
197
+ }
198
+ const selfKey = `${feature.dir}:${story.id}`;
199
+ if (onCycle.has(selfKey)) {
200
+ const refs = deps(node, [...story.dependsOn, ...story.blockedBy])
201
+ .filter((k) => onCycle.has(k))
202
+ .map((k) => depLabel(feature, index.get(k), k));
203
+ problems.push({ key, kind: "graph-problem", refs, reason: `dependency cycle with ${refs.join(", ")}` });
204
+ continue;
205
+ }
206
+ const openBlockers = story.blockedBy.filter((d) => !isDone(resolveDep(all, feature, d))).map(label);
207
+ if (story.status === "blocked" || openBlockers.length > 0) {
208
+ blocked.push({
209
+ key,
210
+ kind: "blocked",
211
+ refs: openBlockers,
212
+ reason: openBlockers.length > 0 ? `blocked-by ${openBlockers.join(", ")}` : "status: blocked",
213
+ });
214
+ continue;
215
+ }
216
+ const openDeps = story.dependsOn.filter((d) => !isDone(resolveDep(all, feature, d))).map(label);
217
+ if (openDeps.length > 0) {
218
+ waiting.push({ key, kind: "waiting", refs: openDeps, reason: `waiting on ${openDeps.join(", ")}` });
219
+ }
220
+ }
221
+ }
222
+ return [...problems, ...blocked, ...waiting];
223
+ }
224
+ /**
225
+ * Next ready tasks (FR-009, I-6): undone tasks whose story is not in Attention (unassigned tasks
226
+ * allowed), in feature order then `T###`, capped. `allDone` means nothing is left open at all.
227
+ */
228
+ export function upNext(scoped, attention, cap) {
229
+ const held = new Set(attention.map((a) => a.key));
230
+ const candidates = [];
231
+ let open = 0;
232
+ for (const feature of scoped) {
233
+ const byId = new Map(feature.stories.map((s) => [s.id, s]));
234
+ const tasks = [...(feature.tasks ?? [])].sort((a, b) => taskNumber(a) - taskNumber(b));
235
+ for (const t of tasks) {
236
+ if (t.done)
237
+ continue;
238
+ open += 1;
239
+ const story = t.story ? byId.get(t.story) : undefined;
240
+ const storyKey = story ? storyLabel(feature, story) : null;
241
+ if (storyKey && held.has(storyKey))
242
+ continue;
243
+ candidates.push({ taskId: t.id, storyKey, description: t.description, feature: feature.dir });
244
+ }
245
+ }
246
+ return { items: candidates.slice(0, Math.max(0, cap)), eligible: candidates.length, allDone: open === 0 };
247
+ }
248
+ /** Canonical ids (`US9`, `014US2`) back to their written form (`US-9`, `014:US-2`). */
249
+ function prettyId(id) {
250
+ const m = /^(?:(\d+))?US(\d+)$/.exec(id);
251
+ return m ? `${m[1] ? `${m[1]}:` : ""}US-${m[2]}` : id;
252
+ }
253
+ function taskNumber(t) {
254
+ return Number(t.id.slice(1)) || 0;
255
+ }
256
+ function percentOf(done, total) {
257
+ return total === 0 ? null : Math.round((done / total) * 100);
258
+ }
259
+ //# sourceMappingURL=overview.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overview.js","sourceRoot":"","sources":["../../src/core/overview.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAqC,MAAM,gBAAgB,CAAC;AACrF,OAAO,EACL,YAAY,GAYb,MAAM,qBAAqB,CAAC;AAE7B;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAC7B,QAA2B,EAC3B,UAAmB,EAAE,EACrB,OAAwB,EAAE,SAAS,EAAE,CAAC,EAAE,EACxC,SAAuB,EAAE;IAEzB,MAAM,MAAM,GAAG,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC/C,MAAM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
5
+
6
+ ## Author once, emit per tool
7
+
8
+ There is one neutral source of truth. Emitters compile it into each assistant's native format.
9
+
10
+ ```
11
+ src/templates/ ── artifact templates (constitution, spec, ui, design-tokens, plan, tasks)
12
+ src/prompts/ ── neutral phase CommandSpecs (constitution → implement)
13
+ │
14
+ ▼ ambykit init / add / sync
15
+ ┌────────────┐
16
+ │ Emitters │ BaseEmitter + per-tool subclasses
17
+ └────────────┘
18
+ │
19
+ ├── .claude/commands/amby/*.md (ClaudeEmitter)
20
+ ├── .github/prompts/*.prompt.md (CopilotEmitter)
21
+ ├── .github/skills/amby-*/SKILL.md (CopilotCliEmitter)
22
+ ├── .opencode/commands/*.md (OpenCodeEmitter)
23
+ ├── .cursor/commands/*.md + rules (CursorEmitter / CursorCliEmitter)
24
+ ├── .agents/workflows/*.md (AntigravityEmitter / AntigravityCliEmitter)
25
+ └── AGENTS.md (+ CLAUDE.md bridge) (shared rules layer)
26
+ ```
27
+
28
+ On `init`, the neutral source is also copied into the consumer's `.amby/` so their project owns its
29
+ templates and can customize them.
30
+
31
+ ## `BaseEmitter`
32
+
33
+ An abstract class holding all shared state and behavior; each tool is a thin subclass.
34
+
35
+ - **Properties:** `toolId`, `displayName`, `commandDir`, `rulesFile`, `commandSurface`
36
+ (`'commands' | 'skills' | 'workflows' | 'none'`), `supportsAgents`, `mcpConfigPath`,
37
+ `mcpConfigScope` (`'project' | 'user'`), `mcpTopLevelKey`.
38
+ - **Template method** `emit(specs, ctx): EmittedFile[]` — orchestrates: resolve target dir → render
39
+ rules file → render each phase prompt **via `commandSurface`** → render MCP config → collect files.
40
+ Subclasses don't re-implement orchestration.
41
+ - **Overridable hooks:** `commandFrontmatter(spec)`, `commandPath(spec)`, `rulesContent(ctx)`,
42
+ `mcpConfig(servers)`. Defaults live in the base; a subclass overrides only its differences.
43
+ - **Reuse subclasses:** `CursorCliEmitter` (`commandSurface: 'none'`) and `AntigravityCliEmitter`
44
+ reuse a sibling's output; VS Code extension targets resolve to their base tool's emitter unchanged
45
+ via the **target→emitter map** in the registry.
46
+
47
+ Adding a tool = one subclass + a compatibility-matrix row + a snapshot test.
48
+
49
+ ## `BaseCommand`
50
+
51
+ The CLI verbs mirror the same pattern. An abstract `BaseCommand` holds project/`.amby/` discovery,
52
+ config load/save, emitter resolution, tool detection, logging, error handling, and `--dry-run`/
53
+ `--yes`. Its template method `run()` validates context then calls each subclass's `execute()`.
54
+ Subclasses: `InitCommand`, `AddCommand`, `SyncCommand`, `CheckCommand`, `RestoreCommand`,
55
+ `UpgradeCommand`, `DashboardCommand`.
56
+
57
+ ## Non-destructive rules merge (brownfield)
58
+
59
+ Generated **command** files are AmbyKit's alone and are overwritten. **Rules files** (`AGENTS.md`,
60
+ the `CLAUDE.md` bridge, `copilot-instructions.md`, Cursor's `.mdc`) are different: a user may have
61
+ authored them. Each such `EmittedFile` is tagged `merge: "region"`, and the writer (`applyFiles`)
62
+ reconciles it through a pure core (`src/core/merge.ts`) instead of overwriting:
63
+
64
+ - The AmbyKit-owned span is a Markdown section that opens with `### AmbyKit usage` and ends at the
65
+ next same-or-higher heading (or EOF). On a fresh file the whole emitted file is written; on an
66
+ existing file only that region is spliced in, preserving every other byte.
67
+ - A short **fingerprint** is embedded in the region footer. On re-run, a region whose body no longer
68
+ matches its fingerprint was hand-edited, so it is left untouched and reported as *skipped*.
69
+ - Before modifying an existing file, the writer copies it to `.amby/backups/<name>.<ts>.bak`
70
+ (`ambykit restore` reverses this). Backups are outside the emitted set, so `check` stays green.
71
+ - `classifyProject` (`src/core/classify.ts`) labels a project greenfield/brownfield from three
72
+ signals — an existing rules file, non-AmbyKit source files, or a git history — defaulting to the
73
+ safe (non-destructive) path when uncertain.
74
+
75
+ ## Token efficiency
76
+
77
+ Spec generation must be cheap. This is designed into the prompts and templates:
78
+
79
+ - **Progressive disclosure** — each phase loads only the artifact it needs via `@path`
80
+ (specify→constitution, plan→spec, tasks→plan, implement→one task slice). Reference material (EARS
81
+ guide, examples) lives in separate on-demand files, not inlined in every prompt.
82
+ - **Reference by stable ID** — downstream artifacts cite `US-#`/`FR-###`/`SC-###` instead of copying
83
+ text.
84
+ - **Patch, don't regenerate** — `clarify` edits only clarification markers; `implement` flips
85
+ checkboxes and updates `status:` in place.
86
+ - **Structured over prose for machine reads** — `dashboard` and `analyze` parse frontmatter and
87
+ checkboxes locally in the CLI at **zero model tokens**; only generative phases call the model.
88
+
89
+ ## Self-hosting
90
+
91
+ AmbyKit is built with AmbyKit. The repo's own `.claude/` (and other tool files) are generated by
92
+ `ambykit sync` from `src/prompts/`; CI asserts `sync` produces no diff so the repo stays a faithful
93
+ consumer of itself. See [contributing](./contributing.md).
@@ -0,0 +1,31 @@
1
+ # Artifact: `plan.md`
2
+
3
+ The plan defines **HOW** the feature is built. It is the first artifact where technology appears.
4
+ Produced by `/amby.plan` from the approved spec and UI design; must stay consistent with the
5
+ [constitution](../concepts/constitution.md).
6
+
7
+ ## Sections
8
+
9
+ 1. **Technical context** — chosen stack, key libraries, and the constraints that drove them.
10
+ 2. **Architecture** — components, boundaries, and how they interact (diagrams welcome).
11
+ 3. **Phased approach** — Phase 0 research → Phase 1 foundation (data model, contracts) → later phases.
12
+ 4. **Requirement mapping** — how the design satisfies each `FR-###`/`US-#` (reference by ID, don't
13
+ restate).
14
+ 5. **Risks & decisions** — trade-offs made and why.
15
+
16
+ ## Supporting artifacts (generated as needed)
17
+
18
+ - **`data-model.md`** — entities, fields, relationships, invariants.
19
+ - **`contracts/`** — API/interface specs (`openapi.yaml`, `events.md`, etc.).
20
+ - **`research.md`** — technology evaluations and decisions with rationale.
21
+
22
+ ## Consistency
23
+
24
+ `/amby.analyze` cross-checks the plan against the spec: every `FR-###` should be addressed, and the
25
+ plan should not introduce requirements that aren't in the spec (scope creep). Because the plan
26
+ references spec IDs rather than copying text, changes to the spec are easy to trace forward.
27
+
28
+ ## Token efficiency
29
+
30
+ The plan links to the spec and UI artifacts by `@path` and cites IDs; it does not duplicate their
31
+ content. This keeps the plan small and the downstream `tasks`/`implement` phases cheap to run.
@@ -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.