# Teach your agent bay

> Install the bay skill, so any coding agent knows how to land changes with bay.

Source: https://getbay.io/docs/skill (HTML).

The bay skill is one `SKILL.md` file that teaches a coding agent bay. It names the command for each step, and tells the agent to act on the result bay prints.

The skill holds instructions only. The bay binary installs on its own, with the install script. The skill grants no key and cannot move trunk.

## When to use the skill

- **Agents share a repository that lands with bay**: each agent learns the same loop and the same rules.
- **A new machine or a new agent**: one command gives it bay's workflow before its first change.
- **An agent without a skill system**: paste the skill, or the `AGENTS.md` lines on Agents and hooks, into its instructions.

## Install it with the skills CLI

The skills CLI installs a skill from its GitHub repository for many agent products. `-g` installs it for every project. Leave it out to install it in this project only.

```sh
npx skills add gudjon/bay --skill bay -g
```

## Install it with bay

`bay install` copies the skill that matches the installed bay version. It writes `~/.claude/skills/bay/`, or the same folder under `$CLAUDE_CONFIG_DIR` when that is set.

```sh
curl -fsSL https://getbay.io/install.sh | sh
```

## What the agent can do

- Open a change with `bay start`, and edit only inside its view.
- Submit with `bay land`, wait with `bay land --wait`, or give up with `bay land --abandon`.
- Read state with `bay status`, and every session with `bay status --fleet`.
- Read what changed with `bay watch`, and ask another agent with `bay talk`.
- Reverse a landed change with `bay undo`.
- Read stdout as one `bay.result/1` document. Unknown is not success.

## How the two copies fit

1. **Both write one folder** The skills CLI with `-g` for Claude Code and `bay install` use the same skill folder.

2. **Doctor compares** `bay doctor` compares that copy with the skill of the installed bay version.

3. **Install restores** A different copy is red with `SKILL_MISMATCH`. `bay install` writes the matching one back.

## What the skill tells an agent never to do

- Push trunk or move trunk by hand.
- Run `git reset --hard` or force-push.
- Grant a key or widen the policy.
- Run `bay install` to land work.

## Source

The skill lives in the bay repository at `skills/bay/SKILL.md`, the one copy for every agent and organisation. The copy for this release: https://github.com/gudjon/bay/blob/v0.1.3/skills/bay/SKILL.md.
