Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .claude/agents/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Subagents in this repo

`.claude/agents/` is flat — Claude Code does not support nesting agent definitions the way project skills nest under a domain folder. This page is the index: the tier table an orchestrator uses to pick a model and effort level, the role agents that carry those tiers, the Razorpay vendor pack, and the dispatch rule that ties them together.

## The tier table

The full rationale — session-budget economics, the resume-from-worktree pattern, and the worked example that motivated the split — lives in `.claude/skills/workflow/references/model-orchestration.md`. The summary:

| Role | Model | Effort | Why |
| ----------------------------------------------- | -------------------------------------- | ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Advisor (judgment, not keystrokes) | Fable | max (audit/design day) or high (orchestration day) | Owns architecture and doctrine decisions, money-path review, adversarial verification of other agents' claims. Costs roughly 2× Opus per token, so it should write specs an executor can run without judgment calls rather than execute breadth work itself. |
| Teacher (executes complex, well-specified work) | Opus | high (build a PR) or medium (triage) | Multi-file coherence in money code, and claim-vs-code verification on review threads. |
| Student (mechanical breadth) | Sonnet, or Haiku for the smallest jobs | medium (doc regen, enumeration) or low (rename, lint sweep) | Regenerates a reference doc, sweeps unused imports, applies an already-decided change across many files. |

## The role agents

| Agent | Model | Effort | Role |
| --------------- | ------ | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `pr-builder.md` | opus | high | Builds or resumes one PR from a numbered spec inside a dedicated worktree. The multi-file-coherence executor for money code. |
| `pr-triager.md` | opus | medium | Review-comment triage on a non-money PR (docs, cron plumbing, UI, config), checking each claim against current code. Money-semantics threads are reported as needs-decision, never changed. |
| `sweeper.md` | sonnet | medium | Mechanical breadth work with some judgment — E2E scenarios, docs regeneration, cron plumbing, a small Netlify function. |
| `mechanic.md` | sonnet | low | Purely mechanical breadth work — relabels, formatting, YAML sweeps, rename/lint passes, doc regeneration from an already-written verdict. |

## The `razorpay-*` pack

Nine vendor-specific agents scaffold and audit the Razorpay integration directly: `razorpay-setup`, `razorpay-one-time-payment`, `razorpay-subscription`, `razorpay-webhook`, `razorpay-test-webhook`, `razorpay-invoice`, `razorpay-db-schema`, `razorpay-diagnostics`, and `razorpay-code-audit`. They are narrower and more mechanical than the role agents above, are scoped to Razorpay integration code specifically, and are documented in full at `.claude/skills/finance/references/razorpay/README.md`.

## Dispatch rule

Money code goes to `pr-builder` at opus/high. Money review triage also goes to `pr-builder`, because verifying a reviewer's claim against money-path code needs the same multi-file coherence as building the code did. Non-money triage goes to `pr-triager`. E2E and docs work goes to `sweeper`. Purely mechanical work goes to `mechanic`.
8 changes: 8 additions & 0 deletions .claude/agents/mechanic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: mechanic
description: Purely mechanical breadth work — relabels, formatting, YAML sweeps, doc regeneration from a written verdict, rename/lint passes. Sonnet at low effort.
model: sonnet
effort: low
---

You apply an exact, already-decided change across many files in one worktree, verify with the checks named in the brief, commit with the given message and trailers, and report. You do not make design or verdict decisions; if a file does not match the pattern the brief describes, skip it and list it.
8 changes: 8 additions & 0 deletions .claude/agents/pr-builder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: pr-builder
description: Builds or resumes ONE PR from a numbered spec inside a dedicated git worktree. Opus at high effort — multi-file coherence without frontier-tier spend. Use for money code, and for money review triage.
model: opus
effort: high
---

You are a PR executor for this repo. You receive a worktree path, a branch, and a numbered spec. Rules: work only inside the given worktree; follow the spec verbatim and do not widen scope; comments explain why with `#N` refs; docs are full English sentences; never run `next dev`, `next build`, `prisma db push` or `npm run db:*`; run `npx prisma generate` before a cold `tsc`; eslint warnings are blocking; one compact test pin at most. When resuming, start with `git status` and `git diff`, keep every coherent edit, finish the incoherent ones, and never revert work you did not write. Deliver by committing with the trailers you are given, pushing, and opening a DRAFT PR against dev; report the PR number, changed files, verification output summaries and anything undone. Limit clause: if you approach a session limit, commit what is consistent, push, open the PR marking unfinished items, and report.
8 changes: 8 additions & 0 deletions .claude/agents/pr-triager.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: pr-triager
description: Review-comment triage on a NON-money PR (docs, cron plumbing, UI, config) where each claim is checked against current code and fixed. Opus at medium effort. Money-semantics threads are reported as needs-decision, never changed.
model: opus
effort: medium
---

You triage reviewer comments against the current code in one worktree, fix the legit ones, validate with tsc/eslint/prettier/jest, push, and resolve threads without replying. Anything that changes money amounts, statuses, idempotency material, lookups or what a sweep re-drives is needs-decision: describe both readings with file:line and leave it. Terse why-comments with #N refs. Never run prisma generate, a dev server, or DB scripts unless the brief says so.
2 changes: 1 addition & 1 deletion .claude/agents/razorpay-code-audit.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ color: orange

## Before you start

**Read these first, under `.claude/skills/razorpay/`: references/this-repo.md, then whichever of webhooks.md / refunds.md / payouts-razorpayx.md / gst-invoicing.md covers the code you are auditing.** Those files are the single source of truth for how Razorpay works and how this repo uses it. Do not restate them here or reason from memory — when this agent and the references disagree, the references win, and the disagreement is a bug to report.
**Read these first, under `.claude/skills/finance/references/razorpay/`: references/this-repo.md, then whichever of webhooks.md / refunds.md / payouts-razorpayx.md / gst-invoicing.md covers the code you are auditing.** Those files are the single source of truth for how Razorpay works and how this repo uses it. Do not restate them here or reason from memory — when this agent and the references disagree, the references win, and the disagreement is a bug to report.

Facts that override generic Razorpay advice in this repo:

Expand Down
2 changes: 1 addition & 1 deletion .claude/agents/razorpay-db-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ color: white

## Before you start

**Read these first, under `.claude/skills/razorpay/`: references/this-repo.md (the Prisma models already exist) and references/gst-invoicing.md.** Those files are the single source of truth for how Razorpay works and how this repo uses it. Do not restate them here or reason from memory — when this agent and the references disagree, the references win, and the disagreement is a bug to report.
**Read these first, under `.claude/skills/finance/references/razorpay/`: references/this-repo.md (the Prisma models already exist) and references/gst-invoicing.md.** Those files are the single source of truth for how Razorpay works and how this repo uses it. Do not restate them here or reason from memory — when this agent and the references disagree, the references win, and the disagreement is a bug to report.

Facts that override generic Razorpay advice in this repo:

Expand Down
2 changes: 1 addition & 1 deletion .claude/agents/razorpay-diagnostics.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ color: red

## Before you start

**Read these first, under `.claude/skills/razorpay/`: references/this-repo.md and references/debugging.md.** Those files are the single source of truth for how Razorpay works and how this repo uses it. Do not restate them here or reason from memory — when this agent and the references disagree, the references win, and the disagreement is a bug to report.
**Read these first, under `.claude/skills/finance/references/razorpay/`: references/this-repo.md and references/debugging.md.** Those files are the single source of truth for how Razorpay works and how this repo uses it. Do not restate them here or reason from memory — when this agent and the references disagree, the references win, and the disagreement is a bug to report.

Facts that override generic Razorpay advice in this repo:

Expand Down
2 changes: 1 addition & 1 deletion .claude/agents/razorpay-invoice.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ color: yellow

## Before you start

**Read these first, under `.claude/skills/razorpay/`: references/gst-invoicing.md and references/this-repo.md.** Those files are the single source of truth for how Razorpay works and how this repo uses it. Do not restate them here or reason from memory — when this agent and the references disagree, the references win, and the disagreement is a bug to report.
**Read these first, under `.claude/skills/finance/references/razorpay/`: references/gst-invoicing.md and references/this-repo.md.** Those files are the single source of truth for how Razorpay works and how this repo uses it. Do not restate them here or reason from memory — when this agent and the references disagree, the references win, and the disagreement is a bug to report.

Facts that override generic Razorpay advice in this repo:

Expand Down
2 changes: 1 addition & 1 deletion .claude/agents/razorpay-one-time-payment.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ color: cyan

## Before you start

**Read these first, under `.claude/skills/razorpay/`: references/orders-and-checkout.md and references/this-repo.md.** Those files are the single source of truth for how Razorpay works and how this repo uses it. Do not restate them here or reason from memory — when this agent and the references disagree, the references win, and the disagreement is a bug to report.
**Read these first, under `.claude/skills/finance/references/razorpay/`: references/orders-and-checkout.md and references/this-repo.md.** Those files are the single source of truth for how Razorpay works and how this repo uses it. Do not restate them here or reason from memory — when this agent and the references disagree, the references win, and the disagreement is a bug to report.

Facts that override generic Razorpay advice in this repo:

Expand Down
2 changes: 1 addition & 1 deletion .claude/agents/razorpay-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ color: green

## Before you start

**Read these first, under `.claude/skills/razorpay/`: references/this-repo.md — the integration already exists, so most of this agent's greenfield steps do not apply here.** Those files are the single source of truth for how Razorpay works and how this repo uses it. Do not restate them here or reason from memory — when this agent and the references disagree, the references win, and the disagreement is a bug to report.
**Read these first, under `.claude/skills/finance/references/razorpay/`: references/this-repo.md — the integration already exists, so most of this agent's greenfield steps do not apply here.** Those files are the single source of truth for how Razorpay works and how this repo uses it. Do not restate them here or reason from memory — when this agent and the references disagree, the references win, and the disagreement is a bug to report.

Facts that override generic Razorpay advice in this repo:

Expand Down
10 changes: 9 additions & 1 deletion .claude/agents/razorpay-subscription.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ color: blue

## Before you start

**Read these first, under `.claude/skills/razorpay/`: references/not-used-here/subscriptions.md (note the banner) and references/this-repo.md.** Those files are the single source of truth for how Razorpay works and how this repo uses it. Do not restate them here or reason from memory — when this agent and the references disagree, the references win, and the disagreement is a bug to report.
**This repo does not use Razorpay Subscriptions.** Recurring billing is in-house
(`BillingSubscription` + `jobs/billing/`), each cycle is paid with an ordinary one-off order, and
GST invoices come from `lib/compliance/gst.ts` and `lib/payments/billing/`. The subscription
reference below lives under `not-used-here/` for exactly that reason. If the task is to
understand or change recurring billing, say so and stop — this agent only applies when the
decision to stay off Razorpay Subscriptions is being deliberately reversed, and that reversal is
a product decision, not one this agent may make on its own.

**Read these first, under `.claude/skills/finance/references/razorpay/`: references/not-used-here/subscriptions.md (note the banner) and references/this-repo.md.** Those files are the single source of truth for how Razorpay works and how this repo uses it. Do not restate them here or reason from memory — when this agent and the references disagree, the references win, and the disagreement is a bug to report.

Facts that override generic Razorpay advice in this repo:

Expand Down
2 changes: 1 addition & 1 deletion .claude/agents/razorpay-test-webhook.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ color: red

## Before you start

**Read these first, under `.claude/skills/razorpay/`: references/local-testing.md and references/webhooks.md.** Those files are the single source of truth for how Razorpay works and how this repo uses it. Do not restate them here or reason from memory — when this agent and the references disagree, the references win, and the disagreement is a bug to report.
**Read these first, under `.claude/skills/finance/references/razorpay/`: references/local-testing.md and references/webhooks.md.** Those files are the single source of truth for how Razorpay works and how this repo uses it. Do not restate them here or reason from memory — when this agent and the references disagree, the references win, and the disagreement is a bug to report.

Facts that override generic Razorpay advice in this repo:

Expand Down
2 changes: 1 addition & 1 deletion .claude/agents/razorpay-webhook.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ color: purple

## Before you start

**Read these first, under `.claude/skills/razorpay/`: references/webhooks.md and references/this-repo.md.** Those files are the single source of truth for how Razorpay works and how this repo uses it. Do not restate them here or reason from memory — when this agent and the references disagree, the references win, and the disagreement is a bug to report.
**Read these first, under `.claude/skills/finance/references/razorpay/`: references/webhooks.md and references/this-repo.md.** Those files are the single source of truth for how Razorpay works and how this repo uses it. Do not restate them here or reason from memory — when this agent and the references disagree, the references win, and the disagreement is a bug to report.

Facts that override generic Razorpay advice in this repo:

Expand Down
8 changes: 8 additions & 0 deletions .claude/agents/sweeper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: sweeper
description: Mechanical breadth work (E2E scenarios, docs regeneration, cron plumbing, a small Netlify function, verdict annotation) inside a dedicated worktree. Sonnet at medium effort.
model: sonnet
effort: medium
---

You are a mechanical executor for this repo. You receive a worktree path, a branch, and a numbered spec. Rules: work only inside the given worktree; follow the spec verbatim; do not widen scope; code comments explain why with `#N` refs; docs are full English sentences (no fragments); never run `next dev`, `next build`, `prisma db push` or `npm run db:*`; eslint warnings are blocking in changed lines. Deliver by committing with the trailers you are given, pushing, and opening a DRAFT PR against dev; report the PR number, changed files, verification output summaries and anything undone. Limit clause: if you approach a session limit, commit what is consistent, push, open the PR marking unfinished items, and report.
Loading
Loading