메뉴
HN
Hacker News • 14일 전

Graphify C# – 코딩 에이전트용 컴파일러 수준 정확도의 참조 탐색 도구

IMP
6/10
핵심 요약

Graphify C#은 무료 헤드리스 Roslyn/MSBuild 인덱서로, C# 소스 코드를 컴파일러가 실제로 해석한 호출·참조·구현·상속 관계를 JSON 그래프로 출력해 코딩 에이전트(Codex, Claude Code 등)에 제공합니다. 단순 텍스트 검색과 달리 오버로드, 제네릭, 프로젝트 경계를 넘어서도 정확한 심볼 바인딩을 보장하며, IDE나 데이터베이스 없이 MIT 라이선스로 사용할 수 있습니다.

번역된 본문

graphify-csharp 🚀 C#용 컴파일러 수준 정확도의 Find Usages(참조 찾기)를 코딩 에이전트에 제공합니다. graphify-csharp은 무료 헤드리스 Roslyn/MSBuild 인덱서로, C# 소스를 결정적이고 쿼리 가능한 시맨틱 근거로 변환합니다. 컴파일러가 해석한 호출자, 참조, 구현, 상속, 오버라이드 정보를 오버로드·제네릭·프로젝트 경계를 넘어서도 제공합니다. Rider/ReSharper의 시맨틱 내비게이션 기능 일부를 Codex, Claude Code 등의 코딩 에이전트용으로 추출한 것이라고 보면 됩니다. MIT 라이선스 · IDE 불필요 · 컴파일된 프로젝트 DLL 불필요 · 데이터베이스 불필요 · Graphify는 선택 사항

에이전트가 추측하게 두지 마세요 다음과 같이 물어본다고 상상해 보세요: 어떤 메서드가 테스트에서만 사용되는가? 텍스트 검색은 철자가 일치하는 것을 찾을 수 있을 뿐입니다. 어떤 오버로드에 바인딩되었는지, 호출자가 어떤 프로젝트에 속하는지, 인터페이스 구현체가 내가 의도한 심볼인지 확실하게 알려줄 수 없습니다. Graphify C#은 MSBuild를 통해 프로젝트를 로드하고 Roslyn에게 모든 심볼의 실제 의미를 물어봅니다. 에이전트가 추론 대신 검사할 수 있는 안정적인 식별자와 방향성 있는 관계를 내보냅니다:

  • 시맨틱 인덱싱 없음: 일치하는 이름이 사용처처럼 보임 / Graphify C# 사용 시: Roslyn이 정확한 선언을 해석
  • 오버로드와 제네릭이 모호함 / 바인딩된 시그니처와 프로젝트/TFM 식별자가 보존됨
  • 테스트 전용 사용 여부는 수동 확인 필요 / 모든 호출자에 프로젝트, 네임스페이스, 소스 위치가 포함됨
  • 타입 관계가 텍스트로 재구성됨 / inherits, implements, overrides가 명시적 엣지(edge)로 표현됨

예를 들어 이 저장소에는 내부 메서드 DeclarationCatalogBuilder.ForTesting(...)이 있습니다. 추출된 그래프에서 에이전트는 하나의 컴파일러 해석 기반 호출을 확인할 수 있습니다:

Graphify.CSharp.Roslyn.DeclarationCatalogBuilder.ForTesting(...) └── 호출자: Graphify.CSharp.Tests.Roslyn.CSharp14FeatureTests (tests/Graphify.CSharp.Tests/Roslyn/CSharp14FeatureTests.cs:143)

이것은 텍스트 매칭 개수가 아니라 시맨틱 근거입니다. 소비자는 호출자를 프로젝트나 네임스페이스 규칙으로 분류하여 해당 메서드를 사람 검토 대상인 '테스트 전용'으로 보고할 수 있습니다.

빠른 시작

  1. 설치 dotnet tool install --global Graphify.CSharp --framework net10.0

  2. 코드베이스 인덱싱 graphify-csharp --input ./src/MyProduct.sln --root . --configuration Release --output ./graphify-out/csharp.json

결과는 nodes, edges, hyperedges를 포함하는 하나의 완전한 JSON 문서입니다. 에이전트가 직접 읽거나, jq로 쿼리하거나, 자체 코드에서 사용하거나, Graphify에 전달할 수 있습니다. 지원 입력은 .sln, .slnx, .csproj, SDK 파일 기반 .cs 앱입니다. 저장소의 SDK, 패키지, MSBuild 입력은 로컬에 있어야 합니다.

  1. 에이전트에게 사용법 학습시키기 포함된 graphify-csharp 스킬은 에이전트에게 인덱스를 언제 갱신할지, 시맨틱 엣지를 어떻게 따라갈지, 정적 분석의 한계가 어디인지 알려줍니다. Codex 호환 프로젝트에 설치:

mkdir -p .agents/skills/graphify-csharp curl -fsSL https://raw.githubusercontent.com/zachsaw/graphify-csharp/main/.agents/skills/graphify-csharp/SKILL.md -o .agents/skills/graphify-csharp/SKILL.md

Claude Code의 경우 .claude/skills/graphify-csharp/SKILL.md를 대신 사용하세요. 스킬 설치·업데이트 후 에이전트 세션을 다시 로드하세요. 스킬을 사용하지 않는다면 프로젝트 지침에 다음을 추가하세요:

"C# 구조 및 사용처 질문 시, 답변 전에 graphify-csharp로 graphify-out/csharp.json을 갱신하라. symbol_key로 선언을 식별하고 incoming calls 및 references 엣지를 검사하라. 인바운드 엣지가 0인 경우는 관찰된 정적 근거로 간주하고, 런타임에 도달 불가능하다는 증거로 삼지 마라."

이제 에이전트에게 물어보세요:

  • 이 정확한 오버로드나 생성자를 호출하는 것은 무엇인가?
  • 어떤 소스 선언이 이 필드, 프로퍼티, 이벤트, 타입을 참조하는가?
  • 어떤 클래스가 이 인터페이스를 구현하는가?
  • 어떤 멤버가 이 virtual 또는 인터페이스 멤버를 오버라이드하는가?
  • 인바운드 참조가 0으로 관찰된 선언은 무엇인가?
  • 어떤 메서드가 테스트 프로젝트에서만 참조되는가?

IDE 내비게이션에서 에이전트 근거로 개발자가 Rider에서 하는 것 / 에이전트가 Graphify C#에서 얻는 것:

  • Find Usages → 방향성 있고 컴파일러 해석 기반의 호출·참조 엣지
  • Jump to Implementation(구현으로 이동)
원문 보기
원문 보기 (영어)
graphify-csharp 🚀 Give coding agents compiler-accurate Find Usages for C#. graphify-csharp is a free, headless Roslyn/MSBuild indexer that turns C# source into deterministic, queryable semantic evidence: compiler-resolved callers, references, implementations, inheritance, and overrides—even across overloads, generics, and projects. Think of it as the semantic-navigation slice of Rider/ReSharper, exported for Codex, Claude Code, and other coding agents. MIT licensed · No IDE · No compiled project DLL required · No database · Graphify optional Stop making your agent guess Suppose you ask: Which methods are used only by tests? A text search can find matching spellings. It cannot reliably tell which overload was bound, which project the caller belongs to, or whether an interface implementation is the symbol you meant. Graphify C# loads the project through MSBuild and asks Roslyn what every symbol actually means. It emits stable identities and directed relationships that an agent can inspect instead of infer: Without semantic indexing With Graphify C# Matching names look like usages Roslyn resolves the exact declaration Overloads and generics are ambiguous Bound signatures and project/TFM identity are retained Test-only usage requires manual inspection Every caller carries project, namespace, and source location Type relationships are reconstructed from text inherits , implements , and overrides are explicit edges For example, this repository contains an internal DeclarationCatalogBuilder.ForTesting(...) method. From the extracted graph, an agent can see one compiler-resolved incoming call: Graphify.CSharp.Roslyn.DeclarationCatalogBuilder.ForTesting(...) └── called by Graphify.CSharp.Tests.Roslyn.CSharp14FeatureTests at tests/Graphify.CSharp.Tests/Roslyn/CSharp14FeatureTests.cs:143 That is semantic evidence, not a text-match count. A consumer can classify the caller by project or namespace convention and report the method as test-only for human review. Quick start 1. Install dotnet tool install --global Graphify.CSharp --framework net10.0 2. Index your codebase graphify-csharp \ --input ./src/MyProduct.sln \ --root . \ --configuration Release \ --output ./graphify-out/csharp.json The result is one complete JSON document containing nodes , edges , and hyperedges . It can be read directly by an agent, queried with jq , consumed from your own code, or passed to Graphify. Supported inputs are .sln , .slnx , .csproj , and SDK file-based .cs apps. The repository's SDKs, packages, and MSBuild inputs must be available locally. 3. Teach your agent to use it The included graphify-csharp skill teaches an agent when to refresh the index, how to follow semantic edges, and where static analysis stops. Install it in a Codex-compatible project: mkdir -p .agents/skills/graphify-csharp curl -fsSL \ https://raw.githubusercontent.com/zachsaw/graphify-csharp/main/.agents/skills/graphify-csharp/SKILL.md \ -o .agents/skills/graphify-csharp/SKILL.md For Claude Code, use .claude/skills/graphify-csharp/SKILL.md instead. Reload an agent session after installing or updating the skill. If you do not use skills, add this to your project instructions: For C# structure and usage questions, refresh graphify-out/csharp.json with graphify-csharp before answering. Identify declarations by symbol_key and inspect incoming calls and references edges. Treat zero inbound edges as observed static evidence, not proof of runtime unreachability. Now ask your agent: What calls this exact overload or constructor? Which source declarations reference this field, property, event, or type? Which classes implement this interface? Which members override this virtual or interface member? Which declarations have zero observed inbound references? Which methods are referenced only from test projects? From IDE navigation to agent evidence What a developer does in Rider What an agent gets from Graphify C# Find Usages Directed, compiler-resolved calls and references edges Jump to Implementation implements edges to the exact interface contract Navigate base and derived types inherits and overrides edges Disambiguate overloads and generics Stable symbol identities with bound signature information Inspect a large solution Project, target-framework, source-location, and provenance metadata Keep navigating while editing Incremental indexing with an optional warm watcher The extractor supplies the facts. Your agent or downstream consumer decides what those facts mean: test-only usage, zero observed references, a deletion candidate, or something requiring human review. Where it fits Graphify C# deliberately covers a focused layer: Rider and ReSharper provide interactive navigation, inspections, refactorings, and quick fixes for developers inside an IDE. NDepend provides a broad, commercial architecture and code-quality suite built around dependency analysis, metrics, rules, reports, baselines, and visualizations. Graphify C# provides source-level C# semantic evidence for coding agents, headlessly and in an open format. There is real overlap with NDepend around callers, dependencies, inheritance, and dead-code investigation. The difference is the product boundary: Graphify C# is not a free NDepend clone or an IDE replacement. It is a Roslyn-native semantic index that other tools and agents can build on. Use it with Graphify—or without it Graphify C# is standalone. It does not invoke, load, or require Graphify. Without Graphify, query the JSON with an agent, jq , C#, Python, or any other consumer. For example, list every indexed method: jq ' .nodes[] | select(.properties.node_kind == "method") ' \ graphify-out/csharp.json With Graphify, refresh the C# evidence and use its higher-level query, path, explanation, clustering, and export workflows: graphify-csharp \ --input ./src/MyProduct.sln \ --root . \ --configuration Release \ --output ./graphify-out/csharp.json graphify query " Which methods call the order service? " \ --graph ./graphify-out/csharp.json Graphify remains the general graph workflow. graphify-csharp contributes the C# layer where compiler binding matters. What gets indexed Source declarations Namespaces, classes, structs, interfaces, records, enums, and delegates Constructors, methods, operators, and local functions Properties, indexers, fields, enum members, and events Parameters, locals, type parameters, aliases, labels, and query range variables Compiler-resolved relationships Direct calls, constructor calls, method groups, and member access Field, type, attribute, generic, typeof , and declaration-header references inherits , implements , and overrides Compiler-selected operators, conversions, deconstruction, foreach , await , using , patterns, ranges, and collection expressions Invocation and constructor arguments bound to source formal parameters Cross-project relationships with overload-aware, project/TFM-aware identity Every edge points from the declaration where the relationship was observed to the declaration Roslyn resolved. Source location and provenance are retained. Unsupported semantic shapes are reported as diagnostics instead of silently disappearing or crashing the entire extraction. See Compatibility for the complete language and compiler-feature matrix. Keep the index warm For repeated agent work, start a watcher: graphify-csharp \ --input ./src/MyProduct.sln \ --root . \ --configuration Release \ --output ./graphify-out/csharp.json \ --watch The watcher keeps the Roslyn workspace warm and prepares changed projects in the background. A normal graphify-csharp invocation acts as an explicit refresh barrier and returns only after a complete JSON snapshot is current. If no matching watcher is running, the same command performs a one-shot refresh. Use --rebuild to invalidate the incremental cache. See Usage and Incremental indexing for watcher ownership, filtering, recovery, and cache behavior. Runtime and language support The package contains two tool assets: Tool asset Runtime Compiler su