deep-codebase-wiki
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).
What this skill does
# Deep Codebase Wiki
## ⚡ PROACTIVE CHECK PROTOCOL (CRITICAL)
**BEFORE** any repository research, exploration, or analysis:
```bash
# 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**:
- User mentions any GitHub repo (e.g., "facebook/react", "vercel/next.js")
- Questions like "How does X work?" about known libraries/frameworks
- "Understand the architecture of..."
- "Explain how [library] implements..."
- Before launching multiple explore/librarian agents
- When debugging external dependencies
- Architecture or implementation questions
**Why this matters**: A 2-hour comprehensive wiki beats 10 parallel agent searches that rediscover the same information every time.
---
## Overview
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.
## Quick Start
This skill operates in three modes with a **mandatory check-first workflow**:
### Decision Flowchart
```
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
```
### Mode 1: Read Mode (Search Existing Wikis)
**Trigger**: Wiki found in index
**Duration**: Seconds to minutes
**Action**: Load and present relevant documentation
**Usage pattern**:
```bash
# 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
```
### Mode 2: Analyze Mode (Create New Wiki)
**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)."
### Mode 3: Update Mode (Refresh Documentation)
**Trigger**: Wiki exists but may be outdated
**Duration**: 1-4 hours
**Action**: Check staleness, re-analyze if needed
**Check staleness**:
```bash
bash scripts/update_check.sh "$WIKI_PATH"
# Returns: up_to_date | partial_update | full_reanalysis
```
## Analyze Mode (Create New Wiki)
### Step 1: Determine Repository and Scope
Extract from user's request:
- **Repository**: Owner and repo name (e.g., "facebook/react")
- **Focus areas**: Specific systems or features of interest
- **Depth**: Quick overview vs comprehensive analysis
Examples:
- "Analyze the React repository" → Full analysis
- "How does Next.js routing work?" → Focus on routing system
- "Understand Supabase auth implementation" → Focus on auth module
### Step 2: Check for Existing Wiki
Search for existing wiki before creating new one:
```bash
bash scripts/search_wikis.sh --repo "owner/repo"
```
If found with recent timestamp (< 30 days old), suggest using Read Mode instead.
### Step 3: Clone Repository
Clone the repository locally for analysis:
```bash
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 analyze
Repository cloned to: `/tmp/wiki-analysis/owner-repo/`
### Step 4: Perform Multi-Level Analysis
Analyze the codebase systematically:
**Level 1: Repository Overview**
1. Identify primary language(s) using Glob
2. Locate entry points (main.py, index.js, package.json, etc.)
3. Map directory structure
4. Read README, CONTRIBUTING, and core docs
5. Identify frameworks and major dependencies
**Level 2: System Architecture**
1. Identify major systems/modules (auth, database, API, UI, etc.)
2. Map system boundaries and responsibilities
3. Document key design patterns
4. Identify external dependencies and integrations
**Level 3: Component Analysis**
1. Map important classes, functions, and modules
2. Document component responsibilities
3. Identify relationships and dependencies
4. Note configuration and environment setup
**Level 4: Trace Flows**
1. Trace common user journeys (e.g., login flow, API request)
2. Document data transformation pipelines
3. Map error handling paths
4. Identify security-critical code paths
Use LSP tools for accurate type information, AST-grep for pattern discovery, and Grep for searching relevant code.
### Step 5: Generate Wiki Structure
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:**
- **Accuracy**: Verify all file paths and line numbers
- **Completeness**: Cover all systems in scope
- **Clarity**: Use descriptive headings and examples
- **Cross-references**: Link related systems and components
- **Code snippets**: Include relevant code examples with file paths
### Step 6: Validate and Save
Validate wiki structure:
```bash
bash scripts/validate_wiki.sh /path/to/wiki
```
Register wiki in index and save to `.claude/wikis/<org>-<repo>/`:
```bash
bash scripts/search_wikis.sh --add "<org>-<repo>" "owner/repo" "/path/to/wiki" "<commit-sha>"
```
Save to `.claude/wikis/<org>-<repo>/` with proper metadata.
### Step 7: Present Summary
Provide user with:
1. Wiki location
2. Analysis scope and coverage
3. Key systems identified
4. Notable findings or concerns
5. Recommendations for deep dives
## Read Mode (Search Existing Wikis)
### Step 1: Locate Relevant Wiki
Find appropriate wiki using search:
**By Repository:**
```bash
bash scripts/search_wikis.sh --repo "owner/repo"
```
**By Query (Keyword Search):**
```bash
bash scripts/search_wikis.sh --query "authentication"
```
**List All Wikis:**
```bash
bash scripts/search_wikis.sh --list
```
### Step 2: Load and Analyze Wiki
Read relevant wiki sections:
1. **Check metadata** for freshness and scope
2. **Read overview** for high-level context
3. **Navigate to relevant systems** based on query
4. **Follow cross-references** for related information
5. **Review traces** for flow understanding
### Step 3: Present Findings
Structure response based on wiki content:
1. **Overview**: High-level summary of system/feature
2. **Architecture**: Key components and their roles
3. **Code Locations**: Files and line numbers for navigation
4. **Flows**: Data/process flows relevant to query
5. **Considerations**: Security, performance, or edge cases
6. **Next Steps**: Recommendations for further investigation
## Update Mode (Refresh Documentation)
### Step 1: Check if Update Needed
```bash
bash scripts/update_check.sh ".claude/wikis/org-repo" [branch]
```
Returns:
- Last analysis timestamp
- Current commit SHA vs analyzed commit
- Number of changed files since analysis
- Recommendation: full re-analysis vs partial update
### Step 2: Determine Update Scope
**Full Re-analysis** (if):
- Major refactoring detected
- > 30% of filesRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.