vnathan3

Trade Deduction Agent — AI skill for Claude Code

AI community

LLM agent that resolves retail trade deductions: matches claims to promotions, calculates what's owed, and classifies each as valid, partial, or invalid, benchmarked against a rules-based baseline on.

How to install Trade Deduction Agent

This entry records only its repository, not the path inside it, so there is no exact command to give. Open vnathan3/trade-deduction-agent and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Trade Deduction Agent does

LLM agent that resolves retail trade deductions: matches claims to promotions, calculates what's owed, and classifies each as valid, partial, or invalid, benchmarked against a rules-based baseline on synthetic labeled data. Python, Claude API, FastAPI, SQLAlchemy.

Alternatives in AI

  • Ppt Agent Skill — 🎨 World-class AI presentation generator · 26 styles · 18 charts · benchmarked against Linear/Anthropic/Stripe 139 ★
  • Samp Source — Rebuilding SA-MP 0.3.7 R5 from source, byte for byte 43 ★
  • Moyu — claude skill install --url https://github.com/uucz/moyu --skill moyu Anti-over-engineering skill that teaches 34 ★

README

Trade Deduction Resolution Agent

An LLM agent that resolves retail trade deductions. It reads a messy deduction claim, matches it to the right promotion or contract, calculates what is actually owed, and classifies the claim as **valid**, **partial**, or **invalid** with reasoning. Low-confidence decisions go to a human review queue. The agent's accuracy is always measured against a rules-based baseline.

All data is synthetic. See [CLAUDE.md](CLAUDE.md) for the full spec, data model, and resolution rules.

Status

Phase 1 (synthetic data generator) is complete. Phase 2 (extraction) is next.

uv run generate --seed 42 --n-deductions 500

This builds the whole dataset into SQLite (`data/deductions.db`) in a couple of seconds and writes a summary to [`reports/data_summary.md`](reports/data_summary.md): 10 retailers, 100 products, 150 promotions, a year of invoices, deliveries, payments and weekly sales, and 500 deductions labeled 70% valid / 15% partial / 15% invalid across 8 planted error types. The same seed always produces the same database.

How it works:

  • World (`generator/world.py`): customers with payment terms, product assortments, non-overlapping promotions, biweekly invoices (with forward-buying on off-invoice deals and some lines billed above list price), deliveries with shortages and damage, payment dates, and weekly sales with promotional lift.
  • Deductions (`generator/deductions.py`): every claim the retailer could legitimately take is listed with what is owed, then one injector per error type turns some into overclaims, wrong rates, window errors, unmatched promos, duplicates, late early-pay discounts, and damage, shortage or pricing claims with no supporting record. Each claim is short-paid on a real invoice, and payments net out the deductions.
  • Amounts (`amounts.py`): the resolution math from the spec, shared by t