@ludecker/aaac 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 (92) hide show
  1. package/README.md +4 -3
  2. package/package.json +13 -1
  3. package/src/cli.mjs +39 -5
  4. package/src/generators/generate-commands.mjs +120 -3
  5. package/src/generators/generate-graph.mjs +17 -0
  6. package/src/lib/install.mjs +1 -0
  7. package/src/lib/run-engine-paths.mjs +33 -0
  8. package/src/run-engine/advance-phase.mjs +343 -0
  9. package/src/run-engine/capability-evidence.mjs +460 -0
  10. package/src/run-engine/debug-run.mjs +38 -0
  11. package/src/run-engine/gate-write.mjs +95 -0
  12. package/src/run-engine/init-run.mjs +215 -0
  13. package/src/run-engine/lib.mjs +141 -0
  14. package/src/run-engine/log-dump.mjs +76 -0
  15. package/src/run-engine/log-trace.mjs +18 -0
  16. package/src/run-engine/log.mjs +343 -0
  17. package/src/run-engine/record-task.mjs +56 -0
  18. package/src/run-engine/stop-check.mjs +55 -0
  19. package/src/run-engine/verify-website-build.mjs +148 -0
  20. package/templates/cursor/aaac/capabilities/promotion-rules.json +64 -0
  21. package/templates/cursor/aaac/capabilities/registry.json +17 -15
  22. package/templates/cursor/aaac/complexity.yaml +98 -0
  23. package/templates/cursor/aaac/contracts/commands/fix-bug.yaml +10 -3
  24. package/templates/cursor/aaac/contracts/commands/fix-module.yaml +41 -0
  25. package/templates/cursor/aaac/contracts/skills/investigation.yaml +22 -1
  26. package/templates/cursor/aaac/contracts/skills/planning.yaml +17 -0
  27. package/templates/cursor/aaac/contracts/skills/validation.yaml +9 -1
  28. package/templates/cursor/aaac/dispatch.md +31 -6
  29. package/templates/cursor/aaac/enforcement.json +25 -0
  30. package/templates/cursor/aaac/fitness-functions.yaml +8 -0
  31. package/templates/cursor/aaac/governance/gates.json +6 -2
  32. package/templates/cursor/aaac/graph.project.yaml +237 -5
  33. package/templates/cursor/aaac/layers.md +6 -1
  34. package/templates/cursor/aaac/lifecycle/lifecycle.json +41 -1
  35. package/templates/cursor/aaac/lifecycle/phases.json +1 -0
  36. package/templates/cursor/aaac/observability/telemetry.yaml +63 -0
  37. package/templates/cursor/aaac/observability/verb-debug.yaml +170 -0
  38. package/templates/cursor/aaac/ontology.json +10 -1
  39. package/templates/cursor/aaac/run/RUN.md +2 -0
  40. package/templates/cursor/aaac/run/schema.json +11 -0
  41. package/templates/cursor/aaac/scripts/generate-runtime-registry.mjs +115 -0
  42. package/templates/cursor/aaac/scripts/run-engine/advance-phase.mjs +343 -0
  43. package/templates/cursor/aaac/scripts/run-engine/capability-evidence.mjs +460 -0
  44. package/templates/cursor/aaac/scripts/run-engine/debug-run.mjs +38 -0
  45. package/templates/cursor/aaac/scripts/run-engine/gate-write.mjs +95 -0
  46. package/templates/cursor/aaac/scripts/run-engine/init-run.mjs +215 -0
  47. package/templates/cursor/aaac/scripts/run-engine/lib.mjs +141 -0
  48. package/templates/cursor/aaac/scripts/run-engine/log-dump.mjs +76 -0
  49. package/templates/cursor/aaac/scripts/run-engine/log-trace.mjs +18 -0
  50. package/templates/cursor/aaac/scripts/run-engine/log.mjs +343 -0
  51. package/templates/cursor/aaac/scripts/run-engine/record-task.mjs +56 -0
  52. package/templates/cursor/aaac/scripts/run-engine/stop-check.mjs +55 -0
  53. package/templates/cursor/aaac/scripts/run-engine/verify-website-build.mjs +148 -0
  54. package/templates/cursor/aaac/state/capability-stats.json +5 -0
  55. package/templates/cursor/agents/aaac-log-debug.md +72 -0
  56. package/templates/cursor/agents/fix-code-path.md +27 -0
  57. package/templates/cursor/agents/fix-hypothesis-validate.md +26 -0
  58. package/templates/cursor/agents/fix-inventory-confirm.md +22 -0
  59. package/templates/cursor/agents/fix-recent-changes.md +22 -0
  60. package/templates/cursor/agents/fix-regression-scope.md +27 -0
  61. package/templates/cursor/agents/fix-repro-verify.md +21 -0
  62. package/templates/cursor/agents/fix-repro.md +29 -0
  63. package/templates/cursor/agents/fix-runtime-evidence.md +22 -0
  64. package/templates/cursor/agents/fix-test-failures.md +23 -0
  65. package/templates/cursor/agents/playwright-check-run.md +44 -0
  66. package/templates/cursor/hooks/aaac-before-submit.sh +3 -0
  67. package/templates/cursor/hooks/aaac-pre-tool.sh +4 -0
  68. package/templates/cursor/hooks/aaac-stop.sh +3 -0
  69. package/templates/cursor/hooks/aaac-subagent-start.sh +3 -0
  70. package/templates/cursor/hooks.json +30 -0
  71. package/templates/cursor/policies/minimal-complexity.md +101 -0
  72. package/templates/cursor/rules/aaac-enforcement.mdc +42 -0
  73. package/templates/cursor/skills/shared/execution/SKILL.md +1 -1
  74. package/templates/cursor/skills/shared/fitness-functions/SKILL.md +23 -7
  75. package/templates/cursor/skills/shared/investigation/SKILL.md +91 -18
  76. package/templates/cursor/skills/shared/investigation/orchestrator/SKILL.md +12 -4
  77. package/templates/cursor/skills/shared/planning/SKILL.md +74 -8
  78. package/templates/cursor/skills/shared/platform-release/SKILL.md +22 -19
  79. package/templates/cursor/skills/shared/platform-release/orchestrator/contract.yaml +27 -7
  80. package/templates/cursor/skills/shared/reporting/SKILL.md +2 -1
  81. package/templates/cursor/skills/shared/root-cause/SKILL.md +14 -3
  82. package/templates/cursor/skills/shared/testing/SKILL.md +31 -5
  83. package/templates/cursor/skills/shared/validation/SKILL.md +48 -13
  84. package/templates/cursor/skills/shared/verbs/_dispatch-utils.md +20 -1
  85. package/templates/cursor/skills/shared/verbs/_lifecycle.md +3 -2
  86. package/templates/cursor/skills/shared/verbs/check/orchestrator/SKILL.md +4 -1
  87. package/templates/cursor/skills/shared/verbs/create/orchestrator/SKILL.md +2 -2
  88. package/templates/cursor/skills/shared/verbs/fix/orchestrator/SKILL.md +21 -11
  89. package/templates/cursor/skills/shared/verbs/fix/orchestrator/contract.yaml +19 -4
  90. package/templates/cursor/skills/shared/verbs/update/orchestrator/SKILL.md +2 -2
  91. package/templates/cursor/skills/shared/verification/SKILL.md +3 -0
  92. package/templates/docs/agentic_architecture.md +236 -53
@@ -23,8 +23,8 @@ Lifecycle: graph `verb_runtime.create` (work + gates on Run)
23
23
  2. **load_inventory** — when `domains/<slug>/update/inventory/SKILL.md` exists
24
24
  3. **discover** — [discovery](../../discovery/SKILL.md) readonly
25
25
  4. **investigate_lite** — [investigation-lite](../../investigation-lite/SKILL.md)
26
- 5. **plan** — [planning](../../planning/SKILL.md)
27
- 6. **validate** — [validation](../../validation/SKILL.md) — confidence gates
26
+ 5. **plan** — [planning](../../planning/SKILL.md) — **requirement_map + complexity_score** on Run
27
+ 6. **validate** — [validation](../../validation/SKILL.md) — confidence + complexity gates
28
28
  7. **impact_analysis** — [impact-analysis](../../impact-analysis/SKILL.md)
29
29
  8. **dependency_graph** — [dependency-graph](../../dependency-graph/SKILL.md)
30
30
  9. **fitness_functions** — [fitness-functions](../../fitness-functions/SKILL.md)
@@ -1,33 +1,43 @@
1
1
  ---
2
2
  name: verb-fix-orchestrator
3
- description: Orchestrates fix-* except fix-bug resolver paths. Internal only.
3
+ description: Orchestrates fix-* resolver fallbacks and generic fix-{object} commands. Internal only.
4
4
  disable-model-invocation: true
5
5
  ---
6
6
 
7
7
  # fix-* orchestrator
8
8
 
9
- **Object** from graph. `fix-bug` uses domain resolver (see [dispatch.md](../../../aaac/dispatch.md) for fallback).
9
+ **Object** from graph or resolver `default_object`. Domain resolver paths (`fix-module`, `fix-bug`, …) prefer `*-fix-bug` orchestrators see [dispatch.md](../../../aaac/dispatch.md).
10
10
 
11
11
  Read [_dispatch-utils.md](../_dispatch-utils.md) and [_lifecycle.md](../_lifecycle.md) first.
12
12
 
13
- Lifecycle: graph `verb_runtime.fix` (work + gates on Run)
13
+ Contract: [contract.yaml](./contract.yaml)
14
+ Command contracts: [fix-module.yaml](../../../aaac/contracts/commands/fix-module.yaml), [fix-bug.yaml](../../../aaac/contracts/commands/fix-bug.yaml)
15
+
16
+ Lifecycle: graph `verb_runtime.fix` or `command_workflows.fix-module` on Run
14
17
 
15
18
  ## Phases (deterministic — do not skip)
16
19
 
17
- 1. **policies**
18
- 2. **load_inventory** — when domain inventory exists
19
- 3. **discover** — [discovery](../../discovery/SKILL.md) readonly
20
- 4. **investigate** — [investigation](../../investigation/SKILL.md) deep
21
- 5. **root_cause** — [root-cause](../../root-cause/SKILL.md)
22
- 6. **plan** — [planning](../../planning/SKILL.md)
20
+ 1. **policies** — all four including [minimal-complexity.md](../../../policies/minimal-complexity.md)
21
+ 2. **load_inventory** — when `domains/<slug>/update/inventory/SKILL.md` exists
22
+ 3. **discover** — [discovery](../../discovery/SKILL.md) — **4–6 parallel** agents, one message
23
+ 4. **investigate_swarm** — [investigation](../../investigation/SKILL.md) Mode A — **7 parallel** agents, one message
24
+ 5. **root_cause** — [root-cause](../../root-cause/SKILL.md) — optional [fix-hypothesis-validate](../../../agents/fix-hypothesis-validate.md)
25
+ 6. **plan** — [planning](../../planning/SKILL.md) — minimal diff; `complexity_score` max **5**
23
26
  7. **validate** — [validation](../../validation/SKILL.md)
24
27
  8. **impact_analysis** — [impact-analysis](../../impact-analysis/SKILL.md)
25
28
  9. **dependency_graph** — [dependency-graph](../../dependency-graph/SKILL.md)
26
29
  10. **fitness_functions** — [fitness-functions](../../fitness-functions/SKILL.md)
27
30
  11. **rollback** — [rollback](../../rollback/SKILL.md) when maturity protected/critical or blast_radius ≥ medium
28
31
  12. **execute** — [execution](../../execution/SKILL.md)
29
- 13. **verify** — [testing](../../testing/SKILL.md) + [verification](../../verification/SKILL.md)
30
- 14. **sync_inventory**
32
+ 13. **verify** — [testing](../../testing/SKILL.md) fix verify swarm + [verification](../../verification/SKILL.md)
33
+ 14. **sync_inventory** — when domain inventory exists
31
34
  15. **report** — [reporting](../../reporting/SKILL.md)
32
35
 
36
+ ## Swarm anti-patterns (hard fail)
37
+
38
+ - Skipping discovery or investigate_swarm because the issue "looks simple"
39
+ - Sequential Task launches when parallel is required
40
+ - Execute before `root_cause_confidence` ≥ 0.7
41
+ - Claim success when `repro_status: not_fixed`
42
+
33
43
  Gate failure → **STOP, REQUEST CLARIFICATION**
@@ -6,28 +6,42 @@ inputs:
6
6
  intent:
7
7
  required: true
8
8
  outputs:
9
+ investigation:
10
+ type: markdown
11
+ required: true
12
+ root_cause:
13
+ type: markdown
14
+ required: true
9
15
  code_changes:
10
16
  type: boolean
11
17
  inventory_synced:
12
18
  type: boolean
19
+ repro_status:
20
+ type: string
21
+ required: true
22
+ enum: [fixed, partial, not_fixed]
13
23
  report:
14
24
  type: markdown
15
25
  success_criteria:
16
26
  - All policies loaded before execute
17
- - investigation completed before planning
27
+ - discovery swarm completed (4-6 parallel agents)
28
+ - investigate_swarm completed (7 parallel fix agents)
29
+ - root_cause_confidence at least 0.7 before plan
18
30
  - domain inventory loaded when domains/<slug>/update/inventory exists
19
31
  - object skills from graph object_skills / object_skill_verbs loaded
20
32
  - governance/implementation followed for all edits
33
+ - repro_status fixed or partial with documented follow-up
21
34
  - fallow check_changed clean on touched files
22
35
  - user intent satisfied per verification
23
36
  failure_conditions:
24
37
  - execute without approved plan
25
- - skip investigation phase
38
+ - skip discover or investigate_swarm phase
26
39
  - skip governance/implementation on code changes
27
40
  - skip domain inventory when slug resolves to inventory file
41
+ - repro_status not_fixed while claiming success
28
42
  dependencies:
29
- skills: [investigation, discovery, planning, execution, testing, verification, reporting]
30
- policies: [master-rules, implementation, mcp-and-deploy]
43
+ skills: [discovery, investigation, root-cause, planning, execution, testing, verification, reporting]
44
+ policies: [master-rules, implementation, mcp-and-deploy, minimal-complexity]
31
45
  docs:
32
46
  - docs/master_rules.md
33
47
  - docs/architecture.md
@@ -35,4 +49,5 @@ dependencies:
35
49
  verification:
36
50
  - sync_inventory
37
51
  - run_tests
52
+ - fix_repro_verify_swarm
38
53
  - fallow_check_changed
@@ -18,8 +18,8 @@ Lifecycle: graph `verb_runtime.update` (work + gates on Run)
18
18
  2. **load_inventory** — when domain inventory exists
19
19
  3. **discover** — [discovery](../../discovery/SKILL.md)
20
20
  4. **investigate_lite** — [investigation-lite](../../investigation-lite/SKILL.md) — **mandatory** (what exists, depends on, constraints)
21
- 5. **plan** — [planning](../../planning/SKILL.md)
22
- 6. **validate** — [validation](../../validation/SKILL.md)
21
+ 5. **plan** — [planning](../../planning/SKILL.md) — **requirement_map + complexity_score** (max 8)
22
+ 6. **validate** — [validation](../../validation/SKILL.md) — confidence + complexity gates
23
23
  7. **impact_analysis** — [impact-analysis](../../impact-analysis/SKILL.md)
24
24
  8. **dependency_graph** — [dependency-graph](../../dependency-graph/SKILL.md)
25
25
  9. **fitness_functions** — [fitness-functions](../../fitness-functions/SKILL.md)
@@ -14,6 +14,9 @@ After `testing`. Before `report`.
14
14
 
15
15
  ## Checks
16
16
 
17
+ - **Website build gate** (create / update / fix): `artifacts/verify.yaml` from [verify-website-build.mjs](../../../aaac/scripts/run-engine/verify-website-build.mjs) — static assets in `index.html` must exist; `pnpm --filter @ludecker/website build` must pass
18
+ - **Playwright verb checks** (create / update / fix): launch [playwright-check-run](../../../agents/playwright-check-run.md) — `pnpm --filter @ludecker/aaac test:e2e` must pass; set `PLAYWRIGHT_BASE_URL` for public-route smoke
19
+ - Run artifact `artifacts.testing.repro_status` is **fixed** or **partial** with documented follow-up (fix paths)
17
20
  - Orchestrator `contract.yaml` `success_criteria`
18
21
  - Graph `object_skills` / `object_skill_verbs` skills were loaded for command object + verb
19
22
  - User instruction satisfied (spot-check 2–3 behaviors in code or tests)
@@ -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,36 +23,71 @@ 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 | `cms` |
27
+ | Intent | Goal in plain language | `"Add featured hero toggle to home page"` |
28
+
29
+ ### Ludecker domains
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 |
30
37
 
31
- ### Commands (AAAC v1)
38
+ ### Commands (Ludecker v1)
32
39
 
33
40
  | Command | When to use |
34
41
  |---------|-------------|
35
- | `update-module` | Change an existing bounded module |
42
+ | `update-module` | Change an existing bounded module (`cms`, `ui`, `database`, `aaac`) |
36
43
  | `update-doc` | Update architecture documentation (no code) |
37
- | `create-feature` | Add a new capability |
38
- | `fix-bug` | Fix broken behavior |
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) |
39
48
  | `review-module` | Quality/architecture review (no code) |
40
49
  | `review-incident` | Investigate deploy or production issue |
41
50
  | `test-module` | Test and verify a module |
42
51
  | `test-function` | Test a user journey |
43
- | `release-app` | Phased release (git → deploy) |
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 |
44
55
 
45
- Verb×object matrix commands (`create-component`, `check-schema`, …) route through shared verb orchestrators. See [`.cursor/aaac/ontology.md`](../.cursor/aaac/ontology.md).
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 |
46
62
 
47
63
  ### Examples
48
64
 
49
65
  ```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"
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"
55
76
  /release-app production "Ship with typecheck"
77
+ /write-article guide, How to use Commands in Cursor
78
+ /launch-ludecker
56
79
  ```
57
80
 
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
+
58
91
  ### What you should not need to know
59
92
 
60
93
  skill, agent, subagent, tool, workflow, graph, orchestrator — infrastructure only.
@@ -63,33 +96,9 @@ skill, agent, subagent, tool, workflow, graph, orchestrator — infrastructure o
63
96
 
64
97
  ## Part 2 — Appendix (maintainers)
65
98
 
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:
75
-
76
- ```bash
77
- npx @ludecker/aaac@latest generate
78
- # or
79
- pnpm dlx @ludecker/aaac@latest generate
80
- ```
81
-
82
- ### Adding a product domain
83
-
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)
89
-
90
99
  ### Responsibility layers
91
100
 
92
- Full map: [`.cursor/aaac/layers.md`](../.cursor/aaac/layers.md)
101
+ AAAC is organized by **responsibility**, not file type. Full map: [`.cursor/aaac/layers.md`](../.cursor/aaac/layers.md)
93
102
 
94
103
  ```text
95
104
  User Layer → Commands
@@ -99,33 +108,207 @@ Governance Layer → gate stacks (gates.json), policies, fitness
99
108
  Run Layer → Run manifest (state + observability)
100
109
  Execution Layer → Orchestrators, pipeline skills, capabilities, agents
101
110
  Contracts Layer → command + skill contracts
102
- Knowledge Layer → {{DOCS_ROOT}}/
111
+ Knowledge Layer → docs/
112
+ ```
113
+
114
+ | Component | Responsibility |
115
+ |-----------|----------------|
116
+ | Commands | User-facing API |
117
+ | Ontology | Vocabulary and classification |
118
+ | Dispatch | Command resolution, Run creation |
119
+ | Graph | Execution routing |
120
+ | Lifecycle | **Work** phase configuration |
121
+ | Gate stacks | **Approval** checkpoints |
122
+ | Run | Primary execution object; decisions, log, checkpoints |
123
+ | Domain orchestrators | Domain coordination |
124
+ | Shared pipeline skills | Phase execution |
125
+ | Capability registry | object → capability → provider |
126
+ | Object skills | Skill-type providers |
127
+ | Agent specs | Agent behavior |
128
+ | Policies | Mandatory governance |
129
+ | Dependencies | Impact analysis |
130
+ | Fitness functions | Architecture validation |
131
+ | Contracts | Input/output invariants |
132
+ | Documentation | System knowledge |
133
+
134
+ ### Execution graph
135
+
136
+ ```text
137
+ Intent → Command → Execution Graph → Result
103
138
  ```
104
139
 
140
+ **Execution graph** = orchestrator + skills + agents + tools + rules + documentation.
141
+
105
142
  **SSOT:** [`.cursor/aaac/graph.yaml`](../.cursor/aaac/graph.yaml)
106
143
 
107
- **Dispatch:** [`.cursor/aaac/dispatch.md`](../.cursor/aaac/dispatch.md)
144
+ **Dispatch procedure:** [`.cursor/aaac/dispatch.md`](../.cursor/aaac/dispatch.md)
108
145
 
109
146
  ### Directory layout
110
147
 
111
148
  ```text
112
149
  .cursor/
113
150
  commands/ # thin routers (public)
114
- aaac/ # ontology, graph, generators config
151
+ aaac/graph.yaml # wiring (private OS)
115
152
  domains/<slug>/update/
116
- orchestrator/
117
- inventory/
118
- skills/shared/ # pipeline + verb orchestrators
153
+ orchestrator/ # what happens
154
+ inventory/ # what exists
155
+ skills/shared/ # framework (discovery, planning, execution, …)
156
+ skills/ludecker/ # project-specific object skills
157
+ skills/write-article/ # content swarm
119
158
  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)
159
+ policies/ # rules all skills inherit
160
+ ```
161
+
162
+ ### Orchestrator vs inventory
163
+
164
+ | | Orchestrator | Inventory |
165
+ |--|--------------|-----------|
166
+ | Question | What should happen? | What exists? |
167
+ | Updates when | Workflow changes | After every code-changing `update-module` |
168
+
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
+ ### Execution determinism (create / update / fix)
172
+
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
+ **Work lifecycles** (SSOT: [`.cursor/aaac/lifecycle/lifecycle.json`](../.cursor/aaac/lifecycle/lifecycle.json)):
185
+
186
+ | Verb | Work | Gate stack |
187
+ |------|------|------------|
188
+ | create | discover → investigate_lite → plan → execute → verify → report | pre_execute |
189
+ | update | same | pre_execute |
190
+ | fix | discover → investigate_swarm → root_cause → plan → execute → verify → report | pre_execute |
191
+ | release | execute → verify → report | release |
192
+
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`.
233
+
234
+ ### Capability registry
235
+
236
+ Objects declare capabilities in ontology; providers resolve from [`.cursor/aaac/capabilities/registry.json`](../.cursor/aaac/capabilities/registry.json):
237
+
238
+ ```text
239
+ object → capability → provider (skill | mcp | expert)
125
240
  ```
126
241
 
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.
251
+
252
+ ### Run (primary execution object)
253
+
254
+ **SSOT:** [`.cursor/aaac/run/schema.json`](../.cursor/aaac/run/schema.json), [`.cursor/aaac/run/RUN.md`](../.cursor/aaac/run/RUN.md)
255
+
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
+ ### Adding a product domain
280
+
281
+ 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
286
+
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)
288
+
127
289
  ### Release swarm (`release-app`)
128
290
 
129
- Wave 1: `release-git` (blocking). Configure deploy agents in `graph.project.yaml` for your host.
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).
300
+
301
+ ### Regenerating commands
302
+
303
+ ```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
312
+ ```
130
313
 
131
- Orchestrator: [`.cursor/skills/shared/platform-release/orchestrator`](../.cursor/skills/shared/platform-release/orchestrator/SKILL.md)
314
+ Ontology reference: [`.cursor/aaac/ontology.md`](../.cursor/aaac/ontology.md)