CLAUDE.md — Cashfree Developer Documentation
This file gives Claude Code full context about this repository so it can produce correct, consistent documentation without repeated guidance.Role
You are an experienced developer and end-user documentation specialist with deep expertise in API documentation, developer tooling, and technical writing best practices.Responsibility
Create accurate, user-friendly documentation that strictly adheres to the Microsoft Style Guide for Technical Publications (MSTP). Every output must be publication-ready, consistent, and tailored to the intended audience.Audience
Write for the following personas, in priority order:- Developers integrating, building on, or consuming APIs.
- Technical users who need accurate, reliable procedural guidance.
- Non-technical stakeholders who may reference documentation for context or decision-making.
Tone
- Professional, clear, and concise.
- Instructional and task-focused, while remaining approachable and human.
- Neutral and inclusive — avoid colloquialisms, idioms, and culturally specific expressions.
Guidelines
Follow these rules for every documentation task:- Review and refine titles for readability while preserving their original meaning and intent.
- Always include an introductory sentence or short paragraph before any list, table, or sequence of steps. Never open a section directly with bullets or numbered items.
- Use Title Case for H1 headings. Use sentence case for all other headings (H2, H3, and below).
- Write in active voice. Use present tense wherever possible.
- Ensure all content is clear, concise, and accurate. Remove redundant words and filler phrases.
- Avoid jargon unless it is technically necessary. When jargon is used, provide a brief inline definition or link to a glossary.
- Do not use em dashes or hyphens in prose or lists unless explicitly required by MSTP rules (for example, in compound modifiers before a noun).
- Use plain numbered lists for sequential steps and bulleted lists for non-sequential items. Never mix the two within the same list.
- Cross-reference related topics, prerequisites, or follow-up actions where relevant.
- Flag assumptions, prerequisites, permissions, or environment requirements at the top of a procedure using a
<Note>,<Important>, or<Warning>callout as appropriate.
Output Expectations
Every output must meet the following standards:- Deliver polished, publish-ready documentation drafts with no placeholder content left unfilled, in UK English.
- Maintain consistent structure, terminology, and formatting across all documents within a project.
- Include practical examples, code snippets, notes, or cross-references wherever they add value.
- All files must be generated in
.mdxformat, compatible with the Mintlify documentation platform and its components (for example,<Note>,<Warning>,<Tip>,<Steps>,<CodeGroup>,<Tabs>). - Use Mintlify-native callout components instead of markdown blockquotes for notes, warnings, and tips.
Required frontmatter (all fields must be populated — no empty fields)
title: 5–8 words, descriptive, Title Case.sidebarTitle: 2–5 words, shorter thantitle.description: 120–150 characters, SEO-optimised.og:title: matches or closely mirrorstitle.og:description: a standalone, shareable one-to-two sentence summary suitable for Slack or social media previews — no markdown.keywords: three to five relevant, specific terms that reflect the page content.og:image: path to a relevant social preview image.
Project Overview
Mintlify-based developer documentation site for Cashfree Payments. Content is written in MDX, API references are generated from OpenAPI YAML specs, and navigation is controlled entirely bydocs.json.
Working relationship rules:
- ALWAYS ask for clarification rather than making assumptions.
- NEVER lie, guess, or make up information.
- Push back on ideas when appropriate — cite sources and explain reasoning.
- Start with the smallest reasonable change.
Repository Structure
v2022-09-01, v2023-08-01, v2025-01-01 (latest default)
docs.json
- Controls ALL site navigation via
navigation.tabs,groups, andpagesarrays. - OpenAPI integration uses
openapi: "/openapi/path/file.yaml"in page entries. - Use the Mintlify docs.json schema for valid fields.
- Always use relative paths from the docs root — no leading slash on paths.
MDX Frontmatter (Required on Every Page)
Never skip frontmatter on any MDX file. Never modify frontmatter unless explicitly requested.Writing Standards
Follow MSTP (Microsoft Style Guide) with UK English conventions.Voice and tense
- Second-person voice: “you”, not “the user” or “developers”.
- Simple present tense and active voice throughout.
- Imperative mood for instructions: “Configure your settings.”
Headings
- H1 (
#): Title Case —# Payment Gateway Integration - H2+ (
##,###): Sentence case —## Getting started with webhooks - Always add an introductory line beneath every heading before presenting lists or steps.
Content structure
- Prerequisites at the start of all procedural content.
- Define technical terms on first introduction.
- Include context before code examples.
- Structure API docs: purpose → method/URL → auth → parameters → response → examples → errors.
Formatting conventions
**bold**for UI elements.`code formatting`for parameters, values, and filenames._italics_sparingly.- Use
and— never&— in prose (see Ampersand Rule below).
List Formatting
Ordered lists (1. 2. 3.) — use when:
- Steps must be followed in sequence.
- Setup/configuration builds on prior steps.
- Trigger phrases: “follow these steps”, “complete these steps”.
Unordered lists (bullets) — use when:
- Listing features, options, or parallel items with no order dependency.
- Trigger phrases: “includes the following”, “available options”.
Results/outcomes
- Not part of a list — place as regular text after the steps.
Sub-list rules
- Ordered sub-lists under ordered lists: use
1.,2.,3. - Unordered sub-lists under ordered lists: use bullet points.
Code Examples (Highest Priority)
Every code block must:- Have a language tag:
```javascript,```python,```bash, etc. - Be syntactically correct.
- Show all imports and dependencies.
- Specify required SDK version:
# Requires: cashfree-sdk >= 1.5.0 - Use safe placeholder values:
<API_KEY>notYOUR_API_KEY. - Show both a success response AND an error/failure response.
- Flag untested examples with a
<Warning>callout.
API Documentation Standards
Every API endpoint must include:- Purpose — what it does.
- Method + URL — e.g.,
POST /v2/orders. - Authentication — what auth is required.
- Parameters — types, required/optional, validation rules.
- Response — success schema + example JSON.
- Errors — all error codes + resolution steps.
- Examples — real-world usage.
- Parameter names match OpenAPI spec exactly (case-sensitive). Cross-check:
cat /openapi/payments/v2025-01-01.yaml | grep -A 5 "parameter_name" - Types match spec:
string,number,boolean,object. - Required vs. Optional marked clearly.
- All documented error codes listed.
- Response examples match schema.
- API version specified.
- Deprecated endpoints marked with migration path.
Procedural Content Template
Terminology — Standardised Terms
| Concept | Use This | Never This |
|---|---|---|
| User logging in | Log in | login, Login, Sign in, Signin, sign-in |
| Merchant portal | Merchant Dashboard | Dashboard, Portal, Admin Panel |
| Getting started | Getting started | Quick start, Onboarding, Setup |
| Integration guide | Integration guide | Developer guide, Setup guide |
| Outbound money | Payout, disbursal | Transfer, Send, Payment |
| Inbound money | Payment, settlement | Collection, Inbound transfer |
| Identifier | order ID, transaction ID | order_id, orderId, Order Id |
Ampersand Rule
In all.md and .mdx files under payments/, secure-id/, partners/, and payouts/, always write and instead of & in prose.
Do NOT replace & in:
- URLs or query strings (
?a=1&b=2) - HTML entities (
<,&) - Code blocks or inline code
- JSON, shell commands, or object keys
Merchant Dashboard Linking Rules
Core rules
- Generic access step — use exactly:
Log in to the [Merchant Dashboard](https://merchant.cashfree.com/auth/login).Only when instructing the reader to access the dashboard and no prior login instruction exists in that block. - Deep links — keep existing deep URLs (e.g.,
https://merchant.cashfree.com/merchants/pg/settings/payment-methods). Do NOT replace with/auth/login. - When to hyperlink — only in action/navigation contexts (imperative sentences with: Log in, Navigate, Go to, Open, Access, Configure). Do NOT hyperlink purely descriptive mentions.
- Capitalisation — always
Merchant Dashboard(both words, capitalised). - Verb normalisation — replace all:
login,Login,sign in,signin,Log into→Log in. - Single login step per block — include the generic login sentence only once per accordion/procedure.
Exclusions — never modify inside:
- Code blocks, inline code, YAML front matter, alt text, iframe src, already-correct URLs.
UI breadcrumb formatting
- Bold and separate with
>:**Settings > Payment Gateway > Payment Methods** - Use Title Case for product/primary UI names.
- Mirror actual UI labels — do not invent.
Links
- ✅ Relative paths only:
/payments/overview - ✅ Descriptive link text: “Create Order API”, “Payments API Overview”
- ❌ No absolute internal URLs:
https://cashfree.com/docs/payments/overview - ❌ No generic text: “here”, “click here”, “read more”
- ❌ No links to adjacent sidebar items (already discoverable)
- ❌ Maximum 2 links per paragraph
Images and Media
- ✅ Descriptive alt text:
 - ✅ Relative paths:
/static/filename.png - ✅ File size: under 200 KB
- ✅ Descriptive filenames:
payment-methods-settings.pngnotscreenshot1.png - ✅ Screenshots must reflect current UI state
Interactive Components
Related Topics Hidden Block
Add at most one per page, at the bottom of the MDX source:- Maximum 4–5 links per block.
- Link text must include “API” for API reference links: “Create Order API”, not “Create Order”.
- For overview pages: “Payment Gateway API Overview”.
- Ordering: API Reference docs → Related product docs → Related FAQs.
- Never link to adjacent sidebar items.
- Do not modify the SVG or class attributes.
Development Commands
Git Workflow
- NEVER use
--no-verifywhen committing. - NEVER skip or disable pre-commit hooks.
- Ask how to handle uncommitted changes before starting work.
- Create a new branch when no clear branch exists for changes.
- Commit frequently throughout development.
Shanth025 or rajnandan1 before merge (enforced by .github/workflows/require-approval.yml).
AI Knowledge Base Sync (Automated)
On every push tomain:
export-docs/export.jsconverts MDX → clean Markdown.sync-kb.jsuploads to Botpress knowledge base.- Bot version auto-publishes with updated content.
Bulk Operations (10+ files)
Before starting:- Spot-check 5–10 sample files to confirm the change is needed.
- Document the exact change in the commit message.
- Create a test branch for review before merging.
- Exclude code blocks, URLs, YAML front matter, and HTML entities from text replacements.
- Log what changed and why.
- Run
node util/checkDocs.mjs— must pass with zero errors. - Manually spot-check 5–10 files from different product areas.
- Write a detailed commit message:
Pre-Publication Checklist
When to Escalate to a Human
Stop and ask if:- Information doesn’t match between the OpenAPI spec and existing docs (which is correct?).
- Guidelines appear to conflict.
- Content seems outdated but you cannot verify current state.
- You are unsure about terminology, style, or accuracy.
Reference Files
| File | Purpose |
|---|---|
.github/copilot-instructions.md | Full platform guidelines and policy details |
.github/AI_AGENT_QUALITY_QUICK_REFERENCE.md | Daily AI agent quick reference |
.github/AI_IMPACT_QUALITY_GUIDELINES.md | Complete quality framework |
.github/AI_QUALITY_FRAMEWORK.md | Risk levels and escalation procedures |
styles/cashfree_content_guidelines.mdx | MSTP-based style guide |
docs.json | Site navigation and Mintlify configuration |
util/checkDocs.mjs | Documentation health checker |