From ai-dev
Investigate codebase for an issue in a forked context (context isolation)
How this skill is triggered — by the user, by Claude, or both
Slash command
/ai-dev:dev-investigateThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Investigate the codebase for a given issue in a forked context. This skill runs with `context: fork` so that large Read results do not pollute the caller's context window.
Investigate the codebase for a given issue in a forked context. This skill runs with context: fork so that large Read results do not pollute the caller's context window.
Input: $ARGUMENTS (issue details, keywords, affected areas from Phase 1)
Investigation reads many files to trace data flows and map dependencies. Running in a forked context keeps this token-heavy work isolated — the caller only receives the final investigation-report.md, not hundreds of file reads.
Extract from $ARGUMENTS:
Read CLAUDE.md for project architecture, conventions, and directory structure.
Launch parallel Explore agents for each investigation axis:
Agent(
subagent_type: "Explore",
prompt: "Investigate {axis} for {issue} in this codebase.
Entry points: {identified files/symbols}
You MUST:
1. Read every relevant file — no guessing
2. Trace calls and data flow through actual code paths
3. Note public API surfaces and internal boundaries
4. Check for tests — list what's tested and what's not
5. List all files involved with their role
Report: structured findings with file:line references."
)
git log, git blame)For each axis, the agent must cover:
git log / git blame for recent changes and contextAfter receiving agent reports, verify:
If gaps remain, launch follow-up Explore agents for specific areas.
Write investigation-report.md in the current working directory.
Filename sanitization: If the issue has a reference (e.g., #42, PGR-1234), the file is still named investigation-report.md (the caller handles issue-specific paths).
# Investigation Report: {issue title}
## Summary
- 1-3 sentence overview of findings
## Architecture Overview
- Component/module structure relevant to the issue
- Layer boundaries and responsibilities
## Data Flow
- Entry point -> processing -> output (with file:line references)
- State management involved
- Side effects (DB writes, API calls, file I/O)
## Affected Files
| File | Role | Lines | Changes Needed |
|------|------|-------|----------------|
| `src/...` | Entry point | 45-120 | Modify X |
| `src/...` | Data layer | 10-80 | Add Y |
## Dependencies
- **Upstream** (what calls this): [list with file:line]
- **Downstream** (what this calls): [list with file:line]
- **External** (libraries, APIs, services): [list]
## Existing Patterns
- How similar features are implemented in this codebase
- Conventions observed (naming, error handling, testing)
## Test Coverage
- Existing tests: [list with file paths]
- Covered scenarios: [list]
- Missing coverage: [list]
## Risks / Concerns
- Potential issues discovered during investigation
- Complexity hotspots
- Missing error handling or edge cases
## Decision Points
- Ambiguities that need resolution in /dig phase
- Design choices with trade-offs
## Open Questions
- Things that could not be determined from code alone
Rules:
file:line| Situation | Action |
|---|---|
| Entry points unclear | Grep broadly, expand search patterns |
| Agent returns shallow results | Re-launch with more specific prompts |
| Codebase too large for full trace | Scope down, report what was covered and what was skipped |
| CLAUDE.md missing | Infer architecture from directory structure |
npx claudepluginhub riox432/ai-dev-templates --plugin ai-devGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.