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.
npx agentmods add commands/dragoon0x/canon/optimizegit clone --depth 1 https://github.com/Dragoon0x/canonWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00022 | $0.00523 |
| Opus 5 | $0.00011 | $0.00262 |
| Sonnet 5 | $0.00004 | $0.00105 |
| Haiku 4.5 | $0.00002 | $0.00052 |
Grade A, and why
optimize 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.
What it actually says
/optimize
Measure, then cut. Not vibes-based "it feels slow" — concrete targets from canon-performance.
Targets (Core Web Vitals, "Good" thresholds)
- LCP: ≤ 2.5s
- INP: ≤ 200ms
- CLS: ≤ 0.1
- TTFB: ≤ 800ms
Budgets
- Initial JS (parsed+compiled): ≤ 200KB gzipped for most apps, ≤ 350KB for complex.
- CSS: ≤ 60KB gzipped.
- Hero/LCP image: ≤ 200KB, served at correct dimensions,
fetchpriority="high", no lazy. - Total page weight (first load): ≤ 1.5MB.
Checklist
- LCP image: identified, preloaded,
fetchpriority="high", notloading="lazy", served at rendered size. - Fonts:
font-display: swap, 1–2 families max, subset if possible, preload the critical weight. - CLS: width and height attributes on every
<img>, reserved space for ads and embeds, no layout-shifting web fonts without proper fallbacks. - JS: code-split by route, lazy-load below-the-fold interactive components, tree-shake dead imports, replace heavy libs (moment → date-fns, lodash-full → per-function).
- Third parties: audit. Every third-party script pays rent or leaves.
- Images: modern formats (AVIF with WebP fallback),
srcsetfor responsive, no raw PNG/JPG where a vector works. - Caching: long cache for hashed assets, short/no cache for HTML, service worker only if you own the consequences.
- INP: keep long tasks ≤ 50ms, debounce input handlers, defer non-critical work with
requestIdleCallbackorscheduler.postTask.
Output
- Current vs target table for each metric.
- Top 5 interventions ranked by impact.
- Before/after bundle report if applicable.
- Specific code changes, not "consider optimizing".
Success criteria
Hits all four CWV "Good" thresholds on a median mobile device over 4G. Bundle under budget. No single task over 50ms on the critical path.
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.
- 2d ago First seen · 45 lines · 22 tokens per session scan A 4b229f2830a5
optimize is a command published in the GitHub repository Dragoon0x/canon (5 stars, last pushed 4mo ago), licensed MIT. It adds 22 tokens to every session and 523 once invoked, about $0.0001 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-31.
Other commands, from other repositories
pm-status
Scan open PRs, report pipeline state, merge ready work to dev, and keep the staging promotion PR current.
codex-review
Run an adversarial review of the current branch via Codex (GPT-5.4). Default = direct Bash + thin + cheap; --verbose = wrapper-agent + 3x Opus burn.
review-pr
Fetch a pull request diff, run code-reviewer analysis, translate findings to owner voice, and post a single batched inline GitHub review.
freeze
Activate the REA kill switch — writes .rea/HALT with a reason, blocking all governed tool calls until unfrozen.
halt-check
Smoke test — verify every hook and middleware respects the HALT kill switch. Advisory, read-only.
rea
Print REA session status — autonomy level, HALT state, policy profile, and recent audit entries.