Copilot reads .github/copilot-instructions.md for the whole repo (and optional
path-scoped .github/instructions/*.instructions.md). Add the Substrate protocol there.
-
Install and initialize (once per repo):
npm install -g substrate-cli substrate init your-project # already set up? git clone + substrate sync pull -
Create
.github/copilot-instructions.md:## Substrate context This project uses Substrate for persistent, shared context — decisions, constraints, and conventions stored in committed `.substrate/` files (git is the transport; no server, no accounts). - **At the start of a session**, load and follow context: `substrate brief --format agent` - **When the work produces something durable** (a constraint, decision, or convention), capture it: `substrate add "<statement>" --type <constraint|decision|note|task|entity|runbook|snippet> [--tag <tag>]`. Add `--private` for personal/machine-specific notes (kept out of git). - **After capturing**, share it: `substrate sync push`, then `git add .substrate && git commit -m "Update context" && git push`. - On a fresh clone, run `substrate sync pull` first.
Path-scoped context (optional): for a subtree, add
.github/instructions/api.instructions.md with an applyTo: "src/api/**" frontmatter and
capture matching context with --scope "src/api/*".
Open Copilot Chat and ask: "What constraints and decisions are stored for this project?"
It should run substrate brief --format agent and report them.
- Copilot isn't following instructions — confirm
.github/copilot-instructions.mdexists and instruction files are enabled in settings; checksubstrate --version. - No context —
substrate statusandsubstrate sync status. - Team out of sync —
git pull && substrate sync pull; after capturing,substrate sync push+ commit.