dhurandhar 1.0.0
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/.dhurandhar-session-start.md +242 -0
- package/LICENSE +21 -0
- package/README.md +416 -0
- package/docs/ARCHITECTURE_V2.md +249 -0
- package/docs/DECISION_REGISTRY.md +357 -0
- package/docs/IMPLEMENTATION_PERSONAS.md +406 -0
- package/docs/PLUGGABLE_STRATEGIES.md +439 -0
- package/docs/SYSTEM_OBSERVER.md +433 -0
- package/docs/TEST_FIRST_AGILE.md +359 -0
- package/docs/architecture.md +279 -0
- package/docs/engineering-first-philosophy.md +263 -0
- package/docs/getting-started.md +218 -0
- package/docs/module-development.md +323 -0
- package/docs/strategy-example.md +299 -0
- package/docs/test-first-example.md +392 -0
- package/package.json +79 -0
- package/src/core/README.md +92 -0
- package/src/core/agent-instructions/backend-developer.md +412 -0
- package/src/core/agent-instructions/devops-engineer.md +372 -0
- package/src/core/agent-instructions/dhurandhar-council.md +547 -0
- package/src/core/agent-instructions/edge-case-hunter.md +322 -0
- package/src/core/agent-instructions/frontend-developer.md +494 -0
- package/src/core/agent-instructions/lead-system-architect.md +631 -0
- package/src/core/agent-instructions/system-observer.md +319 -0
- package/src/core/agent-instructions/test-architect.md +284 -0
- package/src/core/module.yaml +54 -0
- package/src/core/schemas/design-module-schema.yaml +995 -0
- package/src/core/schemas/system-design-map-schema.yaml +324 -0
- package/src/modules/example/README.md +130 -0
- package/src/modules/example/module.yaml +252 -0
- package/tools/cli/commands/audit.js +267 -0
- package/tools/cli/commands/config.js +113 -0
- package/tools/cli/commands/context.js +170 -0
- package/tools/cli/commands/decisions.js +398 -0
- package/tools/cli/commands/entity.js +218 -0
- package/tools/cli/commands/epic.js +125 -0
- package/tools/cli/commands/install.js +172 -0
- package/tools/cli/commands/module.js +109 -0
- package/tools/cli/commands/service.js +167 -0
- package/tools/cli/commands/story.js +225 -0
- package/tools/cli/commands/strategy.js +294 -0
- package/tools/cli/commands/test.js +277 -0
- package/tools/cli/commands/validate.js +107 -0
- package/tools/cli/dhurandhar.js +212 -0
- package/tools/lib/config-manager.js +170 -0
- package/tools/lib/filesystem.js +126 -0
- package/tools/lib/module-installer.js +61 -0
- package/tools/lib/module-manager.js +149 -0
- package/tools/lib/sdm-manager.js +982 -0
- package/tools/lib/test-engine.js +255 -0
- package/tools/lib/test-templates/api-client.template.js +100 -0
- package/tools/lib/test-templates/vitest.config.template.js +37 -0
- package/tools/lib/validators/config-validator.js +113 -0
- package/tools/lib/validators/module-validator.js +137 -0
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
# Implementation Personas - DevOps, Backend, Frontend
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Dhurandhar v2.4 expands the Council with **3 implementation-focused personas** that translate design decisions and test contracts into executable infrastructure and code.
|
|
6
|
+
|
|
7
|
+
## Philosophy
|
|
8
|
+
|
|
9
|
+
### Traditional Approach (Anti-Pattern)
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
Design Complete → "Now figure out how to build it"
|
|
13
|
+
Developer: "What database?"
|
|
14
|
+
Developer: "Which framework?"
|
|
15
|
+
Developer: "How do we deploy?"
|
|
16
|
+
Developer: "Where's the API spec?"
|
|
17
|
+
|
|
18
|
+
[Weeks of implementation decisions]
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Dhurandhar Approach
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
Design Complete (SDM has all decisions)
|
|
25
|
+
→ DevOps Engineer: [Reads deployment strategy] "Generating K8s manifests"
|
|
26
|
+
→ Backend Developer: [Reads service definition] "Implementing Go/Echo service"
|
|
27
|
+
→ Frontend Developer: [Reads story contract] "Building React login form"
|
|
28
|
+
|
|
29
|
+
[Implementation starts immediately, all decisions made]
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## The Implementation Layer
|
|
33
|
+
|
|
34
|
+
### 3 Specialized Personas
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
┌──────────────────────────────────────────┐
|
|
38
|
+
│ IMPLEMENTATION LAYER │
|
|
39
|
+
├──────────────────────────────────────────┤
|
|
40
|
+
│ DevOps Engineer │
|
|
41
|
+
│ - Infrastructure as Code │
|
|
42
|
+
│ - CI/CD Pipelines │
|
|
43
|
+
│ - Environment Management │
|
|
44
|
+
│ │
|
|
45
|
+
│ Backend Developer │
|
|
46
|
+
│ - Service Implementation │
|
|
47
|
+
│ - Entity/Model Creation │
|
|
48
|
+
│ - API Endpoint Development │
|
|
49
|
+
│ │
|
|
50
|
+
│ Frontend Developer │
|
|
51
|
+
│ - UI Component Implementation │
|
|
52
|
+
│ - API Client Creation │
|
|
53
|
+
│ - State Management │
|
|
54
|
+
└──────────────────────────────────────────┘
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Persona 1: DevOps Engineer
|
|
58
|
+
|
|
59
|
+
### Role
|
|
60
|
+
Infrastructure and Automation Specialist
|
|
61
|
+
|
|
62
|
+
### What They Read from SDM
|
|
63
|
+
|
|
64
|
+
```yaml
|
|
65
|
+
technical_strategies:
|
|
66
|
+
deployment:
|
|
67
|
+
orchestration: kubernetes
|
|
68
|
+
scaling_strategy: horizontal_pod_autoscaling
|
|
69
|
+
service_mesh:
|
|
70
|
+
enabled: true
|
|
71
|
+
technology: istio
|
|
72
|
+
|
|
73
|
+
observability:
|
|
74
|
+
logging: centralized_elk
|
|
75
|
+
metrics: prometheus
|
|
76
|
+
tracing: jaeger
|
|
77
|
+
|
|
78
|
+
services:
|
|
79
|
+
- name: auth-service
|
|
80
|
+
tech_stack:
|
|
81
|
+
language: Go
|
|
82
|
+
framework: Echo
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### What They Generate
|
|
86
|
+
|
|
87
|
+
1. **Dockerfile**:
|
|
88
|
+
```dockerfile
|
|
89
|
+
FROM golang:1.21-alpine AS builder
|
|
90
|
+
WORKDIR /app
|
|
91
|
+
COPY . .
|
|
92
|
+
RUN go build -o /auth-service
|
|
93
|
+
|
|
94
|
+
FROM alpine:latest
|
|
95
|
+
COPY --from=builder /auth-service /
|
|
96
|
+
EXPOSE 8080
|
|
97
|
+
CMD ["/auth-service"]
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
2. **Kubernetes Manifests**:
|
|
101
|
+
```yaml
|
|
102
|
+
apiVersion: apps/v1
|
|
103
|
+
kind: Deployment
|
|
104
|
+
metadata:
|
|
105
|
+
name: auth-service
|
|
106
|
+
spec:
|
|
107
|
+
replicas: 3
|
|
108
|
+
template:
|
|
109
|
+
spec:
|
|
110
|
+
containers:
|
|
111
|
+
- name: auth-service
|
|
112
|
+
image: auth-service:latest
|
|
113
|
+
resources:
|
|
114
|
+
limits: {cpu: "500m", memory: "512Mi"}
|
|
115
|
+
---
|
|
116
|
+
apiVersion: autoscaling/v2
|
|
117
|
+
kind: HorizontalPodAutoscaler
|
|
118
|
+
spec:
|
|
119
|
+
minReplicas: 3
|
|
120
|
+
maxReplicas: 10
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
3. **CI/CD Pipeline**:
|
|
124
|
+
```yaml
|
|
125
|
+
# .github/workflows/auth-service.yml
|
|
126
|
+
name: Deploy auth-service
|
|
127
|
+
on:
|
|
128
|
+
push:
|
|
129
|
+
paths: ['services/auth/**']
|
|
130
|
+
jobs:
|
|
131
|
+
deploy:
|
|
132
|
+
runs-on: ubuntu-latest
|
|
133
|
+
steps:
|
|
134
|
+
- name: Build
|
|
135
|
+
- name: Test
|
|
136
|
+
- name: Deploy to K8s
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Key Characteristic
|
|
140
|
+
|
|
141
|
+
**Tool-Agnostic**: Uses whatever `deployment.orchestration` specifies (K8s, ECS, serverless)
|
|
142
|
+
|
|
143
|
+
## Persona 2: Backend Developer
|
|
144
|
+
|
|
145
|
+
### Role
|
|
146
|
+
Logic and Data Implementation Specialist
|
|
147
|
+
|
|
148
|
+
### What They Read from SDM
|
|
149
|
+
|
|
150
|
+
```yaml
|
|
151
|
+
services:
|
|
152
|
+
- name: order-service
|
|
153
|
+
tech_stack:
|
|
154
|
+
language: Go
|
|
155
|
+
framework: Echo
|
|
156
|
+
database: PostgreSQL
|
|
157
|
+
|
|
158
|
+
entities:
|
|
159
|
+
- name: Order
|
|
160
|
+
attributes:
|
|
161
|
+
- name: id
|
|
162
|
+
type: uuid
|
|
163
|
+
- name: total
|
|
164
|
+
type: decimal
|
|
165
|
+
|
|
166
|
+
agile_blueprint:
|
|
167
|
+
stories:
|
|
168
|
+
- id: STORY-005
|
|
169
|
+
name: "Create Order"
|
|
170
|
+
interaction_boundary:
|
|
171
|
+
api_endpoint: /api/v1/orders
|
|
172
|
+
method: POST
|
|
173
|
+
request_contract:
|
|
174
|
+
items: array
|
|
175
|
+
total: number
|
|
176
|
+
|
|
177
|
+
technical_strategies:
|
|
178
|
+
persistence:
|
|
179
|
+
model: database_per_service
|
|
180
|
+
communication:
|
|
181
|
+
primary_pattern: asynchronous_events
|
|
182
|
+
event_bus: {technology: kafka}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### What They Generate
|
|
186
|
+
|
|
187
|
+
1. **Service Scaffold**:
|
|
188
|
+
```
|
|
189
|
+
services/order/
|
|
190
|
+
├── main.go
|
|
191
|
+
├── handlers/create_order.go
|
|
192
|
+
├── models/order.go
|
|
193
|
+
├── database/migrations/
|
|
194
|
+
└── events/producer.go
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
2. **Entity Model**:
|
|
198
|
+
```go
|
|
199
|
+
type Order struct {
|
|
200
|
+
ID uuid.UUID `gorm:"primaryKey"`
|
|
201
|
+
UserID uuid.UUID
|
|
202
|
+
Total decimal.Decimal
|
|
203
|
+
CreatedAt time.Time
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
3. **API Handler**:
|
|
208
|
+
```go
|
|
209
|
+
func CreateOrder(c echo.Context) error {
|
|
210
|
+
var req CreateOrderRequest
|
|
211
|
+
c.Bind(&req)
|
|
212
|
+
|
|
213
|
+
order := Order{ID: uuid.New(), Total: req.Total}
|
|
214
|
+
db.Create(&order)
|
|
215
|
+
|
|
216
|
+
// Apply event-driven strategy
|
|
217
|
+
kafkaProducer.Publish("order.created", order)
|
|
218
|
+
|
|
219
|
+
return c.JSON(201, order)
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
4. **Database Migration**:
|
|
224
|
+
```sql
|
|
225
|
+
CREATE TABLE orders (
|
|
226
|
+
id UUID PRIMARY KEY,
|
|
227
|
+
user_id UUID NOT NULL,
|
|
228
|
+
total DECIMAL(10,2),
|
|
229
|
+
created_at TIMESTAMP
|
|
230
|
+
);
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Key Characteristic
|
|
234
|
+
|
|
235
|
+
**SDM-Driven**: Implements exactly what SDM defines, applies active strategies automatically
|
|
236
|
+
|
|
237
|
+
## Persona 3: Frontend Developer
|
|
238
|
+
|
|
239
|
+
### Role
|
|
240
|
+
Interface and Interaction Specialist
|
|
241
|
+
|
|
242
|
+
### What They Read from SDM
|
|
243
|
+
|
|
244
|
+
```yaml
|
|
245
|
+
agile_blueprint:
|
|
246
|
+
stories:
|
|
247
|
+
- id: STORY-005
|
|
248
|
+
name: "Create Order"
|
|
249
|
+
interaction_boundary:
|
|
250
|
+
service: order-service
|
|
251
|
+
api_endpoint: /api/v1/orders
|
|
252
|
+
method: POST
|
|
253
|
+
request_contract:
|
|
254
|
+
items: array<{product_id: string, quantity: number}>
|
|
255
|
+
total: number
|
|
256
|
+
response_contract:
|
|
257
|
+
order_id: string
|
|
258
|
+
status: string
|
|
259
|
+
|
|
260
|
+
technical_strategies:
|
|
261
|
+
security:
|
|
262
|
+
authentication: jwt_centralized
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### What They Generate
|
|
266
|
+
|
|
267
|
+
1. **UI Component** (React):
|
|
268
|
+
```jsx
|
|
269
|
+
export function CreateOrderForm() {
|
|
270
|
+
const [items, setItems] = useState([]);
|
|
271
|
+
const [total, setTotal] = useState(0);
|
|
272
|
+
|
|
273
|
+
const handleSubmit = async (e) => {
|
|
274
|
+
e.preventDefault();
|
|
275
|
+
const response = await createOrder({items, total});
|
|
276
|
+
navigate(`/orders/${response.order_id}`);
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
return (
|
|
280
|
+
<form onSubmit={handleSubmit}>
|
|
281
|
+
<ItemList items={items} onChange={setItems} />
|
|
282
|
+
<Total value={total} />
|
|
283
|
+
<button type="submit">Create Order</button>
|
|
284
|
+
</form>
|
|
285
|
+
);
|
|
286
|
+
}
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
2. **API Client** (TypeScript):
|
|
290
|
+
```typescript
|
|
291
|
+
interface CreateOrderRequest {
|
|
292
|
+
items: Array<{product_id: string; quantity: number}>;
|
|
293
|
+
total: number;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
interface CreateOrderResponse {
|
|
297
|
+
order_id: string;
|
|
298
|
+
status: string;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
export async function createOrder(
|
|
302
|
+
req: CreateOrderRequest
|
|
303
|
+
): Promise<CreateOrderResponse> {
|
|
304
|
+
const response = await fetch('/api/v1/orders', {
|
|
305
|
+
method: 'POST',
|
|
306
|
+
headers: {
|
|
307
|
+
'Authorization': `Bearer ${getAccessToken()}`, // jwt_centralized
|
|
308
|
+
'Content-Type': 'application/json',
|
|
309
|
+
},
|
|
310
|
+
body: JSON.stringify(req),
|
|
311
|
+
});
|
|
312
|
+
|
|
313
|
+
return response.json();
|
|
314
|
+
}
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
### Key Characteristic
|
|
318
|
+
|
|
319
|
+
**Story-Driven**: Implements UIs from `agile_blueprint`, API clients from `interaction_boundary`
|
|
320
|
+
|
|
321
|
+
## Integration with Existing Personas
|
|
322
|
+
|
|
323
|
+
### Design → Implementation Flow
|
|
324
|
+
|
|
325
|
+
```
|
|
326
|
+
1. Lead System Architect
|
|
327
|
+
→ Defines service in SDM
|
|
328
|
+
→ Sets strategies
|
|
329
|
+
|
|
330
|
+
2. Test Architect
|
|
331
|
+
→ Creates story
|
|
332
|
+
→ Defines interaction boundary
|
|
333
|
+
→ Generates contract tests
|
|
334
|
+
|
|
335
|
+
3. Implementation Layer (Parallel)
|
|
336
|
+
→ DevOps Engineer: Infra
|
|
337
|
+
→ Backend Developer: API
|
|
338
|
+
→ Frontend Developer: UI
|
|
339
|
+
|
|
340
|
+
4. System Observer
|
|
341
|
+
→ Verifies all implemented
|
|
342
|
+
→ Checks drift
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
### Delegation Example
|
|
346
|
+
|
|
347
|
+
```
|
|
348
|
+
User: "Add order service"
|
|
349
|
+
|
|
350
|
+
Lead System Architect:
|
|
351
|
+
✓ order-service added to SDM
|
|
352
|
+
✓ Strategies applied (db-per-service, event-driven)
|
|
353
|
+
|
|
354
|
+
Delegates to:
|
|
355
|
+
→ Backend Developer: "Implement order-service"
|
|
356
|
+
→ DevOps Engineer: "Generate infrastructure"
|
|
357
|
+
|
|
358
|
+
Backend Developer:
|
|
359
|
+
✓ Service scaffold created
|
|
360
|
+
✓ Database migration created
|
|
361
|
+
✓ Event producers added
|
|
362
|
+
|
|
363
|
+
DevOps Engineer:
|
|
364
|
+
✓ Dockerfile created
|
|
365
|
+
✓ K8s manifests created
|
|
366
|
+
✓ CI/CD pipeline created
|
|
367
|
+
|
|
368
|
+
System Observer:
|
|
369
|
+
Drift: 0% (all implemented)
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
## Benefits
|
|
373
|
+
|
|
374
|
+
### 1. Immediate Implementation
|
|
375
|
+
|
|
376
|
+
**Before**:
|
|
377
|
+
- Design complete → Weeks of "how do we build this?"
|
|
378
|
+
|
|
379
|
+
**After**:
|
|
380
|
+
- Design complete → Implementation starts immediately (all decisions in SDM)
|
|
381
|
+
|
|
382
|
+
### 2. Parallel Execution
|
|
383
|
+
|
|
384
|
+
**DevOps**, **Backend**, and **Frontend** work simultaneously:
|
|
385
|
+
- No waiting for infrastructure
|
|
386
|
+
- No waiting for backend APIs
|
|
387
|
+
- All read from same SDM source of truth
|
|
388
|
+
|
|
389
|
+
### 3. Tool-Agnostic
|
|
390
|
+
|
|
391
|
+
Each persona adapts to SDM specifications:
|
|
392
|
+
- **DevOps**: K8s or ECS or Serverless
|
|
393
|
+
- **Backend**: Go or Node or Python
|
|
394
|
+
- **Frontend**: React or Vue or Flutter
|
|
395
|
+
|
|
396
|
+
### 4. Strategy Enforcement
|
|
397
|
+
|
|
398
|
+
All implementation personas automatically apply active strategies:
|
|
399
|
+
- Database-per-service
|
|
400
|
+
- Event-driven communication
|
|
401
|
+
- JWT authentication
|
|
402
|
+
- Circuit breakers
|
|
403
|
+
|
|
404
|
+
---
|
|
405
|
+
|
|
406
|
+
**Dhurandhar v2.4: Design → Contract → Implementation (7 Personas, 4 Layers)**
|