Provides scripts for structured API and dependency discovery instead of manual file reading.
Install
mkdir -p .claude/skills/code-discovery && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10741" && unzip -o skill.zip -d .claude/skills/code-discovery && rm skill.zipInstalls to .claude/skills/code-discovery
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Use when exploring codebase structure, discovering module APIs, understanding imports, or checking what functions exist. Provides scripts that replace manual file reading with structured discovery.Key capabilities
- →Inspect module APIs
- →Trace import chains
- →Detect architecture violations
- →Analyze code reachability
How it works
It provides scripts to programmatically inspect module signatures and dependency graphs.
Inputs & outputs
When to use code-discovery
- →Inspecting module public APIs
- →Tracing import dependencies
- →Detecting circular imports
About this skill
Code Discovery Tools
When to use: Before writing code that calls existing modules, or when exploring unfamiliar parts of the codebase.
Instead of: Reading entire files to find function signatures, use these scripts.
discover_api.py
Purpose: Inspect real module APIs—functions, classes, constants, signatures.
Use when:
- About to call a function but unsure of its parameters
- Exploring a module's public surface
- Verifying an API exists before using it
Usage:
# Text output (human-readable)
python scripts/discover_api.py nomarr.workflows.processing.process_file_wf
# JSON output (machine-readable)
python scripts/discover_api.py nomarr.components.ml --format=json
# Example output:
# ================================================================================
# Module: nomarr.components.ml.ml_embed_comp
# ================================================================================
#
# FUNCTIONS:
#
# def compute_embeddings(file_path: str, models_dir: str, backbone: str) -> np.ndarray:
# Compute embeddings for an audio file.
Decision rule: If you're about to read_file a module just to find what functions exist → use discover_api.py instead.
discover_import_chains.py
Purpose: Trace import dependencies from a module and detect architecture violations.
Use when:
- Checking if a new import would violate layering rules
- Debugging circular imports
- Understanding what a module depends on
Usage:
# Trace imports from a module
python scripts/discover_import_chains.py nomarr.workflows.library.scan_library_wf
# JSON output
python scripts/discover_import_chains.py nomarr.services.domain.tagging_svc --format=json
# Can also accept file paths
python scripts/discover_import_chains.py nomarr/interfaces/api/v1/library.py
Output shows:
- Full import chain (what imports what)
- Architecture violations (e.g., "workflow imports service")
- Depth-limited to prevent infinite recursion
build_code_graph.py
Purpose: Build a complete code graph for dead code detection and reachability analysis.
Use when:
- Checking if code is reachable from entrypoints
- Finding unused functions/classes
- Understanding call relationships
Usage:
python scripts/build_code_graph.py
Output: Writes to scripts/outputs/code_graph.json with:
- Nodes: All modules, classes, functions
- Edges: CONTAINS, IMPORTS, CALLS relationships
- Reachability from interface entrypoints
Use with: check_dead_nodes.py to analyze the graph.
Workflow: Discovering an Unfamiliar Module
-
Find the module's API:
python scripts/discover_api.py nomarr.components.tagging -
Check its dependencies:
python scripts/discover_import_chains.py nomarr.components.tagging -
Verify no violations before adding imports:
python scripts/discover_import_chains.py nomarr.workflows.new_workflow_wf
Common Patterns
Before calling a function
# Instead of reading the whole file:
python scripts/discover_api.py nomarr.persistence.db
# Get exact signature:
# def get_next_job(self, status: str = "pending") -> QueueJobDict | None:
Before adding an import
# Check if it would violate architecture:
python scripts/discover_import_chains.py nomarr.services.domain.tagging_svc
# If you see "VIOLATION: services importing interfaces" → don't add that import
Understanding a subsystem
# Get all public APIs in a package
python scripts/discover_api.py nomarr.components.ml
python scripts/discover_api.py nomarr.components.ml.ml_embed_comp
python scripts/discover_api.py nomarr.components.ml.ml_inference_comp
Key Rule
Never guess function names, parameters, or return types.
Use discover_api.py to verify APIs before calling them. This prevents:
- Inventing non-existent functions
- Wrong parameter orders
- Type mismatches
When not to use it
- →Manual file reading
- →Guessing function signatures
Prerequisites
Limitations
- →Requires Python
How it compares
It replaces manual file inspection with structured, automated discovery.
Compared to similar skills
code-discovery side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| code-discovery (this skill) | 0 | 6mo | Review | Intermediate |
| architect-review | 109 | 4mo | No flags | Advanced |
| solid-principles | 57 | 9mo | No flags | Intermediate |
| codex | 32 | 2mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
architect-review
sickn33
Master software architect specializing in modern architecture patterns, clean architecture, microservices, event-driven systems, and DDD. Reviews system designs and code changes for architectural integrity, scalability, and maintainability. Use PROACTIVELY for architectural decisions.
solid-principles
SmidigStorm
Enforce SOLID principles (Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion) in object-oriented design. Use when writing or reviewing classes and modules.
codex
Lucklyric
Invoke Codex CLI for complex coding tasks requiring high reasoning capabilities. This skill should be invoked when users explicitly mention "Codex", request complex implementation challenges, advanced reasoning, or need high-reasoning model assistance. Automatically triggers on codex-related requests and supports session continuation for iterative development.
error-handling-patterns
wshobson
Master error handling patterns across languages including exceptions, Result types, error propagation, and graceful degradation to build resilient applications. Use when implementing error handling, designing APIs, or improving application reliability.
deepwiki-rs
sopaco
AI-powered Rust documentation generation engine for comprehensive codebase analysis, C4 architecture diagrams, and automated technical documentation. Use when Claude needs to analyze source code, understand software architecture, generate technical specs, or create professional documentation from any programming language.
senior-fullstack
davila7
Comprehensive fullstack development skill for building complete web applications with React, Next.js, Node.js, GraphQL, and PostgreSQL. Includes project scaffolding, code quality analysis, architecture patterns, and complete tech stack guidance. Use when building new projects, analyzing code quality, implementing design patterns, or setting up development workflows.