Cross-tool generation¶
Samuel writes one canonical file (AGENTS.md). Translator plugins generate the tool-specific files your editor needs. Two translators ship in the v2.0 registry; more land as the ecosystem grows.
How it works¶
Both translators hook sync.after. When you run samuel sync (manually or as part of samuel run), the framework:
- Walks the project tree, writing per-folder
AGENTS.mdfiles. - Fires
sync.afteronce with the list of files written. - Each translator handler reads that list and emits its tool-specific shape.
Translators run in declared order (the order their plugins were installed) unless overridden by samuel.toml.
samuel-claude-translator¶
Repo: samuelpkg/samuel-claude-translator. WASM tier.
| Hook | Output |
|---|---|
init.after | .claude/settings.json (with PreToolUse stubs) |
sync.after | CLAUDE.md per folder that has an AGENTS.md |
Capabilities: filesystem.write:/workspace/**/CLAUDE.md, filesystem.write:/workspace/.claude/**. Scoped narrowly so the user-side install prompt is unambiguous.
Install:
samuel-codex-translator¶
Repo: samuelpkg/samuel-codex-translator. WASM tier.
| Hook | Output |
|---|---|
sync.after | .codex/<rel>/context.md per folder that has an AGENTS.md |
Capabilities: filesystem.write:/workspace/.codex/**.
Install:
Hook timing¶
The translators fire after the framework has finished writing AGENTS.md. Their input is the canonical content; their output is a transform. They never read samuel.toml directly — the framework hands them everything they need in the sync.after payload.
This decoupling means:
- Translator plugins are stateless. Re-running them with the same input produces the same output (idempotent).
- Adding a new translator doesn't change framework behaviour.
- Removing a translator removes its files on
samuel uninstall(mutation log replay).
How to add a new translator¶
- Build a WASM plugin (see TinyGo + WASM).
- Declare:
- In the
renderfunction, walkin.FilesWritten, transform eachAGENTS.md, and callsamuel.fs_writefor each target. - Release via the
samuelpkg/samuel-plugin-releaseworkflow. - Open a PR against
samuelpkg/samuel-registry'sindex.toml.
The framework will pick it up. Users who install your translator get cross-tool output for the new tool, with no framework changes.