$npx -y skills add hodgesmr/agent-fecfile --skill fecfileAnalyze 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_
| 1 | # FEC Filing Analysis |
| 2 | |
| 3 | This skill enables analysis of Federal Election Commission campaign finance filings. |
| 4 | |
| 5 | ## Requirements |
| 6 | |
| 7 | - [uv](https://docs.astral.sh/uv/) must be installed |
| 8 | - Python 3.9+ |
| 9 | |
| 10 | Dependencies are automatically installed when running scripts with `uv run`. |
| 11 | |
| 12 | ## First-Time Check |
| 13 | |
| 14 | The first time this skill is invoked in a session, verify that `uv` is installed by running: |
| 15 | |
| 16 | ```bash |
| 17 | uv --version |
| 18 | ``` |
| 19 | |
| 20 | 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/ |
| 21 | |
| 22 | ## Quick Start |
| 23 | |
| 24 | **Always start by checking the filing size:** |
| 25 | ```bash |
| 26 | uv run scripts/fetch_filing.py <FILING_ID> --summary-only |
| 27 | ``` |
| 28 | |
| 29 | 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. |
| 30 | |
| 31 | **Fetching data:** |
| 32 | ```bash |
| 33 | uv run scripts/fetch_filing.py <FILING_ID> # Full filing (small filings only) |
| 34 | uv run scripts/fetch_filing.py <FILING_ID> --schedule A # Only contributions |
| 35 | uv run scripts/fetch_filing.py <FILING_ID> --schedule B # Only disbursements |
| 36 | uv run scripts/fetch_filing.py <FILING_ID> --schedules A,B # Multiple schedules |
| 37 | ``` |
| 38 | |
| 39 | The `fecfile` library is installed automatically by uv. |
| 40 | |
| 41 | ## Field Name Policy |
| 42 | |
| 43 | **IMPORTANT**: Do not guess at field names. Before referencing any field names in responses: |
| 44 | |
| 45 | 1. For form-level fields (summary data, cash flow, totals): Read `references/FORMS.md` |
| 46 | 2. For itemization fields (contributors, payees, expenditures): Read `references/SCHEDULES.md` |
| 47 | |
| 48 | 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. |
| 49 | |
| 50 | ## Handling Large Filings |
| 51 | |
| 52 | 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.** |
| 53 | |
| 54 | ### Checking Size |
| 55 | |
| 56 | Before pulling full schedules, use `--summary-only` to assess the filing: |
| 57 | |
| 58 | ```bash |
| 59 | uv run scripts/fetch_filing.py <ID> --summary-only |
| 60 | ``` |
| 61 | |
| 62 | The summary includes financial totals that help gauge filing size without parsing itemizations: |
| 63 | |
| 64 | | Field | Description | |
| 65 | |-------|-------------| |
| 66 | | `col_a_individuals_itemized` | Itemized individual contributions (this period) | |
| 67 | | `col_a_total_contributions` | Total contributions (this period) | |
| 68 | | `col_a_total_disbursements` | Total disbursements (this period) | |
| 69 | | `col_b_individuals_itemized` | Itemized individual contributions (year-to-date) | |
| 70 | | `col_b_total_contributions` | Total contributions (year-to-date) | |
| 71 | | `col_b_total_disbursements` | Total disbursements (year-to-date) | |
| 72 | |
| 73 | These are dollar totals, not item counts, but combined with the committee name they help you decide: |
| 74 | - **Small state/local party with modest totals**: Probably safe to pull full schedules |
| 75 | - **ActBlue, WinRed, or presidential campaign with millions in totals**: Use streaming or post-filter |
| 76 | |
| 77 | If you need to verify exact counts before processing, stream with an early cutoff: |
| 78 | |
| 79 | ```bash |
| 80 | uv run scripts/fetch_filing.py <ID> --stream --schedule A | python3 -c " |
| 81 | import sys |
| 82 | count = 0 |
| 83 | limit = 256 |
| 84 | for line in sys.stdin: |
| 85 | count += 1 |
| 86 | if count >= limit: |
| 87 | print(f'Schedule A: {limit}+ items (stopped counting)') |
| 88 | sys.exit(0) |
| 89 | print(f'Schedule A: {count} items') |
| 90 | " |
| 91 | ``` |
| 92 | |
| 93 | 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. |
| 94 | |
| 95 | ### Pre-Filtering at Parse Time |
| 96 | |
| 97 | Use CLI flags to filter before data is loaded into memory: |
| 98 | |
| 99 | | Flag | Effect | |
| 100 | |------|--------| |
| 101 | | `--summary-only` | Only filing summary (no itemizations) | |
| 102 | | `--schedule A` | Only Schedule A (contributions) | |
| 103 | | `--schedule B` | Only Schedule B (disbursements) | |
| 104 | | `--schedule C` | Only Schedule C (loans) | |
| 105 | | `--schedule D` | Only Schedule D (debts) | |
| 106 | | `--schedule E` | Only Schedule E (independent expenditures) | |
| 107 | | `--schedules A,B` | Multiple schedules (comma-separated) | |
| 108 | |
| 109 | Schedules you don't request are never parsed. |
| 110 | |
| 111 | ### Post-Filtering with Pandas |
| 112 | |
| 113 | Use Python/pandas to aggregate, filter, and limit results: |