corporate-tax-form-fill

Programmatically fill IRS tax form PDFs (Form 1120, etc.) using pymupdf/fitz. Covers field discovery, mapping, filling, cross-checking, and PDF generation.

5 stars

Best use case

corporate-tax-form-fill is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Programmatically fill IRS tax form PDFs (Form 1120, etc.) using pymupdf/fitz. Covers field discovery, mapping, filling, cross-checking, and PDF generation.

Teams using corporate-tax-form-fill should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/corporate-tax-form-fill/SKILL.md --create-dirs "https://raw.githubusercontent.com/vamseeachanta/workspace-hub/main/.agents/skills/corporate-tax-form-fill/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/corporate-tax-form-fill/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How corporate-tax-form-fill Compares

Feature / Agentcorporate-tax-form-fillStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Programmatically fill IRS tax form PDFs (Form 1120, etc.) using pymupdf/fitz. Covers field discovery, mapping, filling, cross-checking, and PDF generation.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Corporate Tax Form Fill — IRS PDF Automation

Fill IRS tax form PDFs programmatically using pymupdf (fitz).
Companion to `corporate-tax-strategic-planning` (analysis → execution).

## When to Use

- User has computed tax numbers and needs to fill an IRS PDF form
- User wants to regenerate a filled PDF after changing values
- User needs to discover field names in a new IRS form version

## Prerequisites

- `uv pip install pymupdf` (provides the `fitz` module)
- Blank fillable PDF from IRS (e.g., `f1120.pdf` from irs.gov/pub/irs-pdf/)
- Source of truth YAML with all computed values

## Step 1: Field Discovery

Extract all widget fields from the blank PDF to build a field map:

```python
import fitz
doc = fitz.open("f1120_blank.pdf")
for pg_idx, page in enumerate(doc):
    for w in page.widgets():
        print(f"Page {pg_idx+1} | {w.field_name} | type={w.field_type} | rect={w.rect}")
```

**Field naming convention (2025 Form 1120):**
- Text fields: `topmostSubform[0].PageN[0]...fN_X[0]` — match by suffix `fN_X[0]`
- Checkboxes: `...cN_X[0]` or `...cN_X[1]` — on-values typically "1", "2", "3"
- Page numbering: `f1_*` = Page 1, `f3_*` = Page 3, `f6_*` = Page 6
- **Field names change with each year's form revision** — always re-discover

## Step 2: Field-to-Line Mapping

When field names aren't self-documenting, extract text labels to correlate:

```python
page = doc[page_idx]
words = page.get_text("words")  # [(x0, y0, x1, y1, "text", ...)]
# Match field rect.y to nearest text label
```

For checkboxes, check available states:
```python
w.button_states()  # Returns dict with on/off values
```

## Step 3: Fill Script Pattern

```python
def fill(page_idx, suffix, value):
    page = doc[page_idx]
    for w in page.widgets():
        if w.field_name.endswith(suffix):
            w.field_value = str(value)
            w.update()
            return True
    print(f"  MISS: page {page_idx + 1}, suffix={suffix}")
    return False

def check(page_idx, suffix, on_value="1"):
    # Same pattern for checkboxes
```

## Step 4: Cross-Check Verification

After generating, read back and verify critical ties:

| Check | Formula |
|-------|---------|
| Schedule L balance | Total assets = Total L&E (both BOY and EOY) |
| M-1 reconciliation | Line 10 = Page 1 Line 28 |
| M-2 → Schedule L | M-2 Line 8 (EOY balance) = Schedule L Line 25 (RE EOY) |
| Tax computation | Taxable income × 21% = Tax (Schedule J) |
| Page 1 flow | Line 11 - Line 27 = Line 28 |

## Step 5: Output Structure

```
taxes/YYYY/
├── f1120_blank.pdf              # IRS blank form (input)
├── fill_f1120.py                # Fill script (regenerable)
├── YYYY-form-1120-filled.pdf    # Output PDF
├── YYYY-form-1120-filing-packet.yaml  # Source of truth
└── YYYY-form-1120-fill-guide.md      # Human-readable fill guide
```

## Pitfalls

1. **Schedule L line numbers shift between years** — the 2025 form uses Line 15 for Total Assets, Line 22a/b for stock, Line 25 for RE. Always verify against the actual PDF.

2. **Checkbox on-values aren't always "1"** — use `w.button_states()` to discover. First radio = "1", second = "2", etc.

3. **M-1/M-2 consistency** — M-2 ending balance MUST equal Schedule L retained earnings. If they don't match, the book net income calculation is wrong. Work backward from Schedule L.

4. **Negative cash** — if company cash is negative, show $0 on Schedule L Line 1 and move the overdraft to Line 18 (Other current liabilities).

5. **The `fill()` helper matches by suffix** — if multiple fields share a suffix across pages, specify `page_idx` carefully.

Related Skills

tax-form-navigation-verification

5
from vamseeachanta/workspace-hub

Systematic workflow for verifying tax software calculations against entry guide specifications

tax-form-currency-field-handling

5
from vamseeachanta/workspace-hub

Handle currency field rounding and formatting quirks when entering precise decimal values into tax software forms

multi-format-transaction-parser

5
from vamseeachanta/workspace-hub

Parse and consolidate financial transaction data across multiple CSV formats and years

multi-format-csv-parser-with-deduplication

5
from vamseeachanta/workspace-hub

Parse brokerage CSV exports that exist in multiple formats with overlapping data across files

multi-format-csv-detection-and-deduplication

5
from vamseeachanta/workspace-hub

Detect and handle multiple CSV format versions from the same data source; deduplicate records across format variants

freetaxusa-tax-form-navigation-credits

5
from vamseeachanta/workspace-hub

Pattern for navigating FreeTaxUSA's tax form flow, validating auto-calculated credits, and handling form-specific exemptions

freetaxusa-form-entry-recovery

5
from vamseeachanta/workspace-hub

Handle session timeouts and modal dialogs when entering tax forms in FreeTaxUSA

form-1120-preparation-from-expense-sheet

5
from vamseeachanta/workspace-hub

Map cash-basis expense sheet to Form 1120 schedules for C-Corp tax filing, including revenue reconciliation, Schedule L balance sheet reconstruction without prior returns, and gap identification.

form-1120-cash-basis-reconciliation

5
from vamseeachanta/workspace-hub

Reconcile multiple source documents (invoices, expense sheets, bank statements) to establish authoritative cash-basis revenue and expenses for Form 1120 C-Corp filing

form-1120-cash-basis-filing

5
from vamseeachanta/workspace-hub

Complete Form 1120 preparation for C-Corp cash-basis filers — includes TaxAct Business Online interview flow for Schedule L, M-1, M-2

corporate-tax-filing-reconciliation

5
from vamseeachanta/workspace-hub

Reconcile multi-document tax packets and build line-by-line IRS filing guides for first-year C-Corps with real-estate holdings

corporate-tax-filing-reconciliation-and-decision

5
from vamseeachanta/workspace-hub

Reconcile multi-document corporate tax packets, verify line-item accuracy against source data, and structure decision trees for filing timing and extension strategies.