@ludecker/aaac 1.1.1 → 1.1.2

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 (29) hide show
  1. package/package.json +1 -1
  2. package/src/generators/generate-commands.mjs +17 -9
  3. package/src/run-engine/advance-phase.mjs +2 -2
  4. package/src/run-engine/gate-write.mjs +14 -2
  5. package/src/run-engine/init-run.mjs +41 -0
  6. package/src/run-engine/lib.mjs +33 -0
  7. package/src/run-engine/record-task.mjs +7 -1
  8. package/src/run-engine/stop-check.mjs +7 -1
  9. package/src/run-engine/verify-website-build.mjs +67 -30
  10. package/templates/cursor/aaac/capabilities/registry.json +14 -16
  11. package/templates/cursor/aaac/graph.project.yaml +4 -204
  12. package/templates/cursor/aaac/ontology.md +17 -32
  13. package/templates/cursor/aaac/project.config.json +4 -1
  14. package/templates/cursor/aaac/run/schema.json +3 -1
  15. package/templates/cursor/aaac/scripts/run-engine/advance-phase.mjs +2 -2
  16. package/templates/cursor/aaac/scripts/run-engine/gate-write.mjs +14 -2
  17. package/templates/cursor/aaac/scripts/run-engine/init-run.mjs +41 -0
  18. package/templates/cursor/aaac/scripts/run-engine/lib.mjs +33 -0
  19. package/templates/cursor/aaac/scripts/run-engine/record-task.mjs +7 -1
  20. package/templates/cursor/aaac/scripts/run-engine/stop-check.mjs +7 -1
  21. package/templates/cursor/aaac/scripts/run-engine/verify-website-build.mjs +67 -30
  22. package/templates/cursor/agents/playwright-check-run.md +8 -26
  23. package/templates/cursor/agents/release-git.md +2 -2
  24. package/templates/cursor/agents/unit-test-run.md +3 -7
  25. package/templates/cursor/skills/shared/governance/implementation/SKILL.md +25 -396
  26. package/templates/cursor/skills/shared/testing/SKILL.md +2 -2
  27. package/templates/cursor/skills/shared/verbs/check/orchestrator/SKILL.md +1 -1
  28. package/templates/cursor/skills/shared/verification/SKILL.md +2 -2
  29. package/templates/docs/agentic_architecture.md +86 -166
@@ -23,75 +23,80 @@ Ask: *What do I want?* Then type:
23
23
  | Part | Meaning | Example |
24
24
  |------|---------|---------|
25
25
  | Command | Kind of work | `update-module` |
26
- | Domain | Which area | `cms` |
27
- | Intent | Goal in plain language | `"Add featured hero toggle to home page"` |
26
+ | Domain | Which area (optional until you add domains) | `payments` |
27
+ | Intent | Goal in plain language | `"Add idempotency key to webhook handler"` |
28
28
 
29
- ### Ludecker domains
29
+ ### Command matrix (ships with every install)
30
30
 
31
- | Slug | Scope |
32
- |------|-------|
33
- | `cms` | `apps/website` — public site, CMS admin, content queries |
34
- | `ui` | `packages/ui` — design system, tokens, components |
35
- | `database` | `supabase/migrations` — schema, RLS, type mirrors |
36
- | `aaac` | `packages/aaac` — `@ludecker/aaac` npm package, CLI, templates, generators |
31
+ AAAC generates ~130 commands from **8 verbs × 12 objects**:
37
32
 
38
- ### Commands (Ludecker v1)
33
+ | Verb | Meaning | Example |
34
+ |------|---------|---------|
35
+ | `create` | Add something new | `/create-module api "Add rate limiter"` |
36
+ | `update` | Change existing | `/update-component ui "Extract Button variants"` |
37
+ | `fix` | Repair broken behavior | `/fix-module auth "Session expires on refresh"` |
38
+ | `review` | Readonly quality check | `/review-architecture system "Check layer boundaries"` |
39
+ | `check` | Readonly capability trace | `/check-module api "Can we add OAuth?"` |
40
+ | `test` | Run verification | `/test-module api "Contract tests for webhooks"` |
41
+ | `release` | Ship to production | `/release-app production "Ship v2.1.0"` |
42
+ | `remove` | Delete safely | `/remove-module legacy "Drop v1 export path"` |
43
+
44
+ **Exception commands** (dedicated orchestrators):
39
45
 
40
46
  | Command | When to use |
41
47
  |---------|-------------|
42
- | `update-module` | Change an existing bounded module (`cms`, `ui`, `database`, `aaac`) |
43
48
  | `update-doc` | Update architecture documentation (no code) |
44
- | `update-design` | UI / design-system changes (`cms` or `ui`) |
45
- | `create-feature` | Add a new capability in a domain |
46
- | `fix-module` | Fix broken module — **requires domain**; full fix swarm |
47
- | `fix-bug` | Same pipeline as `fix-module`; domain optional (`module-fix`, `bug-fix` aliases) |
48
49
  | `review-module` | Quality/architecture review (no code) |
49
- | `review-incident` | Investigate deploy or production issue |
50
- | `test-module` | Test and verify a module |
51
- | `test-function` | Test a user journey |
52
- | `release-app` | Phased release swarm (git Render) |
53
- | `publish-aaac` | Bump, smoke-test, and publish `@ludecker/aaac` to npm |
54
- | `write-article` | Research swarm CMS article persist |
55
-
56
- ### Manual commands (local dev)
57
-
58
- | Command | When to use |
59
- |---------|-------------|
60
- | `launch-ludecker` | Clean local dev server start |
61
- | `kill-ludecker` | Kill stale local port listeners |
50
+ | `review-incident` | Investigate production or deploy issue |
51
+ | `test-function` | Test a user journey end-to-end |
52
+ | `release-app` | Phased release swarm (git → deploy) |
53
+ | `fix-module` / `fix-bug` | Full fix swarm domain optional until you add resolvers |
54
+
55
+ ### Fresh install what works day one
56
+
57
+ - Verb×object commands and shared pipeline (discover → plan → execute → verify → report)
58
+ - Cursor hook enforcement and Run lifecycle
59
+ - Generic capability registry (shared skills only)
60
+ - **No** project domains, **no** hardcoded app build gate (`verify.enabled: false` in `project.config.json`)
61
+
62
+ ### After you customize (any stack)
63
+
64
+ 1. Write `docs/master_rules.md` and `docs/architecture.md`
65
+ 2. Add `domains/<slug>/update/` (orchestrator + inventory) — see Part 2
66
+ 3. Extend `graph.project.yaml` with resolvers and project skills
67
+ 4. Enable verify in `project.config.json` when you have a web app to gate:
68
+
69
+ ```json
70
+ {
71
+ "verify": {
72
+ "enabled": true,
73
+ "app_root": "apps/web",
74
+ "index_html": "apps/web/index.html",
75
+ "build": { "command": "pnpm", "args": ["--filter", "web", "build"] }
76
+ }
77
+ }
78
+ ```
62
79
 
63
- ### Examples
80
+ ### Examples (generic)
64
81
 
65
82
  ```text
66
- /update-module cms "Improve docs shell navigation"
67
- /update-module ui "Add dark mode token for muted text"
68
- /update-module aaac "Add --version flag to CLI"
69
- /fix-bug cms "CMS publish does not revalidate home page"
70
- /fix-bug aaac "init fails when target dir already exists"
71
- /test-module aaac "Run init smoke and aaac:generate diff check"
72
- /publish-aaac "Ship 1.0.1 with template sync"
73
- /update-doc architecture "Document AAAC agent topology"
74
- /review-module cms "Check size budgets and layer boundaries"
75
- /test-module cms "Run full module verification"
76
- /release-app production "Ship with typecheck"
77
- /write-article guide, How to use Commands in Cursor
78
- /launch-ludecker
83
+ /create-module billing "Add invoice PDF export"
84
+ /update-component ui "Tokenize spacing scale"
85
+ /fix-module api "Webhook signature validation fails on chunked bodies"
86
+ /review-module billing "Check SSOT for tax rates"
87
+ /test-function checkout "Guest can complete purchase"
88
+ /release-app staging "Deploy with migration"
89
+ /update-doc architecture "Document event bus boundaries"
79
90
  ```
80
91
 
81
- ### Deprecated (still work one release)
82
-
83
- | Old | New |
84
- |-----|-----|
85
- | `/ship-ludecker` | `/release-app` |
86
- | `/module-update` | `/update-module` |
87
- | `/architecture` | `/update-doc` |
88
- | `/swarm-check` | `/review-incident` or `/fix-bug` |
89
- | `/refactor` | `/review-module` |
90
-
91
92
  ### What you should not need to know
92
93
 
93
94
  skill, agent, subagent, tool, workflow, graph, orchestrator — infrastructure only.
94
95
 
96
+ ### Reference implementation
97
+
98
+ [Lüdecker](https://ludecker.com) dogfoods AAAC with `cms`, `ui`, `database`, and `aaac` domains. That overlay lives in the Lüdecker repo — not in the generic npm template.
99
+
95
100
  ---
96
101
 
97
102
  ## Part 2 — Appendix (maintainers)
@@ -120,7 +125,7 @@ Knowledge Layer → docs/
120
125
  | Lifecycle | **Work** phase configuration |
121
126
  | Gate stacks | **Approval** checkpoints |
122
127
  | Run | Primary execution object; decisions, log, checkpoints |
123
- | Domain orchestrators | Domain coordination |
128
+ | Domain orchestrators | Domain coordination (you add these) |
124
129
  | Shared pipeline skills | Phase execution |
125
130
  | Capability registry | object → capability → provider |
126
131
  | Object skills | Skill-type providers |
@@ -139,7 +144,7 @@ Intent → Command → Execution Graph → Result
139
144
 
140
145
  **Execution graph** = orchestrator + skills + agents + tools + rules + documentation.
141
146
 
142
- **SSOT:** [`.cursor/aaac/graph.yaml`](../.cursor/aaac/graph.yaml)
147
+ **SSOT:** [`.cursor/aaac/graph.yaml`](../.cursor/aaac/graph.yaml) (generated — edit `graph.project.yaml` instead)
143
148
 
144
149
  **Dispatch procedure:** [`.cursor/aaac/dispatch.md`](../.cursor/aaac/dispatch.md)
145
150
 
@@ -148,17 +153,32 @@ Intent → Command → Execution Graph → Result
148
153
  ```text
149
154
  .cursor/
150
155
  commands/ # thin routers (public)
151
- aaac/graph.yaml # wiring (private OS)
156
+ aaac/
157
+ graph.project.yaml # your overlay (resolvers, orchestrators)
158
+ graph.yaml # generated wiring
152
159
  domains/<slug>/update/
153
160
  orchestrator/ # what happens
154
161
  inventory/ # what exists
155
- skills/shared/ # framework (discovery, planning, execution, …)
156
- skills/ludecker/ # project-specific object skills
157
- skills/write-article/ # content swarm
162
+ skills/shared/ # framework pipeline
163
+ skills/<project>/ # your object-capability skills (optional)
158
164
  agents/ # subagent prompt specs
159
165
  policies/ # rules all skills inherit
160
166
  ```
161
167
 
168
+ ### Generic kernel vs project overlay
169
+
170
+ | Layer | Location | Owner |
171
+ |-------|----------|-------|
172
+ | Generic kernel | `@ludecker/aaac` npm templates | Package maintainers |
173
+ | Project overlay | `.cursor/aaac/graph.project.yaml`, `ontology.json`, `project.config.json` | Your repo |
174
+ | Domains | `.cursor/domains/<slug>/` | Your repo |
175
+
176
+ Regenerate after ontology or overlay edits:
177
+
178
+ ```bash
179
+ npx @ludecker/aaac@latest generate
180
+ ```
181
+
162
182
  ### Orchestrator vs inventory
163
183
 
164
184
  | | Orchestrator | Inventory |
@@ -166,21 +186,8 @@ Intent → Command → Execution Graph → Result
166
186
  | Question | What should happen? | What exists? |
167
187
  | Updates when | Workflow changes | After every code-changing `update-module` |
168
188
 
169
- Inventory documents constraints and file maps. **Dependency reasoning** uses [`.cursor/aaac/dependencies.yaml`](../.cursor/aaac/dependencies.yaml) via the `dependency_graph` phase — not inventory alone.
170
-
171
189
  ### Execution determinism (create / update / fix)
172
190
 
173
- Commands define *what* to load; **work lifecycle** defines phases of work; **gate stacks** define approval checkpoints; the **Run** holds state and observability.
174
-
175
- **Mature stack (composed on Run):**
176
-
177
- ```text
178
- Policies → Ontology → Graph → Create Run
179
- → Work: Discovery → Investigation → Planning
180
- → Gates: Validation → Impact → Deps → Fitness → Rollback
181
- → Work: Execute → Verify → Report
182
- ```
183
-
184
191
  **Work lifecycles** (SSOT: [`.cursor/aaac/lifecycle/lifecycle.json`](../.cursor/aaac/lifecycle/lifecycle.json)):
185
192
 
186
193
  | Verb | Work | Gate stack |
@@ -190,125 +197,38 @@ Policies → Ontology → Graph → Create Run
190
197
  | fix | discover → investigate_swarm → root_cause → plan → execute → verify → report | pre_execute |
191
198
  | release | execute → verify → report | release |
192
199
 
193
- **Gate stacks** (SSOT: [`.cursor/aaac/governance/gates.json`](../.cursor/aaac/governance/gates.json)) — approval, not work.
194
-
195
- Composed runtime in graph `verb_runtime`. Human approval at gate boundaries: Run `status: blocked`, `awaiting_approval: true`.
196
-
197
- **Confidence gates** — before execute, if any score is below threshold → `STOP, REQUEST CLARIFICATION`:
198
-
199
- | Dimension | Minimum |
200
- |-----------|---------|
201
- | architecture | 0.9 |
202
- | requirements | 0.8 |
203
- | scope | 0.8 |
204
-
205
- **Object maturity** — harder objects require more phases:
206
-
207
- | Level | Objects (examples) | Extra requirements |
208
- |-------|-------------------|-------------------|
209
- | protected | schema, migration, architecture | impact + deps + rollback |
210
- | critical | module, integration, app | impact + deps |
211
- | stable | feature, workflow | impact on fix |
212
- | evolving | component, function | lifecycle only |
213
-
214
- **Fitness functions** — [`.cursor/aaac/fitness-functions.yaml`](../.cursor/aaac/fitness-functions.yaml): api_first, design_system, accessibility, security, layer_boundaries, performance. Scored `pass` / `warning` / `fail` before execute.
215
-
216
- Lifecycle reference: [`.cursor/skills/shared/verbs/_lifecycle.md`](../.cursor/skills/shared/verbs/_lifecycle.md)
217
-
218
- ### Fix swarm (`/fix-module`, `/fix-bug`, `fix_mode`)
219
-
220
- Same rigor as `write-article` research — parallel Task subagents, one message per wave.
221
-
222
- | Phase | Agent specs | Count |
223
- |-------|-------------|-------|
224
- | discover | discovery-inventory, discovery-boundaries, discovery-ssot | 4–6 |
225
- | investigate_swarm | fix-repro, fix-code-path, fix-recent-changes, fix-test-failures, fix-regression-scope, fix-runtime-evidence, fix-inventory-confirm | **7** |
226
- | root_cause | parent + optional fix-hypothesis-validate | 0–1 |
227
- | verify (fix) | fix-repro-verify, unit-test-run, fallow-check-changed | **3** |
228
-
229
- Skills: [investigation/SKILL.md](../.cursor/skills/shared/investigation/SKILL.md), [testing/SKILL.md](../.cursor/skills/shared/testing/SKILL.md).
230
- Contracts: [fix-module.yaml](../.cursor/aaac/contracts/commands/fix-module.yaml), [fix-bug.yaml](../.cursor/aaac/contracts/commands/fix-bug.yaml).
231
-
232
- Resolver: `fix-domain-by-slug` (`fix-module`) and `fix-bug-by-slug` → `cms-fix-bug` | `ui-fix-bug` | `database-fix-bug` | `aaac-fix-bug`.
200
+ **Gate stacks** (SSOT: [`.cursor/aaac/governance/gates.json`](../.cursor/aaac/governance/gates.json))
233
201
 
234
202
  ### Capability registry
235
203
 
236
204
  Objects declare capabilities in ontology; providers resolve from [`.cursor/aaac/capabilities/registry.json`](../.cursor/aaac/capabilities/registry.json):
237
205
 
238
206
  ```text
239
- object → capability → provider (skill | mcp | expert)
207
+ object → capability → provider (skill | mcp)
240
208
  ```
241
209
 
242
- Graph `object_skills` includes skill-type providers only. MCP providers (e.g. `supabase-mcp` on `database-design`) are recorded on the Run.
243
-
244
- **Capability lifecycle (evidence-driven):** State belongs to the **capability**, not the provider. After each completed Run, `capability-evidence.mjs` aggregates per-run evidence into [`.cursor/aaac/state/capability-stats.json`](../.cursor/aaac/state/capability-stats.json) and evaluates deterministic promotion using [`.cursor/aaac/capabilities/promotion-rules.json`](../.cursor/aaac/capabilities/promotion-rules.json):
245
-
246
- ```text
247
- experimental → validated → trusted → canonical → deprecated
248
- ```
249
-
250
- Promotion uses accumulated metrics: `invocations`, `success_rate`, `rollback_rate`, `gate_failure_rate`, `avg_fitness`. `canonical` requires `manual_approval` (human override on the capability entry). Providers contribute evidence; governance changes state.
210
+ Replace generic shared-skill providers with project skills as you mature.
251
211
 
252
212
  ### Run (primary execution object)
253
213
 
254
214
  **SSOT:** [`.cursor/aaac/run/schema.json`](../.cursor/aaac/run/schema.json), [`.cursor/aaac/run/RUN.md`](../.cursor/aaac/run/RUN.md)
255
215
 
256
- Every command executes within a Run at `state/runs/{run_id}/run.json`:
257
-
258
- | Field | Purpose |
259
- |-------|---------|
260
- | `phase`, `pending`, `completed` | Where we are |
261
- | `decisions[]` | Why routes and gates |
262
- | `log[]` | Phase events |
263
- | `checkpoints[]` | Resume points |
264
- | `artifacts{}` | Plan, impact, report, … |
265
- | `awaiting_approval` | Human gate approval |
266
-
267
- Observability: [`.cursor/aaac/observability/telemetry.yaml`](../.cursor/aaac/observability/telemetry.yaml) — all telemetry on Run, no standalone logs.
268
-
269
- ### Contracts
270
-
271
- Command contracts: [`.cursor/aaac/contracts/commands/`](../.cursor/aaac/contracts/commands/). Skill contracts: [`.cursor/aaac/contracts/skills/`](../.cursor/aaac/contracts/skills/). Schema: [`.cursor/aaac/contract-schema.md`](../.cursor/aaac/contract-schema.md)
272
-
273
- ### Implementation governance
274
-
275
- Not a slash command. Loaded by `shared/execution` on code changes:
276
-
277
- [`.cursor/skills/shared/governance/implementation/SKILL.md`](../.cursor/skills/shared/governance/implementation/SKILL.md)
278
-
279
216
  ### Adding a product domain
280
217
 
281
218
  1. Add `domains/<slug>/update/` (inventory + orchestrator)
282
- 2. Add slug to `graph.yaml` resolvers — **no new command shape**
283
- 3. Regenerate: `node .cursor/aaac/generate-graph.mjs && node .cursor/aaac/generate-commands.mjs`
284
-
285
- ### Contracts
219
+ 2. Add resolver entries to `graph.project.yaml` — **no new command shape**
220
+ 3. Regenerate: `npx @ludecker/aaac@latest generate`
286
221
 
287
- Plugins may include `contract.yaml` beside `SKILL.md`. Central contracts: [`.cursor/aaac/contracts/`](../.cursor/aaac/contracts/). Schema: [`.cursor/aaac/contract-schema.md`](../.cursor/aaac/contract-schema.md)
222
+ See [module-authoring/SKILL.md](../.cursor/skills/shared/module-authoring/SKILL.md).
288
223
 
289
224
  ### Release swarm (`release-app`)
290
225
 
291
- Expert subagents run in **waves**, not one monolithic agent:
292
-
293
- | Wave | Agents | Notes |
294
- |------|--------|-------|
295
- | 0 | Preflight typecheck (optional) | From intent, e.g. "with tests" |
296
- | 1 | `release-git` | **Blocking** — must return `commit_sha` before wave 2 |
297
- | 2 | `release-render` | Poll `ludecker-website` until `live`; smoke-check `/` |
298
-
299
- Wiring: `graph.yaml` agents `release-*`. Orchestrator: [platform-release/orchestrator](../.cursor/skills/shared/platform-release/orchestrator/SKILL.md). DAG: [platform-release/SKILL.md](../.cursor/skills/shared/platform-release/SKILL.md).
226
+ Wave 1: `release-git` (blocking). Add deploy agents in your overlay (e.g. `release-render`, `release-k8s`) — generic template ships git only.
300
227
 
301
228
  ### Regenerating commands
302
229
 
303
230
  ```bash
304
- pnpm aaac:generate
305
- ```
306
-
307
- Or:
308
-
309
- ```bash
310
- node .cursor/aaac/generate-graph.mjs
311
- node .cursor/aaac/generate-commands.mjs
231
+ npx @ludecker/aaac@latest generate
312
232
  ```
313
233
 
314
234
  Ontology reference: [`.cursor/aaac/ontology.md`](../.cursor/aaac/ontology.md)