@erclx/canon

中文文档
5.88.0发布于 2026/11/13MITES Module近 30 天下载 1.3万

Runs your agent's work and keeps its code good, on one setup for every repo.

原始使用文档
文档目录10 节
  1. Quick start
  2. Five roles, each in its own session
  3. The record each step writes
  4. Practice skills with cited sources
  5. Checks that catch a skipped step
  6. One worktree for each change
  7. Setting up a project
  8. For your agent
  9. Docs
  10. Contributing
canon

canon

A Claude Code plugin and CLI that runs agent work from plan to merge.

npm version CI status License MIT

Claude Code's agent view in canon: sessions complete, take answers, and arrive, then a slash opens canon's skill menu

Quick start

claude plugin marketplace add https://github.com/erclx/canon
claude plugin install canon@canon
bun install --global @erclx/canon

Then open a project in Claude Code and run /canon:target-setup, which brings it onto canon.

canon expects someone who already knows Claude Code well. It runs on Linux and macOS, and the CLI needs Bun.

Five roles, each in its own session

You talk to the orchestrator, which starts the others and hears back from each.

  • The orchestrator dispatches the rows on the task board
  • A planner reads the code and writes one plan you approve
  • A worker builds the plan and opens the pull request
  • A code reviewer reads the diff from a fresh session
  • A UI reviewer drives the visual checklist in the running app

The record each step writes

Each record has a fixed shape, so the next session knows where to read. Records live under .canon/ in the main checkout.

  • Before a build: intake, groundwork, the plan, its task, and the board
  • Around a pull request: the code review, the UI review, and the screenshot evidence
  • Across sessions: the drive log, the context entries, and the handoff a compaction would lose

Practice skills with cited sources

Each skill loads when its kind of work starts, and every rule names where it came from.

SkillLoadsCites
code-craftBefore a new function or moduleGoogle, What to look for in a code review
test-craftBefore writing a testHam Vocke, The Practical Test Pyramid
api-designBefore shaping a flag or outputSoftware Engineering at Google
ui-craftWhen a rendered file changesW3C, Using ARIA
systematic-debuggingOn a bug nobody has explainedJesse Vincent, superpowers

Each rule has its own source row in a ledger, and the skill audit fails when a skill's rules and its rows disagree in count.

Checks that catch a skipped step

A skill says what good looks like. These four parts hold the agent to it.

  • Rules by path load when the agent opens a matching file, and each names the skill that owns that kind of file
  • Hooks read each action before or after it runs, refusing some and reporting others back into the same turn
  • The gate runs every stage before a pull request opens, and a stage that cannot read its input fails rather than passing
  • A deny rule keeps the agent from merging, since a hook fails open on a timeout and a permission rule does not

One worktree for each change

Changes run side by side. Each worker builds in its own worktree on its own branch, and every session reads and writes the one .canon/ record in the main checkout, so no worktree keeps a copy of its own.

Setting up a project

The project starts with its stack's own tool, such as bun init or npm create vite, or with /canon:target-scaffold in an empty folder, and canon layers on top.

  1. /canon:target-setup detects the stack, shows the whole chain, and writes nothing until you say yes. Then it runs canon init, checks what landed, and indexes the docs.
  2. /canon:target-check reports, domain by domain, what the project holds against what canon now ships, and repairs nothing.
  3. /canon:target-update upgrades the CLI and plugin after a release, previews the changelog and any migrations, and catches the project up on your go-ahead.

Three kinds of file land in your repo:

  • Skills load live from the plugin, so there is no copy to drift
  • Rules are files under .claude/rules/ that load when you edit a matching path
  • Configs and seeds are real files you own, laid down by canon init and kept current by canon sync

For your agent

  • Every command runs without a prompt, and data on stdout pipes clean
  • canon <command> --help prints each command's flags, exit codes, and examples
  • Rules load by path, so the agent gets the rule for the file it is editing

Docs

  • AI workflow: the loop a feature runs
  • Operating model: planners, workers, and reviewers in parallel
  • Skill map: every skill by the moment you reach for it
  • Agents: flags, exit codes, and output shapes
  • Docs index: every reference doc, updating canon among them

Contributing

Issues are welcome. Pull requests are by invitation, so read the contributing guide before you open one. Released under the MIT license.

版本与发布记录

@erclx/canon 共发布 250 个版本,首次发布于 2026/08/31;过去 12 个月发布了 250 个版本。

版本发布日期距今
5.88.0latest2026/11/131 天前
5.87.02026/11/131 天前
5.86.02026/11/121 天前
5.85.02026/11/121 天前
5.84.02026/11/112 天前
5.83.02026/11/113 天前

关于 @erclx/canon 的常见问题

@erclx/canon 是什么?

Runs your agent's work and keeps its code good, on one setup for every repo.

如何安装 @erclx/canon?

在项目目录运行 npm install @erclx/canon,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 canon,可以用 npx canon 直接运行。

@erclx/canon 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/erclx__canon 是否存在。

@erclx/canon 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@erclx/canon 可以商用吗?

@erclx/canon 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@erclx/canon 的下载量有多少?

根据 npm 官方下载统计,@erclx/canon 在 2026/10/14 – 2026/11/12 这 30 天内被下载 13,383 次,日均约 446 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@erclx/canon 还在维护吗?

最新版本 5.88.0 发布于 2026/11/13(1 天前);至今共发布 250 个版本,其中过去 12 个月发布了 250 个;首次发布于 2026/08/31。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。