Skip to content

Commit 684f5d5

Browse files
committed
Clarify when relationships.py adds value over the fetch preview
SKILL.md and workflows.md now spell out that fetch.py already previews 3 outgoing/incoming calls, so relationships.py is mainly worth running for full incoming lists, inheritance trees, references, or artifacts too large to fetch. Adds a playbook table for common tool sequences and flags compiler-generated noise (MoveNext/GetEnumerator) in outgoing calls so agents don't build conclusions on analyzer artifacts. Bumps plugin version to 2.0.6 (docs-only patch).
1 parent c9229b4 commit 684f5d5

3 files changed

Lines changed: 88 additions & 15 deletions

File tree

.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "codealive",
33
"description": "CodeAlive context engine for semantic code search and AI-powered codebase Q&A. Enables AI coding agents to understand entire codebases beyond just open files — search across all indexed repositories, trace cross-service dependencies, discover usage patterns, and get synthesized answers to architectural questions. Includes a lightweight code exploration subagent, authentication hooks, and multiple search modes (fast lexical, semantic, and deep cross-cutting). Works standalone or alongside the CodeAlive MCP server for direct tool access via the Model Context Protocol.",
4-
"version": "2.0.5",
4+
"version": "2.0.6",
55
"author": {
66
"name": "CodeAlive AI",
77
"email": "hello@codealive.ai"

skills/codealive-context-engine/SKILL.md

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ Do NOT retry the failed script until setup completes successfully.
4040
| **List Data Sources** | `datasources.py` | Instant | Free | Discovering indexed repos and workspaces |
4141
| **Semantic Search** | `search.py` | Fast | Low | Default discovery — finds code by meaning (concepts, behavior, architecture) |
4242
| **Grep Search** | `grep.py` | Fast | Low | Finds code containing a specific string or regex (identifiers, literals, patterns) |
43-
| **Fetch Artifacts** | `fetch.py` | Fast | Low | Retrieving full content for search results |
44-
| **Artifact Relationships** | `relationships.py` | Fast | Low | Drilling into call graph, inheritance, references for one artifact |
43+
| **Fetch Artifacts** | `fetch.py` | Fast | Low | Retrieving full content; function-like artifacts also include up to 3 outgoing/incoming calls as a preview |
44+
| **Artifact Relationships** | `relationships.py` | Fast | Low | Full call graph (past the fetch preview's 3-cap), inheritance, or symbol references for one artifact |
4545
| **Chat with Codebase** | `chat.py` | Slow | High | **Not recommended.** Call ONLY when the user explicitly asks (e.g. "use chat"). |
4646

4747
**Cost guidance:** `semantic_search` and `grep_search` are the default starting point — fast and cheap. Use `fetch_artifacts` to load full source and `get_artifact_relationships` to trace call graphs. All four tools are low-cost.
@@ -60,9 +60,26 @@ Do NOT retry the failed script until setup completes successfully.
6060
file-read tool
6161
Treat only that real `content` as ground truth.
6262

63-
**Optional drill-down:** once you know an artifact matters, run
64-
`python relationships.py <identifier>` to expand its call graph, inheritance,
65-
or references.
63+
**Drill into `relationships.py` when the fetch preview isn't enough.** The
64+
`fetch.py` response already previews up to 3 outgoing + 3 incoming calls for
65+
function-like artifacts, so the call graph alone is rarely a reason to run
66+
`relationships.py` after a full fetch of a small artifact. Reach for it when:
67+
68+
- **You need all incoming callers** — the fetch preview is capped at 3.
69+
The full incoming list also surfaces test coverage (incoming from test
70+
files).
71+
- **You need the inheritance tree**`--profile inheritanceOnly` returns
72+
ancestors + descendants (interface implementations, subclasses, base-class
73+
chains). The preview doesn't include inheritance.
74+
- **You need symbol references**`--profile referencesOnly` for places
75+
that reference a type or identifier.
76+
- **The artifact is too large to fetch into context** — the call graph is a
77+
cheaper summary than pulling the full source.
78+
79+
**Analyzer noise:** outgoing calls occasionally include compiler-generated
80+
helpers (`MoveNext`, `GetEnumerator`, closure invocations) from methods using
81+
`foreach`/LINQ. Ignore outgoing hits that don't match the artifact's real
82+
logic.
6683

6784
## When to Use
6885

@@ -222,6 +239,25 @@ python scripts/relationships.py <identifier> [--profile PROFILE] [--max-count N]
222239
| `--max-count N` | Max related artifacts per relationship type (1–1000, default 50) |
223240
| `--json` | Emit the raw JSON response instead of the formatted view |
224241

242+
**When this adds value vs the fetch preview:**
243+
- You need **all incoming callers** (including tests) — the fetch preview
244+
caps at 3 per direction
245+
- You need the **inheritance tree** (`--profile inheritanceOnly`) — preview
246+
doesn't include ancestors/descendants
247+
- You need **symbol references** (`--profile referencesOnly`) — preview
248+
doesn't include references
249+
- The artifact is too large to fetch into context
250+
251+
**When it's usually redundant:** you already ran `fetch.py` on a small
252+
artifact that fits in context. The outgoing calls you need are either in the
253+
source you just read or in the preview's 3-cap — reach for `relationships.py`
254+
only when you specifically need incoming calls, inheritance, or references.
255+
256+
**Noise caveat:** outgoing calls occasionally include compiler-generated
257+
helpers (`MoveNext`, `GetEnumerator`, closure invocations) for methods using
258+
`foreach`/LINQ. These are analyzer artifacts — ignore outgoing hits that
259+
don't match the artifact's real logic.
260+
225261
### `chat.py` — Chat with Codebase (not recommended)
226262

227263
**Do NOT call unless the user explicitly asks** (e.g. "use chat", "use codebase_consultant", "call the chat tool"). Phrases like "ask CodeAlive" or "search CodeAlive" refer to search tools, not chat.

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

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -387,21 +387,58 @@ understanding of the code. For each relevant result, immediately load the real
387387
source via `fetch.py <identifier>` (external repos) or your editor's file-read
388388
tool (current working repo). Treat only that real `content` as ground truth.
389389

390-
### Drill into relationships when you need the call graph
391-
Once you've located an artifact via `search.py` or fetched it via `fetch.py`,
392-
use `relationships.py` to expand it:
393-
```bash
394-
# Default: full outgoing + incoming call graph
390+
### Drill into relationships when you need more than the fetch preview
391+
392+
`fetch.py` already includes up to 3 outgoing + 3 incoming calls as a preview
393+
for function-like artifacts, so the call graph alone is rarely a reason to
394+
run `relationships.py` after a full fetch of a small artifact. Reach for it
395+
when:
396+
397+
- **All incoming callers (including tests):** the preview caps at 3, so
398+
production callers and test coverage both get truncated. `callsOnly`
399+
returns the full list — incoming hits from test files are a proxy for test
400+
coverage.
401+
- **Inheritance tree:** the preview doesn't include ancestors or descendants.
402+
`--profile inheritanceOnly` is the only way to see all interface
403+
implementations, subclasses, or the full base-class chain.
404+
- **Symbol references:** `--profile referencesOnly` for places that
405+
reference a type or identifier without calling it.
406+
- **Large artifacts you don't want to fetch:** the graph is a cheaper summary
407+
than pulling the full source into context.
408+
409+
```bash
410+
# Full incoming + outgoing (default)
395411
python relationships.py "my-org/backend::src/auth.py::AuthService.login()"
396412

397-
# Class hierarchy
413+
# Class hierarchy — ancestors + descendants
398414
python relationships.py "my-org/backend::src/models.py::User" --profile inheritanceOnly
399415

400-
# Everything (calls + inheritance), bigger cap
416+
# Calls + inheritance with a bigger cap
401417
python relationships.py "my-org/backend::src/svc.py::Service" --profile allRelevant --max-count 200
402418
```
403-
The `fetch.py` response shows up to 3 calls per direction as a preview;
404-
`relationships.py` is how you escape that preview cap and switch profiles.
419+
420+
**When `relationships.py` usually adds nothing:** you already fetched the
421+
full source for a small artifact and it fits in context. Outgoing calls are
422+
already visible in the source or the fetch preview — start with incoming,
423+
inheritance, or references instead.
424+
425+
**Noise caveat:** outgoing calls can include compiler-generated helpers
426+
(`MoveNext`, `GetEnumerator`, closure invocations) from methods using
427+
`foreach`/LINQ. Ignore hits that don't match the artifact's real logic.
428+
429+
### Typical playbooks
430+
431+
Concrete tool sequences for common questions — pick whichever matches your
432+
task and skip the rest:
433+
434+
| You want to know... | Sequence |
435+
|---------------------|----------|
436+
| "How is X implemented?" | `search.py``fetch.py` on the top result (preview covers common outgoing calls) |
437+
| "Who calls X?" | `search.py`/`grep.py` to find X → `relationships.py --profile callsOnly` → read incoming |
438+
| "Is X tested, and how?" | locate X → `relationships.py --profile callsOnly` → filter incoming for test-file paths |
439+
| "All implementations of interface X?" | locate X → `relationships.py --profile inheritanceOnly` → read descendants |
440+
| "What does this giant service do?" | `search.py``relationships.py --profile callsOnly` instead of fetching the full source |
441+
| "Where is this type referenced?" | locate X → `relationships.py --profile referencesOnly` |
405442

406443
### Iterative Refinement
407444
Start broad → Review results → Refine query → Repeat

0 commit comments

Comments
 (0)