jdi-cli 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/agents/jdi-architect.md +19 -0
- package/core/agents/jdi-researcher.md +2 -1
- package/core/skills/clean-architecture/SKILL.md +134 -0
- package/core/skills/ddd/SKILL.md +140 -0
- package/core/skills/hexagonal/SKILL.md +127 -0
- package/core/skills/onion/SKILL.md +133 -0
- package/core/skills/the-method/SKILL.md +139 -0
- package/core/skills/vertical-slice/SKILL.md +127 -0
- package/package.json +1 -1
- package/runtimes/antigravity/skills/clean-architecture/SKILL.md +125 -0
- package/runtimes/antigravity/skills/ddd/SKILL.md +131 -0
- package/runtimes/antigravity/skills/hexagonal/SKILL.md +118 -0
- package/runtimes/antigravity/skills/jdi-architect/SKILL.md +19 -0
- package/runtimes/antigravity/skills/jdi-researcher/SKILL.md +2 -1
- package/runtimes/antigravity/skills/onion/SKILL.md +124 -0
- package/runtimes/antigravity/skills/the-method/SKILL.md +130 -0
- package/runtimes/antigravity/skills/vertical-slice/SKILL.md +118 -0
- package/runtimes/claude/agents/jdi-architect.md +19 -0
- package/runtimes/claude/agents/jdi-researcher.md +2 -1
- package/runtimes/claude/skills/clean-architecture/SKILL.md +120 -0
- package/runtimes/claude/skills/ddd/SKILL.md +125 -0
- package/runtimes/claude/skills/hexagonal/SKILL.md +112 -0
- package/runtimes/claude/skills/onion/SKILL.md +119 -0
- package/runtimes/claude/skills/the-method/SKILL.md +124 -0
- package/runtimes/claude/skills/vertical-slice/SKILL.md +113 -0
- package/runtimes/copilot/agents/jdi-architect.agent.md +19 -0
- package/runtimes/copilot/agents/jdi-researcher.agent.md +2 -1
- package/runtimes/opencode/agents/jdi-architect.md +19 -0
- package/runtimes/opencode/agents/jdi-researcher.md +2 -1
- package/runtimes/opencode/skills/clean-architecture/SKILL.md +120 -0
- package/runtimes/opencode/skills/ddd/SKILL.md +125 -0
- package/runtimes/opencode/skills/hexagonal/SKILL.md +112 -0
- package/runtimes/opencode/skills/onion/SKILL.md +119 -0
- package/runtimes/opencode/skills/the-method/SKILL.md +124 -0
- package/runtimes/opencode/skills/vertical-slice/SKILL.md +113 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: hexagonal
|
|
3
|
+
description: Hexagonal Architecture / Ports and Adapters (Alistair Cockburn). Application core in the center, surrounded by Ports (interfaces owned by the core) and Adapters (implementations). Driving (primary) vs Driven (secondary) sides. Language-agnostic rigid rules. Mutually exclusive with The Method, DDD, Clean Architecture, Onion, Vertical Slice.
|
|
4
|
+
triggers:
|
|
5
|
+
- "Hexagonal"
|
|
6
|
+
- "Ports and Adapters"
|
|
7
|
+
- "Alistair Cockburn"
|
|
8
|
+
- "driving adapter"
|
|
9
|
+
- "driven adapter"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Skill: Hexagonal Architecture (Ports and Adapters)
|
|
13
|
+
|
|
14
|
+
Rigid, inviolable rules from Alistair Cockburn's Ports and Adapters. The application is a **core** isolated from the outside world by **ports** (interfaces) and **adapters** (implementations).
|
|
15
|
+
|
|
16
|
+
Hexagonal is the ONLY allowed design when PROJECT.md `Code Design: LOCKED: Hexagonal`. Do not use The Method, DDD as primary structure, Clean Architecture's 4-layer terminology as primary structure, Onion shells, or Vertical Slice feature folders as primary structure.
|
|
17
|
+
|
|
18
|
+
## Mandatory structure
|
|
19
|
+
|
|
20
|
+
The system consists of exactly three structural elements:
|
|
21
|
+
|
|
22
|
+
1. **Application Core (the hexagon)** — domain model + application logic. Knows nothing about technology, protocols, or external systems. The core is the only place where business rules exist.
|
|
23
|
+
2. **Ports** — interfaces **owned by the core** that declare what the core needs from the outside (driven ports) or what the outside can ask the core to do (driving ports). A port is an abstract contract; it has no implementation in the core.
|
|
24
|
+
3. **Adapters** — implementations of ports living outside the core. Adapters translate between the technology-specific outside world (HTTP, DB, queue, file, UI) and the technology-free core.
|
|
25
|
+
|
|
26
|
+
Every code unit belongs to exactly one of: Core, Port (still inside the core's package), or Adapter. A unit that does not fit must be redesigned.
|
|
27
|
+
|
|
28
|
+
## Driving vs Driven (mandatory)
|
|
29
|
+
|
|
30
|
+
1. **Driving (primary) side** — the side that initiates interaction with the core. UI, HTTP controllers, CLI handlers, scheduled job triggers, integration tests. Driving adapters invoke driving ports.
|
|
31
|
+
2. **Driven (secondary) side** — the side the core delegates to. Persistence, message bus, external APIs, file system, email, cache. The core invokes driven ports, which are implemented by driven adapters.
|
|
32
|
+
3. **Driving port** is an interface that exposes the core's capabilities to the outside. **Driven port** is an interface declared by the core that the outside must satisfy.
|
|
33
|
+
4. **Direction of dependency: adapters depend on ports; ports live in the core; the core depends on nothing infrastructural.**
|
|
34
|
+
|
|
35
|
+
## Inviolable rules
|
|
36
|
+
|
|
37
|
+
### Core purity
|
|
38
|
+
|
|
39
|
+
1. The core has zero imports from any framework, ORM, HTTP library, vendor SDK, file system API, or transport library.
|
|
40
|
+
2. The core defines its own types for inputs and outputs to ports. Adapter types (HTTP request, ORM model, queue message) do not appear in core code.
|
|
41
|
+
3. The core does not know the identity of any adapter. It interacts only with ports.
|
|
42
|
+
4. The core does not perform I/O. All I/O happens through driven ports.
|
|
43
|
+
5. The core is fully testable without any adapter. If a unit test of the core requires spinning up DB / HTTP / queue, the design is wrong.
|
|
44
|
+
|
|
45
|
+
### Ports
|
|
46
|
+
|
|
47
|
+
6. A port is an interface. It has no logic.
|
|
48
|
+
7. Ports live in the core's package / module. They are not in an "infrastructure" or "adapters" package.
|
|
49
|
+
8. The core defines a port; the adapter implements it. A port defined outside the core, or implemented in the core, is forbidden.
|
|
50
|
+
9. Driving ports name capabilities of the core in domain language (e.g., `PlaceOrder`, `RenewSubscription`). Driven ports name dependencies in domain language (e.g., `OrderRepository`, `NotificationSender`).
|
|
51
|
+
10. Port methods receive and return only types defined inside the core. They do not receive HTTP requests, ORM entities, or framework-specific types.
|
|
52
|
+
|
|
53
|
+
### Adapters
|
|
54
|
+
|
|
55
|
+
11. An adapter implements exactly one port (driving or driven). An adapter that mixes driving and driven roles is forbidden.
|
|
56
|
+
12. A driving adapter translates an external trigger (HTTP request, CLI command, message, schedule) into a core-defined input and invokes a driving port.
|
|
57
|
+
13. A driven adapter translates a core-defined call into a technology-specific action (SQL query, HTTP call, file write, queue publish) and translates the result back into core-defined output.
|
|
58
|
+
14. Adapters contain only translation and I/O. Business rules in an adapter are forbidden — they must move into the core.
|
|
59
|
+
15. Adapters never call other adapters directly. Coordination between adapters happens through the core via a driving adapter → core → driven adapter sequence.
|
|
60
|
+
16. Adapters never call the core's internal classes directly. They go through ports.
|
|
61
|
+
|
|
62
|
+
### Composition
|
|
63
|
+
|
|
64
|
+
17. The Composition Root assembles adapters and injects them into the core at startup. The core does not construct its own adapters.
|
|
65
|
+
18. Replacing an adapter (e.g., swapping PostgreSQL for MongoDB, REST for gRPC) must not require changes inside the core. If it does, the port is leaking.
|
|
66
|
+
19. Multiple adapters may implement the same port. The core does not know how many.
|
|
67
|
+
20. Test adapters (fakes, in-memory implementations) are first-class adapters and must use the same ports as production adapters. The core cannot have a "test-only" code path.
|
|
68
|
+
|
|
69
|
+
## Forbidden patterns (inviolable)
|
|
70
|
+
|
|
71
|
+
- **Framework types crossing into the core.** No HTTP request type, no ORM entity, no vendor SDK type referenced in core code.
|
|
72
|
+
- **Business rules in adapters.** A driven adapter computing a price, a driving adapter validating a domain rule — both forbidden.
|
|
73
|
+
- **Adapters calling adapters.** Adapter coordination outside the core is forbidden.
|
|
74
|
+
- **Core code instantiating an adapter.** Construction happens in the Composition Root.
|
|
75
|
+
- **Ports defined outside the core.** A port placed in an "infrastructure" module is a violation.
|
|
76
|
+
- **Anemic core.** A core without behavior is a violation — adapters become a leak path for rules.
|
|
77
|
+
- **A driving port returning a framework-specific type** (a port returning `HttpResponse` is wrong).
|
|
78
|
+
- **Driven ports leaking persistence concepts** (a port named `SqlUserRepository` is wrong; it must be domain-named).
|
|
79
|
+
- **Mixed-role adapter** (one adapter both responding to HTTP and writing to DB).
|
|
80
|
+
- **Bypassing ports** by injecting an adapter directly where a port should appear.
|
|
81
|
+
- **Concentric layer terminology** ("Entities layer", "Use Cases layer", "Application Services layer") imposed as the primary structure — Hexagonal organizes by core/ports/adapters, not by concentric layers.
|
|
82
|
+
|
|
83
|
+
## Naming conventions
|
|
84
|
+
|
|
85
|
+
- Driving ports: domain capability verbs (`PlaceOrder`, `RegisterCustomer`).
|
|
86
|
+
- Driven ports: dependency names in domain language (`OrderRepository`, `EmailSender`, `PaymentGateway`).
|
|
87
|
+
- Adapters: technology-qualified (`HttpPlaceOrderAdapter`, `PostgresOrderRepositoryAdapter`, `SmtpEmailSenderAdapter`).
|
|
88
|
+
- The core never references a name containing a technology word.
|
|
89
|
+
|
|
90
|
+
## Reviewer enforcement (gate 5)
|
|
91
|
+
|
|
92
|
+
Reviewer rejects (BLOCKED) when:
|
|
93
|
+
- Core code imports a framework / ORM / HTTP / vendor SDK / file-system type.
|
|
94
|
+
- A port is defined outside the core or implemented inside the core.
|
|
95
|
+
- A port method's signature mentions a framework-specific type.
|
|
96
|
+
- An adapter contains business logic.
|
|
97
|
+
- An adapter calls another adapter directly.
|
|
98
|
+
- The core instantiates an adapter.
|
|
99
|
+
- A driven port name leaks a persistence technology.
|
|
100
|
+
- A driving adapter returns the result of a port call without translating from a core type to an external type.
|
|
101
|
+
|
|
102
|
+
Reviewer warns (APPROVED_WITH_WARNINGS) when:
|
|
103
|
+
- An adapter file is doing more translation than necessary (smell: complex mapping suggesting hidden rules).
|
|
104
|
+
- A port is implemented by a single adapter and is unlikely ever to vary (still allowed — keep the port).
|
|
105
|
+
- A core class has no behavior (anemic).
|
|
106
|
+
- Composition wiring is scattered instead of centralized in a Composition Root.
|
|
107
|
+
|
|
108
|
+
## Anti-patterns
|
|
109
|
+
|
|
110
|
+
- "Service" layer between core and adapters (no such thing in Hexagonal)
|
|
111
|
+
- Repository implemented inside the core (must be a port)
|
|
112
|
+
- Use Case classes shaped after Clean Architecture's Use Case layer (the structure is core/ports/adapters)
|
|
113
|
+
- Ports tied to a transport (e.g., `RestOrderPort`) — ports are domain-shaped, adapters are transport-shaped
|
|
114
|
+
- "Domain Services" terminology imported wholesale from DDD as the primary structure (acceptable internal to the core when meaningful, but does not replace the hexagonal primary structure)
|
|
115
|
+
|
|
116
|
+
## Outputs
|
|
117
|
+
|
|
118
|
+
Does NOT produce own files. Modifies parent agent's structural decisions during code authoring and review.
|
|
@@ -389,13 +389,29 @@ Write to `.jdi/agents/jdi-reviewer-{slug}.md`.
|
|
|
389
389
|
|
|
390
390
|
After writing doer/reviewer, inject `<skills_to_load>` block after `</role>` via Edit.
|
|
391
391
|
|
|
392
|
+
**Code-design skill (mandatory) — resolve from `PROJECT.md.Code Design` (LOCKED value) using this mapping:**
|
|
393
|
+
|
|
394
|
+
| Code Design (PROJECT.md) | Skill to load |
|
|
395
|
+
|---|---|
|
|
396
|
+
| The Method | `the-method` |
|
|
397
|
+
| DDD | `ddd` |
|
|
398
|
+
| Clean Architecture | `clean-architecture` |
|
|
399
|
+
| Hexagonal | `hexagonal` |
|
|
400
|
+
| Onion | `onion` |
|
|
401
|
+
| Vertical Slice | `vertical-slice` |
|
|
402
|
+
|
|
403
|
+
The resolved code-design skill is loaded by **both doer and reviewer**. Exactly one code-design skill is loaded. Never load two code-design skills simultaneously — the project uses exactly one design. If the mapping cannot resolve, abort with an error and ask the user to fix `PROJECT.md.Code Design`.
|
|
404
|
+
|
|
392
405
|
**Doer — always:**
|
|
393
406
|
```markdown
|
|
394
407
|
<skills_to_load>
|
|
395
408
|
- solid — before creating classes/modules/interfaces. Detects god class, large switches, deep inheritance, dep on concretes.
|
|
409
|
+
- {CODE_DESIGN_SKILL} — INVIOLABLE structural rules for the project's locked code design. Apply on every file created.
|
|
396
410
|
</skills_to_load>
|
|
397
411
|
```
|
|
398
412
|
|
|
413
|
+
Replace `{CODE_DESIGN_SKILL}` with the resolved entry from the mapping above (e.g. `the-method`, `ddd`, `clean-architecture`, `hexagonal`, `onion`, `vertical-slice`).
|
|
414
|
+
|
|
399
415
|
If `has_frontend=true`, append:
|
|
400
416
|
```markdown
|
|
401
417
|
- frontend-rules — when task touches .tsx/.vue/.svelte/.razor/.cshtml/.html/.twig/.erb/.blade.php. WCAG 2.2 AA + UX.
|
|
@@ -408,9 +424,12 @@ If `has_frontend=true`, append:
|
|
|
408
424
|
- kiss — gate 5: over-engineering — interface with 1 impl, factory for new(), pass-through, deep inheritance.
|
|
409
425
|
- yagni — gate 5: speculative code — optional params never passed, TODO without ticket, generic with 1 type.
|
|
410
426
|
- clean-code — bad names, long functions, magic numbers, silent catch, boolean params, redundant comments.
|
|
427
|
+
- {CODE_DESIGN_SKILL} — gate 5: enforce INVIOLABLE structural rules for the project's locked code design. BLOCKED on violations defined by the skill.
|
|
411
428
|
</skills_to_load>
|
|
412
429
|
```
|
|
413
430
|
|
|
431
|
+
Replace `{CODE_DESIGN_SKILL}` with the same resolved entry — both doer and reviewer load the SAME code-design skill.
|
|
432
|
+
|
|
414
433
|
If `has_frontend=true`, append:
|
|
415
434
|
```markdown
|
|
416
435
|
- frontend-rules — gate 5 frontend: <input> without label, button without aria-label, localStorage with token, outline removed.
|
|
@@ -61,10 +61,11 @@ Options:
|
|
|
61
61
|
- Vertical Slice
|
|
62
62
|
- Clean Architecture
|
|
63
63
|
- Hexagonal (Ports & Adapters)
|
|
64
|
+
- Onion Architecture
|
|
64
65
|
- The Method (Juval Löwy)
|
|
65
66
|
- "Don't know, suggest" (-> recommend based on type + stack)
|
|
66
67
|
|
|
67
|
-
Locked for the life of the project (global rule).
|
|
68
|
+
Locked for the life of the project (global rule). Mutually exclusive — the project uses exactly ONE code design. The choice is enforced by a JDI skill loaded into doer + reviewer (one of: `ddd`, `vertical-slice`, `clean-architecture`, `hexagonal`, `onion`, `the-method`).
|
|
68
69
|
|
|
69
70
|
**Q4 — MVP scope**
|
|
70
71
|
"Which minimum features for the MVP? (comma-separated)"
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: onion
|
|
3
|
+
description: Onion Architecture (Jeffrey Palermo). Concentric shells with the Domain Model at the absolute center. Dependencies invert across shells - outer depends on inner, inner knows nothing of outer. Language-agnostic rigid rules. Mutually exclusive with The Method, DDD, Clean Architecture, Hexagonal, Vertical Slice.
|
|
4
|
+
triggers:
|
|
5
|
+
- "Onion Architecture"
|
|
6
|
+
- "Jeffrey Palermo"
|
|
7
|
+
- "domain at the center"
|
|
8
|
+
- "concentric shells"
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Skill: Onion Architecture
|
|
12
|
+
|
|
13
|
+
Rigid, inviolable rules from Jeffrey Palermo's Onion Architecture. The system is a series of **concentric shells** with the **Domain Model at the absolute center**. Outer shells depend on inner shells; the inverse is forbidden.
|
|
14
|
+
|
|
15
|
+
Onion is the ONLY allowed design when PROJECT.md `Code Design: LOCKED: Onion`. Do not use The Method, DDD as primary structure, Clean Architecture's 4-named layers, Hexagonal port/adapter terminology as primary structure, or Vertical Slice feature folders as primary structure.
|
|
16
|
+
|
|
17
|
+
## The shells (mandatory order from center outward)
|
|
18
|
+
|
|
19
|
+
1. **Domain Model** — entities and value objects expressing the business state. No behavior dependent on infrastructure. The absolute center.
|
|
20
|
+
2. **Domain Services** — domain operations that do not belong to a single entity/value object. Pure domain logic. Stateless.
|
|
21
|
+
3. **Application Services** — orchestrate use cases. Coordinate Domain Services and Domain Model. Define interfaces for infrastructure dependencies (repository contracts, external system contracts).
|
|
22
|
+
4. **Infrastructure** — persistence implementations, external system clients, UI, tests, framework bindings. The outermost shell.
|
|
23
|
+
|
|
24
|
+
Every code unit belongs to exactly one of these 4 shells. A unit that does not fit must be redesigned.
|
|
25
|
+
|
|
26
|
+
## The Dependency Direction (inviolable)
|
|
27
|
+
|
|
28
|
+
**Dependencies point inward.** Every shell may depend on shells closer to the center; no shell may depend on shells farther from the center.
|
|
29
|
+
|
|
30
|
+
1. Domain Model depends on nothing else in the system.
|
|
31
|
+
2. Domain Services depend on Domain Model only.
|
|
32
|
+
3. Application Services depend on Domain Model and Domain Services.
|
|
33
|
+
4. Infrastructure depends on Application Services, Domain Services, and Domain Model.
|
|
34
|
+
5. Names defined in Infrastructure (ORM types, framework types, vendor SDK types) never appear in any inner shell.
|
|
35
|
+
|
|
36
|
+
## Inversion across infrastructure (inviolable)
|
|
37
|
+
|
|
38
|
+
1. **Application Services define the interfaces** (repository contracts, external system contracts) they require. These interfaces live in Application Services or Domain Services — never in Infrastructure.
|
|
39
|
+
2. **Infrastructure implements those interfaces.** The implementation class lives in Infrastructure. The interface lives inward.
|
|
40
|
+
3. **The Composition Root wires interfaces to implementations.** The Composition Root is part of Infrastructure (or a separate startup module that depends on Infrastructure). Inner shells never construct Infrastructure types.
|
|
41
|
+
|
|
42
|
+
## Domain Model rules
|
|
43
|
+
|
|
44
|
+
1. The Domain Model contains only entities and value objects in domain language.
|
|
45
|
+
2. The Domain Model has no annotations, no inheritance from framework base classes, no persistence concerns, no serialization concerns.
|
|
46
|
+
3. The Domain Model is not anemic. Behavior that belongs to an entity lives on that entity. Behavior that belongs to no single entity lives in Domain Services.
|
|
47
|
+
4. Value objects are immutable. Replacing is the only mutation pattern.
|
|
48
|
+
5. The Domain Model does not know how it is persisted, displayed, or transmitted.
|
|
49
|
+
|
|
50
|
+
## Domain Services rules
|
|
51
|
+
|
|
52
|
+
6. Domain Services are stateless. They contain pure domain logic that does not naturally belong to a single Entity or Value Object.
|
|
53
|
+
7. Domain Services depend on the Domain Model only. They never call repositories, infrastructure, or Application Services.
|
|
54
|
+
8. Domain Services do not perform I/O.
|
|
55
|
+
9. Names of Domain Services are domain operations, not technical operations.
|
|
56
|
+
|
|
57
|
+
## Application Services rules
|
|
58
|
+
|
|
59
|
+
10. Application Services orchestrate use cases. One Application Service method = one application-level operation.
|
|
60
|
+
11. Application Services declare the interfaces (repository, gateway, sender, publisher) they require. These interfaces live with Application Services (or in Domain Services when their abstraction is purely domain-driven).
|
|
61
|
+
12. Application Services do not contain business rules — they coordinate. Business rules live in Domain Model and Domain Services.
|
|
62
|
+
13. Application Services do not import any Infrastructure class. They depend on the interfaces they themselves declare.
|
|
63
|
+
14. Application Services receive input DTOs and return output DTOs (or void). They do not return Domain Model entities to outer shells when those would leak persistence concerns.
|
|
64
|
+
|
|
65
|
+
## Infrastructure rules
|
|
66
|
+
|
|
67
|
+
15. Infrastructure implements interfaces declared by inner shells. It does not introduce interfaces of its own that inner shells consume.
|
|
68
|
+
16. Infrastructure contains: persistence (ORM mappings, repositories), HTTP/UI controllers, message bus clients, file system access, vendor SDK calls, scheduled job handlers, and the Composition Root.
|
|
69
|
+
17. Infrastructure does not contain business rules.
|
|
70
|
+
18. Infrastructure classes are named with their technology when the technology is the encapsulated concern (e.g., `SqlOrderRepository`, `HttpPaymentGateway`).
|
|
71
|
+
19. Two infrastructure classes do not call each other to fulfill a use case. Coordination happens via Application Services.
|
|
72
|
+
|
|
73
|
+
## Forbidden patterns (inviolable)
|
|
74
|
+
|
|
75
|
+
- **Inner shell referencing outer shell.** Domain Model referencing Application Services or Infrastructure is forbidden. Domain Services referencing Application Services or Infrastructure is forbidden. Application Services referencing Infrastructure (concrete classes) is forbidden.
|
|
76
|
+
- **Persistence annotations or framework types in the Domain Model.**
|
|
77
|
+
- **Repository interface placed in Infrastructure.** The interface must live inward (Application Services or Domain Services).
|
|
78
|
+
- **Domain Services performing I/O.**
|
|
79
|
+
- **Application Services containing business rules.**
|
|
80
|
+
- **Infrastructure-defined interfaces consumed by inner shells.**
|
|
81
|
+
- **Skipping a shell** (Infrastructure code calling Domain Model methods directly when an Application Service exists for that use case; or controller calling repository directly bypassing Application Services).
|
|
82
|
+
- **Anemic Domain Model.**
|
|
83
|
+
- **CRUD-only Application Services** with no application semantics.
|
|
84
|
+
- **Cross-shell reach-around** (Infrastructure A calling Infrastructure B to fulfill a use case without going through an Application Service).
|
|
85
|
+
|
|
86
|
+
## Naming conventions
|
|
87
|
+
|
|
88
|
+
- Domain Model classes: domain nouns (`Customer`, `Order`, `Subscription`).
|
|
89
|
+
- Domain Services: domain verb-noun (`OrderPricingPolicy`, `SubscriptionRenewalRules`).
|
|
90
|
+
- Application Services: application-level operations (`RegisterCustomerService`, `RenewSubscriptionService`).
|
|
91
|
+
- Interfaces consumed by Application Services: domain-meaningful (`IOrderRepository`, `IPaymentGateway`, `INotificationSender`).
|
|
92
|
+
- Infrastructure classes: technology-qualified (`SqlOrderRepository`, `StripePaymentGateway`, `SmtpNotificationSender`).
|
|
93
|
+
|
|
94
|
+
## Reviewer enforcement (gate 5)
|
|
95
|
+
|
|
96
|
+
Reviewer rejects (BLOCKED) when:
|
|
97
|
+
- Domain Model, Domain Services, or Application Services import a framework / ORM / HTTP / vendor SDK type.
|
|
98
|
+
- A repository or external-system interface is declared in Infrastructure and consumed inward.
|
|
99
|
+
- An inner shell file imports an outer shell file.
|
|
100
|
+
- Application Services contain business rules that belong on Domain Model or Domain Services.
|
|
101
|
+
- Domain Services perform I/O or call a repository.
|
|
102
|
+
- Infrastructure classes coordinate use cases instead of being driven by Application Services.
|
|
103
|
+
- Infrastructure introduces an interface that inner shells depend on.
|
|
104
|
+
|
|
105
|
+
Reviewer warns (APPROVED_WITH_WARNINGS) when:
|
|
106
|
+
- Domain Model is anemic.
|
|
107
|
+
- Application Services are named after CRUD verbs without semantic meaning.
|
|
108
|
+
- Composition Root is fragmented across multiple infrastructure modules.
|
|
109
|
+
- An entity is mutable in places where a value object would be correct.
|
|
110
|
+
|
|
111
|
+
## Anti-patterns
|
|
112
|
+
|
|
113
|
+
- "Service" layer mixing Domain Services with Application Services indistinguishably
|
|
114
|
+
- Generic repository (`IRepository<T>`) declared at the Infrastructure level
|
|
115
|
+
- Domain Model classes inheriting from an ORM base
|
|
116
|
+
- Domain Services calling repositories
|
|
117
|
+
- Application Services holding state across calls
|
|
118
|
+
- Direct controller-to-repository wiring
|
|
119
|
+
- Infrastructure types appearing as parameters to inner-shell methods
|
|
120
|
+
- "Onion" framing used to disguise Clean Architecture, Hexagonal, or DDD — the rule is the inward dependency direction and the Domain Model at the absolute center
|
|
121
|
+
|
|
122
|
+
## Outputs
|
|
123
|
+
|
|
124
|
+
Does NOT produce own files. Modifies parent agent's structural decisions during code authoring and review.
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: the-method
|
|
3
|
+
description: The Method (Juval Löwy, "Righting Software"). Volatility-based decomposition with universal hierarchy (Clients, Managers, Engines, ResourceAccess, Resources, Utilities). Strict communication rules. Language-agnostic. Mutually exclusive with DDD, Clean Architecture, Hexagonal, Onion, Vertical Slice.
|
|
4
|
+
triggers:
|
|
5
|
+
- "The Method"
|
|
6
|
+
- "Juval Lowy"
|
|
7
|
+
- "Righting Software"
|
|
8
|
+
- "volatility decomposition"
|
|
9
|
+
- "Universal Hierarchy"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Skill: The Method (Juval Löwy)
|
|
13
|
+
|
|
14
|
+
Rigid, inviolable design rules from Juval Löwy's *Righting Software*. Decompose by **volatility**, not functionality. Single architecture in the system — do not mix with any other code design.
|
|
15
|
+
|
|
16
|
+
The Method is the ONLY allowed design when PROJECT.md `Code Design: LOCKED: The Method`. Do not introduce DDD aggregates, Clean Architecture use cases, Hexagonal ports, Onion shells, or Vertical Slice handlers. Do not invent a hybrid.
|
|
17
|
+
|
|
18
|
+
## Core principle (inviolable)
|
|
19
|
+
|
|
20
|
+
**Decompose the system by axes of volatility, never by functionality.**
|
|
21
|
+
|
|
22
|
+
A component is justified only when it encapsulates an independent reason to change. Two pieces of code that change for the same reason belong together. Two pieces that change for different reasons must be separated even if they currently look identical.
|
|
23
|
+
|
|
24
|
+
If a component has no clear volatility it encapsulates, it must not exist.
|
|
25
|
+
|
|
26
|
+
## The Universal Hierarchy (mandatory)
|
|
27
|
+
|
|
28
|
+
Every system has exactly these 5 architectural categories plus 1 cross-cutting category. No other category may be invented.
|
|
29
|
+
|
|
30
|
+
1. **Clients** — entry points. UI, CLI, public API endpoints, scheduled triggers, test harnesses. Volatility: presentation, protocol, channel.
|
|
31
|
+
2. **Managers** — own a use case end-to-end. Sequence the work. Hold the workflow. Volatility: business workflow, use case orchestration.
|
|
32
|
+
3. **Engines** — stateless business algorithms. Pure rules, calculations, validation logic. Volatility: business algorithm, formula, policy.
|
|
33
|
+
4. **ResourceAccess** — only path to a Resource. Hides the technology of the data store. Volatility: data access technology.
|
|
34
|
+
5. **Resources** — the actual data store / external system / queue / cache. Volatility: storage technology, vendor, schema.
|
|
35
|
+
|
|
36
|
+
Cross-cutting (callable from any layer):
|
|
37
|
+
|
|
38
|
+
6. **Utilities** — Security, Logging, Diagnostics, Hosting, Configuration, Localization, Pub/Sub bus, Identity. Stateless cross-cutting concerns. Volatility: infrastructure technology.
|
|
39
|
+
|
|
40
|
+
Every code unit produced MUST belong to exactly one of these categories. If you cannot decide its category, the unit is wrong and must be redesigned.
|
|
41
|
+
|
|
42
|
+
## Communication rules (inviolable)
|
|
43
|
+
|
|
44
|
+
The hierarchy is strictly directed. Communication that violates these rules is a defect, regardless of how convenient it appears.
|
|
45
|
+
|
|
46
|
+
1. **Clients call Managers only.** Clients do not call Engines, ResourceAccess, Resources, or other Clients.
|
|
47
|
+
2. **Managers call Engines and ResourceAccess.** Managers may also call Utilities.
|
|
48
|
+
3. **Managers do not call Managers directly.** Manager-to-Manager communication, when required, goes through a **Queue** (publish/subscribe via the Utility bus). Never synchronous Manager-to-Manager.
|
|
49
|
+
4. **Engines do not call Engines.** Composition of engines happens in the Manager.
|
|
50
|
+
5. **Engines do not call ResourceAccess.** The Manager pulls data via ResourceAccess and passes it into the Engine.
|
|
51
|
+
6. **Engines and ResourceAccess do not call Clients.** No upward calls.
|
|
52
|
+
7. **ResourceAccess is the only component allowed to touch a Resource.** Nothing else (no Manager, no Engine, no Client, no Utility) touches a Resource directly.
|
|
53
|
+
8. **Resources do not call anything.** They are passive.
|
|
54
|
+
9. **Utilities are callable by any layer, but do not contain business logic.** Utilities never call Managers, Engines, or ResourceAccess.
|
|
55
|
+
10. **No skip-level calls upward.** Lower layers never call higher layers synchronously.
|
|
56
|
+
11. **Calls fan out, never fan in across the same layer synchronously.** No sideways synchronous calls within Managers or within Engines.
|
|
57
|
+
|
|
58
|
+
## Volatility rules (inviolable)
|
|
59
|
+
|
|
60
|
+
1. A component exists only to **encapsulate one axis of volatility**. State it explicitly.
|
|
61
|
+
2. The component's public surface must change only when its encapsulated volatility changes. If a change to an unrelated axis requires editing the component, the decomposition is wrong.
|
|
62
|
+
3. The more volatile the area, the deeper inside the architecture it lives. The more stable, the closer to the edges.
|
|
63
|
+
4. **Functional decomposition is forbidden.** Naming components after features ("OrderManager", "CustomerEngine") is allowed only when the feature itself is a volatility boundary. Naming components after operations ("CreateOrder", "ValidateCustomer") is forbidden.
|
|
64
|
+
5. **Naming after volatility, not noun.** Prefer `PricingEngine` (algorithm volatility) over `OrderService` (feature). Prefer `OrderRepository` only if data-access technology is the encapsulated volatility.
|
|
65
|
+
|
|
66
|
+
## Composability rules
|
|
67
|
+
|
|
68
|
+
1. Every Manager must be composable. Adding a new Client (new UI, new API) must not require touching the Manager.
|
|
69
|
+
2. Engines and ResourceAccess components must be reusable across Managers. If they cannot be reused, the volatility encapsulation is wrong.
|
|
70
|
+
3. The system must support adding a new use case by adding 1 Manager (and possibly 1 Client method) without modifying any Engine, ResourceAccess, Resource, or Utility.
|
|
71
|
+
|
|
72
|
+
## Forbidden patterns (inviolable)
|
|
73
|
+
|
|
74
|
+
- **No domain-driven aggregates, anti-corruption layers, or bounded contexts** — that is DDD.
|
|
75
|
+
- **No use cases as a separate layer** — Managers ARE the use cases. Do not create a "UseCase" layer on top of Managers.
|
|
76
|
+
- **No ports & adapters / hexagonal terminology** — ResourceAccess plays the role of adapter for Resources. Do not introduce additional port/adapter layers.
|
|
77
|
+
- **No vertical slices** — code is organized by category, never by feature folder.
|
|
78
|
+
- **No Onion shells.** No "domain core" layer above Engines.
|
|
79
|
+
- **No Repository pattern named after entities** ("UserRepository", "OrderRepository"). ResourceAccess is named after the **resource technology and its volatility**, not after a domain entity. Acceptable: `BillingDataAccess`, `CatalogStore`. Forbidden: `OrderRepository` if "Order" is not a volatility boundary.
|
|
80
|
+
- **No anemic Engine** — an Engine without business logic is forbidden. An Engine with only getters/setters is a defect.
|
|
81
|
+
- **No business logic in Clients.** Clients only translate input to a Manager call and present a Manager response.
|
|
82
|
+
- **No business logic in ResourceAccess.** ResourceAccess maps technology to in-memory representations and nothing more.
|
|
83
|
+
- **No business logic in Resources.** Stored procedures, triggers, or business-logic-bearing schemas are violations.
|
|
84
|
+
- **No business logic in Utilities.** Utilities are infrastructure.
|
|
85
|
+
- **No bypassing ResourceAccess** to touch a Resource (no ORM call in a Manager, no raw SQL in an Engine).
|
|
86
|
+
- **No shared mutable state across components.** Engines are stateless. Managers hold transient workflow state only.
|
|
87
|
+
|
|
88
|
+
## Mandatory acceptance per code unit
|
|
89
|
+
|
|
90
|
+
Before any Manager / Engine / ResourceAccess / Client / Utility is committed, the author must be able to answer:
|
|
91
|
+
|
|
92
|
+
1. Which one of the 6 categories does this belong to? (must be exactly one)
|
|
93
|
+
2. What single axis of volatility does it encapsulate? (must be statable in 1 sentence)
|
|
94
|
+
3. Which categories does it call? (must comply with the communication rules above)
|
|
95
|
+
4. What change in the system would cause it to be edited? (must be the volatility it encapsulates, nothing else)
|
|
96
|
+
5. Is it composable: can another Manager / Client be added without modifying this unit? (must be yes for non-Client units)
|
|
97
|
+
|
|
98
|
+
A unit failing any answer must be redesigned before it ships.
|
|
99
|
+
|
|
100
|
+
## Reviewer enforcement (gate 5)
|
|
101
|
+
|
|
102
|
+
Reviewer rejects (BLOCKED) when:
|
|
103
|
+
- A Client calls Engine / ResourceAccess / Resource directly.
|
|
104
|
+
- A Manager calls another Manager synchronously.
|
|
105
|
+
- An Engine calls another Engine.
|
|
106
|
+
- An Engine calls ResourceAccess.
|
|
107
|
+
- Any code outside ResourceAccess touches a Resource.
|
|
108
|
+
- A Utility contains business logic.
|
|
109
|
+
- A Repository / Service / Manager is named after a noun-entity instead of a volatility axis (warn first, block on second occurrence in the same PR).
|
|
110
|
+
- The PR adds a new top-level category not in the universal hierarchy.
|
|
111
|
+
- The PR splits code by feature folders instead of by category.
|
|
112
|
+
|
|
113
|
+
Reviewer warns (APPROVED_WITH_WARNINGS) when:
|
|
114
|
+
- A component's encapsulated volatility is not declared (missing 1-line statement at top of file or class).
|
|
115
|
+
- An Engine has no behavior (anemic).
|
|
116
|
+
- A new Manager was added without a Client-level entry point.
|
|
117
|
+
|
|
118
|
+
## Anti-patterns
|
|
119
|
+
|
|
120
|
+
- "Service layer" with mixed Manager + Engine responsibilities
|
|
121
|
+
- "Helper" / "Util" classes containing business logic
|
|
122
|
+
- Domain entity classes with both data and behavior bound to persistence
|
|
123
|
+
- "Facade" components that hide multiple Managers behind a single class
|
|
124
|
+
- ResourceAccess methods that return business-decided values instead of raw data
|
|
125
|
+
- Cross-Manager transactions implemented via direct calls
|
|
126
|
+
- Synchronous chains crossing 3+ layers
|
|
127
|
+
|
|
128
|
+
## Outputs
|
|
129
|
+
|
|
130
|
+
Does NOT produce own files. Modifies parent agent's structural decisions during code authoring and review.
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vertical-slice
|
|
3
|
+
description: Vertical Slice Architecture (Jimmy Bogard). Organize by feature, not by technical layer. Each feature owns its full request-to-response path with minimal sharing. Language-agnostic rigid rules. Mutually exclusive with The Method, DDD, Clean Architecture, Hexagonal, Onion.
|
|
4
|
+
triggers:
|
|
5
|
+
- "Vertical Slice"
|
|
6
|
+
- "Jimmy Bogard"
|
|
7
|
+
- "feature folder"
|
|
8
|
+
- "slice architecture"
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Skill: Vertical Slice Architecture
|
|
12
|
+
|
|
13
|
+
Rigid, inviolable rules from Jimmy Bogard's Vertical Slice Architecture. The system is organized by **feature**, not by technical layer. Each slice owns the full path from external request to external response.
|
|
14
|
+
|
|
15
|
+
Vertical Slice is the ONLY allowed design when PROJECT.md `Code Design: LOCKED: Vertical Slice`. Do not impose Clean Architecture's 4-layer structure, Onion shells, Hexagonal core/ports/adapters, DDD aggregates as primary structure, or The Method's universal hierarchy on top.
|
|
16
|
+
|
|
17
|
+
## Mandatory structure
|
|
18
|
+
|
|
19
|
+
1. **Each feature is one slice.** A feature is a single user-facing capability (e.g., `RegisterCustomer`, `CancelOrder`, `RenewSubscription`).
|
|
20
|
+
2. **A slice owns its full pipeline:** input contract, validator, handler, business logic, persistence access, output contract, and slice-specific tests.
|
|
21
|
+
3. **Slices live in feature folders / packages.** The primary code organization is `features/{feature-name}/` (or equivalent in the language). Technical-layer folders (`controllers/`, `services/`, `repositories/`, `models/`) as the primary structure are forbidden.
|
|
22
|
+
4. **Each feature folder is self-contained.** Inside a folder live only the artifacts that serve that feature.
|
|
23
|
+
5. **No shared "Service" layer, no shared "Repository" layer, no shared "Manager" layer across slices.** Each slice has its own.
|
|
24
|
+
|
|
25
|
+
## Slice isolation rules (inviolable)
|
|
26
|
+
|
|
27
|
+
1. **Slices do not call each other directly.** If slice A needs work done by slice B, slice A either duplicates the minimum needed code OR they both publish/subscribe to a shared event bus. Direct invocation of slice B's handler from slice A is forbidden.
|
|
28
|
+
2. **No shared mutable state across slices.** A slice never mutates state owned by another slice except through the shared persistence boundary, and never through another slice's handler.
|
|
29
|
+
3. **DRY applies inside a slice, not across slices.** Two slices that look similar today are still allowed to diverge tomorrow. Forced sharing is the enemy.
|
|
30
|
+
4. **Cross-slice abstractions are introduced only when 3+ slices need the exact same behavior with the exact same shape, and that behavior is stable.** Premature shared abstractions are violations.
|
|
31
|
+
|
|
32
|
+
## Slice composition (mandatory contents)
|
|
33
|
+
|
|
34
|
+
Each slice MUST contain:
|
|
35
|
+
|
|
36
|
+
1. **Request / Command / Query contract** — a structure describing the input.
|
|
37
|
+
2. **Handler** — receives the request, executes the logic, returns the response.
|
|
38
|
+
3. **Validator** (if input requires validation) — slice-local validation rules.
|
|
39
|
+
4. **Response contract** — the output shape returned to the caller.
|
|
40
|
+
5. **Slice-local types** — any DTOs, view models, or projections the slice needs.
|
|
41
|
+
6. **Slice-local tests** — integration tests that exercise the slice end-to-end.
|
|
42
|
+
|
|
43
|
+
A slice MAY contain:
|
|
44
|
+
|
|
45
|
+
- A slice-specific persistence access path (raw query, ORM query, projection, command-side persistence).
|
|
46
|
+
- A slice-specific external system call.
|
|
47
|
+
- Slice-local pre/post processing.
|
|
48
|
+
|
|
49
|
+
A slice MUST NOT contain:
|
|
50
|
+
|
|
51
|
+
- References to another slice's handler, request, or response types.
|
|
52
|
+
- References to a shared "Service" abstracting multiple slices.
|
|
53
|
+
- A "Manager" coordinating multiple slices.
|
|
54
|
+
|
|
55
|
+
## Cross-cutting concerns (inviolable)
|
|
56
|
+
|
|
57
|
+
1. Cross-cutting concerns (logging, authentication, authorization, transactions, validation pipeline, error handling) are applied as **pipeline behaviors / middleware** that wrap the handler, never as shared services injected into the handler.
|
|
58
|
+
2. Authentication and authorization decisions may use shared types (claims, principals) but are enforced at the pipeline level, not inside the handler.
|
|
59
|
+
3. Validation runs as a pipeline step before the handler executes. The handler assumes valid input.
|
|
60
|
+
4. Logging, tracing, metrics: pipeline behaviors. The handler does not invoke logging libraries for cross-cutting purposes.
|
|
61
|
+
|
|
62
|
+
## Persistence rules
|
|
63
|
+
|
|
64
|
+
1. **No generic repository spanning slices.** A slice that needs persistence either uses the ORM/database client directly within the slice OR has its own slice-local repository.
|
|
65
|
+
2. **Reads and writes may diverge structurally.** A slice that reads may use a different model than a slice that writes; this is encouraged.
|
|
66
|
+
3. **No "Domain Model" required to be shared across slices.** Each slice models the data it needs in the shape it needs.
|
|
67
|
+
4. **A shared schema (database) is acceptable; a shared in-code model abstraction is not.**
|
|
68
|
+
|
|
69
|
+
## Forbidden patterns (inviolable)
|
|
70
|
+
|
|
71
|
+
- **Technical-layer primary folders** (`controllers/`, `services/`, `repositories/`, `models/`) used as the system's primary organization.
|
|
72
|
+
- **A handler calling another handler.**
|
|
73
|
+
- **A "Service" class injected into multiple handlers** to provide their business logic.
|
|
74
|
+
- **A "Manager" class coordinating multiple slices.**
|
|
75
|
+
- **A shared "Repository" abstraction** consumed by 5+ slices.
|
|
76
|
+
- **Cross-slice imports of internal slice types.** Slice A importing `B.HandleQuery` or `B.RequestDto` is forbidden.
|
|
77
|
+
- **Slice A invoking slice B via an internal interface** instead of via the public boundary (HTTP, queue, event).
|
|
78
|
+
- **DRY refactoring that merges 2 slices into 1 because they share 80% of the code.** Slices stay separate until 3+ identical use cases exist with stable shape.
|
|
79
|
+
- **Forcing all slices through a shared base handler class** that contains business logic.
|
|
80
|
+
- **A shared "Domain Model" referenced by all slices** as the primary modeling element.
|
|
81
|
+
|
|
82
|
+
## Naming conventions
|
|
83
|
+
|
|
84
|
+
- Feature folders: feature name in domain language (`RegisterCustomer/`, `CancelOrder/`, `ViewCustomerDashboard/`).
|
|
85
|
+
- Request types: domain operation name (`RegisterCustomerCommand`, `CancelOrderCommand`, `ViewCustomerDashboardQuery`).
|
|
86
|
+
- Handler types: paired with request (`RegisterCustomerHandler`).
|
|
87
|
+
- Validator types: paired with request (`RegisterCustomerValidator`).
|
|
88
|
+
- Response types: domain output name (`RegisterCustomerResponse`).
|
|
89
|
+
- Internal slice types: prefixed by feature name when shared inside the slice (`RegisterCustomerEmailTemplate`).
|
|
90
|
+
|
|
91
|
+
## Reviewer enforcement (gate 5)
|
|
92
|
+
|
|
93
|
+
Reviewer rejects (BLOCKED) when:
|
|
94
|
+
- The codebase is primarily organized by technical layer instead of by feature.
|
|
95
|
+
- A handler invokes another slice's handler, request, or response type.
|
|
96
|
+
- A new "Service" / "Manager" / "Coordinator" class is introduced that spans multiple slices and carries business logic.
|
|
97
|
+
- A shared generic repository is introduced and consumed by multiple slices.
|
|
98
|
+
- Cross-cutting concerns are injected into handlers as shared services instead of applied as pipeline behaviors.
|
|
99
|
+
- Slice A imports types from slice B's internal folder.
|
|
100
|
+
|
|
101
|
+
Reviewer warns (APPROVED_WITH_WARNINGS) when:
|
|
102
|
+
- Two slices share an identical small helper that has been duplicated 3+ times (candidate for extraction, not required).
|
|
103
|
+
- A slice contains logic that appears to belong to a different slice.
|
|
104
|
+
- A slice handler is long enough to suggest splitting into pipeline behaviors.
|
|
105
|
+
- A slice references a "Domain Service" or "Aggregate" terminology that may indicate a different design creeping in.
|
|
106
|
+
|
|
107
|
+
## Anti-patterns
|
|
108
|
+
|
|
109
|
+
- "Vertical slices" implemented inside an MVC controllers/services/repositories folder structure (the folders betray the layer-primary structure)
|
|
110
|
+
- A "Domain" project that all slices reference, containing entities + services + repositories — that is layered or Onion in disguise
|
|
111
|
+
- Cross-slice "Coordinator" classes that orchestrate two handlers
|
|
112
|
+
- A shared "BaseHandler" that contains transaction management AND business logic
|
|
113
|
+
- A slice handler that delegates 90% of its work to a shared service (the slice is hollow)
|
|
114
|
+
- Premature "DRY" extraction that merges slices into a generic handler with strategy patterns
|
|
115
|
+
|
|
116
|
+
## Outputs
|
|
117
|
+
|
|
118
|
+
Does NOT produce own files. Modifies parent agent's structural decisions during code authoring and review.
|
|
@@ -381,13 +381,29 @@ Write to `.jdi/agents/jdi-reviewer-{slug}.md`.
|
|
|
381
381
|
|
|
382
382
|
After writing doer/reviewer, inject `<skills_to_load>` block after `</role>` via Edit.
|
|
383
383
|
|
|
384
|
+
**Code-design skill (mandatory) — resolve from `PROJECT.md.Code Design` (LOCKED value) using this mapping:**
|
|
385
|
+
|
|
386
|
+
| Code Design (PROJECT.md) | Skill to load |
|
|
387
|
+
|---|---|
|
|
388
|
+
| The Method | `the-method` |
|
|
389
|
+
| DDD | `ddd` |
|
|
390
|
+
| Clean Architecture | `clean-architecture` |
|
|
391
|
+
| Hexagonal | `hexagonal` |
|
|
392
|
+
| Onion | `onion` |
|
|
393
|
+
| Vertical Slice | `vertical-slice` |
|
|
394
|
+
|
|
395
|
+
The resolved code-design skill is loaded by **both doer and reviewer**. Exactly one code-design skill is loaded. Never load two code-design skills simultaneously — the project uses exactly one design. If the mapping cannot resolve, abort with an error and ask the user to fix `PROJECT.md.Code Design`.
|
|
396
|
+
|
|
384
397
|
**Doer — always:**
|
|
385
398
|
```markdown
|
|
386
399
|
<skills_to_load>
|
|
387
400
|
- solid — before creating classes/modules/interfaces. Detects god class, large switches, deep inheritance, dep on concretes.
|
|
401
|
+
- {CODE_DESIGN_SKILL} — INVIOLABLE structural rules for the project's locked code design. Apply on every file created.
|
|
388
402
|
</skills_to_load>
|
|
389
403
|
```
|
|
390
404
|
|
|
405
|
+
Replace `{CODE_DESIGN_SKILL}` with the resolved entry from the mapping above (e.g. `the-method`, `ddd`, `clean-architecture`, `hexagonal`, `onion`, `vertical-slice`).
|
|
406
|
+
|
|
391
407
|
If `has_frontend=true`, append:
|
|
392
408
|
```markdown
|
|
393
409
|
- frontend-rules — when task touches .tsx/.vue/.svelte/.razor/.cshtml/.html/.twig/.erb/.blade.php. WCAG 2.2 AA + UX.
|
|
@@ -400,9 +416,12 @@ If `has_frontend=true`, append:
|
|
|
400
416
|
- kiss — gate 5: over-engineering — interface with 1 impl, factory for new(), pass-through, deep inheritance.
|
|
401
417
|
- yagni — gate 5: speculative code — optional params never passed, TODO without ticket, generic with 1 type.
|
|
402
418
|
- clean-code — bad names, long functions, magic numbers, silent catch, boolean params, redundant comments.
|
|
419
|
+
- {CODE_DESIGN_SKILL} — gate 5: enforce INVIOLABLE structural rules for the project's locked code design. BLOCKED on violations defined by the skill.
|
|
403
420
|
</skills_to_load>
|
|
404
421
|
```
|
|
405
422
|
|
|
423
|
+
Replace `{CODE_DESIGN_SKILL}` with the same resolved entry — both doer and reviewer load the SAME code-design skill.
|
|
424
|
+
|
|
406
425
|
If `has_frontend=true`, append:
|
|
407
426
|
```markdown
|
|
408
427
|
- frontend-rules — gate 5 frontend: <input> without label, button without aria-label, localStorage with token, outline removed.
|
|
@@ -56,10 +56,11 @@ Options:
|
|
|
56
56
|
- Vertical Slice
|
|
57
57
|
- Clean Architecture
|
|
58
58
|
- Hexagonal (Ports & Adapters)
|
|
59
|
+
- Onion Architecture
|
|
59
60
|
- The Method (Juval Löwy)
|
|
60
61
|
- "Don't know, suggest" (-> recommend based on type + stack)
|
|
61
62
|
|
|
62
|
-
Locked for the life of the project (global rule).
|
|
63
|
+
Locked for the life of the project (global rule). Mutually exclusive — the project uses exactly ONE code design. The choice is enforced by a JDI skill loaded into doer + reviewer (one of: `ddd`, `vertical-slice`, `clean-architecture`, `hexagonal`, `onion`, `the-method`).
|
|
63
64
|
|
|
64
65
|
**Q4 — MVP scope**
|
|
65
66
|
"Which minimum features for the MVP? (comma-separated)"
|