docs-generator
Generate and restructure project documentation into a clear, accessible hierarchy. Use when asked to organize docs, generate documentation, improve doc structure, or restructure README. Don't use for API reference generation from code (JSDoc/Sphinx), authoring a landing page, or agent-config files like CLAUDE.md.
What this skill does
# Documentation Generator Restructure and organize project documentation for clarity and accessibility. ## Prerequisites This skill requires (validate each before starting; if any check fails, stop and ask the user): - **Git working tree**: clean or stashable. Run `git status` first; if dirty, back up via `git stash push -u -m "pre-docs-sync"` before any sync that could rebase or overwrite local changes. - **Tools required**: `git` >= 2.30, a Markdown-aware editor, and `mermaid-cli` (or a renderer) only if diagrams must be exported. Confirm availability with `git --version` and `command -v mmdc`. - **Repo permissions**: read access for analysis; write access only when the user explicitly approves commits. For read-only repos, fall back to emitting a diff or inline summary instead of writing files. - **Branch state**: an `origin` remote that is reachable (`git remote get-url origin`); if missing, do not attempt rebase/pull — ask the user. - **Backups**: confirm the repo is pushed or otherwise backed up before any restructure that deletes or moves doc files. Pair every destructive `rm`/`git mv` with a prior `git status` check and explicit user confirmation; never run `git reset --hard`, `git push --force`, or `rm -rf` without a dry-run preview and user approval. - **Safety defaults**: prefer dry-run previews (`git mv -n`, `rm -i`) and require user confirmation before any irreversible action. If any prerequisite fails, halt and surface the blocker to the user rather than proceeding. ## Repo Sync Before Edits (mandatory) Before creating/updating/deleting files in an existing repository, sync the current branch with remote: ```bash branch="$(git rev-parse --abbrev-ref HEAD)" git fetch origin git pull --rebase origin "$branch" ``` If the working tree is not clean, stash first, sync, then restore: ```bash git stash push -u -m "pre-sync" branch="$(git rev-parse --abbrev-ref HEAD)" git fetch origin && git pull --rebase origin "$branch" git stash pop ``` If `origin` is missing, pull is unavailable, or rebase/stash conflicts occur, stop and ask the user before continuing. ## Workflow ### 0. Create Feature Branch Before making any changes: 1. Check the current branch - if already on a feature branch for this task, skip 2. Check the repo for branch naming conventions by running `git branch -r | head -20` (e.g., `feat/`, `feature/`, etc.) 3. Create and switch to a new branch following the repo's convention, or fallback to: `feat/docs-generator` ### 1. Analyze Project Read the codebase to identify: - **Project type**: Library, API, web app, CLI, microservices - **Architecture**: Monorepo, multi-package, single module - **User personas**: End users, developers, operators - **Existing docs**: Scan for README files, docs/ folder, inline comments, docstrings - **Gaps**: List what documentation exists vs. what is missing ### 2. Restructure Documentation **Root README.md** - Streamline as entry point: - Project overview and purpose - Quickstart (install + first use) - Modules/components summary with links - License and contacts **Component READMEs** - Add per module/package/service: - Purpose and responsibilities - Setup instructions - Testing commands **Centralize in `docs/`** - Organize by category (select applicable): ``` docs/ ├── architecture.md # System design, diagrams ├── api-reference.md # Endpoints, authentication ├── database.md # Schema, migrations ├── deployment.md # Production setup ├── development.md # Local setup, contribution ├── troubleshooting.md # Common issues └── user-guide.md # End-user documentation ``` ### 3. Create Diagrams Use Mermaid for all visual documentation: - Architecture diagrams - Data flow diagrams - Database schemas ### 4. Review and Validate 1. Verify all internal links resolve correctly 2. Check that code examples in docs are syntactically valid 3. Confirm no orphaned docs (files not linked from anywhere) 4. Present a summary of changes to the user before committing Present changes to user for approval. Do not commit unless the user explicitly asks. ## Expected Output After running this skill on a mid-size Node.js API project, you should see: - A clean root `README.md` with project overview, quickstart, module links, and license - Per-package `README.md` files for each service or library - A `docs/` folder with relevant files such as `architecture.md`, `api-reference.md`, `deployment.md`, and `development.md` - Mermaid diagrams embedded in architecture and data-flow docs - A validation summary listing all internal links checked and any gaps found ## Acceptance Criteria A run passes when **all** of the following are true: - [ ] Root `README.md` contains an overview, a quickstart (install + first use), and links to component or `docs/` files. - [ ] A `docs/` directory exists with at least one of: `architecture.md`, `api-reference.md`, `deployment.md`, `development.md` — and only the files relevant to the project type. - [ ] Every internal Markdown link resolves to an existing file (no broken `[text](path)` references). - [ ] No orphaned files: every `docs/*.md` is reachable from `README.md` or another `docs/` page within one hop. - [ ] Mermaid diagrams in architecture or data-flow docs render without syntax errors (`mmdc` validation if available). - [ ] No commits land on `main`/`master`; all changes are on a feature branch following the repo's naming convention. ## Edge Cases - **No existing documentation**: Skill generates from scratch using code analysis. Starts with `README.md` and adds `docs/` files based on project complexity. - **Conflicting or outdated docs**: Flags conflicts to the user. Prefers code-derived information over stale docs; marks outdated sections for review. - **Monorepo with many packages**: Limits per-package README creation to packages with actual public APIs or user-facing functionality; skips auto-generated or build-output packages. - **Private or secret-adjacent content**: Never documents credentials, tokens, or internal-only endpoints beyond what already exists in code comments. - **Read-only repository**: If git write access is unavailable, outputs documentation as a diff or inline summary rather than committing files. ## Step Completion Reports After completing each major step, output a status report in this format: ``` ◆ [Step Name] ([step N of M] — [context]) ·································································· [Check 1]: √ pass [Check 2]: √ pass (note if relevant) [Check 3]: × fail — [reason] [Check 4]: √ pass [Criteria]: √ N/M met ____________________________ Result: PASS | FAIL | PARTIAL ``` Adapt the check names to match what the step actually validates. Use `√` for pass, `×` for fail, and `—` to add brief context. The "Criteria" line summarizes how many acceptance criteria were met. The "Result" line gives the overall verdict. ### Skill-specific checks per phase **Phase: Branch Setup** — checks: `Branch creation`, `Repo sync` **Phase: Project Analysis** — checks: `Project analysis`, `Gap identification` **Phase: Documentation Restructure** — checks: `Doc restructure`, `Diagram creation` **Phase: Validation** — checks: `Validation pass`, `Link verification` ## Error Handling ### No existing documentation found **Solution:** Generate documentation from scratch based on code analysis. Start with README.md and add docs/ files based on project complexity. ### Conflicting or outdated docs **Solution:** Flag conflicts to the user. Prefer code-derived information over stale docs. Mark outdated sections for user review. ## Guidelines - Keep docs concise and scannable - Adapt structure to project type (not all categories apply) - Maintain cross-references between related docs - Remove redundant or outdated content - Preserve any existing docs that are still accurate
Related in Ads & Marketing
ads
IncludedMulti-platform paid advertising audit and optimization skill. Analyzes Google, Meta, YouTube, LinkedIn, TikTok, Microsoft, and Apple Ads. 250+ checks with scoring, parallel agents, industry templates, and AI creative generation.
banana
IncludedAI image generation Creative Director powered by Google Gemini Nano Banana models. Use this skill for ANY request involving image creation, editing, visual asset production, or creative direction. Triggers on: generate an image, create a photo, edit this picture, design a logo, make a banner, visual for my anything, and all /banana commands. Handles text-to-image, image editing, multi-turn creative sessions, batch workflows, and brand presets.
rpg-migration-analyzer
IncludedAnalyzes legacy RPG (Report Program Generator) programs from AS/400 and IBM i systems for migration to modern Java applications. Extracts business logic from RPG III/IV/ILE source code, identifies data structures (D-specs), file operations (F-specs), program dependencies (CALLB/CALLP), and converts RPG constructs to Java equivalents. Generates migration reports, complexity estimates, and Java implementation strategies with POJO classes, JPA entities, and service methods. Use when modernizing AS/400 or IBM i legacy systems, analyzing RPG source files (.rpg, .rpgle, .RPGLE), converting RPG to Java, mapping data specifications to Java classes, planning legacy system migration, or when user mentions RPG analysis, Report Program Generator, RPG III/IV/ILE, AS/400 modernization, IBM i migration, packed decimal conversion, or mainframe application rewrite.
brand-library-architect
IncludedBuild a complete brand library for a product — visual asset render pipeline, brand documentation set (BRAND, COPY, MANIFESTO, BIOS, FAQ, GLOSSARY, TONE, PRICING), open-source convention files (README, CONTRIBUTING, SECURITY, CODE_OF_CONDUCT), and a self-contained press kit. This skill should be used when the user asks to "build a brand library / brand kit / press kit / brand assets" for a product, "set up a brand library workflow," "create a positioning manifesto plus visual identity," or any combination of brand documentation + visual asset pipeline. Apply phase-by-phase or run end-to-end. Templates are product-agnostic and use {{TOKEN}} placeholders the skill prompts the user to fill.
writing-tech-post
IncludedAuthors engineering blog posts end-to-end: launch deep-dives, incident postmortems, architecture migrations, performance case studies, tutorials, AI/agent system writeups, security disclosures, and research-to-product translations. Picks the correct archetype, plans the abstraction ladder, enforces an evidence cadence (diagrams, benchmarks, profiles, traces, code, ablations), tunes voice against publisher house styles (Datadog, Vercel, GitHub, AWS, Meta, Cloudflare, Jane Street), and runs a pre-publish gate for narrative momentum and disclosure ethics. Use when drafting a new engineering post, restructuring a draft that feels flat, deciding which evidence form belongs where, validating that depth and product context are balanced, or preparing a postmortem, migration, or performance narrative for external publication. Do not use for API reference documentation, README authoring, marketing copy, release notes, generic SEO content, ghost-written executive thought leadership, or non-engineering long-form essays.
blog-google
IncludedGoogle API integration for blog performance: PageSpeed Insights, CrUX Core Web Vitals with 25-week history, Search Console performance, URL Inspection, Indexing API, GA4 organic traffic, NLP entity analysis for E-E-A-T, YouTube video search for embedding, and Google Ads Keyword Planner. Progressive feature availability based on credential tier (API key, OAuth/service account, GA4, Ads). Shares config with claude-seo at ~/.config/claude-seo/google-api.json. Use when user says "google data", "page speed", "core web vitals", "search console", "indexation", "GA4", "keyword research", "nlp entities", "blog performance", "youtube search", "google api setup".