Metadata-Version: 2.4
Name: skillgauge
Version: 0.2.0
Summary: Routing and behavioral test harness for agent skills.
Author: Advanced Micro Devices, Inc.
License-Expression: MIT
Project-URL: Homepage, https://github.com/amd/skillgauge
Project-URL: Documentation, https://github.com/amd/skillgauge/blob/main/docs/usage.md
Project-URL: Issues, https://github.com/amd/skillgauge/issues
Project-URL: Source, https://github.com/amd/skillgauge
Keywords: agent-skills,evals,claude-code,copilot,testing,llm
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pyyaml>=6.0
Requires-Dist: inspect-ai>=0.3.263
Requires-Dist: agent-client-protocol<1
Requires-Dist: anthropic>=0.40
Provides-Extra: podman
Requires-Dist: inspect-podman; extra == "podman"
Provides-Extra: verify
Requires-Dist: inspect-swe>=0.2.71; extra == "verify"
Dynamic: license-file

<!--
Copyright Advanced Micro Devices, Inc.

SPDX-License-Identifier: MIT
-->

# Skillgauge

![AMD](https://img.shields.io/badge/AMD-Skillgauge-ED1C24?logo=amd&logoColor=white)
![Agent Skills](https://img.shields.io/badge/Agent_Skills-Standard-7B2D8E)
![Python](https://img.shields.io/badge/Python-3.10+-3776AB?logo=python&logoColor=white)
[![Claude Code](https://img.shields.io/badge/Claude_Code-Compatible-F07535?logo=claude&logoColor=white)](https://www.anthropic.com/claude-code)
[![GitHub Actions](https://img.shields.io/badge/GitHub_Actions-Reusable-2088FF?logo=githubactions&logoColor=white)](https://github.com/amd/skillgauge/blob/main/.github/workflows/reusable.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/amd/skillgauge/blob/main/LICENSE)

![Skillgauge: Agent Skill Testing Harness](https://raw.githubusercontent.com/amd/skillgauge/main/assets/banner.svg)

A test harness for AI agent skills. Install the harness, or point a workflow at your repo. Skillgauge enables four main types of tests:

* **Structural**: Checks whether the skill is well structured (contains the expected files, a proper hierarchy, etc.).
* **Routing**: Checks whether the skill triggers when it should and stays quiet when it shouldn't. You may also point to more than one skill here to explore how skills interfere with each other's routing.
* **Behavioral**: Runs the agent end to end and uses an LLM judge to confirm the skill behaves correctly.
* **Staleness**: Runs the behavioral cases a second time with the skill withheld, and compares. Tells you whether the cases still need the skill, or whether the model has caught up and the suite is passing on its own.

All four read one dataset per skill, `<skill>/evals/evals.json`. How to write one is in [docs/authoring-evals.md](https://github.com/amd/skillgauge/blob/main/docs/authoring-evals.md).

> [!IMPORTANT]
> **Early Days**: Flags, workflow inputs, and report formats may evolve quickly as this repo takes shape.

> [!NOTE]
> **Renamed from skillscope** in 0.2.0, and published on PyPI as
> `skillgauge` rather than installed from git.
>
> - **Still works, with a notice on stderr:** `SKILLSCOPE_*` variables. A
>   `SKILLGAUGE_*` one wins whenever it is set, even to an empty value.
>   Exceptions: `SKILLSCOPE_MODEL` never changed which model ran, and is
>   gone; and a run started through the action or the reusable workflows
>   takes its repo and skills from their inputs, so a runner-level
>   `SKILLSCOPE_REPO` or `SKILLSCOPE_SKILLS` does not reach it (nor did it
>   before the rename).
> - **Renamed, with no alias:** the command is `skillgauge` and the module
>   `python -m skillgauge`. A hook imports from `skillgauge` instead of
>   `skillscope`. (An unrelated project owns `skillscope` on PyPI, so this
>   package does not ship that name.)
> - **Moved, with no fallback:** run reports go to `.skillgauge/` instead of
>   `.skillscope/`, and a skill's container prerequisites run in
>   `/opt/skillgauge` instead of `/opt/skillscope`. An image that baked
>   an install into `/opt/skillscope/cache` has to be rebuilt to keep it.
>   Inside inspect logs, the task tag, metadata and store keys, and routing
>   marks are spelled `skillgauge` too, so a filter on the old spelling
>   stops matching.
> - **When you upgrade:** change `uses: amd/skillscope/...` to
>   `uses: amd/skillgauge/...` along with the tag (the old name only
>   redirects), and add `.skillgauge/` wherever your `.gitignore` lists
>   `.skillscope/`.

## Quick start

Run from the root of the repo you want tested.

```bash
uv tool install --system-certs skillgauge

skillgauge structural                        # no agent, no tokens
skillgauge structural --external             # the same, plus checking external URLs
skillgauge behavioral --skill my-skill       # needs an authenticated `claude` CLI
skillgauge routing --routing-room my-skill,its-neighbour  # also needs a key in the environment
skillgauge staleness --skill my-skill        # the same key: its baseline has to be an empty room
```

`routing` needs `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN` set, and refuses
to start without one — a `claude login` on its own is not enough. The key is
what lets the run point the CLI at its own config directory; without that, the
runner's own `~/.claude/skills` join the room for every case and the scores
describe a room nobody asked for. `behavioral` installs one skill and grades
what the agent produced, so a stray skill is at worst noise there, and a plain
`claude login` is fine.

`staleness` is in `routing`'s camp, not `behavioral`'s, and asks the same
credential question on Claude Code. Its baseline half has to be a room with
**no** skills in it, so the runner's own are not noise there — they are the
measurement. Either set one of those variables, or use `--engine
claude-code`, whose guest has no user-level skills at all. It is Claude Code
only: unlike `routing`, which scales its refusal per harness, it refuses
any `--harness` other than `claude-code`, because there is no staleness leg
for another one yet.

## Run it from your CI

Simply add an `evals.json` file to your skill and a workflow that points to our reusable workflow. This will trigger the three graders the workflow runs -- `structural`, `routing` and `behavioral` -- directly from your repo. `staleness` is not one of them: it runs both halves of every case and is meant to be asked for deliberately rather than on every push.

<img src="https://raw.githubusercontent.com/amd/skillgauge/main/assets/reusable_workflow.svg" alt="An evals.json plus a workflow that calls reusable.yml runs Discover Skills, Structural Tests, Routing and Behavioral Tests, then Results" width="720">

```yaml
jobs:
  evals:
    uses: amd/skillgauge/.github/workflows/reusable.yml@v0.2.0
    secrets:
      api_key: ${{ secrets.ANTHROPIC_API_KEY }}
    with:
      skills: skills/*
```

You may also choose to customize or even disable some tests if you prefer it. See [docs/usage.md](https://github.com/amd/skillgauge/blob/main/docs/usage.md) for details.

## Commands

| Command | Does |
| --- | --- |
| `skillgauge structural` | Skill folders, datasets, and markdown references. |
| `skillgauge routing` | Which skill fires, with several installed together. |
| `skillgauge behavioral` | What a skill does once it has fired. |
| `skillgauge staleness` | Whether those cases still need the skill, and what the agent spends without it. |
| `skillgauge select` | The CI plan for a change, as JSON. |
| `skillgauge list-skills` | The skills that have a dataset, as JSON. |
| `skillgauge template` | The dataset template a new skill starts from. |

`--help` on any of them is the reference. Reports go to stdout as markdown, to
`$GITHUB_STEP_SUMMARY` under Actions, and to JSON under `.skillgauge/runs/` in
the repo under test — worth adding to `.gitignore`.

## Docs

* [docs/authoring-evals.md](https://github.com/amd/skillgauge/blob/main/docs/authoring-evals.md): writing a skill's tests.
* [docs/usage.md](https://github.com/amd/skillgauge/blob/main/docs/usage.md): every flag, every workflow input, and what
  each check actually asserts.
* [docs/harnesses.md](https://github.com/amd/skillgauge/blob/main/docs/harnesses.md): what an agent harness is, and how to
  add one.

## Development

How to contribute, and the checks a pull request has to pass, are in
[CONTRIBUTING.md](CONTRIBUTING.md).

```bash
python -m pip install -e .
python -m unittest discover -s tests -t .
```

Runtime dependencies are PyYAML for frontmatter and `evals/machine.yml`,
`inspect-ai` for the eval framework both engines are built on, and `anthropic`
for the model client.
`inspect-ai` became required when the last stdlib-only engine was removed; the
test suite still runs on the standard library alone, and builds a throwaway
repo in a temp directory rather than reading the tree it runs in.

## License

MIT. See [LICENSE](https://github.com/amd/skillgauge/blob/main/LICENSE).
