About profit-loss
profit-loss is a skill for preparing cash-basis income statements from transaction data. It organizes revenue, COGS, and operating expenses, then calculates gross and net margins.
Key features
- 01Period-based revenue and expense totals
- 02COGS and operating expense classification
- 03Gross profit and margin calculations
- 04Net income and margin calculations
Use cases
- 01Prepare a monthly or quarterly P&L
- 02Review cash-basis business results
- 03Compare margins across reporting periods
MCP support
The skill uses Wilson's `transaction_search` and `spending_summary` tools to gather income and expense data.
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ openaccountant/ skills --skill profit-lossAfter installing, type/profit-lossin Claude Code to confirm it loaded.
Details
From the project READMEProfit & 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 periodspending_summary— aggregate expenses by category to populate operating expense line items
Workflow
- Ask for the reporting period (e.g., "Q1 2026" or "January 2026").
- Use
transaction_searchwithamount > 0to find all revenue transactions in the period. - Use
transaction_searchwithamount < 0to find all expense transactions. - Use
spending_summaryfor the same period to get category-level expense totals. - Separate COGS categories (materials, supplies, direct labor) from operating expenses (rent, utilities, software, payroll, insurance).
- 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%
═══════════════════════════════════════
- Calculate Gross Margin = (Gross Profit / Total Revenue) * 100.
- Calculate Net Margin = (Net Income / Total Revenue) * 100.
Without Wilson
- Export transactions from your bank as CSV (Chase: Accounts > Activity > Download, select CSV; Amex: Statements & Activity > Download Your Transactions).
- Open in Excel or Google Sheets.
- Add a "Type" column. Mark each row as Revenue, COGS, or Operating Expense.
- Use
=SUMIFS(Amount, Type, "Revenue")for total revenue. - Use
=SUMIFS(Amount, Type, "COGS")for total COGS (use absolute values). - Gross Profit = Revenue - COGS. Gross Margin formula:
=GrossProfit/Revenue*100. - Use
=SUMIFS(Amount, Type, "Operating Expense")for total OpEx. - Net Income = Gross Profit - Operating Expenses. Net Margin:
=NetIncome/Revenue*100. - 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.
Comments
Markdown supported