Skill Graph¶
This repository uses a generated skill graph to answer one question:
Which agent and which skills should handle a task, and in what order?
The graph is real, but it is not a standalone workflow engine. It is a routing layer built from the repository's markdown files and used to narrow context for Claude Code and Codex.
What "Skill Graph" Means Here¶
The graph is assembled from three kinds of relationships:
- Agent -> skill ownership from each agent's
Mandatory Skill Usagesection. - Skill -> skill workflow links from each agent's
Workflow Decision Tree. - Skill -> skill advisory links inferred from skill bodies when one skill references another.
The generated output is:
catalog.json: full parsed view of agents, skills, and edges — the single source of truth consumed by the router
This file is built by scripts/skill_index.py.
Source of Truth¶
The graph is derived from markdown, not hand-maintained JSON.
Primary sources:
agents/*.mdskills/*/SKILL.md
Within agent files, these sections matter:
## Skill Lookup## Mandatory Skill Usage## Workflow Decision Tree## Task Recognition Patterns
Within skill files, slash-prefixed references to other skills can produce advisory relationships such as compose_with or depend_on.
Build Process¶
Build the catalog from the repository root:
Or use:
The builder parses every skills/*/SKILL.md and agents/*.md, then emits:
catalog/catalog.json
Edge Types¶
The current graph uses these edge types:
uses: an agent explicitly owns or uses a skillworkflow_next: a workflow decision tree says one skill leads to anotherdepend_on: a skill should come after another skillcompose_with: two skills are commonly used togethersimilar_to: one skill is an alternative to anotherbelong_to: one skill is part of a larger unit of work
Two details matter:
workflow_nextanddepend_onare both generated from the workflow tree. One gives forward order, the other gives prerequisite order.- Skill-body relationships are heuristic. They are useful for routing, but they are not as strong as explicit workflow edges from an agent file.
How Routing Works¶
Routing is handled by:
The router:
- Loads the built catalog or rebuilds it from the repo.
- Scores skills against the task using:
- skill name and description overlap
Task Recognition Patterns, with generic one-word overlaps such asreviewsuppressed for multi-word patterns- optional agent filter
- optional platform filter such as
--platform codex - Selects the best matching primary skills.
- Pulls in prerequisite skills through
depend_onedges. - Orders the final list with
workflow_nextedges. - Returns:
- selected agent
- primary skills
- supporting skills
- suggested order
- referenced agent and skill file paths
Example:
Typical output shape:
Agent: omics-scientist
Primary skills: bio-assembly-qc, bio-binning-qc, tracking-taxonomy-updates
Supporting skills: bio-reads-qc-mapping, bio-annotation, bio-gene-calling, bio-viromics
Suggested order: bio-reads-qc-mapping -> bio-assembly-qc -> tracking-taxonomy-updates -> bio-binning-qc
How Claude Code Uses It¶
Claude Code is expected to use an installed agent file such as:
After installation, agent prompts in ~/.claude/agents/ tell Claude to:
- Run the shared catalog router first.
- Use the returned skill order as the default path.
- Open only the referenced
SKILL.mdfiles. - Follow the ordered workflow unless the task clearly falls outside it.
In practice, the intended loop is:
Then Claude works from the returned subset instead of scanning the whole repository.
How Codex Uses It¶
Codex is expected to load an installed agent prompt such as:
Or set one as the default agent:
The Codex agent prompt follows the same model as Claude:
- Route the task with
skill_index.py route. - Restrict context to the returned agent file and
SKILL.mdfiles. - Execute the task using that ordered set of skills.
What This Is Not¶
This repository does not currently implement:
- a native skill executor that walks the catalog edges by itself
- a strict schema-backed DAG with full validation
- direct Claude or Codex integration that automatically consumes
catalog.json
Instead, the graph is consumed through prompt instructions plus the route command.
Practical Mental Model¶
Use this model when working in the repo:
- Agent markdown defines policy and workflow structure.
- Skill markdown defines behavior and optional cross-skill references.
skill_index.pyturns those docs into a graph.routeturns the graph into a recommended workflow for a task.- Claude Code or Codex follows that recommendation by loading only the relevant prompts.
Maintenance Rules¶
When adding or changing a skill, update the graph inputs, not only the prose:
- Add or update the skill's
SKILL.md. - Update the relevant agent file:
Mandatory Skill UsageWorkflow Decision TreeTask Recognition Patterns- Rebuild the catalog.
- Run tests:
If the workflow tree or task patterns are missing, the graph will be incomplete even if the skill documentation is otherwise good.
Current Limitation¶
The graph builder uses markdown parsing and slash-prefixed token extraction. That keeps authoring simple, but it also means skill-body relationships are advisory and may include false positives if prose looks like a skill reference.
Treat explicit agent workflow edges as authoritative. Treat inferred skill-body edges as hints.