home / skills / phrazzld / claude-config / crypto-gains
This skill calculates capital gains with FIFO, wash-sale detection, term classification, and Form 8949 outputs for IRS compliance.
npx playbooks add skill phrazzld/claude-config --skill crypto-gainsReview the files below or copy the command above to add this skill to your agents.
---
name: crypto-gains
description: |
Calculate capital gains with FIFO, wash sale detection, term classification, and Form 8949 outputs.
user-invocable: true
effort: high
---
# /crypto-gains
Calculate capital gains with IRS-compliant rules.
## Steps
1. Load lots from `normalized/cost-basis.json` and transactions from `normalized/transactions.json`.
2. Build sell list and allocate FIFO lots per asset.
3. Classify each gain as short-term or long-term by holding period.
4. Detect wash sales within 30 days for securities. Mark crypto as not applicable per current policy.
5. Write gains to `normalized/capital-gains.json` and updated lots to `normalized/cost-basis-updated.json`.
6. Generate Form 8949 outputs and summaries.
## Examples
```bash
# Build FIFO gains and updated lots
pnpm gains
```
```bash
# Generate Form 8949 and tax summaries
pnpm report
```
## References
- `normalized/transactions.json`
- `normalized/cost-basis.json`
- `normalized/capital-gains.json`
- `normalized/cost-basis-updated.json`
- `reports/tax-ready/form-8949-c.csv`
- `reports/tax-ready/turbotax-import.csv`
- `reports/tax-ready/schedule-d-summary.md`
- `scripts/calculate-gains.ts`
- `scripts/generate-report.ts`
This skill calculates IRS-compliant capital gains for cryptocurrency and other assets using FIFO lot allocation, holding-period classification, and wash sale detection rules. It produces machine-readable outputs and tax-ready CSVs for Form 8949 and Schedule D summaries. The workflow updates cost-basis lots and creates a detailed capital gains ledger for downstream reporting.
The tool ingests normalized cost-basis lots and transaction history, then builds a sell list and allocates fills to lots using first-in, first-out rules. Each disposition is classified as short-term or long-term by computing the holding period, and wash sales are detected within the 30-day window for securities (crypto currently marked as not applicable). Results are written to updated cost-basis and capital gains files and exported as Form 8949 and other tax-ready reports.
Does the skill apply wash sale rules to crypto?
By current policy it marks wash sale detection as not applicable to crypto; wash sale detection is performed for securities within the 30-day window.
What outputs are produced for tax filing?
It writes updated cost-basis and capital gains JSON files and generates Form 8949 CSVs, Turbotax-import CSV, and a Schedule D summary.
Which allocation method is used?
FIFO (first-in, first-out) allocation is used to match sells to prior lots.