@uinaf/agent-plugin-stuff 0.0.0-stage → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +62 -2
- package/dist/cli.js +734 -0
- package/dist/grok-provider.js +189 -0
- package/dist/lint.js +107 -0
- package/dist/plugin.js +158 -0
- package/dist/plugincheck.js +38 -0
- package/dist/rulecheck.js +38 -0
- package/dist/rules.js +179 -0
- package/dist/scenario.js +484 -0
- package/dist/skill-evidence.js +70 -0
- package/dist/transform.js +75 -0
- package/docs/adoption.md +51 -0
- package/docs/scenarios.md +124 -0
- package/docs/usage.md +210 -0
- package/package.json +71 -4
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
// src/skill-evidence.ts
|
|
4
|
+
const SKILL_ROOTS = [
|
|
5
|
+
".claude",
|
|
6
|
+
".agents",
|
|
7
|
+
".grok"
|
|
8
|
+
];
|
|
9
|
+
function real(file) {
|
|
10
|
+
try {
|
|
11
|
+
return fs.realpathSync(file);
|
|
12
|
+
} catch {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
const callList = (value) => Array.isArray(value) ? value.filter((c) => c !== null && typeof c === "object") : [];
|
|
17
|
+
function skillEvidence(context) {
|
|
18
|
+
const skill = context.config?.skill;
|
|
19
|
+
const workdir = context.vars.workdir;
|
|
20
|
+
if (typeof skill !== "string" || typeof workdir !== "string") return;
|
|
21
|
+
const metadata = context.metadata ?? context.providerResponse?.metadata;
|
|
22
|
+
if (callList(metadata?.skillCalls).find((c) => c.name === skill && c.is_error !== true)) return `skill call ${skill}`;
|
|
23
|
+
const installed = new Set(SKILL_ROOTS.flatMap((root) => {
|
|
24
|
+
const p = real(path.join(workdir, root, "skills", skill, "SKILL.md"));
|
|
25
|
+
return p === void 0 ? [] : [p];
|
|
26
|
+
}));
|
|
27
|
+
const root = real(workdir) ?? workdir;
|
|
28
|
+
if (callList(metadata?.toolCalls).find((c) => {
|
|
29
|
+
if (c.name !== "Read" || c.is_error !== false || typeof c.output !== "string") return false;
|
|
30
|
+
const file = c.input?.file_path;
|
|
31
|
+
if (typeof file !== "string") return false;
|
|
32
|
+
const named = path.resolve(workdir, file);
|
|
33
|
+
const inside = [workdir, root].some((w) => {
|
|
34
|
+
const rel = path.relative(w, named);
|
|
35
|
+
return rel !== ".." && !rel.startsWith(`..${path.sep}`) && !path.isAbsolute(rel);
|
|
36
|
+
});
|
|
37
|
+
const target = real(named);
|
|
38
|
+
return inside && target !== void 0 && installed.has(target);
|
|
39
|
+
})) return `read of the installed ${skill}/SKILL.md`;
|
|
40
|
+
const opening = [...installed].flatMap((p) => {
|
|
41
|
+
const t = fs.readFileSync(p, "utf8").slice(0, 300).trim();
|
|
42
|
+
return t.length >= 40 ? [t] : [];
|
|
43
|
+
});
|
|
44
|
+
if (callList(metadata?.toolCalls).find((c) => c.name === "Bash" && c.is_error === false && typeof c.output === "string" && opening.some((t) => c.output.includes(t)))) return `shell read of the installed ${skill}/SKILL.md`;
|
|
45
|
+
if (codexCommandOutputs(context.providerResponse?.raw).some((out) => opening.some((t) => out.includes(t)))) return `shell read of the installed ${skill}/SKILL.md`;
|
|
46
|
+
}
|
|
47
|
+
function codexCommandOutputs(raw) {
|
|
48
|
+
let parsed = raw;
|
|
49
|
+
if (typeof raw === "string") try {
|
|
50
|
+
parsed = JSON.parse(raw);
|
|
51
|
+
} catch {
|
|
52
|
+
return [];
|
|
53
|
+
}
|
|
54
|
+
const items = parsed?.items;
|
|
55
|
+
if (!Array.isArray(items)) return [];
|
|
56
|
+
return items.flatMap((item) => item?.type === "command_execution" && typeof item.aggregated_output === "string" ? [item.aggregated_output] : []);
|
|
57
|
+
}
|
|
58
|
+
function assertSkillUsed(_output, context) {
|
|
59
|
+
const evidence = skillEvidence(context);
|
|
60
|
+
const forbidden = context.config?.forbidden === true;
|
|
61
|
+
const required = !forbidden && context.config?.required !== false;
|
|
62
|
+
const used = evidence !== void 0;
|
|
63
|
+
const skill = String(context.config?.skill);
|
|
64
|
+
return {
|
|
65
|
+
pass: forbidden ? !used : used || !required,
|
|
66
|
+
score: used ? 1 : 0,
|
|
67
|
+
reason: used ? `skill used: ${evidence}${forbidden ? " (forbidden for this scenario)" : ""}` : `skill ${skill} not loaded${required || forbidden ? "" : " (optional for this scenario)"}`
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
export { assertSkillUsed as default, skillEvidence };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
// src/transform.ts
|
|
5
|
+
const PER_FILE_CAP = 16e3;
|
|
6
|
+
const TOTAL_CAP = 64e3;
|
|
7
|
+
function safeSlice(text, end) {
|
|
8
|
+
let cut = text.slice(0, end);
|
|
9
|
+
const last = cut.charCodeAt(cut.length - 1);
|
|
10
|
+
if (last >= 55296 && last <= 56319) cut = cut.slice(0, -1);
|
|
11
|
+
return cut;
|
|
12
|
+
}
|
|
13
|
+
function capped(rel, text) {
|
|
14
|
+
if (text.length <= PER_FILE_CAP) return `=== OUTPUT FILE: ${rel} ===\n${text}\n=== END OUTPUT FILE ===`;
|
|
15
|
+
return `=== OUTPUT FILE: ${rel} (truncated: showing ${PER_FILE_CAP} of ${text.length} chars) ===\n${safeSlice(text, PER_FILE_CAP)}\n=== END OUTPUT FILE ===`;
|
|
16
|
+
}
|
|
17
|
+
const SKIPPED_DIRS = /* @__PURE__ */ new Set([
|
|
18
|
+
".agents",
|
|
19
|
+
".claude",
|
|
20
|
+
".grok",
|
|
21
|
+
"node_modules",
|
|
22
|
+
".cache",
|
|
23
|
+
".npm",
|
|
24
|
+
".pnpm-store"
|
|
25
|
+
]);
|
|
26
|
+
function transform(output, context) {
|
|
27
|
+
const workdir = context.vars.workdir;
|
|
28
|
+
const manifest = JSON.parse(fs.readFileSync(context.vars.manifest, "utf8"));
|
|
29
|
+
const sections = [];
|
|
30
|
+
const visited = /* @__PURE__ */ new Set();
|
|
31
|
+
const walk = (dir) => {
|
|
32
|
+
for (const e of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
33
|
+
const p = path.join(dir, e.name);
|
|
34
|
+
if (e.isDirectory()) {
|
|
35
|
+
if (!SKIPPED_DIRS.has(e.name)) walk(p);
|
|
36
|
+
} else if (e.isFile()) {
|
|
37
|
+
const rel = path.relative(workdir, p);
|
|
38
|
+
visited.add(rel);
|
|
39
|
+
let body;
|
|
40
|
+
try {
|
|
41
|
+
body = fs.readFileSync(p);
|
|
42
|
+
} catch (error) {
|
|
43
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
44
|
+
sections.push({
|
|
45
|
+
rel,
|
|
46
|
+
text: `=== UNREADABLE FILE: ${rel} === (${detail})`
|
|
47
|
+
});
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
const hash = createHash("sha256").update(body).digest("hex");
|
|
51
|
+
if (manifest[rel] !== hash) sections.push({
|
|
52
|
+
rel,
|
|
53
|
+
text: capped(rel, body.toString("utf8"))
|
|
54
|
+
});
|
|
55
|
+
} else {
|
|
56
|
+
const nrel = path.relative(workdir, p);
|
|
57
|
+
sections.push({
|
|
58
|
+
rel: nrel,
|
|
59
|
+
text: `=== NON-REGULAR FILE: ${nrel} ===`
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
walk(workdir);
|
|
65
|
+
for (const rel of Object.keys(manifest)) if (!visited.has(rel)) sections.push({
|
|
66
|
+
rel,
|
|
67
|
+
text: `=== DELETED FILE: ${rel} === (input file removed by the agent)`
|
|
68
|
+
});
|
|
69
|
+
if (sections.length === 0) return output;
|
|
70
|
+
sections.sort((a, b) => a.rel < b.rel ? -1 : a.rel > b.rel ? 1 : 0);
|
|
71
|
+
let appended = sections.map((s) => s.text).join("\n\n");
|
|
72
|
+
if (appended.length > TOTAL_CAP) appended = `${safeSlice(appended, TOTAL_CAP)}\n\n=== TRUNCATED: output files exceeded ${TOTAL_CAP} chars total ===`;
|
|
73
|
+
return `${output}\n\n${appended}`;
|
|
74
|
+
}
|
|
75
|
+
export { SKIPPED_DIRS, transform as default };
|
package/docs/adoption.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Adopting it in a repo
|
|
2
|
+
|
|
3
|
+
Run the lint in the consumer repo's CI. Run evals only on a machine with model
|
|
4
|
+
auth.
|
|
5
|
+
|
|
6
|
+
## Lint in CI
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
pnpm add -D @uinaf/agent-plugin-stuff
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
```json
|
|
13
|
+
{ "scripts": { "plugin:lint": "plugincheck" } }
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Use `plugincheck` for full plugin repos (skills, rules, manifests, MCP parity),
|
|
17
|
+
`rulecheck` for rules only, or `skillcheck lint` for skills only.
|
|
18
|
+
|
|
19
|
+
Add a CI job that checks out, sets up pnpm and the
|
|
20
|
+
[supported Node](../README.md#install), installs with `--frozen-lockfile`, and
|
|
21
|
+
runs `pnpm run plugin:lint`. The job needs no secrets, and `--ignore-scripts`
|
|
22
|
+
installs work. Run it through the script: a bare `npx plugincheck` resolves the
|
|
23
|
+
latest registry version, not the pinned one.
|
|
24
|
+
|
|
25
|
+
## Evals
|
|
26
|
+
|
|
27
|
+
Keep sweeps off consumer CI. For pnpm 12, add this override to the operator
|
|
28
|
+
project's `pnpm-workspace.yaml` before installing; it drops promptfoo's unused
|
|
29
|
+
local-inference path and its unpatched `sprintf-js`
|
|
30
|
+
([GHSA-hp3w-g68c-fv3c](https://github.com/advisories/GHSA-hp3w-g68c-fv3c)):
|
|
31
|
+
|
|
32
|
+
```yaml
|
|
33
|
+
overrides:
|
|
34
|
+
"promptfoo>@huggingface/transformers": "-"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Install the peers next to skillcheck, then sweep and summarize:
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
pnpm add -D promptfoo @anthropic-ai/claude-agent-sdk @openai/codex-sdk
|
|
41
|
+
skillcheck sweep # resumes: only scenarios without results
|
|
42
|
+
skillcheck summarize # writes .skillcheck/scorecards/<UTC-date>.json
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Keep `.skillcheck/scorecards/`, committed here or in a separate evals
|
|
46
|
+
repository ([isolated runs](usage.md#isolated-runs)), and gitignore the
|
|
47
|
+
results:
|
|
48
|
+
|
|
49
|
+
```gitignore
|
|
50
|
+
.skillcheck/results/
|
|
51
|
+
```
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# Writing scenarios
|
|
2
|
+
|
|
3
|
+
A scenario is two files in a fixed location; a directory missing either is not
|
|
4
|
+
discovered:
|
|
5
|
+
|
|
6
|
+
```text
|
|
7
|
+
<root>/skills/<skill>/evals/<scenario>/task.md
|
|
8
|
+
<root>/skills/<skill>/evals/<scenario>/criteria.json
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
The path is the identity: `<skill>--<scenario>` names the run, the result file,
|
|
12
|
+
and the scorecard entry. Codex and Grok results gain `--codex` and `--grok`
|
|
13
|
+
suffixes.
|
|
14
|
+
|
|
15
|
+
## task.md
|
|
16
|
+
|
|
17
|
+
The prompt handed to the agent, verbatim. Input files are embedded inline and
|
|
18
|
+
written into the workdir before the run:
|
|
19
|
+
|
|
20
|
+
```md
|
|
21
|
+
Fix the failing check in the config below.
|
|
22
|
+
|
|
23
|
+
======= FILE: config.json =======
|
|
24
|
+
{ "retries": -1 }
|
|
25
|
+
======= END FILE =======
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The prompt then says "Input file `config.json` is available in your working
|
|
29
|
+
directory." Destinations must stay under the workdir, must not collide, and
|
|
30
|
+
must not target `.claude/`, `.agents/`, `.grok/`, or `node_modules/`.
|
|
31
|
+
|
|
32
|
+
Write the task the way a user would, without the skill's name, its steps, or
|
|
33
|
+
the checklist: routing is part of what is measured.
|
|
34
|
+
`skillcheck lint` rejects a task that names any skill in the root.
|
|
35
|
+
|
|
36
|
+
The agent runs online with a shell and web access. On a host run it has the
|
|
37
|
+
operator's logins, so a task must never ask for a live mutation such as
|
|
38
|
+
posting a comment, pushing, publishing, or writing to a shared workspace. Put
|
|
39
|
+
that state in fixture files and grade the plan. Checks the agent can run
|
|
40
|
+
itself (install, build, test, fetch a public page) are fair to require.
|
|
41
|
+
|
|
42
|
+
## criteria.json
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"type": "weighted_checklist",
|
|
47
|
+
"context": "one line describing what a good answer looks like",
|
|
48
|
+
"checklist": [
|
|
49
|
+
{ "name": "short-handle", "description": "what the judge should look for", "max_score": 3 }
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
`type` must be `weighted_checklist` and the checklist non-empty. Every item
|
|
55
|
+
needs a non-empty `name` and `description` and a positive `max_score`. Weights
|
|
56
|
+
are relative. `skillcheck lint` applies these checks and the `skill_use` and
|
|
57
|
+
`install` rules below.
|
|
58
|
+
|
|
59
|
+
Each item becomes one `llm-rubric` assertion weighted by `max_score`, in an
|
|
60
|
+
assert-set with threshold 0.7. A separate `skill-used` assertion must also
|
|
61
|
+
pass, so good output without loading the skill still fails.
|
|
62
|
+
|
|
63
|
+
Write descriptions a judge can check against the deliverable: an observable
|
|
64
|
+
property. Weight the items that would make a reviewer reject the
|
|
65
|
+
work. Name a specific tool or version only when the skill teaches it;
|
|
66
|
+
otherwise grade the property the tool provides.
|
|
67
|
+
|
|
68
|
+
### skill_use
|
|
69
|
+
|
|
70
|
+
| Value | Use |
|
|
71
|
+
| ---------------------- | ------------------------------------------------------------------------------------ |
|
|
72
|
+
| `"required"` (default) | The skill must load |
|
|
73
|
+
| `"optional"` | Out-of-lane scenario; loading is recorded, never failed |
|
|
74
|
+
| `"forbidden"` | Near miss: fails when this skill loads. Not on Grok, whose load evidence is too thin |
|
|
75
|
+
|
|
76
|
+
## Trigger scenarios
|
|
77
|
+
|
|
78
|
+
A trigger scenario measures whether a natural prompt loads this skill when
|
|
79
|
+
adjacent skills compete for it. `"install"` names other skills under the same
|
|
80
|
+
root to install beside it, or `"all"` installs every model-invocable one.
|
|
81
|
+
Alternatives must be real directories, not symlinks. A hidden skill is never an
|
|
82
|
+
alternative and cannot be the skill under test.
|
|
83
|
+
|
|
84
|
+
- Positive: `"required"` with the alternatives installed. It fails when the
|
|
85
|
+
agent routes elsewhere or loads nothing.
|
|
86
|
+
- Near miss: `"forbidden"` on a prompt that belongs to a neighbor or to no
|
|
87
|
+
skill. The skill-used rate counts the misfires.
|
|
88
|
+
|
|
89
|
+
Keep the checklist on the outcome the right lane should produce, so a near
|
|
90
|
+
miss that loads nothing but does the work badly still fails. A control run of
|
|
91
|
+
either installs nothing and requires nothing.
|
|
92
|
+
|
|
93
|
+
## What the judge sees
|
|
94
|
+
|
|
95
|
+
The agent's final message, plus every workdir file that differs from the
|
|
96
|
+
pre-run manifest. Deleted inputs, unreadable files, and non-regular files are
|
|
97
|
+
named rather than read. Agent config roots, `node_modules`, and tool caches are
|
|
98
|
+
skipped.
|
|
99
|
+
|
|
100
|
+
Each file is capped at 16,000 characters and the total at 64,000. Keep
|
|
101
|
+
fixtures small enough that the deliverable fits.
|
|
102
|
+
|
|
103
|
+
## Hidden skills
|
|
104
|
+
|
|
105
|
+
A skill with `disable-model-invocation: true` is invoke-only. The eval copy has
|
|
106
|
+
the flag stripped, and the task gains a leading
|
|
107
|
+
`Use the <skill> skill for this task.` The eval then measures behavior when
|
|
108
|
+
invoked.
|
|
109
|
+
|
|
110
|
+
## The workdir
|
|
111
|
+
|
|
112
|
+
Each trial runs in a fresh directory under the system temp dir, outside the
|
|
113
|
+
root, so the agent cannot reach the skill's source, its evals, or the
|
|
114
|
+
repository's agent guidance.
|
|
115
|
+
|
|
116
|
+
- The skill is installed where the harness discovers skills
|
|
117
|
+
(`.claude/skills/`, plus `.agents/skills/` on Codex, or `.grok/skills/` on
|
|
118
|
+
Grok), without its `evals/` directory.
|
|
119
|
+
- A symbolic link inside an installed skill is rejected.
|
|
120
|
+
- Sibling skills the skill links to, followed transitively, are installed
|
|
121
|
+
beside it, so links such as `../other/SKILL.md` resolve. A control run
|
|
122
|
+
installs none of them.
|
|
123
|
+
- A Codex run gets a private `CODEX_HOME` and `HOME` that hide the operator's
|
|
124
|
+
user-level skills, plugins, and global guidance.
|
package/docs/usage.md
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
# Usage
|
|
2
|
+
|
|
3
|
+
Every subcommand resolves one root, `--root <dir>` or the current directory.
|
|
4
|
+
`lint` also takes the root as a positional.
|
|
5
|
+
|
|
6
|
+
## Lint
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
skillcheck lint # lints the current repo
|
|
10
|
+
skillcheck lint ../other # lints another root
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Checks each `<root>/skills/<skill>/`:
|
|
14
|
+
|
|
15
|
+
- Frontmatter opens with `---` on line 1 and closes
|
|
16
|
+
- Keys are `name`, `description`, `disable-model-invocation` and nothing else,
|
|
17
|
+
each at most once
|
|
18
|
+
- `name` equals the directory name; `description` is non-empty
|
|
19
|
+
- `disable-model-invocation`, when present, is the bare YAML boolean `true`
|
|
20
|
+
- Relative links in the body resolve on disk; links in code spans and fenced
|
|
21
|
+
blocks are skipped
|
|
22
|
+
- No eval `task.md` names a skill from the root outside its inline input files
|
|
23
|
+
- Every eval `criteria.json` meets the
|
|
24
|
+
[criteria contract](scenarios.md#criteriajson)
|
|
25
|
+
|
|
26
|
+
Dot-directories under `skills/` (`.claude-plugin`) are skipped. Findings print
|
|
27
|
+
one per line, relative to the root, then a count. Exit 0 clean, 1 with
|
|
28
|
+
findings.
|
|
29
|
+
|
|
30
|
+
## Run
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
skillcheck run skills/<skill>/evals/<scenario>
|
|
34
|
+
skillcheck run <scenario-dir> --agent MODEL --judge MODEL --harness codex
|
|
35
|
+
skillcheck run <scenario-dir> --harness claude --max-turns 80
|
|
36
|
+
skillcheck run <scenario-dir> --harness grok
|
|
37
|
+
skillcheck run <scenario-dir> --trials 3 --agent-effort medium
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Materializes the scenario into a temp workdir per trial
|
|
41
|
+
([workdir](scenarios.md#the-workdir)), installs the skill, drives the agent,
|
|
42
|
+
and grades the files it wrote. Exit 0 means pass, 1 graded fail, 2 error. A
|
|
43
|
+
missing eval peer exits 2 with the exact `pnpm add` command. An errored test
|
|
44
|
+
is ungraded: it exits 2 and prints the provider's message.
|
|
45
|
+
|
|
46
|
+
- `--harness` defaults to `claude`. On `codex` and `grok`, omitting `--agent`
|
|
47
|
+
uses that CLI's default model.
|
|
48
|
+
- `--max-turns` and `--agent-effort low|medium|high|xhigh|max` work only with
|
|
49
|
+
`--harness claude`; other harnesses fail before the eval starts.
|
|
50
|
+
- `--harness grok` runs the locally installed, logged-in Grok Build CLI.
|
|
51
|
+
|
|
52
|
+
### Isolated runs
|
|
53
|
+
|
|
54
|
+
Run evals inside the image in [container/](../container/Dockerfile). On the
|
|
55
|
+
host the agent can read the operator's installed skills, plugins, global
|
|
56
|
+
guidance, and any file by absolute path, so `run` and `sweep` warn.
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
docker build -t skillcheck:<version> --build-arg SKILLCHECK_VERSION=<version> container
|
|
60
|
+
docker run --rm --env-file <owner-only env file> \
|
|
61
|
+
-v "$PWD:/srv/work:ro" -v "$PWD/.skillcheck:/srv/work/.skillcheck" \
|
|
62
|
+
-v <codex config.toml>:/etc/skillcheck/codex/config.toml:ro \
|
|
63
|
+
skillcheck:<version> run --root /srv/work skills/<skill>/evals/<scenario> --trials 3
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
- Start one container per `run` or `sweep`. Agents in one container share a
|
|
67
|
+
user, so a control must never share a container with a skill run.
|
|
68
|
+
- Pass Claude gateway auth through the env file ([auth](#auth)).
|
|
69
|
+
- Mount a Codex `config.toml` written for the run that names only the model
|
|
70
|
+
provider and its auth, never the operator's own. The `agent` user must be
|
|
71
|
+
able to read any token its auth command reads.
|
|
72
|
+
- Results record `isolated`. `summarize` refuses to mix isolated and host
|
|
73
|
+
rows, and `sweep` reruns host results.
|
|
74
|
+
|
|
75
|
+
### Trials
|
|
76
|
+
|
|
77
|
+
`--trials <k>` (default 1) runs the agent k times, each in its own workdir, all
|
|
78
|
+
graded in one promptfoo eval. Use 3 or more before calling a skill change
|
|
79
|
+
better or worse. A scenario's result aggregates its trials:
|
|
80
|
+
|
|
81
|
+
| Field | Meaning |
|
|
82
|
+
| ------------------------------- | ------------------------------------------------------------------------------------------------- |
|
|
83
|
+
| `pass` | pass^k: every trial passed. Exit 0 needs this |
|
|
84
|
+
| `passes`, `pass_rate` | Trials that passed, as a count and a fraction |
|
|
85
|
+
| `score` | Mean weighted checklist score (the assert-set, without skill-used) |
|
|
86
|
+
| `score_min` | Lowest trial score |
|
|
87
|
+
| `score_spread` | Highest minus lowest trial score |
|
|
88
|
+
| `skill_used`, `skill_used_rate` | Trials that loaded the skill, as a count and fraction; on a near-miss scenario these are misfires |
|
|
89
|
+
| `noisy` | Trials both passed and failed, or `score_spread` is at least 0.2 |
|
|
90
|
+
|
|
91
|
+
One errored trial, a result with fewer rows than trials, or a row without its
|
|
92
|
+
checklist and `skill-used` components makes the whole scenario an ERROR.
|
|
93
|
+
|
|
94
|
+
### Control
|
|
95
|
+
|
|
96
|
+
`--control` runs a scenario without the skill: nothing is installed, a hidden
|
|
97
|
+
skill's explicit invocation is dropped from the task, and `skill-used` never
|
|
98
|
+
fails. The result is `<name>--control.json` with `variant: "control"` in the
|
|
99
|
+
sidecar; `sweep --control` covers every scenario. `summarize` adds the mean
|
|
100
|
+
control score and the lift (skill score minus control score) per skill. A
|
|
101
|
+
scenario whose control passes every trial prints `NO LIFT`: it does not test
|
|
102
|
+
the skill.
|
|
103
|
+
|
|
104
|
+
### Judges
|
|
105
|
+
|
|
106
|
+
`--judge` takes a bare Claude model, graded through the Anthropic selection in
|
|
107
|
+
[auth](#auth), or a provider-qualified promptfoo id, passed through verbatim
|
|
108
|
+
and recorded in the scorecard's `judge_model`:
|
|
109
|
+
|
|
110
|
+
```sh
|
|
111
|
+
skillcheck run <scenario-dir> --judge openai:chat:gpt-5.6-sol --judge-effort high
|
|
112
|
+
skillcheck run <scenario-dir> --judge claude-opus-5-5 --judge-effort high --trials 3
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
`--judge-effort` takes `minimal|low|medium|high` for a provider-qualified
|
|
116
|
+
judge (`reasoning_effort`) and `low|medium|high|xhigh|max` for a Claude judge
|
|
117
|
+
(`effort`).
|
|
118
|
+
|
|
119
|
+
## Sweep
|
|
120
|
+
|
|
121
|
+
```sh
|
|
122
|
+
skillcheck sweep # scenarios without completed results
|
|
123
|
+
skillcheck sweep --all # rerun everything
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Runs every scenario under `<root>/skills/*/evals/*` and
|
|
127
|
+
`<root>/cli/*/skills/*/evals/*` sequentially. Exit 2 if anything errored, 1 if
|
|
128
|
+
anything failed, else 0.
|
|
129
|
+
|
|
130
|
+
- A scenario is skipped only when its completed result used the same agent
|
|
131
|
+
model and effort, judge model and effort, and trial count. Others rerun as
|
|
132
|
+
`RERUN`.
|
|
133
|
+
- `EVALS_CONCURRENCY` (default 4) parallelizes the trials of one scenario. To
|
|
134
|
+
spread scenarios, start several `skillcheck run` processes.
|
|
135
|
+
- A gateway transport drop surfaces as an ERROR, not a graded FAIL. Rerun
|
|
136
|
+
`sweep`; it picks up missing and ungraded results.
|
|
137
|
+
|
|
138
|
+
## Summarize
|
|
139
|
+
|
|
140
|
+
```sh
|
|
141
|
+
skillcheck summarize [--allow-mixed]
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Reduces `<root>/.skillcheck/results/*.json` into
|
|
145
|
+
`<root>/.skillcheck/scorecards/<UTC-date>.json`, one entry per scenario with
|
|
146
|
+
the [trial aggregate](#trials), run configuration, mean latency, and summed
|
|
147
|
+
tokens. It prints one row per skill and harness, then each noisy scenario.
|
|
148
|
+
|
|
149
|
+
- An existing scorecard for today merges on `(skill, scenario, harness)`; this
|
|
150
|
+
run's entries win. A same-date file that cannot be parsed stops the write.
|
|
151
|
+
- Rows for scenarios no longer in the tree are dropped, unless the root has no
|
|
152
|
+
skills tree.
|
|
153
|
+
- Non-result files and ungraded transport errors are skipped with a warning. A
|
|
154
|
+
rubric item whose judge call failed errors the trial. If a skipped file
|
|
155
|
+
matches an existing scorecard row, `summarize` fails and leaves the scorecard
|
|
156
|
+
unchanged, so an errored rerun cannot carry forward its old score.
|
|
157
|
+
|
|
158
|
+
## Provenance
|
|
159
|
+
|
|
160
|
+
Each successful run writes a `<name>.meta.json` sidecar next to its result:
|
|
161
|
+
|
|
162
|
+
```json
|
|
163
|
+
{
|
|
164
|
+
"skills_tree_sha": "<root repo HEAD at run time>",
|
|
165
|
+
"skill": "<skill directory name>",
|
|
166
|
+
"scenario": "<scenario directory name>",
|
|
167
|
+
"harness": "claude",
|
|
168
|
+
"agent_model": "claude-opus-5",
|
|
169
|
+
"agent_effort": "medium",
|
|
170
|
+
"judge_model": "claude-opus-5",
|
|
171
|
+
"judge_effort": null,
|
|
172
|
+
"trials": 3,
|
|
173
|
+
"agent_access": "online",
|
|
174
|
+
"isolated": true,
|
|
175
|
+
"aggregate": { "pass": false, "pass_rate": 0.6667, "score": 0.81, "...": "..." },
|
|
176
|
+
"ran_at": "<ISO timestamp>",
|
|
177
|
+
"tool_version": "<skillcheck version>"
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
`summarize` refuses to mix skills-tree revisions or run configurations within
|
|
182
|
+
a harness, retained rows included, and leaves the scorecard unchanged.
|
|
183
|
+
`--allow-mixed` overrides it: the top-level `skills_tree_sha` becomes `mixed`.
|
|
184
|
+
A result with no sidecar reduces as `unattested`.
|
|
185
|
+
|
|
186
|
+
## State
|
|
187
|
+
|
|
188
|
+
`<root>/.skillcheck/results/` is disposable; gitignore it.
|
|
189
|
+
`<root>/.skillcheck/scorecards/` is the history to keep. In the isolated image
|
|
190
|
+
`.skillcheck/` is a separate writable mount, so a separate evals repository can
|
|
191
|
+
pin the skill repository to a commit and keep the scorecards.
|
|
192
|
+
|
|
193
|
+
## Auth
|
|
194
|
+
|
|
195
|
+
| Variable | Effect |
|
|
196
|
+
| --------------------------------------------- | ----------------------------------------------------------------- |
|
|
197
|
+
| `ANTHROPIC_BASE_URL` + `ANTHROPIC_AUTH_TOKEN` | The claude agent and judge go through a gateway |
|
|
198
|
+
| None of the above | Falls back to the local Claude Code session |
|
|
199
|
+
| `ANTHROPIC_API_KEY` | Judge grades over `anthropic:messages:<model>` instead of the SDK |
|
|
200
|
+
| `CODEX_HOME` (default `~/.codex`) | Where the codex harness finds the local `codex` CLI login |
|
|
201
|
+
| `OPENAI_API_KEY` | Agent auth for codex when there is no local login |
|
|
202
|
+
| `OPENAI_API_KEY` + `OPENAI_BASE_URL` | A provider-qualified `--judge openai:…`, optionally via a gateway |
|
|
203
|
+
|
|
204
|
+
- A bare `--judge` model uses the Anthropic selection whatever the harness.
|
|
205
|
+
- The Claude agent loads project settings only, so an `apiKeyHelper` or `env`
|
|
206
|
+
block in `~/.claude/settings.json` never reaches it and the run fails with
|
|
207
|
+
`Not logged in`. Export `ANTHROPIC_BASE_URL` and `ANTHROPIC_AUTH_TOKEN`
|
|
208
|
+
instead.
|
|
209
|
+
- Run from a plain shell. Inside a Claude Code session, its `CLAUDECODE` and
|
|
210
|
+
`CLAUDE_CODE_*` variables leak into the agent.
|
package/package.json
CHANGED
|
@@ -1,6 +1,73 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uinaf/agent-plugin-stuff",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Linters and eval harness for agent plugins, skills, and rules",
|
|
5
|
+
"homepage": "https://github.com/uinaf/agent-plugin-stuff#readme",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/uinaf/agent-plugin-stuff/issues"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"author": "undefined is not a function LLC",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/uinaf/agent-plugin-stuff.git"
|
|
14
|
+
},
|
|
15
|
+
"bin": {
|
|
16
|
+
"plugincheck": "dist/plugincheck.js",
|
|
17
|
+
"rulecheck": "dist/rulecheck.js",
|
|
18
|
+
"skillcheck": "dist/cli.js"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"docs",
|
|
23
|
+
"README.md",
|
|
24
|
+
"LICENSE"
|
|
25
|
+
],
|
|
26
|
+
"type": "module",
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public",
|
|
29
|
+
"registry": "https://registry.npmjs.org/"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"verify": "vp run ready",
|
|
33
|
+
"verify:full": "vp run --no-cache ready",
|
|
34
|
+
"prepare": "vp config --no-agent",
|
|
35
|
+
"prepublishOnly": "pnpm run verify:full"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@anthropic-ai/claude-agent-sdk": "^0.3.281",
|
|
39
|
+
"@openai/codex-sdk": "^0.174.0",
|
|
40
|
+
"@types/node": "^26.6.2",
|
|
41
|
+
"@uinaf/oxlint-config": "1.0.5",
|
|
42
|
+
"promptfoo": "^0.127.0",
|
|
43
|
+
"vite": "catalog:",
|
|
44
|
+
"vite-plus": "catalog:"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"@anthropic-ai/claude-agent-sdk": "^0.3.281",
|
|
48
|
+
"@openai/codex-sdk": "^0.156.1 || ^0.157.0 || ^0.160.0 || ^0.161.0 || ^0.163.0 || ^0.164.0 || ^0.165.0 || ^0.166.0 || ^0.167.0 || ^0.169.0 || ^0.170.0 || ^0.171.0 || ^0.172.0 || ^0.174.0",
|
|
49
|
+
"promptfoo": "^0.123.1 || ^0.124.0 || ^0.125.0 || ^0.126.0 || ^0.127.0"
|
|
50
|
+
},
|
|
51
|
+
"peerDependenciesMeta": {
|
|
52
|
+
"@anthropic-ai/claude-agent-sdk": {
|
|
53
|
+
"optional": true
|
|
54
|
+
},
|
|
55
|
+
"@openai/codex-sdk": {
|
|
56
|
+
"optional": true
|
|
57
|
+
},
|
|
58
|
+
"promptfoo": {
|
|
59
|
+
"optional": true
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"devEngines": {
|
|
63
|
+
"runtime": {
|
|
64
|
+
"name": "node",
|
|
65
|
+
"version": "^24.11.0 || >=26.0.0",
|
|
66
|
+
"onFail": "error"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"engines": {
|
|
70
|
+
"node": ">=24"
|
|
71
|
+
},
|
|
72
|
+
"packageManager": "pnpm@12.26.0"
|
|
73
|
+
}
|