From example-skills
Progressive context retrieval pattern for understanding unfamiliar codebases through iterative refinement
npx claudepluginhub organvm-iv-taxis/a-i--skills --plugin document-skillsThis skill uses the workspace's default tool permissions.
A systematic pattern for progressively exploring and understanding unfamiliar codebases through iterative context refinement.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Designs and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Designs, implements, and audits WCAG 2.2 AA accessible UIs for Web (ARIA/HTML5), iOS (SwiftUI traits), and Android (Compose semantics). Audits code for compliance gaps.
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: