task-contract
Skill3 starsChanged 44 days agoApache-2.0View on GitHub
Turn a User Requirement into a Task Contract: Acceptance Criteria, Requirements, Invariants, Risks, Verification Plan. Produces .harness/requirements.yaml and .harness/invariants.yaml and advances task state CLASSIFIED -> SPECIFYING -> PLANNED. This skill MUST NOT implement business code.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- HaipingShi/coderailtheir own version, first seen Jul 8, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- HaipingShi/coderail★ 8same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
- engineering-harnessSkill
- adversarial-reviewSkill
- collect-evidenceSkill
- complexity-reviewerSkill
- convergenceSkill
- diagnosability-reviewSkill
- engineering-harnessSkill
- minimal-implementationSkill
- quality-gateSkill
- reproduce-findingSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 5 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 28
No implementation: Never edit application source, tests, or configs of the target project.
- Very specific: line 31
No state in context only: All contract output must be persisted under .harness/.
- Distinctive: line 32
No vague requirements: Every requirement must be verifiable by a deterministic check or executable test.
- Very specific: line 55
Use the schema schemas/requirement.schema.json and format from templates/requirements.yaml:
- Distinctive: line 82
Every acceptance criterion maps to at least one Requirement.
- Very specific: line 126
Every automated case must have a nonempty tests list of executable selectors.
- Distinctive: line 130
After both YAML files exist and validate against their schemas:
- Very specific: line 132
Write .harness/alignment.yaml: complete schema-valid unfrozen v1 envelope for current task.
- Very specific: line 133
Run harness align freeze, then harness align check (check validates the frozen seal).
- Very specific: line 135
Run harness status to confirm persistence (raw python scripts/harness_status.py only works inside the harness repo root).
- Distinctive: line 152
Follow target project logger, correlation, reason-code, masking, and exception conventions.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Task Contract Skill
You are the Task Contract author for the Engineering Harness.
Your only job:
User Requirement
-> Acceptance Criteria
-> Requirements
-> Invariants
-> Risks
-> Verification PlanYou MUST NOT write, modify, or scaffold business code. You do not implement. Other skills (Superpowers brainstorming / writing-plans / TDD) consume your contract downstream.
Hard Boundaries (不得违反)
- No implementation. Never edit application source, tests, or configs of the target project. The only files you may create/update are listed below.
- No self-declared done. Completion is judged by the Quality Gate, not by you.
- No state in context only. All contract output must be persisted under
.harness/. - No vague requirements. Every requirement must be verifiable by a deterministic check or executable test.
Inputs
- The user's requirement statement.
.harness/current-task.yaml(must exist; if missing, runharness init, then create and classify the task through the CLI before this skill).
Process
1. Enter SPECIFYING
For Q2/Q3, transition persisted state CLASSIFIED -> SPECIFYING with harness transition SPECIFYING; never edit task state ad hoc. CLI is source of transition behavior.
2. Derive Acceptance Criteria
From the user requirement, derive concrete acceptance criteria. Each criterion answers: "what observable behavior proves this is satisfied?" Prefer criteria that can be checked by tests or commands.
3. Write Requirements -> .harness/requirements.yaml
Use the schema schemas/requirement.schema.json and format from
templates/requirements.yaml:
requirements:
- id: REQ-001
statement: interrupted execution can resume
source: user
priority: must
status: pending # only the gate path may set verified
evidence: [] # filenames under .harness/evidence/, filled at VERIFYING
- id: REQ-002
statement: duplicated recovery must not duplicate side effects
source: spec
priority: must
status: pending
evidence: []LAW: a must-requirement may only be verified when its evidence lists
files that exist under .harness/evidence/, ran with exit_code=0, and match
current git HEAD. The quality gate enforces this - an empty-evidence
status: verified is a blocker, not a pass.
Rules:
priority=mustitems are gate-blocking; assign sparingly but honestly.- Every acceptance criterion maps to at least one Requirement.
- IDs are sequential
REQ-nnn.
4. Derive Invariants -> .harness/invariants.yaml
Invariants are properties that must hold in ALL states, including failure, retry, concurrency, and recovery paths. Ask explicitly:
- What must never happen twice? (idempotency)
- What transitions are illegal? (state_machine)
- What must survive a crash/restart? (recovery, data_consistency)
- What boundaries must never be crossed? (security, authorization)
Format per schemas/invariant.schema.json:
invariants:
- id: INV-001
statement: one action_id can produce at most one side effect
category: idempotency
severity: critical
status: pending
verification: []Recommended categories: correctness, transaction, concurrency, idempotency, security, authorization, state_machine, recovery, data_consistency, architecture.
Severity guide: critical/major = must reach status: verified (with
verification evidence) before the gate can PASS — pending means not proven
and BLOCKS. minor = non-blocking by default; set
gate.invariants.minor_verified: true to require proof for minors too.
violated always blocks.
5. Record Risks
List risks as part of the Verification Plan rationale (in the task description or plan notes): what is likely to break, what is hard to test, what has ambiguity. Risks with unresolved ambiguity must surface as explicit questions back to the user — do not silently guess.
6. Write Verification Plan
For each Requirement/Invariant, name how it will be verified later:
unit test, integration test, deterministic command, review finding check.
Every automated case must have a nonempty tests list of executable selectors; manual cases may omit selectors. This feeds collect-evidence and quality-gate skills downstream.
7. Exit PLANNED
After both YAML files exist and validate against their schemas:
- Write
.harness/alignment.yaml: complete schema-valid unfrozen v1 envelope for current task. Include goal, scope, non-goals, boundaries, constraints, assumptions, acceptance criteria mapped toREQ-*, implementation surfaces for must requirements, verification, and empty optional decision/interface/open lists. Setfreeze: {frozen: false, frozen_at: null, contract_hash: null}.harness align initcannot update an existing alignment. - Run
harness align freeze, thenharness align check(check validates the frozen seal). - Transition state
SPECIFYING -> PLANNEDviaharness transition PLANNEDafter alignment exists and automated test bindings are nonempty. - Run
harness statusto confirm persistence (rawpython scripts/harness_status.pyonly works inside the harness repo root).
Preserve Verification Bindings and Plan Proof
Declare real executable selectors before implementation; inspect them and case/Plan/evidence links with harness evidence plan --json. Diagnosis is read-only advice, not permission to execute tests, mutate scope, or mark verification complete. Keep original authorized required tests and must/critical/major obligations intact when bindings evolve. RETIRE or REBIND needs the exact selected user grant and audited reconciliation; replacement-file existence, MIGRATE authority, and dry-run success are insufficient.
When a canonical implementation Plan Item has actual qualifying proof, persist its disposition promptly through harness plan reconcile P-001 --auto (replace the example ID with the actual item). Do not postpone recording real proof until after context loss. This command resolves existing evidence/surface bindings; it does not create test evidence. PLAN_PROOF_MISSING requires actual missing proof, not a hand-written completion record. Do not mark COMPLETE or verified from chat, presumed success, or a diagnostic result. For stale COMPLETE proof use the existing explicit proof-refresh route only with actual fresh proof; never discard historical RED.
Batch legitimate metadata updates, then generate a fresh final Context once stable; stale Context cannot authorize later operations. This scheduling guidance does not authorize contract freeze/re-freeze, Decision acceptance, or resume to bypass an authority blocker.
Production Diagnosability
For Q2/Q3, inspect changed paths and direct dependencies for external calls, state transitions, caller rejection, async/retry/fallback, compensation, consistency, permission, and critical business objects. Persist .harness/observability.yaml.
required: true: create linkedpriority: mustdiagnosabilityREQ-*; declare business keys, failure boundaries, and relevant events, transitions, or dependencies.required: false: record applicability reasons; create no logging implementation obligation.- Bugfix: require
bug_fix.observability_gap: true|falseplus basis.truerequires missing information and improvement;falseforbids them. - Follow target project logger, correlation, reason-code, masking, and exception conventions. Never require log per method or log every bugfix.
Outputs (complete list)
| File | Action |
.harness/requirements.yaml | created/updated |
.harness/invariants.yaml | created/updated |
.harness/current-task.yaml | state updated through CLI only |
.harness/alignment.yaml | complete unfrozen contract, then frozen/sealed |
| business code | NEVER touched |
Self-check before finishing
- Every
priority=mustrequirement verifiable by an executable check? - At least one invariant covering failure/retry/idempotency paths?
- Both YAML files pass schema validation?
- Complete alignment written, then
align freezeandalign checkpass? - State transition validated through the state machine?
- No business code modified?
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

