AGENT SKILL

mod-scaffolding

Create a new Bifrost plugin with pnpm new and lay out its files - src/plugin.tsx, logic, tests, skills, rules. Use when starting a plugin, adding a pane or command to one, or deciding where a file belongs.

License 许可
MIT
最近更新
2026-10-22
Stars
★ 0
Forks
0

01 前言 Front Matter

name
mod-scaffolding
description
Create a new Bifrost plugin with pnpm new and lay out its files - src/plugin.tsx, logic, tests, skills, rules. Use when starting a plugin, adding a pane or command to one, or deciding where a file belongs.

03 SKILL.md 正文

Scaffolding a plugin

pnpm new my-plugin "One line: what it does"

Copies templates/mod to plugins/my-plugin (placeholders __MOD_NAME__, __MOD_DESCRIPTION__), builds it and refreshes the marketplace. It refuses a name an installed plugin already uses. Linking stays a separate step (pnpm dev:link*).

Layout

plugins/my-plugin/
  src/plugin.tsx        definePlugin: metadata, config, panes, commands, claude events  (required)
  src/notes.ts          pure logic (no host, no state)                                  (example)
  test/notes.test.ts    logic tests          test/plugin.test.tsx   test-kit tests
  test/engine/notes.ts  engine test (copied to dist/tests by the build)
  test/tsconfig.json    adds Bun's types for tests
  skills/my-plugin/SKILL.md   agent skill (Antigravity) with a [Label](sidecar://my-plugin/) pill
  rules/AGENTS.md       optional agent rules (Antigravity)
  docs/                 optional screenshots (copied to dist with README.md)
  README.md  package.json  tsconfig.json  bunfig.toml
  dist/                 generated by bifrost build (gitignored)

Never add hooks/, .claude-plugin/, plugin.json or sidecars/ to the source: they are build output.

Growing it

  • A pane: add to panes ({ title, component, onOpen? }); the first pane is the default for host.pane.open() and the agy view at /.
  • A command: add to commands ({ description, argumentHint?, run(host, args) }).
  • A setting: add to config; read with host.config(key) (blank counts as unset).
  • State: atom('key', initial) next to the code that owns it (a store.ts with atoms and actions taking a Host works well; see plugins/ref-pane/src/store.ts).
  • Claude-only reactions: claude.turnComplete, claude.promptSubmit, claude.sessionStart, claude.configChange.
  • Only one harness: targets: ['claude'] or ['agy'].

04 同仓库更多 Skills