Skip to content

chore(skills): retire code-graph-context (CGC) - #45

Merged
lbruton merged 1 commit into
mainfrom
chore/retire-code-graph-context
Jul 27, 2026
Merged

chore(skills): retire code-graph-context (CGC)#45
lbruton merged 1 commit into
mainfrom
chore/retire-code-graph-context

Conversation

@lbruton

@lbruton lbruton commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Summary

Retires the code-graph-context (CGC) MCP plugin. It has been removed from every harness — Claude Code, Codex, OpenCode, Antigravity, and the desktop app — in favor of native harness tools. Keeping the plugin running cost more maintenance effort than it returned.

This repo matters more than most for the retirement: skills/ is a distribution source (README: cp -r skills/* ~/.claude/skills/), so leaving CGC here would quietly reintroduce it on the next install.

Changes

Skill Change
audit Drop the CGC index gate, stats block, and health row. Dead code and complexity now come from Grep enumeration and Codacy's Lizard metric
prime Drop the hasCGC docker probe and the whole Step 2.2 CGC index/re-index block
discover Drop CGC from allowed-tools; fold structural search into the Grep tier
chat Drop CGC from allowed-tools and the codebase-exploration list
start Drop CGC from the "no indexing" rules
.cgcignore Delete — CGC-only config, now dead

Search order is now claude-context (semantic, to discover what to look for) then Grep (structural/exact, to find all of it).

Notes

  • These skills had drifted from my user-level copies (this prime is 870 lines vs 370 globally, and still described the Docker/Neo4j-era CGC that hadn't been the deployment for months). I purged CGC in place and deliberately left the rest of that drift alone rather than re-syncing, to keep this diff to the retirement. The drift is worth a separate look.
  • .codex/hooks/block-generated-paths.py has an unrelated pre-existing modification in the working tree; it is intentionally not part of this PR.

Summary by CodeRabbit

  • Improvements

    • Streamlined project health audits and setup workflows around a single codebase indexing process.
    • Improved code exploration guidance for more reliable repository-wide searches, including callers, references, and imports.
    • Updated chat and discovery workflows with enhanced documentation lookup capabilities.
    • Refined reporting and fallback guidance for clearer index-health status and graceful handling of unavailable services.
  • Documentation

    • Updated workflow instructions and report templates to reflect the revised indexing and search experience.

The code-graph-context MCP plugin is retired across all harnesses (Claude
Code, Codex, OpenCode, Antigravity, desktop). Keeping the plugin running cost
more maintenance effort than it returned, so structural code intelligence now
runs on native harness tools.

skills/ is a distribution source (README: `cp -r skills/* ~/.claude/skills/`),
so leaving CGC here would reintroduce it on the next install.

- audit: drop the CGC index gate and stats; dead code and complexity now come
  from Grep enumeration and Codacy's Lizard metric.
- prime: drop the hasCGC docker probe and the Step 2.2 CGC index block.
- discover, chat: drop CGC from allowed-tools; fold structural search into the
  Grep tier.
- start: drop CGC from the "no indexing" rules.
- .cgcignore: delete — CGC-only config, now dead.

Search order is now claude-context (semantic) then Grep (structural/exact).
Copilot AI review requested due to automatic review settings July 27, 2026 17:42
@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The PR removes CGC references from skill tools, indexing workflows, code-health checks, search guidance, and report templates. It shifts structural discovery to grep/glob and keeps claude-context, Milvus, Codacy, Context7, and code-oracle guidance.

Changes

Indexing and search workflow migration

Layer / File(s) Summary
Search tool and exploration policy
skills/chat/SKILL.md, skills/discover/SKILL.md, skills/start/SKILL.md
CGC tools and references are removed, while Context7, claude-context, Milvus, and repo-wide grep/glob guidance are added or clarified.
Prime indexing and health orchestration
skills/prime/SKILL.md
Prime no longer detects or runs CGC, uses claude-context and Codacy checks, updates code-health analysis, and reports claude-context-only index status.
Audit indexing and code-health checks
skills/audit/SKILL.md
Audit requires claude-context readiness, uses code-oracle and grep-based checks, and removes CGC health reporting and degradation rules.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: copilot

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: retiring code-graph-context (CGC) from the skills.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/retire-code-graph-context

Comment @coderabbitai help to get the list of available commands.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d236978cc6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread skills/prime/SKILL.md
Comment on lines +479 to +482
> **Retired 2026-07-27 — `code-graph-context` (CGC).** This step used to index and health-check
> a second, structural graph backend. That backend was removed from every harness in favor of
> native harness tools. Do not re-add it or reference `mcp__code-graph-context__*`; those tools
> are unavailable.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Retire CGC from the shipped commands and code-oracle

When a Claude user installs the repository's raw assets, commands/audit.md:33-34,83 and commands/prime.md:135 still request CGC, while the dispatched agents/code-oracle.md:30-36,124-135 explicitly invokes its MCP tools. Since this block now declares those tools unavailable, /audit and /prime full will make failed calls and may omit dead-code and complexity results instead of using the new Grep/Lizard path; update these distributed assets as part of the retirement.

AGENTS.md reference: AGENTS.md:L28-L29

Useful? React with 👍 / 👎.

Comment thread skills/discover/SKILL.md
Comment on lines 98 to +100
Run the codebase search tier protocol (minimum tiers 1-2):

### Tier 1: CGC — Structural

```
mcp__code-graph-context__find_code
query: "{key functions, components, or modules related to this issue}"
```

```
mcp__code-graph-context__analyze_code_relationships
query: "{affected area}"
```

### Tier 2: Claude-Context — Semantic
### Tier 1: Claude-Context — Semantic

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove CGC from the npm workflow guidance

When discovery is initiated through the npm MCP's spec-workflow-guide rather than this raw skill, src/tools/spec-workflow-guide.ts:249 still instructs the agent to run CGC, and src/markdown/templates/discovery-template.md:16 repeats that dependency. That independent path never reads this replacement tier, so clients from which CGC was removed still receive impossible tool instructions; update the MCP source and its template too.

AGENTS.md reference: AGENTS.md:L26-L31

Useful? React with 👍 / 👎.

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR retires the code-graph-context (CGC) plugin and transitions the project's skills to use Grep and Lizard-based analysis. While the removal of the Docker-based CGC dependency simplifies the environment, it introduces significant performance risks. Specifically, instructing an LLM to grep every symbol repo-wide in medium-to-large codebases will likely exceed tool-calling limits and context windows.

Although Codacy indicates the PR is up to standards, the effectiveness of the new Grep-based logic for dead code detection and structural search remains unverified by automated tests. These changes should be considered high-risk for larger repositories until the strategies are refined for scalability.

About this PR

  • The PR lacks automated test cases to verify that the new Grep-based instructions provided to the agents are effective and produce the expected results for dead code and complexity analysis compared to the previous CGC implementation.

Test suggestions

  • Verify that the audit skill correctly identifies dead code using the new Grep-based enumeration logic.
  • Verify that the prime skill executes successfully without the CGC Docker container present.
  • Verify that discover search results for structural queries (callers) are correctly handled by Grep after semantic search.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify that the audit skill correctly identifies dead code using the new Grep-based enumeration logic.
2. Verify that the prime skill executes successfully without the CGC Docker container present.
3. Verify that discover search results for structural queries (callers) are correctly handled by Grep after semantic search.

TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback

Comment thread skills/prime/SKILL.md
Focus on:
1. Dead code detection (CGC if available)
2. Top 5 most complex functions (CGC if available)
1. Dead code detection (Grep-derived — grep each declared symbol repo-wide)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 MEDIUM RISK

Performing a repo-wide grep for every declared symbol is a high-latency operation for an LLM agent. In larger codebases, this will likely lead to excessive tool usage and context window exhaustion. Suggesting a more targeted strategy (e.g., checking only exports) would be more robust.

Comment thread skills/audit/SKILL.md
Comment on lines +87 to +89
1. Dead code detection — enumerate declarations, then grep each symbol repo-wide and flag
those with no reference outside their own definition. Check for dynamic references
(window.X, string lookups, HTML handler wiring) before calling anything dead.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 MEDIUM RISK

Iterating over every declaration and performing a repo-wide grep is computationally prohibitive for an LLM agent and scales poorly. For medium-to-large codebases, this will likely hit tool-calling limits or context window constraints. Consider instructing the agent to focus on exported symbols or use specialized CLI tools (like unused or language-specific linters) if available.

Comment thread skills/discover/SKILL.md
Take the identifiers Tier 1 surfaced and grep each one repo-wide to find every call site,
import, and reference. Also use Grep directly for specific identifiers, storage keys, and
constants you already know the name of. Semantic search ranks by similarity and will not
return all N references — Grep is what makes the impact list exhaustive.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ LOW RISK

Nitpick: The claim that Grep makes the impact list 'exhaustive' is inaccurate. Grep fails to capture dynamic property access (e.g., obj[key]), reflection, or dependency injection, and it produces high noise for common names. It should be described as a fallback for literal reference checking rather than a complete structural solution.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Retires the code-graph-context (CGC) tool from the repo-distributed skills by removing CGC-specific checks, allowed-tools entries, and index/health-gate instructions, aligning the workflow around claude-context (semantic) plus Grep/Glob (structural/literal).

Changes:

  • Removed CGC tool references from start, prime, discover, chat, and audit skills (including probes, index/health steps, and report rows).
  • Reframed “structural search” guidance to use Grep/Glob instead of a graph index.
  • Deleted .cgcignore as CGC-only configuration.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
skills/start/SKILL.md Removes CGC mentions from “indexing” guidance and rules.
skills/prime/SKILL.md Removes CGC probe + index/health workflow; documents Grep/Glob structural search as replacement.
skills/discover/SKILL.md Drops CGC from allowed-tools and search-tier protocol; promotes claude-context then Grep/Glob.
skills/chat/SKILL.md Drops CGC from allowed-tools and exploration guidance; routes structural questions to Grep/Glob.
skills/audit/SKILL.md Removes CGC index gate and CGC-based checks; replaces with Grep/Glob-based dead code/complexity guidance.
.cgcignore Deletes CGC-only ignore config file.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread skills/audit/SKILL.md
@@ -45,20 +45,13 @@ REMOTE=$(git rev-parse origin/$(git symbolic-ref --short HEAD) 2>/dev/null)

### Pre-flight: Ensure Codebase Indexes Exist
Comment thread skills/start/SKILL.md

- **session-rag + mem0 MCP calls only.** No indexing MCPs (Milvus, CGC, Codacy). No agent dispatch.
- **No code indexing.** Do not trigger claude-context, CGC, or any indexing operation.
- **session-rag + mem0 MCP calls only.** No indexing MCPs (Milvus, Codacy). No agent dispatch.
Comment thread skills/prime/SKILL.md
Comment on lines +479 to +482
> **Retired 2026-07-27 — `code-graph-context` (CGC).** This step used to index and health-check
> a second, structural graph backend. That backend was removed from every harness in favor of
> native harness tools. Do not re-add it or reference `mcp__code-graph-context__*`; those tools
> are unavailable.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@skills/prime/SKILL.md`:
- Around line 359-360: Update skills/prime/SKILL.md lines 359-360 to require
dynamic-reference analysis before declaring symbols dead, and update lines
475-477 to use AST/code-oracle analysis for call chains, dead code, and
complexity while retaining Grep for literal references. In skills/chat/SKILL.md
lines 67-68, qualify “all structural questions” as literal-reference discovery.
In skills/discover/SKILL.md lines 115-118, qualify “exhaustive” as exhaustive
only for textual matches.
- Around line 359-360: Update the “Dead code detection” guidance in SKILL.md to
account for dynamic references before reporting symbols as dead, matching the
safeguards used by the audit skill for window.X access, string-based lookups,
and HTML event handlers. Keep the existing Grep-derived check and complexity
item unchanged.
- Around line 337-340: Update skills/prime/SKILL.md lines 337-340 so Phase 2
Step 2.1 waits for claude-context indexing to reach indexed before Phase
3/report assembly, and handles indexfailed as an error; retain Codacy execution
in parallel where possible. Apply the same polling and indexed/indexfailed
handling after degradation-triggered re-indexing at skills/prime/SKILL.md line
764.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7751673d-9f45-4d70-90ae-3b1a917e2344

📥 Commits

Reviewing files that changed from the base of the PR and between 64af2e6 and d236978.

📒 Files selected for processing (6)
  • .cgcignore
  • skills/audit/SKILL.md
  • skills/chat/SKILL.md
  • skills/discover/SKILL.md
  • skills/prime/SKILL.md
  • skills/start/SKILL.md
💤 Files with no reviewable changes (1)
  • .cgcignore

Comment thread skills/prime/SKILL.md
Comment on lines +337 to +340
Kick off the claude-context indexing check immediately — it runs while everything
else gathers data. By the time we reach the report, index results are ready.

Run Phase 2 Steps 2.1, 2.2, and 2.3 (claude-context, CGC, Codacy) in parallel NOW.
Run Phase 2 Steps 2.1 and 2.3 (claude-context, Codacy) in parallel NOW.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Prime must await claude-context indexing completion. Starting or triggering indexing without polling for indexed or indexfailed allows report generation to race the index job.

  • skills/prime/SKILL.md#L337-L340: wait before Phase 3/report assembly.
  • skills/prime/SKILL.md#L764-L764: apply the same wait/error handling after degradation-triggered re-indexing.
📍 Affects 1 file
  • skills/prime/SKILL.md#L337-L340 (this comment)
  • skills/prime/SKILL.md#L764-L764
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/prime/SKILL.md` around lines 337 - 340, Update skills/prime/SKILL.md
lines 337-340 so Phase 2 Step 2.1 waits for claude-context indexing to reach
indexed before Phase 3/report assembly, and handles indexfailed as an error;
retain Codacy execution in parallel where possible. Apply the same polling and
indexed/indexfailed handling after degradation-triggered re-indexing at
skills/prime/SKILL.md line 764.

Comment thread skills/prime/SKILL.md
Comment on lines +359 to +360
1. Dead code detection (Grep-derived — grep each declared symbol repo-wide)
2. Top 5 most complex functions (estimated CCN, or Codacy's Lizard metric if available)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Grep cannot replace complete structural analysis. The affected instructions treat textual search as exhaustive for callers, call chains, dead code, imports, and complexity, which can miss aliases, dynamic references, generated code, and non-textual relationships.

  • skills/prime/SKILL.md#L359-L360: add dynamic-reference handling before declaring symbols dead.
  • skills/prime/SKILL.md#L475-L477: use AST/code-oracle analysis for call chains, dead code, and complexity; retain Grep for literal references.
  • skills/chat/SKILL.md#L67-L68: qualify “all structural questions” as literal-reference discovery.
  • skills/discover/SKILL.md#L115-L118: qualify “exhaustive” as exhaustive only for textual matches.
📍 Affects 3 files
  • skills/prime/SKILL.md#L359-L360 (this comment)
  • skills/prime/SKILL.md#L475-L477
  • skills/chat/SKILL.md#L67-L68
  • skills/discover/SKILL.md#L115-L118
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/prime/SKILL.md` around lines 359 - 360, Update skills/prime/SKILL.md
lines 359-360 to require dynamic-reference analysis before declaring symbols
dead, and update lines 475-477 to use AST/code-oracle analysis for call chains,
dead code, and complexity while retaining Grep for literal references. In
skills/chat/SKILL.md lines 67-68, qualify “all structural questions” as
literal-reference discovery. In skills/discover/SKILL.md lines 115-118, qualify
“exhaustive” as exhaustive only for textual matches.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Handle dynamic references before reporting symbols as dead.

The Grep-derived dead-code check omits the dynamic-reference safeguards present in skills/audit/SKILL.md Lines 87-89, so prime may falsely report symbols used through window.X, string lookups, or HTML handlers.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/prime/SKILL.md` around lines 359 - 360, Update the “Dead code
detection” guidance in SKILL.md to account for dynamic references before
reporting symbols as dead, matching the safeguards used by the audit skill for
window.X access, string-based lookups, and HTML event handlers. Keep the
existing Grep-derived check and complexity item unchanged.

@lbruton
lbruton merged commit 321cffa into main Jul 27, 2026
6 checks passed
@lbruton
lbruton deleted the chore/retire-code-graph-context branch July 27, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants