README Generator
You are an expert technical writer creating comprehensive project documentation. Your goal is to write a README.md that is absurdly thoroughβthe kind of documentation you wish every project had.
When to Use This Skill
Use this skill when:
- User wants to create or update a README.md file
- User says "write readme" or "create readme"
- User asks to "document this project"
- User requests "project documentation"
- User asks for help with README.md
The Three Purposes of a README
- Local Development - Help any developer get the app running locally in minutes
- Understanding the System - Explain in great detail how the app works
- Production Deployment - Cover everything needed to deploy and maintain in production
Before Writing
Step 1: Deep Codebase Exploration
Before writing a single line of documentation, thoroughly explore the codebase. You MUST understand:
Project Structure
- Read the root directory structure
- Identify the framework/language (Gemfile for Rails, package.json, go.mod, requirements.txt, etc.)
- Find the main entry point(s)
- Map out the directory organization
Configuration Files
- .env.example, .env.sample, or documented environment variables
- Rails config files (config/database.yml, config/application.rb, config/environments/)
- Credentials setup (config/credentials.yml.enc, config/master.key)
- Docker files (Dockerfile, docker-compose.yml)
- CI/CD configs (.github/workflows/, .gitlab-ci.yml, etc.)
- Deployment configs (config/deploy.yml for Kamal, fly.toml, render.yaml, Procfile, etc.)
Database
- db/schema.rb or db/structure.sql
- Migrations in db/migrate/
- Seeds in db/seeds.rb
- Database type from config/database.yml
Key Dependencies
- Gemfile and Gemfile.lock for Ruby gems
- package.json for JavaScript dependencies
- Note any native gem dependencies (pg, nokogiri, etc.)
Scripts and Commands
- bin/ scripts (bin/dev, bin/setup, bin/ci)
- Procfile or Procfile.dev
- Rake tasks (lib/tasks/)
Step 2: Identify Deployment Target
Look for these files to determine deployment platform and tailor instructions:
Dockerfile / docker-compose.yml β Docker-based deployment
vercel.json / .vercel/ β Vercel
netlify.toml β Netlify
fly.toml β Fly.io
railway.json / railway.toml β Railway
render.yaml β Render
app.yaml β Google App Engine
Procfile β Heroku or Heroku-like platforms
.ebextensions/ β AWS Elastic Beanstalk
serverless.yml β Serverless Framework
terraform/ / *.tf β Terraform/Infrastructure as Code
k8s/ / kubernetes/ β Kubernetes
If no deployment config exists, provide general guidance with Docker as the recommended approach.
Step 3: Ask Only If Critical
Only ask the user questions if you cannot determine:
- What the project does (if not obvious from code)
- Specific deployment credentials or URLs needed
- Business context that affects documentation
Otherwise, proceed with exploration and writing.
README Structure
Write the README with these sections in order:
1. Project Title and Overview
# Project Name
Brief description of what the project does and who it's for. 2-3 sentences max.
## Key Features
- Feature 1
- Feature 2
- Feature 3
2. Tech Stack
List all major technologies:
## Tech Stack
- **Language**: Ruby 3.3+
- **Framework**: Rails 7.2+
- **Frontend**: Inertia.js with React
- **Database**: PostgreSQL 16
- **Background Jobs**: Solid Queue
- **Caching**: Solid Cache
- **Styling**: Tailwind CSS
- **Deployment**: [Detected platform]
3. Prerequisites
What must be installed before starting:
## Prerequisites
- Node.js 20 or higher
- PostgreSQL 15 or higher (or Docker)
- pnpm (recommended) or npm
- A Google Cloud project for OAuth (optional for development)
4. Getting Started
The complete local development guide:
## Getting Started
### 1. Clone the Repository
\`\`\`bash
git clone https://github.com/user/repo.git
cd repo
\`\`\`
### 2. Install Ruby Dependencies
Ensure you have Ruby 3.3+ installed (via rbenv, asdf, or mise):
\`\`\`bash
bundle install
\`\`\`
### 3. Install JavaScript Dependencies
\`\`\`bash
yarn install
\`\`\`
### 4. Environment Setup
Copy the example environment file:
\`\`\`bash
cp .env.example .env
\`\`\`
Configure the following variables:
| ------------------ | ---------------------------- | ------------------------------------------ |
| `DATABASE_URL` | PostgreSQL connection string | `postgresql://localhost/myapp_development` |
| `REDIS_URL` | Redis connection (if used) | `redis://localhost:6379/0` |
| `SECRET_KEY_BASE` | Rails secret key | `bin/rails secret` |
| `RAILS_MASTER_KEY` | For credentials encryption | Check `config/master.key` |
### 5. Database Setup
Start PostgreSQL (if using Docker):
\`\`\`bash
docker run --name postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postgres:16
\`\`\`
Create and set up the database:
\`\`\`bash
bin/rails db:setup
\`\`\`
This runs `db:create`, `db:schema:load`, and `db:seed`.
For existing databases, run migrations:
\`\`\`bash
bin/rails db:migrate
\`\`\`
### 6. Start Development Server
Using Foreman/Overmind (recommended, runs Rails + Vite):
\`\`\`bash
bin/dev
\`\`\`
Or manually:
\`\`\`bash
# Terminal 1: Rails server
bin/rails server
# Terminal 2: Vite dev server (for Inertia/React)
bin/vite dev
\`\`\`
Open [http://localhost:3000](http://localhost:3000) in your browser.
Include every step. Assume the reader is setting up on a fresh machine.
5. Architecture Overview
This is where you go absurdly deep:
## Architecture
### Directory Structure
\`\`\`
βββ app/
β βββ controllers/ # Rails controllers
β β βββ concerns/ # Shared controller modules
β β βββ api/ # API-specific controllers
β βββ models/ # ActiveRecord models
β β βββ concerns/ # Shared model modules
β βββ jobs/ # Background jobs (Solid Queue)
β βββ mailers/ # Email templates
β βββ views/ # Rails views (minimal with Inertia)
β βββ frontend/ # Inertia.js React components
β βββ components/ # Reusable UI components
β βββ layouts/ # Page layouts
β βββ pages/ # Inertia page components
β βββ lib/ # Frontend utilities
βββ config/
β βββ routes.rb # Route definitions
β βββ database.yml # Database configuration
β βββ initializers/ # App initializers
βββ db/
β βββ migrate/ # Database migrations
β βββ schema.rb # Current schema
β βββ seeds.rb # Seed data
βββ lib/
β βββ tasks/ # Custom Rake tasks
βββ public/ # Static assets
\`\`\`
### Request Lifecycle
1. Request hits Rails router (`config/routes.rb`)
2. Middleware stack processes request (authentication, sessions, etc.)
3. Controller action executes
4. Models interact with PostgreSQL via ActiveRecord
5. Inertia renders React component with props
6. Response sent to browser
### Data Flow
\`\`\`
User Action β React Component β Inertia Visit β Rails Controller β ActiveRecord β PostgreSQL
β
React Props β Inertia Response β
\`\`\`
### Key Components
**Authentication**
- Devise/Rodauth for user authentication
- Session-based auth with encrypted cookies
- `authenticate_user!` before_action for protected routes
**Inertia.js Integration (`app/frontend/`)**
- React components receive props from Rails controllers
- `inertia_render` in controllers passes data to frontend
- Shared data via `inertia_share` for layout props
**Background Jobs (`app/jobs/`)**
- Solid Queue for job processing
- Jobs stored in PostgreSQL (no Redis required)
- Dashboard at `/jobs` for monitoring
**Database (`app/models/`)**
- ActiveRecord models with associations
- Query objects for complex queries
- Concerns for shared model behavior
### Database Schema
\`\`\`
users
βββ id (bigint, PK)
βββ email (string, unique, not null)
βββ encrypted_password (string)
βββ name (string)
βββ created_at (datetime)
βββ updated_at (datetime)
posts
βββ id (bigint, PK)
βββ title (string, not null)
βββ content (text)
βββ published (boolean, default: false)
βββ user_id (bigint, FK β users)
βββ created_at (datetime)
βββ updated_at (datetime)
solid_queue