Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Hack23 Logo

📋 Analysis Templates — Political Intelligence Output Standards

📊 Structured Templates for Consistent, High-Quality Political Intelligence
🎯 Evidence-Based · Mermaid-Rich · Confidence-Labeled · ISMS-Compliant

Owner Version Effective Date Classification

📋 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.md v1.2 — lede paragraph (120–180 words) + body (300–500 words) + counter-narrative (60–150 words).
  • synthesis-summary.md v2.5 — lead-story narrative (400–700 words) + optional secondary-thread narrative for ≥ 3-finding days.
  • per-file-political-intelligence.md v2.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:

  1. Never ship a placeholder. Pass-2 must replace every [REQUIRED: …], AI_MUST_REPLACE, <insert …>, TBD: and FILL IN marker with concrete prose. The validator scans the aggregated article — there is nowhere to hide.
  2. BLUF prose, not bullet stub. The first prose paragraph after ## 🎯 BLUF is what the aggregator extracts as the article <meta description> and as the SERP snippet. Write 1–4 evidence-bearing sentences, ≥ 80 chars, ≤ 1200 chars.
  3. Heading hierarchy is auto-corrected. The aggregator demotes every internal ## to ###, ### to ####, etc. so your template's ## 🎯 BLUF becomes 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 ###/####).
  4. 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 Sources appendix. Inline prose mentions like "primary source: data.riksdagen.se/dokument/HD12345" are preserved (they're real journalism).
  5. 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.
  6. Cite dok_id in every per-document analysis. The aggregator emits one ### HD12345 (or ### FiU17) per file under documents/; 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 canonical AGGREGATION_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), MP intressent_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)

Template Owning methodology (anchor) Owning gate check Family Aggregation position Horizon
analysis-index.md per-artifact-methodologies.md#analysis-index Check 1 + supplementary Operational Supplementary appended per-run
coalition-mathematics.md per-artifact-methodologies.md#coalition-mathematics Check 8 (seat-count table) Family D 16 mixed (T+30…T+1460)
comparative-international.md per-artifact-methodologies.md#comparative-international Check 7 (≥ 2 peer-country rows) Family C 18 mixed
cross-reference-map.md per-artifact-methodologies.md#cross-reference-map Check 1 + sibling-folder coverage Family B 27 per-run
cross-run-diff.md per-artifact-methodologies.md#cross-run-diff Supplementary Check 11 (gate-required when ANALYSIS_RUN_COUNT ≥ 2) Operational Supplementary appended per-run
cross-session-intelligence.md per-artifact-methodologies.md#cross-session-intelligence Supplementary Check 11 (Tier-C aggregation) Operational Supplementary appended mixed (week/month/quarter)
cycle-trajectory.md per-artifact-methodologies.md#cycle-trajectory Long-horizon Check (election-cycle blocking) Family D (cycle only) 14 cycle (T+1y/T+2y/T+5y)
data-download-manifest.md per-artifact-methodologies.md#data-download-manifest Check 1 + Check 2 (per-doc coverage) Family B 30 per-run
devils-advocate.md per-artifact-methodologies.md#devils-advocate Check 7 (≥ 3 ACH hypotheses) Family C 25 per-run
election-2026-analysis.md per-artifact-methodologies.md#election-2026-analysis Check 8 (seat deltas) Family D 12 cycle (T+1460)
election-cycle-analysis.md per-artifact-methodologies.md#election-2026-analysis Check 8 (alias of election-2026-analysis.md) Family D 13 (alias) cycle
executive-brief.md per-artifact-methodologies.md#executive-brief Check 1 + Check 7 (BLUF / Decisions, 400–600 words) Family A 1 per-run
forward-indicators.md per-artifact-methodologies.md#forward-indicators Check 8 (≥ 10 dated indicators) Family D 7 mixed (T+72h…T+90d)
historical-parallels.md per-artifact-methodologies.md#historical-parallels Check 8 (≥ 2 historical episodes) Family D 19 mixed
horizon-pir-rollforward.md per-artifact-methodologies.md#horizon-pir-rollforward Supplementary (long-horizon) Operational Supplementary 28 mixed (quarter/year/cycle)
implementation-feasibility.md per-artifact-methodologies.md#implementation-feasibility Check 8 + Check 9b (Statskontoret evidence) Family D 20 mixed (T+30…T+365)
intelligence-assessment.md per-artifact-methodologies.md#intelligence-assessment Check 7 (≥ 3 KJ + PIRs) Family C 3 per-run
mcp-reliability-audit.md per-artifact-methodologies.md#mcp-reliability-audit Supplementary (Tier-C mandatory) Operational Supplementary appended per-run
media-framing-analysis.md per-artifact-methodologies.md#media-framing-analysis Check 5 (Mermaid) + Check 8 Family D 5 per-run
methodology-reflection.md per-artifact-methodologies.md#methodology-reflection Check 7 (ICD 203 audit) + Check 6 (Pass-2 mtime) Family C 29 per-run
parliamentary-season.md per-artifact-methodologies.md#parliamentary-season Long-horizon Check (quarter/year/cycle blocking) Family D (long-horizon) 15 mixed (quarter/year/cycle)
per-file-political-intelligence.md per-document-methodology.md Check 2 (per-doc coverage) Family E per dok_id per-doc
pestle-analysis.md per-artifact-methodologies.md#pestle-analysis Supplementary (year-ahead/cycle blocking) Analytical Supplementary 21 mixed (year/cycle)
political-classification.md per-artifact-methodologies.md#classification-results Check 1 (Family A — classification-results.md) Family A 26 per-run
political-stride-assessment.md per-artifact-methodologies.md#political-stride-assessment Supplementary (cycle blocking; integrity events) Analytical Supplementary 24 per-run
quantitative-swot.md per-artifact-methodologies.md#quantitative-swot Supplementary (year-ahead/cycle blocking) Analytical Supplementary 23 mixed (year/cycle)
reference-analysis-quality.md per-artifact-methodologies.md#reference-analysis-quality Supplementary (Tier-C mandatory) + thresholds.json Operational Supplementary appended per-run
risk-assessment.md per-artifact-methodologies.md#risk-assessment Check 1 (top-5 risks, L × I, cascading) Family A 9 per-run
scenario-analysis.md per-artifact-methodologies.md#scenario-analysis Check 7 (≥ 3 scenarios + posteriors) Family C 8 per-run
session-baseline.md per-artifact-methodologies.md#session-baseline Supplementary (Tier-C aggregation) Operational Supplementary appended per-run
significance-scoring.md per-artifact-methodologies.md#significance-scoring Check 1 + Check 4 (evidence per ranked item) Family A 4 per-run
stakeholder-impact.md per-artifact-methodologies.md#stakeholder-perspectives Check 1 (named actors + influence network) Family A 6 per-run
swot-analysis.md per-artifact-methodologies.md#swot-analysis Check 1 + Check 4 (evidence) + Check 5 (Mermaid) Family A 10 per-run
synthesis-summary.md per-artifact-methodologies.md#synthesis-summary Check 1 + Check 5 (Mermaid) Family A 2 per-run
threat-analysis.md per-artifact-methodologies.md#threat-analysis Check 1 (Threat Taxonomy + attack tree) Family A 11 per-run
voter-segmentation.md per-artifact-methodologies.md#voter-segmentation Check 8 (SCB segment cuts) Family D 17 per-run
wildcards-blackswans.md per-artifact-methodologies.md#wildcards--black-swans Supplementary (year-ahead/cycle blocking) Analytical Supplementary 22 mixed (year/cycle)
workflow-audit.md per-artifact-methodologies.md#workflow-audit Supplementary (Tier-C mandatory) Operational Supplementary appended per-run

AGGREGATION_ORDER positions are 1-based offsets into the canonical narrative order in scripts/render-lib/aggregator/order.ts. Templates marked "appended" are not in AGGREGATION_ORDER and are appended alphabetically after the 30 canonical sections (see aggregate.ts §189-202).

Reader Intelligence Guide rows are emitted by scripts/render-lib/aggregator/reader-guide.ts for 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 (top 5 risks, L × I, cascading) 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 (framing vectors × parties) 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.md template doubles as the Family A folder README scaffold. See ../methodologies/artifact-catalog.md for 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:

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
Loading

🗺️ 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
Loading

📑 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 deep run; mandatory for every comprehensive (Tier-C aggregation) run. For non-Tier-C runs these artifacts are generally non-blocking; exception: cross-run-diff.md (S5) is gate-required whenever ANALYSIS_RUN_COUNT >= 2 (same article type), including standard and deep runs. Each artifact is consumed by .github/prompts/05-analysis-gate.md §Supplementary checks when present.

Methodology indexper-artifact-methodologies.md §§ analysis-index · reference-analysis-quality · mcp-reliability-audit · workflow-audit · cross-run-diff · cross-session-intelligence · session-baseline. Catalog rowartifact-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.

Methodologyanalytical-supplementary-methodology.md (composition rules, evidence rules, per-template analytic moves). Catalog rowartifact-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
Loading

🏷️ 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
Loading

💼 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
Loading

📈 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
Loading

🔄 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
Loading

🆕 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.md v1.1 → v1.2 — added §"Narrative" with lede + body + counter-narrative slots.
  • synthesis-summary.md v2.4 → v2.5 — added §"Narrative" with lead-story narrative (400–700 words) + optional secondary-thread narrative.
  • per-file-political-intelligence.md v2.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.mdpolitical-classification.md; stakeholder-perspectives.mdstakeholder-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 explicit Template version: v1.1 · Last updated: 2026-04-25 footer (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 sweepvoter-segmentation.md socio-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 ([REQUIRED search 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
Loading

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:

  1. The IDE preview merges the unclosed diagram with everything that follows until the next \``` — the in-editor reading experience is broken.
  2. The analysis-gate Check 5 may falsely pass even though the diagram body is unparseable.
  3. Downstream gh aw mcp inspect audits 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
Loading
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