# Aif Recon

> Fast, token-efficient codebase reconnaissance. Given a task, a set of changed files, or a question, it finds the relevant files, their dependents/callers, related tests, and any governing spec/PRD/issue — and returns one concise context report. Divides the tree across parallel subagents when available, falls back to a single sequential sweep otherwise. Use before implementing, debugging, or revie…

- **Type:** Skill
- **Install:** `agentstack add skill-ainative-build-skills-aif-recon`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [ainative-build](https://agentstack.voostack.com/s/ainative-build)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [ainative-build](https://github.com/ainative-build)
- **Source:** https://github.com/ainative-build/skills/tree/main/skills/engineering/aif-recon

## Install

```sh
agentstack add skill-ainative-build-skills-aif-recon
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# aif-recon

Reconnaissance for the codebase: turn a target into a concise map of what's relevant. Built to feed
other work (implementation, debugging, review) a tight context report instead of a raw file dump.

**Principles:** wide-then-deep · divide and conquer · report signal, not noise.

Self-contained — built-ins only: `git`, `Glob`, `Grep`, `Read`, `Bash`, and (where available) the
`Task` tool for parallel subagents. Read-only; never edits.

## What it answers

Given a **target** — a task description, a set of changed files, or a plain question — produce:

- **Relevant files** — the modules that implement or own the target area.
- **Dependents / callers** — what refers to the changed/target symbols (blast radius).
- **Related tests** — test files that cover the target modules.
- **Spec / governing docs** — with `--spec` (or when asked), the PRD / issue / plan that defines the
  intended behavior.

## Workflow

```
1. Frame the target → search terms, entry dirs, symbols
2. Wide sweep       → Glob/Grep to size the space + gather candidates
3. Divide & conquer → parallel subagents over disjoint dirs (or one sequential sweep)
4. Deep read        → confirm the true owners; trace dependents & tests
5. Report           → one concise context report
```

### 1. Frame the target
Parse the target into concrete search terms: symbol/function/type names, file-type globs, likely
directories. For a changed-files target, start from `git diff --name-only` and the changed symbol
names. For a question, extract the nouns that name features/modules.

### 2. Wide sweep
Use a spread of `Glob` and `Grep` patterns to (a) estimate scale (how many files/dirs matter) and
(b) collect candidate files. Prefer several narrow patterns over one broad one.

### 3. Divide & conquer — capability branch (load-bearing for portability)
- **If parallel subagents are available** (Task tool): split the candidate directories into disjoint
  segments with NO overlap, and spawn one read-only subagent per segment. Give each the exact dirs/
  globs to read and the target it's confirming. Each returns a short segment report. Skip the fan-out
  when the candidate set is small (≤ ~2 segments) — the overhead isn't worth it; sweep inline.
- **Otherwise** (Codex, Cursor, or any runtime without subagents): do ONE sequential sweep in this
  session over the candidate set. Same output, just serial.

Each subagent (or the sequential sweep) must:
- read only its assigned scope; stay within it,
- confirm which candidates truly own the target (open them, don't guess from names),
- for changed/target symbols, Grep the repo for callers/importers (dependents),
- note the test files that exercise those modules,
- return a concise segment summary, not raw file contents.

### 4. Deep read
Merge segment reports. Open the top owners to confirm. Resolve the dependent set (who breaks if this
changes) and the covering tests. Drop false candidates.

### 5. Spec discovery (`--spec`, or when the caller asks)
Locate the governing spec in this order and report what you find (or "none found"):
1. Issue/PR references in the relevant commit messages (`#123`, `JIRA-45`, "closes …").
2. A path the caller named.
3. A scan of `docs/`, `specs/`, `.scratch/`, `plans/`, `PRD*`, `RFC*` for a matching document.

## Report format

Keep it tight — this is fuel for the next step, not an essay.

```markdown
# Recon — 

## Relevant files
- `path/to/file` — what it owns, why it's relevant

## Dependents / blast radius
- `path/to/caller` — how it depends on the target

## Tests
- `path/to/test` — what it covers

## Spec / governing docs        (when --spec or asked)
- `path/to/spec` — the requirement it defines   (or: none found)

## Standards docs               (when asked, e.g. by a reviewer)
- `.editorconfig` / `docs/code-standards*` / linter config / `CONTRIBUTING` — the convention it sets   (or: none found)

## Suggested review groups      (large/multi-area targets only)
- group A: `src/api/`, `src/db/` — backend
- group B: `src/components/` — frontend
  (disjoint file-groups a reviewer can fan out over; omit for a small target)

## Notes & unresolved questions
- gaps, ambiguities, things the caller should confirm
```

## References

- `references/scouting-patterns.md` — Glob/Grep pattern recipes + how to size and split the tree.

## Notes

- Timebox parallel subagents (~3 min each); log any non-responder in the report rather than blocking.
- Each subagent has a bounded context window — hand it a scope it can actually read, not the whole
  tree.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [ainative-build](https://github.com/ainative-build)
- **Source:** [ainative-build/skills](https://github.com/ainative-build/skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-ainative-build-skills-aif-recon
- Seller: https://agentstack.voostack.com/s/ainative-build
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
