# Agent config files

Canonical HTML: https://getdispatcher.dev/help/agent-files

Treat your agent instructions like product code: keep them in-repo, review them in PRs, and test variants in isolated worktrees.

## Recommended file layout

- `AGENTS.md`: top-level operating instructions for agents in this repository.
- `.cursor/agents/`: reusable agent personas and task-specific templates.
- `.cursor/skills/`: repeatable SOPs (`SKILL.md`) for common workflows.

Add files incrementally. Start with one clear `AGENTS.md`, then break repeated patterns into `.cursor/agents` or `.cursor/skills`.

## Safe experimentation in a new worktree

Create a disposable sandbox so prompt experiments never interrupt your main branch:

```bash
REPO="/path/to/repo"
STAMP="$(date +%Y%m%d-%H%M%S)"
BRANCH="dispatcher/agents-playground-$STAMP"
DEST="$REPO/.dispatcher/playgrounds/$BRANCH"
git -C "$REPO" worktree add -b "$BRANCH" "$DEST"
```

Then open `"$DEST"` in your editor, try prompt/layout changes, and open a PR when useful.

## Curating better templates

- Review community examples at https://cursor.directory
- Keep only patterns your team can explain and maintain
- Prefer small, composable instruction files over one giant prompt
- Version control all changes so regressions can be reverted quickly

## In-app entry points

- **Settings → Repositories**: quick links and a copyable sandbox-worktree command
- **Help → Agent config files**: this guide
