Automation

Shop email reply drafter for returns and shipping

Python bot that reads customer emails, sorts returns and shipping questions, and saves draft replies for human review without sending anything.

pythonanthropicpytest

Built 1 time, downloaded 0 times.

Install from your terminal

Run this in your project folder. It signs you in, shows what changes and asks before it overwrites a file.

npx claude-lab add shop-email-reply-drafter-for-returns-and-shipping-43f85d
CLAUDE.md
# Shop reply drafter

## Purpose

- This project reads customer emails from `inbox/` and writes draft replies to `drafts/` for a human to approve.
- The bot never sends email.
- Replies cover returns and shipping questions. Anything unclear goes to `needs_human/`.

## Stack

- Python 3.12, with a virtual environment in `.venv`.
- Packages: `anthropic` SDK and `pytest`.
- This stack was chosen as a default because the owner did not name one. If the owner changes it, update this section.

## Commands

- Create the environment: `python -m venv .venv`
- Activate it (Mac or Linux): `source .venv/bin/activate`
- Install packages: `pip install -r requirements.txt`
- Run tests: `python -m pytest -q`
- Dry run with sample emails (no network): `python -m drafter.run --sample --dry-run`
- Real run (needs an API key): `python -m drafter.run --inbox inbox/`

## Hard rules

- Never add code that sends email, issues refunds, or changes orders.
- Never commit real customer emails, `.env`, `inbox/`, `drafts/` or `needs_human/`.
- Never hardcode an API key. Read it from the `ANTHROPIC_API_KEY` environment variable.
- Fixtures and test data must be invented.

## Policy and reply rules

- Policy text lives in `policies/returns.md` and `policies/shipping.md`.
- A reply may only state facts found in those files.
- If unsure, set the category to `needs_human`.
- Reply style: friendly, under 150 words.
- Do not promise refunds or dates unless the policy file states them.
- Each draft should name the policy section it used.

## Workflow

- Work on one phase from `PLAN.md` at a time.
- Run `/clear` before each phase.
- Use plan mode for the design of Phase 2 and Phase 3.
- Run the `verify` skill before saying a phase is done.
- Give the owner a plain-language summary of each step, because the owner is new to programming.

## Review

- Before accepting any change, check it against the list in `REVIEW.md`.

@REVIEW.md

## Glossary

- `inbox/`: raw sample or real emails.
- `drafts/`: draft replies written by the bot.
- `needs_human/`: queue for emails a person must handle.
Use for my project