README.md
May 12, 2026 ยท View on GitHub
๐ Analysis Templates โ Political Intelligence Output Standards
๐ Structured Templates for Consistent, High-Quality Political Intelligence
๐ฏ Evidence-Based ยท Mermaid-Rich ยท Confidence-Labeled ยท ISMS-Compliant
๐ Document Owner: CEO | ๐ Version: 4.5 | ๐
Last Updated: 2026-04-25 (UTC)
๐ Review Cycle: Quarterly | โฐ Next Review: 2026-07-25
๐ข Owner: Hack23 AB (Org.nr 5595347807) | ๐ท๏ธ Classification: Public
๐ Architecture Documentation Map
| Document | Focus | Description | Documentation Link |
|---|---|---|---|
| Architecture | ๐๏ธ Architecture | C4 model showing current system structure | View Source |
| Security Architecture | ๐ก๏ธ Security | Security controls and compliance mapping | View Source |
| Workflows | โ๏ธ DevOps | CI/CD pipeline documentation | View Source |
| Analysis Directory | ๐ฌ Analysis | Analysis directory overview and structure | View Source |
| AI Analysis Guide | ๐ค Methodology | Per-file analysis protocol and quality gates | View Source |
| Threat Framework | ๐ญ Methodology | Political Threat Taxonomy (6 dimensions) | View Source |
| Risk Methodology | โ ๏ธ Methodology | Likelihood ร Impact scoring for Riksdag events | View Source |
| SWOT Framework | ๐ผ Methodology | Evidence-based political SWOT quadrants | View Source |
| Classification Guide | ๐ท๏ธ Methodology | 7-dimension political event classification | View Source |
| Style Guide | โ๏ธ Methodology | Editorial and analytical style standards | View Source |
๐ ISMS Policy Alignment
These analysis templates implement structured intelligence production mandated by Hack23 AB's ISMS framework:
| ISMS Policy | Template Implementation |
|---|---|
| ๐ ๏ธ Secure Development Policy | Structured templates enforce consistent analytical output; anti-pattern warnings prevent quality degradation |
| ๐ Change Management | Template versioning, quarterly review cycle, document metadata tracking |
| ๐ Information Security Policy | Classification levels (PUBLIC/SENSITIVE/RESTRICTED) in every analysis output |
| ๐ Open Source Policy | SPDX license headers, REUSE compliance, transparent methodology documentation |
| ๐ Vulnerability Management | Threat analysis template identifies political risks; risk assessment quantifies exposure |
Compliance Framework Mapping
| Framework | Version | Relevant Controls | Template Implementation |
|---|---|---|---|
| ISO 27001 | 2022 | A.5.10, A.8.3 | Information classification via political-classification template |
| NIST CSF | 2.0 | ID.RA, ID.RM | Risk identification and management via risk-assessment template |
| CIS Controls | v8.1 | 17.1 | Threat intelligence production via threat-analysis template |
| EU CRA | 2024 | Art. 10, Art. 11 | Transparency and vulnerability disclosure via stakeholder-impact template |
๐ Tradecraft Requirements (v4.3)
Every template produced by Riksdagsmonitor workflows must comply with the tradecraft standards defined in political-style-guide.md:
Standard Header Block
Every template file includes a tradecraft header that workflow AI agents complete:
## ๐ Tradecraft Context
| Element | Value |
|---------|-------|
| **F3EAD Stage** | `[Stage: FIND / FIX / FINISH / EXPLOIT / ANALYZE / DISSEMINATE]` |
| **PIRs Served** | `[List: PIR-1, PIR-5, etc.]` |
| **Admiralty Floor** | `[Minimum: A1 / B2 / C3]` |
| **SAT(s) Applied** | `[List: ACH, Red Team, etc.]` |
| **ICD 203 Standards** | `[List: 1, 2, 4, etc.]` |
Evidence Column Requirements
Every evidence table gains an Admiralty column with [AโF][1โ6] annotation:
| Evidence | Source | Admiralty | Confidence |
|----------|--------|:---------:|:----------:|
| FiU48 passed 176โ173 | Riksdag votering H901FiU48 | **[A1]** | ๐ฆ VERY HIGH |
| SD budget support conditional | Party congress resolution | **[B2]** | ๐ฉ HIGH |
Probability Language
All forward-looking claims use Words of Estimative Probability (WEP):
- Almost certain (~95%) ยท Very likely (~85%) ยท Likely (~70%) ยท Roughly even (~50%) ยท Unlikely (~30%) ยท Very unlikely (~15%) ยท Remote (~5%)
Source Diversity Rule
Every P0/P1 claim requires โฅ3 primary sources (MCP-sourced Riksdag/Regering documents) + โฅ1 secondary source (SCB, IMF for economic context, press, OSINT โ World Bank covers governance / environment / social / defence historicals as a non-economic secondary source). Single-source claims must be labeled [unconfirmed]. See the Source Diversity Rule + Collection Management Matrix (MCP tool โ evidence โ template) in political-style-guide.md.
PIR Tagging
Key findings in intelligence-assessment.md, executive-brief.md, and synthesis-summary.md tag to the PIR they inform (e.g., [PIR-1: Coalition Stability]).
ICD 203 Compliance
Every methodology-reflection.md includes an ICD 203 compliance checklist verifying all 9 analytic tradecraft standards are met.
โ Pass-2 Self-Audit Checklist (v4.4 โ universal)
Every production template (33 files; excludes the templates index README and methodology-reflection.md itself) carries a 10-item Pass-2 Self-Audit Checklist at its end. After Pass 1 produces the artifact, Pass 2 must re-read it end-to-end and verify each item; remediation is logged in methodology-reflection.md ยง"Pass-2 audit log". Any unchecked โ at the end of Pass 2 forces a Pass-3 rewrite of the affected section.
The 10 items: (1) Tradecraft anchors honoured ยท (2) Source diversity floor met ยท (3) Evidence specificity (no "according to data" hand-waves) ยท (4) Named-actor discipline ยท (5) Counter-narrative present ยท (6) Election 2026 lens applied ยท (7) No illustrative content shipped as fact ยท (8) Cross-references resolve ยท (9) Mermaid renders ยท (10) Line-floor check against reference-quality-thresholds.json.
๐ Narrative subsection (Family A synthesis templates + L2+ per-file)
Three templates carry a binding ยง"Narrative" subsection that is the prose handoff to article.md:
executive-brief.mdv1.2 โ lede paragraph (120โ180 words) + body (300โ500 words) + counter-narrative (60โ150 words).synthesis-summary.mdv2.5 โ lead-story narrative (400โ700 words) + optional secondary-thread narrative for โฅ 3-finding days.per-file-political-intelligence.mdv2.5 โ required for โฅ L2-Strategic depth tier; optional for L1-Surface and clustered low-weight items.
All three are graded against the Pass-2 6-axis narrative rubric in political-style-guide.md ยง"Narrative-Voice Standards": lede grade ยท scene density ยท character density ยท surprise quotient ยท takeaway sharpness ยท counter-narrative. Hard floor: 18 / 30 to publish; any single axis < 3 fails the gate.
๐ฐ Reader-Facing Output Contract (script-enforced)
Tradecraft alone does not produce publication-quality articles โ strong intelligence content can still render as a flat artifact concatenation if the reader-facing scaffolding is weak. Every aggregated analysis/daily/$DATE/$SUBFOLDER/article.md is therefore validated by scripts/validate-article.ts (run via npm run validate-article and as part of npm run validate-all). The validator fails CI on any of these violations:
| Rule code | What it blocks |
|---|---|
unresolved-placeholder | [REQUIRED:โฆ], AI_MUST_REPLACE, <insert โฆ>, TBD:, FILL IN strings surviving Pass-2. Templates carry these markers on disk; if any reach the article, the AI agent skipped a substitution. |
missing-reader-guide / missing-executive-brief / missing-bluf / missing-sources-appendix | Required article landmarks. |
bluf-too-short (< 80 chars) / bluf-too-long (> 1200 chars) | Stub or runaway BLUFs. A publishable BLUF needs actor + active verb + object + when + so-what. |
empty-heading-slug | Any heading whose permissive slug is empty (e.g. emoji-only). Empty #anchor would break the Reader Intelligence Guide and SERP deep-links. |
per-doc-missing-dok_id | Any ### HDโฆ/### FiUโฆ per-document subsection lacking at least one dok_id-style code in its body. Every per-document subsection must trace to a primary-source identifier. |
Authoring guidance:
- Never ship a placeholder. Pass-2 must replace every
[REQUIRED: โฆ],AI_MUST_REPLACE,<insert โฆ>,TBD:andFILL INmarker with concrete prose. The validator scans the aggregated article โ there is nowhere to hide. - BLUF prose, not bullet stub. The first prose paragraph after
## ๐ฏ BLUFis what the aggregator extracts as the article<meta description>and as the SERP snippet. Write 1โ4 evidence-bearing sentences, โฅ 80 chars, โค 1200 chars. - Heading hierarchy is auto-corrected. The aggregator demotes every internal
##to###,###to####, etc. so your template's## ๐ฏ BLUFbecomes a properly-nested H3 under the wrapper## Executive Brief. Do not pre-flatten your template's headings to compensate โ author them at the natural depth (BLUF, 60-second read, top forward trigger as##; their sub-bullets as###/####). - Avoid
_Source: file.md_italics at the top of the body. Source attribution is now generated centrally in the Reader Intelligence Guide and the## Article Sourcesappendix. Inline prose mentions like "primary source: data.riksdagen.se/dokument/HD12345" are preserved (they're real journalism). - Avoid emoji-only headings. A heading like
## ๐ฏslugs to an empty string and the validator blocks it. Always pair the emoji with at least one word:## ๐ฏ BLUF,## ๐ฎ Top Forward Trigger. - Cite dok_id in every per-document analysis. The aggregator emits one
### HD12345(or### FiU17) per file underdocuments/; the body must mention that identifier (or another riksdagen identifier) at least once for primary-source traceability.
๐ 14-Language SEO Metadata Contract (template-authored)
Every executive-brief.md now carries the source metadata for all 14 HTML pages. The renderer can build safe fallbacks, but the template fill is responsible for quality:
- Titles: 50โ70 characters where possible; include actor, active verb, policy object and consequence. Do not make titles unique by appending dates.
- Descriptions: 145โ200 characters where possible; summarize the specific story, named actor/action, and why it matters. Include provenance context, not boilerplate.
- Keywords: 5โ8 localized seeds per language: article type, policy domain, named actor/party, Riksdag/Regering reference, OSINT/provenance term.
- All languages: EN, SV, DA, NO/NB, FI, DE, FR, ES, NL, AR, HE, JA, KO, ZH must be present. Arabic and Hebrew rows must preserve RTL language in the text even though the Markdown table itself remains LTR.
- Pass-2 audit: compare rows pairwise; if two descriptions are identical except date/language label, rewrite them with stronger story context.
Run the contract locally before commit:
# Re-aggregate, then validate every article in the repo:
npx tsx scripts/aggregate-analysis.ts --all
npm run validate-article
The aggregator's structural projections (heading demotion, source-preamble stripping, slug normalisation) are unit-tested in tests/render-lib.test.ts; the validator guards the AI-authored contribution that the aggregator concatenates. See Article-Generation.md ยง"Article minimum-content validator" for the full contract reference.
๐งญ Template โ Methodology โ Gate-Check Matrix
Single source of truth โ synced with the
<!-- TEMPLATE_CONTRACT_V1 -->header block now embedded in every template (38 files). Use this matrix to look up which methodology owns a template, which gate check enforces it, and where it lives in the canonicalAGGREGATION_ORDER. The 30-entry aggregation order plus 8 supplementary templates total 38 entries.
๐ Canonical evidence-anchor schema (used by every template)
| claim | evidence (dok_id / vote / MP intressent_id / primary-source URL) | retrieved_at | confidence |
- claim โ single analytic statement, no compound assertions.
- evidence โ primary reference: Riksdag
dok_id, vote tally(JA / NEJ / AVSTร R), MPintressent_id, or a primary-source URL on the network allowlist. - retrieved_at โ ISO-8601 timestamp the data was fetched (
YYYY-MM-DDTHH:MM:SSZ); flags vintage > 6 months for editorial review. - confidence โ 5-level WEP ร Admiralty composite: ๐ฆ VERY HIGH / ๐ฉ HIGH / ๐จ MODERATE / ๐ง LOW / โฌ VERY LOW.
๐ Matrix (38 templates)
AGGREGATION_ORDER positions are 1-based offsets into the canonical narrative order in
scripts/render-lib/aggregator/order.ts. Templates marked "appended" are not inAGGREGATION_ORDERand are appended alphabetically after the 30 canonical sections (seeaggregate.ts ยง189-202).Reader Intelligence Guide rows are emitted by
scripts/render-lib/aggregator/reader-guide.tsfor every produced artifact in the run folder; the rendered article shows them once, immediately after the executive brief.
๐ค Artifact โ workflow โ gate check mapping
The 11 agentic news workflows in .github/workflows/news-*.md render these templates into concrete artifacts under analysis/daily/$ARTICLE_DATE/$SUBFOLDER/. Authoring contract: .github/prompts/README.md. Tradecraft canon: ../methodologies/osint-tradecraft-standards.md.
23 always-produced artifacts per run (every news workflow โ single-type + Tier-C):
๐ Family A โ Core Synthesis (9 artifacts)
| Template | Produced artifact | Enforced by 05-analysis-gate.md |
|---|---|---|
| โ (index, hand-written) | README.md (run index) | Check 1 (presence) |
synthesis-summary.md | synthesis-summary.md (lead story + DIW ranking + โฅ 1 Mermaid) | Check 1 + 5 (Mermaid) |
executive-brief.md | executive-brief.md (BLUF + 3 decisions supported + 400โ600 words) | Check 1 + 7 (BLUF / Decisions) |
significance-scoring.md | significance-scoring.md (DIW scores + sensitivity) | Check 1 + 4 (evidence per ranked item) |
political-classification.md | classification-results.md (priority tiers, retention) | Check 1 |
swot-analysis.md | swot-analysis.md with TOWS matrix | Check 1 + 4 (evidence) |
risk-assessment.md | `risk-assessment.md$ (\text{top} 5 \text{risks}, \text{L} \times \text{I}, \text{cascading}) | \text{Check} 1 |
| $threat-analysis.md` | threat-analysis.md (Political Threat Taxonomy + attack trees) | Check 1 |
stakeholder-impact.md | stakeholder-perspectives.md (named actors + influence network) | Check 1 |
๐ Family B โ Structural Metadata (2 artifacts)
| Template | Produced artifact | Enforced by |
|---|---|---|
data-download-manifest.md | data-download-manifest.md (pre-computed by download step, collection transparency) | Check 1 |
cross-reference-map.md | cross-reference-map.md (continuity contracts, sibling folders) | Check 1 |
๐ Family C โ Strategic Extensions (5 artifacts, F3EAD Exploit โ Analyze)
| Template | Produced artifact | Enforced by |
|---|---|---|
intelligence-assessment.md | intelligence-assessment.md (โฅ 3 Key Judgments + PIRs) | Check 7 (โฅ 3 KJ + PIR) |
scenario-analysis.md | scenario-analysis.md (โฅ 3 scenarios with posteriors + indicators) | Check 7 (โฅ 3 scenarios) |
devils-advocate.md | devils-advocate.md (โฅ 3 ACH hypotheses, KAC, Red Team) | Check 7 (โฅ 3 ACH hypotheses) |
comparative-international.md | comparative-international.md (โฅ 2 peer-country rows via WB / IMF / SCB) | Check 7 (โฅ 2 comparators) |
methodology-reflection.md | methodology-reflection.md (ICD 203 audit, โฅ 10 SATs, DIW reconciliation, PIR retirement log) | Check 7 (ICD 203 audit present) |
๐ Family D โ Electoral & Domain Lenses (7 artifacts, F3EAD Analyze continued)
| Template | Produced artifact | Enforced by |
|---|---|---|
election-2026-analysis.md | election-2026-analysis.md (seat deltas, campaign implications) | Check 8 |
voter-segmentation.md | voter-segmentation.md (SCB segment cuts) | Check 8 |
coalition-mathematics.md | coalition-mathematics.md (Sainte-Laguรซ seat table) | Check 8 (seat-count table) |
historical-parallels.md | historical-parallels.md (โฅ 2 historical episodes) | Check 8 |
media-framing-analysis.md | `media-framing-analysis.md$ (\text{framing} \text{vectors} \times \text{parties}) | \text{Check} 8 |
| $implementation-feasibility.md` | implementation-feasibility.md (actor-capacity + timeline) | Check 8 |
forward-indicators.md | forward-indicators.md (โฅ 10 dated indicators across 4 horizons) | Check 8 (โฅ 10 dated indicators) |
๐ Family E โ Per-Document (N artifacts)
| Template | Produced artifact | Enforced by |
|---|---|---|
per-file-political-intelligence.md | documents/{dok_id}-analysis.md (one per input document) | Check 2 (per-doc coverage) |
๐ฐ๏ธ Operational Supplementary (7 templates โ recommended for deep, mandatory for Tier-C)
| Template | Produced artifact | Purpose |
|---|---|---|
analysis-index.md | analysis-index.md (run navigator) | Read-me-first index; assembled at end of Pass 2 |
session-baseline.md | session-baseline.md | 30-day same-type baseline for pattern-recognition |
cross-run-diff.md | cross-run-diff.md | Gate-required when ANALYSIS_RUN_COUNT โฅ 2 โ same-type day-over-day delta |
cross-session-intelligence.md | cross-session-intelligence.md | Cross-Riksdag-session progression (week/month/quarter aggregation) |
reference-analysis-quality.md | reference-analysis-quality.md | Threshold audit against reference-quality-thresholds.json |
mcp-reliability-audit.md | mcp-reliability-audit.md | MCP tool health snapshot โ call counts, failures, fallbacks |
workflow-audit.md | workflow-audit.md | End-to-end run audit: timing, cost, gate outcomes |
๐ญ Analytical Supplementary (4 templates โ optional, never blocking)
| Template | Produced artifact | When to use |
|---|---|---|
pestle-analysis.md | pestle-analysis.md | Event crosses โฅ 2 PESTLE dimensions |
political-stride-assessment.md | political-stride-assessment.md | Election-adjacent ยท integrity incident ยท disinfo spike ยท critical-infra vote |
wildcards-blackswans.md | wildcards-blackswans.md | Long-horizon forecasting (monthly-review, election-year aggregation) |
quantitative-swot.md | quantitative-swot.md | Decision memo requiring scored SWOT ranking |
Total template files in this directory: 34 = 9 (Family A) + 2 (B) + 5 (C) + 7 (D) + 1 (E reusable) + 7 (operational supplementary) + 4 (analytical supplementary). The
analysis-index.mdtemplate doubles as the Family A folder README scaffold. See../methodologies/artifact-catalog.mdfor the canonical row-per-artifact registry.
Tier-C additive contract (aggregation workflows: news-evening-analysis, news-week-ahead, news-month-ahead, news-weekly-review, news-monthly-review, news-realtime-monitor, news-article-generator) โ no extra files beyond the 23 above; instead:
- Period-scope multipliers on DIW scoring and section depth.
- Cross-type sibling citations recorded in
cross-reference-map.md ยงSibling folders. - Prior-cycle PIR ingestion in
intelligence-assessment.md ยงCarried-forward PIRs(see../methodologies/osint-tradecraft-standards.md#7๏ธโฃ-pir-handoff--cross-cycle-continuity). - 1500-word article floor for the generated news article.
Enforced by the Tier-C additive gate in ext/tier-c-aggregation.md.
Upstream gh-aw documentation (link-out only): https://github.github.com/gh-aw/llms-small.txt ยท https://github.github.com/gh-aw/llms-full.txt ยท https://github.github.com/gh-aw/_llms-txt/agentic-workflows.txt
๐ฏ Purpose
This directory contains a structured catalog of analysis templates that defines the exact output format for every political intelligence artifact produced by Riksdagsmonitor's AI agents. Templates ensure consistency, completeness, and quality across all analysis types โ from per-file document intelligence to full synthesis summaries.
Critical Rule: AI agents MUST follow these templates. Templates define structure and required sections โ the AI fills them with genuine, evidence-based analysis. Templates must NEVER be copied verbatim with placeholder text.
Templates are not standalone outputs. They form a composable intelligence pipeline โ individual templates feed into the daily synthesis, which aggregates into weekly and monthly intelligence reports. The per-file analysis template is the most frequently used: every downloaded Riksdag MCP data file receives a comprehensive analysis using this template.
Critical mandates:
- ๐ AI agents must READ actual Riksdag data and produce original analysis โ never scripted boilerplate
- ๐ Every claim requires an evidence citation (dok_id, vote record, or MCP data file path)
- ๐ All outputs require structured tables + colour-coded Mermaid diagrams โ plain prose alone is rejected
- ๐ฏ Every analysis must pass a minimum 7.0/10 quality gate before consumption by article generators
๐ Template Architecture
graph TB
subgraph "๐ฅ Input Layer"
RAW["๐ Raw Parliamentary<br/>Documents"]
META["๐ Document<br/>Metadata"]
end
subgraph "๐ฌ Per-Document Analysis"
T1["๐ Per-File Political<br/>Intelligence Template"]
end
subgraph "๐งช Analytical Dimension Templates"
T2["๐ท๏ธ Political<br/>Classification"]
T3["โ ๏ธ Risk<br/>Assessment"]
T4["๐ผ SWOT<br/>Analysis"]
T5["๐ญ Threat<br/>Analysis"]
T6["๐ Significance<br/>Scoring"]
T7["๐ฅ Stakeholder<br/>Impact"]
end
subgraph "๐ฐ Synthesis Layer"
T8["๐งฉ Synthesis<br/>Summary"]
end
RAW --> T1
META --> T1
T1 --> T2 & T3 & T4 & T5 & T6 & T7
T2 & T3 & T4 & T5 & T6 & T7 --> T8
style RAW fill:#9E9E9E,color:#FFFFFF,stroke:#616161,stroke-width:2px
style META fill:#9E9E9E,color:#FFFFFF,stroke:#616161,stroke-width:2px
style T1 fill:#1565C0,color:#FFFFFF,stroke:#0D47A1,stroke-width:3px
style T2 fill:#2E7D32,color:#FFFFFF,stroke:#2E7D32,stroke-width:2px
style T3 fill:#D32F2F,color:#FFFFFF,stroke:#B71C1C,stroke-width:2px
style T4 fill:#FF9800,color:#FFFFFF,stroke:#F57C00,stroke-width:2px
style T5 fill:#C2185B,color:#FFFFFF,stroke:#880E4F,stroke-width:2px
style T6 fill:#7B1FA2,color:#FFFFFF,stroke:#4A148C,stroke-width:2px
style T7 fill:#2196F3,color:#000000,stroke:#0097A7,stroke-width:2px
style T8 fill:#FFC107,color:#000000,stroke:#FFA000,stroke-width:3px
๐บ๏ธ Template Interconnection Map
All eight templates form an integrated intelligence network. The per-file analysis template consumes outputs from the six specialist templates, and the synthesis template aggregates all per-file analyses:
graph LR
subgraph "๐ Specialist Templates"
CLS["๐ท๏ธ Political<br/>Classification"]
RSK["โ ๏ธ Risk<br/>Assessment"]
THR["๐ญ Threat<br/>Analysis"]
SWT["๐ผ SWOT<br/>Analysis"]
STK["๐ฅ Stakeholder<br/>Impact"]
SIG["๐ Significance<br/>Scoring"]
end
subgraph "๐ฆ Integrating Templates"
PFI["๐ Per-File<br/>Intelligence"]
SYN["๐งฉ Daily<br/>Synthesis"]
end
CLS -->|"sensitivity + domain"| PFI
RSK -->|"LรI scores"| PFI
THR -->|"6-dimension threats"| PFI
SWT -->|"quadrant findings"| PFI
STK -->|"impact assessments"| PFI
SIG -->|"composite score"| PFI
PFI -->|"per-document analysis"| SYN
SYN -->|"editorial direction"| ART["๐ฐ Article<br/>Generator"]
style CLS fill:#7B1FA2,color:#FFFFFF,stroke:#4A148C
style RSK fill:#D32F2F,color:#FFFFFF,stroke:#B71C1C
style THR fill:#424242,color:#FFFFFF,stroke:#212121
style SWT fill:#1565C0,color:#FFFFFF,stroke:#0D47A1
style STK fill:#4CAF50,color:#FFFFFF,stroke:#2E7D32
style SIG fill:#FFC107,color:#000000,stroke:#FFA000
style PFI fill:#4CAF50,color:#FFFFFF,stroke:#2E7D32
style SYN fill:#FF9800,color:#FFFFFF,stroke:#F57C00
style ART fill:#0D47A1,color:#FFFFFF,stroke:#0D47A1
๐ Master Template Catalog โ Family AโE
Templates are grouped by the output family defined in ai-driven-analysis-guide.md. Each family corresponds to a distinct role in the 7-step analysis protocol. Every analysis workflow uses the same catalog.
๐ Family A โ Core Synthesis (every run produces all 9)
Methodology: synthesis-methodology.md defines step-by-step production of A2, A3, A4, A9. Classification (A5) uses political-classification-guide.md. SWOT (A6) uses political-swot-framework.md. Risk (A7) uses political-risk-methodology.md. Threat (A8) uses political-threat-framework.md.
| # | File | Template | Purpose |
|---|---|---|---|
| A1 | README.md (folder index) | folder README | Index + links for each workflow folder |
| A2 | executive-brief.md | executive-brief.md | BLUF, 3 decisions, 60-second read, confidence-labeled |
| A3 | synthesis-summary.md | synthesis-summary.md | Integrated intelligence picture + article decision |
| A4 | significance-scoring.md | significance-scoring.md | DIW-weighted ranking, 6 dimensions |
| A5 | classification-results.md | political-classification.md | 7-dimension classification across documents |
| A6 | swot-analysis.md | swot-analysis.md | Stakeholder SWOT + TOWS + cross-SWOT |
| A7 | risk-assessment.md | risk-assessment.md | 5ร5 LรI matrix + cascading chains |
| A8 | threat-analysis.md | threat-analysis.md | Political threat taxonomy + attack tree |
| A9 | stakeholder-perspectives.md | stakeholder-impact.md | 6-lens stakeholder impact matrix |
๐ Family B โ Structural Metadata (every run produces all 2)
Methodology: structural-metadata-methodology.md โ step-by-step production of the provenance ledger + relational graph, with SLA table and 7-edge relationship taxonomy.
| # | File | Template | Purpose |
|---|---|---|---|
| B1 | data-download-manifest.md | data-download-manifest.md | Transparent MCP-download inventory + data-depth ceilings |
| B2 | cross-reference-map.md | cross-reference-map.md | Policy clusters + legislative chains + coordinated-activity patterns |
๐ Family C โ Strategic Extensions (core โ every run produces all 5)
Methodology: strategic-extensions-methodology.md โ step-by-step production of all 5 always-produced depth products (ACH matrix, peer-country grid, Key Judgments, bias audit, run-audit gate).
| # | File | Template | Role on every run |
|---|---|---|---|
| C1 | scenario-analysis.md | scenario-analysis.md | 4 scenarios with probabilities summing to 100%; converges to narrow-band on light days |
| C2 | comparative-international.md | comparative-international.md | Peer-country comparison (โฅ5 peers); compares baseline when no reform active (variant filename: international-comparative.md) |
| C3 | devils-advocate.md | devils-advocate.md | ACH red-team with โฅ3 competing hypotheses; documents rejected hypotheses when evidence is strong |
| C4 | intelligence-assessment.md | intelligence-assessment.md | 3โ7 Key Judgments + PIRs for the next cycle |
| C5 | โญ methodology-reflection.md | methodology-reflection.md | VITAL run-audit file โ evidence sufficiency + confidence distribution + party-neutrality + โฅ3 concrete improvements |
๐ Family D โ Electoral & Domain Lenses (core โ every run produces all 7)
Methodology: electoral-domain-methodology.md โ step-by-step production of all 7 always-produced domain lenses (Sainte-Laguรซ seat math, segment privacy threshold, 4-horizon forward indicators, longitudinal frame delta).
| # | File | Template | Role on every run |
|---|---|---|---|
| D1 | election-2026-analysis.md | election-2026-analysis.md | Seat-projection delta + coalition viability; perpetual Swedish political-context file (variant filename: election-2026-implications.md) |
| D2 | voter-segmentation.md | voter-segmentation.md | 5-axis segment impact; documents baseline positions on procedural days |
| D3 | coalition-mathematics.md | coalition-mathematics.md | Current seat map + pivotal votes + Sainte-Laguรซ scenarios |
| D4 | historical-parallels.md | historical-parallels.md | Named precedent(s) โค 40 years with similarity score, or explicit "no-precedent" finding (variant filename: historical-baseline.md) |
| D5 | media-framing-analysis.md | media-framing-analysis.md | Per-party + per-press-quadrant framing + longitudinal-frame delta |
| D6 | implementation-feasibility.md | implementation-feasibility.md | Delivery-risk view; audits in-flight backlog when no new bill lands |
| D7 | forward-indicators.md | forward-indicators.md | โฅ10 indicators across 4 horizons (72 h / week / month / election) |
๐ Family E โ Per-Document
Methodology: per-document-methodology.md โ step-by-step production of
{dok_id}-analysis.md+ cluster files, with doctype-specific Mermaid taxonomy and 4-condition clustering rule.
| # | File | Template | Purpose |
|---|---|---|---|
| E1 | documents/${dok_id}-analysis.md | per-file-political-intelligence.md | Deep per-document analysis (tiers L1โL3) |
| E2 | documents/${cluster}-cluster-analysis.md | per-file-political-intelligence.md ยง Cluster | Cluster-level synthesis for grouped documents |
๐ฐ๏ธ Operational Supplementary โ Not Counted in the 23 (Added v2.4, 2026-04-23)
Purpose โ Enrichment artifacts that strengthen the AI-FIRST quality loop, cross-run memory, and MCP health auditability. Recommended for every
deeprun; mandatory for everycomprehensive(Tier-C aggregation) run. For non-Tier-C runs these artifacts are generally non-blocking; exception:cross-run-diff.md(S5) is gate-required wheneverANALYSIS_RUN_COUNT >= 2(same article type), includingstandardanddeepruns. Each artifact is consumed by.github/prompts/05-analysis-gate.md ยงSupplementary checkswhen present.Methodology index โ
per-artifact-methodologies.mdยงยง analysis-index ยท reference-analysis-quality ยท mcp-reliability-audit ยท workflow-audit ยท cross-run-diff ยท cross-session-intelligence ยท session-baseline. Catalog row โartifact-catalog.md ยงOperational Supplementary.
| # | File | Template | Purpose | Typical article types |
|---|---|---|---|---|
| S1 | analysis-index.md | analysis-index.md | Read-me-first run navigator: artifact inventory, MCP summary, recommended reading order, gate outcome | All deep + comprehensive |
| S2 | reference-analysis-quality.md | reference-analysis-quality.md | Per-run self-score vs reference benchmark + Pass-2 action list โ operationalises the AI-FIRST principle | All comprehensive |
| S3 | mcp-reliability-audit.md | mcp-reliability-audit.md | Endpoint-by-endpoint health record for riksdag-regering / scb / world-bank / IMF with latency, freshness, failure incidents, cache usage | All comprehensive; any deep run with MCP degradation |
| S4 | workflow-audit.md | workflow-audit.md | Prompt-module-by-module self-audit of the 7-module pipeline; 11-principle compliance table | All comprehensive |
| S5 | cross-run-diff.md | cross-run-diff.md | Bayesian delta vs prior run of the same article type โ posterior WEP bands, scenario-probability shifts, risk-register deltas | Any article type with โฅ 2 runs |
| S6 | cross-session-intelligence.md | cross-session-intelligence.md | Session-over-session narrative (week / month / quarter aggregation) โ momentum, crystallisation moments, vote-discipline time-series | weekly-review, monthly-review, motions (quarterly) |
| S7 | session-baseline.md | session-baseline.md | Calendar + adopted-texts + voterings roster for the period โ data-dense reference every narrative artifact points back to | weekly-review, monthly-review, propositions, motions (aggregation) |
Line floors for S1โS7 are configured in reference-quality-thresholds.json and apply to comprehensive runs.
๐ญ Analytical Supplementary โ Optional Deep-Dive (Added v2.5, 2026-04-23)
Purpose โ Optional deep-dive analytical templates mapped to frameworks explicitly listed in the intelligence-operative agent's "Core Expertise" and "Analytical Frameworks" sections. Never replace a core artifact and never blocking in
05-analysis-gate.md. Pair with and cite the canonical artifact they extend.Methodology โ
analytical-supplementary-methodology.md(composition rules, evidence rules, per-template analytic moves). Catalog row โartifact-catalog.md ยงAnalytical Supplementary.
| # | File | Template | Purpose | Trigger |
|---|---|---|---|---|
| AS1 | pestle-analysis.md | pestle-analysis.md | Macro-environment scan (Political/Economic/Social/Technological/Legal/Environmental) with IMF-vintage economic rows, โฅ 3 cross-dimension interactions, key judgement per dimension | event crosses โฅ 2 PESTLE dimensions |
| AS2 | political-stride-assessment.md | political-stride-assessment.md | STRIDE applied to political/electoral/institutional surfaces โ 6 dimension tables, โฅ 2 Mermaid attack trees, MITRE-style TTP map, ISMS control map (ISO 27001 ยท NIST CSF 2.0 ยท CIS v8.1) | election-adjacent ยท integrity incident ยท disinfo spike ยท critical-infra vote |
| AS3 | wildcards-blackswans.md | wildcards-blackswans.md | Tail of scenario-analysis.md โ wildcard register (โฅ 8), black-swan candidates (โฅ 3) with plausible causal chains, cascading consequence trees, resilience assessment | long-horizon forecasting (monthly-review, election-year aggregation) |
| AS4 | quantitative-swot.md | quantitative-swot.md | Numerical SWOT scoring using same DIW weight vector as significance-scoring.md; TOWS matrix with scored action rankings; sensitivity analysis | decision memo requiring scored ranking |
Line floors for AS1โAS4 live in reference-quality-thresholds.json ยง thresholds.analyticalSupplementary; apply only when the template is produced. Non-production is never a gate failure.
Workflow โ Family Map
| Workflow | Family A | Family B | Family C | Family D | Family E |
|---|---|---|---|---|---|
| Morning per-type (propositions, motions, betรคnkanden, interpellationer, frรฅgor) | โ All 9 | โ Both | โ All 5 | โ All 7 | โ Every doc |
| Midday week/month-ahead | โ All 9 | โ Both | โ All 5 | โ All 7 | โ Every forecast item |
| Evening analysis | โ All 9 | โ Both | โ All 5 | โ All 7 | โ Every doc |
| Realtime monitor | โ All 9 | โ Both | โ All 5 | โ All 7 | โ Every doc |
| Weekly review | โ All 9 | โ Both | โ All 5 + reflection | โ All 7 | Top 20 |
| Monthly review | โ All 9 | โ Both | โ All 5 + reflection | โ All 7 | Top 50 |
๐ Template Catalog
๐ Per-File Political Intelligence โ per-file-political-intelligence.md
| Attribute | Value |
|---|---|
| Purpose | Deep intelligence analysis of a single parliamentary document |
| When Used | Per-document analysis stage (one per dok_id) |
| Output Location | analysis/daily/YYYY-MM-DD/{articleType}/documents/{dok_id}-analysis.md |
| Key Sections | Executive Summary ยท Classification ยท SWOT ยท Threat Assessment ยท Risk Assessment ยท Stakeholder Impact ยท Significance Score |
flowchart LR
DOC["๐ Single<br/>Document<br/>(dok_id)"] --> EXEC["๐ Executive<br/>Summary"]
DOC --> CLASS_S["๐ท๏ธ Classification"]
DOC --> SWOT_S["๐ผ SWOT"]
DOC --> THREAT_S["๐ญ Threats"]
DOC --> RISK_S["โ ๏ธ Risks"]
DOC --> STAKE_S["๐ฅ Stakeholders"]
DOC --> SIG_S["๐ Significance"]
style DOC fill:#1565C0,color:#FFFFFF,stroke:#0D47A1,stroke-width:2px
style EXEC fill:#2E7D32,color:#FFFFFF,stroke:#2E7D32
style CLASS_S fill:#FF9800,color:#FFFFFF,stroke:#F57C00
style SWOT_S fill:#FFC107,color:#000000,stroke:#FFA000
style THREAT_S fill:#D32F2F,color:#FFFFFF,stroke:#B71C1C
style RISK_S fill:#C2185B,color:#FFFFFF,stroke:#880E4F
style STAKE_S fill:#2196F3,color:#000000,stroke:#0097A7
style SIG_S fill:#7B1FA2,color:#FFFFFF,stroke:#4A148C
๐ท๏ธ Political Classification โ political-classification.md
| Attribute | Value |
|---|---|
| Purpose | Multi-dimensional classification of political events and documents |
| Dimensions | 7: Public Interest ยท Democratic Integrity ยท Policy Urgency ยท Economic ยท Governance ยท Political Capital ยท Legislative |
| Severity Levels | CRITICAL ยท HIGH ยท MEDIUM ยท LOW |
| Output | Classification results table with confidence labels |
| New in v2.2 | Confidence Decay Rule โ classifications older than 7 days should be reviewed; those 8+ days require re-evaluation |
โ ๏ธ Risk Assessment โ risk-assessment.md
| Attribute | Value |
|---|---|
| Purpose | Systematic political risk identification, scoring, and mitigation analysis |
| Scored Dimensions | 5: Coalition ยท Policy ยท Budget ยท Electoral ยท External |
| Scoring | Five-dimension risk profile using 1โ5 scores per dimension with an overall risk synthesis and color-coded prioritization |
| Advanced | Related sub-analyses: Cascading risk chains ยท Risk velocity ยท Political Temperature Index |
| New in v2.2 | Risk Trend column (โโโ) ยท Previous Assessment Comparison ยท Risk Interconnection Mermaid diagram |
graph LR
subgraph "๐ข Low Risk (1โ4)"
L["Routine<br/>Monitoring"]
end
subgraph "๐ก Medium Risk (5โ9)"
M["Active<br/>Tracking"]
end
subgraph "๐ High Risk (10โ14)"
H["Urgent<br/>Analysis"]
end
subgraph "๐ด Critical Risk (15โ25)"
C["Immediate<br/>Escalation"]
end
L --> M --> H --> C
style L fill:#2E7D32,color:#FFFFFF,stroke:#2E7D32,stroke-width:2px
style M fill:#FFC107,color:#000000,stroke:#FFA000,stroke-width:2px
style H fill:#FF9800,color:#FFFFFF,stroke:#F57C00,stroke-width:2px
style C fill:#D32F2F,color:#FFFFFF,stroke:#B71C1C,stroke-width:2px
๐ผ SWOT Analysis โ swot-analysis.md
| Attribute | Value |
|---|---|
| Purpose | Multi-stakeholder political SWOT with strategic option generation |
| Stakeholder Lenses | Government Coalition ยท Opposition ยท Citizens ยท Economic Actors ยท International |
| Advanced Features | TOWS Matrix ยท Cross-SWOT Interference ยท Temporal Dynamics ยท Scenario Generation |
| Required Output | Evidence table per quadrant + Mermaid visualization |
| New in v2.2 | SWOT Delta section (New/Changed/Removed entries) ยท Temporal window specification |
โ ๏ธ Anti-Pattern Warning: Generic bullet points like "Strong parliamentary majority" without dok_id evidence are REJECTED by the quality gate.
๐ญ Threat Analysis โ threat-analysis.md
| Attribute | Value |
|---|---|
| Purpose | Multi-framework democratic process threat modeling |
| Required Frameworks | Attack Trees + at least ONE of: Kill Chain, Diamond Model, Actor Profiling |
| Threat Taxonomy | 6 categories: Narrative Integrity ยท Legislative Integrity ยท Accountability ยท Transparency ยท Democratic Process ยท Power Balance |
| Threat Agents | 6: Ruling Coalition ยท Opposition ยท External Actors ยท Special Interests ยท Media ยท Institutional |
| New in v3.2 | Threat Evolution Timeline ยท Cross-Methodology Linkage (how threats feed into SWOT and Risk) |
โ ๏ธ Anti-Pattern Warning: Using STRIDE alone is FORBIDDEN. Political threats require politically-native categories, not cybersecurity taxonomies.
graph TD
subgraph "๐ซ WRONG Approach"
STRIDE["STRIDE Categories<br/>(cybersecurity)"]
STRIDE_OUT["โ Superficial<br/>categorisation"]
STRIDE --> STRIDE_OUT
end
subgraph "โ
CORRECT Approach"
MULTI["4-Framework<br/>Integration"]
AT["๐ณ Attack Trees"]
KC["โ๏ธ Kill Chain"]
DM["๐ Diamond Model"]
AP["๐ค Actor Profiling"]
MULTI --> AT & KC & DM & AP
AT & KC & DM & AP --> DEEP["โ
Actionable<br/>intelligence"]
end
style STRIDE fill:#D32F2F,color:#FFFFFF,stroke:#B71C1C
style STRIDE_OUT fill:#D32F2F,color:#FFFFFF,stroke:#B71C1C
style MULTI fill:#2E7D32,color:#FFFFFF,stroke:#2E7D32,stroke-width:2px
style AT fill:#1565C0,color:#FFFFFF,stroke:#0D47A1
style KC fill:#FF9800,color:#FFFFFF,stroke:#F57C00
style DM fill:#7B1FA2,color:#FFFFFF,stroke:#4A148C
style AP fill:#C2185B,color:#FFFFFF,stroke:#880E4F
style DEEP fill:#2E7D32,color:#FFFFFF,stroke:#2E7D32
๐ Significance Scoring โ significance-scoring.md
| Attribute | Value |
|---|---|
| Purpose | Quantitative significance assessment for prioritisation and article selection |
| Score Range | 1โ10 integer composite score |
| Dimensions | Political Weight ยท Public Impact ยท Legislative Consequence ยท Temporal Urgency ยท Cross-Reference Density |
| Thresholds | โฅ8 Breaking News ยท 6โ7 Major Analysis ยท 4โ5 Standard Coverage ยท <4 Monitoring Only |
| New in v2.2 | Relative Scoring section โ compares document score to same-type average |
๐ฅ Stakeholder Impact โ stakeholder-impact.md
| Attribute | Value |
|---|---|
| Purpose | Maps how political events affect key stakeholder groups |
| Stakeholder Groups | Government ยท Parliament ยท Opposition ยท Judiciary ยท Media ยท Citizens ยท International ยท Industry |
| Assessment Axes | Impact Magnitude ยท Impact Direction (positive/negative) ยท Timeframe ยท Certainty |
| Output | Stakeholder impact matrix with directional indicators |
| New in v2.2 | Position Change Tracking (before/after this document) ยท Power-Interest Grid (Mermaid quadrant chart) |
๐งฉ Synthesis Summary โ synthesis-summary.md
| Attribute | Value |
|---|---|
| Purpose | Integrates all per-file analyses into a single coherent intelligence briefing |
| Input | All per-document analyses + classification + risk + SWOT + threat + significance + stakeholder |
| Output Sections | Executive Summary ยท Key Findings ยท Cross-Document Patterns ยท Risk Overview ยท Strategic Outlook |
| Role | Final deliverable that feeds directly into article generation |
| New in v2.2 | Mandatory Forward Indicators (3+ required) ยท Aggregate Risk Level with Trend ยท Quality Self-Check Protocol |
flowchart TB
subgraph "๐ฅ Individual Analyses"
A1["๐ Doc A<br/>Analysis"]
A2["๐ Doc B<br/>Analysis"]
A3["๐ Doc C<br/>Analysis"]
AN["๐ Doc N<br/>Analysis"]
end
subgraph "๐งช Cross-Document Analysis"
XREF["๐ Cross-Reference<br/>Mapping"]
PATTERN["๐ Pattern<br/>Detection"]
CONFLICT["โก Contradiction<br/>Analysis"]
end
subgraph "๐งฉ Synthesis Output"
EXEC_S["๐ Executive<br/>Summary"]
FIND["๐ Key<br/>Findings"]
RISK_O["โ ๏ธ Risk<br/>Overview"]
OUTLOOK["๐ฎ Strategic<br/>Outlook"]
end
A1 & A2 & A3 & AN --> XREF & PATTERN & CONFLICT
XREF & PATTERN & CONFLICT --> EXEC_S & FIND & RISK_O & OUTLOOK
style A1 fill:#1565C0,color:#FFFFFF,stroke:#0D47A1
style A2 fill:#1565C0,color:#FFFFFF,stroke:#0D47A1
style A3 fill:#1565C0,color:#FFFFFF,stroke:#0D47A1
style AN fill:#1565C0,color:#FFFFFF,stroke:#0D47A1
style XREF fill:#7B1FA2,color:#FFFFFF,stroke:#4A148C,stroke-width:2px
style PATTERN fill:#7B1FA2,color:#FFFFFF,stroke:#4A148C,stroke-width:2px
style CONFLICT fill:#7B1FA2,color:#FFFFFF,stroke:#4A148C,stroke-width:2px
style EXEC_S fill:#2E7D32,color:#FFFFFF,stroke:#2E7D32,stroke-width:2px
style FIND fill:#2E7D32,color:#FFFFFF,stroke:#2E7D32,stroke-width:2px
style RISK_O fill:#D32F2F,color:#FFFFFF,stroke:#B71C1C,stroke-width:2px
style OUTLOOK fill:#FFC107,color:#000000,stroke:#FFA000,stroke-width:2px
๐ Template Usage Flow
sequenceDiagram
participant WF as ๐ Workflow
participant PRE as ๐ฅ Pre-Analysis Script
participant AI as ๐ค AI Agent
participant QG as โ
Quality Gate
WF->>PRE: Trigger analysis
PRE->>PRE: Download data (scripts ONLY download)
PRE->>AI: Raw documents + stub files
Note over AI: AI reads methodology +<br/>template + prompt
AI->>AI: Apply per-file-political-intelligence.md
AI->>AI: Apply political-classification.md
AI->>AI: Apply risk-assessment.md
AI->>AI: Apply swot-analysis.md
AI->>AI: Apply threat-analysis.md
AI->>AI: Apply significance-scoring.md
AI->>AI: Apply stakeholder-impact.md
AI->>AI: Apply synthesis-summary.md
AI->>QG: Completed analysis files
QG->>QG: Check 1: Evidence tables present?
QG->>QG: Check 2: Mermaid diagrams present?
QG->>QG: Check 3: Confidence labels present?
QG->>QG: Check 4: dok_id citations present?
QG->>QG: Check 5: Template structure compliant?
QG->>QG: Check 6: No stub content remaining?
alt All checks pass
QG->>WF: โ
Analysis approved
else Any check fails
QG->>AI: โ Revision required
end
๐ v4.5 Template Content Completion (2026-04-25)
Surfaces the Phase 3โ4 template content additions. Every change here is binding contract for new artifact generation runs.
โ Pass-2 Self-Audit Checklist โ universal (33 templates)
Every production template (excludes only the templates index README and methodology-reflection.md, which IS the Pass-2 audit) now carries a 10-item Pass-2 Self-Audit Checklist at its end. The checklist is binding: any unchecked โ at the end of Pass 2 forces a Pass-3 rewrite of the affected section. Items cover tradecraft anchors, source-diversity floor, evidence specificity, named-actor discipline, counter-narrative presence, Election 2026 lens, no illustrative content as fact, cross-reference resolution, Mermaid render check, and line-floor compliance against reference-quality-thresholds.json.
๐ Narrative subsection โ Family A synthesis + L2+ per-file (3 templates)
executive-brief.mdv1.1 โ v1.2 โ added ยง"Narrative" with lede + body + counter-narrative slots.synthesis-summary.mdv2.4 โ v2.5 โ added ยง"Narrative" with lead-story narrative (400โ700 words) + optional secondary-thread narrative.per-file-political-intelligence.mdv2.4 โ v2.5 โ added ยง"Narrative" required for โฅ L2-Strategic depth tier.
All three are graded against the Pass-2 6-axis narrative rubric (lede / scene / character / surprise / takeaway / counter-narrative) in political-style-guide.md ยง"Narrative-Voice Standards" โ hard floor 18 / 30 to publish; any single axis < 3 fails.
๐ Doctype-variant alignment
Family E template per-file-political-intelligence.md is now bound to the 5 extended doctype variants introduced in per-document-methodology.md v1.3: motion-package, fpm (shadow budget โ full delta-envelope analysis), utskottsbetรคnkande-variants (explicit reservation handling), KU-anmรคlan (constitutional scrutiny), EU-nรคmnd (EU consultation). Each variant has a specialised Mermaid shape; the binding doctype-detection algorithm runs before any per-file analysis is written.
๐ข Version bumps (33 templates)
All 33 production templates were version-bumped (handles both **๐ Version:** major-format and **Template version:** footer-format). Library-wide: 277 cross-document .md links resolve, 0 broken; 33/33 templates carry Pass-2 Self-Audit Checklists; 35/35 templates carry Tradecraft Context blocks; 3/3 synthesis templates carry Narrative subsections; date-stamps unified at 2026-04-25.
๐งช Threshold JSON alignment (reference-quality-thresholds.json v1.2 โ v1.3)
Legacy template aliases renamed throughout JSON: classification-results.md โ political-classification.md; stakeholder-perspectives.md โ stakeholder-impact.md. executive-brief.md line floors added to all 11 article-types. 0 ghost references remaining.
๐ v4.4 Library Reconciliation (2026-04-25)
Phase 1 consistency & contract reconciliation pass โ paired with ../methodologies/README.md ยงv4.4. Highlights for the templates layer:
- Tradecraft Context block added to the 7 Family A + E core templates that lacked one (
synthesis-summary.md,swot-analysis.md,risk-assessment.md,threat-analysis.md,stakeholder-impact.md,significance-scoring.md,per-file-political-intelligence.md) โ these now carry F3EAD stage ยท PIRs served ยท Admiralty floor ยท WEP+ODNI ยท Source Diversity floor ยท SATs applied ยท ICD 203 standards on parity with the v1.x Family C/D templates. - Per-family inventory tables added to the ยง"Artifact โ workflow โ gate check mapping" section so readers can see the complete 34-template inventory at a glance (was: tables only enumerated the 23 mandatory core).
- Operational supplementary templates (
analysis-index.md,cross-run-diff.md,cross-session-intelligence.md,mcp-reliability-audit.md,reference-analysis-quality.md,session-baseline.md,workflow-audit.md) now carry an explicitTemplate version: v1.1 ยท Last updated: 2026-04-25footer (previously version-less). - Footer-stamp v1.0 templates (
pestle-analysis.md,political-stride-assessment.md,quantitative-swot.md,wildcards-blackswans.md) bumped to v1.1 / 2026-04-25. - Family A + E v2.3 templates bumped to v2.4 (threat-analysis to v3.4) with
Last Updated: 2026-04-25. - 15 v1.0 templates dated 2026-04-21 bumped to v1.1 / 2026-04-25.
- IMF-first language sweep โ
voter-segmentation.mdsocio-economic controls name IMF WEO for macro context and WB social/governance for participation and rule-of-law context.
๐ v2.3 Common Improvements (All Templates)
Scope note: "All 8 templates" below refers to the original Family A core templates (A2โA9). Families BโE templates (added in v3.0+) inherit these improvements where applicable. See Master Template Catalog for the complete 34-template inventory (23 mandatory core: Family A 9 + B 2 + C 5 + D 7 โ including the Family A folder README scaffolded from
analysis-index.md; plus the Family E reusable template; plus 4 analytical supplementary; plus 7 operational supplementary).
All 8 templates were updated in v2.3 (2026-06-01) with the following cross-cutting improvements:
๐ณ๏ธ Election 2026 Implications Section
Every template now includes an Election 2026 section that assesses electoral impact, coalition scenarios, voter salience, campaign vulnerability, and policy legacy relative to the September 2026 Swedish general election. This section is MANDATORY in all analysis output.
๐ฏ 5-Level Confidence Scale
The binary HIGH/MEDIUM/LOW confidence scale has been replaced with a 5-level confidence scale:
- โฌ VERY LOW โ Speculation only, single unverified source
- ๐ฅ LOW โ Circumstantial evidence, indirect indicators
- ๐ง MEDIUM โ Multiple independent sources, moderate corroboration
- ๐ฉ HIGH โ Official records, documented data, direct evidence
- ๐ฆ VERY HIGH โ Verified data + independent corroboration + expert consensus
๐ Historical Comparison Tables
synthesis-summary.md now includes a Historical Comparison section with tables comparing current period metrics to prior periods and year-ago data, plus a precedents table from prior riksmรถten.
๐ Election 2026 Relevance Score
significance-scoring.md now includes an Election 2026 Relevance Score with proximity bonus, coalition stability multiplier, and voter salience factor to produce election-adjusted significance scores.
๐ v2.2 Common Improvements (All Templates)
All 8 templates were updated in v2.2 (2026-04-06) with the following cross-cutting improvements:
โ Quality Self-Check Checklist
Every template now includes a mandatory quality self-check checklist at the bottom (before Document Control). AI agents must verify each item before finalising analysis output. Checklists enforce:
- Metadata completeness
- Evidence density requirements
- Mermaid diagram rendering verification
- Named actor citation requirements
- No remaining placeholder text (
[REQUIREDsearch test) - Cross-reference linkage
๐ Cross-Reference Section
Every template now includes a cross-reference section linking to sibling analysis files (e.g., risk-assessment.md โ swot-analysis.md โ threat-analysis.md) and same-day analysis from other article types. This enables contextual completeness and cross-document pattern detection.
๐ Enhanced Document Control Footer
All templates now include ISMS alignment references (ISO 27001:2022, NIST CSF 2.0) in the Document Control footer, plus explicit Owner and Effective Date fields matching Hack23 ISMS documentation standards.
๐ Cross-Temporal Comparison
Templates that support temporal analysis now include explicit previous assessment comparison sections with trend indicators (โ Increasing / โ Stable / โ Decreasing) and evidence requirements for each trend direction.
๐ฏ Article-Type-Specific Template Customisation
While all 8 templates apply to every document, certain templates produce richer, more unique output depending on the document type. The AI agent should allocate proportionally more depth to the highlighted templates:
graph TB
subgraph "๐ Committee Reports"
CR_T1["๐ Per-File Intel<br/><b>Focus: voting splits</b>"]
CR_T2["๐ผ SWOT<br/><b>Focus: coalition dynamics</b>"]
CR_T3["๐ญ Threat<br/><b>Focus: democratic process</b>"]
end
subgraph "๐ Propositions"
PR_T1["๐ Per-File Intel<br/><b>Focus: legislative pipeline</b>"]
PR_T2["โ ๏ธ Risk<br/><b>Focus: policy implementation</b>"]
PR_T3["๐ฅ Stakeholder<br/><b>Focus: affected populations</b>"]
end
subgraph "โ Motions"
MO_T1["๐ Per-File Intel<br/><b>Focus: opposition strategy</b>"]
MO_T2["๐ผ SWOT<br/><b>Focus: issue framing</b>"]
MO_T3["๐ Significance<br/><b>Focus: signalverdi</b>"]
end
subgraph "โ Interpellations"
IP_T1["๐ Per-File Intel<br/><b>Focus: accountability</b>"]
IP_T2["๐ญ Threat<br/><b>Focus: government scrutiny</b>"]
IP_T3["๐ฅ Stakeholder<br/><b>Focus: minister responses</b>"]
end
style CR_T1 fill:#2E7D32,color:#FFFFFF,stroke:#2E7D32
style CR_T2 fill:#2E7D32,color:#FFFFFF,stroke:#2E7D32
style CR_T3 fill:#2E7D32,color:#FFFFFF,stroke:#2E7D32
style PR_T1 fill:#1565C0,color:#FFFFFF,stroke:#0D47A1
style PR_T2 fill:#1565C0,color:#FFFFFF,stroke:#0D47A1
style PR_T3 fill:#1565C0,color:#FFFFFF,stroke:#0D47A1
style MO_T1 fill:#FF9800,color:#FFFFFF,stroke:#F57C00
style MO_T2 fill:#FF9800,color:#FFFFFF,stroke:#F57C00
style MO_T3 fill:#FF9800,color:#FFFFFF,stroke:#F57C00
style IP_T1 fill:#D32F2F,color:#FFFFFF,stroke:#B71C1C
style IP_T2 fill:#D32F2F,color:#FFFFFF,stroke:#B71C1C
style IP_T3 fill:#D32F2F,color:#FFFFFF,stroke:#B71C1C
Unique Template Sections by Article Type
Each article type should produce unique analytical sections in its synthesis that no other workflow can produce:
| Article Type | Template | Unique Section Name | What Makes It Unique |
|---|---|---|---|
| Committee Reports | Synthesis | Committee Vote Heatmap | Party-by-party voting matrix with Ja/Nej/Avstรฅr breakdown per beteckning |
| Committee Reports | SWOT | Reservation Analysis | Opposition reservations (dissenting opinions) text analysis โ only committee reports have reservations |
| Propositions | Risk | Legislative Pipeline Risk | Where the bill sits in the process (remiss โ utskott โ plenum) and risk of delay/amendment |
| Propositions | Stakeholder | Budget Impact Matrix | Which population segments gain/lose from proposed budget changes |
| Motions | Significance | Signalverdi Score | Whether the motion is a genuine legislative bid or political positioning (only motions have this signal) |
| Motions | SWOT | Cross-Party Alignment Map | Which opposition parties co-sponsor or signal support โ unique to motion dynamics |
| Interpellations | Per-File Intel | Minister Response Scorecard | Response timeliness (โค28 days statutory), evasion score, policy commitment extraction |
| Interpellations | Threat | Accountability Gap Analysis | Unanswered questions, overdue responses, pattern of ministerial avoidance by portfolio |
| Evening Analysis | Synthesis | Daily Parliamentary Pulse | Vote-weighted activity index combining all document types into a single daily metric |
| Weekly Review | SWOT | Week-over-Week Trend Delta | How did this week's political temperature differ from last week? Only weekly scope enables this |
| Month Ahead | Risk | Strategic Calendar Risk Map | Forward-looking risk landscape tied to specific scheduled events (budget debates, EU summits) |
๐ Template Quality Standards
Every template enforces the following mandatory requirements:
| # | Requirement | Description |
|---|---|---|
| 1 | Evidence Tables | All assessments must be in structured tables, not free-form prose |
| 2 | Mermaid Diagrams | โฅ1 color-coded Mermaid diagram with style directives |
| 3 | Confidence Labels | Every assessment tagged: HIGH (โฅ80%), MEDIUM (60โ79%), LOW (<60%) |
| 4 | dok_id Citations | Parliamentary document IDs cited for every factual claim |
| 5 | Anti-Pattern Warnings | Each template begins with common anti-patterns to AVOID |
| 6 | Frontmatter | Standard metadata: Generated, Data Sources, Documents Analyzed, Confidence |
๐จ Mermaid colour-coding standard (canonical)
The analysis gate (05-analysis-gate.md Check 5) iterates the GATE_SYNTH_LIST (16 core synthesis files including executive-brief.md, swot-analysis.md, threat-analysis.md, election-2026-analysis.md, etc.) and blocks any file that (a) has no ```mermaid block or (b) lacks either a style โฆ directive or a themeVariables / %%{init โฆ} block anywhere in the file. The check runs once per file, not per Mermaid block. To keep colour semantics consistent across the 35+ templates that already render Mermaid (and the 3 long-horizon templates that just received their first diagram โ cycle-trajectory.md, horizon-pir-rollforward.md, parliamentary-season.md) every diagram MUST follow the palette below โ derived from the cyberpunk article-chrome tokens documented in Article-Generation.md ยง"Light and dark mode".
| Hex | Semantic role | Colour use |
|---|---|---|
#1565C0 | Primary blue | Structural / process / data-source nodes (BLUF anchor, ingest, predecessor run) |
#2E7D32 | Success green | Strengths ยท opportunities ยท "active" ยท low-risk indicators |
#FF9800 | Warning orange | Watch items ยท medium severity ยท mid-mandate years |
#D32F2F | Danger red | Threats ยท weaknesses ยท falsification triggers ยท high severity |
#7B1FA2 | Strategic purple | Synthesis ยท scenarios ยท long-horizon projections |
#00897B | Data teal | Data products ยท cycle-spanning PIRs ยท IMF / SCB feeds |
#FFBE0B | Accent yellow (--primary-yellow) | Edges, accents, stroke highlights, "this run" anchor |
#FF006E | Emphasis magenta (--primary-magenta) | New PIRs, emphasis, election-anchor pivots |
#616161 | Neutral grey | Archived / deprecated / pending nodes |
Every Mermaid block MUST start with the canonical init prologue so the diagram inherits the dark-mode chrome on riksdagsmonitor.com:
%%{init: {"theme":"dark","themeVariables":{"primaryColor":"#1565C0","primaryTextColor":"#ffffff","lineColor":"#FFBE0B","secondaryColor":"#7B1FA2","tertiaryColor":"#2E7D32","fontFamily":"Inter, Helvetica, Arial, sans-serif"}}}%%
For multi-state diagrams (flowchart / state / sequence), prefer classDef blocks over per-node style directives so colour semantics stay consistent across the diagram. Note: classDef lines alone do not satisfy the gate's ^[[:space:]]*style[[:space:]]+ regex โ the gate's colour-config check passes via the themeVariables / %%{init โฆ} prologue above (which every block already includes):
classDef bluf fill:#1565C0,color:#ffffff,stroke:#FFBE0B,stroke-width:2px
classDef opp fill:#2E7D32,color:#ffffff
classDef watch fill:#FF9800,color:#000000
classDef threat fill:#D32F2F,color:#ffffff,stroke:#FFBE0B,stroke-width:2px
classDef strategic fill:#7B1FA2,color:#ffffff
classDef data fill:#00897B,color:#ffffff
classDef archive fill:#616161,color:#ffffff
Diagram-class guidance:
| Diagram class | Use it for | Reference templates |
|---|---|---|
flowchart TB / LR | Process maps, evidence chains, attack trees, escalation paths | executive-brief.md, threat-analysis.md, parliamentary-season.md |
quadrantChart | SWOT, risk-vs-impact, decision matrices | swot-analysis.md |
gantt | Forward-indicator timelines, calendar windows | forward-indicators.md |
xychart-beta | DIW scoring, quantitative SWOT, reliability trends | significance-scoring.md, quantitative-swot.md, mcp-reliability-audit.md |
graph LR | Lightweight evidence-to-conclusion arcs | executive-brief.md (lead visual) |
sequenceDiagram | Coalition negotiations, KU referral cycles | political-stride-assessment.md |
mindmap | PESTLE / stakeholder fan-outs | pestle-analysis.md, stakeholder-impact.md |
Mermaid renders client-side in the article HTML โ the aggregator passes ```mermaid fences through untouched and scripts/render-lib/markdown/mermaid-preprocess.ts rewrites them to <pre class="mermaid"> before the unified pipeline (scripts/render-lib/markdown/pipeline.ts) runs. js/lib/mermaid-init.mjs then upgrades each block to SVG after page load against the same-origin vendored runtime under js/lib/mermaid/. The full HTML rendering chain is documented in Article-Generation.md ยง"Mermaid support".
๐ง Authoring rule โ every \``mermaidopening fence MUST have a closing````
Every Mermaid diagram MUST be terminated by its own \``line on a line of its own. This is a hard contract, enforced byscripts/validate-article.ts ([unclosed-mermaid-fence](../../scripts/validate-article.ts) + [mermaid-coverage-regression](../../scripts/validate-article.ts)). When the AI agent drops a closing fence the renderer recovers gracefully (preprocessMermaidFencesuses the next opening fence as an implicit close, so each diagram still becomes its own
`), but the source artifact is rejected at PR review because:
- The IDE preview merges the unclosed diagram with everything that follows until the next
\``` โ the in-editor reading experience is broken.- The analysis-gate Check 5 may falsely pass even though the diagram body is unparseable.
- Downstream
gh aw mcp inspectaudits report the wrong diagram count.Pattern to follow in every template:
\`\`\`mermaid %%{init: โฆ}%% flowchart LR A --> B \`\`\`Pattern to NEVER ship:
\`\`\`mermaid flowchart LR A --> B โ missing closing \`\`\` ## Next section
๐ Template Selection by Data Category
| MCP Data Category | Primary Templates | Supporting Templates |
|---|---|---|
betankanden/ (committee reports) | Political Classification + SWOT Analysis | Stakeholder Impact, Significance Scoring |
propositioner/ (propositions) | Risk Assessment + Stakeholder Impact | Political Classification, Significance Scoring |
motioner/ (motions) | Political Classification + SWOT + Significance | Risk Assessment |
interpellationer/ (interpellations) | Threat Analysis + Stakeholder Impact | Political Classification |
voteringar/ (votes) | Political Classification + SWOT + Threat | Risk Assessment |
anforanden/ (speeches) | Stakeholder Impact + Significance Scoring | Political Classification |
calendar_events/ | Significance Scoring + Risk Assessment | Stakeholder Impact |
fragor/ (written questions) | Political Classification + Significance | Stakeholder Impact |
๐ Temporal Aggregation
flowchart TD
D["๐
Daily per-workflow analysis\nanalysis/daily/YYYY-MM-DD/slug/"] --> W["๐
Weekly aggregation\nanalysis/weekly/YYYY-WNN/"]
W --> M["๐
Monthly strategic brief\nanalysis/monthly/YYYY-MM/"]
D --> AI["๐ค AI cross-article synthesis\nanalysis/daily/YYYY-MM-DD/synthesis-summary.md"]
AI --> W
style D fill:#2E7D32,stroke:#2E7D32,color:#FFFFFF
style W fill:#1565C0,stroke:#0D47A1,color:#FFFFFF
style M fill:#7B1FA2,stroke:#4A148C,color:#FFFFFF
style AI fill:#FF9800,stroke:#F57C00,color:#FFFFFF
| Scope | Format | Example | Cadence |
|---|---|---|---|
| Daily | YYYY-MM-DD | 2026-03-31/ | Every workflow run |
| Weekly | YYYY-WNN | 2026-W14/ | news-weekly-review aggregation |
| Monthly | YYYY-MM | 2026-03/ | news-monthly-review aggregation |
| Cross-article | synthesis-summary.md | Daily synthesis | Per-workflow synthesis |
๐ Related Documentation
| Document | Focus | Link |
|---|---|---|
| Analysis README | Directory overview and critical rules | analysis/README.md |
| Methodologies README | Methodology framework catalog | analysis/methodologies/README.md |
| AI-Driven Guide | Master protocol for AI analysis | ai-driven-analysis-guide.md |
| Prompts v2 | AI prompt library | scripts/prompts/v2/ |
| ISMS-PUBLIC | Hack23 ISMS security standards | Hack23/ISMS-PUBLIC |
๐ Hack23 AB โ Structured Intelligence Through Disciplined Templates