graft
하는 일
이 스킬은 AI가 미리 만들어진 지도를 이용해 저장소의 부분들이 어떻게 작동하는지 찾아보도록 합니다. 코드를 찾고 변경이 무엇에 영향을 줄지 알고 싶은 개발자를 위한 것입니다.
사용하는 경우
- ✓저장소에서 기능이나 함수가 어디 있는지 알고 싶을 때.
- ✓수정하기 전에 변경이 무엇에 영향을 줄지 보고 싶을 때.
- ✓코드의 한 부분이 어떻게 작동하는지 이해해야 하는 경우.
스킬 링크
https://github.com/trailhq/Trail-Code/blob/main/.claude/skills/graft/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“이 저장소에서 속도 제한은 어디서 처리되고, 무엇이 그것을 호출하나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
AI는 그래프 도구에 질문을 보내고, 파일과 줄 번호, 짧은 코드 발췌와 함께 가장 관련 있는 코드 위치를 받습니다. 많은 원본 파일을 전부 읽는 것보다 빠릅니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
graft
graft/ holds a graph of this repo: small markdown nodes that each explain one
part in prose and name the exact file:line spans they cover, plus a wiring
graph of who-calls-what. Querying a node costs a few hundred tokens; rebuilding
that understanding by reading source costs thousands, and misses the edges.
Every command below is $0, needs no API key, and returns in under a second.
There are six of them. Pick the one that fits the task, run it, act on the
answer; don't chain tools hoping for more. Most tasks need one call.
The tools
1 · graft ask "<question>" --source: locate + understand (the default)
Ranked retrieval over the graph, routed automatically between prose nodes and
the wiring graph, returning the top hits with exact file:line.
--sourceinlines the code at each hit, the ≤8-line crux of each definition, so the result IS the code you need, no follow-up file read. Add--fullonly when the crux is too small to act on.--in <path>narrows to a subtree before ranking;-n Ncaps results (default 8).- Use it when the question is conceptual or locational: "how does auth work", "where is rate-limiting handled", "what assembles the request pipeline".
- One ask usually answers. A genuinely multi-part question needs one ask per distinct sub-aspect, never the same question reworded. Few or weak hits mean switch tool (grep / skeleton / callers), don't re-ask.
2 · graft grep "<pattern>": exhaustive find
Regex (or --fixed for a literal) over every indexed file, hits grouped by
enclosing symbol and ranked by coupling; it also reports files it couldn't read.
- Use it when you need every occurrence: all call sites, all uses of a
constant, all providers.
askis ranked top-N and will miss instances; grep won't. One grep replaces a spray of asks. - Search a short symbol name or literal, not a full guessed signature: an
over-specific regex (
func (s *Server) GenerateHandler) returns nothing even when the code is indexed. If a grep misses, loosen it (drop the receiver and signature, keep the bare name) and retrygraft grep— do NOT switch to rawgrep -rn, which is slower and unranked. -icase-insensitive;--in <path>scopes to a subtree. Rawgrep -rnis only for files graft genuinely doesn't index (docs, configs, brand-new files).
3 · graft skeleton <file>: a file's API at a glance
Signatures-only view of one file (every function / method / type with its span) in ~200 tokens, ~10x cheaper than reading the file.
- Use it when you need "what's in this file / what can I call here" before
editing or wiring into it. One skeleton is the whole answer for a file; don't
re-skeleton the same file, and don't skeleton every file
mapalready named.
4 · graft callers <symbol>: the exact edges
Precomputed call/reference edges, not a text search. Symbol can be bare
(Foo), qualified (Class.method), or package-qualified (pkg.Fn).
- default
--direction in: who calls/references this; run before you rename, delete, or change its signature. --direction out: what this symbol itself calls/depends on (the oldcallees).--depth N: walk transitively N hops for the full blast radius (the oldimpact);--depth 2is the usual "what breaks if I touch this".--depth all: the entire connected closure — every source reachable through the edges. Reach for this before a refactor, rename, or any multi-file change: it surfaces the sibling and downstream files (platform variants, a module you must split out) that a single-file edit would miss.
5 · graft map: orientation for an unfamiliar repo or area
A token-budgeted tour: directory clusters, per-directory hubs, and global hotspots, straight from the wiring graph.
- Use it when you land in a repo cold or are asked for "the architecture".
mapalone is the answer: read the hub cards it names; do NOT then skeleton or ask your way through every subsystem it lists.--max-dirs Nwidens it.
6 · Lifecycle: graft build / graft check
Every tool above refreshes the graph itself before answering, so what those tools
return always describes the code as it is right now — including edits you just made
and have not committed. You do not need to run build after editing.
One caveat, if you grep the markdown under graft/ directly: those cards are a
projection, rebuilt at the end of the turn rather than
자주 묻는 질문
API 키가 필요한가요?
아닙니다. 스킬의 명령은 API 키가 필요 없고 로컬에서 실행된다고 설명합니다.
코드를 직접 읽는 것을 대신하나요?
아닙니다. 먼저 필요한 맥락을 집중적으로 제공해서, AI가 전체 파일을 덜 읽어도 되게 합니다.
명령은 얼마나 빠른가요?
스킬은 각 명령이 1초 안에 결과를 돌려준다고 설명합니다.
상세 정보
작성자의 원본 설명
This repo is indexed by graft/. For ANY task here, whether understanding how something works, finding where code lives, tracing what calls a symbol or what a change breaks, or scoping an edit, get your context from graft before grepping or reading source files.
repo: trailhq/Trail-Code
인기도
- GitHub 스타
- 11k
- 순위
- #11832
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …