graphify icon indicating copy to clipboard operation
graphify copied to clipboard

fix: sync claude references/query.md with full vocab-expansion Step 0 (closes #1255)

Open burrows99 opened this issue 5 months ago • 2 comments

What

graphify/skills/claude/references/query.md was 103 lines — missing the Step 0 Constrained query expansion block that every other platform skill (vscode, codex, copilot, opencode, claw, kiro, amp, pi, trae, droid, kilo, windows) already ships at 249 lines.

Additionally, a cross-platform bug was found (via reviewer @uditstocks) and fixed across all 13 platform skills: Step 1's length filter used len(t) > 3 (min 4 chars) while Step 0 extracts tokens with len(t) >= 3 (min 3 chars), silently dropping valid 3-char tokens like api, use, get, tok, auth before BFS/DFS.

Root cause

The skills/claude/ directory contains a stale copy of references/query.md that predates the vocabulary-expansion rewrite. All other platform directories received the update; claude/ did not.

The len(t) > 3 vs >= 3 mismatch existed in the source file and was copied to all platforms — making it cross-platform from the start.

Fix

Commit a1ac4cb — sync skills/claude/references/query.md (103 lines → 249 lines):

before: 103 lines  graphify/skills/claude/references/query.md
after:  249 lines  graphify/skills/claude/references/query.md

Commit 5643c7f — align Step 1 filter for claude/ (> 3 → >= 3 on line 49)

Commit f485fc2 — same >= 3 fix applied to all 12 remaining platforms: amp, claw, codex, copilot, droid, kilo, kiro, opencode, pi, trae, vscode, windows

See: https://github.com/safishamsi/graphify/pull/1256#issuecomment-4680592589

Why it matters

Without Step 0, the graphify query CLI latches onto wrong start nodes for natural-language questions. The binary does no stemming or synonym matching — it relies entirely on the agent first expanding the question against actual graph vocabulary tokens.

Without the >= 3 fix, tokens that Step 0 deliberately selected from graph vocab are silently discarded before traversal even begins.

Verified on a 757-file, 11 634-node TypeScript/Next.js repo: after applying this fix, natural-language query quality matches VS Code Copilot results from the identical graph.

Closes #1255

burrows99 avatar Jun 11 '26 08:06 burrows99

Also addressed the reviewer's observation cross-platform in f485fc2.

The len(t) > 3 bug (Step 1 silently dropping 3-char tokens that Step 0 deliberately selected) was present in all 13 platform skills, not just claude/. Fixed in the same commit:

amp, claw, codex, copilot, droid, kilo, kiro, opencode, pi, trae, vscode, windows

All 13 platforms now use len(t) >= 3 on line 49, consistent with Step 0's if 3 <= len(t) <= 30 threshold.

burrows99 avatar Jun 11 '26 12:06 burrows99

As far as I can tell, none (or very few, I haven't looked at all of them) of the shipped skills include this step 0. Looks like skillgen wasn't done correctly?

Edit: Nevermind, I figured out that none of the other platforms have it because they use the cli-inline query variant. Not sure why or why that one doesn't include this step 0 (which seems pretty important to get good results), but that's a different issue.

LeanderBlume avatar Jun 15 '26 14:06 LeanderBlume