Sub topic 15
Sharing and versioning with your team
This chapter assumes you can write a prompt file, a custom agent, and a skill, and that you know basic Git (branches, pull requests, tags). It covers how to put those artifacts in a repository, how to keep them stable as a team uses them, and what goes wrong when you don't.
File locations and frontmatter fields differ between products. The paths below are examples. Check your tool's documentation for the exact names it reads.
Why treat instructions as code
A prompt file, an agent definition, and a SKILL.md are plain text files that change the behavior of a tool with write access to your project. A one-line edit can change which files an agent may modify or when a skill is chosen. That makes them worth the same handling as build scripts: version control, review, and a record of why each change was made.
Sharing through a repository gives you three things that copying files between laptops does not:
- Everyone runs the same instructions, so results are comparable.
- Each change has an author, a date, and a reason in the history.
- A bad change can be reverted.
Where to put things: project scope and user scope
Most tools read instruction files from two places.
| Scope | Typical location | Shared with the team? | Good for |
|---|---|---|---|
| Project | A hidden folder at the repository root, such as `.agents/` or a tool-specific folder | Yes, through Git | Team workflows, project conventions, skills tied to this codebase |
| User | A folder in your home directory | No | Personal shortcuts, experiments, drafts |
When the same name exists in both places, tools differ on which one wins. Some prefer the project copy, some the user copy. Test this in your tool before relying on it, and avoid giving a personal file the same name as a team file.
A common layout for a project that shares all three kinds of artifact looks like this:
my-project/
├── AGENTS.md
├── .agents/
│ ├── prompts/
│ │ └── review-staged.md
│ ├── agents/
│ │ └── code-reviewer.md
│ └── skills/
│ └── changelog-entry/
│ ├── SKILL.md
│ ├── reference/
│ │ └── format.md
│ └── scripts/
│ └── check_format.py
└── src/This layout is illustrative. Your tool may expect .github/prompts/, .claude/agents/, or another folder. Put the files where your tool looks, and keep one folder per skill so that its resources travel with it.
Review instruction changes like code
Reviewing a pull request that changes an instruction file takes a different eye than reviewing application code. Ask these questions:
- Scope of tools. Did the
toolslist or permissions grow? A reviewer agent that gained a write tool is a different agent. - Description changes. A skill description decides when the skill loads. A broader description can make the skill fire on unrelated tasks. A narrower one can make it never fire.
- Commands and scripts. Does any instruction tell the agent to run a command, download something, or call a network address? Read every script in the skill folder, not only the Markdown.
- Output format. Other tools or people may depend on the format. Changing a report layout can break a downstream step.
- Evidence. Does the pull request show the file working on at least one realistic task?
Use a CODEOWNERS file so the right people are asked to review. Many Git hosts support it.
# CODEOWNERS
/.agents/ @my-org/platform-team
/AGENTS.md @my-org/platform-team
/.agents/skills/release-*/ @my-org/release-managersBranch protection that requires an approved review for these paths turns the habit into a rule. This matters because an agent definition can grant tool access, and a quiet edit to it should not reach the main branch unseen.
Version your artifacts
Your repository history is already a version log. For small teams, commit messages and pull requests are enough. As more people depend on an artifact, add explicit versioning.
Keep a changelog in the skill
For a skill used across many projects, a short changelog next to SKILL.md helps users see what changed. Keep it in a separate file so it does not enter the context window each time the skill loads.
# Changelog
## 1.2.0
- Added: group entries under "Security" when a CVE is mentioned.
## 1.1.0
- Changed: entries now use the past tense.
## 1.0.0
- First release.Some tools accept a version field in frontmatter, and others ignore unknown fields or reject them. Test a small change before you rely on one. If your tool ignores it, the field still helps humans, but nothing enforces it.
Use semantic versioning where it fits
Semantic versioning uses three numbers, MAJOR.MINOR.PATCH. Adapted to instructions:
- Patch: a wording fix with no change in behavior.
- Minor: a new optional step or a new reference file.
- Major: a changed output format, a changed name, a changed argument, or added permissions. Anything that could break someone's workflow.
Renaming is the most common breaking change. If people type /review-staged and you rename the file, their habit breaks with no error message other than "command not found."
Tag releases of shared collections
If several repositories use the same collection of skills, give the collection its own repository and tag releases.
git tag -a v1.2.0 -m "changelog-entry: group security entries"
git push origin v1.2.0Consumers can then pin to a tag instead of following the main branch.
Sharing across repositories
Three approaches are common, each with trade-offs.
| Approach | How it works | Strength | Weakness |
|---|---|---|---|
| Copy the files | Copy the folder into each repository | Simple, no tooling, each repo can edit freely | Copies drift apart and fixes don't propagate |
| Git submodule or subtree | Mount a shared repository at a path | Pinned versions, clear update step | Extra Git steps that teammates often find confusing |
| Package or plugin | Install from a registry or marketplace if your tool supports one | Easy updates | Depends on the tool, and you trust the publisher |
For a team of fewer than ten people with one or two repositories, copying is usually fine. Move to a shared repository when you notice the same fix being made in several places.
A submodule example:
git submodule add https://example.com/my-org/agent-skills.git .agents/shared
git commit -m "Add shared agent skills at v1.2.0"To update, enter the submodule, check out the new tag, and commit the new pointer in the parent repository. The pointer commit is what reviewers see, so the update is a small, reviewable change.
Common failure modes
- Silent drift. Two teammates edit local copies, and results differ without anyone noticing. Fix: one source of truth in the repository, and no uncommitted local edits to shared files.
- Name collisions. A user-scope file shadows a project file, or two skills have the same
name. Fix: choose unique, descriptive names and test which one loads. - Ignored files. A broad
.gitignorerule such as.*/hides the instruction folder, so it is never committed. Rungit statusafter adding files and confirm they show up. - Machine-specific content. Absolute paths, personal tokens, or local tool names in an instruction file break for everyone else. Use paths relative to the repository root.
- Executable bit lost. A script in a skill may lose its executable permission when copied. Either set it in Git with
git update-index --chmod=+x scripts/check_format.pyor have the SKILL.md call the interpreter explicitly, as inpython scripts/check_format.py. - Stale references. A skill points to
reference/format.md, and someone moves the file. Add a check to continuous integration that every path mentioned in SKILL.md exists.
A small check for the last item:
import re
import sys
from pathlib import Path
failed = False
for skill_md in Path(".agents/skills").glob("*/SKILL.md"):
text = skill_md.read_text(encoding="utf-8")
for ref in re.findall(r"\b(?:reference|scripts)/[\w./-]+", text):
if not (skill_md.parent / ref).exists():
print(f"{skill_md}: missing {ref}")
failed = True
sys.exit(1 if failed else 0)Run it in your pipeline so a broken link fails the build instead of confusing an agent later.
A short team workflow
- Draft the change on a branch.
- Run it against two or three realistic tasks and note the results in the pull request.
- Request review from the code owners.
- Merge, then tag a release if the artifact is shared across repositories.
- Tell the team what changed, especially if it is a major version.
- Revisit it after a few weeks. If nobody uses an artifact, remove it. Unused instructions still cost review time, and some of them still cost context.
Exercise
A teammate renames the skill folder changelog-entry to release-notes and adds a Bash tool to your code-reviewer agent in the same pull request. Which semantic version bump applies to each change, and what should the reviewer ask for?
Show answer
Both are major changes. The rename can break anyone who invokes or refers to the old name, and the added tool widens what the agent can do. The reviewer should ask for the two changes to be split into separate pull requests, a stated reason for the Bash access (ideally with a narrower alternative), evidence from a test run, and a note in the changelog that the name changed.
Exercise
Your team's new skill folder is in .agents/skills/, but teammates report that the skill does not exist after pulling. Give two likely causes and how you would check each.
Show answer
First, a .gitignore rule may exclude the folder, so it was never committed. Check with git check-ignore -v .agents/skills/changelog-entry/SKILL.md and git ls-files .agents. Second, the tool may read a different folder than the one you used. Check your tool's documentation for the exact skill path, or move one file and see whether it appears in the tool's skill list.