From s-skills
Analyzes a project codebase, interviews the user for missing context, and generates a standardized docs/ structure: prd.md, architecture.md, UI_GUIDE.md (frontend only), STATUS.md, adr/, spec/. Also runs the test suite and scores the project 0-100. Invoke with /docs-organize in any project directory.
How this skill is triggered — by the user, by Claude, or both
Slash command
/s-skills:docs-organizeThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate and maintain project documentation with a project health score.
Generate and maintain project documentation with a project health score.
Do NOT write any docs file until the interview phase is complete. Analysis first, gaps identified, interview done — then write.
Follow these phases in order. Do not skip.
Before any writes: if docs/STATUS.md already exists, read and save the current Score line value (e.g. 72 / 100). Use this saved value in Phase 5 delta calculation. If it doesn't exist, note prev: n/a.
Read the following in order:
find . -maxdepth 3 -not -path '*/node_modules/*' -not -path '*/.git/*' -not -path '*/dist/*' -not -path '*/.next/*'package.json, go.mod, requirements.txt, Cargo.toml, build.gradle, pom.xml — whichever existREADME.md or README*docs/ contents if presentFrom this analysis, extract:
Before skipping this phase, you MUST be able to answer ALL four of the following from code analysis alone. If even one is unknown, ask it.
Required checklist (must answer all before skipping):
Ask only what you cannot answer. One question at a time using AskUserQuestion. Maximum 5 questions. Default: ask at least 1 question unless all four are unambiguously answered.
Write each file. If a file already exists in docs/, update it — do not overwrite content that looks intentional.
# Product Requirements
## Problem
[What problem this solves — 2-3 sentences]
## Target Users
[Who uses this and why]
## Features (in scope)
[Bullet list of confirmed features, inferred from code + interview]
## Out of Scope
[What this explicitly does NOT do]
## Success Metrics
[How success is measured — infer or note "TBD with team"]
# Architecture
## Overview
[1 paragraph — what this system does and how]
## Tech Stack
| Layer | Technology |
|-------|-----------|
| [layer] | [tech] |
## Key Decisions
[Bullet list of major technical choices and why — infer from code]
## Data Flow
[Describe the main data flow in plain text or simple ASCII]
## Constraints
[Performance, security, compliance, or other hard constraints]
# UI Guide
## Design Direction
[Visual style / mood — infer from existing CSS/components or note "not yet defined"]
## Color Palette
[Infer from CSS variables, Tailwind config, or theme files. Format as CSS custom properties.]
## Typography
[Font families and scale — infer from config or CSS]
## Spacing & Layout
[Grid system and spacing tokens — infer from Tailwind/CSS config]
## Component Patterns
[Key components, their variants — infer from components directory]
## Motion
[Animation principles — infer from existing animations or note "not yet defined"]
## Do Not
[Anti-patterns specific to this project — infer from existing code style]
# Project Status
**Last updated:** [YYYY-MM-DD]
**Score:** [X] / 100 _(prev: n/a)_
## Score Breakdown
| Dimension | Score | Max | Notes |
|------------------------|-------|-----|-------|
| Documentation | [X] | 25 | [brief reason] |
| Feature completion | [X] | 25 | [test results] |
| Code quality | [X] | 25 | [brief reason] |
| Infra / deploy readiness | [X] | 25 | [brief reason] |
| **Total** | **[X]** | **100** | |
## Test Results
Runner: [detected runner or "none found"]
Passed: X / Failed: X / Skipped: X
## Milestones
| Name | Target | Status |
|------|--------|--------|
| [infer from README or note "not defined"] | — | 🔴 todo |
## Features
| Feature | Status | Notes |
|---------|--------|-------|
[Populate from PRD features list — default all to "todo". Feature-level status requires manual update; test score reflects overall completion rate.]
## Technical Debt
| Item | Priority | Added |
|------|----------|-------|
[Scan code for TODO/FIXME comments and list them here. Max 10 items.]
## Infrastructure
| Item | Status |
|------|--------|
| CI/CD | [check for .github/workflows, .gitlab-ci.yml, etc.] |
| Env vars | [check for .env.example] |
| DB / storage | [infer from code] |
| Monitoring | [infer from code] |
If CLAUDE.md already exists: append a ## Docs Reference section only if it doesn't exist yet. Do not overwrite existing content.
If CLAUDE.md does not exist: create it.
# [Project Name]
## Project Summary
[One paragraph — inferred from analysis + interview]
## Tech Stack
[List from architecture.md]
## Conventions
- [Infer from code: naming patterns, file structure, patterns in use]
## Do Not
- [Hard constraints visible in code or stated in interview]
## Docs Reference
- [PRD](docs/prd.md)
- [Architecture](docs/architecture.md)
- [Status & Score](docs/STATUS.md)
- [UI Guide](docs/UI_GUIDE.md) ← include only if frontend detected
- [ADR](docs/adr/)
- [Specs](docs/spec/) ← created on first spec request
[Specs](docs/spec/) ← created on first /docs-organize spec request.Detect the test runner by checking (in order):
package.json → look for scripts.test, jest/vitest configpytest.ini / pyproject.toml / setup.cfg → pytestgo.mod → go testCargo.toml → cargo testbuild.gradle / pom.xml → gradle test / mvn testRun the detected test suite. Capture:
If no test runner found: note "no tests found" in STATUS.md, feature score = 0.
If tests fail to run (compile error, missing deps): note the error, feature score = 0.
Calculate score for each dimension and update STATUS.md.
If tests exist and ran:
round(passed / total * 25) where total = passed + failedIf no test runner found (fallback — code structure analysis): Score based on how much of the PRD feature list is visibly implemented in code. For each feature in PRD, check if corresponding code exists (routes, handlers, components, models):
Add to STATUS.md Test Results section: Runner: none — scored via code structure analysis
grep -r "TODO\|FIXME" --include="*.ts" --include="*.tsx" --include="*.js" --include="*.py" --include="*.go" --include="*.rs" --include="*.java" --include="*.kt" --include="*.swift" --include="*.rb" --include="*.php" . 2>/dev/null | grep -v node_modules | grep -v ".git" | wc -lRead the previous score from STATUS.md before overwriting. Compute delta and write:
**Score:** 72 / 100 _(prev: 61 → +11)_
If no previous score: _(prev: n/a)_
After writing all files, output a summary to the user:
docs-organize complete.
📁 Files written:
- docs/prd.md
- docs/architecture.md
- docs/UI_GUIDE.md (if frontend detected)
- docs/STATUS.md
- CLAUDE.md (created / updated)
🧪 Tests: X passed / X failed / X skipped
Runner: [name]
📊 Score: XX / 100 (prev: XX → delta: +/-)
Documentation: XX / 25
Feature comp.: XX / 25
Code quality: XX / 25
Infra readiness: XX / 25
⚠️ Issues:
[List any dimension that scored 0 with a one-line reason, or "none" if all scored]
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
Provides a checklist for code reviews covering functionality, security, performance, maintainability, tests, and quality. Use for pull requests, audits, team standards, and developer training.
npx claudepluginhub s0613/s-skills --plugin s-skills