AGENT SKILL

context-daddy

Context management tools for Claude Code - provides intelligent codebase mapping with Python, Rust, and C++ parsing, duplicate detection, and MCP-powered symbol queries. Use this skill when working with large codebases that need automated indexing and context management.

License 许可
MIT
所属仓库
bg-szy/TOP-SKILLS
最近更新
2026-11-15
Stars
★ 6
Forks
0

01 前言 Front Matter

name
context-daddy
description
Context management tools for Claude Code - provides intelligent codebase mapping with Python, Rust, and C++ parsing, duplicate detection, and MCP-powered symbol queries. Use this skill when working with large codebases that need automated indexing and context management.

02 资源文件 10

03 SKILL.md 正文

Context Tools for Claude Code

This skill provides intelligent context management for large codebases through:

  • Repository Mapping: Parses Python, Rust, and C++ code to extract classes, functions, and methods
  • Duplicate Detection: Identifies similar code patterns using fuzzy matching
  • MCP Symbol Server: Enables fast symbol search via search_symbols and get_file_symbols tools
  • Automatic Indexing: Background incremental updates as files change

Using MCP Tools - PRIMARY CODE EXPLORATION METHOD

⚡ DECISION TREE - Ask yourself BEFORE using Grep/Search/Bash:

Am I searching for code symbols (functions, classes, enums, structs, types)?
├─ YES → Use MCP tools (search_symbols / get_symbol_content / get_file_symbols)
│         Example: Finding "enum InstructionData" → search_symbols("InstructionData")
│         Example: Finding "Phi" variant → get_symbol_content("InstructionData")
│
└─ NO → Am I searching for text/comments/strings/config values?
          └─ YES → Use Grep/Search
                   Example: Finding string literals, documentation, JSON values

CRITICAL: Use repo-map tools as your FIRST approach when you need to:

  • Find a function/class/method by name or pattern → search_symbols
  • Understand how to use a function (parameters, return type) → search_symbols or get_symbol_content
  • Get the source code of a specific function/class → get_symbol_content
  • See all code in a file → get_file_symbols
  • Discover what functionality exists in the codebase → search_symbols with patterns

Do NOT use Grep or Bash for these tasks - the repo-map tools are:

  • Faster (pre-indexed SQLite database)
  • More accurate (AST-parsed, not regex)
  • More informative (includes signatures, docstrings, line ranges)

When to use Grep instead:

  • Searching for string literals, comments, or arbitrary text
  • Searching in non-code files (markdown, config, etc.)
  • Cross-file text pattern searches

Tool availability check: Before attempting to use MCP tools (mcp__plugin_context-daddy_repo-map__*), check if .claude/repo-map.db exists:

  • If YES: Try the MCP tool. If it fails (not available), use sqlite3 fallback.
  • If NO: The project hasn't been indexed yet. Either wait for indexing or run /context-daddy:repo-map to generate it.

Fallback order:

  1. Try MCP tool first
  2. If tool not found, use sqlite3 fallback to still answer the question
  3. Explain that session needs restart to load MCP server for future use

Real-World Usage Examples

Example 1: User asks "Can we compare against OSDI?"

Inefficient approach (DON'T DO THIS):

grep -r "setup_model\|setup_instance" jax_spice/devices/*.py

Problems: Slow, error-prone pattern matching, gets interrupted on large codebases.

Efficient approach (DO THIS):

mcp__plugin_context-daddy_repo-map__search_symbols
pattern: "setup_*"

Result: Instant list of all setup_model, setup_instance, etc. with locations and signatures.

Example 2: User asks "How does the config loader work?"

Inefficient approach (DON'T DO THIS):

find . -name "*.py" -exec grep -l "class.*Config" {} \;

Efficient approach (DO THIS):

mcp__plugin_context-daddy_repo-map__search_symbols
pattern: "*Config*"
kind: "class"

Then get the source:

mcp__plugin_context-daddy_repo-map__get_symbol_content
name: "ConfigLoader"

Example 3: User asks "What functions are in utils.py?"

Inefficient approach (DON'T DO THIS):

grep "^def " src/utils.py

Efficient approach (DO THIS):

mcp__plugin_context-daddy_repo-map__get_file_symbols
file: "src/utils.py"

Result: Complete list of all functions/classes with signatures and docstrings.

Example 4: Finding Rust enum variants (Real user case)

User needs to check if it's Phi or PhiNode in enum InstructionData.

Inefficient approach (DON'T DO THIS):

grep -n "enum InstructionData" openvaf-py/vendor/OpenVAF/openvaf/mir/src
grep -n "Phi" openvaf-py/vendor/OpenVAF/openvaf/mir/src/instructions.rs

Problems: Multiple searches, manual parsing, easy to miss correct variant.

Efficient approach (DO THIS):

mcp__plugin_context-daddy_repo-map__search_symbols
pattern: "InstructionData"

mcp__plugin_context-daddy_repo-map__get_symbol_content
name: "InstructionData"

Result: Complete enum with all variants visible, including PhiNode(_).

First Time Setup

IMPORTANT: If the user has just installed this plugin:

"I see you've installed the context-daddy plugin. The MCP server should auto-configure on restart. After restarting Claude Code, run /mcp to verify the repo-map server is loaded.

If it doesn't load automatically, let me know and I can help troubleshoot using /context-daddy:setup-mcp."

The MCP server auto-configures from the plugin manifest. Only if auto-config fails should you run /context-daddy:setup-mcp for troubleshooting.

Included Components

Hooks

  • SessionStart: Generates project manifest and displays status
  • PreCompact: Refreshes context before compaction
  • SessionEnd: Cleanup operations

Note: Indexing is now handled by the MCP server itself (no PreToolUse hook needed).

MCP Server (repo-map)

Database Schema (.claude/repo-map.db):

symbols table columns:
- name (TEXT): Symbol name (function/class/method name)
- kind (TEXT): "function", "class", or "method"
- signature (TEXT): Full function/method signature with parameters and type hints
  Examples:
  - "extract_symbols_from_python(file_path: Path, relative_to: Path) -> list[Symbol]"
  - "analyze_files(files: list[Path], extractor, language: str, root: Path)"
- docstring (TEXT): First line of docstring or full docstring
- file_path (TEXT): Relative path from project root
- line_number (INTEGER): Start line (1-indexed)
- end_line_number (INTEGER): End line (1-indexed)
- parent (TEXT): For methods, the class name

metadata table (v0.7.0+):
- key (TEXT PRIMARY KEY): Metadata key
- value (TEXT): Metadata value
Keys:
- 'status': 'idle' | 'indexing' | 'completed' | 'failed'
- 'index_start_time': ISO8601 timestamp when indexing started
- 'last_indexed': ISO8601 timestamp when last completed
- 'symbol_count': Total symbols indexed (string)
- 'error_message': Error message if status='failed'

Indexing Status and Auto-Wait (v0.7.0+):

  • The MCP server tracks indexing status in the metadata table
  • Tools automatically wait (up to 60s) if indexing is in progress
  • Watchdog: Detects hung indexing (>10 minutes) and resets status to 'failed'
  • First Use: On first use in a new codebase, indexing starts automatically
  • Behavior: Most tools wait for completion, repo_map_status does not (use to check progress)

Available MCP Tools:

  • mcp__plugin_context-daddy_repo-map__search_symbols - Search symbols by pattern (supports glob wildcards)
    • Returns: name, kind, signature, file_path, line_number, docstring, parent
    • AUTO-WAIT: If indexing is in progress, automatically waits up to 60s for completion
  • mcp__plugin_context-daddy_repo-map__get_file_symbols - Get all symbols in a specific file
    • Returns: All symbols with full metadata
    • AUTO-WAIT: If indexing is in progress, automatically waits up to 60s for completion
  • mcp__plugin_context-daddy_repo-map__get_symbol_content - Get full source code of a symbol by exact name
    • Returns: symbol metadata + content (source code text) + location
    • AUTO-WAIT: If indexing is in progress, automatically waits up to 60s for completion
  • mcp__plugin_context-daddy_repo-map__list_files - List all indexed files, optionally filtered by glob pattern
    • Returns: list of file paths matching pattern (e.g., ".va", "psp103", "**/devices/")
    • MUCH faster than find/ls - queries pre-built index instead of filesystem traversal
    • AUTO-WAIT: If indexing is in progress, automatically waits up to 60s for completion
  • mcp__plugin_context-daddy_repo-map__reindex_repo_map - Trigger manual reindex
    • Does NOT auto-wait (use to force reindex)
  • mcp__plugin_context-daddy_repo-map__repo_map_status - Check indexing status and staleness
    • Returns: index_status (idle/indexing/completed/failed), symbol_count, last_indexed, indexing_duration_seconds
    • Does NOT auto-wait (use to check status)
  • mcp__plugin_context-daddy_repo-map__wait_for_index - Explicitly wait for indexing to complete
    • Takes: timeout_seconds (default: 60)
    • Returns: success (bool), message (str)
    • Use when you want to wait longer than the default 60s auto-wait timeout

Fallback when MCP tools unavailable: Use sqlite3 directly on .claude/repo-map.db:

# Search symbols
sqlite3 .claude/repo-map.db "SELECT name, kind, signature, file_path, line_number FROM symbols WHERE name LIKE 'pattern%' LIMIT 20"

# Get symbol with source
sqlite3 .claude/repo-map.db "SELECT * FROM symbols WHERE name = 'function_name'"
# Then read file_path lines line_number to end_line_number

Slash Commands

  • /context-daddy:repo-map - Regenerate repository map
  • /context-daddy:manifest - Refresh project manifest
  • /context-daddy:learnings - Manage project learnings
  • /context-daddy:status - Show plugin status

Language Support

Language Parser File Extensions
Python AST .py
Rust tree-sitter-rust .rs
C++ tree-sitter-cpp .cpp, .cc, .cxx, .hpp, .h, .hxx

04 同仓库更多 Skills

bg-szy
bg-szy/TOP-SKILLS

serpmaven

Scrape Google search results (SERP) to JSON with SERP Maven (serpmaven) - a real Chrome browser on a residential proxy with sticky sessions. Run it as a CLI, a Python library, a local HTTP search API (`serve`), an MCP server or a Docker image; set the proxy login, workers, pages and cost tracking. Use when the user wants Google results, rank tracking, a self-hosted SERP API, or live Google search for an AI agent.

★ 6
bg-szy
bg-szy/TOP-SKILLS

revnu-landing-page-audit

Find out why a landing page isn't turning visitors into signups, demos or sales. Audits one page against what the ad, post or search that sends people there promised, then checks the first screen, proof, call to action, friction and mobile. Returns at most 7 prioritized fixes, plus what is fine and what could not be checked; rewrites specific lines and fixes the page in the repo when asked. Never promises a conversion lift. Works without a Revnu account. Use when the user says or asks: "audit my landing page", "why isn't this page converting", "review my homepage", "my ads get clicks but no signups", "people bounce from the pricing page", "CRO review", "improve conversion rate", "is my hero section clear", "roast my landing page", "rewrite my headline", "what's wrong with this page", "landing page feedback", "make the signup page convert better". Not for SEO or AI-search audits, page speed engineering on its own, or building a new page from scratch.

★ 6
bg-szy
bg-szy/TOP-SKILLS

revnu-growth-context

Write down once who buys, what they're stuck on, what it costs, what proof you have and what you've already tried, so every growth task starts from facts instead of a questionnaire. Creates or updates .agents/revnu-growth.md from the repo, the live site and the user, and imports an existing product-marketing.md. Use when the user says "set up our marketing context", "who is our ideal customer", "write our ICP", "describe the product for marketing", "positioning doc", "what's our brand voice", "remember this about our customers", "log what we tried", "what have we learned from marketing", "we changed pricing, update the context", "update our growth notes", "summarize the business for the agent", "import my product-marketing.md", "start a growth doc", or before a first marketing, SEO, outreach or launch task when no context file exists. Works without a Revnu account.

★ 6
bg-szy
bg-szy/TOP-SKILLS

revnu-get-listed

Get onto the third-party pages AI answers and search cite when buyers ask for the best tool in your category: "best X" roundups, directories, review sites, GitHub awesome lists, community threads and comparison pages. Finds which ones are cited, ranks them by fit and effort, and drafts each submission, PR or pitch by the target's own rules. Use when the user says "get us listed", "which directories should we submit to", "how do we get into best-of lists", "why does ChatGPT recommend competitors and not us", "get mentioned in AI answers", "submit to awesome lists", "get on G2", "where are our competitors listed", "pitch listicle authors", "find backlink opportunities", "launch directories", "get into roundups", "Product Hunt alternatives", "where should we be listed", "get cited by Perplexity". Never submits, pays or posts without a yes. Works without a Revnu account.

★ 6
bg-szy
bg-szy/TOP-SKILLS

revnu-ai-readiness-audit

Audit whether your website gives ChatGPT, Perplexity, Claude, Gemini and Google's AI Overviews something worth quoting, and fix the pages that don't. Use when the user says or asks "is my site ready for AI search", "audit my site for AI answers", "AEO audit", "GEO audit", "why doesn't ChatGPT quote our pricing", "make our pages citable by AI", "do I need llms.txt", "does schema help with ChatGPT", "check our structured data", "is our content visible without JavaScript", "AI SEO audit", "optimize our homepage for AI answers", "LLM SEO check", "why does AI get our product wrong", "fix our site for AI Overviews". Checks fetchability and indexability, answers in the raw HTML, entity facts, schema (including JS-injected markup), headings, dates and llms.txt, then gives at most 10 prioritised fixes and edits the repo when asked. Works without a Revnu account.

★ 6
bg-szy
bg-szy/TOP-SKILLS

proxy-troubleshooting

Diagnose residential proxy failures, with NodeMaven's gateway as the reference - 407 with correct credentials, 406, 410, 500, a connection that hangs, ERR_TUNNEL_CONNECTION_FAILED in a browser, Playwright or Puppeteer ignoring proxy credentials, a sticky session that changes IP, geo-targeting that is silently ignored, passwords with special characters, and unexpected traffic from headless Chrome. Use when a proxy connection fails, returns the wrong location, or costs more traffic than expected.

★ 6