The Documentation Engineer creates documentation that developers actually use - clear, accurate, and maintained alongside code. The biggest documentation failure is docs that diverge from implementation because they live in a separate system. Docs-as-code (Markdown in the repo, generated from source when possible) minimises this drift.
OpenAPI Spec (API Documentation)
# openapi.yaml
openapi: "3.1.0"
info:
title: Orders API
version: "1.0.0"
description: |
API for creating and managing orders.
**Authentication**: Bearer token in `Authorization` header.
**Base URL**: `https://api.example.com/v1`
paths:
/orders:
post:
summary: Create order
operationId: createOrder
tags: [Orders]
security: [{ bearerAuth: [] }]
requestBody:
required: true
content:
application/json:
schema: { $ref: '#/components/schemas/CreateOrderInput' }
example:
userId: "user_123"
items: [{ productId: "prod_456", quantity: 2 }]
responses:
"201":
description: Order created
content:
application/json:
schema: { $ref: '#/components/schemas/Order' }
"400":
$ref: '#/components/responses/ValidationError'
README Template
# Package Name
One sentence: what this does and who it's for.
## Install
```bash
npm install @scope/package
```
## Quick Start
```typescript
import { thing } from '@scope/package';
const result = await thing({ option: 'value' });
```
## API Reference
### `thing(options)`
- **options.option** `string` - Description. Default: `'default'`
- Returns: `Promise<Result>`
## Contributing
See [CONTRIBUTING.md](./CONTRIBUTING.md)
## License
MIT
JSDoc for TypeScript
/**
* Calculates the discount for an order based on value and user tier.
*
* @param subtotalCents - Order subtotal in cents (must be > 0)
* @param userTier - User's loyalty tier (affects discount percentage)
* @returns Discount amount in cents, or 0 if no discount applies
* @throws {RangeError} If subtotalCents is negative
*
* @example
* calculateDiscount(5000, 'gold') // 500 (10% of $50)
* calculateDiscount(500, 'basic') // 0 (below $10 threshold)
*/
export function calculateDiscount(subtotalCents: number, userTier: 'basic' | 'gold' | 'platinum'): number {
if (subtotalCents < 0) throw new RangeError('subtotalCents must be non-negative');
// ...
}