sdlc-workflow 1.0.2 → 1.0.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.
Files changed (3) hide show
  1. package/README.md +24 -9
  2. package/bin/cli.js +195 -33
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -5,12 +5,14 @@ Scaffold SDLC workflow docs and templates into your project. Works with **Cursor
5
5
  ## Flow
6
6
 
7
7
  ```
8
- User Request → PO → Business BA → Architect → Technical BA → QE (docs) → Dev → QE (testing) → Deploy
8
+ User Request → PO → Business BA → Architect → Technical BA → QE (docs) → Dev → QE (testing) → Deploy (Docker Compose + K8s)
9
9
  ```
10
10
 
11
- - **QE (docs)**: Test plan, test cases — before Dev implements
12
- - **Dev**: Tech Lead (review, merge) + Senior Dev (implement, Unit Test ≥90%)
13
- - **QE (testing)**: After Dev unit tests — automation + manual, sign-off
11
+ - **Mỗi role chạy bằng sub-agent** (xem `docs/sdlc/agents/`).
12
+ - **Sau khi hoàn thành** triển khai ngay với **Docker Compose** (local/staging) **Kubernetes** (production) — `docs/sdlc/deploy/`.
13
+ - **QE (docs)**: Test plan, test cases
14
+ - **Dev**: Sau bước tài liệu → **run implement luôn**. Tech Lead (review, merge) + Senior Dev (implement, Unit Test ≥90%)
15
+ - **QE (testing)**: QE Lead (test framework, review) + Senior QE (10+ yrs, write automation tests)
14
16
 
15
17
  ## Usage
16
18
 
@@ -56,12 +58,25 @@ docs/sdlc/
56
58
  │ └── README.md
57
59
  ├── qe/ # QE (docs + testing)
58
60
  │ ├── test-case.template.md
61
+ │ ├── README.md
62
+ │ ├── qe-lead/ # QE Lead: test framework, review test code
63
+ │ │ └── README.md
64
+ │ └── senior-qe/ # Senior QE 10+ yrs: write automation tests
65
+ │ └── README.md
66
+ ├── dev/ # Dev team (per role)
67
+ │ ├── tech-lead/ # Tech Lead 15+ yrs: tech stack, review & merge
68
+ │ │ └── README.md
69
+ │ └── senior-developer/ # Senior Dev 10+ yrs: implement, Unit Test ≥90%
70
+ │ └── README.md
71
+ ├── agents/ # Sub-agent specs (mỗi role = sub-agent)
59
72
  │ └── README.md
60
- └── dev/ # Dev team (per role)
61
- ├── tech-lead/ # Tech Lead 15+ yrs: tech stack, review & merge
62
- │ └── README.md
63
- └── senior-developer/ # Senior Dev 10+ yrs: implement, Unit Test ≥90%
64
- └── README.md
73
+ └── deploy/ # Sau khi hoàn thành → Docker Compose + K8s
74
+ ├── README.md
75
+ ├── docker-compose.yml.template
76
+ └── k8s/
77
+ ├── deployment.yaml.template
78
+ ├── service.yaml.template
79
+ └── ingress.yaml.template
65
80
 
66
81
  .cursor/rules/
67
82
  └── sdlc-workflow.mdc # Cursor rule
package/bin/cli.js CHANGED
@@ -149,8 +149,13 @@ async function generateFromInline(cwd) {
149
149
  join(base, "ba", "technical"),
150
150
  join(base, "architecture"),
151
151
  join(base, "qe"),
152
+ join(base, "qe", "qe-lead"),
153
+ join(base, "qe", "senior-qe"),
152
154
  join(base, "dev", "tech-lead"),
153
155
  join(base, "dev", "senior-developer"),
156
+ join(base, "agents"),
157
+ join(base, "deploy"),
158
+ join(base, "deploy", "k8s"),
154
159
  ];
155
160
 
156
161
  for (const d of dirs) {
@@ -171,8 +176,16 @@ async function generateFromInline(cwd) {
171
176
  ["architecture/README.md", ARCH_README],
172
177
  ["qe/test-case.template.md", QE_TC_TEMPLATE],
173
178
  ["qe/README.md", QE_README],
179
+ ["qe/qe-lead/README.md", QE_LEAD_README],
180
+ ["qe/senior-qe/README.md", QE_SENIOR_README],
174
181
  ["dev/tech-lead/README.md", DEV_TECH_LEAD_README],
175
182
  ["dev/senior-developer/README.md", DEV_SENIOR_README],
183
+ ["agents/README.md", AGENTS_README],
184
+ ["deploy/README.md", DEPLOY_README],
185
+ ["deploy/docker-compose.yml.template", DOCKER_COMPOSE_TEMPLATE],
186
+ ["deploy/k8s/deployment.yaml.template", K8S_DEPLOYMENT_TEMPLATE],
187
+ ["deploy/k8s/service.yaml.template", K8S_SERVICE_TEMPLATE],
188
+ ["deploy/k8s/ingress.yaml.template", K8S_INGRESS_TEMPLATE],
176
189
  ];
177
190
 
178
191
  for (const [rel, content] of files) {
@@ -195,10 +208,11 @@ globs: docs/sdlc/**/*, **/*.md
195
208
  3. **Architect** — ADRs, diagrams → docs/sdlc/architecture/
196
209
  4. **Technical BA** — API specs, team breakdown → docs/sdlc/ba/technical/
197
210
  5. **QE (docs)** — Test plan, test cases → docs/sdlc/qe/
198
- 6. **Dev** — Tech Lead (review, merge) + Senior Dev (implement, ≥90% unit test) → docs/sdlc/dev/{role}/
199
- 7. **QE (testing)** — Automation + manual tests, sign-off
200
- 8. **Deploy** — Release, monitor
211
+ 6. **Dev** — Sau bước tài liệu → **run implement ngay**. Tech Lead (review, merge) + Senior Dev (implement, ≥90% unit test) → docs/sdlc/dev/{role}/
212
+ 7. **QE (testing)** — QE Lead (test framework, review) + Senior QE (10+ yrs, automation) → docs/sdlc/qe/{role}/
213
+ 8. **Deploy** — Docker Compose + K8s → docs/sdlc/deploy/
201
214
 
215
+ **Mỗi role chạy bằng sub-agent.** Xem docs/sdlc/agents/
202
216
  Full workflow: docs/sdlc/SDLC-WORKFLOW.md
203
217
  `;
204
218
 
@@ -209,15 +223,16 @@ description: Multi-role SDLC workflow from user requirements through PO, Busines
209
223
 
210
224
  # SDLC Workflow (Multi-Role)
211
225
 
212
- Sequential workflow for approaching user requirements. Each phase produces docs/artifacts for the next. Apply when clarifying scope, breaking down features, or handing off between roles.
226
+ Sequential workflow; **mỗi role chạy bằng sub-agent**. Each phase produces docs/artifacts for the next. Sau khi hoàn thành triển khai với **Docker Compose** **K8s** (docs/sdlc/deploy/).
213
227
 
214
228
  ## Flow Overview
215
229
 
216
230
  \`\`\`
217
- User Request → PO → Business BA → Architect → Technical BA → QE (docs) → Dev → QE (testing) → Deploy
231
+ User Request → PO → Business BA → Architect → Technical BA → QE (docs) → Dev → QE (testing) → Deploy (Docker Compose + K8s)
218
232
  \`\`\`
219
233
 
220
234
  **Determine current phase** before acting. If unsure, ask: "Which phase are we in?"
235
+ **Sub-agent specs**: docs/sdlc/agents/
221
236
 
222
237
  ---
223
238
 
@@ -254,11 +269,11 @@ User Request → PO → Business BA → Architect → Technical BA → QE (docs)
254
269
 
255
270
  **Role**: Create test plan, test cases before Dev implements.
256
271
  **Deliverables**: Test plan, test cases.
257
- **Output**: \`docs/sdlc/qe/\` — Ready for Dev to start implementation.
272
+ **Output**: \`docs/sdlc/qe/\` — Hết bước tài liệu → **Dev team chạy implement ngay** (không chờ thêm).
258
273
 
259
274
  ## Phase 5b: Dev Teams
260
275
 
261
- **Trigger**: After QE docs complete. **Start implementation.**
276
+ **Trigger**: Sau khi xong tài liệu (Technical BA + QE docs). **Dev run implement luôn.**
262
277
 
263
278
  **Roles**:
264
279
  - **Tech Lead (15+ yrs)**: Decide tech stack, libraries; review & merge code. Docs: \`docs/sdlc/dev/tech-lead/\`
@@ -268,15 +283,22 @@ User Request → PO → Business BA → Architect → Technical BA → QE (docs)
268
283
 
269
284
  **Output**: Code + unit tests. **Handoff to QE (testing).**
270
285
 
271
- ## Phase 6: QE (Testing phase)
286
+ ## Phase 6: QE (Testing phase — automation)
272
287
 
273
288
  **Trigger**: After Dev completes unit tests.
274
- **Role**: Run tests, include **automation tests**, sign-off.
275
- **Output**: Test report. **Handoff to Deploy.**
289
+ **Role**: Write and run **automation tests**, sign-off.
290
+
291
+ **Roles**:
292
+ - **QE Lead**: Decide test framework; review test code. Docs: \`docs/sdlc/qe/qe-lead/\`
293
+ - **Senior QE (10+ yrs)**: Write automation tests. Docs: \`docs/sdlc/qe/senior-qe/\`
276
294
 
277
- ## Phase 7: Deploy & Maintenance
295
+ **Output**: Automation tests, test report. **Handoff to Deploy.**
278
296
 
279
- **Role**: Release, monitor, iterate.
297
+ ## Phase 7: Deploy
298
+
299
+ **Trigger**: After QE sign-off.
300
+ **Role**: Triển khai với **Docker Compose** (local/staging) và **Kubernetes** (production).
301
+ **Output**: \`docs/sdlc/deploy/\` — docker-compose.yml, k8s manifests. Deploy ngay sau khi hoàn thành pipeline.
280
302
 
281
303
  ## Quick Phase Checklist
282
304
 
@@ -289,9 +311,10 @@ User Request → PO → Business BA → Architect → Technical BA → QE (docs)
289
311
  | 4 | Technical BA | API specs, tech breakdown |
290
312
  | 5a | QE (docs) | Test plan, test cases |
291
313
  | 5b | Dev | Code, unit tests (≥90%) |
292
- | 6 | QE (testing) | Automation + manual, sign-off |
293
- | 7 | Ops | Deploy, monitor |
314
+ | 6 | QE (testing) | QE Lead + Senior QE, automation, sign-off |
315
+ | 7 | Deploy | Docker Compose + K8s |
294
316
 
317
+ **Sub-agents**: Mỗi role = 1 sub-agent (PO, Business BA, Architect, Technical BA, QE Lead, Senior QE, Tech Lead, Senior Dev). See docs/sdlc/agents/
295
318
  See reference.md for templates.
296
319
  `;
297
320
 
@@ -313,9 +336,19 @@ POST /api/v1/[resource] — Purpose, Request, Response, Contract
313
336
  ## QE: Test Case
314
337
  TC-001: [Scenario] — Precondition, Steps, Expected, Links to AC
315
338
 
339
+ ## QE Team
340
+ - QE Lead: test framework decision, review test code → docs/sdlc/qe/qe-lead/
341
+ - Senior QE (10+ yrs): write automation tests → docs/sdlc/qe/senior-qe/
342
+
316
343
  ## Dev Team
317
344
  - Tech Lead (15+ yrs): tech stack, libraries, review & merge → docs/sdlc/dev/tech-lead/
318
345
  - Senior Dev (10+ yrs): implement, Unit Test ≥90% → docs/sdlc/dev/senior-developer/
346
+
347
+ ## Sub-agents
348
+ Mỗi role = sub-agent. See docs/sdlc/agents/
349
+
350
+ ## Deploy
351
+ Sau khi hoàn thành → Docker Compose + K8s. See docs/sdlc/deploy/
319
352
  `;
320
353
 
321
354
  const AGENTS_MD_CONTENT = `## SDLC Workflow
@@ -327,12 +360,11 @@ When working on requirements, features, or handoffs, follow these phases:
327
360
  3. **Architect** — ADRs, diagrams → docs/sdlc/architecture/
328
361
  4. **Technical BA** — API specs, team breakdown → docs/sdlc/ba/technical/
329
362
  5. **QE (docs)** — Test plan, test cases → docs/sdlc/qe/
330
- 6. **Dev** — After QE docs: Tech Lead (15+ yrs, tech stack, review & merge) + Senior Dev (10+ yrs, implement, Unit Test ≥90%) → docs/sdlc/dev/{role}/
331
- 7. **QE (testing)** — After Dev unit tests: automation + manual, sign-off
332
- 8. **Deploy** — Release, monitor
363
+ 6. **Dev** — Sau bước tài liệu **run implement luôn**. Tech Lead + Senior Dev → docs/sdlc/dev/{role}/
364
+ 7. **QE (testing)** — QE Lead + Senior QE (automation)
365
+ 8. **Deploy** — Docker Compose + K8s → docs/sdlc/deploy/
333
366
 
334
- Flow: ... Technical BA QE docs Dev QE testing Deploy
335
- Ask "Which phase are we in?" if unclear.
367
+ Sau bước làm tài liệu thì cho team Dev run implement ngay. See docs/sdlc/agents/
336
368
  `;
337
369
 
338
370
  const CLAUDE_SDLC_CONTENT = `## SDLC Workflow
@@ -342,12 +374,11 @@ const CLAUDE_SDLC_CONTENT = `## SDLC Workflow
342
374
  3. **Architect** — ADRs, diagrams → docs/sdlc/architecture/
343
375
  4. **Technical BA** — API specs, team breakdown → docs/sdlc/ba/technical/
344
376
  5. **QE (docs)** — Test plan, test cases → docs/sdlc/qe/
345
- 6. **Dev** — After QE docs: Tech Lead (15+ yrs, tech stack, review & merge) + Senior Dev (10+ yrs, implement, Unit Test ≥90%) → docs/sdlc/dev/{role}/
346
- 7. **QE (testing)** — After Dev unit tests: automation + manual, sign-off
347
- 8. **Deploy** — Release, monitor
377
+ 6. **Dev** — Sau bước tài liệu **run implement luôn**. Tech Lead + Senior Dev → docs/sdlc/dev/{role}/
378
+ 7. **QE (testing)** — QE Lead + Senior QE (automation)
379
+ 8. **Deploy** — Docker Compose + K8s → docs/sdlc/deploy/
348
380
 
349
- Flow: ... Technical BA QE docs Dev QE testing Deploy
350
- Ask "Which phase are we in?" if unclear.
381
+ Sau bước làm tài liệu (Technical BA + QE docs) thì cho team Dev run implement ngay. See docs/sdlc/agents/
351
382
  `;
352
383
 
353
384
  const SDLC_WORKFLOW_MD = `# SDLC Workflow (Multi-Role)
@@ -372,8 +403,10 @@ User Request → PO → Business BA → Architect → Technical BA → QE (docs)
372
403
  | 4 | Technical BA | API specs, tech breakdown |
373
404
  | 5a | QE (docs) | Test plan, test cases |
374
405
  | 5b | Dev | Code, unit tests (≥90%) |
375
- | 6 | QE (testing) | Automation + manual, sign-off |
376
- | 7 | Ops | Deploy, monitor |
406
+ | 6 | QE (testing) | QE Lead + Senior QE, automation, sign-off |
407
+ | 7 | Deploy | Docker Compose + K8s |
408
+
409
+ **Sub-agents**: Mỗi role chạy bằng sub-agent (PO, Business BA, Architect, Technical BA, QE Lead, Senior QE, Tech Lead, Senior Dev). See docs/sdlc/agents/
377
410
 
378
411
  ## Phase Details
379
412
 
@@ -394,9 +427,9 @@ User Request → PO → Business BA → Architect → Technical BA → QE (docs)
394
427
  - Output: \`docs/sdlc/ba/technical/\`
395
428
 
396
429
  ### Phase 5a: QE (Docs)
397
- - Test plan, test cases — **before Dev implements**
430
+ - Test plan, test cases
398
431
  - Output: \`docs/sdlc/qe/\`
399
- - **Then**: Dev team starts implementation
432
+ - **Sau bước tài liệu → Dev team run implement luôn** (không chờ thêm)
400
433
 
401
434
  ### Phase 5b: Dev Teams
402
435
  - **Tech Lead (15+ yrs)**: Tech stack, libraries; review & merge. Output: \`docs/sdlc/dev/tech-lead/\`
@@ -404,11 +437,13 @@ User Request → PO → Business BA → Architect → Technical BA → QE (docs)
404
437
  - **Requirement**: Unit Test coverage **≥ 90%**
405
438
  - **Then**: QE starts testing phase
406
439
 
407
- ### Phase 6: QE (Testing)
408
- - After Dev unit tests complete: automation tests + manual tests, sign-off
440
+ ### Phase 6: QE (Testing — automation)
441
+ - **QE Lead**: Test framework decision; review test code. Output: \`docs/sdlc/qe/qe-lead/\`
442
+ - **Senior QE (10+ yrs)**: Write automation tests. Output: \`docs/sdlc/qe/senior-qe/\`
409
443
 
410
444
  ### Phase 7: Deploy
411
- - Release, monitor
445
+ - Sau khi hoàn thành pipeline → triển khai với **Docker Compose** (local/staging) và **Kubernetes** (production)
446
+ - Output: \`docs/sdlc/deploy/\` — docker-compose.yml, k8s/
412
447
 
413
448
  See [reference.md](./reference.md) for templates.
414
449
  `;
@@ -416,6 +451,111 @@ See [reference.md](./reference.md) for templates.
416
451
  const REFERENCE_MD = `# SDLC Workflow — Reference
417
452
 
418
453
  Templates and examples. Use \`*.template.md\` as starting points.
454
+ Sub-agents: docs/sdlc/agents/
455
+ Deploy: docs/sdlc/deploy/ (Docker Compose + K8s)
456
+ `;
457
+
458
+ const AGENTS_README = `# Sub-Agents
459
+
460
+ Mọi role trong SDLC chạy bằng **sub-agent**. Mỗi phase giao cho một sub-agent tương ứng.
461
+
462
+ | Role | Sub-agent | Input | Output |
463
+ |------|-----------|--------|--------|
464
+ | PO | po | User request | docs/sdlc/po/ |
465
+ | Business BA | business-ba | docs/sdlc/po/ | docs/sdlc/ba/business/ |
466
+ | Architect | architect | docs/sdlc/ba/business/ | docs/sdlc/architecture/ |
467
+ | Technical BA | technical-ba | docs/sdlc/architecture/ | docs/sdlc/ba/technical/ |
468
+ | QE (docs) | qe-docs | docs/sdlc/ba/technical/ | docs/sdlc/qe/ (test plan) |
469
+ | Tech Lead | tech-lead | Technical spec | Review, merge, docs/sdlc/dev/tech-lead/ |
470
+ | Senior Dev | senior-dev | Spec + test plan | **Sau tài liệu → run implement ngay**. Code, unit tests (≥90%) |
471
+ | QE Lead | qe-lead | Test plan | Test framework, review, docs/sdlc/qe/qe-lead/ |
472
+ | Senior QE | senior-qe | Test plan + framework | Automation tests, docs/sdlc/qe/senior-qe/ |
473
+ | Deploy | deploy | QE sign-off | Docker Compose + K8s, docs/sdlc/deploy/ |
474
+
475
+ Orchestrator: chạy từng sub-agent theo thứ tự; handoff output → input của sub-agent tiếp theo.
476
+ `;
477
+
478
+ const DEPLOY_README = `# Deploy
479
+
480
+ Sau khi hoàn thành pipeline (QE sign-off), triển khai ngay với:
481
+
482
+ - **Docker Compose** — local / staging: \`docker compose up -d\`
483
+ - **Kubernetes** — production: \`kubectl apply -f k8s/\`
484
+
485
+ ## Files
486
+
487
+ - \`docker-compose.yml.template\` — copy thành \`docker-compose.yml\`, chỉnh image/env
488
+ - \`k8s/deployment.yaml.template\` — Deployment
489
+ - \`k8s/service.yaml.template\` — Service
490
+ - \`k8s/ingress.yaml.template\` — Ingress (optional)
491
+ `;
492
+
493
+ const DOCKER_COMPOSE_TEMPLATE = `# Copy to docker-compose.yml and adjust image, env, ports
494
+ services:
495
+ app:
496
+ image: your-registry/your-app:latest
497
+ build: .
498
+ ports:
499
+ - "8080:8080"
500
+ environment:
501
+ - NODE_ENV=production
502
+ restart: unless-stopped
503
+ `;
504
+
505
+ const K8S_DEPLOYMENT_TEMPLATE = `# deployment.yaml - adjust name, image, replicas
506
+ apiVersion: apps/v1
507
+ kind: Deployment
508
+ metadata:
509
+ name: app
510
+ spec:
511
+ replicas: 2
512
+ selector:
513
+ matchLabels:
514
+ app: app
515
+ template:
516
+ metadata:
517
+ labels:
518
+ app: app
519
+ spec:
520
+ containers:
521
+ - name: app
522
+ image: your-registry/your-app:latest
523
+ ports:
524
+ - containerPort: 8080
525
+ `;
526
+
527
+ const K8S_SERVICE_TEMPLATE = `# service.yaml
528
+ apiVersion: v1
529
+ kind: Service
530
+ metadata:
531
+ name: app
532
+ spec:
533
+ selector:
534
+ app: app
535
+ ports:
536
+ - port: 80
537
+ targetPort: 8080
538
+ type: ClusterIP
539
+ `;
540
+
541
+ const K8S_INGRESS_TEMPLATE = `# ingress.yaml - optional, adjust host
542
+ apiVersion: networking.k8s.io/v1
543
+ kind: Ingress
544
+ metadata:
545
+ name: app
546
+ spec:
547
+ ingressClassName: nginx
548
+ rules:
549
+ - host: app.example.com
550
+ http:
551
+ paths:
552
+ - path: /
553
+ pathType: Prefix
554
+ backend:
555
+ service:
556
+ name: app
557
+ port:
558
+ number: 80
419
559
  `;
420
560
 
421
561
  const PO_EPIC_TEMPLATE = `# Epic: [Name]
@@ -537,12 +677,34 @@ const QE_TC_TEMPLATE = `## TC-001: [Scenario]
537
677
  const QE_README = `# QE (Quality Engineering)
538
678
 
539
679
  Two phases:
540
- 1. **Docs phase** — Test plan, test cases (before Dev implements). Output ready for Dev team.
541
- 2. **Testing phase** — After Dev completes unit tests: run tests, include automation tests, sign-off.
680
+ 1. **Docs phase** — Test plan, test cases. Xong → **Dev run implement luôn**.
681
+ 2. **Testing phase** — Sau khi Dev xong unit tests: QE team viết automation tests.
682
+ - **QE Lead**: Decide test framework; review test code → docs/sdlc/qe/qe-lead/
683
+ - **Senior QE (10+ yrs)**: Write automation tests → docs/sdlc/qe/senior-qe/
542
684
 
543
685
  Use test-case.template.md for test cases.
544
686
  `;
545
687
 
688
+ const QE_LEAD_README = `# QE Lead
689
+
690
+ **Responsibilities**:
691
+ - Decide test framework (e.g. Playwright, Cypress, Jest, etc.)
692
+ - Review test code
693
+ - Ensure automation quality and coverage
694
+
695
+ **Docs**: Test framework ADR, review checklist.
696
+ `;
697
+
698
+ const QE_SENIOR_README = `# Senior QE (10+ years exp)
699
+
700
+ **Responsibilities**:
701
+ - Write automation tests per test plan
702
+ - Implement E2E, integration, regression tests
703
+ - Follow QE Lead's framework decisions
704
+
705
+ **Docs**: Automation test design, framework usage.
706
+ `;
707
+
546
708
  const DEV_TECH_LEAD_README = `# Tech Lead (15+ years exp)
547
709
 
548
710
  **Responsibilities**:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sdlc-workflow",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Scaffold SDLC workflow docs and templates for Cursor, Claude, and dev teams",
5
5
  "type": "module",
6
6
  "bin": {