Skip to main content

Project README Templates

Copy-Paste Documentation for Your Projects

Why READMEs Matter

Your README is often the first thing people see. A good README answers three questions in the first 30 seconds:

  • What is this? — One sentence explaining the project
  • Why should I care? — The problem it solves
  • How do I use it? — Quick start example

Below are three templates I use for different project types. Copy the raw markdown, customize the placeholders, and ship.

CLI Tool README Template

For command-line applications, scripts, and developer tools.

CLI Tool Template
# project-name

> One-line description of what this CLI does and why it's useful.

[![npm version](https://img.shields.io/npm/v/project-name.svg)](https://www.npmjs.com/package/project-name)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)

## Installation

```bash
# npm
npm install -g project-name

# or with npx (no install)
npx project-name <command>
```

## Quick Start

```bash
# Basic usage
project-name init

# With options
project-name build --output ./dist --minify

# Get help
project-name --help
```

## Commands

| Command | Description |
|---------|-------------|
| `init` | Initialize a new project |
| `build` | Build for production |
| `dev` | Start development mode |
| `help` | Show help |

## Options

| Flag | Description | Default |
|------|-------------|---------|
| `-o, --output <dir>` | Output directory | `./dist` |
| `-c, --config <file>` | Config file path | `project.config.js` |
| `-v, --verbose` | Verbose output | `false` |
| `--version` | Show version | |

## Configuration

Create a `project.config.js` in your project root:

```javascript
module.exports = {
  output: './dist',
  minify: true,
  sourcemaps: false,
};
```

Or use environment variables:

```bash
PROJECT_OUTPUT=./dist project-name build
```

## Examples

### Basic Build

```bash
project-name build
```

### Watch Mode

```bash
project-name dev --watch
```

### CI/CD Pipeline

```yaml
# .github/workflows/build.yml
- name: Build
  run: npx project-name build --minify
```

## Requirements

- Node.js 18+
- npm or yarn

## Contributing

1. Fork the repo
2. Create your branch (`git checkout -b feature/amazing`)
3. Commit changes (`git commit -m 'Add amazing feature'`)
4. Push (`git push origin feature/amazing`)
5. Open a Pull Request

## License

MIT © [Your Name](https://github.com/yourusername)

Web Application README Template

For web apps, dashboards, and full-stack projects.

Web Application Template
# Project Name

> Brief description of what this web application does and the problem it solves.

![Screenshot](./docs/screenshot.png)

[![Deploy Status](https://img.shields.io/badge/deploy-vercel-black)](https://your-app.vercel.app)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)

**[Live Demo](https://your-app.vercel.app)** · [Report Bug](https://github.com/user/repo/issues) · [Request Feature](https://github.com/user/repo/issues)

## Features

- ✅ Feature one with brief explanation
- ✅ Feature two that users care about
- ✅ Feature three highlighting a key capability
- 🚧 Upcoming feature (in development)

## Tech Stack

- **Framework:** Next.js 14 (App Router)
- **Styling:** Tailwind CSS
- **Database:** PostgreSQL + Prisma
- **Auth:** NextAuth.js
- **Deployment:** Vercel

## Getting Started

### Prerequisites

- Node.js 18+
- PostgreSQL (or use Docker)
- npm/yarn/pnpm

### Installation

1. Clone the repository

```bash
git clone https://github.com/user/project-name.git
cd project-name
```

2. Install dependencies

```bash
npm install
```

3. Set up environment variables

```bash
cp .env.example .env.local
# Edit .env.local with your values
```

4. Set up the database

```bash
npx prisma db push
npx prisma db seed  # Optional: seed with sample data
```

5. Start the development server

```bash
npm run dev
```

Open [http://localhost:3000](http://localhost:3000) to see the app.

## Environment Variables

| Variable | Description | Required |
|----------|-------------|----------|
| `DATABASE_URL` | PostgreSQL connection string | Yes |
| `NEXTAUTH_SECRET` | Random string for auth | Yes |
| `NEXTAUTH_URL` | App URL (http://localhost:3000) | Yes |
| `GITHUB_ID` | GitHub OAuth app ID | No |
| `GITHUB_SECRET` | GitHub OAuth secret | No |

## Project Structure

```
├── src/
│   ├── app/           # Next.js App Router pages
│   ├── components/    # React components
│   ├── lib/           # Utilities and helpers
│   └── styles/        # Global styles
├── prisma/
│   └── schema.prisma  # Database schema
├── public/            # Static assets
└── tests/             # Test files
```

## Scripts

| Command | Description |
|---------|-------------|
| `npm run dev` | Start development server |
| `npm run build` | Build for production |
| `npm run start` | Start production server |
| `npm run lint` | Run ESLint |
| `npm run test` | Run tests |
| `npm run db:push` | Push schema to database |
| `npm run db:studio` | Open Prisma Studio |

## Deployment

### Vercel (Recommended)

1. Push to GitHub
2. Import project in Vercel
3. Add environment variables
4. Deploy

### Docker

```bash
docker build -t project-name .
docker run -p 3000:3000 project-name
```

## Contributing

Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) first.

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing`)
5. Open a Pull Request

## License

MIT © [Your Name](https://github.com/yourusername)

## Acknowledgments

- [Next.js](https://nextjs.org/) for the framework
- [Vercel](https://vercel.com/) for hosting
- [shadcn/ui](https://ui.shadcn.com/) for components

Library/Package README Template

For npm packages, Python libraries, and reusable modules.

Library/Package Template
# package-name

> A concise description of what this library does. Explain the problem it solves in one sentence.

[![npm version](https://img.shields.io/npm/v/package-name.svg)](https://www.npmjs.com/package/package-name)
[![npm downloads](https://img.shields.io/npm/dm/package-name.svg)](https://www.npmjs.com/package/package-name)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
[![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue.svg)](https://www.typescriptlang.org/)

## Why?

Existing solutions have [problem X]. This library solves it by [approach Y], giving you:

- **Benefit 1** — Brief explanation
- **Benefit 2** — Brief explanation  
- **Benefit 3** — Brief explanation

## Installation

```bash
npm install package-name
# or
yarn add package-name
# or
pnpm add package-name
```

## Quick Start

```typescript
import { doSomething } from 'package-name';

// Basic usage
const result = doSomething('input');
console.log(result);

// With options
const result = doSomething('input', {
  option1: true,
  option2: 'value',
});
```

## API Reference

### `doSomething(input, options?)`

Main function description.

**Parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `input` | `string` | Yes | The input to process |
| `options` | `Options` | No | Configuration options |

**Options:**

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `option1` | `boolean` | `false` | Enable feature X |
| `option2` | `string` | `'default'` | Set the mode |
| `option3` | `number` | `100` | Maximum limit |

**Returns:** `Result` — Description of return value

**Example:**

```typescript
const result = doSomething('hello', { option1: true });
// => { processed: 'HELLO', length: 5 }
```

### `anotherFunction(data)`

Secondary function description.

**Parameters:**

| Name | Type | Description |
|------|------|-------------|
| `data` | `Data[]` | Array of data objects |

**Returns:** `Promise<Result[]>`

## TypeScript

Full TypeScript support included. Import types directly:

```typescript
import { doSomething, type Options, type Result } from 'package-name';

const options: Options = {
  option1: true,
};

const result: Result = doSomething('input', options);
```

## Advanced Usage

### Custom Configuration

```typescript
import { configure, doSomething } from 'package-name';

// Set global defaults
configure({
  option1: true,
  option2: 'custom',
});

// All calls now use these defaults
doSomething('input');
```

### Error Handling

```typescript
import { doSomething, PackageError } from 'package-name';

try {
  const result = doSomething(invalidInput);
} catch (error) {
  if (error instanceof PackageError) {
    console.error('Validation failed:', error.message);
  }
  throw error;
}
```

### Framework Integration

#### React

```tsx
import { useSomething } from 'package-name/react';

function Component() {
  const { data, loading, error } = useSomething('input');
  
  if (loading) return <div>Loading...</div>;
  if (error) return <div>Error: {error.message}</div>;
  
  return <div>{data.processed}</div>;
}
```

## Browser Support

| Browser | Version |
|---------|---------|
| Chrome | 80+ |
| Firefox | 75+ |
| Safari | 13+ |
| Edge | 80+ |

## Bundle Size

- **Minified:** ~5kb
- **Gzipped:** ~2kb
- **Tree-shakeable:** Yes

## Comparison

| Feature | package-name | alternative-a | alternative-b |
|---------|--------------|---------------|---------------|
| TypeScript | ✅ | ❌ | ✅ |
| Tree-shaking | ✅ | ✅ | ❌ |
| Zero deps | ✅ | ❌ | ❌ |
| Feature X | ✅ | ✅ | ❌ |

## Contributing

Contributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.

```bash
# Clone and install
git clone https://github.com/user/package-name.git
cd package-name
npm install

# Run tests
npm test

# Build
npm run build
```

## Changelog

See [CHANGELOG.md](CHANGELOG.md) for release history.

## License

MIT © [Your Name](https://github.com/yourusername)

---

**[Documentation](https://package-name.dev)** · **[npm](https://www.npmjs.com/package/package-name)** · **[GitHub](https://github.com/user/package-name)**

README Best Practices

Lead with the hookFirst paragraph should explain what the project does AND why it's useful. Don't bury the lede.
📋
Show, don't tellInclude a code example in the first screenful. People skim—give them something to copy immediately.
🎯
Installation should be one commandIf setup takes more than 3 steps, something's wrong. Simplify or automate it.
📸
Add a screenshot or GIFFor anything visual, show it. A 10-second demo GIF beats 1000 words of documentation.
🏷️
Add badges (sparingly)Build status, npm version, license. Skip vanity badges—nobody cares about your code coverage percentage.
📝
Keep it updatedOutdated docs are worse than no docs. Review your README every time you change the API.

Common Sections Reference

Must-Have Sections

  • Title + Description: What is this thing?
  • Installation: How do I get it?
  • Usage/Quick Start: Show me the simplest example
  • License: Can I use it?

Nice-to-Have Sections

  • Features: Bullet list of capabilities
  • Configuration: Environment variables, options
  • API Reference: For libraries
  • Contributing: How to help
  • Changelog: What changed (or link to CHANGELOG.md)
  • Acknowledgments: Credit where due

Need Help With Your Project?

I help teams ship better software. Let's talk about your documentation, architecture, or development needs.

Hire Me →