canopy AGENTS.md

A project guide for Canopy, a Git-managed prompt tool for AI workflows. It explains the project, its TypeScript and Bun setup, file layout, coding rules, and related tools.

In plain words
What is it for?
Use it when working on Canopy's prompt data, command-line commands, validation, formatting, tests, or generated Markdown and TypeScript files.
Why use it?
It gives coding agents a concise source of project rules and technical context before they modify the repository.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/jayminwest/canopy/agents-md
Clone the repo
git clone --depth 1 https://github.com/jayminwest/canopy

Made for: Codex, OpenCode.

Per session 4,243 This file is loaded in full into every session.
When invoked 4,243 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.04243 $0.04243
Opus 5 $0.02122 $0.02122
Sonnet 5 $0.00849 $0.00849
Haiku 4.5 $0.00424 $0.00424

Measured 2d ago against content hash bcc3bf56cf3b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

canopy AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 392 lines

How it starts

The opening of the file, as written. The whole thing — 392 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md

This file is the canonical entry point for AI coding agents working in the canopy repo, following the agents.md convention. It mirrors the essentials from CLAUDE.md; when the two disagree, CLAUDE.md is authoritative and this file should be updated to match.

What this project is

Canopy is git-native prompt management for AI agent workflows. Prompts are structured records with composable sections, inheritance, versioning, and schema validation. The JSONL file IS the database; cn emit renders prompts to plain .md (or .ts) files for any downstream tool to consume. Minimal runtime dependencies, advisory file locks for concurrent agents, Bun runtime.

Canopy is part of the os-eco ecosystem alongside warren (control plane), burrow (sandbox), plot (coordination), mulch (expertise), and seeds (issue tracking). See SPEC.md for the full design record.

Tech stack at a glance

  • Runtime: Bun (runs TypeScript directly; no build step on the CLI).
  • Language: TypeScript with strict mode (noUncheckedIndexedAccess, no any).
  • Lint / format: Biome (biome.json). Errors fail CI; the useFilenamingConvention rule enforces kebab-case filenames.
  • Tests: bun test discovers *.test.ts next to the file under test; configuration lives in bunfig.toml.
  • Storage: JSONL files under .canopy/ (one per record type, diffable / mergeable, merge=union gitattribute).
  • CLI: cn (defined in src/index.ts, dispatched via commander).

Project layout

canopy/
├── src/
│   ├── index.ts            # cn CLI entry point + Commander wiring
│   ├── commands/           # one file per subcommand
│   ├── render.ts           # inheritance resolution
│   ├── validate.ts         # schema validation
│   ├── store.ts            # JSONL read/write with advisory locks
│   ├── output.ts           # human + JSON output helpers
│   ├── frontmatter.ts      # YAML frontmatter renderer
│   ├── yaml.ts             # minimal built-in YAML parser
│   └── ...
├── scripts/                # quality-gate scripts (size, debt, coverage, …)
│   ├── check-all.ts            # canonical quiet runner (byte-identical fleet-wide)
│   ├── check-ci-parity.ts      # CI ⇄ check:all parity gate (byte-identical fleet-wide)
│   ├── ci-parity-config.json   # per-repo parity escape hatches (aliases / ciOnly)
│   ├── validate-agents-md.ts   # validates this file's references
│   ├── generate-cli-docs.ts    # emits docs/cli-reference.md
│   ├── check-file-sizes.ts
│   ├── check-debt-markers.ts
│   ├── check-coverage.ts
│   ├── report-test-timing.ts
│   └── report-quality-metrics.ts
├── budgets/                # ratchet budgets (coverage, file-size, debt)
├── docs/
│   ├── cli-reference.md    # auto-generated; do not edit
│   └── architecture.mmd    # mermaid service diagram
├── .canopy/                # canopy's own prompts (dogfood)
├── .factory/skills/        # repo-local agent skills
├── .github/workflows/      # ci.yml + publish.yml + auto-merge.yml
├── SPEC.md                 # V1 design record
├── README.md               # user-facing pitch
├── CHANGELOG.md            # release history
├── RUNBOOK.md              # release / triage / rollback procedures
├── biome.json
├── bunfig.toml
├── tsconfig.json
└── package.json

Read the full file on GitHub · 392 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 392 lines · 4,243 tokens per session scan A bcc3bf56cf3b

Subscribe to this mod's changes

canopy AGENTS.md is an instructions file published in the GitHub repository jayminwest/canopy (39 stars, last pushed 29d ago), licensed MIT. It adds 4,243 tokens to every session, about $0.0212 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.