Slash Command

/docs-readme

Install
1
Install the plugin
$
npx claudepluginhub Shavakan/claude-marketplace --plugin shavakan-commands

Want just this command?

Add to a custom plugin, then install with one command.

Description

Generate/update condensed developer README for project usage and contribution

Command Content

README Generator

Create/update README.md in project root. Constraints: < 200 lines, scannable in 30 seconds, technical tone (no marketing).

Additional Instructions

$ARGUMENTS


Analysis Phase

Check files in order, record findings:

  1. flake.nix → Nix flake present (Y/N)
  2. .envrc + .envrc.example → direnv present (Y/N)
  3. Makefile → Make targets available (Y/N)
  4. package.json / pyproject.toml / go.mod / Cargo.toml → Language ecosystem
  5. Existing README.md → Preserve badges, screenshots, custom sections
  6. Entry points → main.py, index.ts, cmd/main.go, etc

Build System Priority

Select primary build interface based on presence:

PrioritySystemWhenCommands
1Nixflake.nix existsnix develop, nix build, nix run
2MakeMakefile existsmake install, make test, make build
3Package managerpackage.json / Cargo.tomlnpm install, cargo build
4DirectNone abovepython -m, go run, etc

If multiple exist: Use highest priority as primary, mention others as alternatives.

Environment Management

If .envrc exists:

  • Prerequisites: Add "direnv" requirement
  • Install step: Add cp .envrc.example .envrc && direnv allow
  • Configuration section: Reference .envrc.example for variables

If no direnv:

  • Use .env files or manual export commands
  • Configuration section: List env vars inline

README Composition

Required sections (generate in order):

1. Title + Summary

# [Project Name]
> [Single sentence: does X for Y users]

2. Quick Start

Prerequisites: List tools with versions. Omit language version if Nix manages it. Include Nix/direnv if detected.

Install: Commands to get dependencies. Prioritize by build system table above.

Run: Command to start/execute. Include port/URL for web apps.

Test: Command to run tests. Use nix flake check if available.

3. Project Structure

Tree diagram of key directories with inline comments:

src/
  core/       # Business logic
  api/        # Endpoints
tests/        # Test suite

4. Development

Setup: Additional dev steps (direnv, pre-commit hooks, etc)

Build/Lint/Format: Commands using primary build system

Common tasks: 2-3 bullet points for frequent operations

5. Optional Sections (include only if applicable)

Architecture: 2-3 sentences on design decisions and tradeoffs. Include if non-obvious.

Configuration: Env vars with descriptions. Required vs optional. Include if app needs config.

Deployment: Deploy command or link. Include for deployable apps.

Contributing: Link to CONTRIBUTING.md or inline if < 5 rules.

License: License type. Include if LICENSE file exists.

Output Format Rules

Command syntax:

  • Multi-word commands: Always use code blocks, never inline
  • Good: "Run:\nbash\nnpm run dev\n"
  • Bad: "Run npm run dev"

Section length: Each section < 15 lines. Link to detailed docs if longer.

Style: Technical, direct. Explain WHY for architecture, not WHAT code does. No "easy", "simple", "just".

Preservation: Keep existing badges, screenshots, unique sections from old README.

Project Type Adaptations

TypeAdaptations
CLI toolAdd "Usage" with examples, omit "Running"
LibraryAdd "Installation" + "Usage" with API examples, omit "Running"
Web appInclude PORT/URL in "Run", add "Deployment"
MonorepoShow workspace structure, document per-package commands
Nix multi-outputAdd nix flake show output, document available apps/packages

Execution Workflow

  1. Run analysis phase → Collect build system, env management, project type
  2. Generate README content using composition rules
  3. Show preview with summary: "[Project type] with [build system]. README uses [commands]. ~[N] lines."
  4. If approved → Write to README.md
  5. If rejected → Ask what to change, regenerate from step 2

Edge Cases

No build system found: Use direct language commands (python, go run, etc) and warn in preview.

Nix without devShell: Use nix-shell or nix develop with warnings about flake completeness.

Multiple entry points: List all in "Run" section with descriptions.

Secrets in .envrc: Never read actual .envrc, only .envrc.example. Remind about .gitignore.

Example Execution

Input: "Generate README"

Analysis:

  • flake.nix: Yes (Nix development shell + app)
  • .envrc: Yes (with .envrc.example)
  • Makefile: Yes (install/test/build targets)
  • package.json: Yes (Next.js)
  • Entry: pages/index.tsx

Build priority: Nix (priority 1), mention Make as fallback

Preview: "Next.js web app with Nix flake and direnv. README uses nix run for primary interface, notes make commands as alternative. Includes .envrc.example setup. ~90 lines. Approve?"

Output: README.md with Nix-first commands, direnv setup, project structure showing pages/ and components/, development section with nix build and nix flake check.

Stats
Stars2
Forks1
Last CommitNov 20, 2025
Actions

Other plugins with /docs-readme