Skip to content

feat: add Claude Code investigation skill#9

Open
tdimino wants to merge 3 commits intoShinMegamiBoson:mainfrom
tdimino:feat/claude-code-skill
Open

feat: add Claude Code investigation skill#9
tdimino wants to merge 3 commits intoShinMegamiBoson:mainfrom
tdimino:feat/claude-code-skill

Conversation

@tdimino
Copy link

@tdimino tdimino commented Feb 20, 2026

Why a Claude Code Skill for OpenPlanter?

OpenPlanter is a recursive investigation agent with its own runtime. Claude Code is a general-purpose AI coding assistant with native file, web, and shell tools. This skill bridges them:

  • Methodology portability: OpenPlanter's epistemic discipline (Admiralty System, ACH, entity resolution protocol) works inside Claude Code without installing the full agent
  • Tool parity: Every OpenPlanter tool maps to a Claude Code equivalent (see tool mapping table in SKILL.md) — the methodology is what matters, not the runtime
  • Delegation bridge: When investigations exceed Claude Code's comfort zone (20+ reasoning steps, 3+ datasets), delegate_to_rlm.py spawns the full OpenPlanter agent as a subprocess with session resume support
  • 12 government API fetchers: SEC EDGAR, FEC, Senate LDA, USAspending, OFAC SDN, OpenSanctions + 6 specialized fetchers (Census ACS, EPA ECHO, ICIJ Offshore Leaks, OSHA, ProPublica 990, SAM.gov)
  • Knowledge graph query: Read-only access to OpenPlanter wiki knowledge graphs built during delegated investigations

This is not a port. It's a bridge between two complementary investigation paradigms.


Summary

  • 16 scripts (10 core + 6 specialized fetchers): all Python stdlib-only, zero external dependencies
  • Core scripts: dataset_fetcher.py (bulk datasets), web_enrich.py (Exa neural search), scrape_records.py (SEC/FEC/LDA/USAspending), investigate.py (pipeline orchestrator), delegate_to_rlm.py (provider-agnostic RLM bridge with session management), entity_resolver.py, cross_reference.py, confidence_scorer.py, evidence_chain.py, init_workspace.py
  • Specialized fetchers: fetch_census.py, fetch_epa.py, fetch_icij.py, fetch_osha.py, fetch_propublica990.py, fetch_sam.py
  • Wiki graph: wiki_graph_query.py (read-only query of OpenPlanter knowledge graphs — entity lookup, BFS pathfinding, neighbor traversal, stats)
  • 2 agent definitions: investigation-agent.md (decision tree: scripts vs. RLM delegation), verifier-agent.md (read-only uncorrelated verification)
  • 1 reference doc: public-records-apis.md (12 API endpoints with auth, rate limits, linking keys)
  • Updated docs: SKILL.md, README.md, CLAUDE.md

Three Integration Modes

Mode When Scripts
Methodology Only 1-2 datasets, local analysis Core analysis scripts
Web-Enriched Need external data, public records + dataset_fetcher.py, web_enrich.py, scrape_records.py, 6 specialized fetchers
Full RLM Delegation Complex investigations, 3+ datasets delegate_to_rlm.py → full OpenPlanter agent (session-resumable)

Provider-Agnostic RLM Delegation

delegate_to_rlm.py auto-infers provider from model name:

  • claude-* → anthropic, gpt-* → openai, org/model → openrouter
  • llama/qwen/mistral/gemma/phi/deepseek → ollama (local inference)
  • For ambiguous models, pass --provider explicitly

Session management: --resume SESSION_ID continues a previous investigation, --list-sessions shows saved sessions, --list-models shows available models per provider. --reasoning-effort low|medium|high controls investigation depth.

6 Specialized Government API Fetchers

Script Source Auth Key Linking Fields
fetch_census.py US Census ACS 5-Year Optional CENSUS_API_KEY State/county/ZIP FIPS, population, income
fetch_epa.py EPA ECHO None FRS Registry ID, facility name, lat/lon, SIC/NAICS
fetch_icij.py ICIJ Offshore Leaks None ICIJ node ID, jurisdiction, source dataset
fetch_osha.py OSHA DOL Enforcement None Activity number, establishment name, SIC/NAICS
fetch_propublica990.py ProPublica Nonprofit Explorer None EIN, org name, NTEE code, officer compensation
fetch_sam.py SAM.gov Entity Management SAM_GOV_API_KEY UEI, CAGE code, legal name, NAICS

All fetchers follow the same pattern: argparse CLI → urllib.requestdatasets/scraped/{source}/ → provenance.json sidecar with SHA-256.

Wiki Knowledge Graph Query

wiki_graph_query.py provides read-only access to OpenPlanter wiki graphs (NetworkX node-link JSON):

  • Entity lookup (case-insensitive substring)
  • Neighbor traversal (inbound + outbound edges)
  • BFS shortest path between entities
  • Graph statistics (node/link counts, type distributions, top connected nodes)
  • Full-text search across all fields

Review Fixes Applied (from original PR)

  • scrape phase added to investigate.py collect group
  • FEC API key stripped from error messages
  • Pagination truncation warning in dataset_fetcher.py
  • Cerebras examples use --provider cerebras explicitly
  • investigate.py examples include required workspace positional arg
  • Verifier agent docs note evidence_chain.py write side-effect
  • web_enrich.py exits on parse error instead of returning misleading message

Vision for Next PR

Agent-side integration: modify agent/tools.py and tool_defs.py to expose skill scripts as native OpenPlanter agent tools, enabling the RLM agent to invoke the same entity resolution and evidence chain scripts programmatically.

Test plan

  • All 17 scripts pass --help and py_compile
  • Multi-agent code review — all issues resolved
  • Manual: investigate.py /tmp/test --phases all --dry-run
  • Manual: scrape_records.py /tmp/test --entities "Apple" --sources sec --dry-run
  • Manual: delegate_to_rlm.py --check
  • Manual: fetch_sam.py /tmp/test --list (verify NAICS codes)
  • Manual: wiki_graph_query.py /tmp/test --stats

🤖 Generated with Claude Code

Add skills/openplanter/ — a zero-dependency Claude Code skill extracting
OpenPlanter's investigation methodology (entity resolution, evidence chains,
confidence scoring) into standalone Python stdlib scripts.

- 5 scripts: init_workspace, entity_resolver, cross_reference, evidence_chain, confidence_scorer
- 3 reference docs: entity resolution patterns, investigation methodology, output templates
- SKILL.md with epistemic framework, Admiralty confidence tiers, ACH methodology
- README.md with installation, quick start, and minoan-swarm integration link
- ARCHITECTURE.md following matklad's guidelines (codemap, invariants, layer boundaries)
- AGENTS.md for cross-agent compatibility (Codex, Cursor, Copilot, Devin)
- Enhanced CLAUDE.md with project overview, commands, conventions, provider config
…n, and pipeline orchestrator

Add 5 new scripts (dataset_fetcher, web_enrich, scrape_records, investigate,
delegate_to_rlm), 2 agent definitions (investigation-agent, verifier-agent),
and public-records-apis reference. Provider-agnostic RLM delegation auto-infers
from model name. Three integration modes: methodology only, web-enriched, full
RLM delegation. All scripts stdlib-only, verified passing --help.

Review fixes: scrape phase added to pipeline, FEC API key stripped from errors,
pagination truncation warning, Cerebras examples use --provider explicitly,
investigate.py docs include workspace arg, EDGAR URL matches actual script.
@tdimino tdimino changed the title feat: expand Claude Code skill with web enrichment, public records, and RLM delegation feat: add Claude Code investigation skill Feb 20, 2026
Expand the Claude Code investigation skill with:

- 6 specialized data fetcher scripts (Census ACS, EPA ECHO, ICIJ
  Offshore Leaks, OSHA DOL, ProPublica 990, SAM.gov) — all stdlib-only
- wiki_graph_query.py for read-only access to OpenPlanter wiki
  knowledge graphs (entity lookup, BFS pathfinding, neighbor traversal)
- delegate_to_rlm.py upgraded with --resume, --list-sessions,
  --list-models, --reasoning-effort, Ollama provider auto-detection
- SKILL.md expanded with new capabilities, 24 tool mappings, 12 API
  sources documented
- public-records-apis.md updated with 6 new government API endpoints

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tdimino
Copy link
Author

tdimino commented Mar 10, 2026

Hey @ShinMegamiBoson — just pushed a major expansion to this PR:

  • 6 new government API fetcher scripts: Census ACS, EPA ECHO, ICIJ Offshore Leaks, OSHA, ProPublica 990, SAM.gov — all stdlib-only, matching the upstream fetcher patterns
  • wiki_graph_query.py: Read-only query tool for OpenPlanter wiki knowledge graphs (entity lookup, BFS pathfinding, neighbor traversal, stats)
  • delegate_to_rlm.py upgraded: --resume session management, --list-sessions, --list-models, --reasoning-effort, Ollama provider auto-detection
  • SKILL.md + public-records-apis.md: Expanded to cover all 12 API sources, 24 tool mappings

We've been using this skill to power World War Watcher, a real-time dashboard tracking the Iran-US war's impact on infrastructure and economics — entity resolution across defense contractors, government contract data (SAM.gov), and OSINT source chains all run through OpenPlanter methodology: https://x.com/IdaeanDaktyl/status/2031455436591747519

Would love your thoughts on the direction — especially the fetcher pattern and whether you'd want to expose these as native OpenPlanter tools in a future PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant