agentleFS
rioX432rioX432/agent-witness/.claude/skills/dev-investigate/SKILL.md

dev-investigate

Skill1 starsChanged 5 months agoApache-2.0View on GitHub

Investigate codebase for an issue in a forked context (context isolation)

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. TchiRubick/skills★ 1same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository12 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 5 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read CLAUDE.md for project architecture, conventions, and directory structure.

    line 37
  2. Distinctive:

    After receiving agent reports, verify:

    line 96
  3. Distinctive:

    Do findings from different axes contradict each other?

    line 100
  4. Distinctive:

    If gaps remain, launch follow-up Explore agents for specific areas.

    line 102
  5. Very specific:

    Write investigation-report.md in the current working directory.

    line 108
  6. Very specific:

    Filename sanitization: If the issue has a reference (e.g., #42, PGR-1234), the file is still named investigation-report.md (the caller …

    line 110
  7. Very specific:

    Every claim must reference a specific file:line

    line 161
  8. Distinctive:

    If something is unclear, put it in Open Questions — do not guess

    line 163

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/dev-investigate — Forked-Context Investigation

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)

Why Fork?

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.


Step 1: Parse Input

Extract from $ARGUMENTS:

  • Issue summary and acceptance criteria
  • Keywords and technical terms
  • Known affected areas (from issue labels, description)
  • Project architecture context (from CLAUDE.md)

Read CLAUDE.md for project architecture, conventions, and directory structure.


Step 2: Find Entry Points

  1. Grep for keywords from the issue (class names, function names, error messages)
  2. Glob for likely file patterns (feature directories, module names)
  3. git log for recent changes in related areas
  4. Identify 3-6 entry points to start deep investigation

Step 3: Deep Investigation (Explore Agents)

Launch parallel Explore agents for each investigation axis:

Agent template

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."
)

Investigation axes (select 2-4 based on issue type):

  • Code structure: Where does the relevant code live? What layer/module?
  • Data flow: How does data enter, transform, and exit?
  • Dependencies: What depends on this? What does this depend on?
  • Test coverage: What's tested? What's not? Where are the test files?
  • History: Recent changes, who touched it, related PRs (git log, git blame)

Investigation checklist

For each axis, the agent must cover:

  • Read the code: Every involved file, not just entry points
  • Trace the flow: Follow function calls, event handlers, data transformations
  • Map boundaries: Module boundaries, public vs internal APIs
  • Check tests: Existing test files, what's covered, what's missing
  • Check history: git log / git blame for recent changes and context

Step 4: Think Twice

After receiving agent reports, verify:

  1. Did the agents actually read the code, or did they speculate?
  2. Are there other possible causes or code paths not considered?
  3. Is impact analysis complete — all callers, all downstream dependencies?
  4. Do findings from different axes contradict each other?

If gaps remain, launch follow-up Explore agents for specific areas.


Step 5: Write Investigation Report

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:

  • Every claim must reference a specific file:line
  • Distinguish facts (read from code) from inferences
  • If something is unclear, put it in Open Questions — do not guess
  • The report must be self-contained — the caller has no access to this fork's context

Error Handling

SituationAction
Entry points unclearGrep broadly, expand search patterns
Agent returns shallow resultsRe-launch with more specific prompts
Codebase too large for full traceScope down, report what was covered and what was skipped
CLAUDE.md missingInfer architecture from directory structure

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.