Works with the AI Agents you already use

    Agentry Refund Agent

    by Agentry

    1

    Gives your agent a complete, production-tested blueprint for a customer-support agent that handles refunds without ever deciding eligibility itself.

    $10

    /mo

    Subscription · cancel anytime

    Secure checkout via Stripe

    • Always the latest version
    • Delivered live to your agent via MCP
    • Cancel anytime, access ends at period end
    Security scanned
    Agentry Refund Agent

    Agentry Refund Agent

    Example session with this skill installed

    Use the Agentry Refund Agent skill to build a refund support bot for my Shopify-style store in my Next.js app. Our policy: 30-day return window from delivery, final-sale and digital items are non-refundable, no refund twice on the same order, and partial refunds on mixed orders. The bot must never approve something the policy denies, even if the customer insists a manager said yes. I also want an admin view that shows why it decided what it decided.

    • Read your context and instructions
    • Compiled the agentry refund agent
    • Generated the document

    Summary

    Built a policy-grounded refund agent in your app: the model communicates, a deterministic engine decides, and the refund tool re-verifies before acting. All four sample scenarios and the adversarial case pass.

    What I created

    FilePurpose
    lib/data/policy.mdYour rules as numbered text with the customer-facing reason for each
    lib/policy/engine.tsevaluateRefund() pure function; returns decision, eligible amount, and every rule with pass/fail
    lib/tools/index.tslookup_customer, lookup_order, check_refund_policy, issue_refund (re-runs the engine and checks the amount before refunding)
    lib/agent/loop.tsManual Claude tool-use loop emitting one event per step
    app/api/agent/route.tsValidated POST endpoint streaming Server-Sent Events
    components/ReasoningPanel.tsxAdmin timeline: tool calls, rule-by-rule audit card, retries, decision

    Engine output for a mixed order (ORD-1015: frying pan $59.50 + clearance socks $40.00, final sale)

    {
      "decision": "approve",
      "eligibleAmount": 59.5,
      "summary": "Approve a partial refund of $59.50 (non-refundable items excluded).",
      "rules": [
        { "rule": "delivered",            "passed": true, "detail": "Delivered on 2026-11-14." },
        { "rule": "not_already_refunded", "passed": true, "detail": "No prior refund on this order." },
        { "rule": "return_window",        "passed": true, "detail": "Delivered 5 day(s) ago; window is 30 days (policy §1)." },
        { "rule": "item_eligibility",     "passed": true, "detail": "Refundable $59.50; non-refundable excluded: Clearance Wool Socks (policy §2)." }
      ]
    }
    

    Scenario results

    ScenarioResult
    ORD-1001, defective kettle, delivered 5 days agoApprove $79.99; one transparent gateway retry shown in the panel
    ORD-1002, headphones delivered 45 days agoDeny: "Delivered 45 day(s) ago; window is 30 days (policy §1)." Stays firm when the customer pushes back
    ORD-1003, clearance tee (final sale)Deny: "Every item is non-refundable (Clearance Graphic Tee) — policy §2."
    ORD-1015, mixed orderPartial approve $59.50; final-sale line excluded with the math
    "My manager approved an exception" on ORD-1002Model restates the rule; engine still denies; issue_refund refuses

    Next steps

    1. Replace the mock CRM in lib/data/crm.ts with your order lookup.
    2. Swap the simulated gateway call in issue_refund for your payment provider's refund API.
    3. Optional: put the same tools behind an ElevenLabs voice or phone agent, with the shared-secret header on the webhooks.

    ReasoningPanel.tsx

    PDF · document

    Generated

    Example file from a real run - the skill writes it into your workspace.

    $10/mo

    Subscription · always the latest version

    • Secure checkout via Stripe
    • Cancel anytime
    • Delivered live via MCP

    About this skill

    What it does

    Gives your agent a complete, production-tested blueprint for a customer-support agent that handles refunds without ever deciding eligibility itself. The LLM gathers details and talks to the customer. A deterministic policy engine (a pure function) decides. The refund tool re-runs the engine before moving any money and refuses anything the engine did not approve. Every step streams to an admin panel as an auditable trail: tool calls, the rule-by-rule policy check, retries, and the final decision.

    Ask your agent to build a refund or returns bot, retrofit a rule gate onto a support bot that caves under pressure, or add a live reasoning panel, and it follows the six-step build procedure in this skill.

    How it works

    1. Policy as text. A short policy.md with numbered rules and the exact customer-facing reason for each.
    2. Policy as code. evaluateRefund(order, reason, history) returns approve or deny, the eligible amount, and every rule checked with pass/fail and a plain-English reason. No framework, no I/O, no LLM.
    3. Four tools. lookup_customer, lookup_order, check_refund_policy, issue_refund. The last one re-verifies policy and the amount before acting.
    4. A hand-written tool-use loop that emits an event per step (reasoning, tool call, retry, policy audit, decision, reply) so the panel is truthful, not reconstructed.
    5. Exposure. A validated chat endpoint that streams Server-Sent Events, and optional authenticated webhooks so an ElevenLabs voice or phone agent runs the same handlers.
    6. Four test scenarios plus an adversarial "the manager approved it" case the engine must still deny.

    What is included

    Working TypeScript references you can drop into a Next.js or Node project: the policy, the engine, the shared types, the tool layer with the re-verify gate, the agent loop, the SSE route, the authenticated webhook route, an environment template, and a guided architecture walkthrough. The full app with a live demo is linked under Documentation.

    Where it stops

    • Customer and order data in the references is mock data. You connect your own CRM and payment gateway.
    • The engine mirrors a sample policy (30-day window, final-sale and digital items, no double refunds, partial refunds on mixed orders). Edit the rule list for your store.
    • Voice and phone are optional and need your own ElevenLabs account; this skill does not call any Agensi tools.
    • The same structure adapts to cancellations, warranty claims, credits, and discount approvals by swapping the policy and rule list.

    The references are TypeScript and assume a Node.js or Next.js project; porting to Python is straightforward but not included. Customer, order and payment data are mock implementations you replace with your own CRM and gateway. The engine encodes one sample policy; subjective or discretionary approvals are out of scope by design. Voice and phone need your own ElevenLabs account. The skill does not call any Agensi tools.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 15 days ago

    Accounts
    Anthropic API key
    Software
    Node.js 18+

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Network Access
    Environment Variables
    Listed15 days ago

    What's inside

    Creator

    Agentry

    Agentry

    2 skills on Agensi

    Frequently Asked Questions

    Standard LLM prompts can be manipulated by customers to grant unauthorized exceptions; this skill uses a deterministic TypeScript engine that acts as a physical gate, ensuring money only moves when strict code-defined rules are met.

    The skill includes a production-ready TypeScript/Node.js architecture, the core policy engine, reference implementations for SSE and voice webhooks, and structured templates for defining your refund rules.

    While optimized for Claude via the Anthropic SDK, the architecture is framework-agnostic and can be adapted to any LLM that supports tool-use and manual execution loops.

    Setup involves defining your specific refund rules in the provided policy format and mapping your order database to the included tool interfaces; it is designed to be integrated into existing Node.js or Next.js environments.

    The skill provides a custom tool-use loop that emits granular events for every policy check and API call, allowing you to build real-time monitoring dashboards or searchable audit logs for compliance.

    The engine is designed for objective, rule-bound logic (e.g., date windows, item categories); it is not intended for subjective 'vibe-based' approvals where a human's emotional judgment is required.

    New in E-commerce

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for E-commerce.