Skip to content

Commit 1687674

Browse files
author
arch
authored
docs: add skills.md (#392)
* docs: shorten AGENTS.md wording * docs: add skills.md
1 parent 9c98c58 commit 1687674

3 files changed

Lines changed: 46 additions & 1 deletion

File tree

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ This is a **PaperMC/Spigot Minecraft plugin template**. The intent is that users
2020
- `main.yml` — builds, tests, and cuts a snapshot release on push to `main`
2121
- `tag.yml` / `release.yml` — handle tagged releases and Discord notifications
2222

23-
**Agent files (skills + `CLAUDE.md`)**: Two Claude-Code-facing outputs are generated from tracked sources and gitignored. (1) Canonical skills live in `.agents/skills/` (shared with other agents); `.claude/skills/` is a **generated mirror** — Claude Code only discovers skills there. **Edit skills only in `.agents/skills/`; never edit the mirror.** (2) `CLAUDE.md` is a **generated copy of this `AGENTS.md`**`AGENTS.md` is the single source of truth for project instructions; **edit `AGENTS.md`, never `CLAUDE.md`.** `.claude/hooks/sync-agent-files.sh` regenerates both; `.claude/settings.json` runs it on `SessionStart` (with `reloadSkills` so new skills load in-session) and on `PostToolUse` after edits under `.agents/skills/**` or to `AGENTS.md`. Run `sh .claude/hooks/sync-agent-files.sh` to regenerate manually.
23+
**Agent instructions**: (1) Canonical skills live in `.agents/skills/`; `.claude/skills/` is a generated mirror. (2) `CLAUDE.md` is a generated copy of this `AGENTS.md`. (3) No agents are permitted to edit or create `CLAUDE.md` or `.claude/skills/`; Claude hooks established in `.claude/settings.json` automatically sync these mirrors on `SessionStart` and `PostToolUse`.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ In order to use this template for yourself, there are a few things that you will
4949
- [Extending the example code](docs/usage.md) — add commands, subcommands, config fields, or persistent per-player data
5050
- [Customizing this template](docs/customization.md) — the one-time checklist for forking this repo (placeholders, secrets, etc.)
5151
- [Releases & versioning](docs/releases.md) — PaperMC compatibility, version format, and how to cut a release
52+
- [Agent instructions & skills](docs/skills.md) — agent guidance, Claude Code support, and available skills
5253

5354
## Building locally
5455
Thanks to [Gradle](https://gradle.org/), building locally is easy no matter what platform you're on. Simply run the following command:

docs/skills.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Agent instructions and skills
2+
3+
This repository keeps agent instructions in the AGENTS standard.
4+
Contributors should only edit these standard files.
5+
6+
## Sources of truth
7+
8+
- `AGENTS.md` contains repository-wide context and constraints, including the
9+
plugin architecture, packaging, dependencies, command registration, versioning, and CI setup.
10+
Agents will read this file automatically at the beginning of a session.
11+
- `.agents/skills/` contains reusable, task-specific instructions. Each
12+
skill lives in its own directory and is defined by a `SKILL.md` file.
13+
Agents get a list of available skills and can decide when to read their full contents.
14+
15+
#### Claude Code sync
16+
17+
`.claude/hooks/sync-agent-files.sh` copies the following:
18+
19+
| Canonical, tracked source | Generated, ignored Claude Code file |
20+
| --- | --- |
21+
| `AGENTS.md` | `CLAUDE.md` |
22+
| `.agents/skills/<skill>/` | `.claude/skills/<skill>/` |
23+
24+
Hooks in `.claude/settings.json` run synchronization automatically:
25+
26+
- `SessionStart` on new, resumed, and cleared sessions.
27+
- `PostToolUse` when Claude Code writes or edits AGENTS sources.
28+
29+
Do not edit or create `CLAUDE.md` or files under `.claude/skills/`.
30+
They are automatically generated/replaced by scripts, and never tracked.
31+
32+
## Adding a skill
33+
34+
1. Create `.agents/skills/<skill-name>/SKILL.md`.
35+
2. Write the following:
36+
37+
```
38+
---
39+
name: skill-name
40+
description: Give it a short description.
41+
---
42+
```
43+
44+
`name` is the same as the directory.

0 commit comments

Comments
 (0)