@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.
Files changed (234) hide show
  1. package/HOW_TO_USE.md +337 -8
  2. package/dist/docs-site/docs/area-operations/index.html +126 -2
  3. package/dist/docs-site/docs/area-quality/index.html +159 -3
  4. package/dist/docs-site/docs/area-setup/index.html +1 -0
  5. package/dist/docs-site/docs/area-test-cases/index.html +25 -0
  6. package/dist/docs-site/docs/overview/index.html +2 -2
  7. package/dist/docs-site/docs/search.js +1 -1
  8. package/dist/forgeqe.js +2159 -1928
  9. package/dist/requirement-agent/requirements_agent/__init__.py +3 -0
  10. package/dist/requirement-agent/requirements_agent/__main__.py +5 -0
  11. package/dist/requirement-agent/requirements_agent/agent.py +363 -0
  12. package/dist/requirement-agent/requirements_agent/chat_session.py +424 -0
  13. package/dist/requirement-agent/requirements_agent/cli.py +870 -0
  14. package/dist/requirement-agent/requirements_agent/config.py +403 -0
  15. package/dist/requirement-agent/requirements_agent/console_ui.py +632 -0
  16. package/dist/requirement-agent/requirements_agent/context/__init__.py +3 -0
  17. package/dist/requirement-agent/requirements_agent/context/aggregate.py +214 -0
  18. package/dist/requirement-agent/requirements_agent/context/base.py +14 -0
  19. package/dist/requirement-agent/requirements_agent/context/folder.py +107 -0
  20. package/dist/requirement-agent/requirements_agent/context/given.py +70 -0
  21. package/dist/requirement-agent/requirements_agent/context/graph.py +181 -0
  22. package/dist/requirement-agent/requirements_agent/context/knowledge.py +192 -0
  23. package/dist/requirement-agent/requirements_agent/context/mcp.py +24 -0
  24. package/dist/requirement-agent/requirements_agent/context/memory.py +144 -0
  25. package/dist/requirement-agent/requirements_agent/context/personas.py +214 -0
  26. package/dist/requirement-agent/requirements_agent/context/rag.py +148 -0
  27. package/dist/requirement-agent/requirements_agent/context/untrusted.py +56 -0
  28. package/dist/requirement-agent/requirements_agent/docs/HOW_TO_USE.md +505 -0
  29. package/dist/requirement-agent/requirements_agent/docs/requirements-agent-architecture.html +348 -0
  30. package/dist/requirement-agent/requirements_agent/docs_cmd.py +51 -0
  31. package/dist/requirement-agent/requirements_agent/export/__init__.py +3 -0
  32. package/dist/requirement-agent/requirements_agent/export/markdown.py +55 -0
  33. package/dist/requirement-agent/requirements_agent/export/pdf.py +82 -0
  34. package/dist/requirement-agent/requirements_agent/export/requirements_json.py +120 -0
  35. package/dist/requirement-agent/requirements_agent/init_cmd.py +191 -0
  36. package/dist/requirement-agent/requirements_agent/llm/__init__.py +3 -0
  37. package/dist/requirement-agent/requirements_agent/llm/base.py +49 -0
  38. package/dist/requirement-agent/requirements_agent/llm/copilot.py +171 -0
  39. package/dist/requirement-agent/requirements_agent/llm/mock.py +144 -0
  40. package/dist/requirement-agent/requirements_agent/llm/providers.py +277 -0
  41. package/dist/requirement-agent/requirements_agent/llm/router.py +35 -0
  42. package/dist/requirement-agent/requirements_agent/models.py +73 -0
  43. package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/agents/analyst.md +29 -0
  44. package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/agents/architect.md +28 -0
  45. package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/agents/bmad-orchestrator.md +26 -0
  46. package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/agents/dev.md +27 -0
  47. package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/agents/pm.md +27 -0
  48. package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/agents/po.md +27 -0
  49. package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/agents/qa.md +28 -0
  50. package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/agents/sm.md +26 -0
  51. package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/checklists/spec-circuit-analyst.md +8 -0
  52. package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/checklists/spec-circuit-architect.md +11 -0
  53. package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/checklists/spec-circuit-dev.md +11 -0
  54. package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/checklists/spec-circuit-orchestrator.md +9 -0
  55. package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/checklists/spec-circuit-pm.md +9 -0
  56. package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/checklists/spec-circuit-po.md +10 -0
  57. package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/checklists/spec-circuit-qa.md +11 -0
  58. package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/checklists/spec-circuit-sm.md +8 -0
  59. package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/data/bmad-kb.md +19 -0
  60. package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/data/requirements-standards-baseline.md +188 -0
  61. package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/data/technical-preferences.md +54 -0
  62. package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/utils/template-format.md +7 -0
  63. package/dist/requirement-agent/requirements_agent/packs/bmad-core-spec/workflows/greenfield-fullstack.yml +177 -0
  64. package/dist/requirement-agent/requirements_agent/pipeline/__init__.py +3 -0
  65. package/dist/requirement-agent/requirements_agent/pipeline/brd.py +86 -0
  66. package/dist/requirement-agent/requirements_agent/pipeline/pack.py +233 -0
  67. package/dist/requirement-agent/requirements_agent/pipeline/progress.py +60 -0
  68. package/dist/requirement-agent/requirements_agent/pipeline/prompts.py +150 -0
  69. package/dist/requirement-agent/requirements_agent/pipeline/quality.py +124 -0
  70. package/dist/requirement-agent/requirements_agent/pipeline/refine.py +386 -0
  71. package/dist/requirement-agent/requirements_agent/pipeline/sections.py +117 -0
  72. package/dist/requirement-agent/requirements_agent/pipeline/spec_circuit.py +142 -0
  73. package/dist/requirement-agent/requirements_agent/shell/__init__.py +7 -0
  74. package/dist/requirement-agent/requirements_agent/shell/actions.py +208 -0
  75. package/dist/requirement-agent/requirements_agent/shell/app.py +902 -0
  76. package/dist/requirement-agent/requirements_agent/shell/commands.py +206 -0
  77. package/dist/requirement-agent/requirements_agent/shell/progress_pane.py +114 -0
  78. package/dist/requirement-agent/requirements_agent/shell/ref_picker.py +59 -0
  79. package/dist/requirement-agent/requirements_agent/shell/refs.py +120 -0
  80. package/dist/requirement-agent/requirements_agent/shell/session.py +362 -0
  81. package/dist/requirement-agent/requirements_agent/shell/transcript.py +241 -0
  82. package/dist/requirement-agent/requirements_agent/shell/usage.py +64 -0
  83. package/dist/requirement-agent/requirements_agent/shell/usage_llm.py +64 -0
  84. package/dist/requirement-agent/requirements_agent/shell/worker.py +378 -0
  85. package/dist/requirement-agent/requirements_agent/tuios_hook.py +182 -0
  86. package/dist/requirement-agent/requirements_agent/webops.py +627 -0
  87. package/dist/template.html +67 -67
  88. package/dist/web/assets/{3d-force-graph-Df2wOlpF.js → 3d-force-graph-KUdc_88B.js} +3 -3
  89. package/dist/web/assets/Agent-Bd54dLhD.js +10 -0
  90. package/dist/web/assets/AgentWork-CqMhsFBP.js +2 -0
  91. package/dist/web/assets/ApiTests-BO_sKAg8.js +15 -0
  92. package/dist/web/assets/Browse-BjPPdirz.js +1 -0
  93. package/dist/web/assets/Chat-DO-UvDWX.js +3 -0
  94. package/dist/web/assets/CommandPalette-BBGtkkz4.js +1 -0
  95. package/dist/web/assets/Compare-BFuLcrBB.js +1 -0
  96. package/dist/web/assets/Cost-DbKrBm9m.js +1 -0
  97. package/dist/web/assets/{Data-Be3ZNkUu.js → Data-B6_6Rm7C.js} +4 -4
  98. package/dist/web/assets/Desktop-CnBxMp68.js +1 -0
  99. package/dist/web/assets/DesktopReview-DVITz4Jv.js +2 -0
  100. package/dist/web/assets/DeviceScreen-BHmTd9Q-.js +1 -0
  101. package/dist/web/assets/Evidence-BZx9UF1t.js +1 -0
  102. package/dist/web/assets/{Explore-AtSStzNg.js → Explore-Kkl9koqy.js} +2 -2
  103. package/dist/web/assets/Features-_WrrIGBz.js +1 -0
  104. package/dist/web/assets/{Flags-GxmNrnSn.js → Flags-BGqG09qD.js} +2 -2
  105. package/dist/web/assets/Flaky-B7mr96H8.js +1 -0
  106. package/dist/web/assets/Impact-DzAtWie1.js +3 -0
  107. package/dist/web/assets/Jobs-YSmfG7C9.js +5 -0
  108. package/dist/web/assets/KindPage-UqU2qh63.js +6 -0
  109. package/dist/web/assets/LiveDevice-jFCQ_zeU.js +1 -0
  110. package/dist/web/assets/Migration-CfHZeobD.js +8 -0
  111. package/dist/web/assets/Mobile-DTMPjWeO.js +1 -0
  112. package/dist/web/assets/Observability-B-9cikxK.js +1 -0
  113. package/dist/web/assets/OwnItems-BC9M20At.js +5 -0
  114. package/dist/web/assets/PageAgent-CvV8gwuP.js +1 -0
  115. package/dist/web/assets/Product-lDXsflpD.js +6 -0
  116. package/dist/web/assets/Production-BHXWX-ww.js +1 -0
  117. package/dist/web/assets/Quality-Bsljiu_v.js +1 -0
  118. package/dist/web/assets/Readiness-BZppEirK.js +1 -0
  119. package/dist/web/assets/Record-7h0EFEiJ.js +1 -0
  120. package/dist/web/assets/Regression-DdM66t2E.js +5 -0
  121. package/dist/web/assets/RelationGraph-CBY9FhUu.js +1 -0
  122. package/dist/web/assets/Reports-u72R1XBV.js +2 -0
  123. package/dist/web/assets/Requirements-BAcEi5Fl.js +2 -0
  124. package/dist/web/assets/Responsive-CCPzSbdd.js +3 -0
  125. package/dist/web/assets/RunDiff-CGhLqPpP.js +1 -0
  126. package/dist/web/assets/Settings-DDCiQZ0T.js +21 -0
  127. package/dist/web/assets/Steps-sfVkdv7g.js +2 -0
  128. package/dist/web/assets/TestData-B4-xVlvt.js +2 -0
  129. package/dist/web/assets/TestManagement-BGBKGV1L.js +4 -0
  130. package/dist/web/assets/WhatsNew-BMTuBbaX.js +1 -0
  131. package/dist/web/assets/agentSettingsSheet-Cc2W6lyp.js +1 -0
  132. package/dist/web/assets/api-BsiuHmJq.js +1 -0
  133. package/dist/web/assets/choice-C4-yW2x9.js +1 -0
  134. package/dist/web/assets/code-Jek8uWUO.js +1 -0
  135. package/dist/web/assets/{coverage-DirEXtfZ.js → coverage-pqIlfEP0.js} +1 -1
  136. package/dist/web/assets/dataParts-CkwgLllh.js +3 -0
  137. package/dist/web/assets/desktopAppPath-D3mGDKPz.js +1 -0
  138. package/dist/web/assets/flowTheme-DKuXe5nP.js +7 -0
  139. package/dist/web/assets/frame-BMpSUo2-.js +13 -0
  140. package/dist/web/assets/index-6SZomYE0.js +55 -0
  141. package/dist/web/assets/index-CWqwtFKz.css +2 -0
  142. package/dist/web/assets/line-icons-CwCZidXs.js +1 -0
  143. package/dist/web/assets/logos-P2LOMyTK.js +1 -0
  144. package/dist/web/assets/{markdown-BnrLv6Iw.js → markdown-1wY7hIbM.js} +5 -5
  145. package/dist/web/assets/nav-B_68FVw_.js +1 -0
  146. package/dist/web/assets/pageBack-CbyKfisx.js +3 -0
  147. package/dist/web/assets/palette-6YAAmgkD.js +1 -0
  148. package/dist/web/assets/{paletteCommands-LXIICD4V.js → paletteCommands-Isq1rLs-.js} +1 -1
  149. package/dist/web/assets/parts-ClnDV-6r.js +1 -0
  150. package/dist/web/assets/preload-helper-BupTYkQW.js +1 -0
  151. package/dist/web/assets/productParts-D18glCBr.js +1 -0
  152. package/dist/web/assets/qualityParts-1F1Ee4Ay.js +1 -0
  153. package/dist/web/assets/radio-BLI4Ubhk.js +1 -0
  154. package/dist/web/assets/react-BDur5s0O.js +1 -0
  155. package/dist/web/assets/{recordTest-BzKpS4m5.js → recordTest-7uIZiqOW.js} +1 -1
  156. package/dist/web/assets/route-oDy8sV6H.js +1 -0
  157. package/dist/web/assets/sectionList-B651VPon.js +1 -0
  158. package/dist/web/assets/step-mark-CaKf4dAR.js +1 -0
  159. package/dist/web/assets/stepper-DdgwJtbU.js +1 -0
  160. package/dist/web/assets/utils-DJRAScIl.js +1 -0
  161. package/dist/web/assets/wizardParts-C0cNmIK9.js +1 -0
  162. package/dist/web/index.html +15 -13
  163. package/docs/user-guide.html +309 -3
  164. package/evals/prompts/perf-report/limit-broken.yaml +28 -0
  165. package/evals/prompts/perf-report/regression-other-load.yaml +28 -0
  166. package/forgeqe.example.yaml +10 -0
  167. package/package.json +2 -1
  168. package/prompts/README.md +4 -0
  169. package/prompts/brain.md +17 -0
  170. package/prompts/perf-report.md +41 -0
  171. package/prompts/perf-strategy.md +45 -0
  172. package/prompts/perf.md +45 -0
  173. package/prompts/team-builder.md +50 -0
  174. package/py/forgeqe_engine/cli.py +7 -0
  175. package/dist/web/assets/Agent-CRfgRnq2.js +0 -8
  176. package/dist/web/assets/AgentWork-DqiO3LUi.js +0 -2
  177. package/dist/web/assets/ApiTests-DCAnizu5.js +0 -15
  178. package/dist/web/assets/Browse-D5VDHN9Z.js +0 -1
  179. package/dist/web/assets/Chat-CLGQ1ymU.js +0 -3
  180. package/dist/web/assets/CommandPalette-D3F4iHrP.js +0 -1
  181. package/dist/web/assets/Compare-B1WN67Ny.js +0 -1
  182. package/dist/web/assets/Cost-Dk4m3r8z.js +0 -1
  183. package/dist/web/assets/Desktop-B3GcbaPu.js +0 -1
  184. package/dist/web/assets/DesktopReview-DfvAL3m8.js +0 -2
  185. package/dist/web/assets/DeviceScreen-DJqblqBh.js +0 -1
  186. package/dist/web/assets/Evidence-BsA7vCZG.js +0 -1
  187. package/dist/web/assets/Features-CDBlFLaJ.js +0 -1
  188. package/dist/web/assets/Flaky-C062Mh6z.js +0 -1
  189. package/dist/web/assets/Impact-BeXw3-oL.js +0 -3
  190. package/dist/web/assets/Jobs-QYWqmdDI.js +0 -5
  191. package/dist/web/assets/KindPage-C2g51s9c.js +0 -6
  192. package/dist/web/assets/LiveDevice-C9LRZMhC.js +0 -1
  193. package/dist/web/assets/Migration-ByUU0Oa_.js +0 -8
  194. package/dist/web/assets/Mobile-Dd3jL0Cn.js +0 -1
  195. package/dist/web/assets/Observability-Dx4ZCRDj.js +0 -1
  196. package/dist/web/assets/PageAgent-DYBOhs2x.js +0 -1
  197. package/dist/web/assets/Product-Ch1XAeAT.js +0 -12
  198. package/dist/web/assets/Production-TEdyFmo4.js +0 -1
  199. package/dist/web/assets/Quality-DH8EdI2u.js +0 -1
  200. package/dist/web/assets/Readiness-B8S7Ex0C.js +0 -1
  201. package/dist/web/assets/Record-uFQ-YaHg.js +0 -1
  202. package/dist/web/assets/Regression-CSDT2AnY.js +0 -5
  203. package/dist/web/assets/RelationGraph-gc0Xmklt.js +0 -1
  204. package/dist/web/assets/Reports-CSHhRfWv.js +0 -2
  205. package/dist/web/assets/Responsive-CEG1hbbQ.js +0 -3
  206. package/dist/web/assets/RunDiff-CHrMivzC.js +0 -1
  207. package/dist/web/assets/Settings-B63s0b1g.js +0 -21
  208. package/dist/web/assets/Steps-BsDjv-pm.js +0 -2
  209. package/dist/web/assets/TestData-CJoCXihI.js +0 -2
  210. package/dist/web/assets/TestManagement-Dkb-paWh.js +0 -4
  211. package/dist/web/assets/WhatsNew-Dtk9mJU4.js +0 -1
  212. package/dist/web/assets/agentSettingsSheet-BlM8KSpN.js +0 -1
  213. package/dist/web/assets/api-6pHfHEgB.js +0 -1
  214. package/dist/web/assets/choice-CiFogD01.js +0 -1
  215. package/dist/web/assets/code-DzYywAs5.js +0 -1
  216. package/dist/web/assets/dataParts-Di7PdPHu.js +0 -3
  217. package/dist/web/assets/desktopAppPath-B8j1-pX0.js +0 -1
  218. package/dist/web/assets/frame-CNLw552P.js +0 -13
  219. package/dist/web/assets/index-DLuCgQKX.js +0 -55
  220. package/dist/web/assets/index-DRcPg81h.css +0 -2
  221. package/dist/web/assets/line-icons-B-O8oBsY.js +0 -1
  222. package/dist/web/assets/nav-Ds_6IERv.js +0 -1
  223. package/dist/web/assets/pageBack-DJxbEPfN.js +0 -3
  224. package/dist/web/assets/palette-H2g-hemT.js +0 -1
  225. package/dist/web/assets/parts-DKRLtrjs.js +0 -1
  226. package/dist/web/assets/preload-helper-BML5SvL4.js +0 -1
  227. package/dist/web/assets/productParts-imNtw-1N.js +0 -1
  228. package/dist/web/assets/qualityParts-DJhFlgCm.js +0 -1
  229. package/dist/web/assets/radio-CbR6ODxQ.js +0 -1
  230. package/dist/web/assets/route-DjewvmpL.js +0 -1
  231. package/dist/web/assets/sectionList-0umoKvRv.js +0 -1
  232. package/dist/web/assets/step-mark-g8Eb6foB.js +0 -1
  233. package/dist/web/assets/stepper-CzZIC36d.js +0 -1
  234. /package/dist/web/assets/{Product-DLioOiRN.css → flowTheme-DLioOiRN.css} +0 -0
@@ -0,0 +1,505 @@
1
+ # How to use Requirements Agent
2
+
3
+ Self-contained Spec Circuit agent: brief + references → multi-persona review → quality score → **gap-driven refine** → Markdown/PDF.
4
+
5
+ No FastAPI or Mongo. You configure an LLM and run from the terminal.
6
+
7
+ | Doc | Purpose |
8
+ |-----|---------|
9
+ | This guide | Setup + how to run |
10
+ | [`requirements-agent-architecture.html`](requirements-agent-architecture.html) | Interactive architecture (open in a browser) |
11
+
12
+ After install:
13
+
14
+ ```bash
15
+ req-agent docs # print paths to bundled docs
16
+ req-agent docs --open # open the architecture HTML
17
+ req-agent docs --copy ./docs # copy HOW_TO_USE.md + HTML into a folder
18
+ ```
19
+
20
+ ---
21
+
22
+ ## What you need to run
23
+
24
+ ### Required
25
+
26
+ | Requirement | Notes |
27
+ |-------------|--------|
28
+ | **Python 3.9+** | 3.10+ recommended. Check: `python3 --version` |
29
+ | **pip** | To install `requirements-agent` |
30
+ | **A terminal** | macOS Terminal, iTerm, VS Code / Cursor integrated terminal, Windows Terminal, etc. |
31
+ | **An LLM** | At least one profile in `llms.json` with a working API key **or** use `mock` for dry-runs |
32
+
33
+ ### Optional
34
+
35
+ | Optional | Why |
36
+ |----------|-----|
37
+ | **npm 18+** | Only if you prefer `npx req-agent` / global npm launcher |
38
+ | **WeasyPrint system libs** | Nicer PDF (`pip install requirements-agent[pdf]`); without them, fpdf2 still works |
39
+ | **Git** | For `/ref @git` |
40
+ | **A design brief file** | e.g. `brief.md` — or paste design via `/brief` / `--design` |
41
+
42
+ ### Not required
43
+
44
+ - MongoDB / FastAPI
45
+ - Docker
46
+
47
+ ---
48
+
49
+ ## Install
50
+
51
+ ### Option A — pip (recommended)
52
+
53
+ ```bash
54
+ python3 -m pip install -U requirements-agent
55
+ req-agent --help
56
+ ```
57
+
58
+ ### Option B — npm launcher
59
+
60
+ Installs / ensures the Python package via postinstall:
61
+
62
+ ```bash
63
+ npm install -g req-agent
64
+ # or one-shot:
65
+ npx req-agent --help
66
+ ```
67
+
68
+ Requires `python3` and `pip` on `PATH`.
69
+
70
+ ### Option C — from source (dev)
71
+
72
+ ```bash
73
+ cd Requirement_Agent
74
+ python3 -m pip install -e ".[dev]"
75
+ ```
76
+
77
+ ### Optional PDF extras
78
+
79
+ ```bash
80
+ python3 -m pip install -U "requirements-agent[pdf]"
81
+ # WeasyPrint may need system packages, e.g. macOS: brew install pango
82
+ # Without [pdf], export still produces PDF via fpdf2.
83
+ ```
84
+
85
+ ---
86
+
87
+ ## First-time setup
88
+
89
+ ### 1. Scaffold config in your project folder
90
+
91
+ ```bash
92
+ mkdir my-req && cd my-req
93
+ req-agent init
94
+ ```
95
+
96
+ This writes:
97
+
98
+ | File | Purpose |
99
+ |------|---------|
100
+ | `requirements-agent.yaml` | Agent settings (active LLM profile, context paths, export) |
101
+ | `llms.json` | Named LLM profiles (Azure / OpenAI / Ollama / mock / …) |
102
+ | `.env.example` | Env var cheat-sheet for API keys |
103
+
104
+ Global config (optional):
105
+
106
+ ```bash
107
+ req-agent init --global
108
+ # → ~/.config/requirements-agent/
109
+ ```
110
+
111
+ ### 2. Configure LLMs (`llms.json`)
112
+
113
+ All model credentials and endpoints live in **`llms.json`**. The agent picks one **named profile** at a time.
114
+
115
+ #### File shape
116
+
117
+ ```json
118
+ {
119
+ "default": "azure-gpt4o",
120
+ "models": {
121
+ "mock": {
122
+ "provider": "mock",
123
+ "model": "mock",
124
+ "temperature": 0.0,
125
+ "description": "Offline dry-run"
126
+ },
127
+ "azure-gpt4o": {
128
+ "provider": "azure",
129
+ "model": "gpt-4o",
130
+ "deployment": "gpt-4o",
131
+ "endpoint": "https://YOUR_RESOURCE.openai.azure.com/",
132
+ "api_key_env": "RA_AZURE_API_KEY",
133
+ "api_version": "2024-05-01-preview",
134
+ "temperature": 0.3
135
+ },
136
+ "openai-gpt4o": {
137
+ "provider": "openai",
138
+ "model": "gpt-4o",
139
+ "api_key_env": "OPENAI_API_KEY",
140
+ "temperature": 0.3
141
+ },
142
+ "ollama-llama": {
143
+ "provider": "ollama",
144
+ "model": "llama3.2",
145
+ "endpoint": "http://127.0.0.1:11434/v1",
146
+ "temperature": 0.2
147
+ },
148
+ "compatible": {
149
+ "provider": "openai_compatible",
150
+ "model": "gpt-4o",
151
+ "endpoint": "https://your-gateway.example/v1",
152
+ "api_key_env": "RA_API_KEY",
153
+ "temperature": 0.3
154
+ }
155
+ }
156
+ }
157
+ ```
158
+
159
+ #### Profile fields
160
+
161
+ | Field | Required | Meaning |
162
+ |-------|----------|---------|
163
+ | `provider` | yes | `azure` · `openai` · `ollama` · `openai_compatible` · `mock` |
164
+ | `model` | yes | Model id (OpenAI) or logical name |
165
+ | `api_key_env` | usually | Name of the **env var** that holds the key (not the key itself) |
166
+ | `endpoint` | azure / ollama / compatible | Base URL (Azure resource or OpenAI-compatible `/v1`) |
167
+ | `deployment` | azure | Azure deployment name (often same as model) |
168
+ | `api_version` | azure | e.g. `2024-05-01-preview` or `2024-12-01-preview` for gpt-5.* |
169
+ | `temperature` | no | Sampling temperature (default ~0.3) |
170
+ | `description` | no | Shown by `req-agent models` |
171
+
172
+ Point the agent at the file and choose the active profile in **`requirements-agent.yaml`**:
173
+
174
+ ```yaml
175
+ llm:
176
+ models_file: ./llms.json
177
+ active: azure-gpt4o # must match a key under models
178
+ ```
179
+
180
+ #### How to select a profile at runtime
181
+
182
+ | Method | Example |
183
+ |--------|---------|
184
+ | YAML `llm.active` | `active: azure-gpt4o` |
185
+ | CLI flag | `req-agent start -p azure-gpt4o` |
186
+ | CLI flag | `req-agent run --profile openai-gpt4o …` |
187
+ | Env | `export RA_LLM_PROFILE=azure-gpt4o` |
188
+ | Env overrides | `RA_LLM_PROVIDER`, `RA_LLM_MODEL`, `RA_LLMS_JSON`, `RA_CONFIG` |
189
+
190
+ List what is loaded:
191
+
192
+ ```bash
193
+ req-agent models
194
+ req-agent models --llms ./llms.json
195
+ ```
196
+
197
+ #### Provider checklist
198
+
199
+ | Provider | Key env | Also need |
200
+ |----------|---------|-----------|
201
+ | `azure` | `RA_AZURE_API_KEY` | `endpoint`, `deployment`, `api_version` |
202
+ | `openai` | `OPENAI_API_KEY` | `model` |
203
+ | `ollama` | (none / dummy) | Ollama running; `endpoint` like `http://127.0.0.1:11434/v1` |
204
+ | `openai_compatible` | `RA_API_KEY` | `endpoint` ending in `/v1` |
205
+ | `mock` | none | No network — for shell dry-runs and CI |
206
+
207
+ **GPT-5 / reasoning deployments on Azure:** use a recent `api_version` (e.g. `2024-12-01-preview`). The client may switch to `max_completion_tokens` automatically.
208
+
209
+ ### 3. Set API keys in the environment
210
+
211
+ Keys are **never** stored in `llms.json` — only the **name** of the env var (`api_key_env`). Export secrets in your shell (or a secret manager):
212
+
213
+ ```bash
214
+ # Azure OpenAI
215
+ export RA_AZURE_API_KEY="…"
216
+ # optional overrides if you prefer env over llms.json fields:
217
+ # export RA_AZURE_ENDPOINT="https://YOUR_RESOURCE.openai.azure.com/"
218
+ # export RA_AZURE_DEPLOYMENT="gpt-4o"
219
+
220
+ # OpenAI
221
+ export OPENAI_API_KEY="…"
222
+
223
+ # Compatible gateways / some Ollama setups
224
+ export RA_API_KEY="…"
225
+ export RA_LLM_ENDPOINT="http://127.0.0.1:11434/v1"
226
+ ```
227
+
228
+ Copy the cheat-sheet from `.env.example` (written by `req-agent init`).
229
+
230
+ ### 4. Configure prompts (`requirements-agent.yaml`)
231
+
232
+ Persona behaviour is controlled under the **`prompts:`** block. Defaults come from the vendored BMAD pack; you only set what you want to change.
233
+
234
+ ```yaml
235
+ prompts:
236
+ # Optional: replace the shared step instruction for every persona.
237
+ # Use {heading} where the ## section title should appear.
238
+ step_instruction: ""
239
+
240
+ # Optional: replace shared guiderails (tone, ID tables, length, compliance).
241
+ guiderails: ""
242
+
243
+ personas:
244
+ bmad-orchestrator:
245
+ system_extra: ""
246
+ analyst:
247
+ system_extra: "Emphasize measurable success criteria and open questions."
248
+ pm:
249
+ system_extra: ""
250
+ po:
251
+ system_extra: ""
252
+ architect:
253
+ system_extra: "Emphasize zero-trust boundaries and data residency."
254
+ # system_override: "" # DANGEROUS — replaces the entire system prompt
255
+ dev:
256
+ system_extra: ""
257
+ qa:
258
+ system_extra: ""
259
+ sm:
260
+ system_extra: ""
261
+ ```
262
+
263
+ #### What each field does
264
+
265
+ | Field | Scope | Behaviour |
266
+ |-------|--------|-----------|
267
+ | `step_instruction` | All personas | If non-empty, replaces the built-in Spec Circuit step instruction. Must include `{heading}` (or plain text). |
268
+ | `guiderails` | All personas | If non-empty, replaces default guiderails (appended after the step instruction). |
269
+ | `personas.<id>.system_extra` | One persona | **Appended** after the full assembled prompt (pack agent.md + checklists + shared data). Prefer this. |
270
+ | `personas.<id>.system_override` | One persona | If set, **replaces the entire system prompt** for that persona (skips pack + guiderails). Use only when you know you need a full custom prompt. |
271
+
272
+ Persona ids (must match keys under `prompts.personas`):
273
+
274
+ `bmad-orchestrator` · `analyst` · `pm` · `po` · `architect` · `dev` · `qa` · `sm`
275
+
276
+ #### How a persona system prompt is assembled
277
+
278
+ For each Spec Circuit step (unless `system_override` is set):
279
+
280
+ 1. **Step instruction** — YAML `step_instruction` or built-in default (with `{heading}`)
281
+ 2. **Guiderails** — YAML `guiderails` or built-in default
282
+ 3. **Shared pack data** — `bmad-kb.md`, `technical-preferences.md`, `requirements-standards-baseline.md`
283
+ 4. **Agent definition** — `packs/bmad-core-spec/agents/<id>.md`
284
+ 5. **Dependencies** — checklists / utils from the pack (char-budgeted)
285
+ 6. **Atlas only** — short workflow excerpt
286
+ 7. **`system_extra`** — your per-persona appendix
287
+
288
+ Refine / quality / BRD / open-questions use separate built-in systems in code (`pipeline/prompts.py`); they are not overridden by the YAML `personas` map today. To steer refine, put guidance in the `/fix N …` answer or chat message.
289
+
290
+ #### Example: tighten Architect + Analyst only
291
+
292
+ ```yaml
293
+ prompts:
294
+ guiderails: |
295
+ Prefer FR-/NFR-/BRULE- tables with acceptance signals.
296
+ Call out gaps and risks explicitly. Do not invent certifications.
297
+ personas:
298
+ analyst:
299
+ system_extra: |
300
+ Always list unresolved discovery questions as a short bullet list.
301
+ architect:
302
+ system_extra: |
303
+ Require explicit authn/authz, tenancy, and data-at-rest controls
304
+ for any identity or SSO requirement.
305
+ ```
306
+
307
+ #### Custom BMAD pack (advanced)
308
+
309
+ ```yaml
310
+ # optional absolute path; or set env SPEC_CIRCUIT_CORE_ROOT
311
+ pack_root: /path/to/custom-bmad-core-spec
312
+ ```
313
+
314
+ The directory must contain an `agents/` folder with the persona `.md` files.
315
+
316
+ ### 5. Prepare inputs
317
+
318
+ | Input | Example |
319
+ |-------|---------|
320
+ | Design brief | `brief.md` — problem, goals, constraints |
321
+ | References | `./contracts/`, OpenAPI, ADRs, wiki exports |
322
+ | Title | Short product name, e.g. `Identity Hub SSO` |
323
+
324
+ ---
325
+
326
+ ## Quick start (shell)
327
+
328
+ Preferred path — chat-first Textual shell:
329
+
330
+ ```bash
331
+ req-agent start
332
+ # pin a profile:
333
+ req-agent start -p azure-gpt4o
334
+
335
+ # or with shortcuts already filled:
336
+ req-agent run -t "Identity Hub SSO" -f ./brief.md --docs ./contracts/ -p azure-gpt4o -o ./out
337
+ ```
338
+
339
+ Inside the shell:
340
+
341
+ ```text
342
+ /title Identity Hub SSO
343
+ /brief ./brief.md
344
+ /ref ./contracts/
345
+ /analyse
346
+ ```
347
+
348
+ | While running | Leave |
349
+ |---------------|--------|
350
+ | `/stop` or `Ctrl+S` — soft-cancel after current LLM step | `/exit` |
351
+
352
+ ---
353
+
354
+ ## After analyse: gap-driven refine
355
+
356
+ When Spec Circuit finishes you get a **refine board**: quality score, report sections, and a numbered list of gaps + open questions.
357
+
358
+ | Command | What it does |
359
+ |---------|----------------|
360
+ | `/fix 3` | Resolve item #3 in one step (auto-picks the best `##` section) |
361
+ | `/fix 3 Prefer OAuth2 PKCE` | Same, with your guidance |
362
+ | `/gap 3` / `/resolve 3` | Aliases for `/fix` |
363
+ | `yes` / `/yes` | Accept the proposed change |
364
+ | `undo` | Revert the last refine |
365
+ | `/section 5` then a message | Manual pin + edit (advanced) |
366
+ | `/report` or `/done` | Write final report files |
367
+
368
+ Numbering is **unified**: quality gaps first, then open questions. Same indices on `/gaps` and `/questions`.
369
+
370
+ ```text
371
+ /fix 1
372
+ yes
373
+ /fix 2 Use 15-minute access tokens and rotating refresh
374
+ yes
375
+ /report --format both
376
+ ```
377
+
378
+ ---
379
+
380
+ ## Commands cheat sheet
381
+
382
+ ### Setup
383
+
384
+ | Command | Purpose |
385
+ |---------|---------|
386
+ | `/title <name>` | Project title |
387
+ | `/brief <path>` | Load design brief from a file |
388
+ | `/out <dir>` | Output folder (default `./out`) |
389
+ | `/open <report.md>` | Continue from an existing report |
390
+ | `/ref` | Interactive reference picker |
391
+ | `/ref <path\|url>` | Add file, folder, or URL |
392
+ | `/ref @workspace` | Attach cwd |
393
+ | `/ref @git` | Attach git context |
394
+
395
+ ### Run
396
+
397
+ | Command | Purpose |
398
+ |---------|---------|
399
+ | `/analyse [focus]` | Start Spec Circuit (`/run` alias) |
400
+ | `/stop` | Soft-cancel current job |
401
+ | `/status` | Title, brief, progress, refs |
402
+
403
+ ### Review & refine
404
+
405
+ | Command | Purpose |
406
+ |---------|---------|
407
+ | `/fix <n> [answer]` | Gap-driven resolve |
408
+ | `/gaps` / `/questions` / `/risk` | List findings with `/fix N` indices |
409
+ | `/trace` | Section outline |
410
+ | `/section <n\|name>` | Pin a section |
411
+ | `/find <text>` | Search the current report |
412
+ | `/undo` / `/yes` | Revert / accept refine |
413
+
414
+ ### Finish
415
+
416
+ | Command | Purpose |
417
+ |---------|---------|
418
+ | `/report [--format md\|pdf\|both]` | Export |
419
+ | `/help` | Full help |
420
+ | `/exit` | Leave the shell |
421
+
422
+ Natural language works too: after a pin, type `Add p95 latency < 300ms`. Paste a path to attach it as `/ref`.
423
+
424
+ ---
425
+
426
+ ## CLI outside the shell
427
+
428
+ ```bash
429
+ # Docs shipped with the package
430
+ req-agent docs
431
+ req-agent docs --open
432
+ req-agent docs --copy ./agent-docs
433
+
434
+ # Headless / CI
435
+ req-agent run \
436
+ --title "Identity Hub SSO" \
437
+ --design-file ./brief.md \
438
+ --docs ./contracts/ \
439
+ --profile azure-gpt4o \
440
+ --plain \
441
+ --out ./out
442
+
443
+ # Continue against an existing report
444
+ req-agent chat -t "Identity Hub SSO" -f brief.md -r ./out/02-requirements-report.md --docs ./contracts/
445
+ ```
446
+
447
+ `--plain` skips the Textual shell and prints Rich progress.
448
+
449
+ Useful env overrides: `RA_CONFIG`, `RA_LLMS_JSON`, `RA_LLM_PROFILE`, `RA_LLM_PROVIDER`, `RA_LLM_MODEL`, `RA_API_KEY` / `OPENAI_API_KEY` / `RA_AZURE_*`.
450
+
451
+ ---
452
+
453
+ ## What gets written
454
+
455
+ Under `--out` / `/out` (typically `./out`):
456
+
457
+ | Artifact | Description |
458
+ |----------|-------------|
459
+ | `01-spec-circuit-report.md` | Multi-persona draft (`##` per role) |
460
+ | `02-requirements-report.md` | Consolidated BRD outline |
461
+ | `open-questions.json` | Extracted questions |
462
+ | `quality.json` | Six-dimension score + top gaps |
463
+ | Optional PDF | When format includes `pdf` |
464
+
465
+ Live saves happen during analyse and after each confirmed refine.
466
+
467
+ ---
468
+
469
+ ## Personas (Spec Circuit)
470
+
471
+ Eight BMAD roles in one-shot review mode (no mid-pipeline chat):
472
+
473
+ | # | Role | Focus |
474
+ |---|------|--------|
475
+ | 1 | Atlas | Frame domains, unknowns, emphasis |
476
+ | 2 | Business Analyst | Clarity, stakeholders, ambiguities |
477
+ | 3 | Product Manager | MVP, KPIs, non-goals |
478
+ | 4 | Product Owner | Acceptance criteria, slicing, DoR |
479
+ | 5 | Solution Architect | NFRs, security, integrations |
480
+ | 6 | Developer | Feasibility, contracts |
481
+ | 7 | QA | Testability, coverage |
482
+ | 8 | Scrum Master | Sprintability, blockers |
483
+
484
+ ---
485
+
486
+ ## Troubleshooting
487
+
488
+ | Symptom | Check |
489
+ |---------|--------|
490
+ | `command not found: req-agent` | `python3 -m pip show requirements-agent`; ensure scripts dir is on `PATH` |
491
+ | Auth / 401 from Azure | `RA_AZURE_API_KEY`, endpoint URL, deployment name, `api_version` |
492
+ | Empty / bad model replies | Wrong profile (`req-agent models`); try `mock` to verify the shell |
493
+ | `brief.md` not found | Create the file or use `--design "…"` / `/brief` |
494
+ | PDF looks plain | Install `[pdf]` extra + WeasyPrint system deps; or stick to Markdown |
495
+ | `/stop` traceback (old builds) | Upgrade to **1.0.0+**: `pip install -U requirements-agent` |
496
+
497
+ ---
498
+
499
+ ## Tips
500
+
501
+ 1. Put contracts, ADRs, and API specs under `/ref` before `/analyse`.
502
+ 2. Prefer `/fix N` over guessing `/section` numbers.
503
+ 3. Confirm with `yes` after each fix; use `undo` freely.
504
+ 4. Use `mock` to dry-run the shell without an API key.
505
+ 5. Open the architecture diagram: `req-agent docs --open`.