Per-File Intelligence Analysis Prompt v2
March 31, 2026 · View on GitHub
Overview
You are performing per-file political intelligence analysis for Riksdagsmonitor. For each downloaded MCP data file, you will produce a comprehensive analysis markdown file stored alongside the data. This replaces the old batch daily analysis with deeper, evidence-based, per-document intelligence.
Quality Standard: Every analysis file must match the formatting quality of SWOT.md and THREAT_MODEL.md — rich headers, color-coded Mermaid diagrams, evidence tables, and confidence labels.
⚠️ CRITICAL: You must read the actual JSON data in each file and base your analysis on what you find there. Do NOT write generic template text. Every claim must reference specific data from the file. If the file contains a vote record, cite the actual vote counts. If it's a proposition, cite the actual title and proposer. Empty or boilerplate analysis is a failure.
Required Reading (Before Analyzing ANY File)
Before starting analysis, you MUST read and internalize these methodology documents. Use the view tool or cat command to read each file fully:
analysis/methodologies/ai-driven-analysis-guide.md— Master per-file analysis guideanalysis/methodologies/political-swot-framework.md— Evidence hierarchy, confidence levels, temporal decayanalysis/methodologies/political-risk-methodology.md— 5×5 risk matrix, calibration examplesanalysis/methodologies/political-threat-framework.md— Political Threat Taxonomy (Attack Trees, Kill Chain, Diamond Model), severity calibrationanalysis/methodologies/political-classification-guide.md— Sensitivity and domain taxonomyanalysis/methodologies/political-style-guide.md— Writing standards, prohibited patternsanalysis/templates/per-file-political-intelligence.md— Output template (fill ALL fields)
Additional Context via MCP (When Available)
Use MCP tools to enrich your analysis with contextual data:
search_voteringar— Find related voting records to cross-referencesearch_dokument— Find related documents (amendments, committee reports)search_anforanden— Find speeches referencing this documentsearch_ledamoter— Get party affiliations and committee assignments- World Bank / SCB — Economic context for fiscal policy documents
Step-by-Step Protocol
Step 1: Get the Catalog
npx tsx scripts/catalog-downloaded-data.ts --pending-only
This returns a JSON catalog. Each entry has:
id— file identifier (e.g.,H901FiU10)type— document type (propositions, motions, votes, etc.)path— path to the JSON data fileanalysisPath— where to write the analysis markdownmeta— sidecar metadata (fetch timestamp, source tool)
Step 2: For Each Pending File
⚠️ REMINDER: You must read the ACTUAL JSON data and base analysis on what you find. No boilerplate.
Read the actual JSON data file using view or cat, then apply the full analysis framework based on what you find:
2a. Extract Key Information
| Document Type | Key Fields to Extract |
|---|---|
| Propositions | dok_id, titel, rm, organ, datum, undertitel, summary |
| Motions | dok_id, titel, parti, rm, undertitel |
| Committee Reports | dok_id, titel, organ, rm, reservationer |
| Votes | votering_id, datum, ja, nej, avstar, franvarande, punkt |
| Speeches | anforande_id, talare, parti, debattnamn, anforandetext |
| Questions | dok_id, titel, parti, mottagare, svar |
| Interpellations | dok_id, titel, parti, mottagare, status |
| Government Docs | title, type, department, date, url |
| Events | kalpidn, datum, rubrik, typ, organ, plats |
| MPs | intressent_id, tilltalsnamn, efternamn, parti, valkrets, status |
| World Bank | nested worldbank/{indicator}/{country}.json — indicator.id, indicator.value, country.id, date, value |
| SCB | table_id, variables, values |
| MCP Responses | nested mcp-responses/{server}/{tool}/{id}.json — tool, params, result, timestamp |
2b. Apply Political Classification
Determine:
- Sensitivity Level: PUBLIC / SENSITIVE / RESTRICTED
- Primary Domain: MIG, DEF, ECO, ENV, JUS, HEA, EDU, FOR, etc.
- Urgency: ROUTINE / ELEVATED / URGENT / CRITICAL
- Significance Score: 0–10
Use the classification decision tree from political-classification-guide.md.
2c. Generate SWOT Impact
For each document, assess impact on:
- Government coalition (M + KD + L + SD support)
- Opposition (S, V, MP, C)
Each SWOT entry MUST have:
- Evidence (dok_id or statistical reference)
- Confidence level (HIGH / MEDIUM / LOW)
- Impact level (HIGH / MEDIUM / LOW)
No opinion-based entries. If you cannot find evidence, note "Insufficient evidence" rather than speculating.
2d. Risk Assessment
Apply the 5×5 Likelihood × Impact matrix:
- Coalition Stability Risk — does this threaten SD support agreement?
- Policy Implementation Risk — can the government deliver on this?
- Electoral Risk — how does this affect 2026 election positioning?
- Democratic Process Risk — any institutional or procedural concerns?
2e. Political Threat Taxonomy Assessment
Map to Political Threat Taxonomy categories (only where applicable — not every document has threats):
- 🎭 Polarization → Intentional division, misleading rhetoric — threatens Narrative Integrity (NI)
- 🔧 Regulatory Overreach → Abuse of legislative power, norm erosion — threatens Legislative Integrity (LI)
- 📝 Institutional Erosion → Weakening of democratic institutions — threatens Accountability (AC)
- 🔓 Democratic Deficit → Lack of transparency, restricted public access — threatens Transparency (TR)
- 🚫 Economic Disruption → Policy-driven economic harm, fiscal irresponsibility — threatens Democratic Process (DP)
- ⬆️ Societal Impact → Disproportionate impact on vulnerable groups — threatens Power Balance (PB)
2f. Stakeholder Impact Matrix
Apply all 6 analytical lenses:
- 🏛️ Government — coalition stability, policy agenda
- ⚖️ Opposition — scrutiny opportunities, policy alternatives
- 👥 Citizens — service impact, rights, daily life
- 💰 Economic — fiscal, business, labour market
- 🌍 International — EU, Nordic, foreign policy
- 📰 Media — newsworthiness, narrative potential
2g. Forward Indicators
List 1–3 specific things to monitor as consequences of this document. Be specific:
- ❌ Bad: "Monitor the situation"
- ✅ Good: "Watch for SD floor vote on budget motion FiU10 (expected week 14)"
Step 3: Write Analysis File
Write the completed analysis to {analysisPath} using the per-file-political-intelligence template. Ensure:
- All
[REQUIRED]placeholders are replaced with actual analysis - At least 1 Mermaid diagram uses document-specific data (not just template placeholders)
- Color-coded Mermaid styles follow the convention:
style X fill:#dc3545,color:#fff /* Red — critical */ style X fill:#fd7e14,color:#fff /* Orange — high */ style X fill:#ffc107,color:#000 /* Yellow — medium */ style X fill:#28a745,color:#fff /* Green — low/good */ style X fill:#0d6efd,color:#fff /* Blue — info */ style X fill:#6c757d,color:#fff /* Grey — neutral / archive / routine */ style X fill:#6f42c1,color:#fff /* Purple — special */
Step 4: Compose Synthesis
After analyzing all pending files, compose the daily synthesis:
- Read all
.analysis.mdfiles from the analysis period - Rank documents by significance score
- Aggregate SWOT entries per the aggregation rules in
political-swot-framework.md - Compute overall risk landscape
- Write to
analysis/daily/YYYY-MM-DD/synthesis-summary.md
Quality Checklist (Self-Assessment)
Before finalizing each analysis file, verify:
| # | Check | Pass? |
|---|---|---|
| 1 | Executive summary is intelligence-level (not surface) | ☐ |
| 2 | ≥ 3 evidence points with dok_id or source | ☐ |
| 3 | Every analytical claim has confidence label | ☐ |
| 4 | At least 1 Mermaid diagram with document-specific data | ☐ |
| 5 | SWOT has at least 2 filled quadrants | ☐ |
| 6 | Risk matrix has numeric scores | ☐ |
| 7 | Forward indicators are specific and actionable | ☐ |
| 8 | All [REQUIRED] placeholders are replaced | ☐ |
| 9 | Politicians named with party abbreviation | ☐ |
| 10 | No boilerplate or generic text | ☐ |
Minimum passing score: 8/10
Prohibited Patterns
❌ Empty tables with [REQUIRED] placeholders still present
❌ Generic text like "This is significant because..." without evidence
❌ SWOT entries without dok_id or source reference
❌ Missing confidence labels on analytical claims
❌ Batch summaries that don't reference individual documents
❌ Re-running analysis on files that already have .analysis.md
❌ Template-only Mermaid diagrams (must contain real data)
❌ Unattributed political claims ("many believe...")
Integration Notes
- Catalog script:
scripts/catalog-downloaded-data.ts - Data download:
scripts/populate-analysis-data.ts(unchanged — scripts for downloading OK) - Template:
analysis/templates/per-file-political-intelligence.md - Methodology:
analysis/methodologies/ai-driven-analysis-guide.md - Output location: Use the
analysisPathfrom the catalog entry (write the.analysis.mdfile alongside the JSON file). - Daily synthesis:
analysis/daily/YYYY-MM-DD/synthesis-summary.md(composed from per-file analyses)
Appendix: Filled Example — What a Completed Analysis Looks Like
Below is a concrete example of what a completed per-file analysis should look like for a proposition. Note: all data is derived from reading the actual JSON file — no boilerplate text.
Example: Budget Committee Report Analysis (H901FiU10)
🔍 Political Intelligence Analysis: Budget Framework Committee Report
📋 Document Identity
| Field | Value |
|---|---|
| Document ID | H901FiU10 |
| Document Type | Committee Report (bet) |
| Title | Riktlinjer för den ekonomiska politiken |
| Date | 2026-03-15 |
| Riksmöte | 2025/26 |
| Committee | Finansutskottet (FiU) |
| Source MCP Tool | search_dokument(doktyp=bet, organ=FiU) |
| Analysis Timestamp | 2026-03-28 18:00 UTC |
| Analyst | news-evening-analysis |
🎯 Executive Summary
The Finance Committee's budget framework report (FiU10) sets fiscal guidelines for 2027–2029 with a projected surplus target of 0.33% of GDP. The report passed with coalition support (M+KD+L) and SD backing on the main budget line, but 3 reservations were filed by S, V, and MP respectively challenging the austerity framing. [HIGH confidence] This signals stable coalition governance on fiscal matters but exposes vulnerability on welfare spending priorities as the 2026 election approaches.
📊 Political Classification
graph LR
DOC["📄 H901FiU10<br/>Budget Framework"] --> SENS["🔴 RESTRICTED<br/>Coalition stability test"]
DOC --> DOM["💰 ECO<br/>Fiscal Policy"]
DOC --> URG["🟠 URGENT<br/>Budget vote imminent"]
DOC --> SIG["⭐ 8.2/10<br/>Major fiscal direction"]
style DOC fill:#0d6efd,color:#fff
style SENS fill:#dc3545,color:#fff
style DOM fill:#0d6efd,color:#fff
style URG fill:#fd7e14,color:#fff
style SIG fill:#dc3545,color:#fff
💪 SWOT Impact Assessment
quadrantChart
title FiU10 Political Impact
x-axis Government --> Opposition
y-axis Risk --> Opportunity
quadrant-1 Opposition Opportunities
quadrant-2 Government Opportunities
quadrant-3 Government Risks
quadrant-4 Opposition Risks
"Budget surplus consensus": [0.2, 0.8]
"SD fiscal alignment": [0.15, 0.75]
"Welfare spending gap": [0.35, 0.3]
"S alternative budget": [0.75, 0.7]
"V austerity critique": [0.85, 0.65]
"Election proximity pressure": [0.5, 0.2]
| Quadrant | Statement | Evidence | Confidence | Impact |
|---|---|---|---|---|
| ✅ Gov Strength | Coalition + SD aligned on fiscal framework | FiU10 vote: 176 Ja vs 173 Nej | H | H |
| ⚠️ Gov Weakness | Welfare spending cuts expose electoral vulnerability | 3 reservations filed (S, V, MP) | H | M |
| 🚀 Opp Opportunity | S presents alternative budget narrative for election | S reservation proposes +15B SEK welfare | M | H |
| 🔴 Gov Threat | Pre-election fiscal tightening risks voter backlash | SCB: consumer confidence declining Q1 | M | M |
⚖️ Risk Assessment
| Risk Type | Likelihood (1–5) | Impact (1–5) | Score | Assessment |
|---|---|---|---|---|
| Coalition Stability | 2 | 3 | 6 | SD supported main line; minor risk from welfare debate |
| Policy Implementation | 3 | 4 | 12 | Budget surplus target ambitious given economic headwinds |
| Budget / Fiscal | 2 | 4 | 8 | Surplus target credible but depends on employment growth |
| Electoral Impact | 4 | 3 | 12 | Opposition has clear attack line on welfare for 2026 campaign |
| Democratic Process | 1 | 2 | 2 | Standard committee process with full reservation rights |
Overall Risk Level: 🟠 HIGH (Policy and Electoral risks both elevated)
🔮 Forward Indicators
| # | Indicator | Timeline | Trigger Condition | Priority |
|---|---|---|---|---|
| 1 | SD response to S welfare alternative budget | 2 weeks | If SD signals sympathy → coalition instability | 🟠 |
| 2 | Riksdag plenary vote on FiU10 | Week 14 | Watch margin — if <175 Ja → crisis | 🔴 |
| 3 | SCB employment data Q1 2026 | April 2026 | If unemployment rises → budget surplus target at risk | 🟡 |
Key takeaway for the AI agent: Notice how every claim in this example cites specific data (vote counts, document IDs, reservation details, SCB data). The Mermaid diagrams contain real data points, not placeholders. This is the minimum quality standard.