Claude-skill-registry code-investigation
Efficient codebase investigation for rapid-go. Use when understanding existing code before modifications, tracing request flows from API to database, finding where functionality is implemented, or analyzing impact before changes. ALWAYS use before modifying existing code, fixing bugs, or adding features.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/code-investigation" ~/.claude/skills/majiayu000-claude-skill-registry-code-investigation && rm -rf "$T"
manifest:
skills/data/code-investigation/SKILL.mdsource content
Code Investigation Guide
Quick Start
Proto (API contract) -> Handler -> Usecase -> Repository -> DB
Use this flow to trace any feature. Start from what you know.
Key Locations
| What | Where |
|---|---|
| API contracts | |
| Handlers | |
| Usecases | |
| Domain models | |
| Repository interfaces | |
| Repository implementations | |
| DI wiring | |
| Auth interceptors | |
Investigation Patterns
Find an API endpoint
# Find by HTTP path grep "/admin/v1/tenants" schema/proto/rapid/ # Find by RPC name grep "CreateTenant" internal/infrastructure/grpc/internal/handler/admin/
Trace request flow
- Find RPC in
schema/proto/rapid/**/api.proto - Find handler in
internal/infrastructure/grpc/internal/handler/{actor}/ - Find interactor in
internal/usecase/*_impl.go - Find repository in
(interface) andinternal/domain/repository/
(impl)internal/infrastructure/*/repository/
Find all usages of a type
# Find usages of a domain model grep "model.Staff" internal/ # Find usages of a repository method grep "staffRepository.Get" internal/usecase/
Check authorization logic
- Session extraction:
internal/infrastructure/grpc/internal/interceptor/session_interceptor/ - Access control:
internal/infrastructure/grpc/internal/interceptor/authorization_interceptor/ - Role checks in usecase: look for
patternsparam.AdminRole.IsRoot()
Impact analysis before changes
- Find interface definition in
internal/domain/repository/ - Find all implementations in
internal/infrastructure/*/repository/ - Find all callers in
internal/usecase/ - Check mock generation:
internal/domain/repository/mock/
Common Search Patterns
| Goal | Search |
|---|---|
| Find entity by name | |
| Find error definition | |
| Find input validation | |
| Find marshaller | |
| Find DI registration | |
Tips
- Start from proto for API-related investigation
- Start from domain model for business logic investigation
- Check
to understand how components are wireddependency.go - Marshallers exist in two places: repository (DB<->domain) and handler (domain<->proto)