Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/39278-scenarios-skill-evals-cases-from-checkout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@objectstack/scenarios': patch
---

docs(scenarios): `skill-evals --skills-from VERSION` takes its cases from the checkout

Clause-②: no
Metadata-protocol: none

The `@objectstack/skills` package no longer carries each skill's `evals/` directory, so a round over a published version grades that version's bundles against the eval cases (and case files) in the repository checkout's `skills/`. The README's `--skills-from` lines say so, and `round.json` records both trees. A round over the workspace is unchanged.
15 changes: 15 additions & 0 deletions .changeset/39278-skills-package-no-evals.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
'@objectstack/skills': patch
---

fix(skills): the published skills package no longer carries each skill's `evals/` directory

Clause-②: no
Metadata-protocol: none

`@objectstack/skills` shipped every skill's `evals/` directory: the cases the maintainers score a skill with, each holding its expected answer and the spellings an answer must not contain. No agent loads them, and the eval runner itself withholds the directory from the skill it grades, so an installed skill held a folder the measured skill never had. From this release `dist/skills/` is the repository's `skills/**` without `skills/SKILL_NAME/evals/**`.

- **What you see after an upgrade.** Re-running the sync (`npx skills@1.7.2 experimental_sync --agent claude-code --copy -y`) or `os skills` installs skills with no `evals/` directory. Every `SKILL.md`, `references/`, `rules/`, `guides/` and `contracts/` file is unchanged. An `evals/` directory a previous install left in your agent's skills directory is safe to delete.
- **Nothing reads them.** No `SKILL.md` points into `evals/`, and the CLI, the scaffolder and the MCP server read nothing from it.
- **The `next` channel is unchanged.** `npx skills add objectstack-ai/objectstack/skills` copies each skill's directory from the repository's `main`, `evals/` included.
- **The build proves it.** The package's copy step compares `dist/skills/**` to `skills/**` minus those directories, file for file and byte for byte, and refuses a tree that holds a file under a skill's `evals/`; `prepublishOnly` runs the same comparison.
2 changes: 1 addition & 1 deletion content/docs/ai/skills-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ skills/objectstack-{domain}/
├── references/ # generated & optional — present only when the skill maps to Zod sources
│ └── _index.md # pointers into @objectstack/spec Zod sources
├── rules/ # optional — detailed implementation rules
└── evals/ # optional — AI comprehension test cases
└── evals/ # optional — the maintainers' eval cases; repository only, not in @objectstack/skills
```

`SKILL.md` is the only required file. The `references/_index.md` index is generated by `packages/spec/scripts/build-skill-references.ts` and points into the published `@objectstack/spec` schemas in `node_modules` — skills never bundle copies of the schemas, so they stay version-aligned automatically. Skills with no mapped Zod sources (such as Formula) ship without a `references/` directory at all.
Expand Down
10 changes: 5 additions & 5 deletions content/docs/ai/skills.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ Traditional AI code assistants generate generic code. They don't understand:

## Skill Architecture

Each skill ships `SKILL.md` plus a generated `references/` index, and richer skills layer optional `rules/` and `evals/` directories on top — up to four distinct parts. Only `SKILL.md` is required:
Each skill ships `SKILL.md` plus a generated `references/` index, and richer skills layer an optional `rules/` directory on top. In the repository a skill also keeps an `evals/` directory, the cases its maintainers score it with; the `@objectstack/skills` package leaves that directory out, so an installed skill holds up to three of these four parts. Only `SKILL.md` is required:

| Layer | File | Required | Purpose |
| :--- | :--- | :--- | :--- |
| **Overview** | `SKILL.md` | Yes | High-level guide with decision trees and quick-start examples |
| **References** | `references/_index.md` | Generated | Pointers into the published `@objectstack/spec` Zod sources (present in every skill except Formula) |
| **Rules** | `rules/*.md` | Optional | Detailed implementation rules with ✅ correct / ❌ incorrect code examples (today: Data, Platform, Query) |
| **Evaluations** | `evals/*.md` | Optional | Test cases to validate AI assistant understanding (mostly planned — `objectstack-automation` ships the first worked example; other skills' `evals/` directories are still placeholders) |
| **Evaluations** | `evals/` (cases in `*.json`) | Repository only | The cases the maintainers score the skill with: a prompt, the expected answer and the assertions an answer is graded on. Not in the `@objectstack/skills` package |

### SKILL.md — The Entry Point

Expand Down Expand Up @@ -147,8 +147,8 @@ The same package also carries **`objectui`**, the skill for the `@object-ui/*` R
packages rather than for metadata: rendering JSON schemas with `SchemaRenderer`, writing
renderer plugins, data-source integration, and testing, i18n and mobile layout in a React host.
Its source is [`skills/objectui/`](https://github.com/objectstack-ai/objectstack/tree/main/skills/objectui):
a `SKILL.md` entry point, `rules/` the agent always applies, `guides/` it loads per task, and an
`evals/` prompt per guide that catches regressions in agent behaviour. Its frontmatter defers
a `SKILL.md` entry point, `rules/` the agent always applies, `guides/` it loads per task, and, in
the repository only, an `evals/` file per guide that catches regressions in agent behaviour. Its frontmatter defers
data modelling, APIs, automation, formulas and agents to the domain skills above, so the two
coexist in one agent. It installs and updates with the rest of `@objectstack/skills`.

Expand Down Expand Up @@ -249,7 +249,7 @@ Each skill maps directly to an ObjectStack protocol domain. The schema skill tea

### 4. Testable

The `evals/` directory in each skill is reserved for test cases that validate an AI assistant correctly understands the protocol — analogous to test suites for runtime code, but for AI comprehension. Most skills' `evals/` directories are still placeholders; `objectstack-automation` ships the first worked example (`evals/approvals/test-revise-loop.md`).
The `evals/` directory beside each skill in the repository holds test cases that validate an AI assistant correctly understands the protocol — analogous to test suites for runtime code, but for AI comprehension. Like a test suite, it stays in the repository: the `@objectstack/skills` package you install leaves it out, and the maintainers run the cases against each skill with `skill-evals` from a checkout.

---

Expand Down
12 changes: 8 additions & 4 deletions packages/qa/scenarios/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ wrapper, with no change to the runner.

## Running the published skills' eval cases — `skill-evals`

Every published skill bundle carries eval cases (`skills/BUNDLE/evals/*.json`: a `prompt`, an `expected_output` and
Every skill bundle in `skills/` carries eval cases (`skills/BUNDLE/evals/*.json`: a `prompt`, an `expected_output` and
`assertions.must_contain` / `must_contain_any` / `must_not_contain`). `skill-evals` sends each case to the local Claude Code login twice,
once with the bundle installed and once without, and grades each answer by the case's own tokens. A trigger case
asks instead whether the skill was loaded, and runs with the bundle installed beside its competitors only. It runs from this checkout only. It is not part of the published `bin` or `exports`, not a CI job and not a merge gate. The cases are
Expand All @@ -1037,7 +1037,7 @@ pnpm install && pnpm --filter '@objectstack/scenarios^...' build # the runner
pnpm --filter @objectstack/scenarios skill-evals --dry-run # the plan and the argv; no login read, no model call
pnpm --filter @objectstack/scenarios skill-evals # every case × 2 arms
pnpm --filter @objectstack/scenarios skill-evals --skills objectstack-query --repeats 3 # a touched skill
pnpm --filter @objectstack/scenarios skill-evals --skills-from 18.5.0 # a published @objectstack/skills version's bundles and cases
pnpm --filter @objectstack/scenarios skill-evals --skills-from 18.5.0 # a published @objectstack/skills version's bundles, on this checkout's cases
pnpm --filter @objectstack/scenarios skill-evals --skills objectstack-query --triggers-only # its trigger cases alone
pnpm --filter @objectstack/scenarios skill-evals --skills objectstack-query,objectstack-ask --triggers-only # both installed in every trigger turn
pnpm --filter @objectstack/scenarios skill-evals --case objectstack-ai/skills-tools-knowledge#6 --repeats 10 # one case, both arms
Expand Down Expand Up @@ -1092,11 +1092,15 @@ pnpm --filter @objectstack/scenarios skill-evals --self-test # the runner's o
init line misses an installed bundle is `invalid`. `--trigger-field own` installs the case's bundle alone, as every
round recorded before did. `round.json` records `triggerField`, the summary header names it, and `--regrade DIR`
keeps it (the flag is refused there). Behaviour cases keep one bundle, so their two arms still differ only in it.
- **`--skills-from VERSION`**: the bundles are the published version's, packed from npm; the cases are always this
checkout's `skills/BUNDLE/evals/`, for the bundles that version holds, because the published package leaves each
skill's `evals/` out. A case's `files` come from the checkout too. `round.json` records both (`skills.source`,
`skills.cases`), and a bundle of this checkout the version does not hold runs no case.
- **`--triggers-only`**: the selected bundles' trigger cases alone, on the with-skill arm, for a change that only
touches when a skill loads (its `description`). The summary is the trigger section alone, and `round.json` records
`scope.triggersOnly`, so `--regrade DIR` keeps that scope. A bundle `--skills` names with no trigger case is
installed as a competitor while another named bundle has one; alone, or under `--trigger-field own`, it is refused
(a published version before trigger cases has none). The flag is refused beside `--regrade` or `--self-test`.
installed as a competitor while another named bundle has one; alone, or under `--trigger-field own`, it is refused.
The flag is refused beside `--regrade` or `--self-test`.
`--dry-run` prints the reduced plan, and `--skills-from VERSION` runs it on the published bundles.
- **`--case KEY[,KEY]`**: the named cases alone, for an acceptance round on one or two cases. A key is the case's key
as the summary and each record print it, `BUNDLE/FILE_STEM#ID` (`objectstack-query/filters-pagination-search#3`):
Expand Down
8 changes: 5 additions & 3 deletions packages/qa/scenarios/src/skill-evals/arms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,13 @@ export function prepareArmWorkdir(arm: Arm, bundles: string | readonly string[],
* Place a case's `files` in a turn's project: each entry, a path under the
* bundle's `evals/files/` (the reader has refused any other), is copied to the
* same path below `evals/files/` inside `cwd`, a directory whole. Called for
* both arms alike, so the arms still differ only in the bundle.
* both arms alike, so the arms still differ only in the bundle. `casesRoot` is
* the tree the cases were read from, which is not the bundles' tree on a round
* over a published version.
*/
export function placeCaseFiles(files: readonly string[] | undefined, bundle: string, skillsRoot: string, cwd: string): void {
export function placeCaseFiles(files: readonly string[] | undefined, bundle: string, casesRoot: string, cwd: string): void {
for (const f of files ?? []) {
const below = f.split('/').slice(2).join('/');
cpSync(join(skillsRoot, bundle, f), join(cwd, below), { recursive: true, dereference: true });
cpSync(join(casesRoot, bundle, f), join(cwd, below), { recursive: true, dereference: true });
}
}
34 changes: 24 additions & 10 deletions packages/qa/scenarios/src/skill-evals/cases.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.

/**
* The published skills' eval cases, read from a skills root: the workspace's
* `skills/` tree, or the `dist/skills/` of a packed `@objectstack/skills`
* version. Each bundle is one directory holding a `SKILL.md`; its cases are the
* `evals/*.json` files beside it, in the shape every one of them already uses:
* The published skills' eval cases. The bundles come from a skills root: the
* workspace's `skills/` tree, or the `dist/skills/` of a packed
* `@objectstack/skills` version. Each bundle is one directory holding a
* `SKILL.md`. The cases come from a cases root, which is always a checkout's
* `skills/` tree: the published package carries no `evals/`, so a packed
* version's bundles are graded on this checkout's cases for the bundles of the
* same name. A bundle's cases are the `evals/*.json` files under its directory
* in the cases root, in the shape every one of them already uses:
*
* { "skill_name": BUNDLE, "evals": [ { "id", "prompt", "expected_output",
* "files": [], "assertions": { "must_contain": [..], "must_not_contain": [..] } } ] }
Expand Down Expand Up @@ -74,7 +78,10 @@ export interface SkillEvalRefusal {
}

export interface SkillEvalCatalog {
/** Where the bundles are read from. */
root: string;
/** Where the cases and their `evals/files/` are read from; `root` itself on a workspace round. */
casesRoot: string;
/** Every bundle directory under the root (a `SKILL.md` beside it), sorted. */
bundles: string[];
/**
Expand Down Expand Up @@ -253,10 +260,17 @@ export function parseEvalFile(bundle: string, file: string, text: string): { cas
return { cases, refusals };
}

/** Every bundle under `root` and every case its `evals/*.json` hold. */
export function loadSkillEvalCatalog(root: string): SkillEvalCatalog {
/**
* Every bundle under `root`, and every case the `evals/*.json` of the same
* bundle hold under `casesRoot` (absent ⇒ `root`: bundles and cases from one
* tree). A bundle of `casesRoot` that `root` does not hold contributes no case.
*/
export function loadSkillEvalCatalog(root: string, casesRoot: string = root): SkillEvalCatalog {
if (!existsSync(root) || !statSync(root).isDirectory()) {
return { root, bundles: [], unlistedBundles: [], cases: [], refusals: [{ path: root, message: 'is not a directory of skill bundles' }] };
return { root, casesRoot, bundles: [], unlistedBundles: [], cases: [], refusals: [{ path: root, message: 'is not a directory of skill bundles' }] };
}
if (!existsSync(casesRoot) || !statSync(casesRoot).isDirectory()) {
return { root, casesRoot, bundles: [], unlistedBundles: [], cases: [], refusals: [{ path: casesRoot, message: 'is not a directory of skill bundles to read cases from' }] };
}
const bundles = readdirSync(root, { withFileTypes: true })
.filter((d) => d.isDirectory() && existsSync(join(root, d.name, 'SKILL.md')))
Expand All @@ -265,7 +279,7 @@ export function loadSkillEvalCatalog(root: string): SkillEvalCatalog {
const cases: SkillEvalCase[] = [];
const refusals: SkillEvalRefusal[] = [];
for (const bundle of bundles) {
const dir = join(root, bundle, 'evals');
const dir = join(casesRoot, bundle, 'evals');
if (!existsSync(dir)) continue;
const files = readdirSync(dir, { withFileTypes: true })
.filter((d) => d.isFile() && d.name.endsWith('.json'))
Expand All @@ -275,7 +289,7 @@ export function loadSkillEvalCatalog(root: string): SkillEvalCatalog {
for (const file of files) {
const r = parseEvalFile(bundle, file, readFileSync(join(dir, file), 'utf8'));
for (const c of r.cases) {
const missingFile = (c.files ?? []).find((f) => !existsSync(join(root, bundle, f)));
const missingFile = (c.files ?? []).find((f) => !existsSync(join(casesRoot, bundle, f)));
if (missingFile) refusals.push({ path: `${bundle}/evals/${file}: ${c.key}`, message: `\`files\` names \`${missingFile}\`, which is not in the bundle` });
else mine.push(c);
}
Expand All @@ -289,7 +303,7 @@ export function loadSkillEvalCatalog(root: string): SkillEvalCatalog {
cases.push(...mine);
}
const unlistedBundles = bundles.filter((b) => notUserInvocable(readFileSync(join(root, b, 'SKILL.md'), 'utf8')));
return { root, bundles, unlistedBundles, cases, refusals };
return { root, casesRoot, bundles, unlistedBundles, cases, refusals };
}

/** The `SKILL.md` frontmatter sets `user-invocable: false`. Pure over its input. */
Expand Down
Loading
Loading