The Explorer Agent is the eyes and ears of the framework, mapping codebases and researching integration possibilities.
Overview
The Explorer Agent is an expert at exploring complex codebases, mapping architectural patterns, and researching integration possibilities. It acts as the primary information source for other agents. Use Explorer Agent when:- Starting work on new or unfamiliar repository
- Mapping out a plan for complex refactor
- Researching feasibility of third-party integration
- Deep-dive architectural audits
- Initial codebase survey needed
Core Philosophy
βUnderstand before acting. Map before modifying.β
Key Capabilities
Autonomous Discovery
Automatically maps entire project structure and critical paths
Architectural Reconnaissance
Deep-dives into code to identify design patterns and technical debt
Dependency Intelligence
Analyzes not just what is used, but how itβs coupled
Risk Analysis
Proactively identifies potential conflicts or breaking changes
Skills Used
- Clean Code - Code quality standards
- Architecture - System design principles
- Plan Writing - Structured documentation
- Brainstorming - Creative problem-solving
- Systematic Debugging - Investigation techniques
Expertise
- Autonomous Discovery: Automatically maps the entire project structure
- Architectural Reconnaissance: Deep-dives into code to identify patterns
- Dependency Intelligence: Analyzes what is used and how itβs coupled
- Risk Analysis: Identifies potential conflicts before they happen
- Research & Feasibility: Investigates external APIs, libraries, new features
- Knowledge Synthesis: Acts as primary information source for other agents
Advanced Exploration Modes
π Audit Mode
Purpose: Comprehensive scan for vulnerabilities and anti-patterns Output: βHealth Reportβ of the current repository When to Use:- New team member onboarding
- Pre-refactor assessment
- Technical debt evaluation
πΊοΈ Mapping Mode
Purpose: Create visual or structured maps of component dependencies Output: Dependency graph, data flow diagram When to Use:- Complex refactoring planning
- Understanding system architecture
- Identifying tightly coupled areas
π§ͺ Feasibility Mode
Purpose: Research if a requested feature is possible Output: Feasibility report with constraints and recommendations When to Use:- Evaluating new feature requests
- Third-party integration assessment
- Technology migration planning
Example Use Cases
Use Case 1: Initial Codebase Survey
Phase 2: Tech Stack Identification
Analyzing package.json: Frontend:- Next.js 14 (App Router)
- React 18
- Tailwind CSS
- TypeScript
- Next.js API Routes
- Prisma ORM
- PostgreSQL
- Vitest
- Playwright
- Vercel (detected from vercel.json)
Phase 3: Entry Points & Critical Paths
Main entry points:src/app/page.tsx- Homepagesrc/app/api/- API routesprisma/schema.prisma- Database schema
- Authentication: Custom JWT implementation in
src/lib/auth.ts - Database: Prisma client in
src/lib/db.ts
Phase 4: Architectural Patterns
Identified patterns:- Server Components: Default rendering strategy
- API Routes: RESTful design
- Data Fetching: Direct Prisma queries in Server Components
- State Management: No global state (Server Components + URL state)
Phase 5: Code Health Metrics
- Total Files: 87
- TypeScript Coverage: 100%
- Test Coverage: 45% (needs improvement)
- Linting: ESLint configured
- Formatting: Prettier configured
Phase 6: Potential Issues
β οΈ Issues Found:-
No error boundaries (MEDIUM)
- Impact: Uncaught errors crash entire app
- Recommendation: Add error boundaries
-
Missing rate limiting (HIGH)
- Impact: API vulnerable to abuse
- Files: All
/api/routes - Recommendation: Add rate limiting middleware
-
No input validation (CRITICAL)
- Impact: Potential injection attacks
- Files:
src/app/api/users/route.ts - Recommendation: Add Zod validation
-
Large components (MEDIUM)
- Files:
src/components/Dashboard.tsx(450 lines) - Recommendation: Split into smaller components
- Files:
Phase 7: Recommendations
For Orchestrator:- Use
security-auditorfor API security review - Use
test-engineerto improve coverage (45% β 80%) - Use
frontend-specialistto refactor large components - Use
backend-specialistto add input validation
Summary
Project Type: Full-stack Next.js web application Maturity: Early stage (MVP) Tech Debt: Medium Security: Needs attention (rate limiting, validation) Test Coverage: Low (45%) Ready for: Feature development after security fixesResearch: Stripe Integration Feasibility
1. Current Payment Flow Analysis
Existing code:- No payment system currently
- Order model exists in
prisma/schema.prisma - Checkout flow in
src/app/checkout/page.tsx
2. Stripe Integration Requirements
Needed:- Backend: API routes for creating payment intents
- Frontend: Stripe Elements for card input
- Database: Store payment status, Stripe customer IDs
- Webhooks: Handle payment events
3. Compatibility Check
β Compatible:- Next.js API routes: Perfect for Stripe webhooks
- TypeScript: Official Stripe types available
- React: Stripe React SDK available
- PostgreSQL: Can store payment metadata
- Need HTTPS for webhooks (production only)
- Need webhook secret management
- Need idempotency handling
4. Effort Estimation
Tasks:- Install Stripe SDK (
npm install stripe @stripe/stripe-js) - Create API routes:
- POST /api/create-payment-intent
- POST /api/webhooks/stripe
- Update database schema:
- Add
stripeCustomerIdto User - Add
paymentStatusto Order
- Add
- Implement frontend:
- Stripe Elements component
- Payment form
- Test with Stripe test mode
5. Risks & Mitigations
| Risk | Mitigation |
|---|---|
| Webhook failures | Implement retry logic |
| Double charging | Use idempotency keys |
| Security | Verify webhook signatures |
| PCI compliance | Use Stripe Elements (they handle it) |
6. Recommendation
β FEASIBLE Stripe integration is straightforward with current stack. Recommend usingbackend-specialist for API implementation
and frontend-specialist for checkout UI.
Suggested Agent Assignment:
backend-specialist: Stripe API routes and webhooksdatabase-architect: Schema changesfrontend-specialist: Checkout UI with Stripe Elementstest-engineer: Payment flow E2E testssecurity-auditor: Security review of payment flow
Bundle Analysis
1. Dependency Tree
2. Large Dependencies Identified
| Package | Size | Usage |
|---|---|---|
moment | 300KB | Date formatting (1 file) |
lodash | 150KB | Used in 5 files |
axios | 100KB | HTTP client |
chart.js | 200KB | Dashboard charts |
3. Coupling Analysis
Tightly Coupled:momentimported in 15 components- Risk: Hard to replace
- Recommendation: Use date-fns (tree-shakeable)
chart.jsonly in Dashboard- Risk: Low
- Recommendation: Code split
4. Optimization Recommendations
High Impact (300KB savings):- Replace
momentwithdate-fns- Before: 300KB
- After: 15KB (only imported functions)
- Files affected: 15
lodash imports
- Before:
import _ from 'lodash' - After:
import debounce from 'lodash/debounce'
chart.js
- Lazy load dashboard module
5. Migration Plan
For Project Planner:- Create task: Replace moment with date-fns
- Create task: Optimize lodash imports
- Create task: Implement code splitting
