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 forhost.pane.open()and the agy view at/. - A command: add to
commands({ description, argumentHint?, run(host, args) }). - A setting: add to
config; read withhost.config(key)(blank counts as unset). - State:
atom('key', initial)next to the code that owns it (astore.tswith atoms and actions taking aHostworks well; seeplugins/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
__MOD_NAME__
__MOD_DESCRIPTION__
cross-mod
Hub for building plugins that run in both Claude Code and Google Antigravity (agy) with the Bifrost framework. Use when starting any plugin work in this repository to find the right specialized skill and the end-to-end workflow.
ref-pane
Inspect and navigate project artifact references (such as RV-1, FB-2, T-3, ADR-4) in the Auxiliary Pane.
bifrost-dev
Use when changing @gidragir/bifrost itself (packages/bifrost) - adding or renaming an export, Host member, primitive or component, changing codegen or the adapters, bumping its version or releasing it - and not when building a plugin under plugins/<mod>.
bifrost-claude-adapter
Use when changing packages/bifrost/src/claude or src/cli codegen, or when a generated hooks module fails claude plugin validate/test for a reason the framework (not the plugin) causes - scanner errors, missing state contract keys, guard hooks, next(e) chaining.
bifrost-agy-adapter
Use when changing packages/bifrost/src/agy - the generated Antigravity aux-pane server, page runtime client.js, effects, token and preload contract, HTML renderer or bifrost.css - or when an agy pane misbehaves for every plugin rather than one.