Skip to content

Commit f2145a3

Browse files
committed
Update skill guidance for search-first workflow
1 parent b001f13 commit f2145a3

3 files changed

Lines changed: 22 additions & 19 deletions

File tree

skills/codealive-context-engine/SKILL.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: codealive-context-engine
3-
description: Semantic code search and AI-powered codebase Q&A across indexed repositories. Use when understanding code beyond local files, exploring dependencies, discovering cross-project patterns, planning features, debugging, or onboarding. Queries like "How does X work?", "Show me Y patterns", "How is library Z used?". Provides search (fast, returns file locations and descriptions) and chat-with-codebase (slower, costs more, but returns synthesized answers).
3+
description: Semantic code search and AI-powered codebase Q&A across indexed repositories. Use when understanding code beyond local files, exploring dependencies, discovering cross-project patterns, planning features, debugging, or onboarding. Queries like "How does X work?", "Show me Y patterns", "How is library Z used?". The default path is semantic search plus grep search; chat-with-codebase is slower, more expensive, and usually secondary.
44
---
55

66
# CodeAlive Context Engine
@@ -44,7 +44,9 @@ Do NOT retry the failed script until setup completes successfully.
4444
| **Artifact Relationships** | `relationships.py` | Fast | Low | Drilling into call graph, inheritance, references for one artifact |
4545
| **Chat with Codebase** | `chat.py` | Slow | High | Synthesized answers, architectural explanations |
4646

47-
**Cost guidance:** Search is lightweight and should be the default starting point. Chat with Codebase invokes an LLM on the server side, making it significantly more expensive per call — use it when you need a synthesized, ready-to-use answer rather than raw search results.
47+
**Cost guidance:** `semantic_search` and `grep_search` are the default starting point. Chat with Codebase invokes an LLM on the server side, can take up to 30 seconds, and is significantly more expensive per call — use it only when you need a synthesized, ready-to-use answer rather than raw search results.
48+
49+
**Highest-confidence guidance:** If your agent supports subagents and the task needs maximum reliability or depth, prefer a subagent-driven workflow that combines `search.py`, `grep.py`, `fetch.py`, `relationships.py`, and local file reads. `chat.py` is optional synthesis, not the default path.
4850

4951
**Three-step workflow (search → triage → load real content):**
5052
1. **Search** — find relevant code locations with descriptions and identifiers
@@ -110,7 +112,7 @@ python scripts/relationships.py "my-org/backend::src/models.py::User" --profile
110112
python scripts/relationships.py "my-org/backend::src/svc.py::Service" --profile allRelevant --max-count 200
111113
```
112114

113-
### 5. Chat with codebase (slower, richer answers)
115+
### 5. Chat with codebase (slower, optional synthesis)
114116

115117
```bash
116118
python scripts/chat.py "Explain the authentication flow" my-backend
@@ -211,7 +213,7 @@ python scripts/relationships.py <identifier> [--profile PROFILE] [--max-count N]
211213

212214
Sends your question to an AI consultant that has full context of the indexed codebase. Returns synthesized, ready-to-use answers. Supports conversation continuity for follow-ups.
213215

214-
**This is more expensive than search** because it runs an LLM inference on the server side. Prefer search when you just need to locate code. Use chat when you need explanations, comparisons, or architectural analysis.
216+
**This is more expensive than search** because it runs an LLM inference on the server side. Prefer search when you just need to locate code. Use chat when you need explanations, comparisons, or architectural analysis after search. It can take up to 30 seconds.
215217

216218
```bash
217219
python scripts/chat.py <question> <data_sources...> [options]
@@ -289,7 +291,7 @@ This skill works standalone, but delivers the best experience when combined with
289291
| Component | What it provides |
290292
|-----------|-----------------|
291293
| **This skill** | Query patterns, workflow guidance, cost-aware tool selection |
292-
| **MCP server** | Direct `semantic_search`, `grep_search`, `fetch_artifacts`, `get_artifact_relationships`, `codebase_consultant`, `get_data_sources` tools |
294+
| **MCP server** | Direct `semantic_search`, `grep_search`, `fetch_artifacts`, `get_artifact_relationships`, `chat`, `get_data_sources` tools plus deprecated aliases |
293295

294296
When both are installed, prefer the MCP server's tools for direct operations and this skill's scripts for guided workflows.
295297

skills/codealive-context-engine/references/query-patterns.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ Use when:
298298
1. **Use natural language** - CodeAlive understands intent, not just keywords
299299
2. **Be specific about context** - Include domain/layer info (API, database, frontend)
300300
3. **Leverage workspaces** - Search across multiple repos for patterns
301-
4. **Start with chat** - Ask "How does X work?" before searching
301+
4. **Start with search** - Use semantic search first, then grep when the literal pattern matters; only use chat after you have evidence and still need synthesis
302302
5. **Iterate** - Use follow-up questions to drill deeper
303303
6. **Combine with local tools** - CodeAlive for discovery, Read for details
304304
7. **Think like a librarian** - Focus on "what" and "why", not "where"

skills/codealive-context-engine/references/workflows.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,24 @@ Review output to understand:
2828
- What workspaces group related repos
2929
- Which data sources to use for exploration
3030

31-
### Step 2: Get Architectural Overview
31+
### Step 2: Understand Entry Points
3232
```bash
33-
python chat.py "Provide an architectural overview of this codebase. What are the main components, how do they interact, and what's the tech stack?" my-backend-repo
33+
python search.py "main application entry point, startup initialization" my-backend-repo
3434
```
3535

36-
### Step 3: Understand Entry Points
36+
### Step 3: Explore Key Features
3737
```bash
38-
python search.py "main application entry point, startup initialization" my-backend-repo
38+
python search.py "main features, core capabilities, major services" my-backend-repo
3939
```
4040

41-
### Step 4: Explore Key Features
41+
### Step 4: Get Architectural Overview Only If Needed
4242
```bash
43-
python chat.py "What are the main features/capabilities of this system?" my-backend-repo
43+
python chat.py "Provide an architectural overview of this codebase. What are the main components, how do they interact, and what's the tech stack?" my-backend-repo
4444
```
4545

4646
### Step 5: Understand Data Models
4747
```bash
48-
python search.py "database models, schemas, entity definitions" my-backend-repo --mode auto
48+
python search.py "database models, schemas, entity definitions" my-backend-repo
4949
```
5050

5151
**Progressive Discovery:**
@@ -61,18 +61,19 @@ python search.py "database models, schemas, entity definitions" my-backend-repo
6161

6262
### Example: Understanding User Authentication
6363

64-
#### Step 1: Start with High-Level Question
64+
#### Step 1: Start with Search
6565
```bash
66-
python chat.py "How is user authentication implemented? Describe the flow from login to session management" my-backend
66+
python search.py "user authentication, login flow, session management" my-backend
67+
python grep.py "refresh token" my-backend
6768
```
6869

69-
Save conversation_id for follow-up questions.
70-
71-
#### Step 2: Find Entry Points
70+
#### Step 2: Use Chat Only If You Still Need Synthesis
7271
```bash
73-
python search.py "user login endpoint, authentication API" my-backend
72+
python chat.py "How is user authentication implemented? Describe the flow from login to session management" my-backend
7473
```
7574

75+
Save conversation_id for follow-up questions.
76+
7677
#### Step 3: Trace Through Layers
7778
```bash
7879
# API Layer

0 commit comments

Comments
 (0)