You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: skills/clean-architecture-planner/SKILL.md
+9-8Lines changed: 9 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
name: cmp-clean-architecture-planner
3
-
description: Use before implementing a non-trivial coding task — features, bug fixes, refactors, business-rule changes, new external integrations, or any change touching use cases, entities, ports, adapters, controllers, mappers, repositories, or tests. Produces a modification plan that separates policy from mechanism, locates the owning use case and layer, plans ports/adapters/tests, and escalates human-owned design decisions. Skip trivial formatting-only, comment-only, mechanical dependency-bump, or generated-only changes.
3
+
description: Use before implementing a non-trivial coding task — features, bug fixes, refactors, business-rule changes, new external integrations, or any change touching use cases, entities, ports, adapters, controllers, mappers, repositories, or tests. Produces a modification plan that separates policy from mechanism, locates the owning use case and layer, plans ports/adapters/tests, and makes human-owned design decisions explicit in the plan for review. Skip trivial formatting-only, comment-only, mechanical dependency-bump, or generated-only changes.
4
4
---
5
5
6
6
# CMP Clean Architecture Planner
@@ -42,7 +42,7 @@ Keep policy out of outer mechanism; keep mechanism out of inner layers.
42
42
43
43
**Human owns (what-level — propose, do not decide silently):** new use case boundary, new owned concept, new port or port contract, ownership of a cross-cutting capability, moving policy across modules, changing dependency direction, new placement convention, promoting duplicated logic to shared policy, promoting a local helper to a domain concept, redrawing layer responsibility.
44
44
45
-
When a what-level decision appears, mark it a human design gate, propose options, and ask before implementing it.
45
+
When a what-level decision appears, mark it a human design gate: resolve it in the plan by naming the concept / port / boundary in domain-layer terms and proposing the specific design, so the human can confirm it by reading the plan. Do not implement it silently, and do not turn it into a question. Questions are reserved for unclear requirements (see step 1), never for design decisions.
46
46
47
47
## When to Use & Which Mode
48
48
@@ -57,16 +57,16 @@ If unsure, start full and collapse to quick once you confirm no gate triggers.
57
57
58
58
## Planning Workflow
59
59
60
-
Run in order. Stop and ask the human if intent is unclear or a design gate triggers.
60
+
Run in order. Ask the human only when intent or requirements are unclear (step 1). A design gate does not call for a question — surface the decision explicitly in the plan and let the human confirm it on review.
61
61
62
-
1.**Clarify intent.** Behavior to change, behavior to preserve, success criteria, task type. Do not guess product or domain ambiguity.
62
+
1.**Clarify intent.** Behavior to change, behavior to preserve, success criteria, task type. If the product or domain *requirement* is ambiguous, ask — this is the one place a question belongs. Do not guess product or domain ambiguity. Design decisions are handled differently: you resolve those in the plan rather than by asking (see step 8).
3.**Locate in CA coordinates.** Give each change a vertical owner (which use case/process) and a horizontal layer (entity / use case / port / adapter / delivery / persistence / mapper / test). No clear vertical owner → ownership-needed; unclear layer → placement-review.
65
65
4.**Plan context acquisition.** Start from the root `architecture-map.md` (create it from `references/architecture-map-template.md` if it does not exist), then inspect in order: tests → owning use case → entities → existing ports → adapters → delivery entry points → persistence/external details → mappers/DTOs/fixtures → conventions. Mark each must-inspect / may-inspect / do-not-need. Do not read the whole repo unless the route is missing.
66
66
5.**Predict the modification closure.** List artifacts that change or must be verified together. Update as you learn more.
67
-
6.**Check boundary trust.** For each boundary: is the port use-case-shaped (not provider-shaped)? failure modes and side effects explicit? dependency pointing inward? Mark trusted / verify / untrusted. Repair an untrusted boundary as how-level work, or escalate if it must be redrawn.
68
-
7.**Plan ports & adapters.** Existing port fits → use it, keep provider details behind the adapter. Almost fits → propose adjustment, mark how- vs what-level. None fits → new-port-needed, propose in use-case language, ask before creating. Never shape a port by copying the provider; never import SDK/ORM/HTTP/persistence types inward.
69
-
8.**Run human design gates.** Check each gate (new use case / new owned concept / new port / port contract semantics / capability ownership / placement rule / dependency-direction change / shared-policy extraction). Any triggered gate → do not implement silently; continue only with clearly safe how-level work, or ask first.
67
+
6.**Check boundary trust.** For each boundary: is the port use-case-shaped (not provider-shaped)? failure modes and side effects explicit? dependency pointing inward? Mark trusted / verify / untrusted. Repair an untrusted boundary as how-level work, or, if it must be redrawn, handle it as a design gate (step 8) — propose the redraw in the plan for confirmation.
68
+
7.**Plan ports & adapters.** Existing port fits → use it, keep provider details behind the adapter. Almost fits → propose adjustment, mark how- vs what-level. None fits → new-port-needed; propose it in use-case language in the plan and mark it for human confirmation on review, rather than asking mid-plan. Never shape a port by copying the provider; never import SDK/ORM/HTTP/persistence types inward.
69
+
8.**Run human design gates.** Check each gate (new use case / new owned concept / new port / port contract semantics / capability ownership / placement rule / dependency-direction change / shared-policy extraction). Any triggered gate → resolve it in the plan: name it and propose the specific decision in domain-layer terms (the entity field, the use-case step, the port and its contract) so it lands where the human reviews. Do not implement a what-level decision silently, and do not raise it as a question — the human confirms it by reading the plan. Only an unclear *requirement* behind the gate goes back as a question (step 1).
70
70
9.**Produce the implementation route.** Follow CA direction; drop steps with no real change, and do not skip a step that has one.
71
71
10.**Plan verification at the right level.** Entity invariant → entity tests; use case policy → use case tests with fake ports; port contract → contract tests; adapter → integration/mechanism tests; delivery/persistence mapping → controller/repo/mapper tests; dependency rule → lint/static check. Avoid leaning only on E2E when a local test expresses the policy better.
72
72
11.**Update the architecture map.** If this change created or moved a route, update the root `architecture-map.md` per the rules in "Architecture Map". Record only approved structural decisions; if nothing structural changed, leave it untouched.
@@ -75,6 +75,7 @@ Run in order. Stop and ask the human if intent is unclear or a design gate trigg
-**Full plan:** fill `references/plan-template.md`.
78
+
- A filled end-to-end example is in `references/worked-example.md`.
78
79
79
80
## Architecture Map
80
81
@@ -101,4 +102,4 @@ The blank format lives in `references/architecture-map-template.md`.
101
102
10. Does the plan improve future context routing, not just finish the task?
102
103
11. Architecture map updated if a route changed?
103
104
104
-
If a gate is triggered, stop and ask before implementing that decision.
105
+
If a gate is triggered, capture the decision explicitly in the plan and get the human's confirmation on the plan before implementing it — no question needed unless the requirement behind it is unclear.
Copy file name to clipboardExpand all lines: skills/clean-architecture-planner/references/architecture-map-template.md
+3-12Lines changed: 3 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
-
# Architecture Map
1
+
# Architecture Map — Template
2
2
3
-
Routing index for this codebase. CMP treats architecture as a context-routing system; this file is the map that keeps routes cheap to find. Read it before planning a change (it is the entry point for Planning Workflow step 4), and update it when a change creates or moves a route (see "Maintaining this map").
3
+
Blank scaffold for a codebase's routing index. The skill copies this to `architecture-map.md` in the project root when no map exists yet, then fills and maintains that root copy. Do not edit this template per task — edit the root `architecture-map.md`. Maintenance rules live in SKILL.md ("Architecture Map").
4
4
5
-
This is an index, not a mirror of the code. Record stable, high-value navigation only: where things live, who owns what, which boundaries to trust. Leave out implementation detail the code already states and that would drift.
5
+
When generating the root file, replace this header with the project name and:
6
6
7
7
- Last updated:
8
8
- Architectural decision owners:
@@ -71,12 +71,3 @@ Capabilities whose owner is not yet settled. Route here to escalate consistently
The skill keeps this file current as part of every change that moves or creates a route.
78
-
79
-
-**Read first.** At Workflow step 4, start from this map, then drill into code. If the map disagrees with the code you inspect, correct the stale entry (cheap, how-level) and note it; if the discrepancy touches a design gate, escalate instead.
80
-
-**Update last.** As the final step of a change, update the map when — and only when — a structural fact changed: a use case added/removed/renamed or its ports/entities changed; a port or adapter added/removed, or a port contract's semantics changed; an entity gained/lost an owned invariant; a placement convention or dependency rule changed; a boundary debt introduced, resolved, or reclassified; an ownership question opened or closed. If nothing structural changed, leave the map untouched.
81
-
-**Record, don't decide.** Recording an already-approved structural decision is how-level bookkeeping. Adding an entry for a new use case, port, owned concept, or convention that has NOT been approved is a what-level decision behind a human design gate. Never use a map edit as a backdoor to introduce a boundary.
82
-
-**Keep it an index.** Every entry must lower the context cost of a future change. Drop entries that only duplicate what the code already makes obvious.
@@ -87,4 +86,6 @@ delivery input → input boundary / DTO mapping → use case policy → entity i
87
86
- Agent must NOT change without human approval:
88
87
89
88
## 11. Next step
90
-
One of: proceed with implementation / ask human to resolve a design gate first / inspect more context first.
89
+
One of: proceed with implementation / submit the plan for human confirmation (including any flagged design gates) / ask the human to clarify an unclear requirement / inspect more context first.
0 commit comments