# Cost Tracker Skill

Track token usage and costs per product/phase automatically.

## When to Use

After completing ANY significant work on a product, log the cost.

## Cost Estimation Guide

| Task | Estimated Tokens | Estimated Cost |
|------|-----------------|----------------|
| Brief generation | 20,000 | $0.60 |
| Competitor research | 30,000 | $0.90 |
| Target market analysis | 30,000 | $0.90 |
| PRD generation | 40,000 | $1.20 |
| User stories | 50,000 | $1.50 |
| Full Discovery pipeline | 170,000 | $5.00 |
| Design preview (colors, logo, fonts) | 30,000 | $0.90 |
| Screen generation (per screen) | 10,000 | $0.30 |
| Image generation (nano-banana) | - | $0.10/image |
| Full Design pipeline | 100,000 | $3.00 + images |
| Build plan generation | 50,000 | $1.50 |
| Code implementation (varies) | 200,000-500,000 | $6-15 |
| Bug fix (small) | 10,000 | $0.30 |
| Bug fix (complex) | 30,000 | $0.90 |
| Feature addition | 50,000 | $1.50 |

## Token Cost Rates (Claude Opus 4)

- Input: $15 / 1M tokens
- Output: $75 / 1M tokens  
- Blended estimate: ~$30 / 1M tokens (assumes 3:1 output:input ratio)

## How to Log Costs

After completing work, make an API call:

```bash
curl -X POST "https://agency.symph.co/api/products/{slug}/costs" \
  -H "Content-Type: application/json" \
  -d '{
    "phase": "discovery",
    "action": "Generated PRD and user stories",
    "tokens_estimated": 90000,
    "cost_usd": 2.70,
    "model": "claude-opus-4"
  }'
```

Or using fetch in your workflow:

```javascript
await fetch(`/api/products/${slug}/costs`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    phase: "build",
    action: "Implemented authentication",
    tokens_estimated: 100000,
    cost_usd: 3.00,
    model: "claude-opus-4"
  })
});
```

## Auto-Tracking Reminder

**After completing pipeline work, always log the cost!**

Phases to track:
- `discovery` - Research, PRD, user stories
- `design` - Brand guidelines, screens, images
- `build` - Code implementation, bug fixes
- `market` - Landing pages, ad copy
- `sell` - Lead generation, outreach

## Viewing Costs

Costs display on each product's overview page in the Symph Agency UI.
Users can expand to see per-phase breakdown.
