agent-baseline
v0.1.0
Published
Generates shared agent instructions and skills for a repository.
Readme
agent-baseline
Generates the agent instructions and skills our repositories share, so an improvement made once reaches every repository that updates the package.
Use
Add it as a dev dependency, then generate and commit the result:
bun add -d agent-baseline
bunx agent-baseline generategenerate writes three things:
- A block in
AGENTS.mdbetween<!-- agent-baseline:start -->and<!-- agent-baseline:end -->. Everything outside the block belongs to the repository. A file without a block gets one at the end. - An
@AGENTS.mdimport at the top ofCLAUDE.md. Claude Code skipsAGENTS.mdwhen a repository has aCLAUDE.md, so the import is what makes it load. - The chosen skills in
.agents/skills/, where Codex reads them, with links from.claude/skills/for Claude Code. Every skill name agent-baseline ships belongs to it, so give a repository's own skills other names..agents,.claude, and theirskillsfolders must be real directories, not links.
Add bunx agent-baseline generate --check to the repository's check script. It exits with 1 and lists the files that differ when someone edits generated content by hand or updates agent-baseline without generating. Add .agents/skills/ to the formatter's ignore list at the same time; otherwise the formatter rewrites the copied skills and the two checks never pass together.
Claude Code prefers a personal skill over a project skill with the same name, and Codex lists both. On a machine that installs skills globally, remove the global copies of the skills its repositories install, such as with bunx skills remove -g <name>, so the repository's pinned copies take effect.
Config
A repository that uses the defaults needs no config. Otherwise, add agent-baseline.config.ts at the root with only what differs:
import { defaults, defineConfig } from "agent-baseline";
export default defineConfig({
skills: [...defaults.skills, "shadcn"],
});sectionsandskillsreplace the defaults; spreaddefaultsto add to them.commandsnames the package scripts the instructions tell agents to run, merged over the defaults.nullremoves one, and the instructions that need it are left out.generatefails when a chosen section names a script thatpackage.jsondoesn't define.
The defaults are in src/config.ts and the section text in src/sections.ts.
Skills
skills/ holds the skills agent-baseline ships, and src/skill-names.ts lists them.
Requires Bun, which runs the CLI and loads the TypeScript config.
