@capagents/forgeqe 3.3.0 → 3.3.2
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 +32 -0
- 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/search.js +1 -1
- package/dist/forgeqe.js +1922 -1906
- 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 +66 -66
- package/dist/web/assets/{3d-force-graph-DgKpiu6s.js → 3d-force-graph-DDyP5jcf.js} +1 -1
- package/dist/web/assets/Agent-sLaNlaQo.js +8 -0
- package/dist/web/assets/AgentWork-Dv0G4bt3.js +2 -0
- package/dist/web/assets/ApiTests-Bnw2qgWw.js +15 -0
- package/dist/web/assets/Browse-CBt1JY2E.js +1 -0
- package/dist/web/assets/Chat-DIWdnIZK.js +3 -0
- package/dist/web/assets/CommandPalette-DD04oS83.js +1 -0
- package/dist/web/assets/Compare-D0Ao8dZ6.js +1 -0
- package/dist/web/assets/Cost-BY_8-9Qt.js +1 -0
- package/dist/web/assets/{Data-CkQGUNww.js → Data-BC7R_FbW.js} +4 -4
- package/dist/web/assets/Desktop-CSQ2xLg0.js +1 -0
- package/dist/web/assets/DesktopReview-CCOhUdeJ.js +2 -0
- package/dist/web/assets/DeviceScreen-BHmTd9Q-.js +1 -0
- package/dist/web/assets/Evidence-9W4pqIkC.js +1 -0
- package/dist/web/assets/{Explore-k0Y19Q5T.js → Explore-BndXiEf8.js} +2 -2
- package/dist/web/assets/Features-BrfsTC9Q.js +1 -0
- package/dist/web/assets/{Flags-CXFDO-k_.js → Flags-DyykkeHU.js} +2 -2
- package/dist/web/assets/Flaky-C3gj_Brn.js +1 -0
- package/dist/web/assets/Impact-Z8nbNhbe.js +3 -0
- package/dist/web/assets/Jobs-CJWXAqSy.js +5 -0
- package/dist/web/assets/KindPage-C45x_cFz.js +6 -0
- package/dist/web/assets/LiveDevice-DGdLDigO.js +1 -0
- package/dist/web/assets/Migration-QFI5ctp7.js +8 -0
- package/dist/web/assets/Mobile-CuswZyee.js +1 -0
- package/dist/web/assets/Observability-CknZ_xBN.js +1 -0
- package/dist/web/assets/PageAgent-B2bmmMaP.js +1 -0
- package/dist/web/assets/Product-CrtwDiMv.js +12 -0
- package/dist/web/assets/Production-BMsytC2i.js +1 -0
- package/dist/web/assets/Quality-B4Aw6N3_.js +1 -0
- package/dist/web/assets/Readiness-CVIzTFX-.js +1 -0
- package/dist/web/assets/Record-B2Ic8Taj.js +1 -0
- package/dist/web/assets/Regression-bCIAE3Ne.js +5 -0
- package/dist/web/assets/RelationGraph-kG4YVMzl.js +1 -0
- package/dist/web/assets/Reports-NAZ-26Ub.js +2 -0
- package/dist/web/assets/Requirements-BkpiF-Bt.js +2 -0
- package/dist/web/assets/Responsive-CsaoisJq.js +3 -0
- package/dist/web/assets/RunDiff-BC-3Wg1b.js +1 -0
- package/dist/web/assets/Settings-DyBed-J5.js +21 -0
- package/dist/web/assets/Steps-DcQxQ4yA.js +2 -0
- package/dist/web/assets/TestData-wpUeU9Er.js +2 -0
- package/dist/web/assets/TestManagement-D0njkyAT.js +4 -0
- package/dist/web/assets/WhatsNew-BxIAAwgH.js +1 -0
- package/dist/web/assets/agentSettingsSheet-BdB7IXah.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-q-ib7wOq.js} +1 -1
- package/dist/web/assets/dataParts-B2-a-pOD.js +3 -0
- package/dist/web/assets/desktopAppPath-C-p0zU40.js +1 -0
- package/dist/web/assets/frame-CjpZWX_X.js +13 -0
- package/dist/web/assets/index-BH5RbDNY.css +2 -0
- package/dist/web/assets/index-CfGXe_De.js +55 -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-dXSsS-mD.js} +5 -5
- package/dist/web/assets/nav-BZfNOkhX.js +1 -0
- package/dist/web/assets/pageBack-BwKT31j3.js +3 -0
- package/dist/web/assets/palette-L37b4wTE.js +1 -0
- package/dist/web/assets/{paletteCommands-LXIICD4V.js → paletteCommands-zqGCORJu.js} +1 -1
- package/dist/web/assets/parts-3o6HnCp1.js +1 -0
- package/dist/web/assets/preload-helper-BupTYkQW.js +1 -0
- package/dist/web/assets/productParts-BDiEg0z6.js +1 -0
- package/dist/web/assets/qualityParts--CnSadOZ.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-D092f975.js} +1 -1
- package/dist/web/assets/route-oDy8sV6H.js +1 -0
- package/dist/web/assets/sectionList-XiKcJNEK.js +1 -0
- package/dist/web/assets/step-mark-CaKf4dAR.js +1 -0
- package/dist/web/assets/stepper-naqAN_Nb.js +1 -0
- package/dist/web/assets/utils-DJRAScIl.js +1 -0
- package/dist/web/assets/wizardParts-DLlOHVMx.js +1 -0
- package/dist/web/index.html +14 -12
- package/docs/user-guide.html +26 -0
- package/package.json +2 -1
- package/py/forgeqe_engine/cli.py +7 -0
- package/dist/web/assets/Agent-BP11jrsE.js +0 -8
- package/dist/web/assets/AgentWork-DqiO3LUi.js +0 -2
- package/dist/web/assets/ApiTests-CLFt0wGW.js +0 -15
- package/dist/web/assets/Browse-D5VDHN9Z.js +0 -1
- package/dist/web/assets/Chat-BqqaT-n0.js +0 -3
- package/dist/web/assets/CommandPalette-D3F4iHrP.js +0 -1
- package/dist/web/assets/Compare-KeUsk4G3.js +0 -1
- package/dist/web/assets/Cost-CDdSNCkt.js +0 -1
- package/dist/web/assets/Desktop-COKu5aHU.js +0 -1
- package/dist/web/assets/DesktopReview-CMpXNurd.js +0 -2
- package/dist/web/assets/DeviceScreen-DJqblqBh.js +0 -1
- package/dist/web/assets/Evidence-CPevi78T.js +0 -1
- package/dist/web/assets/Features-D_miisXy.js +0 -1
- package/dist/web/assets/Flaky-CzaQIwXC.js +0 -1
- package/dist/web/assets/Impact-pos046GB.js +0 -3
- package/dist/web/assets/Jobs-C0TtzWA4.js +0 -5
- package/dist/web/assets/KindPage-DAvgKrwt.js +0 -6
- package/dist/web/assets/LiveDevice-C9LRZMhC.js +0 -1
- package/dist/web/assets/Migration-kYknzHdK.js +0 -8
- package/dist/web/assets/Mobile-AVi39qoN.js +0 -1
- package/dist/web/assets/Observability-l1ZN4JL0.js +0 -1
- package/dist/web/assets/PageAgent-DzVjKKYz.js +0 -1
- package/dist/web/assets/Product-CrnXTDkX.js +0 -12
- package/dist/web/assets/Production-B4VlKTlL.js +0 -1
- package/dist/web/assets/Quality-CtjVY15v.js +0 -1
- package/dist/web/assets/Readiness-RUzKklxF.js +0 -1
- package/dist/web/assets/Record-f87pdoaN.js +0 -1
- package/dist/web/assets/Regression-RSnjP5hS.js +0 -5
- package/dist/web/assets/RelationGraph-gc0Xmklt.js +0 -1
- package/dist/web/assets/Reports-881BJZ_u.js +0 -2
- package/dist/web/assets/Responsive-251XAuZE.js +0 -3
- package/dist/web/assets/RunDiff-DG0hKKDs.js +0 -1
- package/dist/web/assets/Settings-Cv3kUuOx.js +0 -21
- package/dist/web/assets/Steps-Cyjk5JtV.js +0 -2
- package/dist/web/assets/TestData-TcXA9UmV.js +0 -2
- package/dist/web/assets/TestManagement-D0e2N_Xr.js +0 -4
- package/dist/web/assets/WhatsNew-COVX946M.js +0 -1
- package/dist/web/assets/agentSettingsSheet-DGFh1_iF.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-CuN17Qrj.js +0 -55
- package/dist/web/assets/index-Dchrk5Yt.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-DvrCr604.js +0 -1
- package/dist/web/assets/qualityParts-BYx5phEI.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
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>Requirements Agent architecture</title>
|
|
7
|
+
<meta name="description" content="How the self-contained CLI Requirements Agent runs Spec Circuit, gap-driven refine, and report export — Textual shell, BMAD personas, folder Memory, and LLMs.">
|
|
8
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
9
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
10
|
+
<link href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700&family=Geist:wght@400;500;600&family=Geist+Mono:wght@500&display=swap" rel="stylesheet">
|
|
11
|
+
<style>
|
|
12
|
+
:root{
|
|
13
|
+
--bg:#F5F7FB; --ink:#0E1A2E; --muted:#5F6B7E; --hair:#DDE3EE; --card:#FFFFFF;
|
|
14
|
+
--sans:'Geist','Inter',system-ui,-apple-system,'Segoe UI',sans-serif;
|
|
15
|
+
--display:'Bricolage Grotesque','Geist','Inter',system-ui,sans-serif;
|
|
16
|
+
--mono:'Geist Mono',ui-monospace,'SF Mono',Menlo,monospace;
|
|
17
|
+
}
|
|
18
|
+
*{box-sizing:border-box}
|
|
19
|
+
html{-webkit-text-size-adjust:100%}
|
|
20
|
+
body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--sans);font-size:15px;line-height:1.55}
|
|
21
|
+
.wrap{max-width:1480px;margin:0 auto;padding:0 clamp(16px,3vw,40px)}
|
|
22
|
+
header{padding:clamp(36px,6vw,72px) 0 clamp(20px,3vw,32px)}
|
|
23
|
+
h1{font-family:var(--display);font-weight:700;font-size:clamp(30px,4.2vw,52px);line-height:1.04;letter-spacing:-0.025em;margin:0 0 16px;max-width:20ch}
|
|
24
|
+
header p{margin:0;max-width:70ch;color:var(--muted);font-size:clamp(15px,1.4vw,17px)}
|
|
25
|
+
.scroller{overflow-x:auto;-webkit-overflow-scrolling:touch;border-radius:16px}
|
|
26
|
+
.scroller svg{display:block;width:100%;min-width:1080px;height:auto}
|
|
27
|
+
.hint{display:none;color:var(--muted);font-size:13px;margin:8px 0 0}
|
|
28
|
+
@media (max-width:1100px){.hint{display:block}}
|
|
29
|
+
.trace{margin-top:20px;background:var(--card);border:1px solid var(--hair);border-radius:14px;padding:20px 24px;min-height:148px;display:grid;grid-template-columns:minmax(220px,1.1fr) 1fr 1fr;gap:24px 40px;align-items:start}
|
|
30
|
+
.trace .idle{grid-column:1/-1;color:var(--muted);margin:0;align-self:center}
|
|
31
|
+
.trace h2{font-family:var(--display);font-size:20px;letter-spacing:-0.01em;margin:0 0 6px;display:flex;align-items:center;gap:10px}
|
|
32
|
+
.trace h2 i{width:9px;height:9px;border-radius:50%;display:inline-block;flex:none}
|
|
33
|
+
.trace .role{margin:0;color:var(--muted);font-size:14px;max-width:52ch}
|
|
34
|
+
.trace .file{font-family:var(--mono);font-size:12px;color:var(--muted);margin-top:8px;display:block}
|
|
35
|
+
.trace h3{font-size:13px;font-weight:600;margin:0 0 8px;color:var(--ink)}
|
|
36
|
+
.trace ul{list-style:none;margin:0;padding:0;font-size:14px}
|
|
37
|
+
.trace li{padding:5px 0;border-top:1px solid var(--hair);display:flex;gap:10px;justify-content:space-between}
|
|
38
|
+
.trace li:first-child{border-top:0;padding-top:0}
|
|
39
|
+
.trace li span:last-child{color:var(--muted);text-align:right}
|
|
40
|
+
.trace .none{color:var(--muted);font-size:14px}
|
|
41
|
+
@media (max-width:900px){.trace{grid-template-columns:1fr}}
|
|
42
|
+
.story{margin:clamp(40px,6vw,72px) 0 clamp(32px,5vw,48px);display:grid;grid-template-columns:minmax(200px,1fr) 2fr;gap:24px 56px}
|
|
43
|
+
.story h2{font-family:var(--display);font-size:clamp(22px,2.4vw,30px);letter-spacing:-0.02em;line-height:1.15;margin:0 0 10px}
|
|
44
|
+
.story .lead{color:var(--muted);margin:0;max-width:36ch}
|
|
45
|
+
ol{list-style:none;margin:0;padding:0;counter-reset:s}
|
|
46
|
+
ol li{display:flex;gap:14px;align-items:flex-start;padding:12px 0;border-top:1px solid var(--hair)}
|
|
47
|
+
ol li:first-child{border-top:0;padding-top:0}
|
|
48
|
+
.n{flex:none;width:22px;height:22px;border-radius:50%;background:var(--ink);color:#fff;font-size:11.5px;font-weight:700;display:grid;place-items:center;margin-top:1px}
|
|
49
|
+
@media (max-width:820px){.story{grid-template-columns:1fr}}
|
|
50
|
+
.sections{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin:0 0 clamp(48px,7vw,96px)}
|
|
51
|
+
@media (max-width:820px){.sections{grid-template-columns:1fr}}
|
|
52
|
+
.card{background:var(--card);border:1px solid var(--hair);border-radius:14px;padding:22px 24px}
|
|
53
|
+
.card h3{font-family:var(--display);font-size:18px;margin:0 0 8px;letter-spacing:-0.01em}
|
|
54
|
+
.card p{margin:0 0 12px;color:var(--muted);font-size:14px}
|
|
55
|
+
.card ul{margin:0;padding:0;list-style:none}
|
|
56
|
+
.card li{padding:8px 0;border-top:1px solid var(--hair);font-size:14px}
|
|
57
|
+
.card li:first-child{border-top:0;padding-top:0}
|
|
58
|
+
.card li strong{display:block;color:var(--ink);font-weight:600;margin-bottom:2px}
|
|
59
|
+
.card .mono{font-family:var(--mono);font-size:12px;color:var(--muted)}
|
|
60
|
+
.doclink{margin:0 0 24px;font-size:14px}
|
|
61
|
+
.doclink a{color:#0B6E4F;font-weight:600;text-decoration:none}
|
|
62
|
+
.doclink a:hover{text-decoration:underline}
|
|
63
|
+
.doclink + .doclink{margin-top:-12px}
|
|
64
|
+
code{font-family:var(--mono);font-size:0.92em}
|
|
65
|
+
</style>
|
|
66
|
+
</head>
|
|
67
|
+
<body>
|
|
68
|
+
<div class="wrap">
|
|
69
|
+
<header>
|
|
70
|
+
<h1>Requirements Agent architecture</h1>
|
|
71
|
+
<p>How the self-contained CLI agent turns a brief and local docs into a Spec Circuit draft, quality score, gap-driven refine, and Markdown/PDF — without FastAPI or Mongo.</p>
|
|
72
|
+
</header>
|
|
73
|
+
<p class="doclink">How to use: <a href="./HOW_TO_USE.md">HOW_TO_USE.md</a> · open via <code>req-agent docs --open</code></p>
|
|
74
|
+
<p class="doclink">Shipped inside the installed package under <code>requirements_agent/docs/</code>. Copy with <code>req-agent docs --copy ./docs</code>.</p>
|
|
75
|
+
|
|
76
|
+
<div class="scroller">
|
|
77
|
+
<svg id="diagram" viewBox="0 0 1400 820" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Requirements Agent CLI architecture: Textual shell, Spec Circuit, gap-driven refine, export, folder Memory, and LLMs.">
|
|
78
|
+
<style>
|
|
79
|
+
.ntitle{font:600 13px 'Geist','Inter',system-ui,-apple-system,'Segoe UI',sans-serif;letter-spacing:-0.005em}
|
|
80
|
+
.nmono{font:500 10.5px 'Geist Mono',ui-monospace,'SF Mono',Menlo,monospace}
|
|
81
|
+
.bandtitle{font:600 12.5px 'Geist','Inter',system-ui,sans-serif}
|
|
82
|
+
.bnum{font:700 10.5px 'Geist','Inter',system-ui,sans-serif;fill:#fff}
|
|
83
|
+
.lgt{font:500 12px 'Geist','Inter',system-ui,sans-serif;fill:#5F6B7E}
|
|
84
|
+
.node{cursor:pointer;outline:none;transition:opacity .15s}
|
|
85
|
+
.node:focus-visible .box{stroke:#0E1A2E;stroke-opacity:1;stroke-width:2}
|
|
86
|
+
.node:hover .box{stroke-opacity:1}
|
|
87
|
+
.edge,.badge{transition:opacity .15s}
|
|
88
|
+
.edge .hit{pointer-events:stroke}
|
|
89
|
+
.tracing .edge:not(.hot),.tracing .badge:not(.hot){opacity:.12}
|
|
90
|
+
.tracing .node:not(.hot){opacity:.38}
|
|
91
|
+
.edge.hot:not(.loop) .line{stroke:var(--hot)}
|
|
92
|
+
.edge.hot:not(.loop) .head{fill:var(--hot)}
|
|
93
|
+
.edge.hot .line{stroke-width:2.4}
|
|
94
|
+
.loop .line{stroke-dasharray:1;animation:draw .5s ease-out both;animation-delay:calc(var(--i)*.42s + .3s)}
|
|
95
|
+
.loop .head,.badge{animation:pop .3s ease-out both;animation-delay:calc(var(--i)*.42s + .62s)}
|
|
96
|
+
.loop .halo{animation:pop .01s both;animation-delay:calc(var(--i)*.42s + .3s)}
|
|
97
|
+
@keyframes draw{from{stroke-dashoffset:1}to{stroke-dashoffset:0}}
|
|
98
|
+
@keyframes pop{from{opacity:0}to{opacity:1}}
|
|
99
|
+
@media (prefers-reduced-motion:reduce){.loop .line,.loop .head,.loop .halo,.badge{animation:none}}
|
|
100
|
+
</style>
|
|
101
|
+
<defs><filter id="sh" x="-10%" y="-20%" width="120%" height="150%"><feDropShadow dx="0" dy="1" stdDeviation="1.2" flood-color="#0E1A2E" flood-opacity="0.07"/></filter></defs>
|
|
102
|
+
<rect width="1400" height="820" fill="#F5F7FB"/>
|
|
103
|
+
|
|
104
|
+
<!-- Bands -->
|
|
105
|
+
<g class="band"><rect x="28" y="88" width="1100" height="120" rx="16" fill="#0B6E4F" fill-opacity="0.06" stroke="#0B6E4F" stroke-opacity="0.22"/><circle cx="68" cy="115" r="4" fill="#0B6E4F"/><text x="80" y="120" class="bandtitle" fill="#0B6E4F">Shell experience</text></g>
|
|
106
|
+
<g class="band"><rect x="28" y="260" width="1100" height="120" rx="16" fill="#C86A0A" fill-opacity="0.055" stroke="#C86A0A" stroke-opacity="0.22"/><circle cx="68" cy="287" r="4" fill="#C86A0A"/><text x="80" y="292" class="bandtitle" fill="#C86A0A">Spec Circuit pipeline</text></g>
|
|
107
|
+
<g class="band"><rect x="28" y="432" width="1100" height="120" rx="16" fill="#2563EB" fill-opacity="0.055" stroke="#2563EB" stroke-opacity="0.22"/><circle cx="68" cy="459" r="4" fill="#2563EB"/><text x="80" y="464" class="bandtitle" fill="#2563EB">Refine & export</text></g>
|
|
108
|
+
<g class="band"><rect x="28" y="604" width="1100" height="120" rx="16" fill="#D02670" fill-opacity="0.055" stroke="#D02670" stroke-opacity="0.22"/><circle cx="68" cy="631" r="4" fill="#D02670"/><text x="80" y="636" class="bandtitle" fill="#D02670">Local knowledge & config</text></g>
|
|
109
|
+
<g class="band"><rect x="1180" y="88" width="192" height="460" rx="16" fill="#5B4BC9" fill-opacity="0.055" stroke="#5B4BC9" stroke-opacity="0.22"/><circle cx="1204" cy="115" r="4" fill="#5B4BC9"/><text x="1216" y="120" class="bandtitle" fill="#5B4BC9">External</text></g>
|
|
110
|
+
|
|
111
|
+
<!-- Support edges -->
|
|
112
|
+
<g class="edge sup" data-from="transcript" data-to="progress"><title>Transcript to Progress pane</title><path class="halo" d="M412,160 L449,160" fill="none" stroke="#F5F7FB" stroke-width="5"/><path class="line" d="M412,160 L449,160" fill="none" stroke="#9AA6BB" stroke-width="1.5"/><path class="head" d="M456,160 L449,163.6 L449,156.4 Z" fill="#9AA6BB"/><path class="hit" d="M412,160 L449,160" fill="none" stroke="transparent" stroke-width="12"/></g>
|
|
113
|
+
<g class="edge sup" data-from="progress" data-to="composer"><title>Progress to Composer</title><path class="halo" d="M608,160 L645,160" fill="none" stroke="#F5F7FB" stroke-width="5"/><path class="line" d="M608,160 L645,160" fill="none" stroke="#9AA6BB" stroke-width="1.5"/><path class="head" d="M652,160 L645,163.6 L645,156.4 Z" fill="#9AA6BB"/><path class="hit" d="M608,160 L645,160" fill="none" stroke="transparent" stroke-width="12"/></g>
|
|
114
|
+
<g class="edge sup" data-from="worker" data-to="prompts"><title>Worker to Prompt Assembler</title><path class="halo" d="M608,332 L645,332" fill="none" stroke="#F5F7FB" stroke-width="5"/><path class="line" d="M608,332 L645,332" fill="none" stroke="#9AA6BB" stroke-width="1.5"/><path class="head" d="M652,332 L645,335.6 L645,328.4 Z" fill="#9AA6BB"/><path class="hit" d="M608,332 L645,332" fill="none" stroke="transparent" stroke-width="12"/></g>
|
|
115
|
+
<g class="edge sup" data-from="prompts" data-to="personas"><title>Prompt Assembler to Personas</title><path class="halo" d="M804,332 L841,332" fill="none" stroke="#F5F7FB" stroke-width="5"/><path class="line" d="M804,332 L841,332" fill="none" stroke="#9AA6BB" stroke-width="1.5"/><path class="head" d="M848,332 L841,335.6 L841,328.4 Z" fill="#9AA6BB"/><path class="hit" d="M804,332 L841,332" fill="none" stroke="transparent" stroke-width="12"/></g>
|
|
116
|
+
<g class="edge sup" data-from="prompts" data-to="pack"><title>Prompts to BMAD pack</title><path class="halo" d="M728,364 L728,420 Q728,428 736,428 L780,428 Q788,428 788,436 L788,580 Q788,588 796,588 L850,588 Q858,588 858,596 L858,641" fill="none" stroke="#F5F7FB" stroke-width="5"/><path class="line" d="M728,364 L728,420 Q728,428 736,428 L780,428 Q788,428 788,436 L788,580 Q788,588 796,588 L850,588 Q858,588 858,596 L858,641" fill="none" stroke="#9AA6BB" stroke-width="1.5"/><path class="head" d="M858,648 L854.4,641 L861.6,641 Z" fill="#9AA6BB"/><path class="hit" d="M728,364 L728,420 Q728,428 736,428 L780,428 Q788,428 788,436 L788,580 Q788,588 796,588 L850,588 Q858,588 858,596 L858,641" fill="none" stroke="transparent" stroke-width="12"/></g>
|
|
117
|
+
<g class="edge sup" data-from="folder" data-to="worker"><title>Folder Memory to Worker</title><path class="halo" d="M336,640 L336,400 Q336,392 344,392 L480,392 Q488,392 488,384 L488,364" fill="none" stroke="#F5F7FB" stroke-width="5"/><path class="line" d="M336,640 L336,400 Q336,392 344,392 L480,392 Q488,392 488,384 L488,364" fill="none" stroke="#9AA6BB" stroke-width="1.5"/><path class="head" d="M488,357 L491.6,364 L484.4,364 Z" fill="#9AA6BB"/><path class="hit" d="M336,640 L336,400 Q336,392 344,392 L480,392 Q488,392 488,384 L488,364" fill="none" stroke="transparent" stroke-width="12"/></g>
|
|
118
|
+
<g class="edge sup" data-from="fix" data-to="confirm"><title>/fix to Confirm</title><path class="halo" d="M412,504 L449,504" fill="none" stroke="#F5F7FB" stroke-width="5"/><path class="line" d="M412,504 L449,504" fill="none" stroke="#9AA6BB" stroke-width="1.5"/><path class="head" d="M456,504 L449,507.6 L449,500.4 Z" fill="#9AA6BB"/><path class="hit" d="M412,504 L449,504" fill="none" stroke="transparent" stroke-width="12"/></g>
|
|
119
|
+
<g class="edge sup" data-from="confirm" data-to="export"><title>Confirm to Export</title><path class="halo" d="M608,504 L645,504" fill="none" stroke="#F5F7FB" stroke-width="5"/><path class="line" d="M608,504 L645,504" fill="none" stroke="#9AA6BB" stroke-width="1.5"/><path class="head" d="M652,504 L645,507.6 L645,500.4 Z" fill="#9AA6BB"/><path class="hit" d="M608,504 L645,504" fill="none" stroke="transparent" stroke-width="12"/></g>
|
|
120
|
+
<g class="edge sup" data-from="session" data-to="export"><title>Session to Export paths</title><path class="halo" d="M680,640 L680,580 Q680,572 688,572 L720,572 Q728,572 728,564 L728,536" fill="none" stroke="#F5F7FB" stroke-width="5"/><path class="line" d="M680,640 L680,580 Q680,572 688,572 L720,572 Q728,572 728,564 L728,536" fill="none" stroke="#9AA6BB" stroke-width="1.5"/><path class="head" d="M728,529 L731.6,536 L724.4,536 Z" fill="#9AA6BB"/><path class="hit" d="M680,640 L680,580 Q680,572 688,572 L720,572 Q728,572 728,564 L728,536" fill="none" stroke="transparent" stroke-width="12"/></g>
|
|
121
|
+
<g class="edge ext" data-from="personas" data-to="llm"><title>Personas to LLM</title><path class="halo" d="M1000,332 L1193,332" fill="none" stroke="#F5F7FB" stroke-width="5"/><path class="line" d="M1000,332 L1193,332" fill="none" stroke="#8A82D6" stroke-width="1.5" stroke-dasharray="5 4"/><path class="head" d="M1200,332 L1193,335.6 L1193,328.4 Z" fill="#8A82D6"/><path class="hit" d="M1000,332 L1193,332" fill="none" stroke="transparent" stroke-width="12"/></g>
|
|
122
|
+
<g class="edge ext" data-from="quality" data-to="llm"><title>Quality to LLM</title><path class="halo" d="M1000,364 L1120,364 Q1128,364 1128,372 L1128,300 Q1128,292 1136,292 L1193,292" fill="none" stroke="#F5F7FB" stroke-width="5"/><path class="line" d="M1000,364 L1120,364 Q1128,364 1128,372 L1128,300 Q1128,292 1136,292 L1193,292" fill="none" stroke="#8A82D6" stroke-width="1.5" stroke-dasharray="5 4"/><path class="head" d="M1200,292 L1193,295.6 L1193,288.4 Z" fill="#8A82D6"/><path class="hit" d="M1000,364 L1120,364 Q1128,364 1128,372 L1128,300 Q1128,292 1136,292 L1193,292" fill="none" stroke="transparent" stroke-width="12"/></g>
|
|
123
|
+
<g class="edge ext" data-from="fix" data-to="llm"><title>/fix refine to LLM</title><path class="halo" d="M336,536 L1100,536 Q1108,536 1108,528 L1108,360 Q1108,352 1116,352 L1193,352" fill="none" stroke="#F5F7FB" stroke-width="5"/><path class="line" d="M336,536 L1100,536 Q1108,536 1108,528 L1108,360 Q1108,352 1116,352 L1193,352" fill="none" stroke="#8A82D6" stroke-width="1.5" stroke-dasharray="5 4"/><path class="head" d="M1200,352 L1193,355.6 L1193,348.4 Z" fill="#8A82D6"/><path class="hit" d="M336,536 L1100,536 Q1108,536 1108,528 L1108,360 Q1108,352 1116,352 L1193,352" fill="none" stroke="transparent" stroke-width="12"/></g>
|
|
124
|
+
<g class="edge sup" data-from="config" data-to="worker"><title>Config to Worker</title><path class="halo" d="M1000,672 L1040,672 Q1048,672 1048,664 L1048,420 Q1048,412 1040,412 L560,412 Q552,412 552,404 L552,364" fill="none" stroke="#F5F7FB" stroke-width="5"/><path class="line" d="M1000,672 L1040,672 Q1048,672 1048,664 L1048,420 Q1048,412 1040,412 L560,412 Q552,412 552,404 L552,364" fill="none" stroke="#9AA6BB" stroke-width="1.5"/><path class="head" d="M552,357 L555.6,364 L548.4,364 Z" fill="#9AA6BB"/><path class="hit" d="M1000,672 L1040,672 Q1048,672 1048,664 L1048,420 Q1048,412 1040,412 L560,412 Q552,412 552,404 L552,364" fill="none" stroke="transparent" stroke-width="12"/></g>
|
|
125
|
+
|
|
126
|
+
<!-- Primary loop -->
|
|
127
|
+
<g class="edge loop" data-from="user" data-to="shell" style="--i:0"><title>User to Shell</title><path class="halo" d="M336,56 L336,121" fill="none" stroke="#F5F7FB" stroke-width="6"/><path class="line" d="M336,56 L336,121" pathLength="1" fill="none" stroke="#0E1A2E" stroke-width="2.4"/><path class="head" d="M336,128 L332.4,121 L339.6,121 Z" fill="#0E1A2E"/><path class="hit" d="M336,56 L336,121" fill="none" stroke="transparent" stroke-width="12"/></g>
|
|
128
|
+
<g class="edge loop" data-from="shell" data-to="worker" style="--i:1"><title>Shell to Worker analyse</title><path class="halo" d="M336,192 L336,236 Q336,244 344,244 L500,244 Q508,244 508,252 L508,293" fill="none" stroke="#F5F7FB" stroke-width="6"/><path class="line" d="M336,192 L336,236 Q336,244 344,244 L500,244 Q508,244 508,252 L508,293" pathLength="1" fill="none" stroke="#0E1A2E" stroke-width="2.4"/><path class="head" d="M508,300 L504.4,293 L511.6,293 Z" fill="#0E1A2E"/><path class="hit" d="M336,192 L336,236 Q336,244 344,244 L500,244 Q508,244 508,252 L508,293" fill="none" stroke="transparent" stroke-width="12"/></g>
|
|
129
|
+
<g class="edge loop" data-from="worker" data-to="folder" style="--i:2"><title>Worker gathers folder context</title><path class="halo" d="M456,332 L380,332 Q372,332 372,340 L372,580 Q372,588 364,588 L336,588 Q328,588 328,596 L328,641" fill="none" stroke="#F5F7FB" stroke-width="6"/><path class="line" d="M456,332 L380,332 Q372,332 372,340 L372,580 Q372,588 364,588 L336,588 Q328,588 328,596 L328,641" pathLength="1" fill="none" stroke="#0E1A2E" stroke-width="2.4"/><path class="head" d="M328,648 L324.4,641 L331.6,641 Z" fill="#0E1A2E"/><path class="hit" d="M456,332 L380,332 Q372,332 372,340 L372,580 Q372,588 364,588 L336,588 Q328,588 328,596 L328,641" fill="none" stroke="transparent" stroke-width="12"/></g>
|
|
130
|
+
<g class="edge loop" data-from="folder" data-to="personas" style="--i:3"><title>Context into personas</title><path class="halo" d="M412,672 L900,672 Q908,672 908,664 L908,396 Q908,388 900,388 L924,388 Q916,388 916,380 L916,364" fill="none" stroke="#F5F7FB" stroke-width="6"/><path class="line" d="M412,672 L900,672 Q908,672 908,664 L908,396 Q908,388 900,388 L924,388 Q916,388 916,380 L916,364" pathLength="1" fill="none" stroke="#0E1A2E" stroke-width="2.4"/><path class="head" d="M916,357 L919.6,364 L912.4,364 Z" fill="#0E1A2E"/><path class="hit" d="M412,672 L900,672 Q908,672 908,664 L908,396 Q908,388 900,388 L924,388 Q916,388 916,380 L916,364" fill="none" stroke="transparent" stroke-width="12"/></g>
|
|
131
|
+
<g class="edge loop" data-from="personas" data-to="quality" style="--i:4"><title>Draft scored</title><path class="halo" d="M924,364 L924,400 Q924,408 916,408 L880,408 Q872,408 872,416 L872,470 Q872,478 880,478 L841,478" fill="none" stroke="#F5F7FB" stroke-width="6"/><path class="line" d="M924,364 L924,400 Q924,408 916,408 L880,408 Q872,408 872,416 L872,470 Q872,478 880,478 L841,478" pathLength="1" fill="none" stroke="#0E1A2E" stroke-width="2.4"/><path class="head" d="M834,478 L841,474.4 L841,481.6 Z" fill="#0E1A2E"/><path class="hit" d="M924,364 L924,400 Q924,408 916,408 L880,408 Q872,408 872,416 L872,470 Q872,478 880,478 L841,478" fill="none" stroke="transparent" stroke-width="12"/></g>
|
|
132
|
+
<g class="edge loop" data-from="quality" data-to="fix" style="--i:5"><title>Gaps to /fix</title><path class="halo" d="M772,504 L419,504" fill="none" stroke="#F5F7FB" stroke-width="6"/><path class="line" d="M772,504 L419,504" pathLength="1" fill="none" stroke="#0E1A2E" stroke-width="2.4"/><path class="head" d="M412,504 L419,500.4 L419,507.6 Z" fill="#0E1A2E"/><path class="hit" d="M772,504 L419,504" fill="none" stroke="transparent" stroke-width="12"/></g>
|
|
133
|
+
<g class="edge loop" data-from="fix" data-to="confirm" style="--i:6"><title>Refine then confirm</title><path class="halo" d="M412,504 L449,504" fill="none" stroke="#F5F7FB" stroke-width="6"/><path class="line" d="M412,504 L449,504" pathLength="1" fill="none" stroke="#0E1A2E" stroke-width="2.4"/><path class="head" d="M456,504 L449,507.6 L449,500.4 Z" fill="#0E1A2E"/><path class="hit" d="M412,504 L449,504" fill="none" stroke="transparent" stroke-width="12"/></g>
|
|
134
|
+
<g class="edge loop" data-from="confirm" data-to="export" style="--i:7"><title>Export report</title><path class="halo" d="M608,504 L645,504" fill="none" stroke="#F5F7FB" stroke-width="6"/><path class="line" d="M608,504 L645,504" pathLength="1" fill="none" stroke="#0E1A2E" stroke-width="2.4"/><path class="head" d="M652,504 L645,507.6 L645,500.4 Z" fill="#0E1A2E"/><path class="hit" d="M608,504 L645,504" fill="none" stroke="transparent" stroke-width="12"/></g>
|
|
135
|
+
|
|
136
|
+
<!-- Nodes: shell -->
|
|
137
|
+
<g class="node" data-id="shell" tabindex="0" role="button" aria-label="Requirements Shell. Textual app: chat, progress, always-on input."><rect class="box" x="260" y="128" width="152" height="64" rx="10" fill="#fff" stroke="#0B6E4F" stroke-opacity="0.55" stroke-width="1.2" filter="url(#sh)"/><text x="276" y="156" class="ntitle" fill="#0E1A2E">Requirements</text><text x="276" y="172" class="ntitle" fill="#0E1A2E">Shell</text></g>
|
|
138
|
+
<g class="node" data-id="transcript" tabindex="0" role="button" aria-label="Transcript. Chat + refine boards and findings."><rect class="box" x="260" y="128" width="0" height="0" fill="none"/><!-- placeholder kept for layout --></g>
|
|
139
|
+
<!-- Reposition: use distinct shell children -->
|
|
140
|
+
<g class="node" data-id="transcript" tabindex="0" role="button" aria-label="Transcript. Chat stream, refine board, confirm board."><rect class="box" x="456" y="128" width="152" height="64" rx="10" fill="#fff" stroke="#0B6E4F" stroke-opacity="0.55" stroke-width="1.2" filter="url(#sh)"/><text x="472" y="156" class="ntitle" fill="#0E1A2E">Transcript</text><text x="472" y="172" class="nmono" fill="#5F6B7E">boards + /fix list</text></g>
|
|
141
|
+
<g class="node" data-id="progress" tabindex="0" role="button" aria-label="Progress pane. Stages, personas, live preview."><rect class="box" x="456" y="128" width="0" height="0" fill="none"/></g>
|
|
142
|
+
<g class="node" data-id="progress" tabindex="0" role="button" aria-label="Progress pane. Stages, personas, live preview."><rect class="box" x="652" y="128" width="152" height="64" rx="10" fill="#fff" stroke="#0B6E4F" stroke-opacity="0.55" stroke-width="1.2" filter="url(#sh)"/><text x="668" y="156" class="ntitle" fill="#0E1A2E">Progress pane</text><text x="668" y="172" class="nmono" fill="#5F6B7E">stages · personas</text></g>
|
|
143
|
+
<g class="node" data-id="composer" tabindex="0" role="button" aria-label="Composer. Always-active input for messages and /commands."><rect class="box" x="848" y="128" width="152" height="64" rx="10" fill="#fff" stroke="#0B6E4F" stroke-opacity="0.55" stroke-width="1.2" filter="url(#sh)"/><text x="864" y="156" class="ntitle" fill="#0E1A2E">Composer</text><text x="864" y="172" class="nmono" fill="#5F6B7E">/fix · /stop · /exit</text></g>
|
|
144
|
+
|
|
145
|
+
<!-- Nodes: pipeline -->
|
|
146
|
+
<g class="node" data-id="worker" tabindex="0" role="button" aria-label="Shell Worker. Background analyse, refine, report with soft /stop."><rect class="box" x="456" y="300" width="152" height="64" rx="10" fill="#fff" stroke="#C86A0A" stroke-opacity="0.55" stroke-width="1.2" filter="url(#sh)"/><text x="472" y="328" class="ntitle" fill="#0E1A2E">Shell Worker</text><text x="472" y="344" class="nmono" fill="#5F6B7E">worker.py</text></g>
|
|
147
|
+
<g class="node" data-id="prompts" tabindex="0" role="button" aria-label="Prompt Assembler. Step instruction, guiderails, pack data, agent.md."><rect class="box" x="652" y="300" width="152" height="64" rx="10" fill="#fff" stroke="#C86A0A" stroke-opacity="0.55" stroke-width="1.2" filter="url(#sh)"/><text x="668" y="328" class="ntitle" fill="#0E1A2E">Prompt Assembler</text><text x="668" y="344" class="nmono" fill="#5F6B7E">build_system_prompt</text></g>
|
|
148
|
+
<g class="node" data-id="personas" tabindex="0" role="button" aria-label="BMAD Personas. Eight sequential Spec Circuit roles."><rect class="box" x="848" y="300" width="152" height="64" rx="10" fill="#fff" stroke="#C86A0A" stroke-opacity="0.55" stroke-width="1.2" filter="url(#sh)"/><text x="864" y="328" class="ntitle" fill="#0E1A2E">BMAD Personas</text><text x="864" y="344" class="nmono" fill="#5F6B7E">REVIEW_PIPELINE</text></g>
|
|
149
|
+
|
|
150
|
+
<!-- Nodes: refine -->
|
|
151
|
+
<g class="node" data-id="fix" tabindex="0" role="button" aria-label="Gap-driven /fix. Maps gap or question to a section and runs one refine."><rect class="box" x="260" y="472" width="152" height="64" rx="10" fill="#fff" stroke="#2563EB" stroke-opacity="0.55" stroke-width="1.2" filter="url(#sh)"/><text x="276" y="500" class="ntitle" fill="#0E1A2E">/fix N</text><text x="276" y="516" class="nmono" fill="#5F6B7E">actions.py</text></g>
|
|
152
|
+
<g class="node" data-id="confirm" tabindex="0" role="button" aria-label="Confirm board. yes keeps the change; undo reverts."><rect class="box" x="456" y="472" width="152" height="64" rx="10" fill="#fff" stroke="#2563EB" stroke-opacity="0.55" stroke-width="1.2" filter="url(#sh)"/><text x="472" y="500" class="ntitle" fill="#0E1A2E">Confirm</text><text x="472" y="516" class="nmono" fill="#5F6B7E">yes · undo</text></g>
|
|
153
|
+
<g class="node" data-id="export" tabindex="0" role="button" aria-label="Export. Writes Spec Circuit, BRD, quality JSON, optional PDF."><rect class="box" x="652" y="472" width="152" height="64" rx="10" fill="#fff" stroke="#2563EB" stroke-opacity="0.55" stroke-width="1.2" filter="url(#sh)"/><text x="668" y="500" class="ntitle" fill="#0E1A2E">Export</text><text x="668" y="516" class="nmono" fill="#5F6B7E">md · pdf</text></g>
|
|
154
|
+
<g class="node" data-id="quality" tabindex="0" role="button" aria-label="Quality & questions. Six-dimension score, top gaps, open-questions.json."><rect class="box" x="848" y="472" width="152" height="64" rx="10" fill="#fff" stroke="#2563EB" stroke-opacity="0.55" stroke-width="1.2" filter="url(#sh)"/><text x="864" y="500" class="ntitle" fill="#0E1A2E">Quality &</text><text x="864" y="516" class="ntitle" fill="#0E1A2E">Questions</text></g>
|
|
155
|
+
|
|
156
|
+
<!-- Nodes: local -->
|
|
157
|
+
<g class="node" data-id="folder" tabindex="0" role="button" aria-label="Folder Memory. /ref paths injected into every persona prompt."><rect class="box" x="260" y="648" width="152" height="64" rx="10" fill="#fff" stroke="#D02670" stroke-opacity="0.55" stroke-width="1.2" filter="url(#sh)"/><path d="M260,661 Q336,670 412,661" fill="none" stroke="#D02670" stroke-opacity="0.4" stroke-width="1"/><text x="276" y="680" class="ntitle" fill="#0E1A2E">Folder Memory</text></g>
|
|
158
|
+
<g class="node" data-id="session" tabindex="0" role="button" aria-label="Shell Session. Live markdown, findings, undo stack, out dir."><rect class="box" x="456" y="648" width="270" height="64" rx="10" fill="#fff" stroke="#D02670" stroke-opacity="0.55" stroke-width="1.2" filter="url(#sh)"/><path d="M456,661 Q591,670 726,661" fill="none" stroke="#D02670" stroke-opacity="0.4" stroke-width="1"/><text x="472" y="680" class="ntitle" fill="#0E1A2E">Shell Session</text><text x="472" y="696" class="nmono" fill="#5F6B7E">session.py · ./out</text></g>
|
|
159
|
+
<g class="node" data-id="pack" tabindex="0" role="button" aria-label="BMAD Role Pack. Vendored agents and checklists."><rect class="box" x="456" y="648" width="0" height="0" fill="none"/></g>
|
|
160
|
+
<g class="node" data-id="pack" tabindex="0" role="button" aria-label="BMAD Role Pack. Vendored agents and checklists."><rect class="box" x="772" y="648" width="152" height="64" rx="10" fill="#fff" stroke="#D02670" stroke-opacity="0.55" stroke-width="1.2" filter="url(#sh)"/><path d="M772,661 Q848,670 924,661" fill="none" stroke="#D02670" stroke-opacity="0.4" stroke-width="1"/><text x="788" y="672" class="ntitle" fill="#0E1A2E">BMAD Pack</text><text x="788" y="688" class="nmono" fill="#5F6B7E">bmad-core-spec</text></g>
|
|
161
|
+
<g class="node" data-id="config" tabindex="0" role="button" aria-label="Config. llms.json profiles and requirements-agent.yaml."><rect class="box" x="968" y="648" width="152" height="64" rx="10" fill="#fff" stroke="#D02670" stroke-opacity="0.55" stroke-width="1.2" filter="url(#sh)"/><path d="M968,661 Q1044,670 1120,661" fill="none" stroke="#D02670" stroke-opacity="0.4" stroke-width="1"/><text x="984" y="672" class="ntitle" fill="#0E1A2E">Config</text><text x="984" y="688" class="nmono" fill="#5F6B7E">llms.json · yaml</text></g>
|
|
162
|
+
|
|
163
|
+
<!-- External -->
|
|
164
|
+
<g class="node" data-id="llm" tabindex="0" role="button" aria-label="LLM Providers. Azure, OpenAI, Ollama, mock."><rect class="box" x="1200" y="300" width="152" height="64" rx="10" fill="#fff" stroke="#5B4BC9" stroke-opacity="0.55" stroke-width="1.2" stroke-dasharray="5 4" filter="url(#sh)"/><text x="1216" y="336" class="ntitle" fill="#0E1A2E">LLM Providers</text></g>
|
|
165
|
+
|
|
166
|
+
<!-- Actor -->
|
|
167
|
+
<g class="node actor" data-id="user" tabindex="0" role="button" aria-label="You. Run req-agent in the terminal and drive refine with /fix."><rect x="270" y="12" width="132" height="44" rx="22" fill="#0E1A2E"/><text x="336" y="38.6" text-anchor="middle" class="ntitle" fill="#fff">You</text></g>
|
|
168
|
+
|
|
169
|
+
<!-- Badges -->
|
|
170
|
+
<g class="badge" data-from="user" data-to="shell" style="--i:0"><circle cx="336" cy="78" r="9.5" fill="#0E1A2E" stroke="#F5F7FB" stroke-width="2"/><text x="336" y="81.9" text-anchor="middle" class="bnum">1</text></g>
|
|
171
|
+
<g class="badge" data-from="shell" data-to="worker" style="--i:1"><circle cx="420" cy="244" r="9.5" fill="#0E1A2E" stroke="#F5F7FB" stroke-width="2"/><text x="420" y="247.9" text-anchor="middle" class="bnum">2</text></g>
|
|
172
|
+
<g class="badge" data-from="worker" data-to="folder" style="--i:2"><circle cx="372" cy="480" r="9.5" fill="#0E1A2E" stroke="#F5F7FB" stroke-width="2"/><text x="372" y="483.9" text-anchor="middle" class="bnum">3</text></g>
|
|
173
|
+
<g class="badge" data-from="folder" data-to="personas" style="--i:3"><circle cx="700" cy="672" r="9.5" fill="#0E1A2E" stroke="#F5F7FB" stroke-width="2"/><text x="700" y="675.9" text-anchor="middle" class="bnum">4</text></g>
|
|
174
|
+
<g class="badge" data-from="personas" data-to="quality" style="--i:4"><circle cx="900" cy="420" r="9.5" fill="#0E1A2E" stroke="#F5F7FB" stroke-width="2"/><text x="900" y="423.9" text-anchor="middle" class="bnum">5</text></g>
|
|
175
|
+
<g class="badge" data-from="quality" data-to="fix" style="--i:5"><circle cx="600" cy="504" r="9.5" fill="#0E1A2E" stroke="#F5F7FB" stroke-width="2"/><text x="600" y="507.9" text-anchor="middle" class="bnum">6</text></g>
|
|
176
|
+
<g class="badge" data-from="fix" data-to="confirm" style="--i:6"><circle cx="434" cy="504" r="9.5" fill="#0E1A2E" stroke="#F5F7FB" stroke-width="2"/><text x="434" y="507.9" text-anchor="middle" class="bnum">7</text></g>
|
|
177
|
+
<g class="badge" data-from="confirm" data-to="export" style="--i:7"><circle cx="630" cy="504" r="9.5" fill="#0E1A2E" stroke="#F5F7FB" stroke-width="2"/><text x="630" y="507.9" text-anchor="middle" class="bnum">8</text></g>
|
|
178
|
+
|
|
179
|
+
<!-- Legend -->
|
|
180
|
+
<g class="legend" transform="translate(48,780)">
|
|
181
|
+
<path d="M0,0 L30,0" stroke="#0E1A2E" stroke-width="2.4" stroke-linecap="round"/><path d="M36,0 L29,-3.6 L29,3.6 Z" fill="#0E1A2E"/><circle cx="15" cy="0" r="8" fill="#0E1A2E" stroke="#F5F7FB" stroke-width="2"/><text x="15" y="3.6" text-anchor="middle" class="bnum">1</text><text x="48" y="4" class="lgt">Primary analyse → refine → export loop</text>
|
|
182
|
+
<g transform="translate(300,0)"><path d="M0,0 L30,0" stroke="#9AA6BB" stroke-width="1.5"/><path d="M36,0 L29,-3.6 L29,3.6 Z" fill="#9AA6BB"/><text x="48" y="4" class="lgt">Direct call</text></g>
|
|
183
|
+
<g transform="translate(420,0)"><path d="M0,0 L30,0" stroke="#8A82D6" stroke-width="1.5" stroke-dasharray="5 4"/><path d="M36,0 L29,-3.6 L29,3.6 Z" fill="#8A82D6"/><text x="48" y="4" class="lgt">External system</text></g>
|
|
184
|
+
</g>
|
|
185
|
+
</svg>
|
|
186
|
+
</div>
|
|
187
|
+
<p class="hint">Scroll sideways to see the full diagram.</p>
|
|
188
|
+
|
|
189
|
+
<section class="trace" id="trace" aria-live="polite">
|
|
190
|
+
<p class="idle">Hover or focus a component to trace what it sends to and receives from.</p>
|
|
191
|
+
</section>
|
|
192
|
+
|
|
193
|
+
<section class="story">
|
|
194
|
+
<div>
|
|
195
|
+
<h2>The CLI loop</h2>
|
|
196
|
+
<p class="lead">From brief + refs to gap-driven refine and files under <code>./out</code>.</p>
|
|
197
|
+
</div>
|
|
198
|
+
<ol>
|
|
199
|
+
<li><span class="n">1</span><span>You open the shell (<code>req-agent start</code>) and set title, brief, and <code>/ref</code> docs.</span></li>
|
|
200
|
+
<li><span class="n">2</span><span><code>/analyse</code> starts the Shell Worker (soft-cancel with <code>/stop</code>).</span></li>
|
|
201
|
+
<li><span class="n">3</span><span>Folder Memory injects referenced files into the context bundle.</span></li>
|
|
202
|
+
<li><span class="n">4</span><span>Eight BMAD personas write sequential <code>##</code> sections into the Spec Circuit draft.</span></li>
|
|
203
|
+
<li><span class="n">5</span><span>Quality scoring + open-question extraction produce gaps and a numbered fix list.</span></li>
|
|
204
|
+
<li><span class="n">6</span><span><code>/fix N</code> maps the item to a section and runs one refine LLM call.</span></li>
|
|
205
|
+
<li><span class="n">7</span><span>Confirm board: <code>yes</code> keeps the change, <code>undo</code> reverts.</span></li>
|
|
206
|
+
<li><span class="n">8</span><span><code>/report</code> writes Spec Circuit, BRD, quality JSON, and optional PDF.</span></li>
|
|
207
|
+
</ol>
|
|
208
|
+
</section>
|
|
209
|
+
|
|
210
|
+
<section class="sections">
|
|
211
|
+
<article class="card">
|
|
212
|
+
<h3>Gap-driven refine</h3>
|
|
213
|
+
<p>One command replaces manual BA mapping of gaps → <span class="mono">/section</span>.</p>
|
|
214
|
+
<ul>
|
|
215
|
+
<li><strong>Unified list</strong> Quality gaps first, then open questions — indices match <span class="mono">/gaps</span> and <span class="mono">/questions</span>.</li>
|
|
216
|
+
<li><strong>/fix N [guidance]</strong> Auto-pins best <span class="mono">##</span> via token overlap; otherwise full document.</li>
|
|
217
|
+
<li><strong>One LLM call</strong> Crafted instruction → existing refine → confirm board.</li>
|
|
218
|
+
<li><strong>Aliases</strong> <span class="mono">/gap</span> and <span class="mono">/resolve</span>.</li>
|
|
219
|
+
</ul>
|
|
220
|
+
</article>
|
|
221
|
+
<article class="card">
|
|
222
|
+
<h3>Shell layout</h3>
|
|
223
|
+
<p>Textual app — chat-first, input always live.</p>
|
|
224
|
+
<ul>
|
|
225
|
+
<li><strong>Transcript (~60%)</strong> Chat, refine board, findings, confirm.</li>
|
|
226
|
+
<li><strong>Progress (~40%)</strong> Stages, personas, live markdown preview.</li>
|
|
227
|
+
<li><strong>Composer</strong> Messages and <span class="mono">/commands</span>; <span class="mono">/stop</span> mid-run.</li>
|
|
228
|
+
<li><strong>Worker</strong> Background thread; queues prompts while busy.</li>
|
|
229
|
+
</ul>
|
|
230
|
+
</article>
|
|
231
|
+
<article class="card">
|
|
232
|
+
<h3>BMAD personas</h3>
|
|
233
|
+
<p>Vendored under <span class="mono">packs/bmad-core-spec</span>.</p>
|
|
234
|
+
<ul>
|
|
235
|
+
<li><strong>1–2</strong> Atlas → Analyst</li>
|
|
236
|
+
<li><strong>3–4</strong> PM → PO</li>
|
|
237
|
+
<li><strong>5–6</strong> Architect → Developer</li>
|
|
238
|
+
<li><strong>7–8</strong> QA → Scrum Master</li>
|
|
239
|
+
</ul>
|
|
240
|
+
</article>
|
|
241
|
+
<article class="card">
|
|
242
|
+
<h3>LLM & prompt config</h3>
|
|
243
|
+
<p>Credentials in <span class="mono">llms.json</span>; behaviour in <span class="mono">requirements-agent.yaml</span>.</p>
|
|
244
|
+
<ul>
|
|
245
|
+
<li><strong>llms.json</strong> Named profiles: provider, model, endpoint, <span class="mono">api_key_env</span>, temperature.</li>
|
|
246
|
+
<li><strong>llm.active</strong> Or <span class="mono">--profile</span> / <span class="mono">RA_LLM_PROFILE</span> to pick one.</li>
|
|
247
|
+
<li><strong>prompts.step_instruction / guiderails</strong> Optional global Spec Circuit overrides.</li>
|
|
248
|
+
<li><strong>personas.*.system_extra</strong> Append guidance per role (preferred).</li>
|
|
249
|
+
<li><strong>personas.*.system_override</strong> Replace entire system prompt for one role.</li>
|
|
250
|
+
</ul>
|
|
251
|
+
</article>
|
|
252
|
+
</section>
|
|
253
|
+
</div>
|
|
254
|
+
|
|
255
|
+
<script>
|
|
256
|
+
(function(){
|
|
257
|
+
var DATA = {"nodes": {
|
|
258
|
+
"user": {"title": "You", "role": "Run req-agent in the terminal; drive analyse and /fix.", "tier": "client", "color": "#0B6E4F", "mono": null},
|
|
259
|
+
"shell": {"title": "Requirements Shell", "role": "Textual app hosting chat, progress, and always-on input.", "tier": "client", "color": "#0B6E4F", "mono": "shell/app.py"},
|
|
260
|
+
"transcript": {"title": "Transcript", "role": "Chat stream, refine board with numbered /fix list, confirm board.", "tier": "client", "color": "#0B6E4F", "mono": "shell/transcript.py"},
|
|
261
|
+
"progress": {"title": "Progress pane", "role": "Stages, persona checklist, live markdown preview.", "tier": "client", "color": "#0B6E4F", "mono": "shell/progress_pane.py"},
|
|
262
|
+
"composer": {"title": "Composer", "role": "Always-active input for messages and /commands including /fix and /stop.", "tier": "client", "color": "#0B6E4F", "mono": "Input #composer"},
|
|
263
|
+
"worker": {"title": "Shell Worker", "role": "Background analyse / refine / report with soft cancel and queued prompts.", "tier": "orch", "color": "#C86A0A", "mono": "shell/worker.py"},
|
|
264
|
+
"prompts": {"title": "Prompt Assembler", "role": "Builds each persona system prompt from instruction, guiderails, data, and agent.md.", "tier": "orch", "color": "#C86A0A", "mono": "pipeline/pack.py"},
|
|
265
|
+
"personas": {"title": "BMAD Personas", "role": "Eight sequential Spec Circuit roles writing ## sections.", "tier": "orch", "color": "#C86A0A", "mono": "REVIEW_PIPELINE"},
|
|
266
|
+
"fix": {"title": "/fix N", "role": "Gap-driven refine: pick gap/question, map section, one refine call.", "tier": "eng", "color": "#2563EB", "mono": "shell/actions.py"},
|
|
267
|
+
"confirm": {"title": "Confirm", "role": "yes keeps the change; undo restores previous markdown.", "tier": "eng", "color": "#2563EB", "mono": "awaiting_confirm"},
|
|
268
|
+
"export": {"title": "Export", "role": "Writes Spec Circuit report, BRD, quality JSON, optional PDF.", "tier": "eng", "color": "#2563EB", "mono": "export/"},
|
|
269
|
+
"quality": {"title": "Quality & Questions", "role": "Six-dimension score, top gaps, open-questions.json for the fix list.", "tier": "eng", "color": "#2563EB", "mono": "pipeline/quality.py"},
|
|
270
|
+
"folder": {"title": "Folder Memory", "role": "/ref paths injected into every persona as context chunks.", "tier": "state", "color": "#D02670", "mono": "context/folder.py"},
|
|
271
|
+
"session": {"title": "Shell Session", "role": "Live docs, findings, undo stack, out_dir, progress metrics.", "tier": "state", "color": "#D02670", "mono": "shell/session.py"},
|
|
272
|
+
"pack": {"title": "BMAD Pack", "role": "Vendored agents, checklists, and shared standards data.", "tier": "state", "color": "#D02670", "mono": "packs/bmad-core-spec"},
|
|
273
|
+
"config": {"title": "Config", "role": "Named LLM profiles and agent YAML settings.", "tier": "state", "color": "#D02670", "mono": "llms.json · requirements-agent.yaml"},
|
|
274
|
+
"llm": {"title": "LLM Providers", "role": "Azure, OpenAI, Ollama, openai_compatible, or mock.", "tier": "ext", "color": "#5B4BC9", "mono": "llm/providers.py"}
|
|
275
|
+
}, "edges": [
|
|
276
|
+
{"f": "user", "t": "shell", "label": "starts req-agent / types commands"},
|
|
277
|
+
{"f": "shell", "t": "transcript", "label": "renders boards and chat"},
|
|
278
|
+
{"f": "shell", "t": "progress", "label": "updates stages"},
|
|
279
|
+
{"f": "shell", "t": "composer", "label": "focuses input"},
|
|
280
|
+
{"f": "transcript", "t": "progress", "label": "shared session state"},
|
|
281
|
+
{"f": "progress", "t": "composer", "label": "chrome refresh"},
|
|
282
|
+
{"f": "shell", "t": "worker", "label": "/analyse · /fix · /report"},
|
|
283
|
+
{"f": "worker", "t": "prompts", "label": "builds persona prompts"},
|
|
284
|
+
{"f": "worker", "t": "folder", "label": "gathers /ref context"},
|
|
285
|
+
{"f": "folder", "t": "worker", "label": "returns chunks"},
|
|
286
|
+
{"f": "folder", "t": "personas", "label": "grounds each step"},
|
|
287
|
+
{"f": "prompts", "t": "personas", "label": "injects agent.md"},
|
|
288
|
+
{"f": "prompts", "t": "pack", "label": "loads agents · data"},
|
|
289
|
+
{"f": "config", "t": "worker", "label": "active LLM profile"},
|
|
290
|
+
{"f": "personas", "t": "llm", "label": "generates ## sections"},
|
|
291
|
+
{"f": "personas", "t": "quality", "label": "draft scored"},
|
|
292
|
+
{"f": "quality", "t": "llm", "label": "scores · extracts questions"},
|
|
293
|
+
{"f": "quality", "t": "fix", "label": "feeds numbered gaps"},
|
|
294
|
+
{"f": "fix", "t": "llm", "label": "one refine call"},
|
|
295
|
+
{"f": "fix", "t": "confirm", "label": "shows preview"},
|
|
296
|
+
{"f": "confirm", "t": "export", "label": "after /report"},
|
|
297
|
+
{"f": "session", "t": "export", "label": "paths under out_dir"}
|
|
298
|
+
]};
|
|
299
|
+
var svg = document.getElementById('diagram');
|
|
300
|
+
var panel = document.getElementById('trace');
|
|
301
|
+
var idle = panel.innerHTML;
|
|
302
|
+
var edges = Array.prototype.slice.call(svg.querySelectorAll('.edge'));
|
|
303
|
+
var badges = Array.prototype.slice.call(svg.querySelectorAll('.badge'));
|
|
304
|
+
var nodes = Array.prototype.slice.call(svg.querySelectorAll('.node'));
|
|
305
|
+
function esc(s){return String(s).replace(/[&<>"]/g,function(c){return {'&':'&','<':'<','>':'>','"':'"'}[c]})}
|
|
306
|
+
function list(items){
|
|
307
|
+
if(!items.length) return '<p class="none">Nothing</p>';
|
|
308
|
+
return '<ul>'+items.map(function(i){return '<li><span>'+esc(i.name)+'</span><span>'+esc(i.label)+'</span></li>'}).join('')+'</ul>';
|
|
309
|
+
}
|
|
310
|
+
function show(id){
|
|
311
|
+
var n = DATA.nodes[id]; if(!n) return;
|
|
312
|
+
var hot = {}; hot[id] = 1;
|
|
313
|
+
var out = [], inc = [];
|
|
314
|
+
DATA.edges.forEach(function(e){
|
|
315
|
+
if(e.f === id){ out.push({name:DATA.nodes[e.t].title,label:e.label}); hot[e.t]=1; }
|
|
316
|
+
if(e.t === id){ inc.push({name:DATA.nodes[e.f].title,label:e.label}); hot[e.f]=1; }
|
|
317
|
+
});
|
|
318
|
+
svg.style.setProperty('--hot', n.color);
|
|
319
|
+
svg.classList.add('tracing');
|
|
320
|
+
function mark(el){
|
|
321
|
+
var on = el.getAttribute('data-from') === id || el.getAttribute('data-to') === id;
|
|
322
|
+
el.classList.toggle('hot', on);
|
|
323
|
+
}
|
|
324
|
+
edges.forEach(mark); badges.forEach(mark);
|
|
325
|
+
nodes.forEach(function(el){ el.classList.toggle('hot', !!hot[el.getAttribute('data-id')]); });
|
|
326
|
+
panel.innerHTML =
|
|
327
|
+
'<div><h2><i style="background:'+n.color+'"></i>'+esc(n.title)+'</h2><p class="role">'+esc(n.role)+'</p>'+(n.mono?'<code class="file">'+esc(n.mono)+'</code>':'')+'</div>'+
|
|
328
|
+
'<div><h3>Sends to</h3>'+list(out)+'</div>'+
|
|
329
|
+
'<div><h3>Receives from</h3>'+list(inc)+'</div>';
|
|
330
|
+
}
|
|
331
|
+
function clear(){
|
|
332
|
+
svg.classList.remove('tracing');
|
|
333
|
+
edges.concat(badges,nodes).forEach(function(el){el.classList.remove('hot')});
|
|
334
|
+
panel.innerHTML = idle;
|
|
335
|
+
}
|
|
336
|
+
nodes.forEach(function(el){
|
|
337
|
+
var id = el.getAttribute('data-id');
|
|
338
|
+
if(!id) return;
|
|
339
|
+
el.addEventListener('mouseenter', function(){show(id)});
|
|
340
|
+
el.addEventListener('mouseleave', clear);
|
|
341
|
+
el.addEventListener('focus', function(){show(id)});
|
|
342
|
+
el.addEventListener('blur', clear);
|
|
343
|
+
el.addEventListener('click', function(){show(id)});
|
|
344
|
+
});
|
|
345
|
+
})();
|
|
346
|
+
</script>
|
|
347
|
+
</body>
|
|
348
|
+
</html>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import shutil
|
|
4
|
+
import webbrowser
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from typing import List, Optional, Tuple
|
|
7
|
+
|
|
8
|
+
DOC_FILES = (
|
|
9
|
+
"HOW_TO_USE.md",
|
|
10
|
+
"requirements-agent-architecture.html",
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def docs_dir() -> Path:
|
|
15
|
+
"""Directory of bundled docs shipped with the package."""
|
|
16
|
+
return Path(__file__).resolve().parent / "docs"
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def list_doc_paths() -> List[Tuple[str, Path]]:
|
|
20
|
+
base = docs_dir()
|
|
21
|
+
return [(name, base / name) for name in DOC_FILES]
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def architecture_html() -> Optional[Path]:
|
|
25
|
+
p = docs_dir() / "requirements-agent-architecture.html"
|
|
26
|
+
return p if p.is_file() else None
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def copy_docs(dest: Path) -> List[Path]:
|
|
30
|
+
dest = dest.expanduser().resolve()
|
|
31
|
+
dest.mkdir(parents=True, exist_ok=True)
|
|
32
|
+
written: List[Path] = []
|
|
33
|
+
base = docs_dir()
|
|
34
|
+
for name in DOC_FILES:
|
|
35
|
+
src = base / name
|
|
36
|
+
if not src.is_file():
|
|
37
|
+
continue
|
|
38
|
+
target = dest / name
|
|
39
|
+
shutil.copy2(src, target)
|
|
40
|
+
written.append(target)
|
|
41
|
+
return written
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def open_architecture() -> Path:
|
|
45
|
+
html = architecture_html()
|
|
46
|
+
if html is None or not html.is_file():
|
|
47
|
+
raise FileNotFoundError(
|
|
48
|
+
"Architecture HTML not found in package. Reinstall requirements-agent."
|
|
49
|
+
)
|
|
50
|
+
webbrowser.open(html.resolve().as_uri())
|
|
51
|
+
return html
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from typing import Any, Dict, Optional
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def write_markdown(path: Path, content: str) -> Path:
|
|
9
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
10
|
+
path.write_text(content or "", encoding="utf-8")
|
|
11
|
+
return path
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def write_json(path: Path, data: Dict[str, Any]) -> Path:
|
|
15
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
16
|
+
path.write_text(json.dumps(data, indent=2), encoding="utf-8")
|
|
17
|
+
return path
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def write_sections(out_dir: Path, sections: list) -> Path:
|
|
21
|
+
sec_dir = out_dir / "sections"
|
|
22
|
+
sec_dir.mkdir(parents=True, exist_ok=True)
|
|
23
|
+
for i, section in enumerate(sections, start=1):
|
|
24
|
+
agent_id = getattr(section, "agent_id", None) or section.get("agent_id")
|
|
25
|
+
content = getattr(section, "content", None) or section.get("content")
|
|
26
|
+
# A persona's section is "persona:<id>": no colon in a file name (Windows refuses one).
|
|
27
|
+
safe = "".join(c if c.isalnum() or c in "-_" else "-" for c in str(agent_id or "section"))[:60]
|
|
28
|
+
name = f"{i:02d}-{safe}.md"
|
|
29
|
+
(sec_dir / name).write_text(content or "", encoding="utf-8")
|
|
30
|
+
return sec_dir
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def export_run_artifacts(
|
|
34
|
+
out_dir: Path,
|
|
35
|
+
*,
|
|
36
|
+
spec_circuit: Optional[str] = None,
|
|
37
|
+
brd: Optional[str] = None,
|
|
38
|
+
quality: Optional[Dict[str, Any]] = None,
|
|
39
|
+
sections: Optional[list] = None,
|
|
40
|
+
meta: Optional[Dict[str, Any]] = None,
|
|
41
|
+
) -> Dict[str, str]:
|
|
42
|
+
out_dir.mkdir(parents=True, exist_ok=True)
|
|
43
|
+
paths: Dict[str, str] = {"out_dir": str(out_dir)}
|
|
44
|
+
if spec_circuit is not None:
|
|
45
|
+
p = write_markdown(out_dir / "01-spec-circuit-report.md", spec_circuit)
|
|
46
|
+
paths["spec_circuit"] = str(p)
|
|
47
|
+
if sections:
|
|
48
|
+
paths["sections"] = str(write_sections(out_dir, sections))
|
|
49
|
+
if quality is not None:
|
|
50
|
+
paths["quality"] = str(write_json(out_dir / "quality-score.json", quality))
|
|
51
|
+
if brd is not None:
|
|
52
|
+
paths["brd"] = str(write_markdown(out_dir / "02-requirements-report.md", brd))
|
|
53
|
+
if meta is not None:
|
|
54
|
+
paths["meta"] = str(write_json(out_dir / "run-meta.json", meta))
|
|
55
|
+
return paths
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import logging
|
|
4
|
+
import re
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
logger = logging.getLogger(__name__)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def _plain_lines(markdown: str) -> list:
|
|
11
|
+
text = markdown or ""
|
|
12
|
+
text = re.sub(r"```[\s\S]*?```", lambda m: m.group(0).replace("```", ""), text)
|
|
13
|
+
lines = []
|
|
14
|
+
for line in text.splitlines():
|
|
15
|
+
line = re.sub(r"^#+\s*", "", line)
|
|
16
|
+
line = re.sub(r"\*\*(.+?)\*\*", r"\1", line)
|
|
17
|
+
line = re.sub(r"`([^`]+)`", r"\1", line)
|
|
18
|
+
# Collapse wide markdown tables into truncated lines for fpdf
|
|
19
|
+
if "|" in line and line.count("|") >= 2:
|
|
20
|
+
cells = [c.strip() for c in line.strip("|").split("|")]
|
|
21
|
+
line = " | ".join(cells)[:110]
|
|
22
|
+
lines.append(line)
|
|
23
|
+
return lines
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def export_pdf_fpdf(markdown: str, path: Path, *, title: str = "Requirements Report") -> Path:
|
|
27
|
+
from fpdf import FPDF
|
|
28
|
+
|
|
29
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
30
|
+
pdf = FPDF()
|
|
31
|
+
pdf.set_auto_page_break(auto=True, margin=15)
|
|
32
|
+
pdf.set_margins(left=15, top=15, right=15)
|
|
33
|
+
pdf.add_page()
|
|
34
|
+
pdf.set_font("Helvetica", "B", 14)
|
|
35
|
+
pdf.multi_cell(w=0, h=8, text=title.encode("latin-1", errors="replace").decode("latin-1"))
|
|
36
|
+
pdf.ln(3)
|
|
37
|
+
pdf.set_font("Helvetica", size=10)
|
|
38
|
+
usable = pdf.epw # effective page width after margins
|
|
39
|
+
for line in _plain_lines(markdown):
|
|
40
|
+
safe = (line or " ").encode("latin-1", errors="replace").decode("latin-1")
|
|
41
|
+
try:
|
|
42
|
+
pdf.multi_cell(w=usable, h=5, text=safe)
|
|
43
|
+
except Exception:
|
|
44
|
+
# Extremely long unbroken tokens — hard-wrap
|
|
45
|
+
chunk = safe
|
|
46
|
+
while chunk:
|
|
47
|
+
pdf.multi_cell(w=usable, h=5, text=chunk[:90])
|
|
48
|
+
chunk = chunk[90:]
|
|
49
|
+
pdf.output(str(path))
|
|
50
|
+
return path
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def export_pdf_weasyprint(markdown: str, path: Path, *, title: str = "Requirements Report") -> Path:
|
|
54
|
+
import markdown as md
|
|
55
|
+
|
|
56
|
+
try:
|
|
57
|
+
from weasyprint import HTML
|
|
58
|
+
except Exception as e:
|
|
59
|
+
raise RuntimeError("WeasyPrint not available") from e
|
|
60
|
+
|
|
61
|
+
html_body = md.markdown(markdown or "", extensions=["tables", "fenced_code"])
|
|
62
|
+
html = f"""<!DOCTYPE html>
|
|
63
|
+
<html><head><meta charset="utf-8"><title>{title}</title>
|
|
64
|
+
<style>
|
|
65
|
+
body {{ font-family: Georgia, serif; margin: 2cm; line-height: 1.45; color: #222; }}
|
|
66
|
+
h1,h2,h3 {{ font-family: Helvetica, Arial, sans-serif; color: #111; }}
|
|
67
|
+
table {{ border-collapse: collapse; width: 100%; margin: 1em 0; font-size: 0.9em; }}
|
|
68
|
+
th, td {{ border: 1px solid #ccc; padding: 6px 8px; text-align: left; }}
|
|
69
|
+
code, pre {{ font-family: Menlo, Consolas, monospace; font-size: 0.9em; }}
|
|
70
|
+
pre {{ background: #f6f6f6; padding: 10px; overflow-x: auto; }}
|
|
71
|
+
</style></head><body>{html_body}</body></html>"""
|
|
72
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
73
|
+
HTML(string=html).write_pdf(str(path))
|
|
74
|
+
return path
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def export_pdf(markdown: str, path: Path, *, title: str = "Requirements Report") -> Path:
|
|
78
|
+
try:
|
|
79
|
+
return export_pdf_weasyprint(markdown, path, title=title)
|
|
80
|
+
except Exception as e:
|
|
81
|
+
logger.info("WeasyPrint unavailable (%s); falling back to fpdf2", e)
|
|
82
|
+
return export_pdf_fpdf(markdown, path, title=title)
|