@ludecker/aaac 1.1.0 → 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 (40) 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 +152 -1
  4. package/src/run-engine/capability-evidence.mjs +460 -0
  5. package/src/run-engine/gate-write.mjs +14 -2
  6. package/src/run-engine/init-run.mjs +92 -1
  7. package/src/run-engine/lib.mjs +38 -0
  8. package/src/run-engine/record-task.mjs +7 -1
  9. package/src/run-engine/stop-check.mjs +7 -1
  10. package/src/run-engine/verify-website-build.mjs +185 -0
  11. package/templates/cursor/aaac/capabilities/promotion-rules.json +64 -0
  12. package/templates/cursor/aaac/capabilities/registry.json +11 -11
  13. package/templates/cursor/aaac/dispatch.md +2 -2
  14. package/templates/cursor/aaac/enforcement.json +6 -3
  15. package/templates/cursor/aaac/governance/gates.json +3 -1
  16. package/templates/cursor/aaac/graph.project.yaml +4 -204
  17. package/templates/cursor/aaac/layers.md +3 -0
  18. package/templates/cursor/aaac/observability/telemetry.yaml +3 -0
  19. package/templates/cursor/aaac/ontology.md +17 -32
  20. package/templates/cursor/aaac/project.config.json +4 -1
  21. package/templates/cursor/aaac/run/schema.json +5 -1
  22. package/templates/cursor/aaac/scripts/run-engine/advance-phase.mjs +152 -1
  23. package/templates/cursor/aaac/scripts/run-engine/capability-evidence.mjs +460 -0
  24. package/templates/cursor/aaac/scripts/run-engine/gate-write.mjs +14 -2
  25. package/templates/cursor/aaac/scripts/run-engine/init-run.mjs +92 -1
  26. package/templates/cursor/aaac/scripts/run-engine/lib.mjs +38 -0
  27. package/templates/cursor/aaac/scripts/run-engine/record-task.mjs +7 -1
  28. package/templates/cursor/aaac/scripts/run-engine/stop-check.mjs +7 -1
  29. package/templates/cursor/aaac/scripts/run-engine/verify-website-build.mjs +185 -0
  30. package/templates/cursor/aaac/state/capability-stats.json +5 -0
  31. package/templates/cursor/agents/playwright-check-run.md +8 -26
  32. package/templates/cursor/agents/release-git.md +2 -2
  33. package/templates/cursor/agents/unit-test-run.md +3 -7
  34. package/templates/cursor/skills/shared/governance/implementation/SKILL.md +25 -396
  35. package/templates/cursor/skills/shared/platform-release/SKILL.md +22 -19
  36. package/templates/cursor/skills/shared/platform-release/orchestrator/contract.yaml +27 -7
  37. package/templates/cursor/skills/shared/testing/SKILL.md +5 -0
  38. package/templates/cursor/skills/shared/verbs/check/orchestrator/SKILL.md +1 -1
  39. package/templates/cursor/skills/shared/verification/SKILL.md +2 -1
  40. package/templates/docs/agentic_architecture.md +163 -60
@@ -6,8 +6,6 @@
6
6
 
7
7
  You express intent; the architecture determines execution.
8
8
 
9
- Installed by [{{PROJECT_NAME}}](https://ludecker.com) — generic AAAC kernel for Cursor.
10
-
11
9
  ---
12
10
 
13
11
  ## Part 1 — For everyone
@@ -25,71 +23,87 @@ Ask: *What do I want?* Then type:
25
23
  | Part | Meaning | Example |
26
24
  |------|---------|---------|
27
25
  | Command | Kind of work | `update-module` |
28
- | Domain | Which bounded context | `api` |
29
- | Intent | Goal in plain language | `"Add pagination to list endpoint"` |
26
+ | Domain | Which area (optional until you add domains) | `payments` |
27
+ | Intent | Goal in plain language | `"Add idempotency key to webhook handler"` |
28
+
29
+ ### Command matrix (ships with every install)
30
30
 
31
- ### Commands (AAAC v1)
31
+ AAAC generates ~130 commands from **8 verbs × 12 objects**:
32
+
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):
32
45
 
33
46
  | Command | When to use |
34
47
  |---------|-------------|
35
- | `update-module` | Change an existing bounded module |
36
48
  | `update-doc` | Update architecture documentation (no code) |
37
- | `create-feature` | Add a new capability |
38
- | `fix-bug` | Fix broken behavior |
39
49
  | `review-module` | Quality/architecture review (no code) |
40
- | `review-incident` | Investigate deploy or production issue |
41
- | `test-module` | Test and verify a module |
42
- | `test-function` | Test a user journey |
43
- | `release-app` | Phased release (git deploy) |
44
-
45
- Verb×object matrix commands (`create-component`, `check-schema`, …) route through shared verb orchestrators. See [`.cursor/aaac/ontology.md`](../.cursor/aaac/ontology.md).
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
+ ```
46
79
 
47
- ### Examples
80
+ ### Examples (generic)
48
81
 
49
82
  ```text
50
- /update-module api "Add rate limiting middleware"
51
- /fix-bug "Checkout fails on empty cart"
52
- /update-doc architecture "Document domain boundaries"
53
- /review-module api "Check layer boundaries and size budgets"
54
- /test-function "Sign-up to welcome email journey"
55
- /release-app production "Ship with typecheck"
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"
56
90
  ```
57
91
 
58
92
  ### What you should not need to know
59
93
 
60
94
  skill, agent, subagent, tool, workflow, graph, orchestrator — infrastructure only.
61
95
 
62
- ---
63
-
64
- ## Part 2 — Appendix (maintainers)
65
-
66
- ### Install and regenerate
67
-
68
- ```bash
69
- npx @ludecker/aaac@latest init
70
- # or
71
- pnpm dlx @ludecker/aaac@latest init
72
- ```
73
-
74
- After changing ontology or project wiring:
96
+ ### Reference implementation
75
97
 
76
- ```bash
77
- npx @ludecker/aaac@latest generate
78
- # or
79
- pnpm dlx @ludecker/aaac@latest generate
80
- ```
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.
81
99
 
82
- ### Adding a product domain
100
+ ---
83
101
 
84
- 1. Create `.cursor/domains/<slug>/update/orchestrator/` (SKILL.md + contract.yaml)
85
- 2. Create `.cursor/domains/<slug>/update/inventory/` (file map + constraints)
86
- 3. Add resolver entries to `.cursor/aaac/graph.project.yaml`
87
- 4. Add `command_overrides` to `.cursor/aaac/ontology.json` if slug-based routing is needed
88
- 5. Regenerate graph and commands (see above)
102
+ ## Part 2 Appendix (maintainers)
89
103
 
90
104
  ### Responsibility layers
91
105
 
92
- Full map: [`.cursor/aaac/layers.md`](../.cursor/aaac/layers.md)
106
+ AAAC is organized by **responsibility**, not file type. Full map: [`.cursor/aaac/layers.md`](../.cursor/aaac/layers.md)
93
107
 
94
108
  ```text
95
109
  User Layer → Commands
@@ -99,33 +113,122 @@ Governance Layer → gate stacks (gates.json), policies, fitness
99
113
  Run Layer → Run manifest (state + observability)
100
114
  Execution Layer → Orchestrators, pipeline skills, capabilities, agents
101
115
  Contracts Layer → command + skill contracts
102
- Knowledge Layer → {{DOCS_ROOT}}/
116
+ Knowledge Layer → docs/
103
117
  ```
104
118
 
105
- **SSOT:** [`.cursor/aaac/graph.yaml`](../.cursor/aaac/graph.yaml)
119
+ | Component | Responsibility |
120
+ |-----------|----------------|
121
+ | Commands | User-facing API |
122
+ | Ontology | Vocabulary and classification |
123
+ | Dispatch | Command resolution, Run creation |
124
+ | Graph | Execution routing |
125
+ | Lifecycle | **Work** phase configuration |
126
+ | Gate stacks | **Approval** checkpoints |
127
+ | Run | Primary execution object; decisions, log, checkpoints |
128
+ | Domain orchestrators | Domain coordination (you add these) |
129
+ | Shared pipeline skills | Phase execution |
130
+ | Capability registry | object → capability → provider |
131
+ | Object skills | Skill-type providers |
132
+ | Agent specs | Agent behavior |
133
+ | Policies | Mandatory governance |
134
+ | Dependencies | Impact analysis |
135
+ | Fitness functions | Architecture validation |
136
+ | Contracts | Input/output invariants |
137
+ | Documentation | System knowledge |
138
+
139
+ ### Execution graph
106
140
 
107
- **Dispatch:** [`.cursor/aaac/dispatch.md`](../.cursor/aaac/dispatch.md)
141
+ ```text
142
+ Intent → Command → Execution Graph → Result
143
+ ```
144
+
145
+ **Execution graph** = orchestrator + skills + agents + tools + rules + documentation.
146
+
147
+ **SSOT:** [`.cursor/aaac/graph.yaml`](../.cursor/aaac/graph.yaml) (generated — edit `graph.project.yaml` instead)
148
+
149
+ **Dispatch procedure:** [`.cursor/aaac/dispatch.md`](../.cursor/aaac/dispatch.md)
108
150
 
109
151
  ### Directory layout
110
152
 
111
153
  ```text
112
154
  .cursor/
113
155
  commands/ # thin routers (public)
114
- aaac/ # ontology, graph, generators config
156
+ aaac/
157
+ graph.project.yaml # your overlay (resolvers, orchestrators)
158
+ graph.yaml # generated wiring
115
159
  domains/<slug>/update/
116
- orchestrator/
117
- inventory/
118
- skills/shared/ # pipeline + verb orchestrators
160
+ orchestrator/ # what happens
161
+ inventory/ # what exists
162
+ skills/shared/ # framework pipeline
163
+ skills/<project>/ # your object-capability skills (optional)
119
164
  agents/ # subagent prompt specs
120
- policies/ # inherited governance
121
- {{DOCS_ROOT}}/
122
- agentic_architecture.md
123
- master_rules.md # your project rules (create if missing)
124
- architecture.md # your system map (create if missing)
165
+ policies/ # rules all skills inherit
166
+ ```
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
+
182
+ ### Orchestrator vs inventory
183
+
184
+ | | Orchestrator | Inventory |
185
+ |--|--------------|-----------|
186
+ | Question | What should happen? | What exists? |
187
+ | Updates when | Workflow changes | After every code-changing `update-module` |
188
+
189
+ ### Execution determinism (create / update / fix)
190
+
191
+ **Work lifecycles** (SSOT: [`.cursor/aaac/lifecycle/lifecycle.json`](../.cursor/aaac/lifecycle/lifecycle.json)):
192
+
193
+ | Verb | Work | Gate stack |
194
+ |------|------|------------|
195
+ | create | discover → investigate_lite → plan → execute → verify → report | pre_execute |
196
+ | update | same | pre_execute |
197
+ | fix | discover → investigate_swarm → root_cause → plan → execute → verify → report | pre_execute |
198
+ | release | execute → verify → report | release |
199
+
200
+ **Gate stacks** (SSOT: [`.cursor/aaac/governance/gates.json`](../.cursor/aaac/governance/gates.json))
201
+
202
+ ### Capability registry
203
+
204
+ Objects declare capabilities in ontology; providers resolve from [`.cursor/aaac/capabilities/registry.json`](../.cursor/aaac/capabilities/registry.json):
205
+
206
+ ```text
207
+ object → capability → provider (skill | mcp)
125
208
  ```
126
209
 
210
+ Replace generic shared-skill providers with project skills as you mature.
211
+
212
+ ### Run (primary execution object)
213
+
214
+ **SSOT:** [`.cursor/aaac/run/schema.json`](../.cursor/aaac/run/schema.json), [`.cursor/aaac/run/RUN.md`](../.cursor/aaac/run/RUN.md)
215
+
216
+ ### Adding a product domain
217
+
218
+ 1. Add `domains/<slug>/update/` (inventory + orchestrator)
219
+ 2. Add resolver entries to `graph.project.yaml` — **no new command shape**
220
+ 3. Regenerate: `npx @ludecker/aaac@latest generate`
221
+
222
+ See [module-authoring/SKILL.md](../.cursor/skills/shared/module-authoring/SKILL.md).
223
+
127
224
  ### Release swarm (`release-app`)
128
225
 
129
- Wave 1: `release-git` (blocking). Configure deploy agents in `graph.project.yaml` for your host.
226
+ Wave 1: `release-git` (blocking). Add deploy agents in your overlay (e.g. `release-render`, `release-k8s`) generic template ships git only.
227
+
228
+ ### Regenerating commands
229
+
230
+ ```bash
231
+ npx @ludecker/aaac@latest generate
232
+ ```
130
233
 
131
- Orchestrator: [`.cursor/skills/shared/platform-release/orchestrator`](../.cursor/skills/shared/platform-release/orchestrator/SKILL.md)
234
+ Ontology reference: [`.cursor/aaac/ontology.md`](../.cursor/aaac/ontology.md)