Update repo documentation and agent-facing guidance such as AGENTS.md, README.md, docs/, specs, plans, and runbooks. Use when code, skill, or infrastructure changes risk doc drift or when documentation needs cleanup or restructuring. Do not use for code review, runtime verification, or `agent-readiness` setup.
98
100%
Does it follow best practices?
Impact
94%
1.00xAverage score across 3 eval scenarios
Passed
No known issues
The payments team at Meridian Corp has recently started using AI coding agents (Claude Code, OpenAI Codex) to help maintain their backend services. The agents keep going off-track: one recently overwrote a migration file because it couldn't find the correct setup steps; another spent 20 minutes exploring directory structure before writing a single line of code.
The team has identified that their AGENTS.md file is either missing or poorly written — it either dumps too much information (full architecture tours, every lint rule, directory tree dumps) or too little (no boot command, no test command). They need a well-structured AGENTS.md that gives agents exactly what they need to get oriented quickly without overwhelming them.
The codebase is a Node.js/TypeScript payments service. Currently the repo has a rough AGENTS.md that needs to be completely rewritten based on what agents actually need.
Produce a replacement AGENTS.md file for this payments service repository. The file should orient an AI agent to the project efficiently.
Also produce a short doc-report.md explaining what you changed and why — noting any content you removed, what you kept, and the reasoning.
The following files are provided as inputs. Extract them before beginning.
=============== FILE: inputs/AGENTS.md ===============
payments-service/
├── src/
│ ├── api/ # Express route handlers
│ │ ├── charges.ts
│ │ ├── refunds.ts
│ │ └── webhooks.ts
│ ├── db/
│ │ ├── migrations/ # Knex migration files (never edit manually)
│ │ └── models/ # Sequelize ORM models
│ ├── services/
│ │ ├── stripe.ts # Stripe API wrapper
│ │ └── email.ts # SendGrid email notifications
│ ├── utils/
│ │ ├── logger.ts
│ │ ├── errors.ts
│ │ └── validation.ts
│ └── index.ts # App entry point
├── tests/
│ ├── unit/
│ └── integration/
├── docs/
│ ├── architecture.md
│ ├── api.md
│ └── deployment.md
├── scripts/
│ ├── bootstrap.sh # Sets up dev environment (DEPRECATED, use setup.sh)
│ ├── setup.sh # NEW: replaces bootstrap.sh
│ └── seed.sh # Seed test database
├── package.json
└── .env.exampleThe payments service is a REST API built on Express.js and TypeScript. It handles charge creation, refund processing, and webhook events from Stripe. Data is persisted in PostgreSQL using both Knex (for migrations) and Sequelize (for models — yes, we know this is inconsistent, it's a known tech debt item from Q2 2023 when we merged two teams).
The service uses a layered architecture: routes → controllers → services → data layer. External integrations (Stripe, SendGrid) are wrapped in service classes under src/services/. All Stripe webhooks go through src/api/webhooks.ts, which verifies the Stripe signature before processing.
Stripe webhook signature verification key is stored in STRIPE_WEBHOOK_SECRET. Never log this value.
Prerequisites: Node.js 20+, PostgreSQL 15+, Docker (optional)
npm installcp .env.example .env.envscripts/setup.shnpm run devTo run tests:
npm testnpm run test:integration (requires a running database)npm run test:coverageany types without a comment explaining whysrc/utils/logger.ts) for all logging — never use console.logAppError class from src/utils/errors.ts.env files or any secretsfeature/, fix/, chore/ prefixes requiredgit push --force on mainThe API follows REST conventions. All endpoints return JSON.
Authentication: Bearer token in the Authorization header. Token format: JWT <token>
Base URL: /api/v1
POST /api/v1/charges — Create a new charge
Request body:
{
"amount": 1000,
"currency": "usd",
"customerId": "cust_123",
"paymentMethodId": "pm_456",
"description": "Order #789"
}Response: 201 with charge object
GET /api/v1/charges/:id — Retrieve a charge
Response: 200 with charge object
POST /api/v1/charges/:id/capture — Capture an authorized charge
Response: 200 with updated charge
POST /api/v1/refunds — Create a refund
Request body: { "chargeId": "ch_123", "amount": 500 }
Response: 201 with refund object
POST /api/v1/webhooks/stripe — Stripe webhook endpoint
Headers: stripe-signature required
We use PostgreSQL 15. Connection string goes in DATABASE_URL.
Migration commands:
npx knex migrate:make <name>npx knex migrate:latestnpx knex migrate:rollbackSeeding: npm run seed (runs scripts/seed.sh)
Deployed on AWS ECS via GitHub Actions. CI pipeline defined in .github/workflows/.
Deployment steps:
main triggers CIFor manual deployments: see docs/deployment.md
Common issues:
git pull: Run npm installdocs/architecture.mddocs/api.mddocs/deployment.mdThis section was automatically generated by our doc-gen tool on 2024-01-15.
| File | Lines | Last Modified |
|---|---|---|
| src/api/charges.ts | 234 | 2024-03-01 |
| src/api/refunds.ts | 156 | 2024-02-14 |
| src/api/webhooks.ts | 89 | 2024-01-30 |
| src/services/stripe.ts | 312 | 2024-03-05 |
| src/db/migrations/ | 18 files | 2024-03-01 |