Skip to content

feat(skills): Skill Contract v1, unity-cli skills lint, dual plugin distribution (#160)#161

Merged
akiojin merged 4 commits into
developfrom
feat/skill-contract-v1-160
Apr 10, 2026
Merged

feat(skills): Skill Contract v1, unity-cli skills lint, dual plugin distribution (#160)#161
akiojin merged 4 commits into
developfrom
feat/skill-contract-v1-160

Conversation

@akiojin
Copy link
Copy Markdown
Owner

@akiojin akiojin commented Apr 8, 2026

Summary

  • Introduces Skill Contract v1 and a Rust-native unity-cli skills lint subcommand (22 rules R01..R22) to enforce it across all unity-* skills.
  • Migrates all 13 existing unity-* skills to the contract and adds the shared references/runtime-checklist.md to each one.
  • Packages the skills as a dual plugin for Claude Code (.claude-plugin/) and Codex CLI (new .codex-plugin/ + .agents/skills/ + .agents/plugins/marketplace.json) from a single source of truth.
  • Moves gh-skills-sync out of the distributed plugin into dev-skills/, retargets its Claude Code symlink, and relocates Codex-only gh-* helpers from the legacy .codex/skills/ path to the official .agents/skills/ path.
  • Replaces the legacy scripts/skill-eval/static-skill-contract-check.sh (686 lines of bash) with cargo run -- skills lint --severity error in both lint.yml and skill-routing-eval.yml.

Specs and rationale live in #160 (cross-linked from #145).

Skill Contract v1 (high level)

  • description: ≤ 1024 chars, front-loads a metadata.triggers token in the first 250 chars, third-person imperative, both Use when and Do not use clauses, at least one sibling mentioned.
  • frontmatter: required name, description, allowed-tools (Bash(unity-cli:*), Read, Grep, Glob + Edit,Write only for unity-csharp-edit), metadata.{author,version,category,triggers,siblings}; user-invocable: false only for foundation skills.
  • SKILL.md body: ≤ 500 lines, required H2 sections in order Use When → Do Not Use When → Preferred Flow → Examples → References, 1-level reference nesting, no time-sensitive language.
  • references: every skill must include references/runtime-checklist.md; reference files > 100 lines need a ## Table of Contents.
  • cross-skill: sibling declarations must be bidirectional (R12); shared triggers require cross-listed siblings (R22).
  • symlink integrity: .claude/skills/<name> and .agents/skills/<name> must resolve to the canonical source (R20 / R21).

See docs/skills.md for the full rule index and .claude-plugin/plugins/unity-cli/CONTRIBUTING.md for the new-skill checklist.

Test plan

  • cargo fmt --all -- --check
  • cargo clippy --all-targets -- -D warnings
  • cargo test --all-targets246 passed (22 new skill linter tests + 224 existing)
  • cargo run -- skills lint --severity error13 skills, 0 violations
  • Symlink audit: all 13 .claude/skills/unity-* and .agents/skills/unity-* canonicalize to .claude-plugin/plugins/unity-cli/skills/unity-*
  • Plugin manifests: .claude-plugin/plugins/unity-cli/plugin.json and .codex-plugin/plugin.json both at 0.2.0; .agents/plugins/marketplace.json lists the Codex plugin
  • .codex/skills/ removed, gh-skills-sync relocated to dev-skills/, Codex-only gh-* helpers moved to .agents/skills/
  • CI wiring: lint.yml and skill-routing-eval.yml now invoke cargo run -- skills lint --severity error; legacy bash script deleted
  • Reviewer: manual Codex CLI plugins install ./ check when convenient

Refs: closes work for #160, supersedes the skill-routing portion of #145.

🤖 Generated with Claude Code

…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>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 8, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 09401d4c-9f91-4a40-9b86-5bdd99ee8c58

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/skill-contract-v1-160

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@akiojin
Copy link
Copy Markdown
Owner Author

akiojin commented Apr 10, 2026

Fixed the blocking items on this PR.

Done

  • Merged the latest develop into this branch and resolved the .codex/skills -> .agents/skills rename conflict for unity-development-loop.
  • Added coverage-focused tests in src/skills/loader.rs and src/skills/tests.rs to exercise the new skill-linter code paths that dropped Rust coverage.
  • Normalized .claude-plugin/plugins/unity-cli/skills/unity-development-loop/SKILL.md and added .claude-plugin/plugins/unity-cli/skills/unity-development-loop/references/runtime-checklist.md so cargo run -- skills lint --severity error is clean again after the merge.

Verification

  • cargo test --all-targets skills -- --nocapture
  • cargo llvm-cov --all-targets --json --summary-only --ignore-run-fail --output-path /tmp/unity-cli-cov.json produced overall 90.14%
  • cargo run -- skills lint --severity error

CI is running on commit 9e080d2.

@akiojin
Copy link
Copy Markdown
Owner Author

akiojin commented Apr 10, 2026

Follow-up

  • Fixed the Rust formatter failure by applying cargo fmt --all to src/skills/tests.rs.
  • CI is re-running on commit be89b6c.

@akiojin akiojin merged commit 9cb58e7 into develop Apr 10, 2026
9 checks passed
@akiojin akiojin deleted the feat/skill-contract-v1-160 branch April 10, 2026 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant