fecfile
Analyze FEC (Federal Election Commission) campaign finance filings. Use when working with FEC filing IDs, campaign finance data, contributions, disbursements, or political committee financial reports. Provides the proper workflow for the fec-api MCP tools (search_committees, get_filings).
What this skill does
# FEC Filing Analysis
This skill enables analysis of Federal Election Commission campaign finance filings.
## Requirements
- [uv](https://docs.astral.sh/uv/) must be installed
- Python 3.9+
Dependencies are automatically installed when running scripts with `uv run`.
## First-Time Check
The first time this skill is invoked in a session, verify that `uv` is installed by running:
```bash
uv --version
```
If this command fails or `uv` is not found, do not proceed. Instead, inform the user that `uv` is required but not installed, and direct them to the installation guide: https://docs.astral.sh/uv/getting-started/installation/
## Quick Start
**Always start by checking the filing size:**
```bash
uv run scripts/fetch_filing.py <FILING_ID> --summary-only
```
Based on the summary, decide how to proceed—see **Handling Large Filings** below for filtering and streaming strategies. Small filings can be fetched directly; large filings require pre-filtering or streaming.
**Fetching data:**
```bash
uv run scripts/fetch_filing.py <FILING_ID> # Full filing (small filings only)
uv run scripts/fetch_filing.py <FILING_ID> --schedule A # Only contributions
uv run scripts/fetch_filing.py <FILING_ID> --schedule B # Only disbursements
uv run scripts/fetch_filing.py <FILING_ID> --schedules A,B # Multiple schedules
```
The `fecfile` library is installed automatically by uv.
## Field Name Policy
**IMPORTANT**: Do not guess at field names. Before referencing any field names in responses:
1. For form-level fields (summary data, cash flow, totals): Read `references/FORMS.md`
2. For itemization fields (contributors, payees, expenditures): Read `references/SCHEDULES.md`
These files contain the authoritative field mappings. If a field name isn't documented there, verify it exists in the actual JSON output before using it.
## Handling Large Filings
FEC filings vary enormously in size. Small filings (like state party monthly reports) may have only a few dozen itemizations and can be used directly. However, major committees like ActBlue, WinRed, and presidential campaigns can have hundreds of thousands of itemizations in a single filing. **Do not dump large filing data directly into the context window. Avoid streaming large filings to stdout.**
### Checking Size
Before pulling full schedules, use `--summary-only` to assess the filing:
```bash
uv run scripts/fetch_filing.py <ID> --summary-only
```
The summary includes financial totals that help gauge filing size without parsing itemizations:
| Field | Description |
|-------|-------------|
| `col_a_individuals_itemized` | Itemized individual contributions (this period) |
| `col_a_total_contributions` | Total contributions (this period) |
| `col_a_total_disbursements` | Total disbursements (this period) |
| `col_b_individuals_itemized` | Itemized individual contributions (year-to-date) |
| `col_b_total_contributions` | Total contributions (year-to-date) |
| `col_b_total_disbursements` | Total disbursements (year-to-date) |
These are dollar totals, not item counts, but combined with the committee name they help you decide:
- **Small state/local party with modest totals**: Probably safe to pull full schedules
- **ActBlue, WinRed, or presidential campaign with millions in totals**: Use streaming or post-filter
If you need to verify exact counts before processing, stream with an early cutoff:
```bash
uv run scripts/fetch_filing.py <ID> --stream --schedule A | python3 -c "
import sys
count = 0
limit = 256
for line in sys.stdin:
count += 1
if count >= limit:
print(f'Schedule A: {limit}+ items (stopped counting)')
sys.exit(0)
print(f'Schedule A: {count} items')
"
```
If itemization counts are in the hundreds or more, you must post-filter before presenting results. Even smaller filings may benefit from post-filtering to aggregate or focus the output.
### Pre-Filtering at Parse Time
Use CLI flags to filter before data is loaded into memory:
| Flag | Effect |
|------|--------|
| `--summary-only` | Only filing summary (no itemizations) |
| `--schedule A` | Only Schedule A (contributions) |
| `--schedule B` | Only Schedule B (disbursements) |
| `--schedule C` | Only Schedule C (loans) |
| `--schedule D` | Only Schedule D (debts) |
| `--schedule E` | Only Schedule E (independent expenditures) |
| `--schedules A,B` | Multiple schedules (comma-separated) |
Schedules you don't request are never parsed.
### Post-Filtering with Pandas
Use Python/pandas to aggregate, filter, and limit results:
```bash
cat > /tmp/analysis.py << 'EOF'
# /// script
# requires-python = ">=3.9"
# dependencies = ["pandas>=2.3.0"]
# ///
import json, sys
import pandas as pd
data = json.load(sys.stdin)
df = pd.DataFrame(data.get('itemizations', {}).get('Schedule A', []))
# Aggregate and limit output
print(df.groupby('contributor_state')['contribution_amount'].agg(['count', 'sum']).sort_values('sum', ascending=False).to_string())
EOF
uv run scripts/fetch_filing.py <ID> --schedule A 2>&1 | uv run /tmp/analysis.py
```
### Streaming Mode (Producer/Consumer Model)
For truly massive filings where even a single schedule is too large to hold in memory, use `--stream` to output JSONL (one JSON object per line):
```bash
uv run scripts/fetch_filing.py <ID> --stream --schedule A
```
Each line has the format: `{"data_type": "...", "data": {...}}`
**How streaming works:**
The producer (fetch_filing.py) outputs one record at a time without loading the full filing. A consumer script reads one line at a time and aggregates incrementally. Neither side ever holds all records in memory.
Example streaming aggregation:
```bash
uv run scripts/fetch_filing.py <ID> --stream --schedule A | python3 -c "
import json, sys
from collections import defaultdict
totals = defaultdict(float)
counts = defaultdict(int)
for line in sys.stdin:
rec = json.loads(line)
if rec['data_type'] == 'itemization':
state = rec['data'].get('contributor_state', 'Unknown')
amt = float(rec['data'].get('contribution_amount', 0))
totals[state] += amt
counts[state] += 1
for state in sorted(totals, key=lambda s: -totals[s]):
print(f'{state}: {counts[state]} contributions, \${totals[state]:,.2f}')
"
```
This processes hundreds of thousands of records using constant memory.
### Guidelines
1. **Small filings** - Can be used directly without filtering
2. **Large filings** - Pre-filter with `--summary-only` or `--schedule X`, then check size
3. **Massive results** - Post-filter with pandas to aggregate, filter, and limit output
4. **Streaming mode** - Use `--stream` with inline Python consumers for constant-memory processing
5. **Limit output** - Use `.head()`, `.nlargest()`, `.nsmallest()` to cap results
## Finding Filings by Candidate/Committee Name
When the user asks about a candidate or committee's filings without providing a filing ID, use the MCP tools to discover the filing ID.
### MCP Tools
The `fec-api` MCP server provides two tools:
- **`search_committees`**: Search for committees by name → returns committee IDs
- **`get_filings`**: Get filings for a committee ID → returns filing IDs and metadata
The MCP server loads the FEC API key from the system keyring on first tool use, keeping it secure and hidden from the conversation. The API key is never visible to the model.
### API Key Security
**IMPORTANT**: Never output or log the FEC API key. The key is loaded on first tool use, cached in memory, and never exposed to the model.
The key can be accidentally exposed in:
- Error messages from HTTP clients (which may include the full URL)
- Debug output or logging
- Custom scripts that print request parameters
The MCP server sanitizes error output to prevent key exposure.
### Workflow Example
**"What are the top expenditures in Utah Republican Party's most recent filing?"**
**Step 1: Find the committee**
Use `search_committees` tool with query "Utah Republican Party":
```json
[
{
Related in Ads & Marketing
ads
IncludedMulti-platform paid advertising audit and optimization skill. Analyzes Google, Meta, YouTube, LinkedIn, TikTok, Microsoft, and Apple Ads. 250+ checks with scoring, parallel agents, industry templates, and AI creative generation.
banana
IncludedAI image generation Creative Director powered by Google Gemini Nano Banana models. Use this skill for ANY request involving image creation, editing, visual asset production, or creative direction. Triggers on: generate an image, create a photo, edit this picture, design a logo, make a banner, visual for my anything, and all /banana commands. Handles text-to-image, image editing, multi-turn creative sessions, batch workflows, and brand presets.
rpg-migration-analyzer
IncludedAnalyzes legacy RPG (Report Program Generator) programs from AS/400 and IBM i systems for migration to modern Java applications. Extracts business logic from RPG III/IV/ILE source code, identifies data structures (D-specs), file operations (F-specs), program dependencies (CALLB/CALLP), and converts RPG constructs to Java equivalents. Generates migration reports, complexity estimates, and Java implementation strategies with POJO classes, JPA entities, and service methods. Use when modernizing AS/400 or IBM i legacy systems, analyzing RPG source files (.rpg, .rpgle, .RPGLE), converting RPG to Java, mapping data specifications to Java classes, planning legacy system migration, or when user mentions RPG analysis, Report Program Generator, RPG III/IV/ILE, AS/400 modernization, IBM i migration, packed decimal conversion, or mainframe application rewrite.
brand-library-architect
IncludedBuild a complete brand library for a product — visual asset render pipeline, brand documentation set (BRAND, COPY, MANIFESTO, BIOS, FAQ, GLOSSARY, TONE, PRICING), open-source convention files (README, CONTRIBUTING, SECURITY, CODE_OF_CONDUCT), and a self-contained press kit. This skill should be used when the user asks to "build a brand library / brand kit / press kit / brand assets" for a product, "set up a brand library workflow," "create a positioning manifesto plus visual identity," or any combination of brand documentation + visual asset pipeline. Apply phase-by-phase or run end-to-end. Templates are product-agnostic and use {{TOKEN}} placeholders the skill prompts the user to fill.
writing-tech-post
IncludedAuthors engineering blog posts end-to-end: launch deep-dives, incident postmortems, architecture migrations, performance case studies, tutorials, AI/agent system writeups, security disclosures, and research-to-product translations. Picks the correct archetype, plans the abstraction ladder, enforces an evidence cadence (diagrams, benchmarks, profiles, traces, code, ablations), tunes voice against publisher house styles (Datadog, Vercel, GitHub, AWS, Meta, Cloudflare, Jane Street), and runs a pre-publish gate for narrative momentum and disclosure ethics. Use when drafting a new engineering post, restructuring a draft that feels flat, deciding which evidence form belongs where, validating that depth and product context are balanced, or preparing a postmortem, migration, or performance narrative for external publication. Do not use for API reference documentation, README authoring, marketing copy, release notes, generic SEO content, ghost-written executive thought leadership, or non-engineering long-form essays.
blog-google
IncludedGoogle API integration for blog performance: PageSpeed Insights, CrUX Core Web Vitals with 25-week history, Search Console performance, URL Inspection, Indexing API, GA4 organic traffic, NLP entity analysis for E-E-A-T, YouTube video search for embedding, and Google Ads Keyword Planner. Progressive feature availability based on credential tier (API key, OAuth/service account, GA4, Ads). Shares config with claude-seo at ~/.config/claude-seo/google-api.json. Use when user says "google data", "page speed", "core web vitals", "search console", "indexation", "GA4", "keyword research", "nlp entities", "blog performance", "youtube search", "google api setup".