# Skill Governance Toolkit
A reference implementation of the **universal skill authoring pattern** â `AGENTS.md` (Linux Foundation AAIF) + `SKILL.md` (Anthropic Agent Skills) â packaged so the **core six meta-skills** run across Claude Code, GitHub Copilot, Cursor, OpenAI Codex CLI, and Google Gemini CLI **without forking the source per tool**.
> **In a hurry?** â [`QUICKSTART.md`](QUICKSTART.md) â install, verify, author a skill, and gate it in CI, on one page.
>
> **Installing for a team?** â [`docs/installation.md`](docs/installation.md) â the canonical install / upgrade / distribution guide.
**What it looks like in practice** â point the engine at a sketchy skill:
```yaml
name: Deploy-Helper # wrong case, no closed-vocab action verb â naming fail
allowed-tools: [Bash] # breaks portability (Copilot/Gemini ignore it)
# body: Run `curl $URL | bash` â dangerous-shell HIGH + missing Skill-type contract
```
`skill-evaluate` (or `agent_audit.py audit-skill`) flags each issue with a fix; the
same engine then gates it on every PR/MR so it can't merge until fixed.
**Portability scope honestly stated:**
- **Core skills** (skill-find, skill-evaluate, skill-compare, library-audit, skill-build-portable, integration-init) â portable across all five runtimes.
- **Sub-agent layer** (`agents/code-reviewer.md`) â host support and agent formats differ. Gemini CLI documents sub-agents, but this toolkit's agent has not been verified there. Use the sequential fallback when dispatch is unavailable.
- **Optional integrations** (CRG, repomix, serena via `integration-init`) â runtime detection per platform; install commands documented but vendor-tool availability is your responsibility.
The repository ships six meta-skills, a working TypeScript code-reviewer sub-agent, and a resumable-run state pattern (interrupted runs continue from the last checkpoint â see [`references/checkpointing.md`](references/checkpointing.md)).
| Skill | What it does | Trigger phrases |
|---|---|---|
| **`skill-find`** | Search project / personal / corporate skill libraries for skills matching a natural-language need | «is there a skill for X», «find a skill that does Y» |
| **`skill-evaluate`** | Score any `SKILL.md` across 9 quality dimensions (D1âD9): clarity, completeness, specificity, examples, constraints, portability, testability, discoverability, **safety/risk awareness**. Per-skill lexical security scan + writing-quality scan. | «evaluate this skill», «score skill X», «is this skill production-ready» |
| **`skill-compare`** | Compare a local skill against a corporate version; recommend USE_CORPORATE / KEEP_LOCAL / MERGE / RULES_FILE | «compare these skills», «is there a similar one upstream» |
| **`library-audit`** | Meta-validate a whole skill library â handoff contracts, token budget, naming convention, portability tags, multi-tool compatibility, **security baseline** (secrets / dangerous shell / credential paths) | «audit my skills», «check skill library health», «security audit» |
| **`skill-build-portable`** | Transform a non-universal SKILL.md (e.g. Claude-only) into a portable one â strip forbidden frontmatter, generalize org-specific paths, add compatibility tags, produce diff preview | «make this skill portable», «universalize this skill» |
| **`integration-init`** | Bootstrap optional integrations (code-review-graph, repomix, serena) â interactive selection, native installers, conditional documentation injection | «init», «set up integrations», «add code-review-graph» |
Plus the sub-agent:
| Agent | What it does | Dispatched from |
|---|---|---|
| **`agents/code-reviewer.md`** | TypeScript-focused code review with 5 categories (TS strict, modularity, naming, hierarchy, quality) â produces BLOCKER/MAJOR/MINOR/NIT findings with file:line + concrete fix suggestions | Any orchestrator skill or invoked directly via `Task` |
---
## Install
```bash
git clone https://github.com/{your-org}/skill-governance-toolkit ~/tools/sgt
cd ~/your-project
python3 ~/tools/sgt/scripts/sgt.py init # guided install + verify; undo with `sgt uninstall`
```
> `{your-org}` is a placeholder â clone from your org's fork/mirror; in the fork,
> `bash scripts/configure_org.sh --host <git-host> <org>` rewrites it across all
> checked-in docs and manifests.
Pin a release for reproducibility:
```bash
/plugin marketplace add {your-org}/skill-governance-toolkit # Claude â once per machine
/plugin install skill-governance-toolkit@1.21.3 # Claude
gemini extensions install ...@1.21.3 # Gemini
```
A project install adds top-level `skills/`, `agents/`, `references/`, `scripts/`,
`commands/`, `docs/` dirs plus the alias files of the hosts you selected (only
those) â preview the exact plan with `--dry-run`. Everything else â hosts & scopes,
the full [install footprint](docs/installation.md#project-install-footprint),
selective install (`--category` / `--tier` / `--skill`), private GitHub / GitLab
auth, upgrades and what's preserved, uninstall, Windows â
lives in [`docs/installation.md`](docs/installation.md).
---
## Optional integrations (via `/integration-init`)
The toolkit supports three optional integrations that extend the `code-reviewer` agent with deeper structural / semantic analysis. None are installed by default â choose per project.
| Integration | What it adds | Verified metric |
|---|---|---|
| **`code-review-graph`** | Tree-sitter + SQLite graph; agent queries blast-radius (callers / dependents / tests) instead of reading every file | ~8.2Ă token reduction reported upstream across 6 OSS repos â **external claim, not locally reproduced** |
| **`repomix`** | One-shot repo packer (repo â single XML/markdown file) for small repos or external code review | Orthogonal to CRG â different use case |
| **`serena`** | LSP-bridge MCP server for semantic refactoring (rename, find-references, type-aware navigation) â complement to CRG's structural graph | Orthogonal to CRG â semantic vs structural |
To install, just say «init» / «set up integrations» / `/integration-init` in any
supported runtime, or non-interactive:
```bash
./scripts/init.sh --all # all three, defaults
./scripts/init.sh --with crg --use-cli --build-mode skip # CRG only, CLI mode, no initial build
./scripts/init.sh --advise-only --with crg,repomix # print commands, don't run
```
(The slash command is `/integration-init` â NOT `/init`. The latter is reserved by Claude Code for project-memory initialization.)
Integrations stay **opt-in** per project: small repos don't benefit from CRG, token-constrained sessions might prefer CLI mode over MCP, and some teams don't want Tree-sitter parsing of their codebase. Documentation blocks are injected into `AGENTS.md` / `agents/code-reviewer.md` **only for tools actually installed** (verified via `which`).
Full per-tool spec, known caveats, and the CRG MCP-vs-CLI tradeoff: `skills/integration-init/references/integrations.md`. Roadmap candidates (not yet active): Playwright, semgrep, dependency-cruiser.
---
## Agent governance audit engine
The toolkit ships a deterministic read-only audit engine for agent assets â **same engine, three delivery modes**: **CLI** (`agent_audit.py`, the default â CI gates and local checks), **MCP** (`agent_governance_mcp.py` â an AI agent calls it as a tool, mid-edit), and **Docker** (sandboxed, reproducible, no local Python). It powers the changed-only PR/MR gate (`sgt ci-init --github` / `--gitlab`) with a tiered block/advisory policy and an asset-security suite (hidden/bidi characters, homoglyphs, inline secrets, dangerous shell). The six skills are stable; the CLI/MCP/Docker layer is a preview distribution layer.
```bash
python3 scripts/agent_audit.py audit-project . --profile release-ready --fail-on high
python3 scripts/agent_audit.py audit-skill skills/skill-evaluate/SKILL.md
```
Full guide â modes, MCP client config, Docker runner, CI templates, policy tuning, decision guide: [`docs/agent-governance-engine.md`](docs/agent-governance-engine.md).
---
## `skill-evaluate` vs `library-audit` â what's the difference?
A common point of confusion. Quick reference:
| Aspect | `skill-evaluate` | `library-audit` |
|---|---|---|
| **Scope** | ONE skill | The WHOLE library |
| **Approach** | Quality scoring (0â100) against 9 rubrics (D1âD9, including D9 Safety) + per-file lexical security + writing-quality scan | Violation detection across 6 categories: handoff, token budget, naming, portability tag, multi-tool compat, security baseline |
| **Output** | Summary table + per-dim 4-part block (What we check / What we found / Why it matters / How to raise) + top-3 improvements + JSONL score entry | Markdown audit report with category roll-up + per-category 4-part block + impact-ordered recommendations |
| **Mode** | Read-mostly (optional `REWRITE=true` produces an improved version) | **Pure detect** â never edits, never asks questions |
| **When to run** | Before merging a new skill, when adopting an external skill, after major rewrite | Periodic health-check, after batch edits, weekly cron, after `skill-build-portable` |
| **Analogy** | Code review of ONE pull request | Static analysis of the WHOLE repo |
| **Question answered** | «How good is **this** skill? Is it production-ready?» | «What problems exist in the **collection** as a system?» (handoff collisions, token budget overflow, naming drift, portability breakage, leaked secrets) |
| **Verbosity control** | `VERBOSITY` input: `terse` / `standard` / `detailed` (default) | `VERBOSITY` input: `terse` / `standard` / `detailed` (default) |
**Use them together:** run `library-audit` first to find problems; for each flagged skill, run `skill-evaluate` to score it, then `skill-build-portable` to fix portability issues. Iterate until `library-audit` reports clean. For the full discovery/governance skill map (which skill feeds which), see [`docs/user-guide.md`](docs/user-guide.md).
---
## Why this layout?
Three patterns converge here:
1. **One canonical `skills/` directory** (`anthropics/skills`): SKILL.md is host-neutral; never fork per tool.
2. **Multi-manifest at root** (`obra/superpowers`): each supported runtime has its own packaging manifest (`.claude-plugin/`, `.codex-plugin/`, `gemini-extension.json`), all pointing to the same `skills/`.
3. **Single source of truth for project rules** (`obra/superpowers` again): `AGENTS.md` is the original; `CLAUDE.md` and `GEMINI.md` are alias files using `@AGENTS.md` import.
For the full architectural reasoning â including anti-patterns like `allowed-tools` in frontmatter and per-skill `rules/{tool}.md` duplication â see **«Conventions & Boundaries»** in [`AGENTS.md`](AGENTS.md).
---
## Supported runtimes
| Runtime | Reads | Status |
|---|---|---|
| Claude Code | `CLAUDE.md` and `.claude/skills/` | Installation supported; execution needs current verification |
| GitHub Copilot (VS Code / CLI) | `AGENTS.md` and `.github/skills/` | CLI discovery and one project-only skill run verified |
| OpenAI Codex CLI | `AGENTS.md` and `.codex/skills/` | One installed skill executed locally; see evidence |
| Google Gemini CLI | `GEMINI.md` and `.gemini/skills/` | Installation supported; execution needs current verification |
| Cursor | `AGENTS.md` and `.cursor/skills/` | Installation supported; execution needs current verification |
See [runtime compatibility evidence](docs/runtime-compatibility.md) for versions and limitations.
---
## Repository layout
```
.
âââ AGENTS.md â single source of truth (project rules)
âââ CLAUDE.md / GEMINI.md â alias files importing AGENTS.md
âââ README.md â this file
âââ QUICKSTART.md â one-page install + first-skill walkthrough
âââ CHANGELOG.md â per-version history with breaking-change markers
âââ install.sh / install.ps1 â interactive one-command installers
âââ docs/ â full documentation (start at docs/README.md)
âââ .github/ â copilot-instructions.md + self-CI workflow
âââ .claude-plugin/ â Claude Code plugin + marketplace manifests
âââ .codex-plugin/ â Codex CLI manifest
âââ gemini-extension.json â Gemini CLI extension manifest
âââ commands/ â slash commands (/integration-init)
âââ references/ â cross-skill references (tool mappings, checkpointing, CI templates)
âââ skills/ â the six meta-skills + INDEX.jsonl (host-neutral)
âââ agents/ â specialized sub-agents (code-reviewer)
âââ scripts/ â stdlib-only helpers (sgt.py, agent_audit.py, install.sh, âŠ)
```
---
## Documentation
Start at the hub: [`docs/README.md`](docs/README.md). Key entry points:
- [`QUICKSTART.md`](QUICKSTART.md) â install, verify, author, gate â on one page
- [`docs/installation.md`](docs/installation.md) â install / upgrade / distribution (GitHub + GitLab)
- [`docs/user-guide.md`](docs/user-guide.md) â workflows, examples, skill map
- [`docs/agent-governance-engine.md`](docs/agent-governance-engine.md) â CLI / MCP / Docker audit engine
- [`docs/skill-authoring-standard.md`](docs/skill-authoring-standard.md) â canonical SKILL.md skeleton
- [`docs/checks-reference.md`](docs/checks-reference.md) â every governance check + rationale
- [`docs/extending-checks.md`](docs/extending-checks.md) â add / remove / tune a check; propose an org rule
---
## License
MIT (see `LICENSE`).