skillmirror
Concepts

بِسْمِ ٱللَّهِ ٱلرَّحْمَـٰنِ ٱلرَّحِيمِ

How a sync works

What sync reads, how it decides what to write, why a project copy ends up equal to the vault copy, and what is copied.

sync makes the copy of a skill in each project equal to the copy in the vault. It never installs a skill a project does not have, and it shows every change before it writes one.

The flow

  1. Read the vault. Every folder with a SKILL.md is a skill, and the folders above it are its group.
  2. Ask git for the tracked files of each skill.
  3. Walk the root, skipping noise folders and your exclusions, and never following links.
  4. For every .agents/skills/<name>/ found: if <name> is in the vault, plan it. If it is not, leave it alone.
  5. Show the plan. --dry-run stops here. Otherwise ask, then write target by target.

A mirror, not an overlay

A project copy ends up equal to the vault copy. A file the vault added is created, a file it changed is replaced, and a file an older version had and the vault no longer has is removed. No stale file of an older version survives.

skillmirror status --project ~/projects/infra
● ~/projects/infra
  ~ coding                         outdated (1 file added, 1 file removed)
skillmirror diff coding --project ~/projects/infra
● ~/projects/infra  coding
--- a/notes.md
+++ /dev/null
@@ -1 +0,0 @@
-old note
--- /dev/null
+++ b/references/naming.md
@@ -0,0 +1,2 @@
+# Naming
+- verbs for functions

The plan names the files that would be removed, and diff shows every line. A mode change (an executable bit) counts as a difference too.

A sync replaces edits made in a project

If you changed a skill inside a project, the project copy differs from the vault, and a sync replaces it. skillmirror changes shows which skills of a project were edited there, and skillmirror promote puts them into the vault first. See Improve a skill where you use it. If it already happened, skillmirror undo brings the edit back.

What is copied

The files git tracks in the skill folder are copied, with their permission bits.

  • Staged and committed files are copied. Commit when a skill is ready, so the vault keeps its history, but a staged file already travels.
  • An uncommitted edit of a tracked file is copied too, because the working tree version of a tracked file is what is read. doctor notes it so it does not surprise you.
  • Untracked files are never copied. A half finished draft next to a skill does not leak into your projects. info lists them apart.
  • A tracked symlink or submodule, a tracked file missing from the disk, or a skill whose SKILL.md is not tracked makes that skill fail with a hint instead of copying something wrong.
skillmirror info coding
coding  mandatory
  group        top level of the vault
  description  Coding conventions
  profiles     websites
  files        2 copied
    SKILL.md
    references/naming.md
  not copied   1 file (git does not track it)
    draft.md

Installed in 4 of 4 projects
  ~ ~/projects/atlas-api outdated (1 file added)
  ~ ~/projects/docs-site outdated (1 file added)
  ✓ ~/projects/infra up to date
  ~ ~/projects/lumen-app outdated (1 file added)

Narrowing a sync

sync, push and status take the same scope words. They combine.

ScopeMeaning
SKILL...only these skills
--group PATHonly the skills below this vault folder, such as web or web/seo
--profile NAMEonly the skills of this profile
--project DIRonly this project

An unknown skill, group or profile is an error with a hint, never a quiet "nothing to do". A scope still never adds a skill a project does not have.

When a target fails

One failed target never stops the others and never leaves a half written folder. The command finishes the rest, names each failure with a hint, and exits with 4. Two causes are worth knowing:

  • The project folder changed between the plan and the write. That skill fails instead of being overwritten.
  • The old copy cannot be stored in the backup. That skill fails and the old copy stays where it is.

Where each command writes

CommandWritesNever
syncthe skill folders a project already hasadds a skill
add, init, pushnew skill folders, and updates of the ones presenttouches a skill you did not name or that is not mandatory
deleteremoves one skill folder from projectstouches the vault
new, adopt, promotethe vault, then git addcommits
agents sync, agents addonly the autogenerated block of AGENTS.mdchanges the rest of the file
bridgea .claude/skills link where nothing isreplaces a real folder

Next: Safety and undo.

On this page