build-subgraph

build-subgraph is a skill for Claude Code from ayeshakhalid192007-dev/graph-engineering-crash-course. It costs 40 tokens per session (1,324 once invoked), scanned A, original, MIT.

A tool that extracts a limited part of a graph around a chosen node, including nearby dependencies and attached disputed claims. It also reports what was left out of the full graph.

In plain words
What is it for?
It helps retrieve bounded context for a task, using a target node and a maximum dependency depth.
Why use it?
It keeps task context focused and shows that unrelated graph data was deliberately excluded.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter; reads .claude/ paths; mentions Claude Code.

Good fit It helps retrieve bounded context for a task, using a target node and a maximum dependency depth.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ayeshakhalid192007-dev/graph-engineering-crash-course/build-subgraph
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ayeshakhalid192007-dev/graph-engineering-crash-course --skill build-subgraph
Clone the repo
git clone --depth 1 https://github.com/ayeshakhalid192007-dev/graph-engineering-crash-course

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for build-subgraph

README.md
[![agentmods](https://agentmods.dev/badge/skills/ayeshakhalid192007-dev/graph-engineering-crash-course/build-subgraph/github.svg)](https://agentmods.dev/skills/ayeshakhalid192007-dev/graph-engineering-crash-course/build-subgraph)
Your own site
<a href="https://agentmods.dev/skills/ayeshakhalid192007-dev/graph-engineering-crash-course/build-subgraph"><img src="https://agentmods.dev/badge/skills/ayeshakhalid192007-dev/graph-engineering-crash-course/build-subgraph/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for build-subgraph

Your own site · 80×15
<a href="https://agentmods.dev/skills/ayeshakhalid192007-dev/graph-engineering-crash-course/build-subgraph"><img src="https://agentmods.dev/badge/skills/ayeshakhalid192007-dev/graph-engineering-crash-course/build-subgraph.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,324 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00040 $0.01324
Opus 5.5 $0.00016 $0.00530
Sonnet 5.5 $0.00008 $0.00265
Haiku 4.5 $0.00004 $0.00132

Measured 1mo ago against content hash 83de5fdb02d7, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

build-subgraph scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

starters/task-scoped-retrieval/.claude/skills/build-subgraph/SKILL.md · 116 lines

How it starts

The opening of the file, as written. The whole thing — 116 lines — stays where its author put it; the contents beside it link to each section on GitHub.

build-subgraph

Turns a target node id, a depth, and a full graph into a bounded subgraph: the target, its dependency neighborhood out to that depth, and any claim nodes attached to it that disagree with each other — nothing else. The boundedness is the point of this skill, not a side effect, so the output must state how much of the full graph it left out, not just imply it.

Instructions

You are a Claude Code skill implementing the task-scoped-retrieval pattern. Follow these steps in order:

  1. Read the full graph first. Open sample-graph.example.json (or the file the user names) and parse its nodes and edges arrays. Record the full node count and full edge count before doing anything else — this is the baseline the boundedness check compares against later.
  2. Resolve the target and depth. Take the target node id and depth from the user's request. Default to target normalize_currency_code and depth 1 if the user doesn't specify either — this kit's shipped scenario. Confirm the target id actually exists among the graph's nodes; if it doesn't, stop and report that the target was not found rather than guessing a near match.
  3. Build the depth-bounded dependency set. Starting from the target, follow calls edges outward (both directions — subject-to-object as "calls", object-to-subject as "called_by") for exactly depth hops. At depth 1, this is the target's direct callers and direct callees only — not their callers or callees in turn.
  4. Separately, pull every claim attached to the target. Ignoring depth entirely for this step, find each node linked to the target through a claims edge — there may be one, several, or none, and they may or may not agree with each other. Then find every contradicts (or similarly flagged conflict) edge running between those claim nodes. Do not pick one claim as the "right" one and drop the rest — carry every attached claim and every conflict edge between them into the result.
  5. Assemble the subgraph. The result's node set is: the target, the depth-bounded dependency set from step 3, and the claim nodes from step 4. The result's edge set is exactly the edges from the full graph whose subject and object are both in that node set — no edge gets included on its own if one of its endpoints didn't make the cut.
  6. Prove the boundary, don't just assert it — this step must never be skipped. Compare the full graph's node count (step 1) against the subgraph's node count (step 5). List, or at minimum count, which node ids from the full graph were excluded. If the full graph has any node outside the boundary and the subgraph's node count still equals the full graph's, treat that as a signal the traversal is wrong — a "subgraph" that isn't smaller than the graph it was drawn from hasn't scoped anything, and you should re-check steps 3-5 before returning a result.
  7. Write the result to output.json (or the path the user requested) in this kit's root, with this shape: target, depth, nodes (the included node objects), edges (the included edge objects), full_graph_node_count, subgraph_node_count, and excluded_node_ids (every node id in the full graph not present in nodes).
  8. Report a summary alongside the file: the target, the depth used, how many nodes/edges were included versus the full graph's totals, and which (if any) claim nodes were pulled in for disagreement rather than depth.

Read the full file on GitHub · 116 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 116 lines · 40 tokens per session scan A 83de5fdb02d7

Subscribe to this mod's changes

build-subgraph is a skill published in the GitHub repository ayeshakhalid192007-dev/graph-engineering-crash-course (5 stars, last pushed 1mo ago), licensed MIT. It adds 40 tokens to every session and 1,324 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

animate

Build a web animation: whether it should animate at all, the purpose, the tool, the properties, the easing curve, the duration, interruption and exit. Writes the CSS or Motion code for dropdowns, modals, toasts, tooltips, accordions, press feedback, stagger and scroll reveals. Use to animate something or make a…

ericrisco/rsc-harness · 75 tokens

fastapi

Use when building, reviewing, testing, securing or shipping a FastAPI / async Python service — routers, Pydantic v2 schemas, dependency injection, async SQLAlchemy 2.0, OAuth2/JWT, ASGITransport tests, production wiring. NOT language-level Python or packaging (that is python), NOT engine-level SQL (that is…

ericrisco/rsc-harness · 94 tokens

implement

Use when an approved plan and task list exist and it is time to turn them into working, tested code — the SDD phase after analyze and before verify. Enforces TDD: a failing test comes before the code that makes it pass, one task at a time, appended to a progress ledger that survives compaction. Delegates test tooling…

ericrisco/rsc-harness · 123 tokens

nextjs

Use when building, reviewing, testing, securing, or optimizing a Next.js App Router app: Server vs Client boundaries, use server actions, route handlers, the v15 vs v16 use cache caching model, metadata/SEO, auth, and Core Web Vitals. NOT framework-agnostic React or a Vite SPA (that is react), and NOT visual/UI design…

ericrisco/rsc-harness · 90 tokens

presentations

Use when building, theming, or exporting a presentation deck — pitch, sales, keynote, board/QBR, leave-behind one-pager — from slide structure to a token-based theme to PDF or editable PPTX (Marp, Slidev, python-pptx). NOT the words (that is marketing), NOT the visual tokens (that is design), NOT the investor story…

ericrisco/rsc-harness · 93 tokens

review

Use when a green diff needs adversarial judgment in the rsc SDD chain, between verify and ship — give a review keyed to the spec/plan/constitution in 02-DOCS/wiki/sdd/, or receive one and verify each comment before agreeing. NOT running lint/type/tests (that is verify), NOT the spec-less standalone pass (that is…

ericrisco/rsc-harness · 89 tokens