feat(skills): Skill Contract v1, unity-cli skills lint, dual plugin distribution (#160)#161
Conversation
…l plugin distribution (#160) Establishes a machine-verifiable Claude Code / Codex skill contract and migrates all 13 unity-* skills to it in a single PR. Skills are now shared between the Claude Code plugin (`.claude-plugin/`) and the newly introduced Codex plugin (`.codex-plugin/` + `.agents/skills/` + `.agents/plugins/`) via a single source of truth under `.claude-plugin/plugins/unity-cli/skills/`. Why - description-based triggering was informal and inconsistent across skills. - Codex CLI published a formal plugin spec (`.codex-plugin/plugin.json`, `.agents/skills/`, `.agents/plugins/marketplace.json`) in late 2025 but the repo still used the pre-spec `.codex/skills/` layout. - `gh-skills-sync` is a development helper for this repository itself and should not ship inside the distributed plugin. - No dedicated gwt-spec Issue tracked skill concerns; closest was #145 (CLI core) which only mentioned skill routing in passing. What - New Rust module `src/skills/` implementing loader, domain model, report, runner, and rules R01..R22 (Skill Contract v1). Exposed via `unity-cli skills lint [--root --format --severity --fix]`. - 22 unit tests under `src/skills/tests.rs` (one RED example per rule + a good_skill pass-all). - Migrated 13 unity-* skills: frontmatter (metadata.triggers/siblings), description rewritten to Verb+object imperative with sibling mention, body rewritten to the 5 required H2 sections, `references/runtime-checklist.md` copied into every skill, `unity-csharp-edit` receives `Edit, Write`, `unity-cli-usage` becomes `user-invocable: false`. - Created `.codex-plugin/plugin.json`, `.agents/skills/` symlinks, `.agents/plugins/marketplace.json`. Deleted legacy `.codex/skills/`. Codex-only helpers (`gh-fix-ci`, `gh-fix-issue`, `gh-pr`, `gh-pr-check`) moved from `.codex/skills/` to `.agents/skills/`. - Bumped `.claude-plugin/plugins/unity-cli/plugin.json` to 0.2.0 with explicit `skills: "./skills/"`. Bumped marketplace to 0.2.0. - Moved `gh-skills-sync` to `dev-skills/gh-skills-sync/` (out of plugin). - `CLAUDE.md`, `docs/skills.md` (new), `docs/development.md` updated to reflect the contract. `CONTRIBUTING.md` added inside the plugin with the new-skill checklist and PR template fragment. - Replaced `scripts/skill-eval/static-skill-contract-check.sh` with `cargo run -- skills lint --severity error` in `.github/workflows/lint.yml` and `.github/workflows/skill-routing-eval.yml`. Legacy script deleted. Verification - `cargo fmt --all -- --check` - `cargo clippy --all-targets -- -D warnings` - `cargo test --all-targets` — 246 passed (incl. 22 new skill linter tests) - `cargo run -- skills lint --severity error` — 13 skills, 0 violations - `.claude/skills/` and `.agents/skills/` symlinks resolve to canonical source - `.codex/` removed, `gh-skills-sync` in `dev-skills/`, plugin manifests at 0.2.0 Refs: #160, #145 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…t-v1-160 # Conflicts: # .agents/skills/unity-development-loop
|
Fixed the blocking items on this PR. Done
Verification
CI is running on commit |
|
Follow-up
|
Summary
unity-cli skills lintsubcommand (22 rules R01..R22) to enforce it across allunity-*skills.references/runtime-checklist.mdto each one..claude-plugin/) and Codex CLI (new.codex-plugin/+.agents/skills/+.agents/plugins/marketplace.json) from a single source of truth.gh-skills-syncout of the distributed plugin intodev-skills/, retargets its Claude Code symlink, and relocates Codex-only gh-* helpers from the legacy.codex/skills/path to the official.agents/skills/path.scripts/skill-eval/static-skill-contract-check.sh(686 lines of bash) withcargo run -- skills lint --severity errorin bothlint.ymlandskill-routing-eval.yml.Specs and rationale live in #160 (cross-linked from #145).
Skill Contract v1 (high level)
metadata.triggerstoken in the first 250 chars, third-person imperative, bothUse whenandDo not useclauses, at least one sibling mentioned.name,description,allowed-tools(Bash(unity-cli:*), Read, Grep, Glob+Edit,Writeonly forunity-csharp-edit),metadata.{author,version,category,triggers,siblings};user-invocable: falseonly for foundation skills.Use When → Do Not Use When → Preferred Flow → Examples → References, 1-level reference nesting, no time-sensitive language.references/runtime-checklist.md; reference files > 100 lines need a## Table of Contents..claude/skills/<name>and.agents/skills/<name>must resolve to the canonical source (R20 / R21).See
docs/skills.mdfor the full rule index and.claude-plugin/plugins/unity-cli/CONTRIBUTING.mdfor the new-skill checklist.Test plan
cargo fmt --all -- --checkcargo clippy --all-targets -- -D warningscargo test --all-targets— 246 passed (22 new skill linter tests + 224 existing)cargo run -- skills lint --severity error— 13 skills, 0 violations.claude/skills/unity-*and.agents/skills/unity-*canonicalize to.claude-plugin/plugins/unity-cli/skills/unity-*.claude-plugin/plugins/unity-cli/plugin.jsonand.codex-plugin/plugin.jsonboth at0.2.0;.agents/plugins/marketplace.jsonlists the Codex plugin.codex/skills/removed,gh-skills-syncrelocated todev-skills/, Codex-only gh-* helpers moved to.agents/skills/lint.ymlandskill-routing-eval.ymlnow invokecargo run -- skills lint --severity error; legacy bash script deletedplugins install ./check when convenientRefs: closes work for #160, supersedes the skill-routing portion of #145.
🤖 Generated with Claude Code