Temporal semantic code intelligence for the current repository via the Contextual MCP server: hybrid search, dependency-graph traversal, blast-radius/impact analysis, git-blame-enriched history,...
This skill is installed globally and loads in every repo, not just ones
running Contextual. Before following anything below, confirm a Contextual
tool (e.g. search) is connected in this session — its name appearing
anywhere counts as connected, even only as a bare name in a tool list or a
"deferred tools" / "tools available via search" notice, not just as a
directly callable tool. If no Contextual tool name appears anywhere in this
session, none of this applies — don't call any tool named below, and don't
mention Contextual to the user unprompted.
Some clients load MCP tool schemas lazily instead of upfront: a connected
tool can appear as a bare name only, and calling it directly returns an
input-validation or not-found error until its schema is loaded on demand
(Claude Code's ToolSearch, or the equivalent tool-discovery mechanism in
your client). Treat that error as "load the schema, then retry" — not as
"unavailable." Do this load-and-retry before falling back to grep/read of
raw files for something the Core rule below says to use a Contextual tool
for; the deferred tool is still the right tool, it just needs one extra
call to become callable.
If multiple MCP servers are connected and a bare tool name is ambiguous or
reported as not found, look for the connected server named contextual —
or, for a repo with more than one Contextual-managed workspace wired into
this client, contextual-<id> — and qualify the call with that server name.
Contextual is the persistent memory and semantic intelligence layer for this codebase. It provides real, timestamped, searchable context via MCP tools so you don't have to guess this codebase's structure, dependencies, architectural history, or change timeline.
Before answering any question about this repo's code, structure,
dependencies, behavior, or history — call a Contextual tool first. Prefer
retrieved results over guessing from training data. Before deleting,
renaming, or changing the signature of anything: graph_impact is
mandatory, not optional. This applies to vague or open-ended requests too
("audit the CLI layer," "how does X work," "what's the current state of
Y") — a broad prompt is not an exemption, it's a reason to reach for
search or nexus_search first rather than grep/read-only exploration.
A decision doesn't need to be flagged as one to count as one: choosing or
swapping a library, model, schema, or approach; reversing something done
earlier; resolving a tradeoff explicitly in conversation, a commit, or a
code comment. Any of these is ADR material the moment it's settled — not
only when the user says "log this as a decision." Before ending a turn
where one of these happened: call decision_search to check whether a
record already exists, then decision_create for a new one or
decision_supersede if it replaces an earlier one. Do this even if the
user only asked for the code change and never mentioned Contextual — a
decision documented solely in a comment or commit message is invisible to
every future session, including yours. Skip it for routine implementation
choices that would cost nothing to re-derive later (a variable name, which
loop construct) — this is for calls that would waste real time to
re-litigate or rediscover.
Understand code — search (hybrid semantic+keyword, start here) ·
nexus_search (search + graph neighborhood + temporal context in one call —
use instead of chaining search + graph_traverse + get_temporal_context) ·
get_file_content (source by file_path+line range or by fqn=; prefer a
line range over a full-file read) · get_repo_structure (directory tree) ·
get_git_diff (literal diff text between refs or against the working tree)
Follow dependencies — graph_traverse (multi-hop, forward/backward/both)
· graph_get_entity_callers (one-hop callers, cheaper than traverse) ·
graph_get_entity_definition (fetch one symbol's source without the whole
file) · graph_find_path (shortest dependency path between two entities) ·
graph_query (bulk filter by property, not by meaning) · graph_stats
(entity/edge counts and density)
Before changing something — graph_impact (blast-radius analysis;
mandatory preflight for any delete/rename/signature change) ·
co_change_analysis (undeclared coupling that structural edges miss — check
this too, impact alone isn't the full picture)
History & rationale — get_temporal_context (blame, commit history,
change velocity for one entity) · decision_search (why was X built this
way) · decision_list / decision_create / decision_update /
decision_supersede (ADR lifecycle) · graph_at_time (snapshot as of a
commit or timestamp)
Health — get_stats (index freshness and counts) · get_doctor (full
system diagnostic — call this if search returns nothing or a tool keeps
erroring) · get_telemetry (recent tool-call activity, latency, and errors —
evidence before diagnosing) · diagnose_issue (correlates get_doctor +
get_telemetry into one ranked list of likely causes — the fastest starting
point when something is wrong and you don't yet know why)
search and graph tools return an entity_id/FQN on every result — reuse
it directly in graph_traverse, graph_impact, get_file_content(fqn=...),
etc. Don't call search again just to re-derive an ID you already have.get_file_content(file_path, start_line, end_line) over a
full-file read — a 30-line function costs a fraction of the tokens a
1000-line file does.path/to/file.py:ClassName.method) directly — no round trip through
search needed just to obtain a hash.compact=True (search) or gcf=True (graph
tools) for a denser text encoding of the same data.Retrieved results are evidence, not infallible truth. Before treating something as certain:
is_stale / staleness_score on returned entities — a high score
means the index may be behind the current file content.confidence_tier on graph edges — speculative or low edges
(and any speculative_callers on graph_impact) are advisory only; don't
base a delete/rename decision on them alone.If you're a chat LLM without these tools and the user pastes Contextual output into the conversation, prefer it over guessing — but it can still be stale or incomplete, so corroborate before acting on it for anything high-stakes (deletions, renames, security-relevant changes). If the user asks a codebase question without pasting anything, ask them to run a Contextual search and share the result.