@capagents/forgeqe 3.3.1 → 3.3.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/HOW_TO_USE.md +337 -8
- package/dist/docs-site/docs/area-operations/index.html +126 -2
- package/dist/docs-site/docs/area-quality/index.html +159 -3
- package/dist/docs-site/docs/area-setup/index.html +1 -0
- package/dist/docs-site/docs/area-test-cases/index.html +25 -0
- package/dist/docs-site/docs/overview/index.html +2 -2
- package/dist/docs-site/docs/search.js +1 -1
- package/dist/forgeqe.js +2159 -1928
- package/dist/requirement-agent/requirements_agent/__init__.py +3 -0
- package/dist/requirement-agent/requirements_agent/__main__.py +5 -0
- package/dist/requirement-agent/requirements_agent/agent.py +363 -0
- package/dist/requirement-agent/requirements_agent/chat_session.py +424 -0
- package/dist/requirement-agent/requirements_agent/cli.py +870 -0
- package/dist/requirement-agent/requirements_agent/config.py +403 -0
- package/dist/requirement-agent/requirements_agent/console_ui.py +632 -0
- package/dist/requirement-agent/requirements_agent/context/__init__.py +3 -0
- package/dist/requirement-agent/requirements_agent/context/aggregate.py +214 -0
- package/dist/requirement-agent/requirements_agent/context/base.py +14 -0
- package/dist/requirement-agent/requirements_agent/context/folder.py +107 -0
- package/dist/requirement-agent/requirements_agent/context/given.py +70 -0
- package/dist/requirement-agent/requirements_agent/context/graph.py +181 -0
- package/dist/requirement-agent/requirements_agent/context/knowledge.py +192 -0
- package/dist/requirement-agent/requirements_agent/context/mcp.py +24 -0
- package/dist/requirement-agent/requirements_agent/context/memory.py +144 -0
- package/dist/requirement-agent/requirements_agent/context/personas.py +214 -0
- package/dist/requirement-agent/requirements_agent/context/rag.py +148 -0
- package/dist/requirement-agent/requirements_agent/context/untrusted.py +56 -0
- package/dist/requirement-agent/requirements_agent/docs/HOW_TO_USE.md +505 -0
- package/dist/requirement-agent/requirements_agent/docs/requirements-agent-architecture.html +348 -0
- package/dist/requirement-agent/requirements_agent/docs_cmd.py +51 -0
- package/dist/requirement-agent/requirements_agent/export/__init__.py +3 -0
- package/dist/requirement-agent/requirements_agent/export/markdown.py +55 -0
- package/dist/requirement-agent/requirements_agent/export/pdf.py +82 -0
- package/dist/requirement-agent/requirements_agent/export/requirements_json.py +120 -0
- package/dist/requirement-agent/requirements_agent/init_cmd.py +191 -0
- package/dist/requirement-agent/requirements_agent/llm/__init__.py +3 -0
- package/dist/requirement-agent/requirements_agent/llm/base.py +49 -0
- package/dist/requirement-agent/requirements_agent/llm/copilot.py +171 -0
- package/dist/requirement-agent/requirements_agent/llm/mock.py +144 -0
- package/dist/requirement-agent/requirements_agent/llm/providers.py +277 -0
- package/dist/requirement-agent/requirements_agent/llm/router.py +35 -0
- package/dist/requirement-agent/requirements_agent/models.py +73 -0
- package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/agents/analyst.md +29 -0
- package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/agents/architect.md +28 -0
- package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/agents/bmad-orchestrator.md +26 -0
- package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/agents/dev.md +27 -0
- package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/agents/pm.md +27 -0
- package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/agents/po.md +27 -0
- package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/agents/qa.md +28 -0
- package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/agents/sm.md +26 -0
- package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/checklists/spec-circuit-analyst.md +8 -0
- package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/checklists/spec-circuit-architect.md +11 -0
- package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/checklists/spec-circuit-dev.md +11 -0
- package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/checklists/spec-circuit-orchestrator.md +9 -0
- package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/checklists/spec-circuit-pm.md +9 -0
- package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/checklists/spec-circuit-po.md +10 -0
- package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/checklists/spec-circuit-qa.md +11 -0
- package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/checklists/spec-circuit-sm.md +8 -0
- package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/data/bmad-kb.md +19 -0
- package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/data/requirements-standards-baseline.md +188 -0
- package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/data/technical-preferences.md +54 -0
- package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/utils/template-format.md +7 -0
- package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/workflows/greenfield-fullstack.yml +177 -0
- package/dist/requirement-agent/requirements_agent/pipeline/__init__.py +3 -0
- package/dist/requirement-agent/requirements_agent/pipeline/brd.py +86 -0
- package/dist/requirement-agent/requirements_agent/pipeline/pack.py +233 -0
- package/dist/requirement-agent/requirements_agent/pipeline/progress.py +60 -0
- package/dist/requirement-agent/requirements_agent/pipeline/prompts.py +150 -0
- package/dist/requirement-agent/requirements_agent/pipeline/quality.py +124 -0
- package/dist/requirement-agent/requirements_agent/pipeline/refine.py +386 -0
- package/dist/requirement-agent/requirements_agent/pipeline/sections.py +117 -0
- package/dist/requirement-agent/requirements_agent/pipeline/spec_circuit.py +142 -0
- package/dist/requirement-agent/requirements_agent/shell/__init__.py +7 -0
- package/dist/requirement-agent/requirements_agent/shell/actions.py +208 -0
- package/dist/requirement-agent/requirements_agent/shell/app.py +902 -0
- package/dist/requirement-agent/requirements_agent/shell/commands.py +206 -0
- package/dist/requirement-agent/requirements_agent/shell/progress_pane.py +114 -0
- package/dist/requirement-agent/requirements_agent/shell/ref_picker.py +59 -0
- package/dist/requirement-agent/requirements_agent/shell/refs.py +120 -0
- package/dist/requirement-agent/requirements_agent/shell/session.py +362 -0
- package/dist/requirement-agent/requirements_agent/shell/transcript.py +241 -0
- package/dist/requirement-agent/requirements_agent/shell/usage.py +64 -0
- package/dist/requirement-agent/requirements_agent/shell/usage_llm.py +64 -0
- package/dist/requirement-agent/requirements_agent/shell/worker.py +378 -0
- package/dist/requirement-agent/requirements_agent/tuios_hook.py +182 -0
- package/dist/requirement-agent/requirements_agent/webops.py +627 -0
- package/dist/template.html +67 -67
- package/dist/web/assets/{3d-force-graph-Df2wOlpF.js → 3d-force-graph-KUdc_88B.js} +3 -3
- package/dist/web/assets/Agent-Bd54dLhD.js +10 -0
- package/dist/web/assets/AgentWork-CqMhsFBP.js +2 -0
- package/dist/web/assets/ApiTests-BO_sKAg8.js +15 -0
- package/dist/web/assets/Browse-BjPPdirz.js +1 -0
- package/dist/web/assets/Chat-DO-UvDWX.js +3 -0
- package/dist/web/assets/CommandPalette-BBGtkkz4.js +1 -0
- package/dist/web/assets/Compare-BFuLcrBB.js +1 -0
- package/dist/web/assets/Cost-DbKrBm9m.js +1 -0
- package/dist/web/assets/{Data-Be3ZNkUu.js → Data-B6_6Rm7C.js} +4 -4
- package/dist/web/assets/Desktop-CnBxMp68.js +1 -0
- package/dist/web/assets/DesktopReview-DVITz4Jv.js +2 -0
- package/dist/web/assets/DeviceScreen-BHmTd9Q-.js +1 -0
- package/dist/web/assets/Evidence-BZx9UF1t.js +1 -0
- package/dist/web/assets/{Explore-AtSStzNg.js → Explore-Kkl9koqy.js} +2 -2
- package/dist/web/assets/Features-_WrrIGBz.js +1 -0
- package/dist/web/assets/{Flags-GxmNrnSn.js → Flags-BGqG09qD.js} +2 -2
- package/dist/web/assets/Flaky-B7mr96H8.js +1 -0
- package/dist/web/assets/Impact-DzAtWie1.js +3 -0
- package/dist/web/assets/Jobs-YSmfG7C9.js +5 -0
- package/dist/web/assets/KindPage-UqU2qh63.js +6 -0
- package/dist/web/assets/LiveDevice-jFCQ_zeU.js +1 -0
- package/dist/web/assets/Migration-CfHZeobD.js +8 -0
- package/dist/web/assets/Mobile-DTMPjWeO.js +1 -0
- package/dist/web/assets/Observability-B-9cikxK.js +1 -0
- package/dist/web/assets/OwnItems-BC9M20At.js +5 -0
- package/dist/web/assets/PageAgent-CvV8gwuP.js +1 -0
- package/dist/web/assets/Product-lDXsflpD.js +6 -0
- package/dist/web/assets/Production-BHXWX-ww.js +1 -0
- package/dist/web/assets/Quality-Bsljiu_v.js +1 -0
- package/dist/web/assets/Readiness-BZppEirK.js +1 -0
- package/dist/web/assets/Record-7h0EFEiJ.js +1 -0
- package/dist/web/assets/Regression-DdM66t2E.js +5 -0
- package/dist/web/assets/RelationGraph-CBY9FhUu.js +1 -0
- package/dist/web/assets/Reports-u72R1XBV.js +2 -0
- package/dist/web/assets/Requirements-BAcEi5Fl.js +2 -0
- package/dist/web/assets/Responsive-CCPzSbdd.js +3 -0
- package/dist/web/assets/RunDiff-CGhLqPpP.js +1 -0
- package/dist/web/assets/Settings-DDCiQZ0T.js +21 -0
- package/dist/web/assets/Steps-sfVkdv7g.js +2 -0
- package/dist/web/assets/TestData-B4-xVlvt.js +2 -0
- package/dist/web/assets/TestManagement-BGBKGV1L.js +4 -0
- package/dist/web/assets/WhatsNew-BMTuBbaX.js +1 -0
- package/dist/web/assets/agentSettingsSheet-Cc2W6lyp.js +1 -0
- package/dist/web/assets/api-BsiuHmJq.js +1 -0
- package/dist/web/assets/choice-C4-yW2x9.js +1 -0
- package/dist/web/assets/code-Jek8uWUO.js +1 -0
- package/dist/web/assets/{coverage-DirEXtfZ.js → coverage-pqIlfEP0.js} +1 -1
- package/dist/web/assets/dataParts-CkwgLllh.js +3 -0
- package/dist/web/assets/desktopAppPath-D3mGDKPz.js +1 -0
- package/dist/web/assets/flowTheme-DKuXe5nP.js +7 -0
- package/dist/web/assets/frame-BMpSUo2-.js +13 -0
- package/dist/web/assets/index-6SZomYE0.js +55 -0
- package/dist/web/assets/index-CWqwtFKz.css +2 -0
- package/dist/web/assets/line-icons-CwCZidXs.js +1 -0
- package/dist/web/assets/logos-P2LOMyTK.js +1 -0
- package/dist/web/assets/{markdown-BnrLv6Iw.js → markdown-1wY7hIbM.js} +5 -5
- package/dist/web/assets/nav-B_68FVw_.js +1 -0
- package/dist/web/assets/pageBack-CbyKfisx.js +3 -0
- package/dist/web/assets/palette-6YAAmgkD.js +1 -0
- package/dist/web/assets/{paletteCommands-LXIICD4V.js → paletteCommands-Isq1rLs-.js} +1 -1
- package/dist/web/assets/parts-ClnDV-6r.js +1 -0
- package/dist/web/assets/preload-helper-BupTYkQW.js +1 -0
- package/dist/web/assets/productParts-D18glCBr.js +1 -0
- package/dist/web/assets/qualityParts-1F1Ee4Ay.js +1 -0
- package/dist/web/assets/radio-BLI4Ubhk.js +1 -0
- package/dist/web/assets/react-BDur5s0O.js +1 -0
- package/dist/web/assets/{recordTest-BzKpS4m5.js → recordTest-7uIZiqOW.js} +1 -1
- package/dist/web/assets/route-oDy8sV6H.js +1 -0
- package/dist/web/assets/sectionList-B651VPon.js +1 -0
- package/dist/web/assets/step-mark-CaKf4dAR.js +1 -0
- package/dist/web/assets/stepper-DdgwJtbU.js +1 -0
- package/dist/web/assets/utils-DJRAScIl.js +1 -0
- package/dist/web/assets/wizardParts-C0cNmIK9.js +1 -0
- package/dist/web/index.html +15 -13
- package/docs/user-guide.html +309 -3
- package/evals/prompts/perf-report/limit-broken.yaml +28 -0
- package/evals/prompts/perf-report/regression-other-load.yaml +28 -0
- package/forgeqe.example.yaml +10 -0
- package/package.json +2 -1
- package/prompts/README.md +4 -0
- package/prompts/brain.md +17 -0
- package/prompts/perf-report.md +41 -0
- package/prompts/perf-strategy.md +45 -0
- package/prompts/perf.md +45 -0
- package/prompts/team-builder.md +50 -0
- package/py/forgeqe_engine/cli.py +7 -0
- package/dist/web/assets/Agent-CRfgRnq2.js +0 -8
- package/dist/web/assets/AgentWork-DqiO3LUi.js +0 -2
- package/dist/web/assets/ApiTests-DCAnizu5.js +0 -15
- package/dist/web/assets/Browse-D5VDHN9Z.js +0 -1
- package/dist/web/assets/Chat-CLGQ1ymU.js +0 -3
- package/dist/web/assets/CommandPalette-D3F4iHrP.js +0 -1
- package/dist/web/assets/Compare-B1WN67Ny.js +0 -1
- package/dist/web/assets/Cost-Dk4m3r8z.js +0 -1
- package/dist/web/assets/Desktop-B3GcbaPu.js +0 -1
- package/dist/web/assets/DesktopReview-DfvAL3m8.js +0 -2
- package/dist/web/assets/DeviceScreen-DJqblqBh.js +0 -1
- package/dist/web/assets/Evidence-BsA7vCZG.js +0 -1
- package/dist/web/assets/Features-CDBlFLaJ.js +0 -1
- package/dist/web/assets/Flaky-C062Mh6z.js +0 -1
- package/dist/web/assets/Impact-BeXw3-oL.js +0 -3
- package/dist/web/assets/Jobs-QYWqmdDI.js +0 -5
- package/dist/web/assets/KindPage-C2g51s9c.js +0 -6
- package/dist/web/assets/LiveDevice-C9LRZMhC.js +0 -1
- package/dist/web/assets/Migration-ByUU0Oa_.js +0 -8
- package/dist/web/assets/Mobile-Dd3jL0Cn.js +0 -1
- package/dist/web/assets/Observability-Dx4ZCRDj.js +0 -1
- package/dist/web/assets/PageAgent-DYBOhs2x.js +0 -1
- package/dist/web/assets/Product-Ch1XAeAT.js +0 -12
- package/dist/web/assets/Production-TEdyFmo4.js +0 -1
- package/dist/web/assets/Quality-DH8EdI2u.js +0 -1
- package/dist/web/assets/Readiness-B8S7Ex0C.js +0 -1
- package/dist/web/assets/Record-uFQ-YaHg.js +0 -1
- package/dist/web/assets/Regression-CSDT2AnY.js +0 -5
- package/dist/web/assets/RelationGraph-gc0Xmklt.js +0 -1
- package/dist/web/assets/Reports-CSHhRfWv.js +0 -2
- package/dist/web/assets/Responsive-CEG1hbbQ.js +0 -3
- package/dist/web/assets/RunDiff-CHrMivzC.js +0 -1
- package/dist/web/assets/Settings-B63s0b1g.js +0 -21
- package/dist/web/assets/Steps-BsDjv-pm.js +0 -2
- package/dist/web/assets/TestData-CJoCXihI.js +0 -2
- package/dist/web/assets/TestManagement-Dkb-paWh.js +0 -4
- package/dist/web/assets/WhatsNew-Dtk9mJU4.js +0 -1
- package/dist/web/assets/agentSettingsSheet-BlM8KSpN.js +0 -1
- package/dist/web/assets/api-6pHfHEgB.js +0 -1
- package/dist/web/assets/choice-CiFogD01.js +0 -1
- package/dist/web/assets/code-DzYywAs5.js +0 -1
- package/dist/web/assets/dataParts-Di7PdPHu.js +0 -3
- package/dist/web/assets/desktopAppPath-B8j1-pX0.js +0 -1
- package/dist/web/assets/frame-CNLw552P.js +0 -13
- package/dist/web/assets/index-DLuCgQKX.js +0 -55
- package/dist/web/assets/index-DRcPg81h.css +0 -2
- package/dist/web/assets/line-icons-B-O8oBsY.js +0 -1
- package/dist/web/assets/nav-Ds_6IERv.js +0 -1
- package/dist/web/assets/pageBack-DJxbEPfN.js +0 -3
- package/dist/web/assets/palette-H2g-hemT.js +0 -1
- package/dist/web/assets/parts-DKRLtrjs.js +0 -1
- package/dist/web/assets/preload-helper-BML5SvL4.js +0 -1
- package/dist/web/assets/productParts-imNtw-1N.js +0 -1
- package/dist/web/assets/qualityParts-DJhFlgCm.js +0 -1
- package/dist/web/assets/radio-CbR6ODxQ.js +0 -1
- package/dist/web/assets/route-DjewvmpL.js +0 -1
- package/dist/web/assets/sectionList-0umoKvRv.js +0 -1
- package/dist/web/assets/step-mark-g8Eb6foB.js +0 -1
- package/dist/web/assets/stepper-CzZIC36d.js +0 -1
- /package/dist/web/assets/{Product-DLioOiRN.css → flowTheme-DLioOiRN.css} +0 -0
package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/checklists/spec-circuit-po.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Spec circuit — product owner / backlog checklist
|
|
2
|
+
|
|
3
|
+
- [ ] **Testable AC:** Observable, verifiable acceptance criteria (not “works well”).
|
|
4
|
+
- [ ] **Story slicing:** Independently deliverable increments; clear boundaries.
|
|
5
|
+
- [ ] **Pre/post conditions** and **error / empty / permission** states.
|
|
6
|
+
- [ ] **NFR acceptance:** Performance, security, accessibility hooks in AC where relevant.
|
|
7
|
+
- [ ] **Definition of ready:** Dependencies, designs, flags, data contracts spelled out?
|
|
8
|
+
- [ ] **Traceability:** Link to user/business outcome and upstream intent.
|
|
9
|
+
- [ ] **API/data contracts** and **feature flags / rollout / migration** impacts stated?
|
|
10
|
+
- [ ] **Audit / telemetry / supportability** AC when actions are sensitive or billable.
|
package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/checklists/spec-circuit-qa.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Spec circuit — QA checklist
|
|
2
|
+
|
|
3
|
+
- [ ] **Testability of requirements:** Given/when/then clarity; data and environment needs.
|
|
4
|
+
- [ ] **Coverage shape:** Happy, edge, negative, abuse/security paths.
|
|
5
|
+
- [ ] **Contract/API testability:** Schemas, mocks, consumer-driven contracts.
|
|
6
|
+
- [ ] **Data setup/teardown:** Fixtures, masking, PII constraints, synthetic data.
|
|
7
|
+
- [ ] **Environment readiness:** Feature flags, seeds, external sandbox dependencies.
|
|
8
|
+
- [ ] **Security test hooks:** AuthZ matrix, injection, SSRF, rate limits, session fixation.
|
|
9
|
+
- [ ] **Observability assertions:** Alerts, SLO tests, log-based checks where relevant.
|
|
10
|
+
- [ ] **Regression & flaky risk:** Determinism, parallel safety, quarantine strategy.
|
|
11
|
+
- [ ] **Audit evidence:** What artifacts/logs prove “done” for compliance features.
|
package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/checklists/spec-circuit-sm.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Spec circuit — delivery readiness (Scrum Master) checklist
|
|
2
|
+
|
|
3
|
+
- [ ] **Refinement readiness:** Enough clarity to estimate and split without serial rework?
|
|
4
|
+
- [ ] **Dependency sequencing:** Order of stories/features; blocking external work.
|
|
5
|
+
- [ ] **Sprintability:** Fits iteration; no hidden spikes disguised as stories?
|
|
6
|
+
- [ ] **Risks & escalations:** Compliance, security, vendor, data migration spikes needed?
|
|
7
|
+
- [ ] **Thrashing / rework risk:** Unstable scope, unclear AC, missing decisions.
|
|
8
|
+
- [ ] **Handoffs:** PO/Arch/Dev/QA alignment on acceptance and environments.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# BMAD Knowledge Base (Spec circuit)
|
|
2
|
+
|
|
3
|
+
**Spec circuit note:** This run is a **single-pass automated review**, not an interactive BMAD IDE session. The principles below still apply; ignore step-by-step “shard PRD / draft next story” workflows when producing your review section.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
BMAD-METHOD combines AI agents with Agile development. The framework emphasizes modular agents, reusable templates and checklists, and clear documentation as input to quality outputs.
|
|
8
|
+
|
|
9
|
+
## Core principles (for reviews)
|
|
10
|
+
|
|
11
|
+
- **Quality control:** Challenge vague requirements; prefer measurable, verifiable statements.
|
|
12
|
+
- **Strategic alignment:** Tie recommendations to business outcomes and delivery risk.
|
|
13
|
+
- **Clear structure:** Prefer explicit scope, assumptions, and traceability from need → acceptance → verification.
|
|
14
|
+
- **Documentation as input:** Better briefs and constraints yield better implementation and test plans.
|
|
15
|
+
|
|
16
|
+
## Agile delivery themes (informative)
|
|
17
|
+
|
|
18
|
+
- Incremental delivery, definition of ready/done, transparent dependencies.
|
|
19
|
+
- DevSecOps: shift-left testing, pipeline gates, environment parity.
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# Requirements review baseline — industry, ISO themes & security
|
|
2
|
+
|
|
3
|
+
This file is loaded into **Spec circuit** for every specialist. Use it as a **structured review lens**: map the requirement to applicable domains, identify **gaps** versus common expectations, and recommend **next steps**. It is **not** legal advice and does **not** replace formal certification, audit, or a qualified compliance officer.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. How to apply this baseline
|
|
8
|
+
|
|
9
|
+
| Step | Action |
|
|
10
|
+
|------|--------|
|
|
11
|
+
| 1 | Infer **domains** from the requirement: e.g. personal data, payments, health, automotive, AI/ML, safety-critical, government, children’s data. |
|
|
12
|
+
| 2 | For each domain, consider the **standard families** and **control themes** in sections 2–6 below. |
|
|
13
|
+
| 3 | In your section output, include a short **Standards & assurance** (or equivalent) subsection when relevant: **topic → typical framework / ISO theme → gap or risk → suggested action**. |
|
|
14
|
+
| 4 | If scope is unknown, state **assumptions** and list **open questions** for the customer. |
|
|
15
|
+
| 5 | Never claim “ISO certified” or “GDPR compliant” from a text review alone. |
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 2. Quality management & engineering discipline (ISO 9001, ISO/IEC 25010)
|
|
20
|
+
|
|
21
|
+
**Themes to probe**
|
|
22
|
+
|
|
23
|
+
- **ISO 9001 (QMS)**: Needs and expectations, traceability of requirements to verification, management of change, corrective action when defects escape.
|
|
24
|
+
- **ISO/IEC 25010** (software product quality): Functional suitability, performance efficiency, compatibility, usability, reliability, security, maintainability, portability.
|
|
25
|
+
|
|
26
|
+
**Review prompts**
|
|
27
|
+
|
|
28
|
+
- Are success criteria **measurable**? Is there a **verification** strategy tied to acceptance?
|
|
29
|
+
- Are **non-functional** qualities (performance, reliability, maintainability) specified where they drive architecture or cost?
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 3. Information security (ISO/IEC 27001, NIST Cybersecurity Framework)
|
|
34
|
+
|
|
35
|
+
**ISO/IEC 27001 / Annex A themes (informative mapping)**
|
|
36
|
+
|
|
37
|
+
- Context and scope of the ISMS; risk assessment and treatment.
|
|
38
|
+
- **Access control** (least privilege, IAM, segregation of duties).
|
|
39
|
+
- **Cryptography** for data at rest and in transit; key management.
|
|
40
|
+
- **Logging and monitoring**; incident response; business continuity.
|
|
41
|
+
- **Supplier** and third-party risk; secure development lifecycle for software you build or buy.
|
|
42
|
+
|
|
43
|
+
**NIST CSF functions (Identify, Protect, Detect, Respond, Recover)**
|
|
44
|
+
|
|
45
|
+
- Useful for articulating gaps in **governance**, **protective controls**, and **resilience**.
|
|
46
|
+
|
|
47
|
+
**Review prompts**
|
|
48
|
+
|
|
49
|
+
- Data classification? Who can access what? Break-glass / admin paths?
|
|
50
|
+
- Secrets **not** hard-coded; use vaults or managed identity where applicable.
|
|
51
|
+
- **TLS** for external interfaces (prefer modern versions and cipher policies); internal encryption where sensitive data crosses trust boundaries.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## 4. Privacy & data protection (ISO/IEC 27701, common regulatory themes)
|
|
56
|
+
|
|
57
|
+
**ISO/IEC 27701** extends 27001/27002 with privacy controls (PIMS).
|
|
58
|
+
|
|
59
|
+
**Common themes (e.g. GDPR-style, not jurisdiction-specific legal advice)**
|
|
60
|
+
|
|
61
|
+
- Lawful basis for processing; purpose limitation; data minimization.
|
|
62
|
+
- **Retention** and deletion; subject rights (access, erasure) where relevant.
|
|
63
|
+
- **Cross-border** transfers and appropriate safeguards when mentioned.
|
|
64
|
+
- **DPIA** / privacy risk assessment for high-risk processing.
|
|
65
|
+
|
|
66
|
+
**Review prompts**
|
|
67
|
+
|
|
68
|
+
- Is **personal data** in scope? Which categories? Which regions?
|
|
69
|
+
- Are **consent** or **contracts** described where they drive lawful processing?
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 5. AI & automated decision-making (ISO/IEC 42001, emerging practice)
|
|
74
|
+
|
|
75
|
+
**ISO/IEC 42001** (AI management system): governance, risk, data for AI, lifecycle, transparency, human oversight.
|
|
76
|
+
|
|
77
|
+
**Review prompts**
|
|
78
|
+
|
|
79
|
+
- Intended use, **limitations**, and **human-in-the-loop** where decisions affect people materially.
|
|
80
|
+
- **Training data** governance, bias/fairness considerations, and monitoring in production.
|
|
81
|
+
- Logging and **explainability** expectations commensurate with risk.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## 6. Application & product security (OWASP, secure SDLC)
|
|
86
|
+
|
|
87
|
+
**OWASP ASVS** (Application Security Verification Standard): levels of verification for web apps and APIs—use as a **checklist dimension**, not a binary pass/fail from prose alone.
|
|
88
|
+
|
|
89
|
+
**OWASP Top 10** (and API Top 10): injection, broken auth, sensitive data exposure, SSRF, etc.
|
|
90
|
+
|
|
91
|
+
**NIST SSDF** (Secure Software Development Framework): secure design, code review, SBOM/supply chain themes.
|
|
92
|
+
|
|
93
|
+
**Review prompts**
|
|
94
|
+
|
|
95
|
+
- Authentication and session management (**OAuth 2.0 / OpenID Connect**, SAML where enterprise SSO).
|
|
96
|
+
- Authorization at **object** level, not only route level.
|
|
97
|
+
- Input validation, output encoding, **CSP** and browser security headers for web UIs.
|
|
98
|
+
- **Secrets**, dependency/supply-chain updates, and secure CI/CD practices.
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## 7. Safety, sector-specific, and regulated industries (pointers only)
|
|
103
|
+
|
|
104
|
+
Use these **only when** the requirement clearly implies the domain:
|
|
105
|
+
|
|
106
|
+
| Domain | Typical references (informative) |
|
|
107
|
+
|--------|-----------------------------------|
|
|
108
|
+
| Medical device software | IEC 62304, ISO 14971 (risk), FDA QMS expectations where applicable |
|
|
109
|
+
| Automotive cybersecurity | ISO/SAE 21434 |
|
|
110
|
+
| Industrial / OT | IEC 62443 |
|
|
111
|
+
| Cardholder data | PCI DSS |
|
|
112
|
+
| Government / FedRAMP-style | NIST 800-53 themes (US) |
|
|
113
|
+
|
|
114
|
+
Call out that **domain experts** and **formal standards** must be applied for certification.
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## 8. Agile / delivery alignment (industry practice, not a single ISO)
|
|
119
|
+
|
|
120
|
+
- **Incremental delivery**, definition of ready/done, refinement quality, dependency transparency.
|
|
121
|
+
- **DevSecOps**: shift-left security testing, pipeline gates, environment parity.
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## 9. What each role should emphasize (Spec circuit)
|
|
126
|
+
|
|
127
|
+
| Role | Standards / security angle |
|
|
128
|
+
|------|----------------------------|
|
|
129
|
+
| **Atlas** | Preview which domains (security, privacy, AI, quality) likely apply; set expectations for later sections. |
|
|
130
|
+
| **Business Analyst** | Stakeholders, regulatory context, discovery gaps, explicit assumptions. |
|
|
131
|
+
| **Product Manager** | Market/regulatory constraints, roadmap risk, scope vs compliance cost. |
|
|
132
|
+
| **Product Owner** | Acceptance criteria testability; regulatory non-goals; measurable outcomes. |
|
|
133
|
+
| **Architect** | NFRs, trust boundaries, security architecture, data flows, resilience. |
|
|
134
|
+
| **Developer** | Feasibility of controls, secure defaults, integration with IdP/secrets/observability. |
|
|
135
|
+
| **QA** | Verification strategy, security test types (SAST/DAST/pentest hooks), evidence for audits. |
|
|
136
|
+
| **Scrum Master** | Dependencies, readiness for refinement, escalation paths for compliance/security spikes. |
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## 10. Output snippet (copy pattern)
|
|
141
|
+
|
|
142
|
+
```markdown
|
|
143
|
+
### Standards & assurance (informative)
|
|
144
|
+
|
|
145
|
+
| Topic | Typical framework / theme | Gap / risk for this requirement | Suggested next step |
|
|
146
|
+
|-------|---------------------------|----------------------------------|---------------------|
|
|
147
|
+
| ... | ... | ... | ... |
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Use this pattern **when** any of sections 2–8 apply; omit the subsection if the requirement is purely internal tooling with no sensitive data (still consider basic security hygiene).
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## 11. Product engineering / SaaS specifics
|
|
155
|
+
|
|
156
|
+
When the requirement implies a multi-tenant product or SaaS:
|
|
157
|
+
|
|
158
|
+
- **Tenancy model** (shared DB vs silo, row-level isolation, org vs workspace).
|
|
159
|
+
- **Entitlements / plans / quotas** and enforcement points.
|
|
160
|
+
- **Audit logs** for admin and security-relevant user actions.
|
|
161
|
+
- **Support tooling** (impersonation, data export) with policy and logging.
|
|
162
|
+
- **Data residency** and cross-region replication if mentioned or implied.
|
|
163
|
+
- **Export / deletion** flows aligned with privacy commitments.
|
|
164
|
+
- **Rollout, migration, and backward compatibility** for schema and API changes.
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## 12. Agentic / autonomous system risks
|
|
169
|
+
|
|
170
|
+
When the system uses LLMs, tools, workflows, or autonomous actions:
|
|
171
|
+
|
|
172
|
+
- **Approval gates** and **override authority** for high-impact operations.
|
|
173
|
+
- **Tool execution boundaries** (what may run, on whose behalf, with which credentials).
|
|
174
|
+
- **Prompt injection** and **indirect prompt** risks from untrusted content in UIs or documents.
|
|
175
|
+
- **Evidence provenance** (inputs used, model/tool versions, timestamps).
|
|
176
|
+
- **Action replay / idempotency** for automated side effects.
|
|
177
|
+
- **Hallucination containment** (human review, guardrails, structured outputs).
|
|
178
|
+
- **Policy-based constraints** (RBAC, rate limits, allowlists).
|
|
179
|
+
- **Artifact retention** and **chain-of-custody** for compliance or disputes.
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## 13. QA / evidence expectations
|
|
184
|
+
|
|
185
|
+
- Define what **proof of done** means: test levels, environments, data rules.
|
|
186
|
+
- **Traceability**: requirement → acceptance criteria → test case → run artifact/log.
|
|
187
|
+
- **Security testing**: SAST/DAST/dependency scan hooks, penetration test triggers, abuse-case tests where relevant.
|
|
188
|
+
- **Reproducibility**: seeded data, deterministic suites where possible; document flaky-test risk.
|
package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/data/technical-preferences.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Technical preferences — Spec circuit defaults
|
|
2
|
+
|
|
3
|
+
Use these as **default engineering assumptions** when the requirement is silent. Call out conflicts or gaps explicitly.
|
|
4
|
+
|
|
5
|
+
## Stack and API style
|
|
6
|
+
|
|
7
|
+
- Prefer **explicit contracts** (OpenAPI/JSON Schema or equivalent) for external and internal service boundaries.
|
|
8
|
+
- **REST or well-documented RPC** with versioning or backward-compatible evolution where APIs are public or long-lived.
|
|
9
|
+
- **Idempotent** mutating operations where retries are possible (safe replays, deduplication keys).
|
|
10
|
+
|
|
11
|
+
## Architecture patterns
|
|
12
|
+
|
|
13
|
+
- **Layered or modular** boundaries; avoid leaking persistence into domain logic without justification.
|
|
14
|
+
- **Feature flags** for risky or gradual rollouts when behavior change affects many users.
|
|
15
|
+
- **Backward compatibility** and **migration** plans when data shape or APIs change.
|
|
16
|
+
|
|
17
|
+
## Identity, tenancy, and authorization
|
|
18
|
+
|
|
19
|
+
- Assume **authentication** is required for non-public capabilities unless stated otherwise.
|
|
20
|
+
- Prefer **tenant-scoped** data access; enforce authorization at the **object/resource** level, not only route level.
|
|
21
|
+
- Document **admin / break-glass** paths and audit expectations when privileged actions exist.
|
|
22
|
+
|
|
23
|
+
## Secrets and configuration
|
|
24
|
+
|
|
25
|
+
- **No secrets in source** or client bundles; use vaults, managed identity, or environment-specific secret stores.
|
|
26
|
+
- **Least privilege** for runtime and CI roles.
|
|
27
|
+
|
|
28
|
+
## Observability and operations
|
|
29
|
+
|
|
30
|
+
- **Structured logging** with correlation/trace identifiers across services.
|
|
31
|
+
- **Metrics** for latency, errors, saturation; **alerting** on SLO breaches where applicable.
|
|
32
|
+
- **Audit trails** for security-, compliance-, or billing-relevant actions.
|
|
33
|
+
|
|
34
|
+
## Data lifecycle
|
|
35
|
+
|
|
36
|
+
- Classify data sensitivity; define **retention**, **deletion/export** (subject rights where personal data applies), and **encryption** at rest and in transit across trust boundaries.
|
|
37
|
+
|
|
38
|
+
## Reliability
|
|
39
|
+
|
|
40
|
+
- **Timeouts, retries with backoff**, and **circuit breaking** for external dependencies.
|
|
41
|
+
- **Idempotency** and **compensating actions** for distributed workflows and webhooks.
|
|
42
|
+
|
|
43
|
+
## Testing and CI
|
|
44
|
+
|
|
45
|
+
- **Test pyramid:** unit → integration → targeted E2E; critical paths covered before release.
|
|
46
|
+
- **Reproducible evidence:** automated runs produce logs/artifacts; flaky tests flagged and owned.
|
|
47
|
+
- **Determinism** where possible; explicit test data setup/teardown for integration tests.
|
|
48
|
+
|
|
49
|
+
## Autonomous / agentic features (when relevant)
|
|
50
|
+
|
|
51
|
+
- **Tool execution boundaries** and **human-in-the-loop** or approval gates for high-impact actions.
|
|
52
|
+
- **Prompt-injection** awareness for UIs that pass untrusted content into models or tools.
|
|
53
|
+
- **Provenance** for automated decisions affecting users (what was used, what ran, optional replay).
|
|
54
|
+
- **Artifact retention** appropriate to compliance and incident response.
|
package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/utils/template-format.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Template format conventions (reference)
|
|
2
|
+
|
|
3
|
+
Templates may use placeholders and internal AI instructions. For **Spec circuit**, you are **not** filling a template document; use this file only to recognize structure if a dependency references template-style markup.
|
|
4
|
+
|
|
5
|
+
- **{{placeholders}}**: Variables in authoring templates
|
|
6
|
+
- **[[LLM: instructions]]**: Internal processing hints in full BMAD templates
|
|
7
|
+
- In your review output, produce **clean markdown** for stakeholders—no template control tokens.
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
workflow:
|
|
2
|
+
id: greenfield-fullstack
|
|
3
|
+
name: Greenfield Full-Stack Application Development
|
|
4
|
+
description: >-
|
|
5
|
+
Agent workflow for building full-stack applications from concept to development.
|
|
6
|
+
Supports both comprehensive planning for complex projects and rapid prototyping for simple ones.
|
|
7
|
+
type: greenfield
|
|
8
|
+
project_types:
|
|
9
|
+
- web-app
|
|
10
|
+
- saas
|
|
11
|
+
- enterprise-app
|
|
12
|
+
- prototype
|
|
13
|
+
- mvp
|
|
14
|
+
|
|
15
|
+
# For Complex Projects (Production-Ready, Multiple Features)
|
|
16
|
+
complex_project_sequence:
|
|
17
|
+
- agent: analyst
|
|
18
|
+
creates: project-brief.md
|
|
19
|
+
optional_steps:
|
|
20
|
+
- brainstorming_session
|
|
21
|
+
- market_research_prompt
|
|
22
|
+
notes: "Can do brainstorming first, then optional deep research before creating project brief. SAVE OUTPUT: Copy final project-brief.md to your project's docs/ folder."
|
|
23
|
+
|
|
24
|
+
- agent: pm
|
|
25
|
+
creates: prd.md
|
|
26
|
+
requires: project-brief.md
|
|
27
|
+
notes: "Creates PRD from project brief using prd-tmpl. SAVE OUTPUT: Copy final prd.md to your project's docs/ folder."
|
|
28
|
+
|
|
29
|
+
- agent: ux-expert
|
|
30
|
+
creates: front-end-spec.md
|
|
31
|
+
requires: prd.md
|
|
32
|
+
optional_steps:
|
|
33
|
+
- user_research_prompt
|
|
34
|
+
notes: "Creates UI/UX specification using front-end-spec-tmpl. SAVE OUTPUT: Copy final front-end-spec.md to your project's docs/ folder."
|
|
35
|
+
|
|
36
|
+
- agent: ux-expert
|
|
37
|
+
creates: v0_prompt (optional)
|
|
38
|
+
requires: front-end-spec.md
|
|
39
|
+
condition: user_wants_ai_generation
|
|
40
|
+
notes: "OPTIONAL BUT RECOMMENDED: Generate AI UI prompt for tools like v0, Lovable, etc. Use the generate-ai-frontend-prompt task. User can then generate UI in external tool and download project structure."
|
|
41
|
+
|
|
42
|
+
- agent: architect
|
|
43
|
+
creates: fullstack-architecture.md
|
|
44
|
+
requires:
|
|
45
|
+
- prd.md
|
|
46
|
+
- front-end-spec.md
|
|
47
|
+
optional_steps:
|
|
48
|
+
- technical_research_prompt
|
|
49
|
+
- review_generated_ui_structure
|
|
50
|
+
notes: "Creates comprehensive architecture using fullstack-architecture-tmpl. If user generated UI with v0/Lovable, can incorporate the project structure into architecture. May suggest changes to PRD stories or new stories. SAVE OUTPUT: Copy final fullstack-architecture.md to your project's docs/ folder."
|
|
51
|
+
|
|
52
|
+
- agent: pm
|
|
53
|
+
updates: prd.md (if needed)
|
|
54
|
+
requires: fullstack-architecture.md
|
|
55
|
+
condition: architecture_suggests_prd_changes
|
|
56
|
+
notes: "If architect suggests story changes, update PRD and re-export the complete unredacted prd.md to docs/ folder."
|
|
57
|
+
|
|
58
|
+
- agent: po
|
|
59
|
+
validates: all_artifacts
|
|
60
|
+
uses: po-master-checklist
|
|
61
|
+
notes: "Validates all documents for consistency and completeness. May require updates to any document."
|
|
62
|
+
|
|
63
|
+
- agent: various
|
|
64
|
+
updates: any_flagged_documents
|
|
65
|
+
condition: po_checklist_issues
|
|
66
|
+
notes: "If PO finds issues, return to relevant agent to fix and re-export updated documents to docs/ folder."
|
|
67
|
+
|
|
68
|
+
- project_setup_guidance:
|
|
69
|
+
action: guide_project_structure
|
|
70
|
+
condition: user_has_generated_ui
|
|
71
|
+
notes: "If user generated UI with v0/Lovable: For polyrepo setup, place downloaded project in separate frontend repo alongside backend repo. For monorepo, place in apps/web or packages/frontend directory. Review architecture document for specific guidance."
|
|
72
|
+
|
|
73
|
+
- development_order_guidance:
|
|
74
|
+
action: guide_development_sequence
|
|
75
|
+
notes: "Based on PRD stories: If stories are frontend-heavy, start with frontend project/directory first. If backend-heavy or API-first, start with backend. For tightly coupled features, follow story sequence in monorepo setup. Reference sharded PRD epics for development order."
|
|
76
|
+
|
|
77
|
+
- workflow_end:
|
|
78
|
+
action: move_to_ide
|
|
79
|
+
notes: "All planning artifacts complete. Move to IDE environment to begin development. Explain to the user the IDE Development Workflow next steps: data#bmad-kb:IDE Development Workflow"
|
|
80
|
+
|
|
81
|
+
# For Simple Projects (Prototypes, MVPs, Quick Experiments)
|
|
82
|
+
simple_project_sequence:
|
|
83
|
+
- step: project_scope
|
|
84
|
+
action: assess complexity
|
|
85
|
+
notes: "First, assess if this needs full planning (use complex_project_sequence) or can be a simple prototype/MVP."
|
|
86
|
+
|
|
87
|
+
- agent: analyst
|
|
88
|
+
creates: project-brief.md
|
|
89
|
+
optional_steps:
|
|
90
|
+
- brainstorming_session
|
|
91
|
+
notes: "Creates focused project brief for simple project. SAVE OUTPUT: Copy final project-brief.md to your project's docs/ folder."
|
|
92
|
+
|
|
93
|
+
- agent: pm
|
|
94
|
+
creates: simple-project-prd.md
|
|
95
|
+
uses: create doc simple-project-prd OR create-epic OR create-story
|
|
96
|
+
requires: project-brief.md
|
|
97
|
+
notes: "Create simple prd, simple epic or story instead of full PRD for rapid development. Choose based on scope."
|
|
98
|
+
|
|
99
|
+
- workflow_end:
|
|
100
|
+
action: move_to_ide
|
|
101
|
+
notes: "Simple project defined. Move to IDE environment to begin development. Explain to the user the IDE Development Workflow next steps: data#bmad-kb:IDE Development Workflow"
|
|
102
|
+
|
|
103
|
+
flow_diagram: |
|
|
104
|
+
```mermaid
|
|
105
|
+
graph TD
|
|
106
|
+
A[Start: Greenfield Project] --> B{Project Complexity?}
|
|
107
|
+
B -->|Complex/Production| C[analyst: project-brief.md]
|
|
108
|
+
B -->|Simple/Prototype| D[analyst: focused project-brief.md]
|
|
109
|
+
|
|
110
|
+
C --> E[pm: prd.md]
|
|
111
|
+
E --> F[ux-expert: front-end-spec.md]
|
|
112
|
+
F --> F2{Generate v0 prompt?}
|
|
113
|
+
F2 -->|Yes| F3[ux-expert: create v0 prompt]
|
|
114
|
+
F2 -->|No| G[architect: fullstack-architecture.md]
|
|
115
|
+
F3 --> F4[User: generate UI in v0/Lovable]
|
|
116
|
+
F4 --> G
|
|
117
|
+
G --> H{Architecture suggests PRD changes?}
|
|
118
|
+
H -->|Yes| I[pm: update prd.md]
|
|
119
|
+
H -->|No| J[po: validate all artifacts]
|
|
120
|
+
I --> J
|
|
121
|
+
J --> K{PO finds issues?}
|
|
122
|
+
K -->|Yes| L[Return to relevant agent for fixes]
|
|
123
|
+
K -->|No| M[Move to IDE Environment]
|
|
124
|
+
L --> J
|
|
125
|
+
|
|
126
|
+
D --> N[pm: simple epic or story]
|
|
127
|
+
N --> O[Move to IDE Environment]
|
|
128
|
+
|
|
129
|
+
C -.-> C1[Optional: brainstorming]
|
|
130
|
+
C -.-> C2[Optional: market research]
|
|
131
|
+
F -.-> F1[Optional: user research]
|
|
132
|
+
G -.-> G1[Optional: technical research]
|
|
133
|
+
D -.-> D1[Optional: brainstorming]
|
|
134
|
+
|
|
135
|
+
style M fill:#90EE90
|
|
136
|
+
style O fill:#90EE90
|
|
137
|
+
style F3 fill:#E6E6FA
|
|
138
|
+
style F4 fill:#E6E6FA
|
|
139
|
+
style C fill:#FFE4B5
|
|
140
|
+
style E fill:#FFE4B5
|
|
141
|
+
style F fill:#FFE4B5
|
|
142
|
+
style G fill:#FFE4B5
|
|
143
|
+
style D fill:#FFB6C1
|
|
144
|
+
style N fill:#FFB6C1
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
decision_guidance:
|
|
148
|
+
use_complex_sequence_when:
|
|
149
|
+
- Building production-ready applications
|
|
150
|
+
- Multiple team members will be involved
|
|
151
|
+
- Complex feature requirements (4+ stories)
|
|
152
|
+
- Need comprehensive documentation
|
|
153
|
+
- Long-term maintenance expected
|
|
154
|
+
- Enterprise or customer-facing applications
|
|
155
|
+
|
|
156
|
+
use_simple_sequence_when:
|
|
157
|
+
- Building prototypes or MVPs
|
|
158
|
+
- Solo developer or small team
|
|
159
|
+
- Simple requirements (1-3 stories)
|
|
160
|
+
- Quick experiments or proof-of-concepts
|
|
161
|
+
- Short-term or throwaway projects
|
|
162
|
+
- Learning or educational projects
|
|
163
|
+
|
|
164
|
+
handoff_prompts:
|
|
165
|
+
# Complex sequence prompts
|
|
166
|
+
analyst_to_pm: "Project brief is complete. Save it as docs/project-brief.md in your project, then create the PRD."
|
|
167
|
+
pm_to_ux: "PRD is ready. Save it as docs/prd.md in your project, then create the UI/UX specification."
|
|
168
|
+
ux_to_architect: "UI/UX spec complete. Save it as docs/front-end-spec.md in your project, then create the fullstack architecture."
|
|
169
|
+
architect_review: "Architecture complete. Save it as docs/fullstack-architecture.md. Do you suggest any changes to the PRD stories or need new stories added?"
|
|
170
|
+
architect_to_pm: "Please update the PRD with the suggested story changes, then re-export the complete prd.md to docs/."
|
|
171
|
+
updated_to_po: "All documents ready in docs/ folder. Please validate all artifacts for consistency."
|
|
172
|
+
po_issues: "PO found issues with [document]. Please return to [agent] to fix and re-save the updated document."
|
|
173
|
+
complex_complete: "All planning artifacts validated and saved in docs/ folder. Move to IDE environment to begin development."
|
|
174
|
+
|
|
175
|
+
# Simple sequence prompts
|
|
176
|
+
simple_analyst_to_pm: "Focused project brief complete. Save it as docs/project-brief.md, then create simple epic or story for rapid development."
|
|
177
|
+
simple_complete: "Simple project defined. Move to IDE environment to begin development."
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Any, Callable, Dict, Optional
|
|
4
|
+
|
|
5
|
+
from requirements_agent.context.aggregate import ContextAggregator, build_base_user_prompt
|
|
6
|
+
from requirements_agent.llm.base import ChatMessage, LlmClient
|
|
7
|
+
from requirements_agent.models import ContextBundle
|
|
8
|
+
from requirements_agent.pipeline.progress import emit, make_stream_reporter
|
|
9
|
+
from requirements_agent.pipeline.prompts import BRD_CONSOLIDATION_SYSTEM, REQUIREMENTS_REPORT_MD_TITLE
|
|
10
|
+
|
|
11
|
+
ProgressCallback = Callable[[Dict[str, Any]], None]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _strip_fence(text: str) -> str:
|
|
15
|
+
cleaned = (text or "").strip()
|
|
16
|
+
if cleaned.startswith("```"):
|
|
17
|
+
lines = cleaned.split("\n")
|
|
18
|
+
if lines and lines[0].startswith("```"):
|
|
19
|
+
lines = lines[1:]
|
|
20
|
+
if lines and lines[-1].strip().startswith("```"):
|
|
21
|
+
lines = lines[:-1]
|
|
22
|
+
cleaned = "\n".join(lines).strip()
|
|
23
|
+
return cleaned
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class BRDConsolidator:
|
|
27
|
+
def __init__(self, llm: LlmClient, context: Optional[ContextAggregator] = None):
|
|
28
|
+
self.llm = llm
|
|
29
|
+
self.context = context or ContextAggregator([])
|
|
30
|
+
|
|
31
|
+
def consolidate(
|
|
32
|
+
self,
|
|
33
|
+
title: str,
|
|
34
|
+
design: str,
|
|
35
|
+
draft_report: str,
|
|
36
|
+
*,
|
|
37
|
+
bundle: Optional[ContextBundle] = None,
|
|
38
|
+
on_progress: Optional[ProgressCallback] = None,
|
|
39
|
+
) -> Dict[str, Any]:
|
|
40
|
+
emit(on_progress, type="activity", phase="consolidate", message="Preparing BRD consolidation prompt…")
|
|
41
|
+
bundle = bundle or self.context.gather(title, design)
|
|
42
|
+
base_user = build_base_user_prompt(title, design, bundle)
|
|
43
|
+
dr = (draft_report or "").strip()
|
|
44
|
+
if len(dr) > 120_000:
|
|
45
|
+
dr = dr[:120_000] + "\n\n_(truncated for consolidation)_\n"
|
|
46
|
+
user_content = (
|
|
47
|
+
f"{base_user.strip()}\n\n---\n\n"
|
|
48
|
+
f"# Draft requirements report (may use role-based sections — merge into the standard outline)\n\n{dr}\n\n"
|
|
49
|
+
"---\n\n"
|
|
50
|
+
"Rewrite into the complete structured BRD now. Every ## section must be detailed "
|
|
51
|
+
"(tables with IDs and acceptance signals, not a summary). Output markdown only."
|
|
52
|
+
)
|
|
53
|
+
emit(
|
|
54
|
+
on_progress,
|
|
55
|
+
type="activity",
|
|
56
|
+
phase="consolidate",
|
|
57
|
+
message="Calling model — streaming BRD sections…",
|
|
58
|
+
)
|
|
59
|
+
try:
|
|
60
|
+
out = self.llm.stream_chat(
|
|
61
|
+
[ChatMessage("system", BRD_CONSOLIDATION_SYSTEM), ChatMessage("user", user_content)],
|
|
62
|
+
max_tokens=20000,
|
|
63
|
+
temperature=0.25,
|
|
64
|
+
on_delta=make_stream_reporter(on_progress, phase="consolidate", track_headings=True),
|
|
65
|
+
).content
|
|
66
|
+
except Exception as e:
|
|
67
|
+
emit(on_progress, type="activity", phase="consolidate", message=f"BRD failed: {e}")
|
|
68
|
+
return {"success": False, "report_markdown": draft_report, "error": str(e)}
|
|
69
|
+
if not out:
|
|
70
|
+
return {
|
|
71
|
+
"success": False,
|
|
72
|
+
"report_markdown": draft_report,
|
|
73
|
+
"error": "The model returned no content.",
|
|
74
|
+
}
|
|
75
|
+
cleaned = _strip_fence(out)
|
|
76
|
+
first_line = cleaned.split("\n", 1)[0].strip().lower()
|
|
77
|
+
if first_line != "# requirements report":
|
|
78
|
+
cleaned = f"{REQUIREMENTS_REPORT_MD_TITLE}\n\n{cleaned.lstrip()}"
|
|
79
|
+
emit(
|
|
80
|
+
on_progress,
|
|
81
|
+
type="activity",
|
|
82
|
+
phase="consolidate",
|
|
83
|
+
message=f"BRD draft ready ({len(cleaned):,} chars)",
|
|
84
|
+
preview=cleaned[-700:],
|
|
85
|
+
)
|
|
86
|
+
return {"success": True, "report_markdown": cleaned, "error": None}
|