feat(skills): add harness skill for AI-executable validation - #330
Open
isolomatov-gd wants to merge 5 commits into
Open
feat(skills): add harness skill for AI-executable validation#330isolomatov-gd wants to merge 5 commits into
isolomatov-gd wants to merge 5 commits into
Conversation
Adds `harness` — a model-invocable skill that designs the executable harness a coding agent needs to actually run, observe, and validate a service, instead of stopping at "compiles and tests pass". SKILL.md routes: classify the gap (ACTIONS / ENVIRONMENT / both), discover and extend existing repo assets, write the specification to FEATURE PLAN folder, HITL gate, hand implementation to `coding-flow`, prove by execution, record a `## Harness` inventory in ARCHITECTURE.md. - assets/cli-mcp-scripts.md — delivery shape (CLI/MCP/scripts/dual), encapsulation of auth/secrets/conventions, action granularity (one action = smallest meaningful business outcome, not an endpoint wrapper), curated verbose trace, redaction by default with `--show-secrets` gated by `sensitive-data`, local-first environment boundary with an HITL gate for shared environments. - assets/devcontainers.md — runnable set incl. data and seeding, generated artifacts, safe/unsafe external dependency triage, six containment options ordered cheapest to most faithful, cold-start proof. - README.md — maintainer doc. - Registered in docs/definitions/skills.md. - testing/ and coding/ SKILL.md now point their loose "CLI testing harness" lines at this skill. - Plugins regenerated. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
isolomatov-gd
requested review from
YevheniiaLementova and
omaiesh
as code owners
August 24, 2026 21:14
isolomatov-gd
marked this pull request as draft
August 26, 2026 21:37
Extends `harness` from two kinds (ACTIONS, ENVIRONMENT) to three. PROMPTING covers the skills and subagents an agent loads, authored from a block palette and proved by executing them. Three assets, organized by the contract a skill makes — when I run, what I read, what I do, what I refuse, what done means: - assets/prompting.md — the 13-block palette in five clauses, container rules (everything with procedure, capability, knowledge, or scripts is a skill; a subagent is a context placeholder holding a non-specialized proto-role), boundaries, and the build loop. - assets/prompting-writing.md — rendering blocks into text a model follows; model defaults to write against; the review protocol. - assets/prompting-proof.md — fixture, one trigger per invariant, evaluator ladder, repeats and pass rate, baseline, containment. Copies `configure/` into references/configure/ so the target-agent block resolves per coding agent with APPLY SKILL FILE. Originals untouched. Trims the two existing assets: drops <why_verbose> and both <registration> blocks (SKILL.md step 9 is the single source), compresses delivery shape, artifacts, and runnable set. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The agent running in CI on the project's own events. Two purposes: guards on proposed changes, automations that advance work items. - assets/pipelines.md — guards vs automations, the decisions each project answers for itself, the lane pattern, triggers and concurrency, compute options, loud failure, proof. Teaches the invariants; hardcodes no lane names, no tracker, no vendor. - assets/pipelines-security.md — trust boundary, least privilege, audience, and the guardrail starter copied verbatim into the target repo's router prompt. Lane invariants: three lanes per pipeline with terminal never equal to input, so re-processing is structurally impossible; the claim into a working lane is the concurrency lock and the only visible running signal; a crashed run parks visibly instead of looping; every flow has a lane that waits for a human, and the agent never makes the authorizing move. Security: everything from the forge is untrusted data; definition and prompt load from the default branch; the agent's own output is an attack surface; write permission scoped per lane; secrets out of the model's job entirely; guardrails live outside the agent's write reach. "Internal" is not private — an internal repository is public to the whole organization, and whether the actor is internal or external changes nothing, only the damage does. Also rebalances README across all four kinds; it had drifted prompting-heavy. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…mechanism The fourth kind was named after one substrate and let that substrate's shape write the content. n8n, process engines and cron jobs did not fit the vocabulary, and prevention was framed as PR-time rather than as a class. - Purposes are prevention (guards) and autonomous execution. Different trust postures, different permission sets, different blast radius: a false block versus a wrong change landing. - Substrate is now a resolved decision with criteria — CI pipeline, scheduled job, workflow automation, process engine, bot or webhook service, hook or policy controller. Chosen on where state lives, how long the work runs, whose identity it uses, what it must reach, who approves. - State-model invariants re-grounded in substrate-neutral terms: state store not board, work item not issue, human task not comment gate. The invariants themselves are unchanged — a process engine formalizes exactly these as user tasks, which is why they were never CI-specific. assets/pipelines.md → automations.md, pipelines-security.md → automations-security.md. The guardrail starter is byte-identical; only the security asset's framing generalized from forge to triggering system. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Lifecycle hooks for AI coding agents — code the runtime executes at fixed events,
whatever the model decides. Prompts persuade; hooks enforce.
- assets/hooks.md — capability classes (intercept, rewrite input, rewrite output,
inject context, observe), the hook-or-prompt decision, the per-agent contract
traps that cost the most time, how to grep the evidence logs, tester.js, safety,
proof.
- references/hooks/ — the seven verified per-agent contracts, their working
hooks.json configs, and the live-run logs, copied from docs/hooks/.
- scripts/tester.js — universal dump-first hook probe.
Reference cleanup: prose paths repointed (tester.js to
${CLAUDE_PLUGIN_DIR}/skills/harness/scripts/, logs to references/hooks/), pointers
to unshipped .jsonl transcripts dropped, the adapter source path replaced with a
raw GitHub URL, and Rosetta-specific phrasing neutralized where it named no longer
reachable internals. JSON payload captures are untouched — they are run evidence.
Also makes the target explicit: PROMPTING and HOOKS are for AI coding agents
(Claude Code, Codex, Cursor, Copilot, Windsurf, Antigravity, Devin), stated in
SKILL.md and in both assets. Without it the skill cannot tell what class of
artifact is meant.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
isolomatov-gd
marked this pull request as ready for review
August 28, 2026 14:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #147.
What
Adds
harness— a model-invocable skill that designs the executable apparatus a coding agent needs to actually run, observe, and validate what it changed, rather than stopping at "compiles and unit tests pass."SKILL.mdis a router, not a builder. Nine steps: classify the gap → discover and extend what the target repo already has → propose placement in its own conventions → load the matching asset → write the specification to FEATURE PLAN folder → HITL gate → build → prove by execution → record a## Harnessinventory inARCHITECTURE.md.Five kinds
Independent, often combined. Each answers a different "we cannot verify this."
cli-mcp-scripts.mddevcontainers.mdprompting.md,prompting-writing.md,prompting-proof.mdhooks.md,references/hooks/automations.md,automations-security.mdACTIONS — the callable surface against a running service. One action is the smallest meaningful business outcome composed of several calls, not an endpoint wrapper; the worked
create-orderexample is the load-bearing rule. Tribal knowledge (auth, secret loading, headers, FK resolution, test-data markers) is encoded once so no session rediscovers it. Verbose by default, because the observed trace is the fixture the later automated test is written from. Secrets redacted on every output path.ENVIRONMENT — the isolated ephemeral environment. Empty schema ≠ runnable; data is part of the environment. Every dependency leaving the box is triaged safe or unsafe, with uncertain counting as unsafe until the user decides otherwise, and six containment options ordered cheapest→most faithful that the user picks from. Proof is by attempting the call, never by reading config.
PROMPTING — the skills and subagents an AI coding agent loads (Claude Code, Codex, Cursor, Copilot, Windsurf, Antigravity, Devin). Organized around the contract a skill makes — when I run, what I read, what I do, what I refuse, what "done" means — with 14 blocks across those five clauses; a gap picks four or five. Two rules carry most of the weight: anything holding procedure, capability, knowledge, or scripts is a skill, while a subagent is a context placeholder holding a non-specialized proto-role, so there is no skill-versus-subagent decision to make. And procedure when order is the correctness, guidance when judgment is — a hardcoded branch where judgment belongs produces confident wrong answers. Proof triggers are derived from invariants rather than improvised, and routing is asserted first, because a skill that never loads is the most common failure and the happy path hides it.
HOOKS — lifecycle hooks for AI coding agents. Prompts persuade, hooks enforce: a rule is advice the model may skip, a hook is code the runtime runs at a fixed event regardless of what the model decided. Five capability classes — intercept and block, rewrite tool input before execution, rewrite tool output before the model sees it, inject context, observe.
The asset routes to seven empirically verified per-agent contracts, because the wire contracts diverge in ways that fail silently: two independent block mechanisms that must never be mixed, post-execution events that cannot block because the tool already ran, user-facing and model-facing text in different fields so the wrong one reaches nobody, structured output parsed only on one exit code, and one agent with no structured-output channel at all that blocks via stderr and exit 2. Ships each agent's working
hooks.json, the live-run logs as grep targets with the marker set named, andscripts/tester.js— a universal dump-first probe that discovers an undocumented contract by wiring it and reading what arrives.AUTOMATIONS — work that happens without a human driving it, for prevention (guards: decides allow/flag/block, never authors what it judges) or autonomous execution (triage, docs, planning, small implementations, reconciliation). Different blast radius — a false block versus a wrong change landing — so different trust postures and permission sets.
The substrate is a resolved decision, not the kind: CI pipeline, scheduled job, workflow automation, process engine, bot or webhook service, hook or policy controller — chosen on where state lives, how long the work runs, whose identity it uses, what it must reach, and who approves.
The state model is the design. Three states per automation with the terminal state never equal to the input state, so re-processing is structurally impossible rather than merely discouraged; the claim into a working state is the concurrency lock and the only visible running signal; a crashed run parks in a state nothing loads from and waits visibly instead of looping; and every flow has at least one human task, so no automation shows only its end result. A process engine formalizes exactly these as user tasks — the invariants were never CI-specific.
Automation security
Everything the triggering system hands over is untrusted data — on a forge: titles, bodies, comments, branch names, file names, file contents. The definition and the router prompt load from the trusted baseline; a proposed change is inspected, never executed in a job holding credentials. The trigger that grants a write token and secrets while checking out unmerged code is the standard vulnerability of this category, and the asset says to name yours and prove it is not that.
Write permission is scoped per state, not per automation. Secrets do not belong in the model's job at all — privileged steps go in a separate job that runs no model. The agent's own output is an attack surface, since injected text in its comment reaches a human or a downstream automation. Published transcripts are scrubbed; they sit outside log masking. And guardrails must live outside the agent's write reach — branch protection, or the substrate's equivalent, is the mitigation; the prompt asking nicely is not.
"Internal" is not private. An internal repository is public to the whole organization — employees, contractors, associates. Whether the actor is internal or external changes nothing; only the result does, measured as damage to the project, the team, the organization. A detection therefore routes to a channel narrower than the item that carried it: a world- or org-readable alert republishes the attack and tells the actor it worked.
automations-security.mdships a guardrail starter copied verbatim into the target repo's router prompt: threat signals, the rule that framing ("test", "red team", "demo") grants no exemption, the stop-and-alert protocol, and a non-public-findings section covering what may and may not appear in a world-readable comment.Files
skills/harness/SKILL.mdskills/harness/assets/*.mdskills/harness/references/hooks/*skills/harness/scripts/tester.jsskills/harness/references/configure/*.mdskills/harness/README.mddocs/definitions/skills.mdharnessskills/testing/SKILL.md,skills/coding/SKILL.mdharnessplugins/**Decisions
disable-model-invocation. The frontmatter description carries every activation trigger--show-secretsopt-in and gated bysensitive-datarisk-assessment/dangerous-actions## Harnesssection in the target repo'sARCHITECTURE.md, written bySKILL.mdstep 9 alonecoding-flowfor ACTIONS, ENVIRONMENT, HOOKS, AUTOMATIONS. PROMPTING authors inline; that flow's reviewer and validator phases duplicate the harden and prove steps its assets already own. An automation's router prompt is authored through the PROMPTING assetsdocs/hooks/: prose paths repointed, unshipped.jsonlpointers dropped, adapter source path replaced with a raw GitHub URL, Rosetta-internal phrasing neutralized. JSON payload captures left verbatim — they are run evidenceconfigure/references/configure/, reached withAPPLY SKILL FILE. Root folder and theREAD CONFIGUREalias still ship — retiring both is follow-up workDesign notes
<when_to_use_skill>. Only the frontmatter description is visible before a skill loads, so a post-load trigger list is dead weight. Same omission asorchestration.<registration>block;SKILL.mdstep 9 owns the## Harnesssection name.sensitive-data,risk-assessment,dangerous-actions) directly — a deliberate deviation from "skills don't call skills," matching the existing prerequisite pattern inorchestrationandrosetta. No asset deep-links another skill's internals.src/rosetta-mcp-server/validation/verify_mcp.pyfor the service kinds;tests/e2e-tests/*anddocs/manual-tests/*.mdfor PROMPTING; this repo's owndocs/AUTOMATION-ARCHITECTURE.md,.github/workflows/repo-*.yml,.github/prompts/and.github/scripts/for AUTOMATIONS — where the state-model invariants were measured, and one project's answers rather than the shape the asset prescribes.🤖 Generated with Claude Code