Jeepittea

Refund Agent — AI skill for Claude Code

AI community

AI customer-support agent that handles refund emails using Claude Opus 5.5 and tool calling.

How to install Refund Agent

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

What Refund Agent does

AI customer-support agent that handles refund emails using Claude Opus 5.5 and tool calling. Refund rules are enforced in Python, not by the AI: a strict 30-day policy check, no double refunds, and all-or-nothing database saves with an audit log. Built with SQLAlchemy, Pydantic and Pytest.

Alternatives in AI

  • Anthropic Quickstarts — by Anthropic - Offers comprehensive development guides for three distinct AI-powered demo projects with standa 15.4k ★
  • Flow Define — Multi-AI requirements scoping using Codex and Gemini CLIs (Double Diamond Define phase) 2.8k ★
  • PRD Taskmaster V2 — Zero-config goal-to-tasks engine 187 ★

README

Refund Agent

Autonomous customer-support refund agent built on Claude Opus 5.5 (`claude-opus-5-5`).

src/agent/      email parsing, agent loop, CLI
src/database/   SQLAlchemy models (orders, audit_log), engine, seed data
src/tools/      Pydantic tool schemas, typed tool registry, business-logic tools
tests/          pytest suite (offline, scripted fake Claude) + opt-in live tests

Setup

uv venv -p 3.12 .venv
uv pip install --python .venv -e ".[dev]"
.venv/Scripts/python -m src.agent.cli init-db          # creates + seeds refunds.db
.venv/Scripts/python -m pytest                          # offline suite

Process an email (needs `ANTHROPIC_API_KEY` or an `ant auth login` profile):

.venv/Scripts/python -m src.agent.cli handle samples/refund_request.eml
RUN_LIVE_TESTS=1 .venv/Scripts/python -m pytest -m live   # real-API smoke tests

Who decides what

Concern Owner
Which tools to call, wording of the reply LLM
Sender identity Python: parsed From: header, bound into ToolContext; not a tool parameter
30-day eligibility Python datetime in issue_refund (elapsed <= 30 days, tz-aware UTC)
Final Decision Python, derived from validated tool outputs; never from the model's text

Guarantees in `issue_refund`

  • One transaction. BEGIN IMMEDIATE (SQLite) takes the write lock before the checks read the order. The idempotency check, policy check, status update and audit insert commit together or not at all.
  • Idempotent. It checks status first, then does a compare-and-set UPDATE ... WHERE refund_status='none'. Duplicate emails, duplicate parallel tool calls and concurrent threads produce exactly one refund_issued row (tested with 8 racing threads).
  • Rejections are audited too. Rejections are written to the audit log with the model's reasoning. Orders owned by another customer return order_not_found, so the tool can't be used to check whether an order exists