One-click install
npx skills add https://github.com/CaptainCrouton89/.claude --skill investigating-code-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Investigating Code Patterns
Source: https://github.com/CaptainCrouton89/.claude/tree/main/skills/investigating
Command: npx skills add https://github.com/CaptainCrouton89/.claude --skill investigating-code-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a systematic approach to tracing code flows, locating implementations, diagnosing performance issues, and mapping system architecture. It solves the problem of understanding complex or unfamiliar codebases, enabling you to quickly grasp how existing systems work, research concepts, and answer "how/where/why is X implemented?" questions.

Core Features & Use Cases

  • Code Flow & Location: Trace execution paths from entry points to outcomes and pinpoint where specific functionalities are implemented.
  • Performance Analysis: Diagnose bottlenecks using a 3-phase approach: locate, root cause, and fix/instrument.
  • Use Case: When onboarding to a new project, use this Skill to map the architecture of the user authentication system. It will trace the code flow from the login endpoint, identify key files, and document the data transformations, helping you quickly become productive.

Quick Start

Example: Investigate how user authentication works

1. Clarify: "How does user authentication work in this codebase?"

2. Read docs: docs/system-design.md, docs/api-contracts.yaml.

3. Search: "Grep for 'login' in src/auth."

4. Document: Create a "Code Flow Template" for authentication.

Frequently Asked Questions about Investigating Code Patterns

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

FAQPage Schema
How do I trace code execution paths to understand how a system works?

Code tracing systematically follows execution from entry points through function calls and data transformations to their outcomes. Start by identifying the entry point (e.g., API endpoint or main function), then map how data flows through dependencies and state changes across files to document the complete flow and pinpoint where specific logic executes.

What's the best way to locate where a specific functionality is implemented in a large codebase?

Locate implementations by searching for distinctive keywords, function names, and patterns across the codebase, then cross-reference results to identify the primary file and related dependencies. Document the discovery path with file references and evidence to create a reproducible map of where and how the functionality operates.

How can I diagnose performance bottlenecks in my code?

Performance diagnosis follows a 3-phase approach: locate the slow operation using profiling or logs, root-cause the bottleneck by tracing execution and identifying resource-intensive sections, then fix or instrument the code with measurements. This structured method produces documented evidence linking performance issues to specific implementations.

Can I use code investigation for onboarding to unfamiliar projects?

Yes. Code investigation systematically maps system architecture by tracing critical flows like authentication or data processing from entry points through implementation files. This produces documented architecture understanding, enabling new developers to quickly grasp structure, dependencies, and data transformations without extensive manual exploration.

What output does a code investigation produce?

Code investigation generates structured outputs including execution flow diagrams, file reference maps, evidence-based reasoning that links findings to code locations, and system architecture documentation. These outputs are reproducible and support future research, onboarding, and architectural decisions.