Repository navigation
feat(init): install skills into .meta/skills and link them into agent folders - #38
Merged
Merged
Conversation
… folders meta init claude now writes each skill to .meta/skills/<name>/SKILL.md and links it into .claude/skills/ and .agents/skills/ (Codex and other agents), as atc and git-kb do with .atc/skills/ and .kb/skills/. Other agent folders from atc's registry (.cursor, .opencode, .pi, .omp, .grok) get links when the agent's folder exists. --update turns both older layouts into links: flat .claude/skills/*.md files and real .claude/skills/<name>/ folders holding only SKILL.md. Anything else at a link path (another tool's link, a folder with more files, a file) is reported and left alone; no symlink is followed or removed. Where a symlink can't be made (Windows without Developer Mode), the skill folder is copied with a .meta-skill-copy marker, and a later --update replaces it with a link. A repo whose config is the legacy .meta file can't have the .meta/ folder: init refuses before writing anything and suggests git mv .meta .meta.json. The meta-repo check now uses find_meta_config_in, so a .meta/ folder is not taken for config. install_skills takes the tool name, skill bundle and agent folder list as inputs so it can move into a shared crate later. Implements [[tasks/harmony-2714]]
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
…claude Review fixes: - A symlink anywhere in .meta/skills/<name>/SKILL.md stops the install, and an agent skills folder reached through a symlink is skipped, so no other tool's files are written or removed through a link. - A real folder holding only SKILL.md counts as meta's only in .claude/skills/, where older releases wrote it. - A plain file holding exactly meta's link target (git's checkout of a link with core.symlinks=false) is replaced, so --update repairs such Windows clones. - The copy fallback copies .meta/skills/<name>/SKILL.md, not the embedded text, so a kept or newer committed skill is what agents see. Implements [[tasks/harmony-2714]]
- A real .claude/skills/<name>/ folder holding only SKILL.md is meta's only when that SKILL.md is the shipped text (no release shipped the #36 layout, and its text is today's), so another tool's same-named skill is kept even with --force. - Rule files are not written through a symlinked .claude/, .claude/rules/ or rule file; they are reported as skipped. Implements [[tasks/harmony-2714]]
Implements [[tasks/harmony-2714]]
--update and --force removed any regular .claude/skills/meta-<name>.md. Now only files whose first line is the heading of a skill meta shipped (every release's flat files start with one of seven known headings) are removed; anything else is reported and kept. Also create .claude/rules/ after the skills step, so a refused install leaves no half-made .claude/. Implements [[tasks/harmony-2714]]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
meta init claudenow installs its skills the way atc and git-kb do: real folders in a folder meta owns, linked into each agent's skills folder, so Codex and other agents get them too, not only Claude.Layout
Before (#36):
After:
.cursor/skills,.opencode/skills,.pi/skills,.omp/skillsand.grok/skillsalso get links, but only when that agent's folder (.cursor/etc.) already exists. The folder names are atc's agent registry (atc/crates/atc-cli/src/init/agents.rs); this is atc's--all-agentsrule. Rules and hooks stay in.claude/as before.Ownership and upgrades
Each entry at a link path is read without following links (
symlink_metadata):--update/--forceSKILL.md+.meta-skill-copy), anywherermdir, then linkedSKILL.mdidentical to the shipped text, in.claude/skills/only (#36 layout; no release shipped it, and its text is today's)../../.meta/skills/<name>(git's checkout of the link withcore.symlinks=false)No symlink is ever followed or removed. Rule files and
settings.jsonget the same guard: when.claude/,.claude/rules/, a rule file or.claude/settings.jsonis a symlink, it is skipped and reported. Every folder on the way is checked too, without following links: a symlink anywhere in.meta/skills/<name>/SKILL.mdstops the install with an error, and an agent skills folder reached through a symlink (e.g..agents/skills -> ../.other/skills) is skipped and reported. git-kb'sreject_symlinked_pathdoes the same. Flat pre-#36.claude/skills/meta-*.mdfiles are removed with--update/--forceonly when they are regular files (not links) whose first line is the heading of a skill meta shipped. Every release's flat files start with one of seven known headings, such as# Meta Git Skill. Anything else at those names is reported and kept..meta/skills/<name>/SKILL.mdkeeps the old rule: skipped if it exists, rewritten with--update/--force.Windows
atc tries
symlink_dirand copies onPermissionDenied/Unsupported. git-kb never tries a link on Windows and copies with no marker. Windows reports a missing symlink privilege asERROR_PRIVILEGE_NOT_HELD, which Rust maps to an uncategorized error, notPermissionDenied, so atc's check misses it. meta tries the link and falls back to a copy on any link error. The copy holds.meta/skills/<name>/SKILL.md, copied rather than taken from the binary's built-in text, so a kept or newer committed skill is what agents see, plus a.meta-skill-copymarker. That marker is how later runs know the copy is meta's, and--updatereplaces a marked copy with a link once links work. Clones made withcore.symlinks=falseget the committed links as placeholder files, and--updatereplaces them, as shown in the table. A test forces link creation to fail (install_skills_withtakes the link function) and checks the copies. Tests useassert_linked, which accepts a marked copy only on Windows, so the suite works on Windows with or without link rights.Legacy
.metaconfig fileA repo whose config is the legacy
.metafile can't also have the.meta/folder.meta init claude(with any flags) now refuses before writing anything:The meta-repo warning check now uses
find_meta_config_in, which accepts only files. Before, a.meta/folder counted as a config there.The plugin installer's workspace finder (
registry.rs) still treats a.meta/folder as a workspace marker for.meta/plugins/. That is intended (tests/plugin_install.batscovers it) and it never reads the folder as config, so it is unchanged.For a shared crate later
install_skills(root, tool, skills, agent_dirs, overwrite, verbose)takes the tool name (.<tool>/skills,.<tool>-skill-copy), the skill bundle and the agent folder table as inputs. Nothing in it is meta-specific apart from the copy marker's text. The flat-file cleanup and the legacy.metacheck stay outside it.Tests
New unit tests: links for Claude and Codex, other agent folders only when they exist, legacy
.metarefusal for every flag combination,--updateover #36 folders (kept without it), marked copies replaced by links, foreign folders and files left alone under--updateand--force, foreign links neither followed nor removed, single-file folders outside.claude/skills/kept, git placeholders replaced, copies made from.meta/skills/when links fail, and symlinked agent or.meta/skills/folders never written through (Unix).cargo testfor init: all passed; clippy-D warningsclean.Merge order
Part of [tasks/harmony-2714]: meta keeps its agent skills in a local
.meta/folder. Four PRs, same branch nameharmony-2714-meta-skills-dir, so each repo's CI builds against the others:tests/init.batschecks the new layout against meta_climain. Then sync meta_cli into gitkb/meta as usual.After a meta release, re-run
meta init claude --updatein harmony to move its committed.claude/skills/meta-*.mdfiles to.meta/skills/with links.