iterative-code-exploration

Progressive context retrieval pattern for understanding unfamiliar codebases through iterative refinement

Best use case

iterative-code-exploration is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Progressive context retrieval pattern for understanding unfamiliar codebases through iterative refinement

Teams using iterative-code-exploration should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/iterative-code-exploration/SKILL.md --create-dirs "https://raw.githubusercontent.com/organvm-iv-taxis/a-i--skills/main/distributions/claude/skills/iterative-code-exploration/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/iterative-code-exploration/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How iterative-code-exploration Compares

Feature / Agentiterative-code-explorationStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Progressive context retrieval pattern for understanding unfamiliar codebases through iterative refinement

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Iterative Code Exploration

A systematic pattern for progressively exploring and understanding unfamiliar codebases through iterative context refinement.

## The Problem

When working with new codebases, you often don't know:
- Which files contain relevant code
- What patterns and conventions exist
- What terminology the project uses
- How components interact

Standard approaches fail:
- **Read everything**: Time-consuming and overwhelming
- **Guess locations**: Often misses critical context
- **Ask broad questions**: Returns too much irrelevant information

## The Solution: 4-Phase Iterative Loop

```
┌─────────────────────────────────────────────┐
│                                             │
│   ┌──────────┐      ┌──────────┐            │
│   │ DISCOVER │─────▶│ EVALUATE │            │
│   └──────────┘      └──────────┘            │
│        ▲                  │                 │
│        │                  ▼                 │
│   ┌──────────┐      ┌──────────┐            │
│   │   LOOP   │◀─────│  REFINE  │            │
│   └──────────┘      └──────────┘            │
│                                             │
│        Max 3-4 cycles, then synthesize      │
└─────────────────────────────────────────────┘
```

### Phase 1: DISCOVER

Start with broad exploration:

```bash
# Find entry points
find . -name "main.*" -o -name "index.*" -o -name "app.*" | head -20

# Discover project structure
tree -L 3 -I 'node_modules|dist|build'

# Find configuration
find . -name "*.config.*" -o -name "package.json" -o -name "*.toml"

# Identify key patterns
grep -r "export class" --include="*.ts" src/ | head -20
grep -r "def " --include="*.py" . | head -20
```

Document initial findings:
- Project type (web app, library, service, etc.)
- Tech stack (languages, frameworks)
- Architecture hints (monorepo, microservices, etc.)

### Phase 2: EVALUATE

Assess discovered files for relevance:

```bash
# Read high-value files
cat README.md
cat ARCHITECTURE.md 2>/dev/null
cat docs/overview.md 2>/dev/null

# Check package manifests
cat package.json | jq '.dependencies, .scripts'
cat Cargo.toml 2>/dev/null
cat requirements.txt 2>/dev/null
```

**Scoring Criteria:**
- **Critical (★★★)**: Entry points, core logic, main configs
- **Important (★★)**: Utilities, shared components, types
- **Supporting (★)**: Tests, docs, examples
- **Noise (-)**: Generated files, vendored code

### Phase 3: REFINE

Focus on specific areas identified as relevant:

```bash
# Dive into specific modules
ls -la src/core/
cat src/core/index.ts

# Trace dependencies
grep -r "import.*from.*core" --include="*.ts" src/ | head -20

# Find related patterns
grep -A 5 -B 5 "class UserService" src/**/*.ts

# Check tests for usage examples
find . -name "*.test.*" -o -name "*.spec.*" | head -10
```

Build mental model:
- How components connect
- What patterns are used consistently
- Where similar functionality lives

### Phase 4: LOOP

Decision point - do you need more context?

**Continue if:**
- Key functionality still unclear
- Dependencies not fully traced
- Patterns inconsistent or confusing

**Stop if:**
- Core logic understood
- Can explain main flows
- Ready to make changes confidently

## Practical Workflow

### For Feature Implementation

1. **Discover**: Find similar existing features
   ```bash
   grep -r "feature-name" src/
   find . -name "*feature*"
   ```

2. **Evaluate**: Review implementation patterns
   ```bash
   cat src/features/similar-feature/index.ts
   ```

3. **Refine**: Check tests and edge cases
   ```bash
   cat src/features/similar-feature/*.test.ts
   ```

4. **Loop**: Trace dependencies until clear

### For Bug Fixing

1. **Discover**: Locate error origin
   ```bash
   grep -r "error message" src/
   git log -S "error message"
   ```

2. **Evaluate**: Understand surrounding context
   ```bash
   cat path/to/file.ts | grep -A 20 -B 20 "error location"
   ```

3. **Refine**: Check call sites and callers
   ```bash
   grep -r "functionName" --include="*.ts" src/
   ```

4. **Loop**: Expand context as needed

### For Refactoring

1. **Discover**: Map current structure
   ```bash
   find src/ -name "*.ts" | xargs wc -l | sort -n
   grep -r "class\|interface" --include="*.ts" src/ | wc -l
   ```

2. **Evaluate**: Identify coupling points
   ```bash
   grep -r "import.*from.*module" src/ | cut -d: -f2 | sort | uniq -c | sort -rn
   ```

3. **Refine**: Find all usages
   ```bash
   grep -r "ComponentName" --include="*.ts" src/
   ```

4. **Loop**: Ensure all references found

## Output Template

After each loop iteration, document:

```markdown
## Iteration N

**Query**: What I was looking for
**Found**: X files, Y patterns, Z components
**Relevance**: High/Medium/Low with reasons
**Gaps**: What's still unclear
**Next**: What to explore in next iteration

**Key Files**:
- path/to/file.ts - Core implementation (★★★)
- path/to/other.ts - Supporting utility (★★)

**Mental Model Update**:
- New understanding of X
- Connection between Y and Z
- Pattern: Description
```

## Integration Points

Complements:
- **knowledge-architecture**: For documenting discoveries
- **second-brain-librarian**: For saving exploration notes
- **project-orchestration**: For planning exploration strategy
- **testing-patterns**: For learning through tests

## Tips

- Start wide, then narrow focus
- Document assumptions to validate
- Use tests as documentation
- Follow imports/exports
- Check git history for context
- Look for comments explaining "why"

Related Skills

taxonomy-modeling-design

5
from organvm-iv-taxis/a-i--skills

Phase 2 of the pentaphase structural-overhaul protocol. Classifies entities, standardizes attributes, establishes relationships, and designs the access framework. Use when the user invokes phase 2 of an overhaul, asks to "design the taxonomy" or "model the structure", or has completed a landscape audit and is ready to redesign. Consumes phase-1-landscape-report.md; produces phase-2-taxonomy-model.md.

systemic-ingestion-normalization

5
from organvm-iv-taxis/a-i--skills

Phase 4 of the pentaphase structural-overhaul protocol. Purges redundancies, enriches and aligns legacy entities to the new schema, executes phased ingestion into the new environment, and audits integrity. Use when the user invokes phase 4 of an overhaul, asks to "migrate the data" or "ingest into the new system", or has a configured environment ready to accept legacy entities. Consumes phase-3-environment-spec.md; produces phase-4-ingestion-report.md.

system-environment-configuration

5
from organvm-iv-taxis/a-i--skills

Phase 3 of the pentaphase structural-overhaul protocol. Translates the taxonomy model into objective technical criteria, evaluates candidate mechanisms or frameworks, instantiates the chosen architecture, and programs validation rules. Use when the user invokes phase 3 of an overhaul, asks to "select a system" or "configure the environment", or has a taxonomy model and is ready to choose technology. Consumes phase-2-taxonomy-model.md; produces phase-3-environment-spec.md.

pentaphase-orchestrator

5
from organvm-iv-taxis/a-i--skills

Threads the full five-phase structural-overhaul protocol — landscape discovery, taxonomy design, environment configuration, systemic ingestion, governance evolution — for any substrate the user names. Use when the user requests a structural overhaul, system redesign, or end-to-end restructuring of a documentation system, asset registry, code monorepo, knowledge base, or operational workflow; or when they explicitly invoke the pentaphase methodology. Coordinates handoffs between phase-skills and seats validation gates between phases.

landscape-discovery-audit

5
from organvm-iv-taxis/a-i--skills

Phase 1 of the pentaphase structural-overhaul protocol. Inventories assets, maps current flow, identifies friction, and defines value metrics for any substrate. Use when the user invokes phase 1 of an overhaul, requests a baseline audit, asks to "discover the landscape" of a system, or wants to understand current state before redesigning. Produces phase-1-landscape-report.md.

governance-evolution-protocol

5
from organvm-iv-taxis/a-i--skills

Phase 5 of the pentaphase structural-overhaul protocol. Codifies operational protocols, onboards the ecosystem of participants, programs behavior monitoring, and establishes an iteration cadence so the substrate evolves rather than calcifies. Use when the user invokes phase 5 of an overhaul, asks to "establish governance" or "lock in the protocols", or has completed ingestion and is ready to declare the substrate operational. Consumes phase-4-ingestion-report.md; produces phase-5-governance-charter.md, which closes the protocol.

dimension-surfacing

5
from organvm-iv-taxis/a-i--skills

Surfaces the parallel domain dimensions implicit in a dense or minimal prompt. Use when a user prompt is small on the surface but plainly implies multiple independent domains needing different expertise; when explicitly invoked by the coliseum-orchestrator skill as Phase 1; or when the user asks "what dimensions does this prompt encode" or "what axes does this break into." Produces a named dimension set where each dimension is independently executable and not a paraphrase of another.

coliseum-dispatch

5
from organvm-iv-taxis/a-i--skills

Dispatches a composed set of assignment envelopes to domain-expert subagents in parallel, in a single message with multiple Agent tool calls. Enforces the no-pingpong gate via the pingpong-detector agent before any dispatch fires. Use when invoked by the coliseum-orchestrator as Phase 3; when envelopes are already composed and the next step is parallel execution; or when the user asks to "fan out" or "dispatch in parallel." Produces a dispatch log capturing what was sent, when, and where returns land.

assignment-composition

5
from organvm-iv-taxis/a-i--skills

Wraps each surfaced dimension as a self-contained 9-section autonomous-work-assignment envelope — scope, context, success criteria, allowed tools, return format, handoff — all the recipient subagent needs to execute without coming back. Use when invoked by coliseum-orchestrator as Phase 2; when dimensions are named and the next step is to make each independently dispatchable; or when the user asks "compose this as an assignment." The no-pingpong gate validates each envelope before dispatch.

workspace-autopsy-governance

5
from organvm-iv-taxis/a-i--skills

Conducts a full automated autopsy of the current workspace directory to map files, identifies structural issues, proposes a restructuring plan (the signal), and establishes unified governance using templates. Use this skill when a user asks to map, restructure, reorganize, or apply new governance to an existing messy repository.

workshop-presentation-design

5
from organvm-iv-taxis/a-i--skills

Design engaging workshops, conference talks, and educational presentations. Covers learning objectives, activity design, slide craft, and facilitation techniques. Triggers on workshop design, presentation prep, talk structure, or training session requests.

webhook-integration-patterns

5
from organvm-iv-taxis/a-i--skills

Designs reliable webhook systems with proper delivery guarantees, retry logic, signature verification, and idempotent processing for event-driven integrations.