Compile skill into deterministic harness

VerifiedSafe

Compiles a stable procedural skill into a deterministic script and shrinks SKILL.md to a thin bootloader, partitioning work across code, LLM, and human.

Sby Skills Guide Bot
DevelopmentAdvanced
10/31/2026
Claude CodeCursor
#skill-compilation#agent-skills#refactoring#code-generation#harness-testing

Recommended for

Automated summary

A meta-skill that turns a stabilized agent procedure into a deterministic script under scripts/agent_skills/ and reduces the original SKILL.md to a thin bootloader.

Strengths

  • An explicit readiness gate refuses to compile unstable or judgment-heavy procedures and names the failing condition.
  • A Code / LLM / Human partition table must be produced and shown to the user before any code is written, making boundary decisions visible.
  • The harness requirements are concrete: standard library only, repo root resolved relative to the script, read-only by default, `--json` output, and a `needs_llm_judgment` marker instead of guessing.
  • The workflow enforces behavioral parity evidence through a vitest spec, followed by the repo's sync, frontmatter, and lint checks.

Limitations

  • Assumes a specific repository layout (`.agent/`, `scripts/`, `.cursor/skills/`) and internal scripts (sync_assistant_trees.py, check_agent_frontmatter.py) that are not included.
  • No automated way to judge stability: the agent must supply the evidence (repeated transcripts, an inventory row) and the call remains subjective.
  • The full partition rules live in an external reference file (`.agent/SKILL_COMPILATION.md`), so the stated criteria are not self-contained.
When to use it

Use it when a procedural skill has been run the same way many times and you want the mechanical steps moved into a tested script rather than re-derived by the model each run.

When not to use it

Avoid it for skills that are mostly judgment (security review, systematic debugging, subagent review) or whose procedure still shifts between runs.

Security analysis

Safe
Quality score87/100

The content is a meta-skill describing how to convert a repetitive prose skill into a deterministic helper script. It contains no destructive commands, no credential or token handling, no outbound network/exfiltration, no encoded payloads, and no attempts to override the auditor or the host agent's safety behavior. The only executable surface is standard local test/lint/sync commands and code generation constrained to the repository, with explicit prohibitions on give the harness commit/push/tag or external-export authority. This is normal, conservative engineering guidance.

Findings
  • •Skill directs the agent to author new scripts under `scripts/agent_skills/` and execute repo-local commands (`npm run test:run`, `npm run lint`, `python scripts/sync_assistant_trees.py`, `python scripts/ci/check_agent_frontmatter.py`). This is bounded developer tooling: stdlib-only, repo-relative paths, read-only by default, and it explicitly forbids the generated harness from commit/push/tag or external export. No network fetches, no secret handling, no destructive paths, no obfuscation.
  • •References several repository-specific governance documents (`.agent/SKILL_COMPILATION.md`, `.agent/SKILL_INVENTORY.md`, `.agent/SKILL_CHANGE_AST10_REVIEW.md`) without including them; an agent following the skill blindly in a repo lacking those files would fail or improvise. Availability/portability concern rather than a safety one.
How this analysis is made

Examples

Compile a stable skill
The `.cursor/skills/release-notes/SKILL.md` procedure has run identically for the last eight releases. Compile it into a script harness under scripts/agent_skills/ — show me the Code/LLM/Human partition table before writing any code.
Check the readiness gate
Does `.cursor/skills/changelog-sync/SKILL.md` pass the compile readiness gate? If not, tell me which condition fails and what evidence I still need to gather.
Prove parity after compiling
Add a vitest spec for scripts/agent_skills/check-type-sync.mjs asserting it matches the old prose procedure on a realistic fixture, then run npm run test:run plus the sync and frontmatter checks.

/compile-skill — Lower a stable skill into a deterministic harness

Use when a procedural skill has crystallized and agents keep paying the reasoning tax to re-derive the same steps. Compiles the fixed parts into a script under scripts/agent_skills/ and shrinks the skill to a thin bootloader. Pattern and partition rules: .agent/SKILL_COMPILATION.md.

Inputs

  • Target skill: .cursor/skills/<name>/SKILL.md (or a command). If the user did not name one, list uncompiled candidates with the stability evidence you have and ask — do not pick silently.
  • Stability evidence: repeated transcripts running the same procedure, or a row in .agent/SKILL_INVENTORY.md with real usage.

Readiness gate

Compile only if all hold. If any fails, say "not ready" and name the failing condition instead of compiling an unstable procedure.

  • Same sources, filters, and state every run — no per-run re-planning.
  • At least one step is pure mechanics (path resolution, parsing, package.json / CHANGELOG.md rewrites, IPC or API-type checks, lint/test invocation, report skeletons).
  • The judgment left over is nameable in a sentence or two ("choose the semver level").
  • The skill is not mostly judgment. systematic-debugging, karpathy-guidelines, security-review, and subagent-review have nothing to lower — leave them as prose.

Step 1 — Partition the steps

Produce this table before writing code, and show it to the user. It must agree with the partition rules in .agent/SKILL_COMPILATION.md:

| Owner | Gets | |-------|------| | Code | Known paths, parsing, semver math, file rewrites, IPC/API-type checks, lint/test invocation, report skeletons | | LLM | Ambiguous change classification, AC verdicts from messy evidence, PR narrative, bug hunting, UI/UX judgment | | Human | Commit, push, publish, release tagging, board transitions, consequential overrides |

If a step needs a heuristic to stay correct, it belongs to the LLM. Freezing judgment into rules is the main way this pattern fails.

Step 2 — Implement the harness

scripts/agent_skills/<name>.mjs   # or .py — match the surrounding script language
  • Match the neighbors: .mjs like scripts/check-type-sync.mjs and scripts/doctor.mjs for anything inspecting TypeScript, IPC, or package.json; Python like scripts/ci/*.py for agent-asset governance. No new runtime dependencies — Node stdlib or Python stdlib.
  • Resolve the repo root relative to the script file — no hardcoded absolute paths.
  • Read-only by default. Inspect/plan run free; writes need an explicit apply subcommand or --run.
  • Support --json for agents and a readable summary otherwise. Errors to stderr, non-zero exit.
  • Emit a needs_llm_judgment marker rather than guessing when evidence is ambiguous — that is the handoff back to the model.
  • The harness never commits, pushes, tags, or exports outside the repo.

Step 3 — Shrink the skill to a bootloader

Keep name first and a non-empty description in frontmatter, then keep only: when to use, Invoke (copy-pasteable commands), LLM judgment slots (numbered), Human authority, and Verify. Delete prose the harness now enforces.

Step 4 — Test

Add a vitest spec alongside the repo's other script tests and run:

npm run test:run

Assert behavioral parity with the prose procedure on at least one realistic fixture — that is the evidence the compile was lossless.

Step 5 — Sync and record

python scripts/sync_assistant_trees.py
python scripts/sync_assistant_trees.py --check
python scripts/ci/check_agent_frontmatter.py
python scripts/validate_cli_hub_skills.py   # when a CLI-hub skill changed
npm run lint

Then update .agent/SKILL_COMPILATION.md (new row in the compiled table), .agent/SKILL_INVENTORY.md (note the harness path, refresh Last reviewed), and apply .agent/SKILL_CHANGE_AST10_REVIEW.md.

Done when

  • Partition table was shown and the LLM slots are named in the bootloader.
  • Harness runs read-only by default, emits --json, and hands ambiguity back to the model.
  • Tests pass and demonstrate parity on a real case.
  • Sync, frontmatter, and lint are green; .cursor/ is canonical and .claude/ was regenerated.

Do not

  • Do not hand-edit .claude/ — it is generated from .cursor/ by sync_assistant_trees.py.
  • Do not give the harness commit/push/tag or external-export authority.
  • Do not add an npm dependency for a harness; stdlib only.
  • Do not claim numeric token savings; this repo has no per-session telemetry. Savings are structural.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/compile-skill-into-deterministic-harness-mvda88yg/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/compile-skill-into-deterministic-harness-mvda88yg' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/compile-skill-into-deterministic-harness-mvda88yg/download' --output '.skill-downloads/compile-skill-into-deterministic-harness-mvda88yg/SKILL.md.part' && mv '.skill-downloads/compile-skill-into-deterministic-harness-mvda88yg/SKILL.md.part' '.skill-downloads/compile-skill-into-deterministic-harness-mvda88yg/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

This file does not provide a usable name/description header for this native procedure. It remains available to download and inspect; use the manual method below.

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/compile-skill-into-deterministic-harness-mvda88yg/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills