GitHub - grafana/hatch: Write agent rules and commands once and generate for all. · GitHub
/" data-turbo-transient="true" />
Skip to content
Search or jump to...
Search code, repositories, users, issues, pull requests...
-->
Search
Clear
Search syntax tips
Provide feedback
--><br>We read every piece of feedback, and take your input very seriously.
Include my email address so I can be contacted
Cancel
Submit feedback
Saved searches
Use saved searches to filter your results more quickly
-->
Name
Query
To see all available qualifiers, see our documentation.
Cancel
Create saved search
Sign in
/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up
Appearance settings
Resetting focus
You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
{{ message }}
grafana
hatch
Public
Notifications<br>You must be signed in to change notification settings
Fork
Star
main
BranchesTags
Go to file
CodeOpen more actions menu
Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit
History<br>46 Commits<br>46 Commits
cmd/hatch
cmd/hatch
docs
docs
pkg
pkg
.gitignore
.gitignore
LICENSE
LICENSE
README.md
README.md
go.mod
go.mod
go.sum
go.sum
mise.toml
mise.toml
View all files
Repository files navigation
🥚 hatch
Write rules, skills, commands, and sub-agent definitions once , generate<br>the native files each coding agent expects.
Hatch reads a single source tree under .hatch/ and produces the specific<br>files Claude Code, OpenAI Codex CLI, GitHub Copilot, Cursor, OpenCode, and<br>Zed each read to customise their behaviour.
Install
go install github.com/grafana/hatch/cmd/hatch@latest
Or with mise inside the repo:
mise run install
Quick start
$ cd my-project<br>$ hatch init -examples<br>$ hatch gen<br>wrote CLAUDE.md:1-3<br>wrote .claude/skills/review-pr/SKILL.md<br>wrote AGENTS.md:1-3<br>...
Edit files under .hatch/_rules/, .hatch/_skills/, .hatch/_commands/,<br>or .hatch/_agents/, then re-run hatch gen. Commit the .hatch/ source<br>and the generated files together.
Migrating
To migrate to hatch, ask your coding agent to read our docs.
Feature support
✓ means the agent has a native primitive; ⚠ means hatch emulates it.<br>See docs/features.md for how each emulation works,<br>its output paths, and trade-offs.
Feature<br>Claude Code<br>Codex<br>Copilot<br>Cursor<br>OpenCode<br>Zed
Rules (always-on)
Rules (scoped applyTo)
Skills
Slash commands
Sub-agents
Nested scopes (monorepo)
CLI
Command<br>What it does
hatch init [-examples] [-path p]<br>scaffold .hatch/ (optionally with example files or nested)
hatch new [-path p] [title]<br>create a new rule, skill, command, or agent from a template
hatch gen [-targets names]<br>write every target's native files
hatch list [-targets names]<br>dry-run; print what gen would write
hatch check [-targets names]<br>verify generated files are up to date (for CI)
hatch clean [-targets names]<br>remove everything hatch generated
hatch version, hatch help<br>print version / usage
See docs/cli.md for the full flag reference, including<br>-no-hatch-skill and the auto-injected meta skill.
Docs
CLI reference — every subcommand and flag
Source layout, nesting, and frontmatter — how .hatch/ is organised and what frontmatter fields do
Feature support — what each target natively supports and how hatch emulates the gaps
Targets and output mapping — per-agent file locations and nested-scope routing
Development — build and test the hatch binary itself
About
Write agent rules and commands once and generate for all.
grafana.github.io/hatch/
Resources
Readme
License
Apache-2.0 license
Code of conduct
Code of conduct
Security policy
Security policy
Uh oh!
There was an error while loading. Please reload this page.
Activity
Custom properties
Stars
stars
Watchers
watching
Forks
forks
Report repository
Releases
v1.2.0
Latest
May 11, 2026
+ 6 releases
Packages
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Contributors
Uh oh!
There was an error while loading. Please reload this page.
Languages
Go<br>100.0%
You can’t perform that action at this time.