dev-investigate
Investigate codebase for an issue in a forked context (context isolation)
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Investigate codebase for an issue in a forked context (context isolation)
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Process issues sequentially: /dev per issue in isolated sub-agent → CI wait → merge → next
E2E development: investigate → dig → decompose → implement → test → review → PR
Break a task into ordered subtasks with dependencies
Clarify ambiguities in plans with structured questions and auto-decide rules
Audit codebase for tech debt, code quality, and architecture issues — then create GitHub Issues
Create a pull request for the current branch using the project's PR template
| name | dev-investigate |
| description | Investigate codebase for an issue in a forked context (context isolation) |
| context | fork |
| allowed-tools | ["Read","Glob","Grep","Bash(git log:*)","Bash(git diff:*)","Bash(git blame:*)","Bash(find:*)","Agent","ToolSearch"] |
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 |