From DevFlow
Bootstraps internal developer documentation when the docs directory is empty, missing, or poorly organized. Loads a consumer prompt extension if available.
How this skill is triggered — by the user, by Claude, or both
Slash command
/devflow:docs-bootstrap-internalThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> **Configuration:** Read the internal documentation path from `.devflow/config.json` using: `"${CLAUDE_SKILL_DIR:-<absolute skill base directory this runner reports in context>}"/../../scripts/config-get.sh .docs.internal docs/internal/`. The helper falls back to `docs/internal/` when the config file is missing or the key is absent. Use the result as `[[INTERNAL_DOC_LOCATION]]` throughout this...
Configuration: Read the internal documentation path from
.devflow/config.jsonusing:"${CLAUDE_SKILL_DIR:-<absolute skill base directory this runner reports in context>}"/../../scripts/config-get.sh .docs.internal docs/internal/. The helper falls back todocs/internal/when the config file is missing or the key is absent. Use the result as[[INTERNAL_DOC_LOCATION]]throughout this skill.
Portable helper anchor (single-statement). The bundled-helper commands in this skill resolve the skill directory inline at each call site via ${CLAUDE_SKILL_DIR:-<absolute skill base directory this runner reports in context>}. When $CLAUDE_SKILL_DIR is set and non-empty (Claude Code), run each command exactly as written. On a runner where it is unset or empty, replace the placeholder with the skill base directory the runner reports in context (e.g. a Base directory for this skill: line) before running the command; if that reported path is Windows-form (C:\...), first convert it to this shell's POSIX form with one standalone wslpath -u '<path>' (WSL) or cygpath -u '<path>' (Git Bash/MSYS2) command and substitute the printed result only if the command succeeds and prints a non-empty path — otherwise fall through to the drive-letter rules exactly as if the tool were absent, the same success-and-non-empty acceptance the platform's path-normalization rules apply (if neither tool exists: lowercase the drive letter, map C:\ to /mnt/c on WSL or /c on MSYS2, and turn backslashes into /; if the environment is neither WSL nor MSYS2, use the path unchanged and report that it could not be normalized — the same arm the platform's path-normalization rules take). Resolve the anchor inline at every call site — never capture it into a shell variable that a later statement reads, because some runners' inline-bash marshaling drops such variables (observed on Copilot CLI). If neither $CLAUDE_SKILL_DIR nor a runner-reported base directory is available, stop and report that the helper anchor could not be resolved rather than running a command with a broken path.
Consumer prompt extension (load first). Before doing this skill's work, load any consumer-supplied prompt extension for this skill and honor it. From the repo root, run:
"${CLAUDE_SKILL_DIR:-<absolute skill base directory this runner reports in context>}"/../../scripts/load-prompt-extension.sh docs-bootstrap-internal
If the invocation fails because the helper path does not exist (No such file, exit 127, or the platform equivalent), that is the anchor-resolution failure described in the Portable helper anchor note above — fix the anchor, don't report a missing extension. Otherwise, if the helper exits non-zero, a consumer extension exists but could not be loaded — surface its stderr message and do not silently proceed as if none existed. If it exits 0 and prints text, treat that text as additional instructions appended to the end of this skill's own prompt for this run — it is upgrade-safe, consumer-owned customization committed under .devflow/prompt-extensions/. If it exits 0 and prints nothing, proceed unchanged.
You are an AI Documentation Bootstrap Agent for code repositories. Your task is to analyze the codebase and create a well-organized internal documentation directory structure with high-quality initial content. The directory structure you create will be used by /docs-sync-internal in future runs to maintain documentation as code changes.
Primary goal: Create a domain-based categorization through subdirectories — not a mirror of the code's directory structure.
Organize by business domain and feature area, not by technical layer.
Wrong (mirrors code structure):
docs/internal/backend/
docs/internal/frontend/
docs/internal/api/
docs/internal/cron/
docs/internal/plugins/
Right (domain-based):
docs/internal/orders/
docs/internal/customers/
docs/internal/authentication/
docs/internal/integrations/
docs/internal/setup/
Why: Developers look for docs about the feature they're working on ("how do orders work?"), not the code layer ("what's in the backend directory?"). A single feature like "orders" spans backend classes, frontend components, API endpoints, and database tables — its documentation should be in one place.
Use one level of subdirectories under [[INTERNAL_DOC_LOCATION]]. No nesting.
Wrong: docs/internal/integrations/payments/stripe/
Right: docs/internal/integrations/ (with files like payment-stripe.md)
Why: Flat structures are easier to navigate, easier for /docs-sync-internal to manage, and prevent category proliferation.
Create the directory structure and a few high-quality seed documents per category. Do not create 50 stub files with placeholder content. A well-organized empty structure with 5-10 thorough documents is more valuable than 50 files that say "TODO."
Check what documentation already exists:
find [[INTERNAL_DOC_LOCATION]] -type f -name "*.md" 2>/dev/null | head -50
find [[INTERNAL_DOC_LOCATION]] -type d 2>/dev/null
If documentation already exists, this is a reorganization task, not a creation task. Preserve existing content — move files into the new structure rather than overwriting them.
Survey the codebase to identify feature domains. Use these signals:
Run exploratory commands:
# Understand the project
cat CLAUDE.md | head -100
# Top-level structure
ls -d */
# Database tables (if schema files exist)
find . -name "*.sql" -o -name "*.schema" | head -10
# Page controllers / routes
find . -path "*/pages/*" -o -path "*/routes/*" -o -path "*/controllers/*" | head -20
# Configuration and integrations
find . -name "*.config.*" -o -name "*.yml" -o -name "*.yaml" | grep -v node_modules | head -10
Based on your analysis, create a categorization plan. Categories should be:
Standard categories that apply to most projects (use if relevant):
| Category | When to include |
|---|---|
architecture/ | Always — system overview, design patterns, key abstractions |
setup/ | Always — development environment, build steps, configuration |
database/ | If the project has a database |
api/ | If the project exposes APIs |
authentication/ | If the project has auth/permissions |
integrations/ | If the project connects to external services |
Domain-specific categories (derived from your codebase analysis):
These are the categories unique to this project's business domain. For an e-commerce platform, these might be orders/, customers/, products/, shipping/. For a CMS, these might be content/, publishing/, media/. Name them after what the business calls them, not what the code calls them.
Create all subdirectories and add .gitkeep files so empty directories can be committed to git:
mkdir -p [[INTERNAL_DOC_LOCATION]]/{category1,category2,category3,...}
find [[INTERNAL_DOC_LOCATION]] -type d -empty -exec touch {}/.gitkeep \;
The .gitkeep files will be automatically superseded as seed documents and future documentation are added to each directory.
For each category, create 1-3 seed documents that cover the most important topics. Prioritize:
Seed document quality standards:
src/server.py, never append line numbers (line numbers change as code evolves)[[INTERNAL_DOC_LOCATION]] if any docs already existDo not commit the changes. Leave committing to the caller.
| Mistake | Why it's wrong | What to do instead |
|---|---|---|
| Mirror the code directory tree | Developers look for features, not layers | Group by business domain |
| Create nested subdirectories | Hard to navigate, hard for sync skill to manage | Keep it flat — one level deep |
| Create 50 stub files | Empty files add noise, not value | Create structure + 5-10 quality seeds |
| Ignore existing docs | Overwrites previous work | Audit first, reorganize existing content |
| Name categories after frameworks | react/, php/, mysql/ are layers, not domains | Name after what the business calls them |
Create a catch-all misc/ or guides/ | Becomes a junk drawer | Every doc should fit a specific category |
Before completing, verify:
[[INTERNAL_DOC_LOCATION]][[INTERNAL_DOC_LOCATION]] boundariesnpx claudepluginhub the01geek/devflow-autopilot --plugin devflowOrganizes project documentation into intent-based structure (BUILD/FIX/UNDERSTAND/LOOKUP) by auditing files and creating directories. Use for new projects, chaotic docs, or navigation issues.
Generates initial documentation from codebase analysis when a project has no docs/ directory. Triggers on 'init docs', 'generate docs', or empty docs/.