Skip to main content
skill CX Codex

profit-loss — Claude Code skill: build a P&L for any period

This skill builds a standard income statement for any date range: revenue, COGS, gross profit, operating expenses, net income and margins.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add openaccountant/skills --skill profit-loss -a claude-code
Open on GitHub

What profit-loss does

The skill produces a standard profit and loss statement from your transactions. It pulls income (positive amounts) and expenses (negative amounts), aggregates spending by category, then splits those categories into cost of goods sold and operating expenses. The output is a formatted statement with revenue, gross profit, operating expenses and net income, plus gross and net margin percentages.

It runs on two Wilson tools: transaction_search to find revenue and expense transactions in the period, and spending_summary for category-level totals. First it asks for the reporting period — something like "Q1 2026" or "January 2026" — then classifies categories: materials, supplies and direct labor go to COGS, while rent, utilities, software, payroll and insurance land in operating expenses. That split depends on your business type. A freelancer may have zero COGS; a product business should keep materials and shipping separate from overhead.

This is a cash-basis P&L keyed to transaction dates, not accrual. Invoice on Net-30 terms and revenue shows up when you get paid, not when you bill. Without Wilson there is a manual route: export transactions from your bank as CSV, tag a Type column with Revenue, COGS or Operating Expense, and total each with =SUMIFS(Amount, Type, "Revenue").

What it helps with

  • total revenue and expenses for a quarter from bank transactions
  • separate COGS from operating expenses by category
  • get gross and net margin percentages
  • build a P&L in Excel without access to Wilson
  • break the statement out by month with pivot tables

Example prompts for the agent

  • Build a P&L for Q1 2026
  • Generate a profit and loss statement for January 2026
  • Calculate gross and net margin for last month

How to install profit-loss

1Skills CLI (Vercel)

npx skills add openaccountant/skills --skill profit-loss -a claude-code

2Manually: put the files in place

~/.claude/skills/profit-loss/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/profit-loss/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about profit-loss

How do I install profit-loss in Claude?

Run npx skills add openaccountant/skills --skill profit-loss -a claude-code. The skill lands at ~/.claude/skills/profit-loss/SKILL.md.

What does profit-loss do?

It builds a profit and loss statement for a given period: revenue, COGS, gross profit, operating expenses and net income. It also calculates gross and net margin percentages.

How is this different from an accrual-based P&L?

It is cash-basis, keyed to transaction dates. With Net-30 invoicing, revenue appears when paid rather than when invoiced.

Source text

SKILL.md · MIT
---
name: profit-loss
description: >
  Generate a profit and loss statement for any date range.
---

# Profit & Loss Statement

## Overview
Build a standard income statement (P&L) showing revenue, cost of goods sold, gross profit, operating expenses, and net income. Calculates gross margin and net margin percentages.

## Wilson Tools Used
- `transaction_search` — pull all income transactions (positive amounts) and expense transactions (negative amounts) for the target period
- `spending_summary` — aggregate expenses by category to populate operating expense line items

## Workflow
1. Ask for the reporting period (e.g., "Q1 2026" or "January 2026").
2. Use `transaction_search` with `amount > 0` to find all revenue transactions in the period.
3. Use `transaction_search` with `amount < 0` to find all expense transactions.
4. Use `spending_summary` for the same period to get category-level expense totals.
5. Separate COGS categories (materials, supplies, direct labor) from operating expenses (rent, utilities, software, payroll, insurance).
6. Build the P&L using this format:

```
PROFIT & LOSS STATEMENT — [Period]
═══════════════════════════════════════
Revenue
  Sales Revenue                  $XX,XXX
  Service Revenue                $XX,XXX
───────────────────────────────────────
  Total Revenue                  $XX,XXX

Cost of Goods Sold
  Materials                      ($X,XXX)
  Direct Labor                   ($X,XXX)
───────────────────────────────────────
  Total COGS                     ($X,XXX)

GROSS PROFIT                     $XX,XXX
  Gross Margin                      XX.X%

Operating Expenses
  Rent                           ($X,XXX)
  Utilities                        ($XXX)
  Software & Subscriptions         ($XXX)
  Payroll                        ($X,XXX)
  Insurance                        ($XXX)
  Other                            ($XXX)
───────────────────────────────────────
  Total Operating Expenses       ($X,XXX)

NET INCOME                        $X,XXX
  Net Margin                        XX.X%
═══════════════════════════════════════
```

7. Calculate Gross Margin = (Gross Profit / Total Revenue) * 100.
8. Calculate Net Margin = (Net Income / Total Revenue) * 100.

## Without Wilson
1. Export transactions from your bank as CSV (Chase: Accounts > Activity > Download, select CSV; Amex: Statements & Activity > Download Your Transactions).
2. Open in Excel or Google Sheets.
3. Add a "Type" column. Mark each row as Revenue, COGS, or Operating Expense.
4. Use `=SUMIFS(Amount, Type, "Revenue")` for total revenue.
5. Use `=SUMIFS(Amount, Type, "COGS")` for total COGS (use absolute values).
6. Gross Profit = Revenue - COGS. Gross Margin formula: `=GrossProfit/Revenue*100`.
7. Use `=SUMIFS(Amount, Type, "Operating Expense")` for total OpEx.
8. Net Income = Gross Profit - Operating Expenses. Net Margin: `=NetIncome/Revenue*100`.
9. For multi-month P&L, add a `=TEXT(Date,"YYYY-MM")` column and use pivot tables to break out by month.

## Important Notes
- Wilson uses negative amounts for expenses and positive for income. The P&L should display expenses as positive numbers in parentheses.
- COGS vs. operating expense classification depends on your business type. A freelancer may have zero COGS. A product business should separate materials and shipping from overhead.
- This is a cash-basis P&L (based on transaction dates), not accrual. If you invoice Net-30, revenue appears when paid, not when invoiced.

© openaccountant · MIT · openaccountant/skills

Similar skills

Everything for Finance and business →

From the same set28

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor