@ludecker/aaac 1.0.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 (110) hide show
  1. package/README.md +60 -0
  2. package/package.json +38 -0
  3. package/src/cli.mjs +138 -0
  4. package/src/generators/generate-commands.mjs +165 -0
  5. package/src/generators/generate-graph-commands.mjs +63 -0
  6. package/src/generators/generate-graph.mjs +242 -0
  7. package/src/lib/copy.mjs +36 -0
  8. package/src/lib/install.mjs +76 -0
  9. package/src/lib/paths.mjs +54 -0
  10. package/templates/cursor/aaac/capabilities/registry.json +106 -0
  11. package/templates/cursor/aaac/contract-schema.md +66 -0
  12. package/templates/cursor/aaac/contracts/commands/create-module.yaml +28 -0
  13. package/templates/cursor/aaac/contracts/commands/fix-bug.yaml +32 -0
  14. package/templates/cursor/aaac/contracts/commands/update-module.yaml +28 -0
  15. package/templates/cursor/aaac/contracts/skills/impact-analysis.yaml +17 -0
  16. package/templates/cursor/aaac/contracts/skills/investigation-lite.yaml +17 -0
  17. package/templates/cursor/aaac/contracts/skills/investigation.yaml +17 -0
  18. package/templates/cursor/aaac/contracts/skills/validation.yaml +14 -0
  19. package/templates/cursor/aaac/dependencies.yaml +14 -0
  20. package/templates/cursor/aaac/dispatch.md +135 -0
  21. package/templates/cursor/aaac/fitness-functions.yaml +34 -0
  22. package/templates/cursor/aaac/governance/gates.json +39 -0
  23. package/templates/cursor/aaac/graph.project.yaml +161 -0
  24. package/templates/cursor/aaac/layers.md +93 -0
  25. package/templates/cursor/aaac/lifecycle/lifecycle.json +78 -0
  26. package/templates/cursor/aaac/lifecycle/phases.json +19 -0
  27. package/templates/cursor/aaac/ontology.json +219 -0
  28. package/templates/cursor/aaac/ontology.md +90 -0
  29. package/templates/cursor/aaac/project.config.json +3 -0
  30. package/templates/cursor/aaac/run/RUN.md +72 -0
  31. package/templates/cursor/aaac/run/schema.json +83 -0
  32. package/templates/cursor/aaac/state/checkpoints/README.md +20 -0
  33. package/templates/cursor/agents/boundary-review.md +11 -0
  34. package/templates/cursor/agents/check-capability-trace.md +18 -0
  35. package/templates/cursor/agents/dependency-analysis.md +11 -0
  36. package/templates/cursor/agents/discovery-boundaries.md +11 -0
  37. package/templates/cursor/agents/discovery-inventory.md +14 -0
  38. package/templates/cursor/agents/discovery-ssot.md +11 -0
  39. package/templates/cursor/agents/fallow-check-changed.md +9 -0
  40. package/templates/cursor/agents/impact-analysis.md +22 -0
  41. package/templates/cursor/agents/plan-layer-map.md +11 -0
  42. package/templates/cursor/agents/plan-state-machines.md +11 -0
  43. package/templates/cursor/agents/release-git.md +36 -0
  44. package/templates/cursor/agents/system-decomposition.md +11 -0
  45. package/templates/cursor/agents/unit-test-run.md +19 -0
  46. package/templates/cursor/policies/implementation.md +8 -0
  47. package/templates/cursor/policies/master-rules.md +7 -0
  48. package/templates/cursor/skills/shared/api/SKILL.md +26 -0
  49. package/templates/cursor/skills/shared/architecture/SKILL.md +25 -0
  50. package/templates/cursor/skills/shared/architecture/orchestrator/SKILL.md +21 -0
  51. package/templates/cursor/skills/shared/architecture/refactor-analysis.md +302 -0
  52. package/templates/cursor/skills/shared/check/SKILL.md +47 -0
  53. package/templates/cursor/skills/shared/component/SKILL.md +24 -0
  54. package/templates/cursor/skills/shared/dependency-graph/SKILL.md +38 -0
  55. package/templates/cursor/skills/shared/discovery/SKILL.md +29 -0
  56. package/templates/cursor/skills/shared/documentation/SKILL.md +21 -0
  57. package/templates/cursor/skills/shared/documentation/orchestrator/SKILL.md +26 -0
  58. package/templates/cursor/skills/shared/documentation/orchestrator/contract.yaml +20 -0
  59. package/templates/cursor/skills/shared/documentation/write-arch-doc.md +168 -0
  60. package/templates/cursor/skills/shared/domain/SKILL.md +24 -0
  61. package/templates/cursor/skills/shared/execution/SKILL.md +34 -0
  62. package/templates/cursor/skills/shared/fitness-functions/SKILL.md +42 -0
  63. package/templates/cursor/skills/shared/governance/implementation/SKILL.md +424 -0
  64. package/templates/cursor/skills/shared/impact-analysis/SKILL.md +44 -0
  65. package/templates/cursor/skills/shared/integration/SKILL.md +22 -0
  66. package/templates/cursor/skills/shared/investigation/SKILL.md +46 -0
  67. package/templates/cursor/skills/shared/investigation/orchestrator/SKILL.md +22 -0
  68. package/templates/cursor/skills/shared/investigation-lite/SKILL.md +38 -0
  69. package/templates/cursor/skills/shared/migration/SKILL.md +22 -0
  70. package/templates/cursor/skills/shared/model/SKILL.md +22 -0
  71. package/templates/cursor/skills/shared/module-authoring/SKILL.md +29 -0
  72. package/templates/cursor/skills/shared/module-authoring/authoring-template.md +9 -0
  73. package/templates/cursor/skills/shared/planning/SKILL.md +30 -0
  74. package/templates/cursor/skills/shared/platform-release/SKILL.md +46 -0
  75. package/templates/cursor/skills/shared/platform-release/orchestrator/SKILL.md +51 -0
  76. package/templates/cursor/skills/shared/platform-release/orchestrator/contract.yaml +29 -0
  77. package/templates/cursor/skills/shared/platform-release/ship-procedure.md +31 -0
  78. package/templates/cursor/skills/shared/remove/SKILL.md +28 -0
  79. package/templates/cursor/skills/shared/reporting/SKILL.md +43 -0
  80. package/templates/cursor/skills/shared/rollback/SKILL.md +46 -0
  81. package/templates/cursor/skills/shared/root-cause/SKILL.md +24 -0
  82. package/templates/cursor/skills/shared/run/SKILL.md +64 -0
  83. package/templates/cursor/skills/shared/schema/SKILL.md +24 -0
  84. package/templates/cursor/skills/shared/testing/SKILL.md +24 -0
  85. package/templates/cursor/skills/shared/testing/orchestrator/SKILL.md +22 -0
  86. package/templates/cursor/skills/shared/validation/SKILL.md +56 -0
  87. package/templates/cursor/skills/shared/verbs/_dispatch-utils.md +90 -0
  88. package/templates/cursor/skills/shared/verbs/_lifecycle.md +87 -0
  89. package/templates/cursor/skills/shared/verbs/_object-skills.md +60 -0
  90. package/templates/cursor/skills/shared/verbs/check/orchestrator/SKILL.md +22 -0
  91. package/templates/cursor/skills/shared/verbs/check/orchestrator/contract.yaml +24 -0
  92. package/templates/cursor/skills/shared/verbs/create/orchestrator/SKILL.md +39 -0
  93. package/templates/cursor/skills/shared/verbs/create/orchestrator/contract.yaml +34 -0
  94. package/templates/cursor/skills/shared/verbs/fix/orchestrator/SKILL.md +33 -0
  95. package/templates/cursor/skills/shared/verbs/fix/orchestrator/contract.yaml +38 -0
  96. package/templates/cursor/skills/shared/verbs/release/orchestrator/SKILL.md +29 -0
  97. package/templates/cursor/skills/shared/verbs/release/orchestrator/contract.yaml +25 -0
  98. package/templates/cursor/skills/shared/verbs/remove/orchestrator/SKILL.md +25 -0
  99. package/templates/cursor/skills/shared/verbs/remove/orchestrator/contract.yaml +32 -0
  100. package/templates/cursor/skills/shared/verbs/review/orchestrator/SKILL.md +24 -0
  101. package/templates/cursor/skills/shared/verbs/review/orchestrator/contract.yaml +25 -0
  102. package/templates/cursor/skills/shared/verbs/test/orchestrator/SKILL.md +24 -0
  103. package/templates/cursor/skills/shared/verbs/test/orchestrator/contract.yaml +25 -0
  104. package/templates/cursor/skills/shared/verbs/update/orchestrator/SKILL.md +34 -0
  105. package/templates/cursor/skills/shared/verbs/update/orchestrator/contract.yaml +34 -0
  106. package/templates/cursor/skills/shared/verification/SKILL.md +28 -0
  107. package/templates/cursor/skills/shared/workflow/SKILL.md +25 -0
  108. package/templates/docs/agentic_architecture.md +131 -0
  109. package/templates/docs/architecture.md +5 -0
  110. package/templates/docs/master_rules.md +5 -0
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: verb-update-orchestrator
3
+ description: Orchestrates update-* commands without dedicated resolver. Internal only.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # update-* orchestrator
8
+
9
+ **Object** from graph. Resolvers win: `update-module`, `update-architecture`, `update-component` (alias: `update-design`).
10
+
11
+ Read [_dispatch-utils.md](../_dispatch-utils.md) and [_lifecycle.md](../_lifecycle.md) first.
12
+
13
+ Lifecycle: graph `verb_runtime.update` (work + gates on Run)
14
+
15
+ ## Phases (deterministic — do not skip)
16
+
17
+ 1. **policies**
18
+ 2. **load_inventory** — when domain inventory exists
19
+ 3. **discover** — [discovery](../../discovery/SKILL.md)
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)
23
+ 7. **impact_analysis** — [impact-analysis](../../impact-analysis/SKILL.md)
24
+ 8. **dependency_graph** — [dependency-graph](../../dependency-graph/SKILL.md)
25
+ 9. **fitness_functions** — [fitness-functions](../../fitness-functions/SKILL.md)
26
+ 10. **rollback** — [rollback](../../rollback/SKILL.md) when maturity protected or blast_radius high
27
+ 11. **execute** — [execution](../../execution/SKILL.md); `design_mode` when component + design resolver
28
+ 12. **verify** — [testing](../../testing/SKILL.md) + [verification](../../verification/SKILL.md)
29
+ 13. **sync_inventory**
30
+ 14. **report** — [reporting](../../reporting/SKILL.md)
31
+
32
+ Intent `Sync inventory only` → inventory sync only, no execution.
33
+
34
+ Gate failure → **STOP, REQUEST CLARIFICATION**
@@ -0,0 +1,34 @@
1
+ name: verb-update-orchestrator
2
+ purpose: Modify existing code, config, or docs per update-* command
3
+ inputs:
4
+ domain:
5
+ required: false
6
+ intent:
7
+ required: true
8
+ outputs:
9
+ code_changes:
10
+ type: boolean
11
+ inventory_synced:
12
+ type: boolean
13
+ report:
14
+ type: markdown
15
+ success_criteria:
16
+ - All policies loaded before execute
17
+ - domain inventory loaded when domains/<slug>/update/inventory exists
18
+ - object skills from graph loaded
19
+ - governance/implementation followed for all edits
20
+ - fallow check_changed clean on touched files
21
+ failure_conditions:
22
+ - execute without approved plan
23
+ - skip domain inventory when slug resolves to inventory file
24
+ dependencies:
25
+ skills: [discovery, planning, execution, testing, verification, reporting]
26
+ policies: [master-rules, implementation, mcp-and-deploy]
27
+ docs:
28
+ - docs/master_rules.md
29
+ - docs/architecture.md
30
+ - docs/design_system.md
31
+ verification:
32
+ - sync_inventory
33
+ - run_tests
34
+ - fallow_check_changed
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: shared-verification
3
+ description: >-
4
+ Verifies AAAC intent met — contract success_criteria, inventory sync, behavior
5
+ spot-check, fitness re-score. Distinct from testing (green CI). Not user-facing.
6
+ disable-model-invocation: true
7
+ ---
8
+
9
+ # Shared verification
10
+
11
+ ## When
12
+
13
+ After `testing`. Before `report`.
14
+
15
+ ## Checks
16
+
17
+ - Orchestrator `contract.yaml` `success_criteria`
18
+ - Graph `object_skills` / `object_skill_verbs` skills were loaded for command object + verb
19
+ - User instruction satisfied (spot-check 2–3 behaviors in code or tests)
20
+ - Domain constraints from inventory still hold
21
+ - `sync_inventory` completed when `execute` ran (inventory date + file table current)
22
+ - Out-of-scope areas untouched
23
+ - **Fitness re-check:** abbreviated [fitness-functions](../fitness-functions/SKILL.md) score on touched scope — no new `fail` on security or layer_boundaries
24
+ - Rollback plan from [rollback](../rollback/SKILL.md) still accurate if execute changed scope
25
+
26
+ ## Fail
27
+
28
+ Stop and report gaps — do not claim success if tests pass but intent unmet.
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: shared-workflow
3
+ description: >-
4
+ Multi-step business processes and state machines. Object workflow. Not user-facing.
5
+ disable-model-invocation: true
6
+ ---
7
+
8
+ # Shared workflow
9
+
10
+ ## Scope
11
+
12
+ - Explicit state machines (finite states, named transitions)
13
+ - Orchestration across UI → API → jobs → external systems
14
+ - Requirement engine, Q&A graphs, publish pipelines, release waves
15
+
16
+ ## Execution focus
17
+
18
+ - Model invalid transitions; no timing assumptions
19
+ - Idempotent async steps; cancellable where applicable
20
+ - Log state transitions at debug level
21
+
22
+ ## Review / check focus
23
+
24
+ - Can the process reach the intended end state?
25
+ - Race conditions and overlapping requests
@@ -0,0 +1,131 @@
1
+ # Agentic Architecture as Code (AAAC)
2
+
3
+ ## In one sentence
4
+
5
+ > **Commands are the public API. Skills, agents, tools, rules, and documentation are private implementation details.**
6
+
7
+ You express intent; the architecture determines execution.
8
+
9
+ Installed by [{{PROJECT_NAME}}](https://ludecker.com) — generic AAAC kernel for Cursor.
10
+
11
+ ---
12
+
13
+ ## Part 1 — For everyone
14
+
15
+ ### What you do
16
+
17
+ > **Call a command. The system figures out the rest.**
18
+
19
+ Ask: *What do I want?* Then type:
20
+
21
+ ```text
22
+ /<verb>-<object> <domain> "<intent>"
23
+ ```
24
+
25
+ | Part | Meaning | Example |
26
+ |------|---------|---------|
27
+ | Command | Kind of work | `update-module` |
28
+ | Domain | Which bounded context | `api` |
29
+ | Intent | Goal in plain language | `"Add pagination to list endpoint"` |
30
+
31
+ ### Commands (AAAC v1)
32
+
33
+ | Command | When to use |
34
+ |---------|-------------|
35
+ | `update-module` | Change an existing bounded module |
36
+ | `update-doc` | Update architecture documentation (no code) |
37
+ | `create-feature` | Add a new capability |
38
+ | `fix-bug` | Fix broken behavior |
39
+ | `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).
46
+
47
+ ### Examples
48
+
49
+ ```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"
56
+ ```
57
+
58
+ ### What you should not need to know
59
+
60
+ skill, agent, subagent, tool, workflow, graph, orchestrator — infrastructure only.
61
+
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:
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
+ ### Responsibility layers
91
+
92
+ Full map: [`.cursor/aaac/layers.md`](../.cursor/aaac/layers.md)
93
+
94
+ ```text
95
+ User Layer → Commands
96
+ Control Layer → Ontology, Dispatch, Graph
97
+ Lifecycle Layer → work phases (lifecycle.json)
98
+ Governance Layer → gate stacks (gates.json), policies, fitness
99
+ Run Layer → Run manifest (state + observability)
100
+ Execution Layer → Orchestrators, pipeline skills, capabilities, agents
101
+ Contracts Layer → command + skill contracts
102
+ Knowledge Layer → {{DOCS_ROOT}}/
103
+ ```
104
+
105
+ **SSOT:** [`.cursor/aaac/graph.yaml`](../.cursor/aaac/graph.yaml)
106
+
107
+ **Dispatch:** [`.cursor/aaac/dispatch.md`](../.cursor/aaac/dispatch.md)
108
+
109
+ ### Directory layout
110
+
111
+ ```text
112
+ .cursor/
113
+ commands/ # thin routers (public)
114
+ aaac/ # ontology, graph, generators config
115
+ domains/<slug>/update/
116
+ orchestrator/
117
+ inventory/
118
+ skills/shared/ # pipeline + verb orchestrators
119
+ 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)
125
+ ```
126
+
127
+ ### Release swarm (`release-app`)
128
+
129
+ Wave 1: `release-git` (blocking). Configure deploy agents in `graph.project.yaml` for your host.
130
+
131
+ Orchestrator: [`.cursor/skills/shared/platform-release/orchestrator`](../.cursor/skills/shared/platform-release/orchestrator/SKILL.md)
@@ -0,0 +1,5 @@
1
+ # Architecture
2
+
3
+ Describe your system map: layers, modules, data flow, and deployment.
4
+
5
+ AAAC policies reference this file. Replace this stub with your project architecture.
@@ -0,0 +1,5 @@
1
+ # Master rules
2
+
3
+ Define your project’s non-negotiable architecture and implementation rules here.
4
+
5
+ AAAC orchestrators load this file via `.cursor/policies/master-rules.md`. Replace this stub with your team’s rules.