Generates comprehensive Markdown expense reports from invoice data and local receipt files. Activates when the user wants an expense report, spending breakdown, category summary, or asks 'show me my expenses for [period].' Aggregates from Notion Finance DB and local files with 7-section structure, trend analysis, and period-over-period comparisons.
From founder-osnpx claudepluginhub thecloudtips/founder-os --plugin founder-osThis skill uses the workspace's default tool permissions.
references/report-sections.mdDesigns and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Enables AI agents to execute x402 payments with per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents pay for APIs, services, or other agents.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Generate structured Markdown expense reports by aggregating processed invoice data from the consolidated Notion "[FOS] Finance" database (filtered by Type="Invoice") and local receipt/invoice files. Produce a 7-section report covering the requested date range, save to expense-reports/[period]-[YYYY-MM-DD].md, and optionally log to the Notion "Founder OS HQ - Reports" database with Type="Expense Report".
Parse the user-supplied period argument into a concrete start and end date. Apply these rules in priority order:
| Input | Interpretation |
|---|---|
YYYY-MM (e.g., 2024-03) | First day to last day of that month |
Q1 YYYY through Q4 YYYY | Q1 = Jan-Mar, Q2 = Apr-Jun, Q3 = Jul-Sep, Q4 = Oct-Dec |
YYYY-MM to YYYY-MM | First day of start month through last day of end month |
Resolve relative to today's date at invocation time.
| Input | Interpretation |
|---|---|
this month or current month | First day to last day of the current calendar month |
last month | First day to last day of the previous calendar month |
this quarter | First day to last day of the current calendar quarter |
last quarter | First day to last day of the previous calendar quarter |
When no period is specified, default to the current calendar month.
start_date and end_date as ISO 8601 (YYYY-MM-DD) for all downstream operations.Gather expense data from two sources, merge, and deduplicate. Execute the pipeline in this order.
When Notion MCP is available, query the consolidated Finance database:
Type equal to "Invoice" to retrieve only invoice records.Invoice Date within the resolved date range (start_date to end_date).Approval Status equal to "approved" -- exclude rejected, pending, and flagged invoices.When Notion is unavailable, skip this step and proceed with local files only. Never error on missing Notion.
Scan the working directory and common receipt locations for unprocessed expense files:
*.pdf, *.jpg, *.jpeg, *.png, *.tiff, *.csv in the working directory and any receipts/ or invoices/ subdirectory.Combine Notion records and local file entries into a single expense dataset:
Generate each section in order. Omit no section -- use "No data available for this section" when a section has insufficient data rather than removing it.
Report title, date range, generation date, and company placeholder. Format as a centered Markdown header block.
Five key metrics in a scannable block:
Table with one row per category from the P11 14-category taxonomy. Include all 14 categories; categories with zero spend appear with $0.00 and 0.0%. Sort by Amount descending. Columns: Category, Amount, % of Total, Items, Budget Code. Include a totals row at the bottom.
Table listing each unique vendor. Sort by Total descending. Columns: Vendor, Total, Invoices, Top Category. Include only vendors that appear in the current period. Limit to top 20 vendors; if more than 20 exist, add a "Other Vendors (N)" summary row.
Three-row summary table: Fully Deductible, Partially Deductible (50%), Non-Deductible. Columns: Classification, Amount, % of Total, Invoice Count. Include a totals row. After the table, add a note listing the categories that fall under partial deductibility (meals at 50%, travel partial per P11 rules).
Table grouping expenses by Budget Code. Columns: Budget Code, Department, Amount, % of Total. Derive Department from the budget code prefix mapping (OPS = Operations, TECH = Technology, SVC = Services, TRV = Travel, FAC = Facilities, ADM = Administration, MKT = Marketing, HR = Human Resources, GEN = General). Sort by Amount descending.
Compare the current period to the previous period of the same length (e.g., March 2024 vs February 2024; Q1 2024 vs Q4 2023). Present the comparison as described below in the Trend Analysis Methodology section.
Consult ${CLAUDE_PLUGIN_ROOT}/skills/expense/expense-reporting/references/report-sections.md for detailed section templates, example output, table formats, and column calculation formulas.
Compare the current period against the previous period of identical length. When the previous period has no data, note "No prior period data available for comparison" and skip trend calculations.
Calculate percentage change as: ((current - previous) / |previous|) * 100. When the previous period total is zero, report "N/A -- no prior spending" instead of infinity.
Present:
For each of the 14 categories, compute:
Apply these labels based on percentage change per category:
| Change | Label |
|---|---|
| > +50% | Significant spike |
| > +20% | Notable increase |
| -20% to +20% | Stable |
| < -20% | Notable decrease |
| < -50% | Significant drop |
| New category (zero in prior period) | New spending |
| Disappeared category (zero in current period) | Eliminated |
Calculate daily spending rate for each period: total / days_in_period. Compare rates to detect acceleration or deceleration independent of period length differences. Report as "[current_rate]/day vs [previous_rate]/day ([change]%)".
Apply these rules before finalizing the report:
Save the generated report to: expense-reports/[period]-[YYYY-MM-DD].md
Period slug format:
2024-03Q1-20242024-01-to-2024-03Example: expense-reports/2024-03-2024-03-15.md
Create the expense-reports/ directory if it does not exist.
When Notion is available, log the report to the Reports database with Type="Expense Report". Search for a database named "[FOS] Reports"; if not found, fall back to "Founder OS HQ - Reports"; if not found, fall back to the legacy name "Expense Report Builder - Reports". Do not create the database -- it is expected to exist as part of the Founder OS HQ template. Use Report Title + Date Range as the composite key for idempotent upsert -- update the existing record on re-runs rather than creating duplicates.
Properties to log: Report Title, Type (always "Expense Report"), Date Range, Total Amount, Invoice Count, Top Category, Tax Deductible %, Report File Path, Generated At.
Use the 14-category taxonomy defined by P11 Invoice Processor. Do not invent new categories. Map each category to its Budget Code using the P11 mapping:
| Category | Budget Code | Tax Deductible |
|---|---|---|
| office_supplies | OPS-001 | Yes |
| software | TECH-001 | Yes |
| hardware | TECH-002 | Yes |
| professional_services | SVC-001 | Yes |
| travel | TRV-001 | Partial |
| meals | TRV-002 | 50% |
| shipping | OPS-002 | Yes |
| utilities | FAC-001 | Yes |
| rent | FAC-002 | Yes |
| insurance | ADM-001 | Yes |
| marketing | MKT-001 | Yes |
| training | HR-001 | Yes |
| subscriptions | TECH-003 | Yes |
| other | GEN-001 | Varies |
Generate the full 7-section report. Category Breakdown will have one non-zero row. Trend Analysis still compares to the prior period. Vendor Summary will have one row.
Process in batches of 100 for aggregation. Report all data -- do not sample or truncate. The Vendor Summary top-20 limit applies regardless of dataset size.
When a report for the same period already exists in Notion, update the existing record. When the local file exists, overwrite it. Note "Updated report -- replaces prior version" in the cover page.
Only include "approved" invoices from Notion in calculations. Note the count of pending and rejected invoices in the Executive Summary as informational: "N pending and M rejected invoices excluded from this report."