본문으로 건너뛰기
Skillpedia
일반 코딩11k · #11832

graft

하는 일

이 스킬은 AI가 미리 만들어진 지도를 이용해 저장소의 부분들이 어떻게 작동하는지 찾아보도록 합니다. 코드를 찾고 변경이 무엇에 영향을 줄지 알고 싶은 개발자를 위한 것입니다.

사용하는 경우

  • ✓저장소에서 기능이나 함수가 어디 있는지 알고 싶을 때.
  • ✓수정하기 전에 변경이 무엇에 영향을 줄지 보고 싶을 때.
  • ✓코드의 한 부분이 어떻게 작동하는지 이해해야 하는 경우.

스킬 링크

https://github.com/trailhq/Trail-Code/blob/main/.claude/skills/graft/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/trailhq/Trail-Code/blob/main/.claude/skills/graft/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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.

  • --source inlines 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 --full only when the crux is too small to act on.
  • --in <path> narrows to a subtree before ranking; -n N caps 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. ask is 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 retry graft grep — do NOT switch to raw grep -rn, which is slower and unranked.
  • -i case-insensitive; --in <path> scopes to a subtree. Raw grep -rn is 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 map already 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 old callees).
  • --depth N: walk transitively N hops for the full blast radius (the old impact); --depth 2 is 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". map alone is the answer: read the hub cards it names; do NOT then skeleton or ask your way through every subsystem it lists. --max-dirs N widens 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.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

비슷한 스킬