distributions/claude/skills/iterative-code-exploration/SKILL.md
Progressive context retrieval pattern for understanding unfamiliar codebases through iterative refinement
npx skillsauth add a-organvm/a-i--skills iterative-code-explorationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
A systematic pattern for progressively exploring and understanding unfamiliar codebases through iterative context refinement.
When working with new codebases, you often don't know:
Standard approaches fail:
┌─────────────────────────────────────────────┐
│ │
│ ┌──────────┐ ┌──────────┐ │
│ │ DISCOVER │─────▶│ EVALUATE │ │
│ └──────────┘ └──────────┘ │
│ ▲ │ │
│ │ ▼ │
│ ┌──────────┐ ┌──────────┐ │
│ │ LOOP │◀─────│ REFINE │ │
│ └──────────┘ └──────────┘ │
│ │
│ Max 3-4 cycles, then synthesize │
└─────────────────────────────────────────────┘
Start with broad exploration:
# 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:
Assess discovered files for relevance:
# 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:
Focus on specific areas identified as relevant:
# 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:
Decision point - do you need more context?
Continue if:
Stop if:
Discover: Find similar existing features
grep -r "feature-name" src/
find . -name "*feature*"
Evaluate: Review implementation patterns
cat src/features/similar-feature/index.ts
Refine: Check tests and edge cases
cat src/features/similar-feature/*.test.ts
Loop: Trace dependencies until clear
Discover: Locate error origin
grep -r "error message" src/
git log -S "error message"
Evaluate: Understand surrounding context
cat path/to/file.ts | grep -A 20 -B 20 "error location"
Refine: Check call sites and callers
grep -r "functionName" --include="*.ts" src/
Loop: Expand context as needed
Discover: Map current structure
find src/ -name "*.ts" | xargs wc -l | sort -n
grep -r "class\|interface" --include="*.ts" src/ | wc -l
Evaluate: Identify coupling points
grep -r "import.*from.*module" src/ | cut -d: -f2 | sort | uniq -c | sort -rn
Refine: Find all usages
grep -r "ComponentName" --include="*.ts" src/
Loop: Ensure all references found
After each loop iteration, document:
## 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
Complements:
testing
Designs systems for encoding, scoring, and generating choreographic movement using Laban notation, computational geometry, and procedural animation principles.
tools
Manage monorepos and multi-package repositories with workspace tools, dependency management, selective builds, and change detection. Covers npm/pnpm workspaces, Turborepo, and Python monorepo patterns. Triggers on monorepo setup, workspace management, or multi-package repository requests.
development
Curated bundle for managing monorepos with containerized deployment pipelines. Includes monorepo management, Docker containerization, CI/CD deployment, and coding standards. Use when setting up or improving multi-package repository infrastructure.
development
Apply modular synthesis principles to system design, workflow architecture, and conceptual frameworks. Use when designing modular systems, creating architecture diagrams using synthesis metaphors, applying signal flow thinking to data pipelines, or translating between audio engineering and software concepts. Triggers on modular architecture design, signal flow diagrams, synthesis-inspired system thinking, or "oscillator/patch" metaphors.