@ruyfranca/myskills 1.0.28 → 1.0.30
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/.agent/rules/AGENTS.md +273 -0
- package/.agent/skills/cqrs-implementation/SKILL.md +107 -0
- package/.agent/skills/ddd-strategic-design/SKILL.md +70 -0
- package/.agent/skills/ddd-tactical-patterns/SKILL.md +70 -0
- package/.agent/skills/elixir-pro/SKILL.md +89 -0
- package/.agent/skills/event-sourcing-architect/SKILL.md +66 -0
- package/.agent/skills/golang-pro/SKILL.md +121 -0
- package/.agent/skills/kotlin-coroutines-expert/SKILL.md +99 -0
- package/.agent/skills/modern-javascript-patterns/SKILL.md +131 -0
- package/.agent/skills/monorepo-architect/SKILL.md +91 -0
- package/.agent/skills/nextjs-react-expert/SKILL.md +94 -247
- package/.agent/skills/react-patterns/SKILL.md +200 -0
- package/.agent/skills/react-state-management/SKILL.md +147 -0
- package/.agent/skills/ruby-pro/SKILL.md +105 -0
- package/.agent/skills/zod-validation-expert/SKILL.md +132 -0
- package/AGENTS.md +273 -0
- package/index.js +42 -9
- package/package.json +1 -1
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
---
|
|
2
|
+
trigger: always_on
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# AGENTS.md - Antigravity Kit
|
|
6
|
+
|
|
7
|
+
> This file defines how the AI behaves in this workspace.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## CRITICAL: AGENT & SKILL PROTOCOL (START HERE)
|
|
12
|
+
|
|
13
|
+
> **MANDATORY:** You MUST read the appropriate agent file and its skills BEFORE performing any implementation. This is the highest priority rule.
|
|
14
|
+
|
|
15
|
+
### 1. Modular Skill Loading Protocol
|
|
16
|
+
|
|
17
|
+
Agent activated → Check frontmatter "skills:" → Read SKILL.md (INDEX) → Read specific sections.
|
|
18
|
+
|
|
19
|
+
- **Selective Reading:** DO NOT read ALL files in a skill folder. Read `SKILL.md` first, then only read sections matching the user's request.
|
|
20
|
+
- **Rule Priority:** P0 (AGENTS.md / GEMINI.md) > P1 (Agent .md) > P2 (SKILL.md). All rules are binding.
|
|
21
|
+
|
|
22
|
+
### 2. Enforcement Protocol
|
|
23
|
+
|
|
24
|
+
1. **When agent is activated:**
|
|
25
|
+
- ✅ Activate: Read Rules → Check Frontmatter → Load SKILL.md → Apply All.
|
|
26
|
+
2. **Forbidden:** Never skip reading agent rules or skill instructions. "Read → Understand → Apply" is mandatory.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 📥 REQUEST CLASSIFIER (STEP 1)
|
|
31
|
+
|
|
32
|
+
**Before ANY action, classify the request:**
|
|
33
|
+
|
|
34
|
+
| Request Type | Trigger Keywords | Active Tiers | Result |
|
|
35
|
+
| ---------------- | ------------------------------------------ | ------------------------------ | --------------------------- |
|
|
36
|
+
| **QUESTION** | "what is", "how does", "explain" | TIER 0 only | Text Response |
|
|
37
|
+
| **SURVEY/INTEL** | "analyze", "list files", "overview" | TIER 0 + Explorer | Session Intel (No File) |
|
|
38
|
+
| **SIMPLE CODE** | "fix", "add", "change" (single file) | TIER 0 + TIER 1 (lite) | Inline Edit |
|
|
39
|
+
| **COMPLEX CODE** | "build", "create", "implement", "refactor" | TIER 0 + TIER 1 (full) + Agent | **{task-slug}.md Required** |
|
|
40
|
+
| **DESIGN/UI** | "design", "UI", "page", "dashboard" | TIER 0 + TIER 1 + Agent | **{task-slug}.md Required** |
|
|
41
|
+
| **SLASH CMD** | /create, /orchestrate, /debug | Command-specific flow | Variable |
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## 🤖 INTELLIGENT AGENT ROUTING (STEP 2 - AUTO)
|
|
46
|
+
|
|
47
|
+
**ALWAYS ACTIVE: Before responding to ANY request, automatically analyze and select the best agent(s).**
|
|
48
|
+
|
|
49
|
+
> 🔴 **MANDATORY:** You MUST follow the protocol defined in `@[skills/intelligent-routing]`.
|
|
50
|
+
|
|
51
|
+
### Auto-Selection Protocol
|
|
52
|
+
|
|
53
|
+
1. **Analyze (Silent)**: Detect domains (Frontend, Backend, Security, etc.) from user request.
|
|
54
|
+
2. **Select Agent(s)**: Choose the most appropriate specialist(s).
|
|
55
|
+
3. **Inform User**: Concisely state which expertise is being applied.
|
|
56
|
+
4. **Apply**: Generate response using the selected agent's persona and rules.
|
|
57
|
+
|
|
58
|
+
### Response Format (MANDATORY)
|
|
59
|
+
|
|
60
|
+
When auto-applying an agent, inform the user:
|
|
61
|
+
|
|
62
|
+
```markdown
|
|
63
|
+
🤖 **Applying knowledge of `@[agent-name]`...**
|
|
64
|
+
|
|
65
|
+
[Continue with specialized response]
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Rules:**
|
|
69
|
+
|
|
70
|
+
1. **Silent Analysis**: No verbose meta-commentary ("I am analyzing...").
|
|
71
|
+
2. **Respect Overrides**: If user mentions `@agent`, use it.
|
|
72
|
+
3. **Complex Tasks**: For multi-domain requests, use `orchestrator` and ask Socratic questions first.
|
|
73
|
+
|
|
74
|
+
### ⚠️ AGENT ROUTING CHECKLIST (MANDATORY BEFORE EVERY CODE/DESIGN RESPONSE)
|
|
75
|
+
|
|
76
|
+
**Before ANY code or design work, you MUST complete this mental checklist:**
|
|
77
|
+
|
|
78
|
+
| Step | Check | If Unchecked |
|
|
79
|
+
|------|-------|--------------|
|
|
80
|
+
| 1 | Did I identify the correct agent for this domain? | → STOP. Analyze request domain first. |
|
|
81
|
+
| 2 | Did I READ the agent's `.md` file (or recall its rules)? | → STOP. Open `.agent/agents/{agent}.md` |
|
|
82
|
+
| 3 | Did I announce `🤖 Applying knowledge of @[agent]...`? | → STOP. Add announcement before response. |
|
|
83
|
+
| 4 | Did I load required skills from agent's frontmatter? | → STOP. Check `skills:` field and read them. |
|
|
84
|
+
|
|
85
|
+
**Failure Conditions:**
|
|
86
|
+
|
|
87
|
+
- ❌ Writing code without identifying an agent = **PROTOCOL VIOLATION**
|
|
88
|
+
- ❌ Skipping the announcement = **USER CANNOT VERIFY AGENT WAS USED**
|
|
89
|
+
- ❌ Ignoring agent-specific rules (e.g., Purple Ban) = **QUALITY FAILURE**
|
|
90
|
+
|
|
91
|
+
> 🔴 **Self-Check Trigger:** Every time you are about to write code or create UI, ask yourself:
|
|
92
|
+
> "Have I completed the Agent Routing Checklist?" If NO → Complete it first.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## TIER 0: UNIVERSAL RULES (Always Active)
|
|
97
|
+
|
|
98
|
+
### 🌐 Language Handling
|
|
99
|
+
|
|
100
|
+
When user's prompt is NOT in English:
|
|
101
|
+
|
|
102
|
+
1. **Internally translate** for better comprehension
|
|
103
|
+
2. **Respond in user's language** - match their communication
|
|
104
|
+
3. **Code comments/variables** remain in English
|
|
105
|
+
|
|
106
|
+
### 🧹 Clean Code (Global Mandatory)
|
|
107
|
+
|
|
108
|
+
**ALL code MUST follow `@[skills/clean-code]` rules. No exceptions.**
|
|
109
|
+
|
|
110
|
+
- **Code**: Concise, direct, no over-engineering. Self-documenting.
|
|
111
|
+
- **Testing**: Mandatory. Pyramid (Unit > Int > E2E) + AAA Pattern.
|
|
112
|
+
- **Performance**: Measure first. Adhere to 2025 standards (Core Web Vitals).
|
|
113
|
+
- **Infra/Safety**: 5-Phase Deployment. Verify secrets security.
|
|
114
|
+
|
|
115
|
+
### 📁 File Dependency Awareness
|
|
116
|
+
|
|
117
|
+
**Before modifying ANY file:**
|
|
118
|
+
|
|
119
|
+
1. Check `CODEBASE.md` → File Dependencies
|
|
120
|
+
2. Identify dependent files
|
|
121
|
+
3. Update ALL affected files together
|
|
122
|
+
|
|
123
|
+
### 🗺️ System Map Read
|
|
124
|
+
|
|
125
|
+
> 🔴 **MANDATORY:** Read `ARCHITECTURE.md` at session start to understand Agents, Skills, and Scripts.
|
|
126
|
+
|
|
127
|
+
**Path Awareness:**
|
|
128
|
+
|
|
129
|
+
- Agents: `.agent/` (Project)
|
|
130
|
+
- Skills: `.agent/skills/` (Project)
|
|
131
|
+
- Runtime Scripts: `.agent/skills/<skill>/scripts/`
|
|
132
|
+
|
|
133
|
+
### 🧠 Read → Understand → Apply
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
❌ WRONG: Read agent file → Start coding
|
|
137
|
+
✅ CORRECT: Read → Understand WHY → Apply PRINCIPLES → Code
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
**Before coding, answer:**
|
|
141
|
+
|
|
142
|
+
1. What is the GOAL of this agent/skill?
|
|
143
|
+
2. What PRINCIPLES must I apply?
|
|
144
|
+
3. How does this DIFFER from generic output?
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## TIER 1: CODE RULES (When Writing Code)
|
|
149
|
+
|
|
150
|
+
### 📱 Project Type Routing
|
|
151
|
+
|
|
152
|
+
| Project Type | Primary Agent | Skills |
|
|
153
|
+
| -------------------------------------- | --------------------- | ----------------------------- |
|
|
154
|
+
| **MOBILE** (iOS, Android, RN, Flutter) | `mobile-developer` | mobile-design |
|
|
155
|
+
| **WEB** (Next.js, React web) | `frontend-specialist` | frontend-design |
|
|
156
|
+
| **BACKEND** (API, server, DB) | `backend-specialist` | api-patterns, database-design |
|
|
157
|
+
|
|
158
|
+
> 🔴 **Mobile + frontend-specialist = WRONG.** Mobile = mobile-developer ONLY.
|
|
159
|
+
|
|
160
|
+
### 🛑 Socratic Gate
|
|
161
|
+
|
|
162
|
+
**For complex requests, STOP and ASK first:**
|
|
163
|
+
|
|
164
|
+
### 🛑 GLOBAL SOCRATIC GATE (TIER 0)
|
|
165
|
+
|
|
166
|
+
**MANDATORY: Every user request must pass through the Socratic Gate before ANY tool use or implementation.**
|
|
167
|
+
|
|
168
|
+
| Request Type | Strategy | Required Action |
|
|
169
|
+
| ----------------------- | -------------- | ----------------------------------------------------------------- |
|
|
170
|
+
| **New Feature / Build** | Deep Discovery | ASK minimum 3 strategic questions |
|
|
171
|
+
| **Code Edit / Bug Fix** | Context Check | Confirm understanding + ask impact questions |
|
|
172
|
+
| **Vague / Simple** | Clarification | Ask Purpose, Users, and Scope |
|
|
173
|
+
| **Full Orchestration** | Gatekeeper | **STOP** subagents until user confirms plan details |
|
|
174
|
+
| **Direct "Proceed"** | Validation | **STOP** → Even if answers are given, ask 2 "Edge Case" questions |
|
|
175
|
+
|
|
176
|
+
**Protocol:**
|
|
177
|
+
|
|
178
|
+
1. **Never Assume:** If even 1% is unclear, ASK.
|
|
179
|
+
2. **Handle Spec-heavy Requests:** When user gives a list (Answers 1, 2, 3...), do NOT skip the gate. Instead, ask about **Trade-offs** or **Edge Cases** (e.g., "LocalStorage confirmed, but should we handle data clearing or versioning?") before starting.
|
|
180
|
+
3. **Wait:** Do NOT invoke subagents or write code until the user clears the Gate.
|
|
181
|
+
4. **Reference:** Full protocol in `@[skills/brainstorming]`.
|
|
182
|
+
|
|
183
|
+
### 🏁 Final Checklist Protocol
|
|
184
|
+
|
|
185
|
+
**Trigger:** When the user says "son kontrolleri yap", "final checks", "çalıştır tüm testleri", or similar phrases.
|
|
186
|
+
|
|
187
|
+
| Task Stage | Command | Purpose |
|
|
188
|
+
| ---------------- | -------------------------------------------------- | ------------------------------ |
|
|
189
|
+
| **Manual Audit** | `python .agent/scripts/checklist.py .` | Priority-based project audit |
|
|
190
|
+
| **Pre-Deploy** | `python .agent/scripts/checklist.py . --url <URL>` | Full Suite + Performance + E2E |
|
|
191
|
+
|
|
192
|
+
**Priority Execution Order:**
|
|
193
|
+
|
|
194
|
+
1. **Security** → 2. **Lint** → 3. **Schema** → 4. **Tests** → 5. **UX** → 6. **Seo** → 7. **Lighthouse/E2E**
|
|
195
|
+
|
|
196
|
+
**Rules:**
|
|
197
|
+
|
|
198
|
+
- **Completion:** A task is NOT finished until `checklist.py` returns success.
|
|
199
|
+
- **Reporting:** If it fails, fix the **Critical** blockers first (Security/Lint).
|
|
200
|
+
|
|
201
|
+
**Available Scripts (12 total):**
|
|
202
|
+
|
|
203
|
+
| Script | Skill | When to Use |
|
|
204
|
+
| -------------------------- | --------------------- | ------------------- |
|
|
205
|
+
| `security_scan.py` | vulnerability-scanner | Always on deploy |
|
|
206
|
+
| `dependency_analyzer.py` | vulnerability-scanner | Weekly / Deploy |
|
|
207
|
+
| `lint_runner.py` | lint-and-validate | Every code change |
|
|
208
|
+
| `test_runner.py` | testing-patterns | After logic change |
|
|
209
|
+
| `schema_validator.py` | database-design | After DB change |
|
|
210
|
+
| `ux_audit.py` | frontend-design | After UI change |
|
|
211
|
+
| `accessibility_checker.py` | frontend-design | After UI change |
|
|
212
|
+
| `seo_checker.py` | seo-fundamentals | After page change |
|
|
213
|
+
| `bundle_analyzer.py` | performance-profiling | Before deploy |
|
|
214
|
+
| `mobile_audit.py` | mobile-design | After mobile change |
|
|
215
|
+
| `lighthouse_audit.py` | performance-profiling | Before deploy |
|
|
216
|
+
| `playwright_runner.py` | webapp-testing | Before deploy |
|
|
217
|
+
|
|
218
|
+
> 🔴 **Agents & Skills can invoke ANY script** via `python .agent/skills/<skill>/scripts/<script>.py`
|
|
219
|
+
|
|
220
|
+
### 🎭 Gemini Mode Mapping
|
|
221
|
+
|
|
222
|
+
| Mode | Agent | Behavior |
|
|
223
|
+
| -------- | ----------------- | -------------------------------------------- |
|
|
224
|
+
| **plan** | `project-planner` | 4-phase methodology. NO CODE before Phase 4. |
|
|
225
|
+
| **ask** | - | Focus on understanding. Ask questions. |
|
|
226
|
+
| **edit** | `orchestrator` | Execute. Check `{task-slug}.md` first. |
|
|
227
|
+
|
|
228
|
+
**Plan Mode (4-Phase):**
|
|
229
|
+
|
|
230
|
+
1. ANALYSIS → Research, questions
|
|
231
|
+
2. PLANNING → `{task-slug}.md`, task breakdown
|
|
232
|
+
3. SOLUTIONING → Architecture, design (NO CODE!)
|
|
233
|
+
4. IMPLEMENTATION → Code + tests
|
|
234
|
+
|
|
235
|
+
> 🔴 **Edit mode:** If multi-file or structural change → Offer to create `{task-slug}.md`. For single-file fixes → Proceed directly.
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
## TIER 2: DESIGN RULES (Reference)
|
|
240
|
+
|
|
241
|
+
> **Design rules are in the specialist agents, NOT here.**
|
|
242
|
+
|
|
243
|
+
| Task | Read |
|
|
244
|
+
| ------------ | ------------------------------- |
|
|
245
|
+
| Web UI/UX | `.agent/frontend-specialist.md` |
|
|
246
|
+
| Mobile UI/UX | `.agent/mobile-developer.md` |
|
|
247
|
+
|
|
248
|
+
**These agents contain:**
|
|
249
|
+
|
|
250
|
+
- Purple Ban (no violet/purple colors)
|
|
251
|
+
- Template Ban (no standard layouts)
|
|
252
|
+
- Anti-cliché rules
|
|
253
|
+
- Deep Design Thinking protocol
|
|
254
|
+
|
|
255
|
+
> 🔴 **For design work:** Open and READ the agent file. Rules are there.
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## 📁 QUICK REFERENCE
|
|
260
|
+
|
|
261
|
+
### Agents & Skills
|
|
262
|
+
|
|
263
|
+
- **Masters**: `orchestrator`, `project-planner`, `security-auditor` (Cyber/Audit), `backend-specialist` (API/DB), `frontend-specialist` (UI/UX), `mobile-developer`, `debugger`, `game-developer`
|
|
264
|
+
- **Key Skills**: `clean-code`, `brainstorming`, `app-builder`, `frontend-design`, `mobile-design`, `plan-writing`, `behavioral-modes`
|
|
265
|
+
|
|
266
|
+
### Key Scripts
|
|
267
|
+
|
|
268
|
+
- **Verify**: `.agent/scripts/verify_all.py`, `.agent/scripts/checklist.py`
|
|
269
|
+
- **Scanners**: `security_scan.py`, `dependency_analyzer.py`
|
|
270
|
+
- **Audits**: `ux_audit.py`, `mobile_audit.py`, `lighthouse_audit.py`, `seo_checker.py`
|
|
271
|
+
- **Test**: `playwright_runner.py`, `test_runner.py`
|
|
272
|
+
|
|
273
|
+
---
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cqrs-implementation
|
|
3
|
+
description: "Implement Command Query Responsibility Segregation for scalable architectures. Use when separating read and write models, optimizing query performance, or building event-sourced systems."
|
|
4
|
+
risk: unknown
|
|
5
|
+
source: community
|
|
6
|
+
date_added: "2026-02-27"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# CQRS Implementation
|
|
10
|
+
|
|
11
|
+
Comprehensive guide to implementing CQRS (Command Query Responsibility Segregation) patterns.
|
|
12
|
+
|
|
13
|
+
## Use this skill when
|
|
14
|
+
|
|
15
|
+
- Separating read and write concerns
|
|
16
|
+
- Scaling reads independently from writes
|
|
17
|
+
- Building event-sourced systems
|
|
18
|
+
- Optimizing complex query scenarios
|
|
19
|
+
- Different read/write data models are needed
|
|
20
|
+
- High-performance reporting is required
|
|
21
|
+
|
|
22
|
+
## Do not use this skill when
|
|
23
|
+
|
|
24
|
+
- The domain is simple and CRUD is sufficient
|
|
25
|
+
- You cannot operate separate read/write models
|
|
26
|
+
- Strong immediate consistency is required everywhere
|
|
27
|
+
|
|
28
|
+
## Instructions
|
|
29
|
+
|
|
30
|
+
- Identify read/write workloads and consistency needs.
|
|
31
|
+
- Define command and query models with clear boundaries.
|
|
32
|
+
- Implement read model projections and synchronization.
|
|
33
|
+
- Validate performance, recovery, and failure modes.
|
|
34
|
+
|
|
35
|
+
## Core Concepts
|
|
36
|
+
|
|
37
|
+
### Commands (Write Side)
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
// Command — intent to change state
|
|
41
|
+
interface SubmitOrderCommand {
|
|
42
|
+
orderId: string;
|
|
43
|
+
items: OrderItem[];
|
|
44
|
+
customerId: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Command Handler
|
|
48
|
+
class SubmitOrderHandler {
|
|
49
|
+
async handle(cmd: SubmitOrderCommand): Promise<void> {
|
|
50
|
+
const order = await this.orderRepo.findById(cmd.orderId);
|
|
51
|
+
order.submit(cmd.items);
|
|
52
|
+
await this.orderRepo.save(order);
|
|
53
|
+
await this.eventBus.publish(order.domainEvents);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Queries (Read Side)
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
// Read model — optimized for queries
|
|
62
|
+
interface OrderSummaryView {
|
|
63
|
+
orderId: string;
|
|
64
|
+
customerName: string;
|
|
65
|
+
totalAmount: number;
|
|
66
|
+
status: string;
|
|
67
|
+
createdAt: Date;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Query Handler
|
|
71
|
+
class GetOrderSummaryHandler {
|
|
72
|
+
async handle(orderId: string): Promise<OrderSummaryView> {
|
|
73
|
+
return this.readDb.query(
|
|
74
|
+
'SELECT * FROM order_summaries WHERE order_id = $1',
|
|
75
|
+
[orderId]
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Projection Building
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
// Project events to read model
|
|
85
|
+
class OrderProjection {
|
|
86
|
+
async on(event: OrderSubmitted): Promise<void> {
|
|
87
|
+
await this.readDb.upsert('order_summaries', {
|
|
88
|
+
order_id: event.orderId,
|
|
89
|
+
status: 'submitted',
|
|
90
|
+
submitted_at: event.occurredAt,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Synchronization Strategies
|
|
97
|
+
|
|
98
|
+
| Strategy | Consistency | Complexity |
|
|
99
|
+
|----------|-------------|------------|
|
|
100
|
+
| Synchronous | Strong | High |
|
|
101
|
+
| Async via events | Eventual | Medium |
|
|
102
|
+
| Change Data Capture | Near-real-time | Medium |
|
|
103
|
+
| Scheduled rebuild | Eventual | Low |
|
|
104
|
+
|
|
105
|
+
## Related Skills
|
|
106
|
+
|
|
107
|
+
Works well with: `event-sourcing-architect`, `ddd-tactical-patterns`
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ddd-strategic-design
|
|
3
|
+
description: "Design DDD strategic artifacts including subdomains, bounded contexts, and ubiquitous language for complex business domains."
|
|
4
|
+
risk: safe
|
|
5
|
+
source: self
|
|
6
|
+
tags: "[ddd, strategic-design, bounded-context, ubiquitous-language]"
|
|
7
|
+
date_added: "2026-02-27"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# DDD Strategic Design
|
|
11
|
+
|
|
12
|
+
## Use this skill when
|
|
13
|
+
|
|
14
|
+
- Defining core, supporting, and generic subdomains.
|
|
15
|
+
- Splitting a monolith or service landscape by domain boundaries.
|
|
16
|
+
- Aligning teams and ownership with bounded contexts.
|
|
17
|
+
- Building a shared ubiquitous language with domain experts.
|
|
18
|
+
|
|
19
|
+
## Do not use this skill when
|
|
20
|
+
|
|
21
|
+
- The domain model is stable and already well bounded.
|
|
22
|
+
- You need tactical code patterns only.
|
|
23
|
+
- The task is purely infrastructure or UI oriented.
|
|
24
|
+
|
|
25
|
+
## Instructions
|
|
26
|
+
|
|
27
|
+
1. Extract domain capabilities and classify subdomains.
|
|
28
|
+
2. Define bounded contexts around consistency and ownership.
|
|
29
|
+
3. Establish a ubiquitous language glossary and anti-terms.
|
|
30
|
+
4. Capture context boundaries in ADRs before implementation.
|
|
31
|
+
|
|
32
|
+
## Required artifacts
|
|
33
|
+
|
|
34
|
+
- Subdomain classification table
|
|
35
|
+
- Bounded context catalog
|
|
36
|
+
- Glossary with canonical terms
|
|
37
|
+
- Boundary decisions with rationale
|
|
38
|
+
|
|
39
|
+
## Subdomain Classification
|
|
40
|
+
|
|
41
|
+
| Type | Description | Example |
|
|
42
|
+
|------|-------------|---------|
|
|
43
|
+
| **Core** | Competitive advantage, high complexity | Order management |
|
|
44
|
+
| **Supporting** | Needed but not differentiating | Notifications |
|
|
45
|
+
| **Generic** | Commodity, buy or use SaaS | Authentication |
|
|
46
|
+
|
|
47
|
+
## Bounded Context Patterns
|
|
48
|
+
|
|
49
|
+
### Context Map Relationships
|
|
50
|
+
|
|
51
|
+
| Pattern | When to Use |
|
|
52
|
+
|---------|------------|
|
|
53
|
+
| **Partnership** | Teams must cooperate closely |
|
|
54
|
+
| **Shared Kernel** | Small shared model owned jointly |
|
|
55
|
+
| **Customer-Supplier** | One team depends on the other |
|
|
56
|
+
| **Anti-Corruption Layer** | Protect from legacy/external models |
|
|
57
|
+
| **Published Language** | Well-documented integration protocol |
|
|
58
|
+
|
|
59
|
+
## Examples
|
|
60
|
+
|
|
61
|
+
```text
|
|
62
|
+
Use @ddd-strategic-design to map our commerce domain into bounded contexts,
|
|
63
|
+
classify subdomains, and propose team ownership.
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Limitations
|
|
67
|
+
|
|
68
|
+
- This skill does not produce executable code.
|
|
69
|
+
- It cannot infer business truth without stakeholder input.
|
|
70
|
+
- It should be followed by tactical design before implementation.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ddd-tactical-patterns
|
|
3
|
+
description: "Apply DDD tactical patterns in code using entities, value objects, aggregates, repositories, and domain events with explicit invariants."
|
|
4
|
+
risk: safe
|
|
5
|
+
source: self
|
|
6
|
+
tags: "[ddd, tactical, aggregates, value-objects, domain-events]"
|
|
7
|
+
date_added: "2026-02-27"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# DDD Tactical Patterns
|
|
11
|
+
|
|
12
|
+
## Use this skill when
|
|
13
|
+
|
|
14
|
+
- Translating domain rules into code structures.
|
|
15
|
+
- Designing aggregate boundaries and invariants.
|
|
16
|
+
- Refactoring an anemic model into behavior-rich domain objects.
|
|
17
|
+
- Defining repository contracts and domain event boundaries.
|
|
18
|
+
|
|
19
|
+
## Do not use this skill when
|
|
20
|
+
|
|
21
|
+
- You are still defining strategic boundaries.
|
|
22
|
+
- The task is only API documentation or UI layout.
|
|
23
|
+
- Full DDD complexity is not justified.
|
|
24
|
+
|
|
25
|
+
## Instructions
|
|
26
|
+
|
|
27
|
+
1. Identify invariants first and design aggregates around them.
|
|
28
|
+
2. Model immutable value objects for validated concepts.
|
|
29
|
+
3. Keep domain behavior in domain objects, not controllers.
|
|
30
|
+
4. Emit domain events for meaningful state transitions.
|
|
31
|
+
5. Keep repositories at aggregate root boundaries.
|
|
32
|
+
|
|
33
|
+
## Core Building Blocks
|
|
34
|
+
|
|
35
|
+
| Building Block | Description | Key Rule |
|
|
36
|
+
|----------------|-------------|----------|
|
|
37
|
+
| **Entity** | Has identity, mutable | ID never changes |
|
|
38
|
+
| **Value Object** | No identity, immutable | Equality by value |
|
|
39
|
+
| **Aggregate** | Transaction boundary | Only root is public |
|
|
40
|
+
| **Repository** | Collection abstraction | One per aggregate root |
|
|
41
|
+
| **Domain Event** | Fact that happened | Immutable, past tense name |
|
|
42
|
+
| **Domain Service** | Stateless behavior | For cross-aggregate logic |
|
|
43
|
+
|
|
44
|
+
## Example
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
class Order {
|
|
48
|
+
private status: "draft" | "submitted" = "draft";
|
|
49
|
+
|
|
50
|
+
submit(itemsCount: number): void {
|
|
51
|
+
if (itemsCount === 0) throw new Error("Order cannot be submitted empty");
|
|
52
|
+
if (this.status !== "draft") throw new Error("Order already submitted");
|
|
53
|
+
this.status = "submitted";
|
|
54
|
+
this.addEvent(new OrderSubmitted(this.id));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Aggregate Design Rules
|
|
60
|
+
|
|
61
|
+
- Keep aggregates small — focus on invariants
|
|
62
|
+
- Reference other aggregates by ID only
|
|
63
|
+
- Design for eventual consistency between aggregates
|
|
64
|
+
- One transaction = one aggregate
|
|
65
|
+
|
|
66
|
+
## Limitations
|
|
67
|
+
|
|
68
|
+
- This skill does not define deployment architecture.
|
|
69
|
+
- It does not choose databases or transport protocols.
|
|
70
|
+
- It should be paired with testing patterns for invariant coverage.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: elixir-pro
|
|
3
|
+
description: Write idiomatic Elixir code with OTP patterns, supervision trees, and Phoenix LiveView. Masters concurrency, fault tolerance, and distributed systems.
|
|
4
|
+
risk: unknown
|
|
5
|
+
source: community
|
|
6
|
+
date_added: "2026-02-27"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Elixir Pro
|
|
10
|
+
|
|
11
|
+
You are an Elixir expert specializing in concurrent, fault-tolerant, and distributed systems.
|
|
12
|
+
|
|
13
|
+
## Use this skill when
|
|
14
|
+
|
|
15
|
+
- Building concurrent, fault-tolerant Elixir applications
|
|
16
|
+
- Working with OTP patterns (GenServer, Supervisor, Application)
|
|
17
|
+
- Developing Phoenix applications and LiveView real-time features
|
|
18
|
+
- Designing distributed systems with Elixir
|
|
19
|
+
|
|
20
|
+
## Do not use this skill when
|
|
21
|
+
|
|
22
|
+
- The task is unrelated to Elixir/OTP/Phoenix
|
|
23
|
+
- You need a different language or runtime
|
|
24
|
+
|
|
25
|
+
## Focus Areas
|
|
26
|
+
|
|
27
|
+
- OTP patterns (GenServer, Supervisor, Application)
|
|
28
|
+
- Phoenix framework and LiveView real-time features
|
|
29
|
+
- Ecto for database interactions and changesets
|
|
30
|
+
- Pattern matching and guard clauses
|
|
31
|
+
- Concurrent programming with processes and Tasks
|
|
32
|
+
- Distributed systems with nodes and clustering
|
|
33
|
+
- Performance optimization on the BEAM VM
|
|
34
|
+
|
|
35
|
+
## Core Patterns
|
|
36
|
+
|
|
37
|
+
```elixir
|
|
38
|
+
# GenServer example
|
|
39
|
+
defmodule MyWorker do
|
|
40
|
+
use GenServer
|
|
41
|
+
|
|
42
|
+
def start_link(opts), do: GenServer.start_link(__MODULE__, opts, name: __MODULE__)
|
|
43
|
+
def init(state), do: {:ok, state}
|
|
44
|
+
|
|
45
|
+
def handle_call(:get_state, _from, state) do
|
|
46
|
+
{:reply, state, state}
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def handle_cast({:update, new_val}, state) do
|
|
50
|
+
{:noreply, Map.put(state, :value, new_val)}
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Supervision tree
|
|
55
|
+
defmodule MyApp.Supervisor do
|
|
56
|
+
use Supervisor
|
|
57
|
+
|
|
58
|
+
def start_link(opts), do: Supervisor.start_link(__MODULE__, opts, name: __MODULE__)
|
|
59
|
+
|
|
60
|
+
def init(_opts) do
|
|
61
|
+
children = [
|
|
62
|
+
MyWorker,
|
|
63
|
+
{Task.Supervisor, name: MyApp.TaskSupervisor}
|
|
64
|
+
]
|
|
65
|
+
Supervisor.init(children, strategy: :one_for_one)
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Approach
|
|
71
|
+
|
|
72
|
+
1. Embrace "let it crash" philosophy with proper supervision
|
|
73
|
+
2. Use pattern matching over conditional logic
|
|
74
|
+
3. Design with processes for isolation and concurrency
|
|
75
|
+
4. Leverage immutability for predictable state
|
|
76
|
+
5. Test with ExUnit, focusing on property-based testing
|
|
77
|
+
6. Profile with :observer and :recon for bottlenecks
|
|
78
|
+
|
|
79
|
+
## Output
|
|
80
|
+
|
|
81
|
+
- Idiomatic Elixir following community style guide
|
|
82
|
+
- OTP applications with proper supervision trees
|
|
83
|
+
- Phoenix apps with contexts and clean boundaries
|
|
84
|
+
- ExUnit tests with doctests and async where possible
|
|
85
|
+
- Dialyzer specs for type safety
|
|
86
|
+
- Performance benchmarks with Benchee
|
|
87
|
+
- Telemetry instrumentation for observability
|
|
88
|
+
|
|
89
|
+
Follow Elixir conventions. Design for fault tolerance and horizontal scaling.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: event-sourcing-architect
|
|
3
|
+
description: "Expert in event sourcing, CQRS, and event-driven architecture patterns. Masters event store design, projection building, saga orchestration, and eventual consistency patterns."
|
|
4
|
+
risk: unknown
|
|
5
|
+
source: community
|
|
6
|
+
date_added: "2026-02-27"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Event Sourcing Architect
|
|
10
|
+
|
|
11
|
+
Expert in event sourcing, CQRS, and event-driven architecture patterns. Masters event store design, projection building, saga orchestration, and eventual consistency patterns. Use PROACTIVELY for event-sourced systems, audit trail requirements, or complex domain modeling with temporal queries.
|
|
12
|
+
|
|
13
|
+
## Capabilities
|
|
14
|
+
|
|
15
|
+
- Event store design and implementation
|
|
16
|
+
- CQRS (Command Query Responsibility Segregation) patterns
|
|
17
|
+
- Projection building and read model optimization
|
|
18
|
+
- Saga and process manager orchestration
|
|
19
|
+
- Event versioning and schema evolution
|
|
20
|
+
- Snapshotting strategies for performance
|
|
21
|
+
- Eventual consistency handling
|
|
22
|
+
|
|
23
|
+
## Use this skill when
|
|
24
|
+
|
|
25
|
+
- Building systems requiring complete audit trails
|
|
26
|
+
- Implementing complex business workflows with compensating actions
|
|
27
|
+
- Designing systems needing temporal queries ("what was state at time X")
|
|
28
|
+
- Separating read and write models for performance
|
|
29
|
+
- Building event-driven microservices architectures
|
|
30
|
+
- Implementing undo/redo or time-travel debugging
|
|
31
|
+
|
|
32
|
+
## Do not use this skill when
|
|
33
|
+
|
|
34
|
+
- The domain is simple and CRUD is sufficient
|
|
35
|
+
- You cannot support event store operations or projections
|
|
36
|
+
- Strong immediate consistency is required everywhere
|
|
37
|
+
|
|
38
|
+
## Instructions
|
|
39
|
+
|
|
40
|
+
1. Identify aggregate boundaries and event streams
|
|
41
|
+
2. Design events as immutable facts
|
|
42
|
+
3. Implement command handlers and event application
|
|
43
|
+
4. Build projections for query requirements
|
|
44
|
+
5. Design saga/process managers for cross-aggregate workflows
|
|
45
|
+
6. Implement snapshotting for long-lived aggregates
|
|
46
|
+
7. Set up event versioning strategy
|
|
47
|
+
|
|
48
|
+
## Safety
|
|
49
|
+
|
|
50
|
+
- Never mutate or delete committed events in production.
|
|
51
|
+
- Rebuild projections in staging before running in production.
|
|
52
|
+
|
|
53
|
+
## Best Practices
|
|
54
|
+
|
|
55
|
+
- Events are facts - never delete or modify them
|
|
56
|
+
- Keep events small and focused
|
|
57
|
+
- Version events from day one
|
|
58
|
+
- Design for eventual consistency
|
|
59
|
+
- Use correlation IDs for tracing
|
|
60
|
+
- Implement idempotent event handlers
|
|
61
|
+
- Plan for projection rebuilding
|
|
62
|
+
- Use durable execution for process managers and sagas
|
|
63
|
+
|
|
64
|
+
## Related Skills
|
|
65
|
+
|
|
66
|
+
Works well with: `cqrs-implementation`, `ddd-tactical-patterns`, `saga-orchestration`
|