riksdagsmonitor 0.8.48 → 0.8.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +92 -87
  2. package/package.json +6 -6
package/README.md CHANGED
@@ -644,83 +644,33 @@ gh attestation verify riksdagsmonitor-v1.0.0.zip -R Hack23/riksdagsmonitor
644
644
  - [🏷️ Classification Framework](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md) — CIA triad, RTO/RPO, business impact
645
645
 
646
646
  ### GitHub Copilot Integration
647
- - [AGENTS.md](AGENTS.md) - Custom Copilot agents for specialized tasks (14 agents)
648
- - [SKILLS.md](SKILLS.md) - Agent skills for strategic guidance (87 skills)
649
- - [`.github/agents/`](.github/agents/) - Agent configuration files
650
- - [`.github/skills/`](.github/skills/) - Skill libraries
651
-
652
- **Available Agents (14)**:
653
- - **security-architect** - Security architecture and ISMS compliance
654
- - **documentation-architect** - C4 models and technical documentation
655
- - **quality-engineer** - HTML/CSS validation and accessibility
656
- - **frontend-specialist** - Static site development and responsive design
657
- - **isms-compliance-manager** - ISO 27001/NIST CSF/CIS Controls compliance
658
- - **deployment-specialist** - GitHub Actions and CI/CD automation
659
- - **intelligence-operative** - Political intelligence analysis, OSINT, Swedish politics expertise, riksdag-regering-mcp (32 tools)
660
- - **task-agent** - Product excellence, quality assurance, Playwright testing, issue management
661
- - **ui-enhancement-specialist** - Static HTML/CSS, responsive design, 14-language support, WCAG 2.1 AA
662
- - **data-pipeline-specialist** - CIA data consumption, ETL workflows, caching strategies, data validation
663
- - **data-visualization-specialist** - Chart.js/D3.js, interactive dashboards, CIA intelligence visualizations
664
- - **content-generator** - Automated news generation, intelligence reports, multi-language content
665
- - **devops-engineer** - CI/CD pipelines, GitHub Actions security, infrastructure automation, monitoring
666
- - **news-journalist** - Political journalism, editorial standards, multi-language news coverage
667
-
668
- **Available Skills (87)**:
669
-
670
- *Core Infrastructure (7):*
671
- - **hack23-isms-compliance** - ISMS framework requirements
672
- - **security-by-design** - Security best practices
673
- - **static-site-security** - Static website security
674
- - **ci-cd-security** - GitHub Actions security hardening
675
- - **documentation-standards** - Documentation guidelines
676
- - **html-accessibility** - WCAG 2.1 AA compliance
677
- - **multi-language-localization** - Internationalization best practices
678
-
679
- *Political Intelligence (11):*
680
- - **political-science-analysis** - Comparative politics and policy analysis frameworks
681
- - **osint-methodologies** - Open-source intelligence collection and verification
682
- - **intelligence-analysis-techniques** - Structured analytic techniques (ACH, SWOT)
683
- - **swedish-political-system** - Riksdag structure, 8 parties, electoral system
684
- - **electoral-analysis** - Election forecasting and coalition prediction
685
- - **behavioral-analysis** - Political psychology and leadership analysis
686
- - **strategic-communication-analysis** - Narrative analysis and media monitoring
687
- - **legislative-monitoring** - Voting patterns and parliamentary oversight
688
- - **risk-assessment-frameworks** - Political risk and corruption indicators
689
- - **data-science-for-intelligence** - Statistical analysis and visualization
690
- - **gdpr-compliance** - GDPR compliance for political data processing
691
-
692
- *ISMS & Security (6):*
693
- - **cis-controls** - CIS Controls v8.1 for static sites
694
- - **iso-27001-controls** - ISO 27001:2022 Annex A controls
695
- - **nist-csf-mapping** - NIST CSF 2.0 framework mapping
696
- - **threat-modeling** - STRIDE threat analysis
697
- - **secure-code-review** - HTML/CSS/JS security review
698
- - **security-documentation** - ISMS documentation standards
699
-
700
- *Development & Operations (11):* ⬆️ **EXPANDED**
701
- - **c4-architecture-documentation** - C4 model and Mermaid diagrams
702
- - **github-actions-workflows** - CI/CD patterns and security
703
- - **code-quality-checks** - HTMLHint, CSSLint, linkinator, axe-core
704
- - **secrets-management** - GitHub secrets and PAT management
705
- - **data-pipeline-engineering** ✨ **NEW** - ETL workflows, automated data fetching
706
- - **automated-content-generation** ✨ **NEW** - News generation, intelligence reports
707
- - **performance-optimization** ✨ **NEW** - Core Web Vitals, bundle size, caching
708
- - **api-integration** ✨ **NEW** - REST/GraphQL clients, rate limiting
709
- - **github-agentic-workflows** ✨ **NEW** - AI-powered repository automation, MCP tools, safe outputs
710
-
711
- *UI/UX & Design (4):* ⬆️ **EXPANDED**
712
- - **responsive-design** - Mobile-first, CSS Grid/Flexbox, breakpoints (320px-1440px+)
713
- - **design-system-management** - Cyberpunk theme, CSS variables, component library
714
- - **political-data-visualization** - CSS-only charts, heat maps, dashboards
715
- - **advanced-data-visualization** ✨ **NEW** - Chart.js/D3.js, interactive dashboards
716
-
717
- *Testing & Quality Assurance (2):* ✨ **NEW**
718
- - **playwright-testing** - Browser automation, visual regression, accessibility audits
719
- - **issue-management** - GitHub issue creation, labeling, agent assignment
720
-
721
- *Data Integration (2):* ⬆️ **EXPANDED**
722
- - **riksdag-regering-mcp** - 32 political data tools (Parliament, Government, MPs, votes)
723
- - **cia-data-integration** ✨ **NEW** - CIA export consumption, validation, caching strategies
647
+
648
+ Riksdagsmonitor uses **GitHub Copilot personas, skills, and agentic workflows** as first-class automation. The directory READMEs are the single source of truth; [`AGENTS.md`](AGENTS.md) and [`SKILLS.md`](SKILLS.md) are the long-form reference catalogs.
649
+
650
+ - [`.github/agents/README.md`](.github/agents/README.md) — **24 agent files** (14 persona agents + 9 workflow-specialist `.agent.md` + shared `developer.instructions.md`)
651
+ - [`.github/skills/README.md`](.github/skills/README.md) — **91 skills** grouped by 12 functional categories
652
+ - [`.github/prompts/README.md`](.github/prompts/README.md) — 8 bounded-context prompt modules + Tier-C extension, imported by every agentic news workflow
653
+ - [`.github/workflows/README.md`](.github/workflows/README.md) 45 workflow files (standard + agentic)
654
+ - [AGENTS.md](AGENTS.md) — canonical persona catalog with skill-mapping tables and invocation examples
655
+ - [SKILLS.md](SKILLS.md) canonical skill catalog with agent-skill mappings
656
+
657
+ **14 Persona Agents** (assignable via `assign_copilot_to_issue`):
658
+
659
+ - **security-architect** · **documentation-architect** · **quality-engineer** · **frontend-specialist** · **isms-compliance-manager** · **deployment-specialist** · **devops-engineer** · **intelligence-operative** · **news-journalist** · **content-generator** · **data-pipeline-specialist** · **data-visualization-specialist** · **task-agent** · **ui-enhancement-specialist**
660
+
661
+ **9 Workflow-Specialist Agents** (`.agent.md`, invoked by name from workflows): `agentic-workflows` · `ci-cleaner` · `contribution-checker` · `create-safe-output-type` · `custom-engine-implementation` · `grumpy-reviewer` · `interactive-agent-designer` · `technical-doc-writer` · `w3c-specification-writer`
662
+
663
+ **Available Skills (91)** see [`.github/skills/README.md`](.github/skills/README.md) for the complete catalog across:
664
+
665
+ - 🛡️ Core Infrastructure & Governance (9) · 🕵️ Political Intelligence (11) · 🔐 ISMS & Security (14)
666
+ - ⚙️ Development & Operations (14) · 🧪 Testing & QA (2) · 🎨 UI/UX & Design (8)
667
+ - 📡 Data Integration (6) · 📰 Journalism & Media (5) · 🏛️ Government, Regulatory & Economics (7)
668
+ - 🗣️ Language & Localization (1) · 🤖 GitHub Agentic Workflows (13) · 📋 Copilot Patterns (1)
669
+
670
+ *Economic-Data Integrations (three primary sources, parity-treated):*
671
+ - **scb-mcp** (`@jarib/pxweb-mcp@2.0.0`) official Swedish statistics via PxWebAPI 2.0 (1,200+ tables)
672
+ - **world-bank-mcp** (`worldbank-mcp@1.0.1`) + `scripts/world-bank-client.ts` — WGI governance, environment, long-horizon social/education
673
+ - **IMF TypeScript client** (`scripts/imf-client.ts`) — WEO, Fiscal Monitor, IFS, GFS_COFOG via Datamapper JSON + SDMX 3.0; macro/fiscal freshness + T+5 projections. **Intentionally not an MCP server** — pure-TS, fully covered by the npm SBOM (ADR 0001).
724
674
 
725
675
  ### External Documentation
726
676
  - [CIA Platform Documentation](https://hack23.github.io/cia/)
@@ -730,13 +680,66 @@ gh attestation verify riksdagsmonitor-v1.0.0.zip -R Hack23/riksdagsmonitor
730
680
  - [Hack23 Secure Development Policy](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Secure_Development_Policy.md)
731
681
  - [Hack23 Blog](https://hack23.com/blog.html)
732
682
 
683
+ ## 🔬 Political Intelligence Analysis & News Creation
684
+
685
+ Riksdagsmonitor is built around two tightly-coupled product lines: **deep political intelligence analysis** and **autonomous news article creation**. Every news article is backed by a reproducible analysis artifact trail on disk.
686
+
687
+ ### End-to-end pipeline
688
+
689
+ ```mermaid
690
+ flowchart LR
691
+ A[📥 MCP + CIA + SCB + IMF<br/>data download] --> B[📐 Apply methodology<br/>analysis/methodologies]
692
+ B --> C[📋 Populate templates<br/>analysis/templates]
693
+ C --> D[📂 Write 9 or 14 artifacts<br/>analysis/daily/$DATE/$SUBFOLDER]
694
+ D --> E{🚦 Analysis Gate<br/>prompts/05}
695
+ E -- pass --> F[📰 Generate article<br/>prompts/06]
696
+ E -- fail --> C
697
+ F --> G[🌐 Translate into<br/>remaining 12 languages]
698
+ G --> H[🔀 One PR per article type<br/>prompts/07]
699
+ style A fill:#0a0e27,stroke:#00d9ff,color:#e0e0e0
700
+ style E fill:#dc3545,stroke:#b02a37,color:#fff
701
+ style H fill:#1a1e3d,stroke:#ffbe0b,color:#e0e0e0
702
+ ```
703
+
704
+ ### Vital documents
705
+
706
+ | Area | Document | What you'll find |
707
+ |------|----------|------------------|
708
+ | **Analysis framework** | [`analysis/README.md`](analysis/README.md) | Artifact taxonomy, 9-artifact / 14-artifact contract, daily-output layout |
709
+ | **Methodology library** | [`analysis/methodologies/README.md`](analysis/methodologies/README.md) | 11 methodology documents (AI-driven guide, per-document protocol, risk/SWOT/threat frameworks, synthesis, electoral, classification, style) |
710
+ | **Template library** | [`analysis/templates/README.md`](analysis/templates/README.md) | 23 templates — 8 core single-type (T1–T8) + 15 extended/Tier-C (scenario, executive-brief, coalition-mathematics, election-2026, historical-parallels, comparative-international, devil's advocate, etc.) |
711
+ | **News-generation contract** | [`.github/prompts/README.md`](.github/prompts/README.md) | 8 bounded-context prompt modules + Tier-C extension; single blocking analysis gate |
712
+ | **Workflow orchestration** | [`.github/workflows/README.md`](.github/workflows/README.md) + [`WORKFLOWS.md`](WORKFLOWS.md) §Stage 6.1 | How each `news-*.md` source compiles to a hardened `.lock.yml` with SHA-pinned actions, egress firewall, and five-layer safe-outputs |
713
+ | **Specialist personas** | [`.github/agents/README.md`](.github/agents/README.md) | `intelligence-operative`, `news-journalist`, `content-generator` — and 11 more |
714
+ | **Rules that guide the agents** | [`.github/skills/README.md`](.github/skills/README.md) | 11 political-intelligence skills + 5 journalism skills + 14 ISMS/security skills |
715
+
716
+ ### Data sources used during analysis
717
+
718
+ - **Riksdagen & Regeringen** via `riksdag-regering-mcp` (32 tools): MPs, votes, documents, speeches, committees, government docs
719
+ - **Statistics Sweden (SCB)** via `@jarib/pxweb-mcp@2.0.0` (1 200+ PxWeb tables)
720
+ - **World Bank Open Data** via `worldbank-mcp@1.0.1` + `scripts/world-bank-client.ts` (WGI governance, environment, education)
721
+ - **IMF** via `scripts/imf-client.ts` (pure-TS, WEO + Fiscal Monitor + IFS + GFS_COFOG, T+5 projections)
722
+ - **CIA platform** (Hack23) — 19 visualisation products consumed nightly via `update-cia-csv-data.yml`
723
+
724
+ ---
725
+
733
726
  ## 🤖 AI-Disrupted News Generation
734
727
 
735
- > *"While traditional newsrooms debate whether AI will replace journalists, Riksdagsmonitor already runs a fully autonomous political intelligence newsroom — 10 agentic workflows, 14 languages, zero human editors, and a publication schedule that would bankrupt any legacy outlet trying to keep up."*
728
+ > *"While traditional newsrooms debate whether AI will replace journalists, Riksdagsmonitor already runs a fully autonomous political intelligence newsroom — 12 agentic workflows, 14 languages, zero human editors, and a publication schedule that would bankrupt any legacy outlet trying to keep up."*
729
+
730
+ Riksdagsmonitor's **agentic news generation pipeline** is the world's first fully AI-driven political intelligence newsroom for parliamentary monitoring. Powered by Claude Opus (currently 4.7) via GitHub Copilot Coding Agent, our **12 specialized workflows** (11 scheduled + 1 on-demand, plus 1 dedicated translation workflow) autonomously produce deep political analysis — not shallow summaries, but structured intelligence products with source verification, multi-party balance, and GDPR-compliant OSINT methodology.
736
731
 
737
- Riksdagsmonitor's **agentic news generation pipeline** is the world's first fully AI-driven political intelligence newsroom for parliamentary monitoring. Powered by Claude Opus (currently 4.6) via GitHub Copilot Coding Agent, our 10 specialized workflows (9 scheduled + 1 on-demand) autonomously produce deep political analysis — not shallow summaries, but structured intelligence products with source verification, multi-party balance, and GDPR-compliant OSINT methodology.
732
+ > 📚 **Directory-level catalogs** (single sources of truth):
733
+ > - [`.github/workflows/README.md`](.github/workflows/README.md) — 45 workflow files (21 standard `.yml` + 12 agentic `.md` sources + 12 compiled `.lock.yml`)
734
+ > - [`.github/prompts/README.md`](.github/prompts/README.md) — 8 bounded-context prompt modules + `ext/tier-c-aggregation.md`, imported by every news workflow
735
+ > - [`.github/agents/README.md`](.github/agents/README.md) — 24 Copilot agent files (14 personas + 9 workflow-specialists + 1 shared developer-instructions)
736
+ > - [`.github/skills/README.md`](.github/skills/README.md) — 91 skills grouped by 12 functional categories
737
+ > - [`analysis/README.md`](analysis/README.md) — on-disk artifact layout (`analysis/daily/$ARTICLE_DATE/$SUBFOLDER/`) with 9-artifact / 14-artifact contracts
738
+ > - [`analysis/methodologies/README.md`](analysis/methodologies/README.md) — 11 methodology documents
739
+ > - [`analysis/templates/README.md`](analysis/templates/README.md) — 23 canonical output templates (8 core single-type + 15 extended / Tier-C)
740
+ > - [`WORKFLOWS.md`](WORKFLOWS.md) — canonical end-to-end reference (v7.2, includes Stage 6.1 *Agentic Workflow Structure & Prompt Imports*)
738
741
 
739
- ### 📰 Autonomous Publication Schedule
742
+ ### Autonomous Publication Schedule
740
743
 
741
744
  Every day, the platform's AI operatives awaken on cron schedules, query the Swedish Parliament's open data via **32 MCP tools**, cross-reference government sources, and generate publication-ready intelligence articles in **14 languages** — including RTL support for Arabic and Hebrew.
742
745
 
@@ -745,15 +748,17 @@ Every day, the platform's AI operatives awaken on cron schedules, query the Swed
745
748
  | 🌅 04:00 | **Committee Reports** | Utskottsbetänkanden analysis, voting breakdowns | Mon–Fri |
746
749
  | 🌅 05:00 | **Propositions** | Government bills, legislative impact assessment | Mon–Fri |
747
750
  | ☀️ 06:00 | **Motions** | Opposition proposals, party strategy decoding | Mon–Fri |
748
- | ☀️ 07:00 | **Week Ahead** | Parliamentary calendar preview, agenda intelligence | Friday |
749
- | ☀️ 08:00 | **Month Ahead** | Strategic outlook, coalition forecasting | 1st of month |
751
+ | 07:00 | **Interpellations** | Ministerial accountability, evasion detection | Mon–Fri |
752
+ | 🔮 07:00 | **Week Ahead** | Parliamentary calendar preview, agenda intelligence | Friday |
753
+ | 📅 08:00 | **Month Ahead** | Strategic outlook, coalition forecasting | 1st of month |
750
754
  | 🔍 10:00 & 14:00 (Mon–Fri); 12:00 (Sat/Sun) | **Realtime Monitor** | Breaking political developments, flash analysis | Mon–Fri (×2) + weekends |
755
+ | 🌍 11:00 & 17:00 (Mon–Fri); 14:00 (Sat/Sun) | **Translate** | 12 additional languages from EN/SV cores | Daily |
751
756
  | 🌆 18:00 (16:00 Sat) | **Evening Analysis** | Deep-dive intelligence synthesis | Mon–Sat |
752
757
  | 📊 09:00 | **Weekly Review** | Week-in-review scorecard, party performance | Saturday |
753
758
  | 📈 10:00 | **Monthly Review** | Comprehensive monthly intelligence assessment | 28th of month |
754
- | 🔧 Manual | **Article Generator** | On-demand article generation | On-demand |
759
+ | 🔧 Manual | **Article Generator** | On-demand article generation / backfill | On-demand |
755
760
 
756
- > _All times are **UTC** (GitHub Actions cron). For local time, convert to CET/CEST. Authoritative schedules defined in `.github/workflows/news-*.lock.yml` workflows._
761
+ > _All times are **UTC** (GitHub Actions cron). For local time, convert to CET/CEST. Authoritative schedules defined in `.github/workflows/news-*.lock.yml` workflows — see [`.github/workflows/README.md`](.github/workflows/README.md) for the complete inventory._
757
762
 
758
763
  > **Result**: Dozens of articles per week across 14 languages — delivering **hundreds of localized intelligence products each month**, generated autonomously with zero editorial intervention.
759
764
 
@@ -784,7 +789,7 @@ timeline
784
789
  title Riksdagsmonitor Evolution — 2026 to 2037
785
790
  section Phase 3 — Foundation (2026)
786
791
  Q1-Q2 : TypeScript migration ✅
787
- : 10 agentic news workflows ✅
792
+ : 12 agentic news workflows ✅
788
793
  : 34 GitHub Actions workflows + 10 agent prompt files
789
794
  : Dual deployment (S3 + GitHub Pages)
790
795
  Q3-Q4 : CIA data pipeline integration
@@ -833,7 +838,7 @@ timeline
833
838
  graph LR
834
839
  subgraph SGCompleted["✅ Completed"]
835
840
  style SGCompleted fill:#006400,stroke:#00d9ff,color:#e0e0e0
836
- A[TypeScript Migration<br/>31 modules] --> B[Agentic News Gen<br/>10 workflows]
841
+ A[TypeScript Migration<br/>31 modules] --> B[Agentic News Gen<br/>12 workflows]
837
842
  B --> C[14 Languages<br/>RTL support]
838
843
  C --> D[Dual Deploy<br/>S3 + GitHub Pages]
839
844
  end
@@ -853,7 +858,7 @@ graph LR
853
858
  | Capability | Status | Details |
854
859
  |:-----------|:------:|:--------|
855
860
  | TypeScript migration | ✅ Done | 31 modules, 2890 Vitest tests |
856
- | Agentic news generation | ✅ Live | 10 workflows (9 scheduled + 1 on-demand), 14 languages |
861
+ | Agentic news generation | ✅ Live | 12 workflows (11 scheduled + 1 on-demand), 14 languages |
857
862
  | 14-language support | ✅ Live | Including Arabic/Hebrew RTL |
858
863
  | CIA data integration | 🔄 Active | 19 visualization products |
859
864
  | Predictive dashboards | 📋 Planned | Chart.js/D3.js interactive displays |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "riksdagsmonitor",
3
- "version": "0.8.48",
3
+ "version": "0.8.51",
4
4
  "type": "module",
5
5
  "description": "Swedish Parliament (Riksdag) intelligence platform — TypeScript utilities for political data visualization, dashboards, and open data analysis with Chart.js and D3.js",
6
6
  "main": "dist/lib/shared/index.js",
@@ -160,8 +160,8 @@
160
160
  "@types/d3": "7.4.3",
161
161
  "@types/node": "25.6.0",
162
162
  "@types/papaparse": "5.5.2",
163
- "@vitest/coverage-v8": "4.1.4",
164
- "@vitest/ui": "4.1.4",
163
+ "@vitest/coverage-v8": "4.1.5",
164
+ "@vitest/ui": "4.1.5",
165
165
  "ajv": "8.18.0",
166
166
  "ajv-formats": "3.0.1",
167
167
  "chart.js": "4.5.1",
@@ -173,7 +173,7 @@
173
173
  "htmlhint": "1.9.2",
174
174
  "js-yaml": "4.1.1",
175
175
  "json-schema-to-typescript": "15.0.4",
176
- "knip": "6.5.0",
176
+ "knip": "6.6.1",
177
177
  "papaparse": "5.5.3",
178
178
  "playwright": "1.59.1",
179
179
  "start-server-and-test": "3.0.2",
@@ -184,11 +184,11 @@
184
184
  "typescript-eslint": "8.59.0",
185
185
  "vite": "8.0.9",
186
186
  "vite-plugin-sri-gen": "1.3.2",
187
- "vitest": "4.1.4",
187
+ "vitest": "4.1.5",
188
188
  "worldbank-mcp": "1.0.1"
189
189
  },
190
190
  "optionalDependencies": {
191
- "cypress": "15.14.0"
191
+ "cypress": "15.14.1"
192
192
  },
193
193
  "overrides": {
194
194
  "glob": "13.0.6"