agentleFS
girijashankarjgirijashankarj/cursor-handbook/.cursor/rules/devops/documentation-standards.mdc

cursor-handbook / devops

Cursor rule31 starsChanged 3 months agoMITView on GitHub

Documentation standards for code, APIs, and architecture

The file

We split this documentation-standards.mdc into the rules it gives an agent

9 rules. About 0 are common, 9 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Document why, not what — code should be self-documenting for the "what"

    line 9
  2. Distinctive:

    Use JSDoc/TSDoc for all public functions and classes

    line 10
  3. Distinctive:

    Document complex algorithms with inline comments

    line 11
  4. Distinctive:

    Keep README.md up to date with every significant change

    line 12
  5. Distinctive:

    Use OpenAPI/Swagger for REST APIs

    line 35
  6. Distinctive:

    Document all endpoints: method, path, params, body, responses

    line 36
  7. Distinctive:

    Document error codes and their meanings

    line 38
  8. Distinctive:

    Keep docs in sync with code (prefer auto-generation)

    line 39
  9. Distinctive:

    Every repository MUST include:

    line 49

≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
documentation-standards.mdc
---
description: "Documentation standards for code, APIs, and architecture"
alwaysApply: true
---

# Documentation Standards

## Code Documentation
- Document **why**, not **what** — code should be self-documenting for the "what"
- Use JSDoc/TSDoc for all public functions and classes
- Document complex algorithms with inline comments
- Keep README.md up to date with every significant change

### JSDoc Template
```{{CONFIG.techStack.language}}
/**
 * Calculates the total price for an order including taxes and discounts.
 *
 * @param items - Array of order items with price and quantity
 * @param taxRate - Tax rate as a decimal (e.g., 0.08 for 8%)
 * @param discountCode - Optional promotional discount code
 * @returns The calculated total with breakdown
 * @throws {ValidationError} When items array is empty
 * @example
 * const total = calculateOrderTotal(items, 0.08, 'SAVE10');
 */
export function calculateOrderTotal(
  items: OrderItem[],
  taxRate: number,
  discountCode?: string
): OrderTotal { ... }
```

## API Documentation
- Use OpenAPI/Swagger for REST APIs
- Document all endpoints: method, path, params, body, responses
- Include example requests and responses
- Document error codes and their meanings
- Keep docs in sync with code (prefer auto-generation)

## Architecture Documentation
- Architecture Decision Records (ADRs) for significant decisions
- System diagrams updated quarterly
- Data flow diagrams for complex processes
- Runbooks for operational procedures
- Incident post-mortems documented and shared

## README Template
Every repository MUST include:
1. Project description and purpose
2. Quick start / setup instructions
3. Development workflow
4. Testing instructions
5. Deployment process
6. Architecture overview
7. Contributing guidelines

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.