// Automatically search indexed code when user asks questions about the codebase. Detects code-related queries and uses semantic memory to find relevant files. Activates for questions like "how does X work", "where is Y", "show me Z implementation".
| name | semantic-search |
| description | Automatically search indexed code when user asks questions about the codebase. Detects code-related queries and uses semantic memory to find relevant files. Activates for questions like "how does X work", "where is Y", "show me Z implementation". |
| auto-activate | true |
Auto-search code using semantic memory when user asks codebase questions.
This skill activates when ALL of these conditions are met:
User question contains code-related keywords:
Current project appears to be indexed:
query_memory callQuestion is about THIS codebase:
Extract the search query from user's natural language question:
Examples:
Adjust parameters based on query type:
Specific queries (class names, function names):
query_memory(
query="UserModel class definition",
max_results=5,
similarity_threshold=0.8 # Higher threshold for precision
)
Conceptual queries (how does X work):
query_memory(
query="authentication work flow",
max_results=10,
similarity_threshold=0.7 # Normal threshold
)
Exploratory queries (find all X, show me Y):
query_memory(
query="API endpoints routes",
max_results=15,
similarity_threshold=0.6 # Lower threshold, more results
)
Specific Queries (user looking for exact thing):
Conceptual Queries (user wants to understand):
Broad Queries (exploration/discovery):
Don't just dump search results - use them to answer the question:
Good Answer Pattern:
[Direct answer to user's question]
[Explanation based on retrieved code]
[Reference specific files with similarity scores as percentages]
[Offer to explain further or dive deeper]
Example:
User: "How does authentication work?"
Response:
Authentication in this project uses JWT tokens:
1. **Login Flow** (auth/login.py, 92% match):
- User submits credentials to /api/login
- Validates against database
- Generates JWT token with user ID and expiration
- Returns token in HTTP-only cookie
2. **Request Authentication** (middleware/auth.py, 89% match):
- Middleware intercepts protected routes
- Extracts JWT from cookie
- Verifies signature and expiration
- Adds user object to request context
3. **Session Management** (auth/session.py, 85% match):
- Stores active sessions in Redis
- Implements token refresh mechanism
- 1-hour token expiry, 7-day refresh window
The main entry point is the authenticate_request() middleware function
that runs on every protected route.
Would you like me to explain any of these components in more detail?
DO NOT activate for:
❌ General programming questions:
❌ External library questions:
❌ Non-code questions:
❌ Project is not indexed:
setup-assistant skill handle this caseInform user and suggest alternatives:
I couldn't find exact matches for "[query]" in the indexed code.
This could mean:
- The feature uses different terminology
- The code hasn't been indexed yet (run /status to check)
- Try broader search terms
Would you like me to:
- Search for related concepts? (suggest alternative query)
- Check indexing status?
- Use traditional grep search instead?
I found some potentially related code:
[Show results with caveat]
These matches have lower confidence scores. The feature might use
different terminology, or these could be tangentially related.
Would you like me to:
- Try a broader search?
- Search for alternative terms?
When presenting scores to users, use percentages and context:
Work seamlessly with:
/search command: User's explicit search takes precedencesetup-assistant skill: If project not indexed, defer to setupThis skill is successful when:
/search command