@ludecker/aaac 1.1.3 → 1.1.5

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 (44) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/src/run-engine/advance-phase.mjs +2 -5
  4. package/src/run-engine/debug-run.mjs +6 -0
  5. package/src/run-engine/lib.mjs +17 -0
  6. package/src/run-engine/log.mjs +1 -1
  7. package/src/run-engine/record-task.mjs +25 -4
  8. package/templates/cursor/aaac/enforcement.json +6 -0
  9. package/templates/cursor/aaac/graph.project.yaml +2 -0
  10. package/templates/cursor/aaac/run/schema.json +5 -0
  11. package/templates/cursor/aaac/scripts/run-engine/advance-phase.mjs +2 -5
  12. package/templates/cursor/aaac/scripts/run-engine/debug-run.mjs +6 -0
  13. package/templates/cursor/aaac/scripts/run-engine/lib.mjs +17 -0
  14. package/templates/cursor/aaac/scripts/run-engine/log.mjs +1 -1
  15. package/templates/cursor/aaac/scripts/run-engine/record-task.mjs +25 -4
  16. package/templates/cursor/aaac/scripts/run-engine/verify-website-build.mjs +1 -1
  17. package/templates/cursor/agents/fix-runtime-evidence.md +1 -1
  18. package/templates/cursor/policies/implementation.md +3 -0
  19. package/templates/cursor/policies/mcp-and-deploy.md +14 -0
  20. package/templates/cursor/policies/minimal-complexity.md +2 -2
  21. package/templates/cursor/policies/project-context.md +5 -0
  22. package/templates/cursor/policies/ui-design.md +5 -0
  23. package/templates/cursor/rules/aaac-enforcement.mdc +10 -5
  24. package/templates/cursor/skills/shared/_task-prompt-policy.md +18 -0
  25. package/templates/cursor/skills/shared/architecture/refactor-analysis.md +7 -7
  26. package/templates/cursor/skills/shared/check/SKILL.md +4 -0
  27. package/templates/cursor/skills/shared/discovery/SKILL.md +4 -0
  28. package/templates/cursor/skills/shared/execution/SKILL.md +2 -3
  29. package/templates/cursor/skills/shared/governance/implementation/SKILL.md +8 -5
  30. package/templates/cursor/skills/shared/integration/SKILL.md +2 -2
  31. package/templates/cursor/skills/shared/investigation/SKILL.md +1 -1
  32. package/templates/cursor/skills/shared/investigation-lite/SKILL.md +2 -0
  33. package/templates/cursor/skills/shared/platform-release/SKILL.md +4 -6
  34. package/templates/cursor/skills/shared/platform-release/orchestrator/SKILL.md +4 -4
  35. package/templates/cursor/skills/shared/platform-release/ship-procedure.md +14 -15
  36. package/templates/cursor/skills/shared/schema/SKILL.md +1 -1
  37. package/templates/cursor/skills/shared/testing/SKILL.md +3 -3
  38. package/templates/cursor/skills/shared/verbs/_dispatch-utils.md +5 -3
  39. package/templates/cursor/skills/shared/verbs/check/orchestrator/SKILL.md +1 -1
  40. package/templates/cursor/skills/shared/verbs/update/orchestrator/contract.yaml +3 -1
  41. package/templates/docs/agentic_architecture.md +2 -2
  42. package/templates/docs/master_rules.md +673 -20
  43. package/templates/docs/project_context.md +40 -0
  44. package/templates/docs/ui_design.md +206 -0
package/README.md CHANGED
@@ -31,7 +31,7 @@ Works **out of the box** after `init` — open in Cursor and run commands. No po
31
31
  - `.cursor/skills/shared/` — full pipeline (discovery → execute → verify → report)
32
32
  - `.cursor/agents/` — 13 generic subagent specs
33
33
  - `.cursor/commands/` — ~130 generated slash commands
34
- - `docs/` — ready-to-use `master_rules.md`, `architecture.md`, and `agentic_architecture.md`
34
+ - `docs/` — ready-to-use `master_rules.md`, `ui_design.md`, `project_context.md`, `architecture.md`, and `agentic_architecture.md`
35
35
 
36
36
  Optional later: add **domains** under `.cursor/domains/<slug>/` (see maintainer appendix in `agentic_architecture.md`).
37
37
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ludecker/aaac",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "Agentic Architecture as Code (AAAC) — installable Cursor agent framework",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -16,6 +16,7 @@ import {
16
16
  phaseKind,
17
17
  isEditPhase,
18
18
  isGatePhase,
19
+ resolveSwarmMinimum,
19
20
  writeJson,
20
21
  saveActiveRun,
21
22
  } from "./lib.mjs";
@@ -55,11 +56,7 @@ if (manifest.phase !== completedPhase) {
55
56
  process.exit(1);
56
57
  }
57
58
 
58
- const minAgents =
59
- completedPhase === "verify" &&
60
- (enforcement.fix_commands?.includes(manifest.command) || manifest.verb === "fix")
61
- ? enforcement.swarm_min_agents?.verify_fix
62
- : enforcement.swarm_min_agents?.[completedPhase];
59
+ const minAgents = resolveSwarmMinimum(completedPhase, manifest, enforcement);
63
60
  const launches = manifest.swarm?.task_launches_this_phase ?? 0;
64
61
  if (minAgents && launches < minAgents && !force) {
65
62
  recordLog(manifest, {
@@ -31,6 +31,12 @@ if (summary.blocked_reason) console.log(`Blocked: ${summary.blocked_reason}`);
31
31
  console.log(`Completed: ${summary.completed.join(" → ") || "(none)"}`);
32
32
  console.log(`Pending: ${summary.pending.join(" → ") || "(none)"}`);
33
33
  console.log(`Swarm: phase=${summary.swarm.phase} count=${summary.swarm.task_launches_this_phase}`);
34
+ if (summary.swarm.agents?.length) {
35
+ console.log(`Agents: ${summary.swarm.agents.length} recorded this phase`);
36
+ for (const a of summary.swarm.agents.slice(-5)) {
37
+ console.log(` #${a.index} ${a.subagent_type ?? "?"} ${a.description ?? ""} @ ${a.at}`);
38
+ }
39
+ }
34
40
  console.log(`Log: ${summary.log_count} entries Decisions: ${summary.decisions_count}`);
35
41
  console.log("--- last 10 log entries ---");
36
42
  for (const e of summary.last_log_entries) {
@@ -136,6 +136,23 @@ export function phaseKind(phase, registry) {
136
136
  return isGatePhase(phase, registry) ? "gate" : "work";
137
137
  }
138
138
 
139
+ /** Swarm minimum for completed phase — check verb uses check_swarm on discover. */
140
+ export function resolveSwarmMinimum(completedPhase, manifest, enforcement) {
141
+ if (
142
+ completedPhase === "verify" &&
143
+ (enforcement.fix_commands?.includes(manifest.command) || manifest.verb === "fix")
144
+ ) {
145
+ return enforcement.swarm_min_agents?.verify_fix;
146
+ }
147
+ if (completedPhase === "discover" && manifest.verb === "check") {
148
+ return (
149
+ enforcement.swarm_min_agents?.check_swarm ??
150
+ enforcement.swarm_min_agents?.discover
151
+ );
152
+ }
153
+ return enforcement.swarm_min_agents?.[completedPhase];
154
+ }
155
+
139
156
  export function promptFromHook(hook) {
140
157
  return hook?.prompt ?? hook?.text ?? hook?.content ?? "";
141
158
  }
@@ -334,7 +334,7 @@ export function debugRunSummary(manifest) {
334
334
  awaiting_approval: manifest.awaiting_approval,
335
335
  completed: manifest.completed ?? [],
336
336
  pending: manifest.pending ?? [],
337
- swarm: { phase: swarmPhase, task_launches_this_phase: swarmCount },
337
+ swarm: { phase: swarmPhase, task_launches_this_phase: swarmCount, agents: manifest.swarm?.agents ?? [] },
338
338
  edit_allowed: manifest.enforcement?.edit_allowed ?? false,
339
339
  last_log_entries: log.slice(-10),
340
340
  decisions_count: (manifest.decisions ?? []).length,
@@ -44,19 +44,40 @@ process.stdin.on("end", () => {
44
44
  if (manifest.conversation_id && manifest.conversation_id !== conversationId) allow();
45
45
 
46
46
  manifest.swarm = manifest.swarm ?? {};
47
- manifest.swarm.task_launches_this_phase = (manifest.swarm.task_launches_this_phase ?? 0) + 1;
47
+ const launchIndex = (manifest.swarm.task_launches_this_phase ?? 0) + 1;
48
+ manifest.swarm.task_launches_this_phase = launchIndex;
48
49
  manifest.swarm.phase = manifest.phase;
49
- manifest.updated_at = isoNow();
50
+
51
+ const agentEntry = {
52
+ at: isoNow(),
53
+ index: launchIndex,
54
+ phase: manifest.phase,
55
+ subagent_type: hook.subagent_type ?? hook.subagentType ?? null,
56
+ description: hook.description ?? hook.subagent_description ?? null,
57
+ model: hook.model ?? null,
58
+ readonly: hook.readonly ?? null,
59
+ };
60
+ manifest.swarm.agents = manifest.swarm.agents ?? [];
61
+ manifest.swarm.agents.push(agentEntry);
62
+
63
+ const telemetryDetail = JSON.stringify({
64
+ count: launchIndex,
65
+ subagent_type: agentEntry.subagent_type,
66
+ index: launchIndex,
67
+ });
50
68
 
51
69
  recordLog(manifest, {
52
70
  event: "agent_spawned",
53
71
  phase: manifest.phase,
54
72
  phase_kind: manifest.phase_kind,
55
- detail: `count=${manifest.swarm.task_launches_this_phase}`,
73
+ detail: telemetryDetail,
56
74
  level: "debug",
57
75
  });
58
76
 
59
77
  writeJson(path.join(runDir(active.run_id), "run.json"), manifest);
60
- saveActiveRun(conversationId, { ...active, task_launches_this_phase: manifest.swarm.task_launches_this_phase });
78
+ saveActiveRun(conversationId, {
79
+ ...active,
80
+ task_launches_this_phase: manifest.swarm.task_launches_this_phase,
81
+ });
61
82
  allow();
62
83
  });
@@ -6,6 +6,7 @@
6
6
  "verify_verbs": ["create", "update", "fix"],
7
7
  "swarm_min_agents": {
8
8
  "discover": 4,
9
+ "check_swarm": 3,
9
10
  "investigate_swarm": 7,
10
11
  "research_swarm": 6,
11
12
  "verify_fix": 3
@@ -14,6 +15,11 @@
14
15
  "investigate_swarm": ["artifacts/investigation.md"],
15
16
  "root_cause": ["artifacts/root_cause.yaml"],
16
17
  "plan": ["artifacts/plan.yaml"],
18
+ "validate": ["artifacts/validate.yaml"],
19
+ "impact_analysis": ["artifacts/impact.yaml"],
20
+ "dependency_graph": ["artifacts/dependency_graph.yaml"],
21
+ "fitness_functions": ["artifacts/fitness.yaml"],
22
+ "rollback": ["artifacts/rollback.yaml"],
17
23
  "verify": ["artifacts/verify.yaml"],
18
24
  "report": ["artifacts/report.md"]
19
25
  },
@@ -189,5 +189,7 @@ agents:
189
189
 
190
190
  policies:
191
191
  - policies/master-rules.md
192
+ - policies/project-context.md
193
+ - policies/ui-design.md
192
194
  - policies/implementation.md
193
195
  - policies/mcp-and-deploy.md
@@ -35,6 +35,11 @@
35
35
  "stack": "string | null",
36
36
  "results": {}
37
37
  },
38
+ "swarm": {
39
+ "task_launches_this_phase": 0,
40
+ "phase": "string | null",
41
+ "agents": []
42
+ },
38
43
  "created_at": "iso8601",
39
44
  "updated_at": "iso8601"
40
45
  },
@@ -16,6 +16,7 @@ import {
16
16
  phaseKind,
17
17
  isEditPhase,
18
18
  isGatePhase,
19
+ resolveSwarmMinimum,
19
20
  writeJson,
20
21
  saveActiveRun,
21
22
  } from "./lib.mjs";
@@ -55,11 +56,7 @@ if (manifest.phase !== completedPhase) {
55
56
  process.exit(1);
56
57
  }
57
58
 
58
- const minAgents =
59
- completedPhase === "verify" &&
60
- (enforcement.fix_commands?.includes(manifest.command) || manifest.verb === "fix")
61
- ? enforcement.swarm_min_agents?.verify_fix
62
- : enforcement.swarm_min_agents?.[completedPhase];
59
+ const minAgents = resolveSwarmMinimum(completedPhase, manifest, enforcement);
63
60
  const launches = manifest.swarm?.task_launches_this_phase ?? 0;
64
61
  if (minAgents && launches < minAgents && !force) {
65
62
  recordLog(manifest, {
@@ -31,6 +31,12 @@ if (summary.blocked_reason) console.log(`Blocked: ${summary.blocked_reason}`);
31
31
  console.log(`Completed: ${summary.completed.join(" → ") || "(none)"}`);
32
32
  console.log(`Pending: ${summary.pending.join(" → ") || "(none)"}`);
33
33
  console.log(`Swarm: phase=${summary.swarm.phase} count=${summary.swarm.task_launches_this_phase}`);
34
+ if (summary.swarm.agents?.length) {
35
+ console.log(`Agents: ${summary.swarm.agents.length} recorded this phase`);
36
+ for (const a of summary.swarm.agents.slice(-5)) {
37
+ console.log(` #${a.index} ${a.subagent_type ?? "?"} ${a.description ?? ""} @ ${a.at}`);
38
+ }
39
+ }
34
40
  console.log(`Log: ${summary.log_count} entries Decisions: ${summary.decisions_count}`);
35
41
  console.log("--- last 10 log entries ---");
36
42
  for (const e of summary.last_log_entries) {
@@ -136,6 +136,23 @@ export function phaseKind(phase, registry) {
136
136
  return isGatePhase(phase, registry) ? "gate" : "work";
137
137
  }
138
138
 
139
+ /** Swarm minimum for completed phase — check verb uses check_swarm on discover. */
140
+ export function resolveSwarmMinimum(completedPhase, manifest, enforcement) {
141
+ if (
142
+ completedPhase === "verify" &&
143
+ (enforcement.fix_commands?.includes(manifest.command) || manifest.verb === "fix")
144
+ ) {
145
+ return enforcement.swarm_min_agents?.verify_fix;
146
+ }
147
+ if (completedPhase === "discover" && manifest.verb === "check") {
148
+ return (
149
+ enforcement.swarm_min_agents?.check_swarm ??
150
+ enforcement.swarm_min_agents?.discover
151
+ );
152
+ }
153
+ return enforcement.swarm_min_agents?.[completedPhase];
154
+ }
155
+
139
156
  export function promptFromHook(hook) {
140
157
  return hook?.prompt ?? hook?.text ?? hook?.content ?? "";
141
158
  }
@@ -334,7 +334,7 @@ export function debugRunSummary(manifest) {
334
334
  awaiting_approval: manifest.awaiting_approval,
335
335
  completed: manifest.completed ?? [],
336
336
  pending: manifest.pending ?? [],
337
- swarm: { phase: swarmPhase, task_launches_this_phase: swarmCount },
337
+ swarm: { phase: swarmPhase, task_launches_this_phase: swarmCount, agents: manifest.swarm?.agents ?? [] },
338
338
  edit_allowed: manifest.enforcement?.edit_allowed ?? false,
339
339
  last_log_entries: log.slice(-10),
340
340
  decisions_count: (manifest.decisions ?? []).length,
@@ -44,19 +44,40 @@ process.stdin.on("end", () => {
44
44
  if (manifest.conversation_id && manifest.conversation_id !== conversationId) allow();
45
45
 
46
46
  manifest.swarm = manifest.swarm ?? {};
47
- manifest.swarm.task_launches_this_phase = (manifest.swarm.task_launches_this_phase ?? 0) + 1;
47
+ const launchIndex = (manifest.swarm.task_launches_this_phase ?? 0) + 1;
48
+ manifest.swarm.task_launches_this_phase = launchIndex;
48
49
  manifest.swarm.phase = manifest.phase;
49
- manifest.updated_at = isoNow();
50
+
51
+ const agentEntry = {
52
+ at: isoNow(),
53
+ index: launchIndex,
54
+ phase: manifest.phase,
55
+ subagent_type: hook.subagent_type ?? hook.subagentType ?? null,
56
+ description: hook.description ?? hook.subagent_description ?? null,
57
+ model: hook.model ?? null,
58
+ readonly: hook.readonly ?? null,
59
+ };
60
+ manifest.swarm.agents = manifest.swarm.agents ?? [];
61
+ manifest.swarm.agents.push(agentEntry);
62
+
63
+ const telemetryDetail = JSON.stringify({
64
+ count: launchIndex,
65
+ subagent_type: agentEntry.subagent_type,
66
+ index: launchIndex,
67
+ });
50
68
 
51
69
  recordLog(manifest, {
52
70
  event: "agent_spawned",
53
71
  phase: manifest.phase,
54
72
  phase_kind: manifest.phase_kind,
55
- detail: `count=${manifest.swarm.task_launches_this_phase}`,
73
+ detail: telemetryDetail,
56
74
  level: "debug",
57
75
  });
58
76
 
59
77
  writeJson(path.join(runDir(active.run_id), "run.json"), manifest);
60
- saveActiveRun(conversationId, { ...active, task_launches_this_phase: manifest.swarm.task_launches_this_phase });
78
+ saveActiveRun(conversationId, {
79
+ ...active,
80
+ task_launches_this_phase: manifest.swarm.task_launches_this_phase,
81
+ });
61
82
  allow();
62
83
  });
@@ -25,7 +25,7 @@ function loadVerifyConfig() {
25
25
  if (!verify.enabled) {
26
26
  return { enabled: false };
27
27
  }
28
- const appRootRel = verify.app_root ?? "apps/website";
28
+ const appRootRel = verify.app_root ?? "apps/web";
29
29
  const indexRel =
30
30
  verify.index_html ?? path.join(appRootRel, "index.html").replace(/\\/g, "/");
31
31
  const appRoot = path.join(PROJECT_ROOT, appRootRel);
@@ -9,7 +9,7 @@ Gather runtime evidence — logs, CI, MCP, browser errors — for the symptom.
9
9
  ## Procedure
10
10
 
11
11
  1. If intent mentions CI or deploy → use `ci-investigator` subagent pattern or read recent workflow logs
12
- 2. If database/RLS → Supabase MCP `get_logs`, `get_advisors` (project `anseivwusnyiwopihnqu`)
12
+ 2. If database/RLS → use configured database MCP `get_logs`, `get_advisors` (see [mcp-and-deploy.md](../../policies/mcp-and-deploy.md))
13
13
  3. If Render deploy → check deployment status via Render MCP when available
14
14
  4. If error message pasted → search codebase for matching string
15
15
  5. Never log secrets or tokens
@@ -2,6 +2,9 @@
2
2
 
3
3
  **Sources:**
4
4
 
5
+ - [{{DOCS_ROOT}}/master_rules.md](../../{{DOCS_ROOT}}/master_rules.md)
6
+ - [{{DOCS_ROOT}}/ui_design.md](../../{{DOCS_ROOT}}/ui_design.md)
7
+ - [{{DOCS_ROOT}}/project_context.md](../../{{DOCS_ROOT}}/project_context.md)
5
8
  - [{{DOCS_ROOT}}/architecture.md](../../{{DOCS_ROOT}}/architecture.md)
6
9
  - [.cursor/skills/shared/governance/implementation/SKILL.md](../skills/shared/governance/implementation/SKILL.md)
7
10
 
@@ -0,0 +1,14 @@
1
+ # Policy: MCP and deploy
2
+
3
+ Optional project overlay. Add rule files under `.cursor/rules/` when you use MCP servers or a deploy platform.
4
+
5
+ | Concern | Where to configure |
6
+ |---------|-------------------|
7
+ | Database MCP | `.cursor/rules/<provider>-mcp.mdc` — migrations, project ref, RLS |
8
+ | Deploy / hosting | `.cursor/rules/deploy.mdc` — service name, blueprint, smoke URL |
9
+
10
+ **Migrations:** When you add SQL under your migrations folder, apply via your configured database MCP immediately after the change.
11
+
12
+ **Deploy checks:** Use the MCP server your team configures in Cursor settings. Put vendor project IDs and service names in `docs/project_context.md` or `.cursor/rules/` — not in shared generic skills.
13
+
14
+ Generic installs ship without provider-specific rule files. Add them when you connect Supabase, Render, or another provider.
@@ -67,9 +67,9 @@ complexity_breakdown:
67
67
  new_api_endpoint: 1
68
68
  modify: 1
69
69
  reuse:
70
- - "ExportButton pattern from packages/ui"
70
+ - "ExportButton pattern from <design-system-package>"
71
71
  modify:
72
- - "apps/website/app/api/export/route.ts (extend existing export handler)"
72
+ - "<app>/api/export/route.ts (extend existing export handler)"
73
73
  create:
74
74
  - artifact: "GET /api/export/csv"
75
75
  kind: new_api_endpoint
@@ -0,0 +1,5 @@
1
+ # Policy: Project context
2
+
3
+ **Source of truth:** [{{DOCS_ROOT}}/project_context.md](../../{{DOCS_ROOT}}/project_context.md)
4
+
5
+ Project-specific paths, SSOT anchors, and tooling. Master rules stay stack-agnostic. Domain skills cannot override master rules.
@@ -0,0 +1,5 @@
1
+ # Policy: UI design and CSS
2
+
3
+ **Source of truth:** [{{DOCS_ROOT}}/ui_design.md](../../{{DOCS_ROOT}}/ui_design.md)
4
+
5
+ Loaded for UI, component, and styling work. Agents must read before writing CSS or presentational markup. Master Rules §5 and §41 apply.
@@ -11,8 +11,8 @@ Every AAAC slash command (`/fix-module`, `/update-module`, `/write-article`, …
11
11
 
12
12
  ## Prerequisites
13
13
 
14
- 1. **Project opened in Cursor** — `.cursor/hooks.json` is installed by `init`; hooks run when the project is open
15
- 2. **Registry current** — after ontology edits: `npx @ludecker/aaac@latest generate`
14
+ 1. **Cursor Hooks enabled** — Settings → Hooks; restart Cursor after `.cursor/hooks.json` changes
15
+ 2. **Registry current** — `node .cursor/aaac/generate-graph.mjs`
16
16
 
17
17
  ## Hook behavior (automatic)
18
18
 
@@ -31,11 +31,16 @@ Every AAAC slash command (`/fix-module`, `/update-module`, `/write-article`, …
31
31
  node .cursor/aaac/scripts/run-engine/advance-phase.mjs <run_id> <phase>
32
32
  ```
33
33
  3. **Swarm minimums** (enforced by advance-phase):
34
- - `discover`: 4 Task agents
34
+ - `discover`: 4 Task agents (check verbs: `check_swarm` 3)
35
35
  - `investigate_swarm`: 7 Task agents
36
36
  - `research_swarm`: 6 Task agents
37
- 4. **Code edits only in `execute`** (hook-enforced). Before execute: artifacts only under `.cursor/aaac/state/runs/`.
38
- 5. **Complete the Run** — advance through `report`, set status completed.
37
+ 4. **Verify gate (create / update / fix):** before advancing past `verify`, run:
38
+ ```bash
39
+ node .cursor/aaac/scripts/run-engine/verify-website-build.mjs --run-id <run_id>
40
+ ```
41
+ `advance-phase.mjs verify` runs this automatically and blocks on missing static assets or failed `vite build` (catches favicon/path regressions).
42
+ 5. **Code edits only in `execute`** (hook-enforced). Before execute: artifacts only under `.cursor/aaac/state/runs/`.
43
+ 6. **Complete the Run** — advance through `report`, set status completed.
39
44
 
40
45
  ## If edit is denied
41
46
 
@@ -0,0 +1,18 @@
1
+ # Task prompt policy excerpt (mandatory)
2
+
3
+ Append this block to **every** Task sub-agent prompt the orchestrator sends.
4
+
5
+ ## Policies (mandatory)
6
+
7
+ - **Readonly** unless the agent spec explicitly allows test runs or shell commands.
8
+ - **Evidence:** every claim needs `path:line` citations the parent can spot-check.
9
+ - **SSOT:** do not invent constants, routes, or file paths — read the repo.
10
+ - **Prime directive** (master rules): clarity beats cleverness; predictability beats shortcuts; one truth beats convenience.
11
+ - **Layer boundaries:** `packages/ui` must not import `apps/website`; `packages/types` and `packages/utils` stay runtime-free.
12
+ - **Errors:** never silent — state gaps explicitly in the return block.
13
+
14
+ Full policy chain: [.cursor/policies/master-rules.md](../../policies/master-rules.md) → [docs/master_rules.md](../../../docs/master_rules.md)
15
+
16
+ ## Return shape
17
+
18
+ Follow the agent spec (`Findings`, `Evidence`, `Gaps`, `Confidence`). Do not edit files unless the spec allows it.
@@ -61,7 +61,7 @@ Also read the target with codebase tools (Grep, Read) — do not rely on shell a
61
61
  #### S - Single Responsibility
62
62
 
63
63
  Look for:
64
- - Files over budget (see Master Rules §19: routes 200, components 250, lib 300, openrouter 350)
64
+ - Files over budget (see Master Rules §19: routes 200, components 250, lib 300)
65
65
  - Functions over 80 lines (or nested callbacks over 40)
66
66
  - Classes with > 10 methods
67
67
  - Mixed concerns (data + UI + business logic)
@@ -166,7 +166,7 @@ For each issue found, assess:
166
166
  - **Effort**: Lines to change, tests needed?
167
167
  - **Master rule**: Which rule(s) does fixing this satisfy?
168
168
 
169
- Prioritize: clarity and predictability over clever abstractions (Rule 22).
169
+ Prioritize: clarity and predictability over clever abstractions (Rule 42).
170
170
 
171
171
  ## Output Format
172
172
 
@@ -196,7 +196,7 @@ Use this template exactly:
196
196
  | Area | Status | Top violations |
197
197
  |------|--------|----------------|
198
198
  | SSOT & layers | 🟡/🟢/🔴 | [e.g. UI fetching in component] |
199
- | UI discipline | 🟡/🟢/🔴 | [e.g. inline components] |
199
+ | UI discipline | 🟡/🟢/🔴 | [e.g. inline components, deep CSS selectors — see ui_design.md] |
200
200
  | Boundaries & errors | 🟡/🟢/🔴 | [e.g. unvalidated API body] |
201
201
  | Async & state | 🟡/🟢/🔴 | [e.g. ad-hoc flags vs state machine] |
202
202
  | Testing & logging | 🟡/🟢/🔴 | [e.g. no tests for changed module] |
@@ -244,7 +244,7 @@ Use this template exactly:
244
244
 
245
245
  ### ⚠️ Technical Debt Notes
246
246
 
247
- - [Items to defer — document why per Rule 21 if suggesting exceptions]
247
+ - [Items to defer — document why per Rule 34 if suggesting exceptions]
248
248
 
249
249
  ---
250
250
 
@@ -252,14 +252,14 @@ Use this template exactly:
252
252
 
253
253
  Before applying suggestions:
254
254
 
255
- - [ ] Tests exist for affected code (Rule 20)
255
+ - [ ] Tests exist for affected code (Rule 21)
256
256
  - [ ] Create feature branch
257
257
  - [ ] Commit current state (only when user asks)
258
258
  - [ ] Apply **one** refactoring at a time
259
259
  - [ ] Run tests after each change
260
260
  - [ ] Review diff before committing
261
261
  - [ ] No scope creep — minimal diff (user preference)
262
- - [ ] Document any intentional rule exception (Rule 21)
262
+ - [ ] Document any intentional rule exception (Rule 34)
263
263
 
264
264
  ## Applying Refactorings
265
265
 
@@ -270,7 +270,7 @@ When the user asks to implement (not just analyze):
270
270
  3. Centralize schemas and validation at boundaries
271
271
  4. Extract to new files (no inline components)
272
272
  5. Add/update behavioral tests, not implementation-detail tests
273
- 6. Use structured logging on new async paths (Rule 19)
273
+ 6. Use structured logging on new async paths (Rule 20)
274
274
 
275
275
  ## Usage
276
276
 
@@ -34,6 +34,10 @@ Launch **3** parallel `Task` subagents (`explore`, `readonly: true`) in **one me
34
34
 
35
35
  Optional **4th** agent (second wave, only if intent names external system): `discovery-boundaries.md` for integration edges.
36
36
 
37
+ ## Task prompt (mandatory)
38
+
39
+ Every Task prompt **must** include the policy excerpt from [_task-prompt-policy.md](../_task-prompt-policy.md) plus: question, scope, agent spec path, and inventory path when available.
40
+
37
41
  ## Merge
38
42
 
39
43
  Parent synthesizes one brief:
@@ -24,6 +24,10 @@ Launch **4–6** parallel `Task` subagents (`explore`, `readonly: true`) in **on
24
24
 
25
25
  Add domain-specific angles from inventory skill. Max **8** agents total; second wave ≤2 for critical gaps.
26
26
 
27
+ ## Task prompt (mandatory)
28
+
29
+ Every Task prompt **must** include the policy excerpt from [_task-prompt-policy.md](../_task-prompt-policy.md) plus: intent, domain, inventory constraints, and the linked agent spec path.
30
+
27
31
  ## Output
28
32
 
29
33
  Merged brief for `planning`: findings, evidence, gaps, confidence. Parent spot-checks `path:line` claims.
@@ -15,14 +15,13 @@ Orchestrator phase `execute` after approved plan.
15
15
  ## Mandatory
16
16
 
17
17
  1. Read [governance/implementation/SKILL.md](../governance/implementation/SKILL.md)
18
- 2. Read domain [inventory](../../../domains/) constraints
18
+ 2. Read domain inventory when present (`domains/<slug>/update/inventory/`)
19
19
  3. Read [policies/](../../../policies/)
20
20
 
21
21
  ## Actions
22
22
 
23
23
  - Edit files per plan and implementation skill
24
- - `apply_migration` for new/changed `supabase/migrations/` (project `anseivwusnyiwopihnqu` see [supabase-mcp.mdc](../../../rules/supabase-mcp.mdc))
25
- - `track()` for user-facing mutations
24
+ - Apply database migrations via configured MCP when your project uses one (see [mcp-and-deploy.md](../../../policies/mcp-and-deploy.md) and `{{DOCS_ROOT}}/project_context.md`)
26
25
  - Structured logging on server async paths
27
26
 
28
27
  ## Must not
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: implementation
3
- description: Enforces project master rules and architecture when implementing code. Read {{DOCS_ROOT}}/master_rules.md and {{DOCS_ROOT}}/architecture.md before any code change.
3
+ description: Enforces project master rules and architecture when implementing code. Read {{DOCS_ROOT}}/master_rules.md, {{DOCS_ROOT}}/ui_design.md (UI/CSS), {{DOCS_ROOT}}/project_context.md, and {{DOCS_ROOT}}/architecture.md before any code change.
4
4
  ---
5
5
 
6
6
  # Implementation
@@ -10,6 +10,8 @@ All code changes must comply with your project docs. **If implementation conflic
10
10
  | Document | Path | Governs |
11
11
  |----------|------|---------|
12
12
  | Master Rules | [{{DOCS_ROOT}}/master_rules.md](../../../../{{DOCS_ROOT}}/master_rules.md) | Architecture, layers, SSOT, testing |
13
+ | UI Design | [{{DOCS_ROOT}}/ui_design.md](../../../../{{DOCS_ROOT}}/ui_design.md) | CSS discipline, selectors, layout, a11y |
14
+ | Project Context | [{{DOCS_ROOT}}/project_context.md](../../../../{{DOCS_ROOT}}/project_context.md) | Repo paths, SSOT anchors, tooling |
13
15
  | Architecture | [{{DOCS_ROOT}}/architecture.md](../../../../{{DOCS_ROOT}}/architecture.md) | System shape, modules, data flow, deploy |
14
16
 
15
17
  Read the relevant sections **before** implementing. Add project-specific object skills under `.cursor/skills/<project>/` and wire them in `capabilities/registry.json` when you outgrow the generic defaults.
@@ -20,8 +22,9 @@ Read the relevant sections **before** implementing. Add project-specific object
20
22
 
21
23
  1. **Identify the layer** you are touching (UI, state, domain, infrastructure).
22
24
  2. **Read** the matching section in master rules and architecture docs.
23
- 3. **Check reuse**extend existing modules before adding new ones.
24
- 4. **Respect boundaries** — UI renders only; domain owns rules; infrastructure persists.
25
+ 3. **UI/CSS work:** read [ui_design.md](../../../../{{DOCS_ROOT}}/ui_design.md) shallow CSS, no premature token architecture (Rules §5, §41).
26
+ 4. **Check reuse** — extend existing modules before adding new ones.
27
+ 5. **Respect boundaries** — UI renders only; domain owns rules; infrastructure persists.
25
28
 
26
29
  ---
27
30
 
@@ -41,7 +44,7 @@ Direction: **Input → State → Logic → Output**. No circular imports across
41
44
  ## Checklist (execute phase)
42
45
 
43
46
  - [ ] Values from config/constants — no unexplained literals
44
- - [ ] Token/class-based CSS — no inline styles in UI components
47
+ - [ ] Class-based CSS per ui_design.md — no inline styles; shallow selectors
45
48
  - [ ] One component per file; named exports
46
49
  - [ ] Async ops: cancellable, logged at boundaries
47
50
  - [ ] Tests appropriate to the change (unit for domain, integration for boundaries)
@@ -50,4 +53,4 @@ Direction: **Input → State → Logic → Output**. No circular imports across
50
53
 
51
54
  ## Project overlay (optional)
52
55
 
53
- Generic rules ship in `{{DOCS_ROOT}}/master_rules.md` and work without edits. When you outgrow defaults, extend those docs or add a `skills/<project>/implementation/` skill and wire it in `graph.project.yaml`.
56
+ Generic rules ship in `{{DOCS_ROOT}}/master_rules.md` and work without edits. Put repo-specific paths and SSOT anchors in `{{DOCS_ROOT}}/project_context.md`. When you outgrow defaults, extend those docs or add a `skills/<project>/implementation/` skill and wire it in `graph.project.yaml`.
@@ -9,8 +9,8 @@ disable-model-invocation: true
9
9
 
10
10
  ## Scope
11
11
 
12
- - `apps/website/app/api/`, Supabase MCP, Render deploy policies
13
- - Project rules: [deploy.mdc](../../../../rules/deploy.mdc), [supabase-mcp.mdc](../../../../rules/supabase-mcp.mdc)
12
+ - Your app's API routes, webhooks, and OAuth adapters
13
+ - Optional: [mcp-and-deploy.md](../../../policies/mcp-and-deploy.md) and `.cursor/rules/` when MCP or deploy is configured
14
14
 
15
15
  ## Execution focus
16
16
 
@@ -53,7 +53,7 @@ Launch **7 parallel** `Task` subagents in **one message**. `readonly: true` unle
53
53
  | 6 | [fix-runtime-evidence.md](../../../agents/fix-runtime-evidence.md) | `generalPurpose` | CI/logs/MCP evidence |
54
54
  | 7 | [fix-inventory-confirm.md](../../../agents/fix-inventory-confirm.md) | `explore` | Inventory scope + constraints |
55
55
 
56
- **Parent prompt must include:** intent, domain, inventory path, discovery brief summary, frame fields.
56
+ **Parent prompt must include:** intent, domain, inventory path, discovery brief summary, frame fields, and the policy excerpt from [_task-prompt-policy.md](../_task-prompt-policy.md).
57
57
 
58
58
  **Anti-patterns (hard fail):**
59
59
 
@@ -36,3 +36,5 @@ Pass output to [validation](../validation/SKILL.md). If any confidence below thr
36
36
  ## Agents
37
37
 
38
38
  Reuse readonly specs: [discovery-inventory.md](../../../agents/discovery-inventory.md), [discovery-ssot.md](../../../agents/discovery-ssot.md), [dependency-analysis.md](../../../agents/dependency-analysis.md) — 2–3 parallel max for lite path.
39
+
40
+ Every Task prompt **must** include the policy excerpt from [_task-prompt-policy.md](../_task-prompt-policy.md).
@@ -17,7 +17,7 @@ Wave 1: release-git ← BLOCKING
17
17
 
18
18
  Wave 1.5: conditional package publish ← OPTIONAL (project overlay; blocking when triggered)
19
19
 
20
- Wave 2: release-renderBLOCKING (poll until live or fail)
20
+ Wave 2: deploy agent OPTIONAL (project overlay; poll until live or fail)
21
21
 
22
22
  Wave 3: verification + reporting
23
23
  ```
@@ -36,13 +36,11 @@ Execute [agents/release-git.md](../../../agents/release-git.md) or spawn shell s
36
36
 
37
37
  ## Wave 1.5 — conditional publish (project overlay)
38
38
 
39
- When the project ships an npm package with the app (e.g. `@ludecker/aaac`), the project overlay supplies a conditional publish agent and detection scripts. Skip when no changes detected.
39
+ When the project ships an npm package with the app, the project overlay supplies a conditional publish agent and detection scripts. Skip when no changes detected.
40
40
 
41
- ## Wave 2 — Render (mandatory)
41
+ ## Wave 2 — Deploy (optional)
42
42
 
43
- Execute [agents/release-render.md](../../../agents/release-render.md).
44
-
45
- **Never** end ship without polled deploy status.
43
+ When configured, run the project overlay deploy agent. **Never** end ship without polled deploy status when deploy is enabled.
46
44
 
47
45
  ## Reference
48
46