Integrate ts_knowledge_graph with Claude Code (Graphify-style)

未关闭
#10 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
冷清
技术栈
typescript

调研方向

首先阅读现有的 GraphQuery 方法以及支持 --json 的 CLI 查询命令。然后检查拟议的 .claude/skills/SKILL.md 集成,并确定计划中的 MCP 适配器将如何公开相同的操作。完成的标准是,约定的 Claude Code 集成已形成文档,并且无需更改核心图查询层即可使用。

由索引模型根据 Issue 内容生成。

描述

competitor

Goal

Integrate ts_knowledge_graph with Claude Code (and other agents) the way Graphify is — let the agent query the knowledge graph instead of blindly grepping the codebase.

How Graphify does it

Graphify's Claude Code integration is a bundle of three standard Claude Code extension points:

  1. A CLAUDE.md directive — tells Claude to read the generated graph report before answering architecture/dependency questions.
  2. A PreToolUse hook in settings.json — fires before every Grep/Glob call so the graph is consulted first (the "always-on" angle they advertise).
  3. An MCP server exposing the graph as callable tools — the most agent-native path, still on Graphify's roadmap (their issue #146), not shipped.

Why we are well positioned

The query layer is already designed as "JSON in, JSON out" agent tools:

  • GraphQuery methods (whoCalls, blastRadius, deadExports, neighborhood, references) map one-to-one onto agent tools.
  • Every CLI query command accepts --json.

The hard part (a clean, machine-readable query surface) is done; integration is plumbing on top.

Options (lowest to highest effort)

Approach What it is Effort Best when
CLAUDE.md + slash commands A directive telling Claude to run ts-knowledge-graph blast-radius <id> --json for impact questions, plus optional /blast-radius commands in .claude/commands/ Tiny Just want Claude to know the tool exists and use it
A Skill A .claude/skills/ skill documenting when/how to invoke the CLI via Bash Small Want automatic triggering + self-documentation — closest to how Graphify ships
PreToolUse hook Intercept Grep/Glob, inject graph context or remind Claude to query the graph first Small–medium Want it consulted before search, not on demand
MCP server Wrap GraphQuery as MCP tools (who_calls, blast_radius, dead_exports, …) so Claude calls them natively, no Bash Medium The most native, portable path — works across Claude Code, Cursor, etc.

Proposed plan

  1. Start with a Skill — matches Graphify's actual shipping form, fastest to value. Wraps the existing --json CLI; zero changes to core code, just a SKILL.md teaching Claude the commands and when to reach for blast-radius / dead-exports / who-calls.
  2. Then add an MCP server — thin adapter over GraphQuery (already JSON-in/JSON-out) for tool-native, cross-agent use.
  3. Skip the PreToolUse always-on hook initially — clever but adds latency to every search and is the easiest piece to add later.

References

主要语言
TypeScript
星标
7
派生
0
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

jeromeetienne/codespine 的其他 Issue

查看 jeromeetienne/codespine 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。