skill-graph is a proposed runtime layer for AI agents that turns flat skill libraries into graph-structured, progressively disclosed capability context.
Current agent skill systems usually work like this:
- The agent sees a flat list of installed skill names and descriptions.
- A matching skill is loaded when the model decides it is relevant.
- Remote marketplace discovery is separate from the agent's immediate task context.
skill-graph explores a different model:
- Skills are indexed as typed graph nodes.
- Nodes have relationships such as
requires,specializes,complements,conflicts_with, andsupersedes. - Each node exposes multiple context depths, from a short capability card to full
SKILL.mdcontent and referenced files. - During an agent task, the resolver returns the smallest useful skill subgraph, then lets the agent expand deeper only when the work requires it.
The goal is not to replace skills.sh, Claude Skills, Codex Skills, or local SKILL.md directories. The goal is to create a coordination layer that makes those ecosystems more useful at runtime.
This repository now includes the first local-first CLI implementation for skill-graph.
The current launch scope is intentionally small: local skill indexing, BM25 local search with deterministic lexical and optional semantic providers, deterministic graph resolution, context expansion, last-resolution explanations, and a companion agent skill. Hosted sync, user accounts, telemetry, remote embedding uploads, and automatic remote installs are out of scope for the current local-first version.
Install dependencies and build the CLI:
npm install
npm run buildIndex local project and user skills:
node dist/cli/index.js indexOptionally build a local semantic embedding index:
node dist/cli/index.js embeddings index --provider qwen3-localThe real semantic provider runs locally through Python and sentence-transformers with Qwen/Qwen3-Embedding-0.6B by default. Tests and demos use a deterministic provider instead so verification does not require model weights:
node dist/cli/index.js embeddings index --provider deterministicSome embedding model repositories require custom model code. In that case, review the model source first, then opt in explicitly:
node dist/cli/index.js embeddings index --provider qwen3-local --trust-remote-codeIf skill text changes after embeddings are built, semantic search will ask you to rebuild the local embedding index.
Search the indexed graph:
node dist/cli/index.js search "frontend design"Compare against the deterministic lexical baseline:
node dist/cli/index.js search "frontend design" --strategy lexicalFuse BM25 and lexical rankings:
node dist/cli/index.js search "frontend design" --strategy hybridSearch with semantic similarity after embeddings are indexed:
node dist/cli/index.js search "visual screenshots review" --strategy semanticSuggest inferred graph edges for human review:
node dist/cli/index.js edges suggestCache remote skills.sh candidates without installing them:
node dist/cli/index.js remote-cache "accessibility keyboard"Index local skills plus remote candidates from skills.sh:
node dist/cli/index.js index --skills-sh-query "accessibility keyboard"Resolve a task into a skill context plan:
node dist/cli/index.js resolve "make this React dashboard production-ready"Expand a selected node to full skill context:
node dist/cli/index.js expand frontend-design --depth fullExplain the last resolution:
node dist/cli/index.js explain --lastDuring local development, the same commands can be run through tsx:
npm run dev -- index
npm run dev -- resolve "make this CLI production-ready"Run the built-in demo:
npm run demoThe demo indexes example skills, builds deterministic demo embeddings, suggests review-required inferred edges, searches the graph with BM25, lexical, semantic, and hybrid retrieval, caches remote candidates, resolves a local frontend task, expands summary, full, and linked artifact context, explains the saved resolution, and shows the approval-required path for a remote accessibility skill.
skill-graph index: scans skill roots and manual graph files, then writes.skill-graph/index.json.skill-graph index --skills-sh-query "<query>": includes cached, not-installed skills.sh candidates as remote graph nodes.skill-graph remote-cache "<query>": searches skills.sh through the official Skills CLI, caches metadata under.skill-graph/cache/, and prints approval-required install commands.skill-graph embeddings index: builds.skill-graph/embeddings.json; default provider is local Qwen3, and--provider deterministicis available for tests and demos.skill-graph embeddings info: shows saved semantic index provider, model, dimensions, and vector count.skill-graph edges suggest: proposes embedding-similarity graph edges withreviewStatus: proposed; it does not mutate canonical graph edges.skill-graph search "<query>": ranks graph nodes with BM25 by default; pass--strategy lexicalto compare against the deterministic baseline,--strategy semanticto use the saved embedding index, or--strategy hybridto fuse BM25, lexical, and semantic rankings when embeddings exist.skill-graph resolve "<task>": returns selected nodes, depths, frontier nodes, conflicts, missing remote nodes, token estimates, scoring provider provenance, and explanations.skill-graph expand <node-id> --depth <depth>: returnsl0,l1,l2,l3,l4,summary,capability_card, orfullcontext when available.summarymaps to the deterministicl2operational summary.skill-graph context: shows context layers expanded in the current workspace.skill-graph explain --last: renders the previous resolution from.skill-graph/last-resolution.json.skill-graph install <node-id>: graph-aware dry-run guidance with the exact approval-required remote install command when available.
Run the verification suite:
npm test
npm run typecheck
npm run build
npm run demoThe test suite covers:
SKILL.mdparsing and normalization.- Local skill indexing with manual graph overlays.
- BM25 and deterministic lexical search ranking.
- Deterministic semantic embedding indexing and search.
- Review-required inferred edge suggestions from embedding similarity.
- Hybrid BM25, lexical, and semantic reciprocal rank fusion.
- skills.sh CLI output parsing and remote candidate normalization.
- Retrieval relevance regression fixtures.
- Resolver planning, ancestors, frontier nodes, conflicts, and token budgets.
- Progressive context summaries and budget downgrades.
- Linked local artifact expansion through
l4. - Loaded context tracking.
- Approval-required install plan output.
- Context expansion.
- End-to-end CLI behavior over fixture skills.
- PRD.md: End-to-end product requirements and strategy.
- docs/architecture.md: Proposed system architecture and components.
- docs/runtime-protocol.md: How an agent should use the graph during a task.
- docs/graph-schema.md: Draft schema for nodes, edges, context layers, and provenance.
- docs/technical-plan.md: Launch-ready implementation plan, stack, hosting decision, and human-in-the-loop boundaries.
- docs/marketplace-strategy.md: How this complements skills.sh and existing skill marketplaces.
- docs/roadmap.md: MVP and future milestones.
This repository vendors project-level agent skills under .agents/skills so future agent sessions can use the same build-support workflows while developing skill-graph.
Current project skills:
find-skillstest-driven-developmentverification-before-completiontypescript-advanced-typesnodejs-backend-patterns
The selected skill sources and hashes are tracked in skills-lock.json.
Agent skills should behave less like a flat plugin list and more like a contextual knowledge graph. A skill graph can help an agent answer questions such as:
- What broad capability area am I in?
- Which installed skills are relevant?
- Which remote skills might improve the task?
- What prerequisite context should I load first?
- Which deeper skill nodes should I expand only after seeing the repository and task details?
- What skill conflicts or overlaps should I avoid?
- Building a new agent runtime.
- Replacing skills.sh.
- Automatically installing untrusted remote skills without user approval.
- Forcing every skill into a strict tree.
- Requiring agent vendors to change their native skill loading behavior.
MIT. See LICENSE.