code-search

Extracts codebase structure and signatures via tree-sitter AST for Orchestrator context reports.

6|Updated May 18, 2026
One-click install
npx skills add https://github.com/mokhtarabadi/cognitive-lead-hq --skill code-search-mokhtarabadi
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: code-search
Source: https://github.com/mokhtarabadi/cognitive-lead-hq/tree/main/skill-templates/code-search
Command: npx skills add https://github.com/mokhtarabadi/cognitive-lead-hq --skill code-search-mokhtarabadi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Exploring a large codebase to gather context for an AI Orchestrator wastes tokens and dilutes signal when full files are read indiscriminately. This Skill enforces a disciplined discovery workflow that gathers only the structural context the Orchestrator needs. ## Core Features & Use Cases - Signature-First Exploration: Uses tree-sitter AST extraction (via custom_context_extract_signatures) to map classes, functions, interfaces, and types across Python, JavaScript, TypeScript, Java, Kotlin, Go, and Rust before reading any file bodies. - Vertical Slicing: Scopes discovery to a specific feature module (e.g., packages/billing/) while always injecting core SOP files like AGENTS.md and DESIGN.md into the report. - Strict Handover Guardrail: Compiles context reports into context-reports/ and halts, preventing the Executor from analyzing the reports itself. - Use Case: When the Orchestrator requests context for the authentication feature, run directory tree and signature extraction on src/features/auth/ only, then compile a report for upload instead of scanning the whole repository. ## Quick Start Ask the agent to follow the code-search skill to map the project structure and compile a context report for the Orchestrator.

Frequently Asked Questions about code-search

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I gather codebase context for an AI agent without wasting tokens?▼

Extract structural signatures with tree-sitter AST parsing before reading any file bodies. Signatures capture classes, functions, and types at a fraction of the token cost, letting you identify which 2-3 files genuinely need full reads.

What is signature extraction vs reading full source files?▼

Signature extraction uses tree-sitter AST to return only definition lines like function names, parameters, and return types, cutting bodies at the opening brace. Full file reads return entire file contents and cost far more tokens, so they are reserved for final targeted analysis.

Which programming languages support tree-sitter signature extraction?▼

Tree-sitter queries are configured for Python, JavaScript, TypeScript, Java, Kotlin, Go, and Rust. Swift, Ruby, PHP, and C# fall back to regex-based extraction, which is less accurate.

How do I explore only one feature module instead of the whole repository?▼

Use the Vertical Slicing strategy: run the directory tree and signature extraction only on the target feature directory, trace its local dependencies, and always append core SOP files like AGENTS.md and DESIGN.md to the final report.

Why should the Executor not read the generated context report?▼

The workflow enforces a strict guardrail: the Executor is only a data gatherer. After the report file is generated, it must halt and hand the file path to the Manager, who uploads it to the Orchestrator for review.