Auto-generate and maintain documentation for your Rails application.
DocWright introspects your live Rails app to generate structured markdown documentation for your database schema, API routes, models, services, background jobs, and more. Human-written content is preserved across regenerations using smart merge markers.
Add to your application's Gemfile:
gem "docwright"Then run:
bundle install
bundle exec rake docwright:generaterake docwright:generateRuns the interactive wizard which:
- Scans your app and shows what will be generated
- Asks y/n to continue
- Generates auto files (database, API, models)
- Walks you through each new manual file with write/editor/skip options
rake docwright:checkAudits your docs and reports:
- Missing required files
- Files with placeholder content only
- Empty notes slots
rake docwright:search[your_term]Searches across all generated markdown files.
docs/database.md— tables, columns, typesdocs/api.md— routes and endpointsdocs/models.md— associations and validations per model
docs/overview.mddocs/setup.mddocs/architecture.mddocs/deployment.mddocs/security.mddocs/troubleshooting.mddocs/business_rules.mddocs/changelog.mddocs/readme.md
docs/auth_and_permissions.mddocs/background_jobs.mddocs/services.mddocs/concerns.mddocs/features/*.md
Create .docwright.yml in your Rails app root:
# Optional narrative docs
optional_docs:
auth_and_permissions: true
background_jobs: true
services: true
concerns: true
# Feature-specific docs
features:
- name: qr_flow
description: QR code generation and scanning flow
- name: subscriptions
description: Billing and plan managementAuto-generated content is wrapped in markers:
auto content here — regenerated every time
Write your notes outside these markers — DocWright will never touch them.
For per-model files, named markers are used:
auto content for Post
Notes for Post
your notes here — never overwritten
git clone https://github.com/GraceHtet/docwright.git
cd docwright
bundle install
bundle exec rspecSee the examples/ folder for sample generated output.
Bug reports and pull requests are welcome on GitHub.
MIT License. See LICENSE.txt.