SkillGraph
Contract-checked orchestration for agent skills, scientific workflows, and reproducible outputs.
Quick start ·
Workflow guide ·
Skill library ·
MCP integration ·
Report an issue
Languages:
English ·
简体中文 ·
繁體中文 ·
日本語 ·
한국어 ·
Español
✨ Why SkillGraph?
Turn a long agent conversation into an inspectable workflow — with explicit inputs, real files, and bounded feedback.
| 🧩 Compose |
🔒 Validate |
🔄 Recover |
Combine one or more SKILL.md packages in each YAML stage. |
Check declared artifacts, path boundaries, hashes, and optional JSON Schemas. |
Persist visits and checkpoints; pause, resume, retry, and loop within budgets. |
| 🔬 Research workflows |
🔌 Agent integration |
📦 Clone and build |
| Five paper workflow families covering empirical research, ML, medicine, bioinformatics, and surveys. |
Use the CLI, MCP stdio server, or a custom host agent. |
All 31 registered skills are bundled in skills/; no separate .vendor checkout needed. |
[!IMPORTANT]
SkillGraph is an orchestration engine, not a scientific certification service or an OS sandbox. Artifact checks, passing tests, and a compiled PDF do not establish scientific validity, ethics approval, or publication readiness. Host tools retain their own permissions; external models, data, Python packages, and TeX tooling must be configured separately.
📚 Explore the documentation
What SkillGraph Means
SkillGraph is an orchestration layer between an AI agent and the skills that the
agent uses.
An agent is good at reasoning and making decisions, but a long task becomes
fragile when every step is only an informal prompt. SkillGraph turns those steps
into a typed, bounded, resumable graph:
User prompt
│
▼
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Agent stage │ ───▶ │ Skill stage │ ───▶ │ Artifact │
│ task + input │ │ SKILL.md │ │ contract │
└──────────────┘ └──────────────┘ └──────────────┘
│
▼
Next stage / loop
The graph is the source of truth for what happens next, while the host agent
remains responsible for the actual scientific or engineering work. This makes a
workflow portable across Pi, an MCP client, a CLI agent, or a custom runtime.
How the Mechanism Works
flowchart LR
A["YAML workflow"] --> B["Resolve inputs + skills"]
B --> C["Host agent + tools"]
C --> D["Files + node_result.json"]
D --> E{"Contract checks"}
E -->|accepted| F["Persist state + route"]
E -->|invalid| G["Reject submission"]
F --> H["Next stage / bounded repair"]
H --> B
The host agent executes tools; the engine validates submissions and routes the graph.
SkillGraph does not ask an agent to complete a long task in one unstructured
conversation. It turns the task into a sequence of explicit state transitions.
Each transition has four parts:
- Stage definition — a YAML node declares the task, active skill bundle,
inputs, required outputs, visit limit and optional decision fields.
- Context resolution — before activation, the engine resolves input and
artifact references to the exact files produced by earlier visits. Missing
required inputs stop the run; branch-specific inputs can be marked optional.
- Agent execution — the host agent loads the active
SKILL.md files,
performs the stage using its tools, and writes files into the stage output
directory.
- Contracted commit — the agent submits
node_result.json; the engine
verifies the declared files, hashes them, records them in run state, evaluates
the next edge, and only then activates the next stage.
YAML node
→ resolve inputs and skill pins
→ load one or more SKILL.md contracts
→ agent writes declared files
→ node_result.json
→ artifact/path/schema/hash validation
→ deterministic edge selection
→ next node or bounded loop
This separation is the central design principle: the agent produces content;
the graph decides whether that content is admissible and what happens next.
State, provenance, and reproducibility
Every run records a manifest containing the workflow version, graph hash, active
skill hashes, session, inputs and timestamps. Every stage receives a unique
visit_id. Every accepted artifact records its producing node, visit, relative
path, byte size, SHA-256 hash and validation time.
As a result, a downstream stage does not receive an ambiguous label such as
"the latest manuscript". It receives a concrete path such as:
runs/<run>/stages/review/visits/<visit>/outputs/manuscript_under_review.md
A graph or skill change invalidates the corresponding run instead of silently
mixing old and new instructions.
Contracts instead of prompt conventions
A prompt can ask for a paper, but it cannot reliably prove that the paper
contains a methods section, that a figure exists, or that a number came from an
experiment. SkillGraph makes those expectations explicit:
inputs define what a stage is allowed to consume;
outputs define which files it must produce;
- artifact validation checks path boundaries, file existence, size and schemas;
decision fields drive declared branches;
priority resolves competing edges deterministically;
- loop edges impose iteration limits and require changing inputs;
- terminal release gates can validate PDF pages, figures, references and
reproducibility before completion.
Multiple skills in one stage
Some tasks need a coordinated set of methods. A node can expose a primary skill
and additional complementary skills:
- id: methods
type: agent
skill: experimental-design
skills:
- experimental-design
- statistical-power
The runner loads every listed SKILL.md into the stage context. This allows a
single stage to combine, for example, experimental design with power analysis,
or scientific writing with diagram construction, without merging unrelated
instructions into one oversized skill.
Branches, loops, and quality feedback
Branches represent real alternatives, not prose instructions. A medical workflow
can select clinical-cohort analysis or meta-analysis; a bioinformatics workflow
can select bulk RNA-seq, single-cell, or microbiome analysis. Each branch
produces its own artifacts and converges through explicitly bound inputs.
Loops declare feedback paths with provenance. Paper release workflows distinguish
figure, citation, formatting, and substantive manuscript repairs, rather than
sending every failure back to drafting. Revision bindings and downstream content
inheritance still require end-to-end validation; a completed stage alone does not
prove that every later consumer used the revised manuscript.
Core Concepts
1. Skill contracts
A skill is a bounded instruction package whose entry point is SKILL.md.
SkillGraph pins the skill file with SHA-256 at run start. If the skill changes
while a run is paused, the run refuses to continue silently.
skills:
- id: literature-review
version: 1
path: skills/literature-review
produces: [literature-review]
A stage can use one skill or a coordinated skill bundle:
- id: methods
type: agent
skill: experimental-design
skills:
- experimental-design
- statistical-power
The primary skill field remains backward-compatible; skills declares all
active skill contracts for the stage.
2. Artifact contracts
Stages do not merely return text. They declare files that must exist in the
stage output directory:
outputs:
- name: methods
required: true
- name: figures
required: false
The engine checks file boundaries, relative paths, size limits, SHA-256 hashes,
and optional JSON Schemas before accepting the stage.
3. Explicit data flow
A downstream stage receives a path to a validated upstream artifact:
inputs:
research_plan: "{{artifact:scope:research_plan}}"
dataset:
value: "{{artifact:eda:dataset.csv}}"
required: false
required: false is important for branch-specific artifacts. For example, a
bioinformatics draft can receive differential-expression results on a bulk
RNA-seq path and cell-marker results on a single-cell path without making either
branch pretend the other artifact exists.
4. Deterministic routing
Edges use explicit conditions and priorities:
- from: methods
to: eda
when: 'result.decision == "quantitative"'
priority: 20
- from: methods
to: draft
when: 'result.decision != "quantitative"'
priority: 10
Ambiguous routes, missing routes, invalid references, and implicit cycles are
rejected before or during execution.
5. Loops and quality gates
A review loop is a real graph loop, not a vague instruction:
- from: revise
to: review
bind:
manuscript: "{{artifact:revise:revised_manuscript}}"
loop:
id: revision-cycle
max_iterations: 3
This declares that the revised manuscript should be used by the next review;
it is not proof of end-to-end manuscript inheritance. Scientific workflows also
declare release checks for native LaTeX/PDF compilation, venue-specific formatting,
figures, references, and reproducibility. Missing scientific evidence or human
approval must remain unresolved, not be closed by repeated rewriting.
What This Provides
- YAML workflow graphs with deterministic routing and bounded execution.
- One or multiple active
SKILL.md contracts per stage.
- SHA-256 skill pinning so a run cannot silently continue after a skill changes.
- Required and optional artifact contracts with path and size validation.
- JSON Schema checks for machine-readable artifacts.
- Atomic state writes, per-run file locks, manifests, and event logs.
- Checkpoint, pause, resume, retry, and bounded loop execution.
- CLI and MCP stdio adapters.
- A structured question protocol for missing or ambiguous user input.
- Scientific workflow bundles for algorithms, medical research, bioinformatics,
surveys, experiments, LaTeX papers, figures, and PDF release gates.
🔬 Scientific Paper Workflows
The repository includes five workflow families under
.skill-workflows/workflows/:
| Workflow |
Purpose |
Main stages |
paper |
General empirical research |
question → literature → methods → data → statistics → figures → paper → review → LaTeX/PDF gate |
paper-algo |
Algorithm and ML innovation |
problem → related work → method → protocol → implementation → ablation → statistics → paper |
paper-medical |
Clinical and evidence-synthesis studies |
PICO → literature → clinical/meta branch → cohort/statistics/survival → paper |
paper-bioinfo |
Omics and computational biology |
assay design → bulk/single-cell/microbiome branch → enrichment → figures → paper |
paper-survey |
Literature surveys |
scope → corpus → evidence → taxonomy → synthesis → paper |
Each family is assembled from specialized skills such as:
hypothesis-generation
literature-review
experimental-design
statistical-power
exploratory-data-analysis
statistical-analysis
scientific-visualization
scientific-writing
peer-review
citation-management
venue-templates
scanpy, scvi-tools, pydeseq2, bulk-rnaseq
clinical-decision-support, pyhealth, scikit-survival
The paper release path is designed to produce: