The Substrate Skill implements the ability to add, process, read, retrieve, and analyze information into and from the substrate framework. It is a single skill with 13 workflows and two deterministic Bun/TypeScript tools (SubstrateMatch plus MaintainSubstrate) to keep the knowledge graph consistent over time. It is framework-agnostic — built for PAI/Personal_AI_Infrastructure as well as for other agent harnesses (OpenCode, Hermes, and similar). The resulting dataset can live inside your skill directory structure or anywhere on disk via a configurable base_path.
This is a community contribution to the ecosystem around Daniel Miessler's Substrate project. For detailed information, see the SKILL.md file and the capabilities in the workflows subdirectory.
Substrate/ # The skill package (drop this in your skills dir)
├── SKILL.md # Main skill definition
├── Workflows/ # 13 workflow definitions
├── Templates/ # Component file templates
├── Tools/
│ ├── substrate-match/ # SubstrateMatch tool (bun package)
│ ├── substrateMatch-spec.md # SubstrateMatch technical spec
│ └── maintainSubstrate-spec.md
├── Ontology.md # Cross-reference ontology
├── Taxonomy.md # Component type taxonomy
└── example.config.yaml # Example configuration
Tools/
└── maintainSubstrate.ts # Deterministic substrate maintainer/auditor
Example/
└── substrate-global/ # A small example substrate built from two articles
Basically, we just need to get the files in this repository into the right locations. This Readme and the Example/ are optional. Clone this to a temporary directory, fork it, or download the zip and move manually (or ask your agent to do it) — I recommend setting $PAI_DIR to your ~/.opencode or wherever your harness lives.
In a hierarchical-skills setup, move the entire Substrate directory under a relevant category (e.g. $PAI_DIR/skills/Knowledge/Substrate).
If your harness requires a skill index, regenerate it per your platform's normal procedure.
The cross-link matcher ships as a self-contained bun package at Substrate/Tools/substrate-match/. From that directory:
cd Substrate/Tools/substrate-match
bun installThen invoke (see Substrate/Tools/substrateMatch-spec.md for full usage):
bun run src/index.ts match --substrate <path-to-substrate> \
--type Problem --title "..." --tags "..." --description "..." \
--top 10 --min-score 0.35 --prettyMove Tools/maintainSubstrate.ts to $PAI_DIR/PAI/Tools (or wherever your harness keeps standalone tools), then install its dependency:
bun install # in the repo root (adds the `yaml` parser dependency)To run the maintainer, provide your substrate as the argument without the substrate- prefix:
bun run maintainSubstrate.ts --substrate globalInformation about the tool is in the Maintenance spec.
Copy Substrate/example.config.yaml to your skill's config location and customize. The exact filename depends on your platform (e.g. config.yaml under ~/.opencode/skills/Substrate/); some harnesses use substrate.config.yaml.
The repository includes a small example substrate built by running the DocumentIngest workflow on two articles and then the Maintenance script to create the linkage:
- https://www.texasmonthly.com/news-politics/san-antonio-trailer-deaths-migrant-smuggling/
- https://wbrassociation.org.uk/why-changing-our-environment-is-so-hard/
These two example articles were chosen because they are public news/sources about a tragic real event and an urbanism topic — illustrative, not endorsements.
Todo list of things I'd like to add:
Definitely
- Create some usage workflows (currently everything is about data ingest and organization; I want some canned uses rather than only extemporaneous ones)
- Create a map in Mermaid of the current contents
- Specify a specific component and create a Mermaid graph of just that
Just an idea
- Create an Obsidian Vault from the contents (enabling a graph view through its native capability)
- Add data collection scripts as in the upstream Substrate (may or may not be sensible to publish publicly)
This skill builds on Daniel Miessler's Substrate project and its CC BY-SA 4.0 license. See the LICENSE file.