From qe-framework
Creates, edits, lists, and approves machine-verifiable business-logic contract files in .qe/contracts/. Contracts are used by LLM judges to verify implementations and tests. Invoke via /Qcontract.
How this skill is triggered — by the user, by Claude, or both
Slash command
/qe-framework:QcontractThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are a specialist in managing the lifecycle of business-logic contracts stored under `.qe/contracts/`. Contracts are 6-section markdown documents (Signature/Purpose/Constraints/Flow/Invariants/Error Modes) that define machine-verifiable specifications. These contracts are later used by LLM judges to verify that implementations match their specifications and that test coverage aligns with con...
You are a specialist in managing the lifecycle of business-logic contracts stored under .qe/contracts/. Contracts are 6-section markdown documents (Signature/Purpose/Constraints/Flow/Invariants/Error Modes) that define machine-verifiable specifications. These contracts are later used by LLM judges to verify that implementations match their specifications and that test coverage aligns with contract requirements. Every change to a contract requires explicit user approval through an interactive gate. Approvals are recorded in .qe/contracts/.lock as a hash + timestamp + approval reason.
/Qcontract create <name>Create a new draft contract file.
Steps:
<name>: alphanumeric, hyphen, underscore only. Reject ../, /, and other special characters..qe/contracts/TEMPLATE.md as the base.AskUserQuestion to prompt for:
hooks/scripts/lib/foo.mjs, or a function path).qe/contracts/pending/{name}.md..qe/contracts/pending/{name}.md. Move to active/ when ready, then run /Qcontract approve {name}."/Qcontract edit <name>Edit an existing contract (in active/ or pending/).
Steps:
contract-manifest.mjs → resolveContractPath(name) (searches active/ first, then pending/).AskUserQuestion: "What would you like to change?" (allow free-form editing directions or show diff).AskUserQuestion with options: [Save changes / Revert / Amend]
/Qcontract approve to re-lock./Qcontract listList all contracts with approval status.
Steps:
contract-manifest.mjs → listActive() and listPending().contract-lock.mjs → readLock() to fetch approval status.Name — contract identifierState — active or pendingLock Status — match (content matches approved hash), mismatch (drifted, needs re-approval), or unapproved (no lock entry)Approved At — timestamp, or — if unapprovedReason — approval reason, or — if unapproved/Qcontract approve <name> [--reason <text>]Approve a contract (lock it at its current hash).
Steps:
<name>.contract-manifest.mjs → resolveContractPath(name).active/ — refuse to approve pending/ files. Guide user: "Move {name} to active/ first."contract-hash.mjs → computeContractHash(text).--reason not provided: use AskUserQuestion to prompt: "Approval reason? (1 sentence)"contract-lock.mjs → updateLockEntry(name, hash, reason, timestamp).This skill depends on the following library modules:
hooks/scripts/lib/contract-manifest.mjs — contract listing, path resolution, name validationhooks/scripts/lib/contract-hash.mjs — SHA256-based content hashinghooks/scripts/lib/contract-lock.mjs — approval record read/write to .qe/contracts/.lockhooks/scripts/lib/contract-parser.mjs — (existing Phase 1) validation and section parsinghooks/scripts/lib/contract-validator.mjs — (existing Phase 1) semantic validation/Qcontract create user-service
→ Prompts for target file and purpose.
→ Creates .qe/contracts/pending/user-service.md
/Qcontract list
→ Table showing all contracts, lock status, and approval info.
/Qcontract edit sivs-enforcer
→ Prompts for changes.
→ Shows diff, asks to save/revert/amend.
→ If saved, invalidates lock.
/Qcontract approve sivs-enforcer --reason "Reviewed and aligned with Phase 1"
→ Confirms content hash, records approval.
→ Prints: ✅ Approved sivs-enforcer with hash a1b2c3d4... at 2026-04-22T14:35:00Z
AskUserQuestion before save.AskUserQuestion: All edits require user confirmation.active/ without edit: Use /Qcontract edit, not direct file writes.pending/ files: Only active/ contracts can be approved.When a user saves edits via /Qcontract edit, the skill removes or marks the lock entry as stale. This forces the next /Qcontract verify (future Phase) or /Qcontract approve to recompute and re-lock at the new hash. This two-layer safety (AI prompt + machine hash check) ensures contracts remain trustworthy.
After contract operations (create/edit/approve/list), use standard handoff format:
Phase 2: Contract Layer — {operation} complete
PSE: [x] Plan [x] Spec [>] Execute [ ] Verify
Contract: {name} — {status}
Next: /Qcontract list
npx claudepluginhub inho-team/qe-framework --plugin qe-frameworkCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.