Bootstrap a new project's documentation hub by creating the four core documentation files (systemArchitecture.md, keyPairResponsibility.md, glossary.md, techStack.md) with initial content based on...
Bootstrap a new project with a complete documentation hub structure.
Helper Scripts Available:
scripts/validate_hub.py - Validates documentation structurescripts/extract_glossary.py - Extracts domain-specific terms from codescripts/detect_drift.py - Detects existing modules and technologiesAlways run scripts with --help or check scripts/README.md first to understand their usage and output format.
Creates the Documentation Hub file structure in a project's cline-docs/ directory:
project-root/
āāā cline-docs/
āāā systemArchitecture.md # High-level architecture diagrams
āāā keyPairResponsibility.md # Module responsibilities
āāā glossary.md # Domain-specific terms
āāā techStack.md # Technologies used
User wants to set up documentation ā Does cline-docs/ exist?
āā Yes ā Run validation first
ā āā Valid ā Use /document-hub read instead
ā āā Invalid ā Ask user: overwrite or skip?
ā
āā No ā Initialize new hub:
1. Create directory structure
2. Detect technologies (detect_drift.py)
3. Extract glossary terms (extract_glossary.py)
4. Generate initial content
5. Validate result (validate_hub.py)
First, check if a documentation hub already exists:
# Check if cline-docs exists
ls project-root/cline-docs/
# If exists, validate it first
python scripts/validate_hub.py /path/to/project
If validation returns "valid": false with missing files, proceed with initialization.
Use helper scripts to analyze the project:
Detect existing technologies and modules:
python scripts/detect_drift.py /path/to/project
This returns JSON with:
src/package.json/requirements.txtExtract domain-specific terms:
python scripts/extract_glossary.py /path/to/project
This returns ranked terms with context from code comments.
Create the four core files with initial content based on the gathered information.
Templates: starter templates for all four files live in references/templates/ (systemArchitecture.md, keyPairResponsibility.md, glossary.md, techStack.md). Read the relevant template file when creating each doc file.
Use the JSON output from helper scripts to populate initial content:
From detect_drift.py output:
techStack.mdkeyPairResponsibility.mdFrom extract_glossary.py output:
glossary.md alphabeticallyAfter creating initial files, ask the user:
Documentation hub initialized with detected information.
Please provide additional context:
1. What is the primary purpose of this project?
2. Are there any key architectural decisions to document?
3. Any specific modules or workflows that need detailed explanation?
I can update the documentation with your input.
After initialization, always validate:
python scripts/validate_hub.py /path/to/project
Check that:
"valid": trueA full end-to-end Python example of the 6-step workflow is in references/example-initialization.md ā read it if you want a concrete script-driven walkthrough.
validate_hub.py at the endā Don't create documentation without analyzing the codebase first ā Don't overwrite existing valid documentation without user confirmation ā Don't create empty files - populate with at least template structure
ā Do use helper scripts to gather information ā Do validate before and after ā Do ask user for additional context
To initialize BOTH Brain systems in one pass: run this skill (skip if cline-docs/ already has all 4 files), then run /memory-bank-initialize (skip if memory-bank/ already has its 6 files). Re-run either to force re-initialization if a system is present but incomplete.
After initialization:
/document-hub update skillUsage and JSON output shapes for validate_hub.py, detect_drift.py, and extract_glossary.py are in references/script-reference.md ā read it before invoking a script; scripts/README.md has complete documentation.