Willie 2d5849a0ef fix(config): keep YAML anchors and aliases when a command writes the config (#551)
* fix(config): keep YAML anchors and aliases when a command writes the config

Every writer re-encodes the in-memory struct, which has no anchors, so a
command such as `target a --add-exclude` expanded `&shared` / `*shared`
under targets and projects and the lists stopped following each other.
The comment pass added for #525 already pairs each old node with the one
that replaced it; relinkAliases uses the same pairs to put anchors back and
turn unedited alias values into aliases again.

An anchored node keeps its anchor and the aliases that still hold its old
value follow its new value, as the file declares. An alias that was edited
keeps its own list and leaves the anchored one alone. Output is sorted by
name, so the anchor moves to the first place the group appears: an alias
may not precede its anchor.

Fixes #546

* fix(config): keep YAML merge keys when a command writes the config

A command rewrites config.yaml from the Go struct, which holds the merged
keys of `<<: *base` and not the merge itself, so every merge key was written
out expanded and later edits of the anchored mapping no longer reached the
mappings that merged it. relinkAliases already restored anchors and aliases
from the old/new node pairing; relinkMerge now does the same for merge keys,
including `<<: [*a, *b]`, merges in nested mappings and in project-config
target items.

A key stays written out when the old mapping set it itself, or when its value
is no longer the one its merge source gives it. yaml.v3 merges are shallow, so
such a key replaces the merged value as a whole and what is written always
decodes to the config the command meant to save. A source that was removed, or
that holds a key the mapping no longer has, is not merged back.

Output order is not the old file's order, so an anchor that would follow its
first merge key moves onto it (`<<: &base`). The next write pairs that mapping
with the alias that still shows its value, so the file stays stable.

The runbook steps for anchors now write their own config: mdproof re-runs the
setup before each step, so step 7 and 8 never saw the config of step 6
(Codex review on #551). Steps for merge keys are added the same way.

* fix(config): let edits of an anchored mapping that add or remove a key reach its mergers

A command that added a key to an anchored mapping (the first `agents:`
block via `target base --agent-mode copy`) made relinkMerge refuse the
merge source: the merging mapping's pre-edit data lacked the key, which
was read as "the command removed it". The merge key was dropped and the
merger written out expanded, so later edits of the anchor no longer
reached it.

A source is now refused only when the merging mapping had a key before
the write and the command removed it. A key the source gained does not
count.

The symmetric case is fixed with it: a key removed from the anchored
mapping stayed written out under a merger that still held the old merged
value. An unedited key that the merger did not set itself now follows
the source that gave it, whatever that source now says (a changed value,
a removed key, or the next source of `<<: [*a, *b]`). A key the merger
set itself, or that the command edited, stays written out.

Tests cover add, remove and change of a key on the anchored mapping and
on the merging mapping, a key from either source of a merge list, nested
merges, projects, project-config target items and chained merges. Runbook
step 11 covers the real binary.

* fix(config): keep every comment when a write relinks merge keys and aliases

Rewriting a merge key replaced the original merge items and covered keys with
new nodes and carried over only the comments of the key and the list itself, so
a comment on an item of `<<:` followed by `- *a # note` was lost on any write,
and so was the trailing comment of a removed key when the mapping was left with
keys the merge supplies.

Comments now follow the entry they were on: a merge item's to the alias that
replaces it, those of an item that is no longer merged to the next item, and
those of a key the merge supplies to the next key still written, or in front of
the merge key when none is. The merge list keeps its flow or block style so item
comments stay on their lines.

Sweeping the rest of the relink paths for the same loss found more places where
yaml.v3 drops or moves a comment: the comment after an anchor on a block mapping
collided with its first key's comment, a line comment on a block collection or
on a key with an empty value is not written, and an anchored collection's head
comment moved on the next write. These are settled once on the written tree, and
the body of an inline merge source gets its comments paired too.
2026-10-13 11:14:06 +08:00
2026-10-02 03:46:48 +08:00
2026-09-25 02:32:37 +08:00
2026-01-14 18:09:36 +08:00
2026-09-25 02:32:37 +08:00

skillshare

skillshare

English · Deutsch · Español · Français · 日本語 · 한국어 · Português · 简体中文 · 繁體中文

Website License: MIT Release Downloads Platform Ask DeepWiki Support skillshare on Ko-fi

Star on GitHub

runkids%2Fskillshare | Trendshift

Your AI coding setup, everywhere.
Manage skills, agents, rules, MCP connections and hooks in one place.
For Claude Code, Codex, Pi, OpenCode and more.

Website • Install • Quick Start • Highlights • Screenshots • Desktop App • Docs

skillshare demo

Note

Latest: v0.25.6 — The Plugins page updates many plugins in one pass: each plugin is checked and applied once, plugins from the same source share one download, and the dialog shows old → new versions per Agent. Shared memory is easier to reach: the dashboard lists recently updated notes, and Memory tools gives you prompts to try memory across sessions or to review a conversation for lessons worth keeping; Skillshare never runs an agent itself. Turning off a global MCP server in one project now works in OpenCode 2, and plugins sync to OpenCode 2. All releases →

Why skillshare

Switching AI tools should not mean rebuilding your setup. skillshare gives your skills and other AI resources a home you control.

  • Switch tools, keep your skills — edit once, then sync to Claude Code, Codex, Pi and the other tools you use.
  • Take your setup with you — version your source in Git and pull it onto another machine.
  • Share with your team — keep project resources with your code and distribute shared skills through tracked repositories.

One teammate uses Claude Code, another uses Codex. Keep their shared code-review checklist in .skillshare/ alongside the project. New teammates install the declared skills and sync to the configured tools instead of copying instructions from chat. Team onboarding →

Use the desktop app or CLI to manage everything locally, audit skills before use, and choose what each tool receives.

Coming from another tool? Migration Guide · Comparison

CLI and UI Preview

Skill Detail Security Audit
CLI sync output CLI install with security audit
UI Dashboard UI Skills
Web dashboard overview Web UI skills page

Installation

Tip

Use skillshare from your desktop. Get Skillshare App for macOS (Apple Silicon), Windows and Linux. First launch helps you install or locate the CLI, choose your AI tools and run your first sync. Installation guide.

Desktop App — visual setup and daily management

Skillshare App puts skills, agents, MCP and hooks in a desktop window. Install the app, open it, and follow first-launch setup.

macOS (Apple Silicon), with Homebrew:

brew tap runkids/tap
brew install --cask skillshare-app

Windows / Linux, or a manual macOS install: Download the latest app installers. See the Desktop App guide for platform details.

CLI: macOS / Linux

curl -fsSL https://raw.githubusercontent.com/runkids/skillshare/main/install.sh | sh

The script installs to ~/.local/bin by default, so normal installs and updates do not need sudo. If the installer prints PATH setup instructions, follow them before running skillshare. Add the suggested line to your shell config (such as ~/.zshrc or ~/.bashrc) for future terminals. Set INSTALL_DIR to use another location.

Windows PowerShell

irm https://raw.githubusercontent.com/runkids/skillshare/main/install.ps1 | iex

CLI: Homebrew

brew install skillshare

Tip: Run skillshare upgrade to update to the latest version. It auto-detects your install method and handles the rest.

GitHub Actions

- uses: runkids/setup-skillshare@v1
  with:
    source: ./skills
- run: skillshare sync

See setup-skillshare for all options (audit, project mode, version pinning).

Shorthand (Optional)

Add an alias to your shell config (~/.zshrc or ~/.bashrc):

alias ss='skillshare'

Quick Start

skillshare init            # Create config, source, and detected targets
skillshare sync            # Sync skills to all targets

How It Works

  • macOS / Linux: ~/.config/skillshare/
  • Windows: %AppData%\skillshare\
┌─────────────────────────────────────────────────────────────┐
│                    Source Directory                         │
│   ~/.config/skillshare/skills/    ← skills (SKILL.md)       │
│   ~/.config/skillshare/agents/    ← agents                  │
│   ~/.config/skillshare/extras/    ← rules, commands, etc.   │
└─────────────────────────────────────────────────────────────┘
                              │ sync
              ┌───────────────┼───────────────┐
              ▼               ▼               ▼
       ┌───────────┐   ┌───────────┐   ┌───────────┐
       │  Claude   │   │  OpenCode │   │ OpenClaw  │   ...
       └───────────┘   └───────────┘   └───────────┘
Platform Skills Source Agents Source Extras Source Link Type
macOS/Linux ~/.config/skillshare/skills/ ~/.config/skillshare/agents/ ~/.config/skillshare/extras/ Symlinks
Windows %AppData%\skillshare\skills\ %AppData%\skillshare\agents\ %AppData%\skillshare\extras\ NTFS Junctions for folders (no admin required); file symlinks need Developer Mode, otherwise copied
Imperative (install-per-command) Declarative (skillshare)
Source of truth Skills copied independently Single source → symlinks (or copies)
New machine setup Re-run every install manually git clone config + sync
Security audit None Built-in audit + auto-scan on install/update
Web dashboard None skillshare ui
Runtime dependency Node.js + npm None (single Go binary)

Full comparison →

Highlights

Install & update skills —from GitHub, GitLab, or any Git host

skillshare install github.com/reponame/skills
skillshare update --all
skillshare target claude --mode copy  # if symlinks don't work

Symlink issues? — switch to copy mode per target

skillshare target <name> --mode copy
skillshare sync

Security audit —scan before skills reach your agent

skillshare audit

Project skills —per-repo, committed with your code

skillshare init -p && skillshare sync

Agents —sync custom agents to agent-capable targets

skillshare sync agents            # sync agents only
skillshare sync --all             # sync skills + agents + extras + MCP + hooks together

Extras —manage rules, commands, prompts & more

skillshare extras init rules          # create a "rules" extra
skillshare sync --all                 # sync skills + agents + extras + MCP + hooks together
skillshare extras collect rules       # collect local files back to source

MCP connections —configure once for Claude Code, Codex, Pi, VS Code, OpenCode and more

skillshare mcp add                    # guided URL or JSON setup
skillshare sync mcp --dry-run         # preview native configuration changes
skillshare sync mcp                   # apply connection settings

Keep definitions in config.yaml or reference a separate mcp.yaml. See MCP setup for examples, environment references and importing existing connections.

Manage native hooks without executing them:

skillshare hooks add check --file ./check.yaml
skillshare hooks sync --dry-run
skillshare hooks sync

Plugins —install a complete plugin and pick which tools receive it

skillshare plugin add                 # guided: source, plugin, targets, review
skillshare plugin add owner/repo --target claude --target codex --no-tui
skillshare sync plugins --dry-run     # plugins sync separately from sync --all

Existing native installations can be adopted with plugin import. See Manage plugins across tools.

Shell completion —tab-complete commands, flags, and subcommands

skillshare completion bash --install   # also: zsh, fish, powershell, nushell

Local checkpoints — commit source changes without pushing

skillshare commit -m "Update review skill"
skillshare commit --dry-run

Web dashboard — visual control panel

skillshare ui

All commands & guides →

Contributing

Contributions welcome! Open an issue first, then submit a draft PR with tests. See CONTRIBUTING.md for setup details.

git clone https://github.com/runkids/skillshare.git && cd skillshare
make check  # format + lint + test

Tip

Not sure where to start? Browse open issues or try the Playground for a zero-setup dev environment.

Contributors

Thanks to everyone who helped shape skillshare.

leeeezx Vergil333 romanr xocasdashdash philippe-granet terranc benrfairless nerveband EarthChen gdm257 skovtunenko TyceHerrman 1am2syman thealokkr JasonLandbridge masonc15 richardwhatever reneleonhardt ndeybach hhh2210 leoarry salmonumbrella daylamtayari dstotijn ipruning massukio kevincobain2000 StephenPAdams mk-imagine Curtion amdoi7 jessica-engel AlimuratYusup thor-shuang bishopmatthew chaosky iFwu ildunari aestilog xarthurx m0cun bit3125 eekryuos Bongseop-Kim sophodex PeterTianbuhan dotned ismferd jblackburn21 jnhu76 jacobleft rhysmcneill druellan 12britz askpatrickw Almost42 Brett-Best isCopyman svob michal-grzelak shikbupt LeoYeAI TIR44 Ajaymamtora vishaldialpad kankan0829 dnabb thinhngotony skaurus jamesbraza 2BAB zdlldz elstiaan FaintFlower yantinglin21 chung1912 r-fynn cescox hhdebb Snurppa s0undt3ch danscheer 7zq12lvm-b DarkiT harisonw wuhaoyujerry star-nebula AdamMagued mbury 483218131 neilforest7 johnkattenhorn


Support skillshare ❤️

skillshare is free and open source.

If skillshare saves you time, consider buying me a coffee. Every contribution helps with ongoing development, cross-platform testing, documentation, and maintenance.

☕ Buy me a coffee

You can also help by giving skillshare a ⭐ on GitHub!

Star History

Star History Chart


License

MIT

Languages
Go 73.7%
TypeScript 20.2%
JavaScript 3%
Shell 1.4%
CSS 0.9%
Other 0.7%