sdlc-workflow 1.0.4 → 1.0.6

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 +1 -0
  2. package/bin/cli.js +174 -25
  3. package/package.json +3 -2
package/README.md CHANGED
@@ -8,6 +8,7 @@ Scaffold SDLC workflow docs and templates into your project. Works with **Cursor
8
8
  User Request → PO → Business BA → Architect → Technical BA → QE (docs) → Dev → QE (testing) → Deploy (Docker Compose + K8s)
9
9
  ```
10
10
 
11
+ - **Trigger:** When you send an **idea** or **feature request**, the agent should run the **full pipeline** (PO → … → Deploy) in sequence, one sub-agent/role per phase — not handle everything in one go or stop after one phase. See `docs/sdlc/ORCHESTRATION.md`.
11
12
  - **Each role runs as a sub-agent** (see `docs/sdlc/agents/`).
12
13
  - **After completion** → deploy immediately with **Docker Compose** (local/staging) and **Kubernetes** (production) — `docs/sdlc/deploy/`.
13
14
  - **QE (docs)**: Test plan, test cases
package/bin/cli.js CHANGED
@@ -164,6 +164,7 @@ async function generateFromInline(cwd) {
164
164
 
165
165
  const files = [
166
166
  ["SDLC-WORKFLOW.md", SDLC_WORKFLOW_MD],
167
+ ["ORCHESTRATION.md", ORCHESTRATION_MD],
167
168
  ["reference.md", REFERENCE_MD],
168
169
  ["po/epic-brief.template.md", PO_EPIC_TEMPLATE],
169
170
  ["po/README.md", PO_README],
@@ -196,13 +197,15 @@ async function generateFromInline(cwd) {
196
197
  }
197
198
 
198
199
  const CURSOR_RULE_CONTENT = `---
199
- description: SDLC multi-role workflow (PO BA Architect Tech BA → QE docs → Dev → QE testing)
200
+ description: SDLC multi-role workflow; on idea/request trigger pipeline through deployment (sub-agent per phase)
200
201
  alwaysApply: false
201
202
  globs: docs/sdlc/**/*, **/*.md
202
203
  ---
203
204
 
204
205
  # SDLC Workflow
205
206
 
207
+ **On idea/feature request:** Trigger full pipeline (PO → … → Deploy). One sub-agent per phase; run phases in sequence without stopping. See docs/sdlc/SDLC-WORKFLOW.md and docs/sdlc/agents/.
208
+
206
209
  1. **PO** — PRD, user stories → docs/sdlc/po/
207
210
  2. **Business BA** — FRS, process flows → docs/sdlc/ba/business/
208
211
  3. **Architect** — ADRs, diagrams → docs/sdlc/architecture/
@@ -218,21 +221,30 @@ Full workflow: docs/sdlc/SDLC-WORKFLOW.md
218
221
 
219
222
  const CURSOR_SKILL_MD = `---
220
223
  name: sdlc-workflow
221
- description: Multi-role SDLC workflow from user requirements through PO, Business BA, Architect, Technical BA, Dev teams, and QE. Use when user mentions SDLC, requirements, PO, BA, Architect, technical spec, phased development, or handoff between roles.
224
+ description: Multi-role SDLC workflow from user requirements through PO, Business BA, Architect, Technical BA, Dev teams, and QE. Use when user sends an idea, feature request, or requirement — trigger full pipeline through deployment. Use when user mentions SDLC, requirements, PO, BA, Architect, technical spec, phased development, or handoff between roles.
222
225
  ---
223
226
 
224
227
  # SDLC Workflow (Multi-Role)
225
228
 
226
229
  Sequential workflow; **each role runs as a sub-agent**. Each phase produces docs/artifacts for the next. After completion → deploy with **Docker Compose** and **K8s** (docs/sdlc/deploy/).
227
230
 
231
+ ## Trigger and orchestration (mandatory)
232
+
233
+ **When the user sends an idea, feature request, or new requirement:**
234
+ 1. **Do not** handle it with the main agent only. **Trigger the pipeline** and run it **continuously through deployment** (Phase 1 → 2 → … → 7).
235
+ 2. **Per phase = one sub-agent (one role).** For each phase, act only as that role, produce that phase's outputs into the correct folder, then **continue immediately to the next phase** without waiting for the user.
236
+ 3. **Run in order:** PO → Business BA → Architect → Technical BA → QE (docs) → Dev → QE (testing) → Deploy. Do not stop after one phase unless the user explicitly asks to stop.
237
+ 4. If the platform supports **sub-agents**, spawn one sub-agent per phase and pass the previous phase's output as input. If not, the main agent must **simulate** by executing each phase in sequence and writing artifacts to docs/sdlc/... then proceeding.
238
+
239
+ **Sub-agent specs**: docs/sdlc/agents/
240
+
228
241
  ## Flow Overview
229
242
 
230
243
  \`\`\`
231
244
  User Request → PO → Business BA → Architect → Technical BA → QE (docs) → Dev → QE (testing) → Deploy (Docker Compose + K8s)
232
245
  \`\`\`
233
246
 
234
- **Determine current phase** before acting. If unsure, ask: "Which phase are we in?"
235
- **Sub-agent specs**: docs/sdlc/agents/
247
+ **Determine current phase** before acting. If user sent an idea, assume Phase 0 and start from Phase 1.
236
248
 
237
249
  ---
238
250
 
@@ -353,6 +365,8 @@ After completion → Docker Compose + K8s. See docs/sdlc/deploy/
353
365
 
354
366
  const AGENTS_MD_CONTENT = `## SDLC Workflow
355
367
 
368
+ **Trigger:** When the user sends an **idea**, **feature request**, or **requirement**, run the full pipeline (Phase 1 → 7) in sequence. One role (sub-agent) per phase; produce outputs then continue to the next. Do not stop after one phase until deployment unless the user asks to stop.
369
+
356
370
  When working on requirements, features, or handoffs, follow these phases:
357
371
 
358
372
  1. **PO** — PRD, user stories → docs/sdlc/po/
@@ -369,6 +383,8 @@ After the docs phase, the Dev team runs implementation immediately. See docs/sdl
369
383
 
370
384
  const CLAUDE_SDLC_CONTENT = `## SDLC Workflow
371
385
 
386
+ **Trigger on idea:** When the user sends an idea, feature request, or requirement, run the pipeline continuously: Phase 1 (PO) → 2 → … → 7 (Deploy). One sub-agent/role per phase; do not handle the whole flow as the main agent only. Do not stop after one phase unless the user asks.
387
+
372
388
  1. **PO** — PRD, user stories → docs/sdlc/po/
373
389
  2. **Business BA** — FRS, process flows → docs/sdlc/ba/business/
374
390
  3. **Architect** — ADRs, diagrams → docs/sdlc/architecture/
@@ -386,6 +402,12 @@ const SDLC_WORKFLOW_MD = `# SDLC Workflow (Multi-Role)
386
402
  Use this doc with **Claude** (copy to Custom Instructions / Projects) or **@ mention** in chat.
387
403
  For Cursor, see .cursor/rules/sdlc-workflow.mdc
388
404
 
405
+ ## Trigger and orchestration
406
+
407
+ - **When the user sends an idea, feature request, or requirement:** Start the pipeline and run it **continuously through deployment** (Phase 1 → 2 → … → 7). Do not handle everything in one main-agent response.
408
+ - **One sub-agent (role) per phase:** Execute each phase as that role only; write artifacts to the right folder; then **continue to the next phase** without waiting. If the tool supports sub-agents, spawn one per phase; otherwise the main agent runs each phase in sequence.
409
+ - **Do not stop** after PO or any single phase unless the user explicitly asks to stop. Run through to Deploy.
410
+
389
411
  ## Flow
390
412
 
391
413
  \`\`\`
@@ -448,9 +470,38 @@ User Request → PO → Business BA → Architect → Technical BA → QE (docs)
448
470
  See [reference.md](./reference.md) for templates.
449
471
  `;
450
472
 
473
+ const ORCHESTRATION_MD = `# Pipeline orchestration
474
+
475
+ ## Trigger
476
+
477
+ When the user sends an **idea**, **feature request**, or **requirement** (e.g. "I want a login page", "We need an API for X"):
478
+
479
+ 1. **Do not** answer with the main agent only (e.g. one reply that does a bit of everything).
480
+ 2. **Trigger the full pipeline** and run **Phase 1 → 2 → … → 7 in sequence**.
481
+ 3. **One role (sub-agent) per phase:** For each phase, act only as that role, write outputs to the correct \`docs/sdlc/...\` folder, then **continue to the next phase** without asking the user to "run next step".
482
+ 4. **Run through to Deploy.** Do not stop after PO, BA, or Dev unless the user explicitly says to stop.
483
+
484
+ ## How to run (by platform)
485
+
486
+ - **If the tool has sub-agents:** Spawn one sub-agent per phase; pass previous phase output as input; run in order.
487
+ - **If only one agent:** Simulate by executing Phase 1 (PO) → write \`docs/sdlc/po/...\` → then Phase 2 (Business BA) → … → Phase 7 (Deploy). One continuous run or explicit "Phase 1 done, starting Phase 2" steps.
488
+
489
+ ## Checklist per run
490
+
491
+ - [ ] Phase 1 PO: artifacts in \`docs/sdlc/po/\`
492
+ - [ ] Phase 2 Business BA: \`docs/sdlc/ba/business/\`
493
+ - [ ] Phase 3 Architect: \`docs/sdlc/architecture/\`
494
+ - [ ] Phase 4 Technical BA: \`docs/sdlc/ba/technical/\`
495
+ - [ ] Phase 5a QE docs: \`docs/sdlc/qe/\`
496
+ - [ ] Phase 5b Dev: code + unit tests, \`docs/sdlc/dev/\`
497
+ - [ ] Phase 6 QE testing: automation, sign-off
498
+ - [ ] Phase 7 Deploy: \`docs/sdlc/deploy/\`, Docker Compose + K8s
499
+ `;
500
+
451
501
  const REFERENCE_MD = `# SDLC Workflow — Reference
452
502
 
453
503
  Templates and examples. Use \`*.template.md\` as starting points.
504
+ Templates are written for all project types: web, mobile, API-only, library/SDK, CLI, data/ML, platform/infra.
454
505
  Sub-agents: docs/sdlc/agents/
455
506
  Deploy: docs/sdlc/deploy/ (Docker Compose + K8s)
456
507
  `;
@@ -473,6 +524,8 @@ Every role in the SDLC runs as a **sub-agent**. Each phase is assigned to a corr
473
524
  | Deploy | deploy | QE sign-off | Docker Compose + K8s, docs/sdlc/deploy/ |
474
525
 
475
526
  Orchestrator: run each sub-agent in order; hand off output → input of the next sub-agent.
527
+
528
+ **Trigger:** On user idea/request, run the full pipeline (see docs/sdlc/ORCHESTRATION.md). Do not run the whole flow as the main agent only; do not stop after one phase until Deploy unless the user asks.
476
529
  `;
477
530
 
478
531
  const DEPLOY_README = `# Deploy
@@ -490,7 +543,8 @@ After the pipeline completes (QE sign-off), deploy immediately with:
490
543
  - \`k8s/ingress.yaml.template\` — Ingress (optional)
491
544
  `;
492
545
 
493
- const DOCKER_COMPOSE_TEMPLATE = `# Copy to docker-compose.yml and adjust image, env, ports
546
+ const DOCKER_COMPOSE_TEMPLATE = `# Copy to docker-compose.yml and adjust image, env, ports.
547
+ # Single service (API, CLI, app) or add more services (api, worker, frontend, db) as needed.
494
548
  services:
495
549
  app:
496
550
  image: your-registry/your-app:latest
@@ -500,9 +554,13 @@ services:
500
554
  environment:
501
555
  - NODE_ENV=production
502
556
  restart: unless-stopped
557
+ # Optional: add worker, frontend, db, etc.
558
+ # worker:
559
+ # image: your-registry/worker:latest
560
+ # depends_on: [app]
503
561
  `;
504
562
 
505
- const K8S_DEPLOYMENT_TEMPLATE = `# deployment.yaml - adjust name, image, replicas
563
+ const K8S_DEPLOYMENT_TEMPLATE = `# deployment.yaml adjust name, image, replicas. Duplicate for multi-service (api, worker, etc.).
506
564
  apiVersion: apps/v1
507
565
  kind: Deployment
508
566
  metadata:
@@ -560,6 +618,9 @@ spec:
560
618
 
561
619
  const PO_EPIC_TEMPLATE = `# Epic: [Name]
562
620
 
621
+ ## Project type
622
+ [Web app | Mobile app | API/backend only | Library/SDK | CLI/tool | Data/ML | Platform/infra | Mixed — pick one or describe]
623
+
563
624
  ## Problem
564
625
  [What problem are we solving?]
565
626
 
@@ -567,8 +628,11 @@ const PO_EPIC_TEMPLATE = `# Epic: [Name]
567
628
  - [Metric 1]
568
629
  - [Metric 2]
569
630
 
570
- ## User Stories
571
- 1. As [persona], I want [action] so that [benefit].
631
+ ## User Stories (or equivalent)
632
+ - **Web/Mobile**: As [persona], I want [action] so that [benefit].
633
+ - **API/Library**: As [consumer/integrator], I need [capability] so that [outcome].
634
+ - **CLI/Internal**: As [operator/developer], I run [command/workflow] to [result].
635
+ 1. ...
572
636
  2. ...
573
637
 
574
638
  ## Acceptance Criteria (High-level)
@@ -590,9 +654,11 @@ Use epic-brief.template.md as starting point.
590
654
 
591
655
  const BA_FR_TEMPLATE = `## FR-001: [Title]
592
656
 
657
+ **Type**: [Feature | API/Contract | Data/Report | Compliance | Non-functional — pick one]
658
+
593
659
  **Description**: [What the system must do]
594
660
 
595
- **Trigger**: [When does this apply?]
661
+ **Trigger**: [When does this apply? — e.g. user action, API call, schedule, event]
596
662
 
597
663
  **Process Flow**:
598
664
  1. Step 1
@@ -602,6 +668,9 @@ const BA_FR_TEMPLATE = `## FR-001: [Title]
602
668
  **Output**: [Result]
603
669
 
604
670
  **Constraints**: [Compliance, SLA, etc.]
671
+
672
+ ---
673
+ *Use for any project type: product feature (UI/API), library behaviour, CLI behaviour, data pipeline, or platform capability.*
605
674
  `;
606
675
 
607
676
  const BA_BUSINESS_README = `# Business BA
@@ -610,38 +679,113 @@ Functional requirements, process flows, use cases.
610
679
  Use functional-requirement.template.md for FRS items.
611
680
  `;
612
681
 
613
- const TECH_API_TEMPLATE = `## POST /api/v1/[resource]
682
+ const TECH_API_TEMPLATE = `# Interface / contract spec
614
683
 
684
+ Use the section that matches your project. Delete the rest.
685
+
686
+ ---
687
+
688
+ ## HTTP API (backend, BFF, webhooks)
689
+ ### POST /api/v1/[resource]
615
690
  **Purpose**: [One-line]
691
+ **Request**: Body (JSON schema), Headers (Auth, Content-Type)
692
+ **Response**: 200 payload, 4xx/5xx error format
693
+ **Contract**: OpenAPI spec
694
+
695
+ ### GET /api/v1/[resource] (add other methods as needed)
696
+ **Purpose**: ...
697
+ **Query params**: ...
698
+ **Response**: ...
616
699
 
617
- **Request**:
618
- - Body: JSON schema
619
- - Headers: Auth, Content-Type
700
+ ---
620
701
 
621
- **Response**:
622
- - 200: Success payload
623
- - 4xx/5xx: Error format
702
+ ## Library / SDK (public API surface)
703
+ ### Module/Class: [Name]
704
+ **Purpose**: [One-line]
705
+ **Input**: [Params, types]
706
+ **Output**: [Return type, behaviour]
707
+ **Contract**: TS types / JSDoc / docstring
624
708
 
625
- **Contract**: See OpenAPI spec
709
+ ---
710
+
711
+ ## CLI (commands, flags)
712
+ ### Command: \`[cmd] [sub] [flags]\`
713
+ **Purpose**: [One-line]
714
+ **Args**: [positional]
715
+ **Flags**: [--opt, env vars]
716
+ **Exit codes**: 0 success, non-zero errors
717
+ **Contract**: \`--help\` output / man page
626
718
  `;
627
719
 
628
- const TECH_TEAM_TEMPLATE = `| Team | Scope | Dependencies |
629
- |---------|--------------------------|------------------------|
630
- | Backend | API, DB, business logic | Technical spec |
631
- | Frontend| UI, API integration | API contract |
632
- | Mobile | App UI, API integration | API contract |
720
+ const TECH_TEAM_TEMPLATE = `# Team breakdown
721
+
722
+ Use only the rows that apply to your project. Remove or leave blank unused teams.
723
+
724
+ ## By project type
725
+
726
+ ### Web / full‑stack (UI + API)
727
+ | Team | Scope | Dependencies |
728
+ |----------|--------------------------------|-------------------|
729
+ | Backend | API, DB, business logic | Technical spec |
730
+ | Frontend | Web UI, API integration | API contract |
731
+
732
+ ### Mobile
733
+ | Team | Scope | Dependencies |
734
+ |----------|--------------------------------|-------------------|
735
+ | Backend | API, DB, business logic | Technical spec |
736
+ | Mobile | App UI (iOS / Android / cross-platform), API integration | API contract |
737
+
738
+ ### API / backend only (no UI)
739
+ | Team | Scope | Dependencies |
740
+ |----------|--------------------------------|-------------------|
741
+ | Backend | API, DB, business logic, workers | Technical spec |
742
+
743
+ ### Library / SDK
744
+ | Team | Scope | Dependencies |
745
+ |----------|--------------------------------|-------------------|
746
+ | Core | Library/SDK implementation, public API | Technical spec |
747
+ | Bindings | Language bindings, wrappers (optional) | Core API spec |
748
+
749
+ ### CLI / tooling
750
+ | Team | Scope | Dependencies |
751
+ |----------|--------------------------------|-------------------|
752
+ | CLI | CLI app, commands, config | Technical spec |
753
+
754
+ ### Data / ML / analytics
755
+ | Team | Scope | Dependencies |
756
+ |----------|--------------------------------|-------------------|
757
+ | Backend | APIs, pipelines, storage | Technical spec |
758
+ | Data/ML | Models, ETL, analytics, reporting | Data spec, API contract |
759
+
760
+ ### DevOps / platform / infra
761
+ | Team | Scope | Dependencies |
762
+ |----------|--------------------------------|-------------------|
763
+ | Platform | Infra, CI/CD, observability | Technical spec |
764
+ | Backend | APIs, services (if any) | Technical spec |
765
+
766
+ ### Mixed (pick and combine)
767
+ | Team | Scope | Dependencies |
768
+ |----------|--------------------------------|-------------------|
769
+ | Backend | API, DB, business logic | Technical spec |
770
+ | Frontend | Web UI, API integration | API contract |
771
+ | Mobile | App UI, API integration | API contract |
772
+ | Data/ML | Models, ETL, analytics | Data spec, API |
773
+ | Platform | Infra, CI/CD, deploy | Technical spec |
633
774
  `;
634
775
 
635
776
  const BA_TECH_README = `# Technical BA
636
777
 
637
- API specs, DB schema, team breakdown.
638
- Use templates as starting points.
778
+ API/interface specs, DB schema, team breakdown.
779
+ Templates support: HTTP API, library/SDK, CLI, and all project types (see api-spec and team-breakdown).
639
780
  `;
640
781
 
641
782
  const ARCH_ADR_TEMPLATE = `# ADR-001: [Decision Title]
642
783
 
643
784
  ## Status
644
- Accepted
785
+ [Proposed | Accepted | Deprecated | Superseded by ADR-xxx]
786
+
787
+ ## Scope
788
+ [backend | frontend | mobile | library | CLI | data/ML | platform/infra | cross-cutting — one or more]
645
789
 
646
790
  ## Context
647
791
  [Why we need this decision]
@@ -662,6 +806,8 @@ Use adr.template.md for new ADRs.
662
806
 
663
807
  const QE_TC_TEMPLATE = `## TC-001: [Scenario]
664
808
 
809
+ **Type**: [API | UI/E2E | Unit | Contract | CLI | Data/Regression — pick one]
810
+
665
811
  **Precondition**: [State before test]
666
812
 
667
813
  **Steps**:
@@ -672,6 +818,9 @@ const QE_TC_TEMPLATE = `## TC-001: [Scenario]
672
818
  **Expected**: [Expected result]
673
819
 
674
820
  **Links to**: AC-001, Story #42
821
+
822
+ ---
823
+ *API: send request, assert status/body. UI: interact, assert DOM/visibility. CLI: run command, assert stdout/exit code. Contract: consumer/provider expectations.*
675
824
  `;
676
825
 
677
826
  const QE_README = `# QE (Quality Engineering)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sdlc-workflow",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Scaffold SDLC workflow docs and templates for Cursor, Claude, and dev teams",
5
5
  "type": "module",
6
6
  "bin": {
@@ -19,7 +19,8 @@
19
19
  "author": "",
20
20
  "license": "MIT",
21
21
  "files": [
22
- "bin"
22
+ "bin",
23
+ "README.md"
23
24
  ],
24
25
  "engines": {
25
26
  "node": ">=18"