jdi-cli 0.1.1 → 0.1.3
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/README.md +6 -0
- package/core/agents/jdi-architect.md +19 -0
- package/core/agents/jdi-researcher.md +2 -1
- package/core/commands/jdi-add-phase.md +171 -0
- package/core/commands/jdi-remove-phase.md +228 -0
- 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/agents.md +4 -0
- 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-add-phase/SKILL.md +171 -0
- package/runtimes/antigravity/skills/jdi-architect/SKILL.md +19 -0
- package/runtimes/antigravity/skills/jdi-remove-phase/SKILL.md +228 -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/CLAUDE.md +4 -0
- package/runtimes/claude/agents/jdi-architect.md +19 -0
- package/runtimes/claude/agents/jdi-researcher.md +2 -1
- package/runtimes/claude/commands/jdi-add-phase.md +171 -0
- package/runtimes/claude/commands/jdi-remove-phase.md +228 -0
- 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/copilot/copilot-instructions.md +4 -0
- package/runtimes/copilot/prompts/jdi-add-phase.prompt.md +171 -0
- package/runtimes/copilot/prompts/jdi-remove-phase.prompt.md +228 -0
- package/runtimes/opencode/AGENTS.md +4 -0
- package/runtimes/opencode/agents/jdi-architect.md +19 -0
- package/runtimes/opencode/agents/jdi-researcher.md +2 -1
- package/runtimes/opencode/commands/jdi-add-phase.md +171 -0
- package/runtimes/opencode/commands/jdi-remove-phase.md +228 -0
- 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,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.
|
|
@@ -12,6 +12,10 @@ Este projeto usa o JDI (Just Do It) como workflow de desenvolvimento. JDI eh um
|
|
|
12
12
|
/jdi-do <N> -> executa via doer specialist
|
|
13
13
|
/jdi-verify <N> -> gates de qualidade via reviewer specialist
|
|
14
14
|
/jdi-ship <N> -> finaliza phase + avanca pra proxima
|
|
15
|
+
|
|
16
|
+
# Roadmap mutation (qualquer hora)
|
|
17
|
+
/jdi-add-phase "<name>" [--goal "<t>"] [--at <pos>] -> adiciona phase
|
|
18
|
+
/jdi-remove-phase <N> [--force] -> remove future/pending phase
|
|
15
19
|
```
|
|
16
20
|
|
|
17
21
|
`/jdi-create [desc]` gera novos agents/skills genericos no `core/` (rodado dentro do repo JDI, nao de projetos consumindo).
|
|
@@ -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)"
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: jdi-add-phase
|
|
3
|
+
description: Adds a new phase to ROADMAP.md. Append at end (default) or insert at a specific position. Bumps total_phases. Atomic commit.
|
|
4
|
+
argument_hint: "\"<phase name>\" [--goal \"<goal>\"] [--at <position>]"
|
|
5
|
+
runtime_intent:
|
|
6
|
+
invokes_agent: none
|
|
7
|
+
runtime_overrides:
|
|
8
|
+
claude:
|
|
9
|
+
allowed-tools: [Read, Write, Edit, Bash, Grep, Glob, AskUserQuestion]
|
|
10
|
+
copilot:
|
|
11
|
+
tools: [read, write, edit, grep, glob, terminal]
|
|
12
|
+
opencode:
|
|
13
|
+
subtask: true
|
|
14
|
+
antigravity:
|
|
15
|
+
triggers:
|
|
16
|
+
- "/jdi-add-phase"
|
|
17
|
+
- "add new phase"
|
|
18
|
+
- "create phase"
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
<objective>
|
|
22
|
+
Adds a new phase to the project's roadmap. Edits `.jdi/ROADMAP.md`. Does not start the phase — only registers it. The user advances via `/jdi-discuss <N>` when ready.
|
|
23
|
+
</objective>
|
|
24
|
+
|
|
25
|
+
<arguments>
|
|
26
|
+
- `name` (required) — short phase name. Quote if it contains spaces.
|
|
27
|
+
- `--goal "<text>"` (optional) — 1-line description of what the phase delivers. If missing, AskUserQuestion will prompt.
|
|
28
|
+
- `--at <position>` (optional) — insert at this position instead of appending. Existing phases at and after `<position>` shift down by 1 (renumbered in ROADMAP only — slugs stay the same in any existing `.jdi/phases/` folders). Default: append.
|
|
29
|
+
|
|
30
|
+
Examples:
|
|
31
|
+
- `/jdi-add-phase "User authentication" --goal "Login + signup + JWT"`
|
|
32
|
+
- `/jdi-add-phase "Performance pass" --at 3`
|
|
33
|
+
- `/jdi-add-phase "Hotfix N+1 query"`
|
|
34
|
+
</arguments>
|
|
35
|
+
|
|
36
|
+
<process>
|
|
37
|
+
|
|
38
|
+
### Step 1: Validation
|
|
39
|
+
```bash
|
|
40
|
+
test -d .jdi/ || { echo "Not a JDI project. /jdi-new first."; exit 1; }
|
|
41
|
+
test -f .jdi/ROADMAP.md || { echo "ROADMAP.md missing."; exit 1; }
|
|
42
|
+
test -f .jdi/STATE.md || { echo "STATE.md missing."; exit 1; }
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
If `<name>` argument missing: AskUserQuestion "Phase name?" (free text). Required.
|
|
46
|
+
|
|
47
|
+
If `--goal` flag missing: AskUserQuestion "Phase goal (1 line)?" (free text). Required.
|
|
48
|
+
|
|
49
|
+
### Step 2: Compute phase number + slug
|
|
50
|
+
|
|
51
|
+
Read `total_phases` from `.jdi/ROADMAP.md`:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
TOTAL=$(grep -oE 'total_phases:\s*[0-9]+' .jdi/ROADMAP.md | grep -oE '[0-9]+')
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
PowerShell:
|
|
58
|
+
```powershell
|
|
59
|
+
$total = (Select-String -Path .jdi/ROADMAP.md -Pattern 'total_phases:\s*([0-9]+)').Matches[0].Groups[1].Value -as [int]
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
If `--at <pos>` provided, validate `1 <= pos <= total + 1`. Otherwise `pos = total + 1` (append).
|
|
63
|
+
|
|
64
|
+
If `pos <= current_phase` (read from STATE.md), abort with error: "Cannot insert before current phase {current}. Use --at {current+1} or higher."
|
|
65
|
+
|
|
66
|
+
Generate `slug` from `name`:
|
|
67
|
+
- Lowercase
|
|
68
|
+
- Replace accents (à → a, é → e, ç → c, ñ → n)
|
|
69
|
+
- Non-alphanumeric → `-`
|
|
70
|
+
- Collapse repeated `-`, strip leading/trailing `-`
|
|
71
|
+
- Truncate to 40 chars
|
|
72
|
+
|
|
73
|
+
Phase identifier prefix is the 2-digit position (`NN`): `01`, `02`, ..., zero-padded.
|
|
74
|
+
|
|
75
|
+
### Step 3: Renumber prefix on shift (only if --at)
|
|
76
|
+
|
|
77
|
+
If `--at <pos>` shifts existing phases:
|
|
78
|
+
|
|
79
|
+
Edit `.jdi/ROADMAP.md` — for every existing `### Phase K:` where `K >= pos`, change to `### Phase K+1:` and bump its `**Slug:**` prefix from `KK-...` to `(K+1)(K+1)-...`.
|
|
80
|
+
|
|
81
|
+
**WARNING (printed):**
|
|
82
|
+
> "Renumbering ROADMAP phases. Any existing `.jdi/phases/<NN-slug>/` folders are NOT renamed — they keep their original slugs and become "history". New work in renumbered phases creates new folders. Commits referencing old `phase {K}` remain valid as history."
|
|
83
|
+
|
|
84
|
+
This is intentional. Do not rename `.jdi/phases/` folders — would break commit history and cross-references in DECISIONS.md.
|
|
85
|
+
|
|
86
|
+
If `--at` not provided (append), skip Step 3.
|
|
87
|
+
|
|
88
|
+
### Step 4: Append phase section to ROADMAP.md
|
|
89
|
+
|
|
90
|
+
If appending (`pos == total + 1`), append at the bottom of `## Phases`:
|
|
91
|
+
|
|
92
|
+
```markdown
|
|
93
|
+
|
|
94
|
+
### Phase {pos}: {name}
|
|
95
|
+
- **Slug:** {NN}-{slug}
|
|
96
|
+
- **Status:** pending
|
|
97
|
+
- **Goal:** {goal}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
If inserting (`pos <= total`), insert the new section BEFORE the section that previously had number `pos` (now renumbered to `pos+1`).
|
|
101
|
+
|
|
102
|
+
### Step 5: Bump total_phases
|
|
103
|
+
|
|
104
|
+
Edit `.jdi/ROADMAP.md`:
|
|
105
|
+
```
|
|
106
|
+
total_phases: {TOTAL + 1}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Step 6: Audit trail in DECISIONS.md (optional, only if user passes --reason)
|
|
110
|
+
|
|
111
|
+
Not required. If user wants to record why this phase was added mid-project, they pass `--reason "<text>"`. When present, append to `.jdi/DECISIONS.md`:
|
|
112
|
+
|
|
113
|
+
```markdown
|
|
114
|
+
D-{N+1} ({date}, phase {pos}): Phase added mid-project. Reason: {reason}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
(N = current max D-X.)
|
|
118
|
+
|
|
119
|
+
### Step 7: Commit
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
git add .jdi/ROADMAP.md .jdi/DECISIONS.md 2>/dev/null
|
|
123
|
+
git commit -m "chore(jdi): add phase {pos} {NN-slug}"
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
PowerShell:
|
|
127
|
+
```powershell
|
|
128
|
+
git add .jdi/ROADMAP.md .jdi/DECISIONS.md 2>$null
|
|
129
|
+
git commit -m "chore(jdi): add phase $pos $NN-$slug"
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Step 8: Confirm
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
Phase {pos}: {name} added.
|
|
136
|
+
Slug: {NN}-{slug}
|
|
137
|
+
Goal: {goal}
|
|
138
|
+
Status: pending
|
|
139
|
+
total_phases: {TOTAL + 1}
|
|
140
|
+
|
|
141
|
+
Next: /jdi-discuss {pos} (when ready to start this phase)
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
</process>
|
|
145
|
+
|
|
146
|
+
<gates>
|
|
147
|
+
- pre: `.jdi/ROADMAP.md` + `.jdi/STATE.md` exist
|
|
148
|
+
- pre: `--at <pos>` (if used) is greater than `current_phase` in STATE.md
|
|
149
|
+
- post: ROADMAP.md has new phase section + bumped total_phases + atomic commit
|
|
150
|
+
</gates>
|
|
151
|
+
|
|
152
|
+
<errors>
|
|
153
|
+
- `.jdi/` missing -> "Run /jdi-new first"
|
|
154
|
+
- `--at <pos>` <= current_phase -> "Cannot insert before current phase. Use --at {current+1} or higher."
|
|
155
|
+
- `--at <pos>` < 1 or > total+1 -> "Position out of range. Valid: 1..{total+1}"
|
|
156
|
+
- Phase name empty -> AskUserQuestion to fill
|
|
157
|
+
- Goal empty -> AskUserQuestion to fill
|
|
158
|
+
</errors>
|
|
159
|
+
|
|
160
|
+
<runtime_notes>
|
|
161
|
+
|
|
162
|
+
**Claude Code:**
|
|
163
|
+
- AskUserQuestion handles missing args interactively.
|
|
164
|
+
|
|
165
|
+
**Copilot:**
|
|
166
|
+
- AskUserQuestion not always available — read missing args from prompt body or fail with clear error.
|
|
167
|
+
|
|
168
|
+
**OpenCode/Antigravity:**
|
|
169
|
+
- Same interactive flow as Claude when supported. Otherwise fail with clear error message asking the user to re-invoke with all args.
|
|
170
|
+
|
|
171
|
+
</runtime_notes>
|