-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Summary
The docs-readme plugin generates and maintains project READMEs by analyzing the codebase, extracting metadata from manifests, and following a consistent structure. This is valuable because writing a good README from scratch is tedious and Claude's default behavior is to generate either too much or too little without a consistent format.
Original Intent
Plugin to maintain a project README file — what purpose it serves, what it needs to communicate, as well as keeping it up-to-date.
Commands
/readme:generate
Purpose: Generate a comprehensive README from project analysis.
Behavior:
-
Analyze the project:
- Read manifest files (
package.json,pyproject.toml,Cargo.toml,go.mod) - Extract: name, description, version, license, author, repository URL
- Detect tech stack from dependencies and config files
- Find entry points and main exports
- Identify scripts/commands from package.json, Makefile, etc.
- Check for existing docs/, examples/, CONTRIBUTING.md, CHANGELOG.md
- Read manifest files (
-
Detect badge candidates:
Badge Condition Source npm version package.jsonexistsshields.io PyPI version pyproject.tomlwith[project]shields.io License License file or manifest field shields.io CI status .github/workflows/existsGitHub Actions Coverage Coverage config detected Codecov/Coveralls TypeScript tsconfig.jsonexistsshields.io -
Generate README with this structure:
# <Project Name> <badges> <One-paragraph description from manifest or inferred from code> ## Features - <Feature 1 — inferred from main exports/routes/commands> - <Feature 2> ## Installation <Package manager command based on project type> ## Quick Start <Minimal working example based on main entry point> ## Usage <More detailed usage with code examples> ## API Reference <If library: document main exports> <If CLI: document commands and flags> <If web app: skip or link to docs/> ## Configuration <Environment variables, config files> ## Development <How to set up for development, run tests, etc.> ## Contributing <Link to CONTRIBUTING.md if exists, otherwise brief guide> ## License <License name + link>
-
Ask user before writing:
- Show generated README preview
- Allow editing each section
- Confirm before writing/overwriting
Edge cases:
- README already exists → offer to regenerate specific sections or fully replace
- Monorepo → generate root README linking to package READMEs
- No manifest files → ask user for project description
- Private/internal project → skip badges, focus on setup instructions
/readme:update (new)
Purpose: Update specific sections of an existing README without regenerating the whole thing.
Behavior:
- Read existing README.md
- Parse into sections (by
##headings) - Ask user which sections to update:
- Installation (re-detect from manifest)
- Usage (re-analyze entry points)
- API Reference (re-scan exports)
- Configuration (re-scan env vars and config files)
- Development (re-detect scripts/commands)
- Badges (re-detect and refresh)
- Or "Add missing sections" — identify sections in template not in current README
- For each selected section:
- Regenerate from current project state
- Show diff between old and new
- Apply if user approves
- Preserve all user-written content in non-selected sections
- Output: summary of updated sections
Edge cases:
- Non-standard README structure → best-effort section matching by heading text
- README uses different heading levels → normalize to
##for main sections - HTML content in README → preserve as-is
Hooks
None — this plugin operates through commands only.
File Manifest
| File | Est. Lines | Purpose |
|---|---|---|
commands/generate.md |
100-120 | Generate README from scratch |
commands/update.md |
80-100 | Update specific sections |
README.md |
120-150 | Full plugin documentation |
.claude-plugin/plugin.json |
15-20 | Plugin manifest |
README Outline
- Overview — What docs-readme does: structured README generation and maintenance
- Quick Start — Installation +
/readme:generate - Commands — Table with both commands
- README Template — Full reference of the generated structure with explanations
- Badge Support — Table of auto-detected badges
- Section Reference — What each README section should contain
- Customization — How user-written sections are preserved during updates
Prerequisites
- No external tools required
Quality Checklist
- Each command .md is 60+ lines with concrete steps
- README is 100+ lines with examples and reference tables
- README template is comprehensive and production-ready
- Badge detection covers common cases
- Plugin provides clear value (consistent structure + section-level updates)