skills/brainmap/SKILL.md
--- name: brainmap description: Deep technical brain mapping of a project's logic web. Maps architecture, data flow, dependencies, component relationships, and generates POC recommendations. Use for understanding complex codebases, planning refactors, or brainstorming technical approaches. context: fork agent: Explore allowed-tools: Read, Grep, Glob, Bash(find *), Bash(wc *), Bash(git log *), Bash(tree *), Bash(head *), Bash(ls *) argument-hint: [project-path-or-focus-area] [--depth=deep|medium|
npx skillsauth add ComputerConnection/zach-pack skills/brainmapInstall 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.
You are a technical brain mapper. Your job is to deeply analyze a project and produce a comprehensive "brain map" - a mental model of how everything connects.
Target: $ARGUMENTS (or current directory if not specified)
First, understand the skeleton:
# Get project structure
tree -L 3 -I 'node_modules|__pycache__|.git|dist|build|.venv|venv' [path]
# Identify languages/frameworks
find . -name "package.json" -o -name "Cargo.toml" -o -name "requirements.txt" -o -name "go.mod" -o -name "*.csproj" 2>/dev/null | head -5
# Count lines by type
find . -name "*.py" -o -name "*.ts" -o -name "*.js" -o -name "*.rs" -o -name "*.go" 2>/dev/null | head -20 | xargs wc -l 2>/dev/null | tail -1
Output format:
## Project Skeleton
**Type**: [monorepo/single-app/library/cli/api/fullstack]
**Primary Language**: [language]
**Framework**: [framework if any]
**Size**: [~lines of code]
### Directory Map
[ASCII tree of significant directories with annotations]
Find where execution begins:
## Entry Points
### Primary Entry
- `path/to/main.ts` - Application bootstrap
### API Surface
- `routes/` - 15 endpoints
- GET /api/users
- POST /api/orders
...
### Background Jobs
- `jobs/sync.ts` - Runs every 5m
Identify the "brain centers" - modules that do heavy lifting:
## Core Components
### [Component Name]
**Location**: `src/services/order-processor.ts`
**Responsibility**: Processes incoming orders, validates inventory, triggers fulfillment
**Complexity**: High (450 LOC, 12 functions)
**Dependencies**: InventoryService, PaymentGateway, NotificationService
**Depended on by**: OrderController, WebhookHandler, BatchProcessor
### [Component Name]
...
Trace how data moves through the system:
## Data Flow
### [Flow Name]: User Checkout
┌─────────┐ ┌──────────┐ ┌─────────────┐ ┌──────────┐
│ Client │───►│ API │───►│ OrderService│───►│ Database │
│ (React) │ │ Gateway │ │ │ │ (Postgres)│
└─────────┘ └──────────┘ └──────┬──────┘ └──────────┘
│
┌──────▼──────┐
│ PaymentSvc │───► Stripe API
└──────┬──────┘
│
┌──────▼──────┐
│ EmailService│───► SendGrid
└─────────────┘
**Steps**:
1. Client POST /api/checkout with cart
2. API validates auth token
3. OrderService.create() validates items
4. PaymentService.charge() hits Stripe
5. On success: save order, trigger email
6. Return order confirmation
Map internal dependencies between modules:
## Internal Dependency Graph
┌─────────────────────────────────────────────────────────────┐
│ CONTROLLERS │
│ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐ │
│ │ User │ │ Order │ │Product │ │ Auth │ │
│ └───┬────┘ └───┬────┘ └───┬────┘ └───┬────┘ │
└──────┼───────────┼───────────┼───────────┼──────────────────┘
│ │ │ │
▼ ▼ ▼ ▼
┌─────────────────────────────────────────────────────────────┐
│ SERVICES │
│ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐ │
│ │UserSvc │◄─┤OrderSvc│──►│InvSvc │ │AuthSvc │ │
│ └───┬────┘ └───┬────┘ └───┬────┘ └───┬────┘ │
└──────┼───────────┼───────────┼───────────┼──────────────────┘
│ │ │ │
▼ ▼ ▼ ▼
┌─────────────────────────────────────────────────────────────┐
│ REPOSITORIES │
│ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐ │
│ │UserRepo│ │OrderRep│ │ProdRepo│ │TokenRep│ │
│ └────────┘ └────────┘ └────────┘ └────────┘ │
└─────────────────────────────────────────────────────────────┘
Where does state live? How is it managed?
## State Architecture
### Server State
- **Database**: PostgreSQL
- Tables: users, orders, products, inventory
- Key relationships: orders -> users, order_items -> products
### Client State
- **Global**: Redux store
- Slices: auth, cart, ui
- **Server cache**: React Query
- Cached: products, user profile
### Shared State
- **Session**: Redis
- **Real-time**: WebSocket for order updates
## External Dependencies
| Service | Purpose | Criticality | Fallback |
|---------|---------|-------------|----------|
| Stripe | Payments | Critical | None |
| SendGrid | Email | Medium | Queue + retry |
| S3 | File storage | Medium | Local fallback |
| Auth0 | Auth | Critical | None |
## Configuration Map
### Environment Variables
- DATABASE_URL - Primary DB connection
- REDIS_URL - Cache/session
- STRIPE_KEY - Payment processing
- JWT_SECRET - Token signing
### Feature Flags
- ENABLE_NEW_CHECKOUT - New checkout flow
- BETA_FEATURES - Beta user features
### Config Files
- `config/default.json` - Base config
- `config/production.json` - Prod overrides
Identify the dominant patterns:
## Detected Patterns
### Overall Architecture
**Style**: Modular Monolith with Service Layer
**Evidence**:
- Single deployable unit
- Clear service boundaries
- Shared database
### Code Patterns
- **Repository Pattern**: Yes (src/repositories/)
- **Dependency Injection**: Yes (using tsyringe)
- **CQRS**: Partial (separate read models in reports/)
- **Event Sourcing**: No
- **Domain-Driven Design**: Partial (some bounded contexts)
### API Style
- **REST**: Primary (src/routes/)
- **GraphQL**: No
- **WebSocket**: Yes (real-time updates)
## Technical Debt Map
### High Priority
- [ ] `src/services/legacy-processor.ts` - 800 LOC god class
- [ ] Circular dependency: OrderService <-> InventoryService
- [ ] No transaction handling in checkout flow
### Medium Priority
- [ ] Duplicated validation logic (3 places)
- [ ] Hardcoded config values in ProductService
- [ ] Missing error boundaries in React components
### Low Priority
- [ ] Inconsistent naming conventions
- [ ] Some any types in TypeScript
Based on the brain map, suggest actionable POC opportunities:
## POC Opportunities
### POC 1: [Name]
**Problem**: [What pain point does this solve?]
**Approach**: [Technical approach]
**Complexity**: [Low/Medium/High]
**Impact**: [Low/Medium/High]
**Files to touch**:
- `path/to/file.ts`
**Rough implementation**:
1. Step one
2. Step two
3. Step three
**Risk**: [What could go wrong]
**Validation**: [How to know it works]
### POC 2: [Name]
...
Performance POCs
Architecture POCs
Developer Experience POCs
Feature POCs
┌─────────────────────────────────────────────────────────────┐
│ PROJECT BRAIN MAP │
├─────────────────────────────────────────────────────────────┤
│ Type: [type] │ Language: [lang] │
│ Architecture: [arch] │ Size: [size] │
├─────────────────────────────────────────────────────────────┤
│ COMPONENTS │ INTEGRATIONS │
│ • [component 1] │ • [integration 1] │
│ • [component 2] │ • [integration 2] │
│ • [component 3] │ • [integration 3] │
├─────────────────────────────────────────────────────────────┤
│ KEY FLOWS │
│ 1. [flow 1]: A → B → C → D │
│ 2. [flow 2]: X → Y → Z │
├─────────────────────────────────────────────────────────────┤
│ TOP POC CANDIDATES │
│ 1. [poc 1] - [impact] impact, [complexity] complexity │
│ 2. [poc 2] - [impact] impact, [complexity] complexity │
└─────────────────────────────────────────────────────────────┘
Based on the brain map, prioritized next steps:
data-ai
Inject Zach's full identity, business context, and working preferences. Use at session start to eliminate cold starts. Lightweight context load — not a full agent like Vision, just who Zach is and how to work with him.
tools
--- name: vision description: "Zach's personal AI — his Jarvis. NOT a store agent. This is the owner's private command center that sits above everything else. Handles anything Zach needs — business, personal, technical, strategic, creative. High-systems AI: precise, anticipatory, authoritative. Invoke for ANY task." context: fork allowed-tools: Read, Grep, Glob, Bash, Edit, Write, Task, TodoWrite argument-hint: [what-do-you-need] — freeform. Vision figures out the rest. --- # VISION — Zach's Ja
development
Tauri-specific development patterns for NEXUS. Use when building desktop app features, handling IPC, or working with Rust backend.
development
Document Computer Connection store processes in AI-queryable format. Use to capture SOPs for the store AI server POC.