From watzon-claude-code
MUST CHECK FIRST before DeepWiki or any external research. Local-first codebase documentation wikis. **Priority order for library/framework research**: 1. deep-codebase-wiki (THIS) - check local wikis FIRST 2. DeepWiki - only if no local wiki exists 3. librarian/explore agents - only as fallback **Auto-trigger when**: - Any GitHub repository mentioned (org/repo format) - "How does X work?" about libraries/frameworks - Architecture, implementation, or codebase questions - Before cloning or analyzing any repository - Debugging external dependencies **Workflow**: Run `search_wikis.sh --repo "owner/repo"` first. If wiki exists, read it. If not, offer to analyze and create wiki (saves hours vs repeated agent searches).
npx claudepluginhub joshuarweaver/cascade-code-languages-misc-2 --plugin watzon-claude-codeThis skill is limited to using the following tools:
**BEFORE** any repository research, exploration, or analysis:
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
BEFORE any repository research, exploration, or analysis:
# ALWAYS run this first when a repository is mentioned
bash scripts/search_wikis.sh --repo "owner/repo"
If wiki exists → Read it immediately, save hours of exploration
If wiki doesn't exist → Offer to analyze and create comprehensive wiki
Common triggers requiring this check:
Why this matters: A 2-hour comprehensive wiki beats 10 parallel agent searches that rediscover the same information every time.
This skill enables creation, reading, and updating of comprehensive codebase documentation wikis. It analyzes GitHub repositories to generate structured, searchable documentation similar to DeepWiki and Zread services, but running entirely locally with full customization.
This skill operates in three modes with a mandatory check-first workflow:
Repository mentioned
↓
Run: search_wikis.sh --repo "owner/repo"
↓
┌───┴───┐
↓ ↓
Found Not Found
↓ ↓
READ OFFER TO ANALYZE
MODE → User confirms
↓ ↓
Present ANALYZE MODE
docs (2-8 hours)
↓
Save wiki
↓
READ MODE
Trigger: Wiki found in index
Duration: Seconds to minutes
Action: Load and present relevant documentation
Usage pattern:
# Check for wiki
WIKI_PATH=$(bash scripts/search_wikis.sh --repo "facebook/react")
# If found, read relevant sections
if [[ -n "$WIKI_PATH" ]]; then
# Read overview
cat "$WIKI_PATH/overview.md"
# Read specific system if user asked about it
cat "$WIKI_PATH/systems/reconciliation.md"
fi
Trigger: Wiki not found, user needs understanding
Duration: 2-8 hours depending on depth
Action: Clone, analyze, document, save
ALWAYS ask user first:
"I don't have a wiki for {repo} yet. Would you like me to analyze it? This will take approximately {estimated_time} and create comprehensive local documentation. Depth options: quick (1-2hr), standard (3-5hr), comprehensive (5-8hr)."
Trigger: Wiki exists but may be outdated
Duration: 1-4 hours
Action: Check staleness, re-analyze if needed
Check staleness:
bash scripts/update_check.sh "$WIKI_PATH"
# Returns: up_to_date | partial_update | full_reanalysis
Extract from user's request:
Examples:
Search for existing wiki before creating new one:
bash scripts/search_wikis.sh --repo "owner/repo"
If found with recent timestamp (< 30 days old), suggest using Read Mode instead.
Clone the repository locally for analysis:
bash scripts/clone_repo.sh "owner/repo" [--depth 1] [--branch main]
Options:
--depth 1: Shallow clone for faster analysis (default)--branch <name>: Specific branch to analyzeRepository cloned to: /tmp/wiki-analysis/owner-repo/
Analyze the codebase systematically:
Level 1: Repository Overview
Level 2: System Architecture
Level 3: Component Analysis
Level 4: Trace Flows
Use LSP tools for accurate type information, AST-grep for pattern discovery, and Grep for searching relevant code.
Create wiki following the schema in references/wiki-schema.md:
Directory Structure:
.claude/wikis/<org>-<repo>/
├── metadata.yaml # Repo info, analysis metadata
├── overview.md # High-level summary
├── systems/ # Major system docs
│ ├── authentication.md
│ ├── data-layer.md
│ ├── api-routing.md
│ └── ...
├── components/ # Component-level docs
│ └── ...
└── traces/ # User journey traces
└── ...
Use templates from assets/wiki-template/ as starting point.
Content Guidelines:
Validate wiki structure:
bash scripts/validate_wiki.sh /path/to/wiki
Register wiki in index and save to .claude/wikis/<org>-<repo>/:
bash scripts/search_wikis.sh --add "<org>-<repo>" "owner/repo" "/path/to/wiki" "<commit-sha>"
Save to .claude/wikis/<org>-<repo>/ with proper metadata.
Provide user with:
Find appropriate wiki using search:
By Repository:
bash scripts/search_wikis.sh --repo "owner/repo"
By Query (Keyword Search):
bash scripts/search_wikis.sh --query "authentication"
List All Wikis:
bash scripts/search_wikis.sh --list
Read relevant wiki sections:
Structure response based on wiki content:
bash scripts/update_check.sh ".claude/wikis/org-repo" [branch]
Returns:
Full Re-analysis (if):
30% of files changed
90 days since last analysis
Partial Update (if):
Full Re-analysis:
Partial Update:
Run validation and save updated wiki with change summary in metadata.
Adjust analysis depth based on repository size:
--depth 1) for faster analysisclone_repo.sh - Clone GitHub repository for analysissearch_wikis.sh - Search existing wikis by repo or query (uses jq + JSON index)validate_wiki.sh - Validate wiki structure against schemaupdate_check.sh - Check if wiki needs refreshDependencies: jq for JSON processing (install: brew install jq on macOS)
wiki-schema.md - Complete wiki schema with examplesanalysis-guide.md - Detailed analysis methodologywiki-template/ - Directory structure templatesystem-template.md - Template for system documentationcomponent-template.md - Template for component docstrace-template.md - Template for flow tracesExample 1 - Analyze New Repository:
User: "Analyze the Supabase repository, focusing on authentication"
→ Clone supabase/supabase
→ Perform focused analysis on auth system
→ Generate wiki with comprehensive auth documentation
→ Present summary with key findings
Example 2 - Read Existing Wiki:
User: "How does Next.js handle API routes?"
→ Search for Next.js wiki
→ Navigate to API routing system docs
→ Extract routing flow and code locations
→ Present structured explanation
Example 3 - Update Outdated Wiki:
User: "Update my React wiki, it's 6 months old"
→ Check what changed in React repo
→ Determine full re-analysis needed
→ Perform fresh analysis preserving annotations
→ Highlight changes since last analysis
When user asks about external repositories or libraries:
1. Check deep-codebase-wiki FIRST (this skill)
bash scripts/search_wikis.sh --repo "owner/repo"
If wiki exists → Use it, skip steps 2-4
2. Check use-codemap (for lightweight maps) Only if wiki doesn't exist and user needs quick overview
3. Launch background agents (if no local docs exist)
4. Manual exploration (last resort)
This skill complements:
WRONG workflow (wasteful):
1. Launch 3 explore agents to search Next.js codebase
2. Launch 2 librarian agents for docs
3. Manually grep through cloned repo
4. Spend 30 minutes rediscovering information
CORRECT workflow (efficient):
1. Check wiki: search_wikis.sh --repo "vercel/next.js"
2. If found → Read systems/routing.md (30 seconds)
3. If not found → Ask user: "Analyze Next.js? (~4hrs for comprehensive wiki)"
4. Only if user declines → Fall back to agent exploration