code-search-selector
⚡ AUTO-INVOKE when user asks: 'audit', 'investigate', 'how does X work', 'find all', 'where is', 'trace', 'understand', 'map the codebase', 'comprehensive'. MUST run BEFORE Read/Glob when planning to read 3+ files. Prevents tool familiarity bias toward native tools.
What this skill does
# ⛔ MANDATORY CODE SEARCH GATE ⛔
```
╔══════════════════════════════════════════════════════════════════════════════╗
║ ║
║ ⚡ THIS SKILL AUTO-TRIGGERS ON THESE KEYWORDS: ║
║ ║
║ "audit" | "investigate" | "how does X work" | "find all" | "where is" ║
║ "trace" | "understand" | "map the codebase" | "comprehensive" ║
║ "all integration points" | "find implementations" | "architecture" ║
║ ║
║ 🚫 INTERCEPTION: Triggers when about to Read 3+ files OR Glob broadly ║
║ ║
╚══════════════════════════════════════════════════════════════════════════════╝
```
## Why This Gate Exists
**The Tool Familiarity Bias Problem:**
You have "native" tools (Read, Glob, Grep) that are always available with predictable output. These feel safe. But they produce INFERIOR results for semantic queries.
**The "Known File Path" Trap:**
When a prompt mentions specific file paths, your instinct is to Read directly. RESIST THIS. Semantic search provides CONTEXT around those files that direct reads miss.
**The Parallelization Excuse:**
"Let me Read files while agents work" is inefficient. Claudemem's indexed data is FASTER and provides better context.
This skill ensures you use the RIGHT tool for code search tasks. Using Grep when claudemem is indexed is a critical mistake that produces inferior results.
## The Problem This Solves
```
❌ WRONG: User asks "How does authentication work?"
→ You use: grep -r "auth" src/
→ Result: 500 lines of noise, no understanding
✅ RIGHT: User asks "How does authentication work?"
→ You check: claudemem status
→ You use: claudemem search "authentication login flow JWT"
→ Result: Top 10 semantically relevant code chunks
```
## MANDATORY Decision Tree
### Step 1: Classify the Task
```
┌─────────────────────────────────────────────────────────────────┐
│ WHAT IS THE USER ASKING? │
├─────────────────────────────────────────────────────────────────┤
│ │
│ "Find all X" → SEMANTIC (go to Step 2) │
│ "How does X work" → SEMANTIC (go to Step 2) │
│ "Audit X integration" → SEMANTIC (go to Step 2) │
│ "Map the data flow" → SEMANTIC (go to Step 2) │
│ "Understand architecture" → SEMANTIC (go to Step 2) │
│ "Trace X through code" → SEMANTIC (go to Step 2) │
│ "Find implementations" → SEMANTIC (go to Step 2) │
│ "What patterns are used" → SEMANTIC (go to Step 2) │
│ │
│ "Find exact string 'foo'" → EXACT MATCH (use Grep, skip tree) │
│ "Count occurrences of X" → EXACT MATCH (use Grep, skip tree) │
│ "Find symbol UserService" → EXACT MATCH (use Grep, skip tree) │
│ │
└─────────────────────────────────────────────────────────────────┘
```
### Step 2: Check claudemem Status (MANDATORY for Semantic)
```bash
# ALWAYS run this before semantic search
claudemem status
```
**Interpret the output:**
| Status | What It Means | Next Action |
|--------|---------------|-------------|
| Shows chunk count (e.g., "938 chunks") | ✅ Indexed | **USE CLAUDEMEM** (Step 3) |
| "No index found" | ❌ Not indexed | Offer to index (Step 2b) |
| "command not found" | ❌ Not installed | Fall back to Detective agent |
### Step 2b: If Not Indexed, Offer to Index
```typescript
AskUserQuestion({
questions: [{
question: "Claudemem is not indexed. Index now for better semantic search results?",
header: "Index?",
multiSelect: false,
options: [
{ label: "Yes, index now (Recommended)", description: "Takes 1-2 minutes, enables semantic search" },
{ label: "No, use grep instead", description: "Faster but less accurate for semantic queries" }
]
}]
})
```
If user says yes:
```bash
claudemem index -y
```
### Step 3: Execute the Search
**IF CLAUDEMEM IS INDEXED (from Step 2):**
```bash
# Get role-specific guidance first
claudemem ai developer # or architect, tester, debugger
# Then search semantically
claudemem search "authentication login JWT token validation" -n 15
```
**IF CLAUDEMEM IS NOT AVAILABLE:**
Use the detective agent:
```typescript
Task({
subagent_type: "code-analysis:detective",
description: "Investigate [topic]",
prompt: "Use semantic search to find..."
})
```
### Step 4: NEVER Do This
```
╔══════════════════════════════════════════════════════════════════╗
║ ❌ FORBIDDEN when claudemem is indexed: ║
║ ║
║ grep -r "pattern" src/ # Use claudemem search instead ║
║ Grep tool for semantic queries # Use claudemem search instead ║
║ Glob to find implementations # Use claudemem search instead ║
║ find . -name "*.ts" | xargs... # Use claudemem search instead ║
║ ║
║ These tools are for EXACT MATCHES only, not semantic search. ║
╚══════════════════════════════════════════════════════════════════╝
```
## Task-to-Tool Mapping Reference
| User Request | ❌ DON'T Use | ✅ DO Use |
|--------------|-------------|----------|
| "Audit all API endpoints" | `grep -r "router\|endpoint"` | `claudemem search "API endpoint route handler"` |
| "How does auth work?" | `grep -r "auth\|login"` | `claudemem search "authentication login flow"` |
| "Find all database queries" | `grep -r "prisma\|query"` | `claudemem search "database query SQL prisma"` |
| "Map the data flow" | `grep -r "transform\|map"` | `claudemem search "data transformation pipeline"` |
| "What's the architecture?" | `ls -la src/` | `claudemem search "architecture layer service"` |
| "Find error handling" | `grep -r "catch\|error"` | `claudemem search "error handling exception"` |
| "Trace user creation" | `grep -r "createUser"` | `claudemem search "user creation registration"` |
## When Grep IS Appropriate
✅ **Use Grep for:**
- Finding exact string: `grep -r "DEPRECATED_FLAG" src/`
- Counting occurrences: `grep -c "import React" src/**/*.tsx`
- Finding specific symbol: `grep -r "class UserService" src/`
- Regex patterns: `grep -r "TODO:\|FIXME:" src/`
❌ **Never use Grep for:**
- Understanding how something works
- Finding implementations by concept
- Architecture analysis
- Tracing data flow
- Auditing integrations
## Integration with Detective Skills
After using this skill's decision tree, invoke the appropriate detective:
| Investigation Type | Detective Skill |
|-------------------|-----------------|
| Architecture patterns | `code-analysis:architect-detective` |
| Implementation details | `code-analysis:developer-detective` |
| Test coverage | `code-analysis:tester-detective` |
| Bug root cause | `code-analysis:debugger-detective` |
| Comprehensive audit | `code-analysis:ultrathink-detective` |
## Quick Reference Card
```
┌─────────────────────────────────────────────────────────────────┐
│ CODE SEARCH QUICK REFERENCE │
├─────────────────────────────────────────────────────────────────┤
│ │
│ 1. ALWAYS check first: claudemem status │
│ │
│ 2. If indexed: claudemem search "semantic query" │
│ │
│ 3. For exact matches: Grep tool (only this case!) │
│ Related in Security
mac-ops
IncludedComprehensive macOS workstation operations — diagnose kernel panics, identify failing drives, audit launchd startup items, decode wake reasons, triage TCC permission denials, manage APFS snapshots, recover from no-boot. Use for: Mac is slow, slow bootup, won't boot, kernel panic, kernel_task hot, mds_stores CPU, photoanalysisd, cloudd, login loop, gray screen, sleep wake failure, drive failing, IO errors, APFS snapshots eating space, Time Machine local snapshots, Spotlight indexing, launchd, LaunchAgent, LaunchDaemon, login items, TCC permissions, Full Disk Access, Screen Recording denied, Gatekeeper, quarantine, com.apple.quarantine, app is damaged, helper tool, /Library/PrivilegedHelperTools, pmset, wake reasons, dark wake, sysdiagnose, panic.ips, DiagnosticReports, configuration profile, MDM profile, remote diagnostics over SSH.
a11y-audit
IncludedRun accessibility audits on web projects combining automated scanning (axe-core, Lighthouse) with WCAG 2.1 AA compliance mapping, manual check guidance, and structured reporting. Output is configurable: markdown report only, markdown plus machine-readable JSON, or markdown plus issue tracker integration. Use this skill whenever the user mentions "accessibility audit", "a11y audit", "WCAG audit", "accessibility check", "compliance scan", or asks to check a web project for accessibility issues. Also trigger when the user wants to verify WCAG conformance or map findings to a specific standard (CAN-ASC-6.2, EN 301 549, ADA/AODA).
erpclaw
IncludedAI-native ERP system with self-extending OS. Full accounting, invoicing, inventory, purchasing, tax, billing, HR, payroll, advanced accounting (ASC 606/842, intercompany, consolidation), and financial reporting. 413 actions across 14 domains, 43 expansion modules. Constitutional guardrails, adversarial audit, schema migration. Double-entry GL, immutable audit trail, US GAAP.
assess
IncludedAssesses and rates quality 0-10 across multiple dimensions (correctness, maintainability, security, performance, testability, simplicity) with pros/cons analysis. Compares against project conventions and prior decisions from memory. Produces structured evaluation reports with actionable improvement suggestions. Use when evaluating code, designs, architectures, or comparing alternative approaches.
spring-boot-security-jwt
IncludedProvides JWT authentication and authorization patterns for Spring Boot 3.5.x covering token generation with JJWT, Bearer/cookie authentication, database/OAuth2 integration, and RBAC/permission-based access control using Spring Security 6.x. Use when implementing authentication or authorization in Spring Boot applications.
code-hardcode-audit
IncludedDetect hardcoded values, magic numbers, and leaked secrets. TRIGGERS - hardcode audit, magic numbers, PLR2004, secret scanning.