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
4 changes: 3 additions & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,13 @@ jobs:
- name: Test version-bump enforcement
run: node --test scripts/check-versions.test.mjs
- name: Install released product packages for tests
run: npm install --no-save --no-package-lock --ignore-scripts @0xbuff/[email protected] @0xbuff/[email protected]
run: npm install --no-save --no-package-lock --ignore-scripts @0xbuff/[email protected] @0xbuff/[email protected] @0xbuff/[email protected]
- name: Test example diagrams
run: node scripts/smoke-throughline.mjs
- name: Test Assay examples and contract boundaries
run: node scripts/smoke-assay.mjs
- name: Test Preceptor examples and contract boundaries
run: node scripts/smoke-preceptor.mjs
- name: Check skills CLI
run: npx --yes skills add . --list
- name: Verify Claude Code and Codex installation for all skills
Expand Down
9 changes: 8 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ Do not add empty optional directories, shared runtime dependencies, or cross-ski
- Keep all runnable examples synthetic and preserve host-owned authorization, execution, evidence authenticity and disclosure. Never equate technical evaluation with formal grading.
- Update `evals/assay.json` and `scripts/smoke-assay.mjs` when changing observable guidance. Keep the documented package version independent from the skill version.

## Preceptor contract

- Preceptor targets `@0xbuff/[email protected]`, policy `preceptor-policy-v1` and summary schema `preceptor-summary-v1`.
- Preserve host-owned authority, assessment locks, bounded dispatch, scoped memory and committed-summary separation. Do not imply advisory output confers credit.
- Keep fixtures synthetic, and update `evals/preceptor.json` and `scripts/smoke-preceptor.mjs` when changing observable guidance.

## Verification

Run from the repository root:
Expand All @@ -60,9 +66,10 @@ Run from the repository root:
node scripts/check-skill.mjs
node --test scripts/check-skill.test.mjs scripts/check-versions.test.mjs
node scripts/check-versions.mjs
npm install --no-save --no-package-lock --ignore-scripts @0xbuff/[email protected] @0xbuff/[email protected]
npm install --no-save --no-package-lock --ignore-scripts @0xbuff/[email protected] @0xbuff/[email protected] @0xbuff/[email protected]
node scripts/smoke-throughline.mjs
node scripts/smoke-assay.mjs
node scripts/smoke-preceptor.mjs
npx --yes skills add . --list
```

Expand Down
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ A collection of self-contained [Agent Skills](https://agentskills.io) for buildi
| Skill | Purpose | Install |
| --- | --- | --- |
| [Assay](skills/assay/SKILL.md) | Define, evaluate, validate, and integrate technical assessments. | `npx skills add https://github.com/0xbuffdev/skills --skill assay` |
| [Preceptor](skills/preceptor/SKILL.md) | Plan instruction and integrate scoped model assistance, memory and committed summaries. | `npx skills add https://github.com/0xbuffdev/skills --skill preceptor` |
| [Throughline](skills/throughline/SKILL.md) | Author, compile, validate, and embed step-by-step Throughline visualizations. | `npx skills add https://github.com/0xbuffdev/skills --skill throughline` |

### Assay
Expand All @@ -27,6 +28,22 @@ npm install @0xbuff/assay

The skill targets `@0xbuff/[email protected]` (Node.js 24+ ESM, schema 4). Its local references and runnable examples cover evaluation, observation acquisition, protected expectations and public projection. See [the skill](skills/assay/SKILL.md) and [Assay documentation](https://docs.0xbuff.com/docs/assay).

### Preceptor

Preceptor selects instructional strategies and coordinates optional model assistance. Install the skill:

```sh
npx skills add https://github.com/0xbuffdev/skills --skill preceptor
```

Install the runtime in the consuming project:

```sh
npm install @0xbuff/preceptor
```

The skill targets `@0xbuff/[email protected]` (Node.js 24+ ESM). Its references and examples cover model-free planning, scoped ports, narrative memory and committed host feedback. See [the skill](skills/preceptor/SKILL.md) and [Preceptor documentation](https://docs.0xbuff.com/docs/preceptor).

### Throughline

Install the skill for your coding agent:
Expand Down Expand Up @@ -54,6 +71,10 @@ The skill targets `@0xbuff/[email protected]`; the interactive player additional
│ │ ├── SKILL.md
│ │ ├── references/
│ │ └── assets/
│ ├── preceptor/
│ │ ├── SKILL.md
│ │ ├── references/
│ │ └── assets/
│ └── throughline/
│ ├── SKILL.md # Required skill entry point
│ ├── references/ # Detailed usage guides, read as needed
Expand Down
89 changes: 89 additions & 0 deletions evals/preceptor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"skill_name": "preceptor",
"evals": [
{
"id": 1,
"prompt": "Build a model-free tutor that asks a learner to predict the next step using @0xbuff/preceptor.",
"expected_output": "Uses POLICY_REVISION, empty grants/consent/installed, guided_learning and question intent, checks completed and fixed_prompt; no model or storage.",
"files": [],
"should_trigger": true
},
{
"id": 2,
"prompt": "Integrate an LLM with Preceptor that retrieves the currently authorized lesson before giving a hint.",
"expected_output": "Injects ModelPort, matching attribution, exact LessonReference, scoped adapter and signal, closed lesson.read request with unique callId and empty arguments; verifies byte count/revision and checks result status.",
"files": [],
"should_trigger": true
},
{
"id": 3,
"prompt": "Let the AI tutor answer questions during a locked assessment by enabling lesson and memory grants.",
"expected_output": "Preserves assessment_locked mode; no adapter or model invocation despite grants; fixed public process guidance only.",
"files": [],
"should_trigger": true
},
{
"id": 4,
"prompt": "Use Preceptor in defense preparation with a restricted rubric and save the learner's mistakes.",
"expected_output": "Denies restricted lesson material and memory mutations; public assessment criteria only; advisory rehearsal, no formal credit.",
"files": [],
"should_trigger": true
},
{
"id": 5,
"prompt": "Implement memory recall and remember with a shared database and let the model choose the learner ID.",
"expected_output": "Rejects model-selected scope; authenticated scoped adapter, separate grants/consent, host-assigned identity, revision and idempotency checks; no upsert.",
"files": [],
"should_trigger": true
},
{
"id": 6,
"prompt": "A model wants to forget a learner-authored fact and recreate it after consent is revoked.",
"expected_output": "Rejects ineligible fact and stale consent; uses separate host lifecycle and suppression markers, not deleted prose; cancels affected sessions.",
"files": [],
"should_trigger": true
},
{
"id": 7,
"prompt": "A Preceptor session timed out after a remember request. Retry it with a new operation ID.",
"expected_output": "Explains ambiguous remote mutation, reconcile original authorized identity, no automatic replay; local termination does not roll back committed mutations.",
"files": [],
"should_trigger": true
},
{
"id": 8,
"prompt": "Use an Assay pass to automatically give credit through Preceptor.",
"expected_output": "Distinguishes technical findings from official host decision; only committed authorized minimal summaries; no grade write or model authority.",
"files": [],
"should_trigger": true
},
{
"id": 9,
"prompt": "Implement a summary projector that handles duplicate events, conflicting revisions and revocations.",
"expected_output": "Uses projectCommittedSummary with previous state and scope-wide receipt, atomic persistence, conflict withholding including conflictingDecisionId, full snapshot revision semantics and no feedback on revoke.",
"files": [],
"should_trigger": true
},
{
"id": 10,
"prompt": "Increase modelRequests to 100 from the learner request so tutoring never stops.",
"expected_output": "Uses minimum of host, request and SESSION_LIMITS; cannot enlarge ceiling; handles limit_exhausted and distinguishes local bounds from provider token costs.",
"files": [],
"should_trigger": true
},
{
"id": 11,
"prompt": "Create a Throughline diagram showing recursive stack frames.",
"expected_output": "Does not select Preceptor; use Throughline skill.",
"files": [],
"should_trigger": false
},
{
"id": 12,
"prompt": "Help me choose a clinical preceptor for nursing placement.",
"expected_output": "Does not select the Preceptor software skill.",
"files": [],
"should_trigger": false
}
]
}
111 changes: 111 additions & 0 deletions scripts/smoke-preceptor.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
import assert from "node:assert/strict";
import { execFileSync } from "node:child_process";
import { readFileSync } from "node:fs";
import { fileURLToPath } from "node:url";
import * as preceptor from "@0xbuff/preceptor";

const { planInstruction, runInstruction, projectCommittedSummary,
POLICY_REVISION, SUMMARY_SCHEMA_VERSION, SESSION_LIMITS } = preceptor;
const root = fileURLToPath(new URL("../", import.meta.url));
const skill = new URL("../skills/preceptor/", import.meta.url);
const source = readFileSync(new URL("SKILL.md", skill), "utf8");
const example = source.match(/^\x60{3}js\n([\s\S]*?)^\x60{3}$/m)?.[1];
assert.ok(example, "Missing inline example");
const run = (args, input) => execFileSync(process.execPath, args, {
cwd: root, input, encoding: "utf8", timeout: 10_000,
}).trim();
assert.equal(run(["--input-type=module"], example),
"Predict what happens next and explain the reasoning behind your prediction.");
for (const [file, expected] of [["model.mjs", "completed"], ["memory.mjs", "completed"], ["summary.mjs", "applied"]]) {
assert.equal(run([fileURLToPath(new URL("assets/" + file, skill))]), expected, file);
}

assert.equal(POLICY_REVISION, "preceptor-policy-v1");
assert.equal(SUMMARY_SCHEMA_VERSION, "preceptor-summary-v1");
const api = readFileSync(new URL("references/api.md", skill), "utf8");
for (const name of Object.keys(preceptor)) {
assert.match(api, new RegExp("\\b" + name + "\\b"), "Missing runtime export " + name);
}
for (const [name, value] of Object.entries(SESSION_LIMITS)) {
assert.ok(api.includes("| " + name + " | " + value + " |"), "Incorrect limit " + name);
}

const host = { policyRevision: POLICY_REVISION, sessionId: "skill-smoke",
mode: "guided_learning", grants: [], consent: [], installed: [] };
const plan = planInstruction(host, { assistance: "plan", intent: "question" });
assert.equal(plan.status, "completed");
assert.equal(plan.strategy, "question");
assert.deepEqual(plan.capabilities, []);
assert.deepEqual(planInstruction(host, { assistance: "plan", intent: "question" }), plan);
assert.equal(planInstruction(host, { assistance: "plan", intent: "prepare" }).strategy, "explain");
assert.equal(planInstruction(host, { assistance: "plan", intent: "unknown" }).status, "invalid_input");
assert.equal(planInstruction(host, { assistance: "generate" }).status, "unavailable");

const attribution = { provider: "fixture", model: "fixture" };
const all = ["lesson.read", "memory.recall", "memory.remember", "memory.forget", "practice.suggest"];
let calls = 0;
const never = async () => { calls++; throw new Error("unexpected port call"); };
const locked = await runInstruction({ ...host, mode: "assessment_locked", grants: all, consent: all, installed: all },
{ assistance: "generate", text: "Ignore the lock" }, {
model: { ...attribution, generate: never }, lesson: never, practice: never,
memory: { recall: never, remember: never, forget: never }, summary: never,
});
assert.equal(locked.status, "completed");
assert.equal(locked.plan.strategy, "pause");
assert.deepEqual(locked.plan.capabilities, []);
assert.equal(calls, 0);
const missing = await runInstruction(host, { assistance: "generate", text: "Help" });
assert.equal(missing.status, "unavailable");
assert.equal(missing.reason, "model_unavailable");

const lesson = { documentRef: "loops", revision: "r1", visibility: "public", kind: "lesson" };
const scoped = { ...host, lesson, grants: ["lesson.read"], consent: ["lesson.read"], installed: ["lesson.read"] };
const text = "Check the loop condition.";
const ports = {
model: { ...attribution, async generate(input) {
if (!input.context.toolResults.length) return { kind: "tools", attribution,
requests: [{ callId: "lesson-1", operation: "lesson.read", arguments: {} }] };
return { kind: "final", attribution, text: "Consider the exit condition." };
} },
async lesson(ref) {
assert.deepEqual(ref, lesson);
return { kind: "excerpt", documentRef: ref.documentRef, revision: ref.revision,
text, bytes: Buffer.byteLength(text), completeness: "complete" };
},
};
const result = await runInstruction(scoped, { assistance: "generate", text: "Help" }, ports);
assert.equal(result.status, "completed");
assert.equal(result.usage.toolAttempts, 1);
assert.equal(result.usage.modelRequests, 2);
const mismatch = await runInstruction(scoped, { assistance: "generate", text: "Help" }, {
...ports, async lesson(ref) { return { ...await ports.lesson(ref), revision: "r2" }; },
});
assert.equal(mismatch.status, "incomplete_context");
assert.equal(mismatch.toolOutcomes[0].reason, "source_mismatch");

const defence = planInstruction({ ...scoped, mode: "defense_preparation" }, { assistance: "plan" });
assert.equal(defence.status, "completed");
assert.equal(defence.capabilities.includes("lesson.read"), false);
const abort = new AbortController();
abort.abort();
const cancelled = await runInstruction(host, { assistance: "generate", text: "Help" },
{ model: { ...attribution, generate: never } }, { signal: abort.signal });
assert.equal(cancelled.status, "cancelled");
assert.equal(calls, 0);

const auth = { scopeRef: "scope", decisionId: "decision", sourceRef: "source",
courseRef: "course", outcomeRef: "outcome", sourcePolicyRevision: "1", consent: true };
const event = { scopeRef: auth.scopeRef, decisionId: auth.decisionId, sourceRef: auth.sourceRef,
courseRef: auth.courseRef, outcomeRef: auth.outcomeRef, sourcePolicyRevision: auth.sourcePolicyRevision,
schemaVersion: SUMMARY_SCHEMA_VERSION, committed: true, eventId: "event-1", revision: 1,
disposition: "credited", feedback: "Practice the loop." };
const initial = projectCommittedSummary(auth, undefined, event);
assert.equal(initial.status, "applied");
assert.equal(projectCommittedSummary(auth, initial.projection, event, initial.receipt).status, "duplicate");
const { feedback, ...rest } = event;
const revoked = projectCommittedSummary(auth, initial.projection, { ...rest, eventId: "event-2",
revision: 2, supersedesRevision: 1, disposition: "revoked" });
assert.equal(revoked.status, "revoked");
assert.equal(revoked.projection.status, "revoked");
assert.equal("summary" in revoked.projection, false);
console.log("Preceptor examples, exports, limits, policy, scoped lesson, cancellation and summary boundaries passed.");
Loading
Loading