developer-detective
⚡ Implementation analysis skill. Best for: 'how does X work', 'find implementation of', 'trace data flow', 'where is X defined', 'find all usages'. Uses claudemem AST with callers/callees for efficient code tracing.
What this skill does
# Developer Detective Skill
This skill uses claudemem's callers/callees analysis for implementation investigation.
## Why Claudemem Works Better for Development
| Task | claudemem | Native Tools |
|------|-----------|--------------|
| Find usages | `callers` shows all call sites | Grep (text match) |
| Trace dependencies | `callees` shows called functions | Manual reading |
| Understand context | `context` gives full picture | Multiple reads |
| Impact analysis | Caller chain reveals risk | Unknown |
**Primary commands:**
- `claudemem --agent callers <name>` - What calls this code
- `claudemem --agent callees <name>` - What this code calls
- `claudemem --agent context <name>` - Full understanding
# Developer Detective Skill
**Version:** 3.3.0
**Role:** Software Developer
**Purpose:** Implementation investigation using AST callers/callees and impact analysis
## Role Context
You are investigating this codebase as a **Software Developer**. Your focus is on:
- **Implementation details** - How code actually works
- **Data flow** - How data moves through the system (via callees)
- **Usage patterns** - How code is used (via callers)
- **Dependencies** - What a function needs to work
- **Impact analysis** - What breaks if you change something
## Why callers/callees is Perfect for Development
The `callers` and `callees` commands show you:
- **callers** = Every place that calls this code (impact of changes)
- **callees** = Every function this code calls (its dependencies)
- **Exact file:line** = Precise locations for reading/editing
- **Call kinds** = call, import, extends, implements
## Developer-Focused Commands (v0.3.0)
### Find Implementation
```bash
# Find where a function is defined
claudemem --agent symbol processPayment
# Get full context with callers and callees
claudemem --agent context processPayment```
### Trace Data Flow
```bash
# What does this function call? (data flows OUT)
claudemem --agent callees processPayment
# Follow the chain
claudemem --agent callees validateCardclaudemem --agent callees chargeStripe```
### Find All Usages
```bash
# Who calls this function? (usage patterns)
claudemem --agent callers processPayment
# This shows EVERY place that uses this code
```
### Impact Analysis (v0.4.0+ Required)
```bash
# Before modifying ANY code, check full impact
claudemem --agent impact functionToChange
# Output shows ALL transitive callers:
# direct_callers:
# - LoginController.authenticate:34
# - SessionMiddleware.validate:12
# transitive_callers (depth 2):
# - AppRouter.handleRequest:45
# - TestSuite.runAuth:89
```
**Why impact matters**:
- `callers` shows only direct callers (1 level)
- `impact` shows ALL transitive callers (full tree)
- Critical for refactoring decisions
**Handling Empty Results:**
```bash
IMPACT=$(claudemem --agent impact functionToChange)
if echo "$IMPACT" | grep -q "No callers"; then
echo "No callers found. This is either:"
echo " 1. An entry point (API handler, main function) - expected"
echo " 2. Dead code - verify with: claudemem dead-code"
echo " 3. Dynamically called - check for import(), reflection"
fi
```
### Impact Analysis (BEFORE Modifying)
```bash
# Quick check - direct callers only (v0.3.0)
claudemem --agent callers functionToChange
# Deep check - ALL transitive callers (v0.4.0+ Required)
IMPACT=$(claudemem --agent impact functionToChange)
# Handle results
if [ -z "$IMPACT" ] || echo "$IMPACT" | grep -q "No callers"; then
echo "No static callers found - verify dynamic usage patterns"
else
echo "$IMPACT"
echo ""
echo "This tells you:"
echo "- Direct callers (immediate impact)"
echo "- Transitive callers (ripple effects)"
echo "- Grouped by file (for systematic updates)"
fi
```
### Understanding Complex Code
```bash
# Get full picture: definition + callers + callees
claudemem --agent context complexFunction```
## PHASE 0: MANDATORY SETUP
### Step 1: Verify claudemem v0.3.0
```bash
which claudemem && claudemem --version
# Must be 0.3.0+
```
### Step 2: If Not Installed → STOP
Use AskUserQuestion (see ultrathink-detective for template)
### Step 3: Check Index Status
```bash
# Check claudemem installation and index
claudemem --version && ls -la .claudemem/index.db 2>/dev/null
```
### Step 3.5: Check Index Freshness
Before proceeding with investigation, verify the index is current:
```bash
# First check if index exists
if [ ! -d ".claudemem" ] || [ ! -f ".claudemem/index.db" ]; then
# Use AskUserQuestion to prompt for index creation
# Options: [1] Create index now (Recommended), [2] Cancel investigation
exit 1
fi
# Count files modified since last index
STALE_COUNT=$(find . -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" -o -name "*.py" -o -name "*.go" -o -name "*.rs" \) \
-newer .claudemem/index.db 2>/dev/null | grep -v "node_modules" | grep -v ".git" | grep -v "dist" | grep -v "build" | wc -l)
STALE_COUNT=$((STALE_COUNT + 0)) # Normalize to integer
if [ "$STALE_COUNT" -gt 0 ]; then
# Get index time with explicit platform detection
if [[ "$OSTYPE" == "darwin"* ]]; then
INDEX_TIME=$(stat -f "%Sm" -t "%Y-%m-%d %H:%M" .claudemem/index.db 2>/dev/null)
else
INDEX_TIME=$(stat -c "%y" .claudemem/index.db 2>/dev/null | cut -d'.' -f1)
fi
INDEX_TIME=${INDEX_TIME:-"unknown time"}
# Get sample of stale files
STALE_SAMPLE=$(find . -type f \( -name "*.ts" -o -name "*.tsx" \) \
-newer .claudemem/index.db 2>/dev/null | grep -v "node_modules" | grep -v ".git" | head -5)
# Use AskUserQuestion (see template in ultrathink-detective)
fi
```
### Step 4: Index if Needed
```bash
claudemem index
```
---
## Workflow: Implementation Investigation (v0.3.0)
### Phase 1: Map the Area
```bash
# Get overview of the feature area
claudemem --agent map "payment processing"```
### Phase 2: Find the Entry Point
```bash
# Locate the main function (highest PageRank in area)
claudemem --agent symbol PaymentService```
### Phase 3: Trace the Flow
```bash
# What does PaymentService call?
claudemem --agent callees PaymentService
# For each major callee, trace further
claudemem --agent callees validatePaymentclaudemem --agent callees processChargeclaudemem --agent callees saveTransaction```
### Phase 4: Understand Usage
```bash
# Who uses PaymentService?
claudemem --agent callers PaymentService
# This shows the entry points
```
### Phase 5: Read Specific Code
```bash
# Now read ONLY the relevant file:line ranges from results
# DON'T read whole files
```
## Output Format: Implementation Report
### 1. Symbol Overview
```
┌─────────────────────────────────────────────────────────┐
│ IMPLEMENTATION ANALYSIS │
├─────────────────────────────────────────────────────────┤
│ Symbol: processPayment │
│ Location: src/services/payment.ts:45-89 │
│ Kind: function │
│ PageRank: 0.034 │
│ Search Method: claudemem v0.3.0 (AST analysis) │
└─────────────────────────────────────────────────────────┘
```
### 2. Data Flow (Callees)
```
processPayment
├── validateCard (src/validators/card.ts:12)
├── getCustomer (src/services/customer.ts:34)
├── chargeStripe (src/integrations/stripe.ts:56)
│ └── stripe.charges.create (external)
└── saveTransaction (src/repositories/transaction.ts:78)
└── database.insert (src/db/index.ts:23)
```
### 3. Usage (Callers)
```
processPayment is called by:
├── CheckoutController.submit (src/controllers/checkout.ts:45)
├── SubscriptionService.renew (src/services/subscription.ts:89)
└── RetryQueue.processPayment (src/workers/retry.ts:23)
```
### 4. Impact Analysis
```
⚠️ IMPACT: Changing processPayment will affect:
- 3 direct callers (shown above)
- Checkout flow (user-facing)
- Subscription renewals (automated)
- Payment retry logic (background)
```
## Scenarios
### Scenario: "How does XRelated in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.