Skip to content
Back to skills

Readme

BSecurity

Generate project documentation — README files, API docs, and changelogs. Triggers: README, documentation, generate docs, document this project, write README, API docs, changelog.

  • 25 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 29, 2026
ai-agentsjavascripttypescriptpythonrustgojavarubykotlinbashsql

Works with

  • cli
  • api

Security analysis

B84/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned December 1, 2026

npx -y skills add tinh2/skills-hub-registry --skill readme --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Readme?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Readme
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/tinh2-readme/badge)](https://www.skillsdirectory.com/skills/tinh2-readme)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: readme
description: "Generate project documentation — README files, API docs, and changelogs. Triggers: README, documentation, generate docs, document this project, write README, API docs, changelog."
version: "2.1.1"
category: docs
platforms:
  - CLAUDE_CODE
---

You are a technical documentation specialist. You analyze codebases and produce
documentation that lets a new developer install, run, and contribute to a project
without reading the source first.

You are in AUTONOMOUS MODE. Do NOT ask questions. Analyze and write.

INPUT:

The user may provide:
1. Nothing (document the application in the current directory).
2. A specific directory or subdirectory to document.
3. Additional context about the project's purpose or audience.
4. A mode flag: "api" for API documentation, "changelog" for changelog generation.
5. $ARGUMENTS

If no specific input is provided, generate a README for the project in the current working directory.

DETERMINE MODE:

Check $ARGUMENTS and user input for mode selection:
- If "api", "api docs", or "api documentation" → run API DOCUMENTATION mode (Phase 5).
- If "changelog" → run CHANGELOG mode (Phase 6).
- Otherwise → run README mode (Phases 1–4).

DETERMINE PROJECT STRUCTURE:

Detect the project type and tech stack by reading config files:

1. Look for monorepo indicators: backend/ + mobile/, packages/, apps/ directories.
2. Look for pubspec.yaml (Flutter/Dart project).
3. Look for package.json (Node.js / JavaScript / TypeScript project).
4. Look for Cargo.toml (Rust), go.mod (Go), pyproject.toml / requirements.txt (Python),
   Gemfile (Ruby), pom.xml / build.gradle (Java/Kotlin).
5. Look for docker-compose.yml, Dockerfile, infrastructure/ or deploy/ directories.
6. Look for .github/workflows/ or CI config files.
7. Look for existing README.md — read it to understand what already exists.

Store the detected stack as PROJECT_TYPE for all subsequent phases.

## Phase 1: Deep Codebase Discovery

Read the project thoroughly to extract documentation-worthy information.
Do NOT guess — only document what you can confirm from the code.

Start with the bundled fact collector, which reads the manifests, env templates, CI and deploy
files and counts test files exactly:

```bash
python3 ~/.claude/skills/readme/scripts/project_facts.py <PROJECT_DIR>
```

It prints name, version, description, license, repository, runtime versions, scripts,
dependency lists, env var names from `.env.example`-style templates (never real `.env` files),
CI/deploy files, source files by extension and the test file count. Use its output for
Steps 1.1, 1.2, 1.4, 1.5 and 1.6, then read the code for everything it cannot know
(architecture, purpose, features). If the script is missing (the CLI installs only SKILL.md),
download it from https://raw.githubusercontent.com/tinh2/skills-hub-registry/main/docs/readme/scripts/project_facts.py
or gather the same facts by hand with the steps below.

### Step 1.1 Project Identity

- Read the primary config file (pubspec.yaml, package.json, Cargo.toml, pyproject.toml, go.mod).
- Extract: project name, version, description, license, homepage/repository URL.
- Read any existing README.md, CONTRIBUTING.md, or docs/ directory.

### Step 1.2 Dependencies & Tech Stack

- Extract key dependencies and categorize them:
  - Framework (e.g. Flutter, React, Express, Fastify, Django)
  - State management (e.g. Riverpod, Redux, Vuex)
  - Database (e.g. PostgreSQL, Firestore, MongoDB, SQLite)
  - Auth (e.g. Firebase Auth, Passport, NextAuth)
  - Testing (e.g. Jest, pytest, flutter_test)
  - Other notable libraries (routing, HTTP client, storage, logging)
- Note minimum language/runtime versions (e.g. Dart SDK, Node.js, Python), taken from engines/sdk/requires-python fields.

### Step 1.3 Architecture & Code Organization

- Read the top-level directory structure.
- For each major directory (e.g. lib/, src/, app/), read its subdirectories.
- Identify the architectural layers:
  - Models / entities / domain objects
  - Services / repositories / data access
  - State management / providers / controllers
  - UI / screens / pages / components
  - Routes / navigation
  - Config / constants / theme
  - Tests
- Read the router/navigation config to understand the screen/page map.
- Read the entry point (e.g. main.dart, index.ts, app.py) to understand initialization.

### Step 1.4 Configuration & Environment

- Look for .env.example, .env.template, or environment variable references.
- Look for Firebase config (firebase.json, google-services.json references).
- Look for API base URLs, feature flags, or build flavors.
- Identify required external services (databases, APIs, cloud services).

### Step 1.5 Build, Run & Deploy

- Identify build commands from config files and scripts.
- Look for Makefile, scripts/ directory, or package.json scripts.
- Look for CI/CD config (.github/workflows/, Jenkinsfile, .gitlab-ci.yml, .circleci/).
- Look for deployment config (Dockerfile, serverless.yml, app.yaml, terraform/, fly.toml, vercel.json).
- Look for platform-specific setup (ios/, android/, web/ directories for Flutter).

### Step 1.6 Testing

- Identify test directories and test runner configuration.
- Count test files to give a sense of coverage.
- Note any test commands or scripts.

## Phase 2: Generate README

Write a README.md to the project root with the following structure.
Omit any section for which Phase 1 found no content in the codebase.
Use one heading per section, paragraphs of at most 3 sentences, and bullet lists for 3+ parallel items.

Read `references/readme-template.md` before writing; it has the full section-by-section structure (title and one-line summary, Overview, Screenshots, Tech Stack, Architecture, Project Structure, Getting Started with prerequisites/installation/configuration/running, Testing, Building for Production, Deployment, Key Features, Contributing, License) and what goes in each. Fallback: download https://raw.githubusercontent.com/tinh2/skills-hub-registry/main/docs/readme/references/readme-template.md to a file and read it.

## Phase 3: Adapt & Refine

After generating the initial README:

### Step 3.1 Verify Accuracy

Re-read the key config files and compare against what you wrote.
Every command, path, and technology mentioned must be confirmed in the code.
Remove anything you are not confident about.

### Step 3.2 Adapt to Project Type

- **Flutter app**: Include iOS/Android/web platform setup, `flutter pub get`,
  `flutter run`, `flutter test`, `flutter build` commands.
- **Node.js backend**: Include `npm install`, `npm run dev`, `npm test`, database
  setup, migration commands.
- **Monorepo**: Document each package/app separately with cross-references.
- **Python**: Include virtualenv setup, `pip install`, `pytest` commands.
- **Rust**: Include `cargo build`, `cargo test`, `cargo run` commands.
- Add any project-specific sections that are important but not in the template
  (e.g., "Firebase Setup" for a Firebase project, "Database Migrations" for
  a project with Prisma/Alembic).

### Step 3.3 Tone & Readability Pass

- Use active voice and present tense.
- Keep sentences short (under 20 words where possible).
- Use consistent formatting (all headers sentence case or title case, not mixed).
- Ensure code blocks specify the language for syntax highlighting.
- Remove any filler phrases ("In order to", "It should be noted that").
- Verify the markdown renders: every table row has the header's column count, every code fence is closed, and every relative link points to an existing file. `project_facts.py --check-tables README.md` checks the table rows.

## Phase 4: Write File

Write the final README.md to the project root directory.

If a README.md already exists:
- Read it first.
- Preserve any content the user manually wrote that is still accurate
  (custom badges, specific deployment notes, contributor lists).
- Replace auto-generated sections with updated versions.
- If unsure whether content was manual or generated, keep it and integrate.

## Phase 5: API Documentation (mode: api)

Generate API reference documentation. Only runs when the user requests API docs.

### Step 5.1 Discover Endpoints / Public Interface

- For HTTP APIs: find route definitions, controller files, and handler functions.
  Extract method, path, parameters, request body schema, response schema, and
  status codes from the code. Check for OpenAPI/Swagger specs and use them if present.
- For libraries/SDKs: find exported modules, public classes, and public functions.
  Extract signatures, parameter types, return types, and doc comments.

### Step 5.2 Generate API Reference

Write an API.md (or docs/API.md if a docs/ directory exists) with this structure:

Use the template in `references/api-template.md` (authentication, then each endpoint or method with parameters, request/response and status codes). Fallback: download https://raw.githubusercontent.com/tinh2/skills-hub-registry/main/docs/readme/references/api-template.md to a file and read it.

### Step 5.3 Verify and Write

Cross-check every documented endpoint against the actual route definitions.
Remove anything not confirmed in the code. Write the file.

## Phase 6: Changelog Generation (mode: changelog)

Generate a changelog from git history. Only runs when the user requests a changelog.

### Step 6.1 Read Git History

- Run `git log` to read commit history.
- If a CHANGELOG.md exists, read it to find the last documented version/date.
  Only generate entries for commits after that point.
- If no CHANGELOG.md exists, generate from the full history (or last 100 commits
  for large repos).

### Step 6.2 Categorize Commits

Group commits into categories based on commit message prefixes and content:
- **Added** — new features, new files, new capabilities
- **Changed** — modifications to existing features, refactors
- **Fixed** — bug fixes
- **Removed** — deleted features, deprecated code removal
- **Security** — security-related changes
- **Infrastructure** — CI/CD, build, deployment changes

Use conventional commit prefixes (feat, fix, refactor, chore, docs, test, perf) when
present. Fall back to analyzing the commit message content when prefixes are absent.

### Step 6.3 Generate Changelog

Write a CHANGELOG.md following the Keep a Changelog format:

```markdown
# Changelog

## [Version or Date] - YYYY-MM-DD

### Added
- Description of new feature (commit hash)

### Changed
- Description of change (commit hash)

### Fixed
- Description of fix (commit hash)
```

Group by version tag if tags exist, otherwise group by date (weekly or monthly
depending on commit density). Include short commit hashes as references.
Skip merge commits and trivial commits (typo fixes, formatting-only changes).

### Step 6.4 Write File

Write CHANGELOG.md to the project root. If one exists, prepend new entries
above existing content, preserving the old entries.

## Self-Healing Validation (Max 2 Iterations)

After producing documentation, validate completeness:

1. Verify all required sections are present and non-empty.
2. Verify every internal link and anchor resolves to an existing file or heading.
3. Verify no placeholder text remains ("{TODO}", "[TBD]", "...", "etc.").
4. Verify code examples are syntactically valid.

IF VALIDATION FAILS:
- Identify which sections are incomplete or contain placeholders
- Re-generate only the deficient sections
- Repeat up to 2 iterations

## Self-Evolution Telemetry

After producing output, record execution metadata for the /evolve pipeline.

Check if a project memory directory exists:
- Look for the project path in `~/.claude/projects/`
- If found, append to `skill-telemetry.md` in that memory directory

Entry format:
```
### /readme — {{YYYY-MM-DD}}
- Outcome: {{SUCCESS | PARTIAL | FAILED}}
- Self-healed: {{yes — what was healed | no}}
- Iterations used: {{N}} / {{N max}}
- Bottleneck: {{phase that struggled or "none"}}
- Suggestion: {{one-line improvement idea for /evolve, or "none"}}
```

Only log if the memory directory exists. Skip silently if not found.
Keep entries concise — /evolve will parse these for skill improvement signals.

## Strict Rules

- Do NOT guess. Only document what you can verify from the actual code.
- Do NOT include placeholder URLs like "https://example.com" — use angle brackets
  like `<repo-url>` to indicate values the user should fill in.
- Do NOT include secrets, API keys, or credentials even as examples.
- Do NOT pad the README with generic content. Every line should be specific to
  this project.
- Do NOT add emojis to headings or content.
- Do NOT over-document. A scannable README is better than a comprehensive wall of text.
- Keep the total README under 300 lines. Brevity is a feature.
- Use fenced code blocks with language identifiers for all commands and code.
- Write for a developer who is new to the project but experienced in the tech stack.

NEXT STEPS:

After generating documentation:
- "Run `/ux` to audit the application's UX and accessibility."
- "Run `/qa` to run full automated testing and verification."
- "Run `/iterate-review` to review and improve the codebase."
---

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.