From qe-framework
Verifies that implementation and tests honor a business-logic contract stored under .qe/contracts/active/. Caches verdicts by hash; delegates to Econtract-judge LLM agent on miss.
How this skill is triggered — by the user, by Claude, or both
Slash command
/qe-framework:Qverify-contractThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Execute contract conformance verification. Compute a 3-hash (contract/impl/test) cache key; return cached verdict on hit; otherwise invoke the Econtract-judge agent, parse its JSON verdict, cache it, and report.
Execute contract conformance verification. Compute a 3-hash (contract/impl/test) cache key; return cached verdict on hit; otherwise invoke the Econtract-judge agent, parse its JSON verdict, cache it, and report.
/Qverify-contract <name> — Verify a Single ContractSteps:
Validate <name> via assertValidContractName from hooks/scripts/lib/contract-manifest.mjs. Reject invalid identifiers.
Locate contract file via resolveContractPath(name) from hooks/scripts/lib/contract-manifest.mjs. Contract must be in active/; pending contracts are not verified.
{verdict: "FAIL", summary: "contract not found: {name}"} and exit.Read contract file content → contractText.
Use contract-file-resolver.mjs functions:
resolveImplPath(name, contractText) → locate implementation fileresolveTestPath(name, contractText) → locate test fileimplText = '')testText = '')Compute 3-part cache key via contract-hash.mjs → computeContractHash:
contract_hash — SHA256 of contract contentimpl_hash — SHA256 of impl content (or empty string)test_hash — SHA256 of test content (or empty string)Call isCacheHit(name, {contract_hash, impl_hash, test_hash}) from contract-verdict-cache.mjs:
readVerdict(name), return cached verdict, print report and exitCache MISS flow:
buildJudgePrompt({contractName: name, contractText, implText, testText}) from contract-judge-prompt.mjs to construct the promptEcontract-judge agent via the Agent tool with subagent_type: 'Econtract-judge', passing the built prompt as the agent's inputverdict, summary, findings): return {verdict: "FAIL", summary: "judge returned unparseable output", findings: [{ section: "Judge Output", expected: "single valid JSON verdict fence with verdict/summary/findings", actual: "<first 200 chars of agent output>", severity: "critical" }]}{ section: "Judge Output", expected: "exactly one JSON fence", actual: "N fences found (took the last)", severity: "minor" } to the parsed findings array before cachingcontract_hash (from step 5)impl_hash (from step 5)test_hash (from step 5)judged_at: new Date().toISOString()model: "claude-sonnet-4-6" (or whatever model the agent used)Call writeVerdict(name, enriched) from contract-verdict-cache.mjs to persist the verdict.
Print formatted report (see Report Format below) and return the verdict.
/Qverify-contract --all — Verify All Active ContractsSteps:
Call listActive() from contract-manifest.mjs to fetch all active contract names.
For each contract name, execute the single contract flow (steps 1–9 above).
Aggregate results: count PASS vs FAIL verdicts.
Print table with columns:
Contract Name — identifierVerdict — PASS or FAILSummary — 1-line verdict summaryJudged At — ISO timestamp (or "Cached" if from cache)Exit with non-zero status code if any contract verdict is FAIL (enables CI integration).
Single contract (example):
Contract: sivs-enforcer
Verdict: PASS
Summary: Implementation honors all declared invariants and error modes.
Judged At: 2026-04-22T14:35:00Z
---
Contract: user-service
Verdict: FAIL
Summary: Missing DuplicateEmailError handling.
Findings:
[critical] Error Modes — expected: throw DuplicateEmailError when email exists | actual: returns null
All contracts (example):
Contract Verification Report (--all)
=====================================
sivs-enforcer | PASS | Implementation honors all invariants | Cached
user-service | FAIL | Missing DuplicateEmailError handling | 2026-04-22T14:35:00Z
auth-provider | PASS | Tokens verified correctly | 2026-04-22T14:36:15Z
Summary: 2 PASS, 1 FAIL
Exit code: 1
This skill depends on the following library modules:
hooks/scripts/lib/contract-manifest.mjs — name validation (assertValidContractName), path resolution (resolveContractPath), listing (listActive)hooks/scripts/lib/contract-file-resolver.mjs — implementation and test path resolution (resolveImplPath, resolveTestPath)hooks/scripts/lib/contract-hash.mjs — 3-hash computation (computeContractHash)hooks/scripts/lib/contract-verdict-cache.mjs — cache operations (isCacheHit, readVerdict, writeVerdict)hooks/scripts/lib/contract-judge-prompt.mjs — prompt builder (buildJudgePrompt)agents/Econtract-judge.md — LLM judge agent (invoked via Agent tool with subagent_type: 'Econtract-judge')--all detects FAIL verdicts (for CI pipelines)/Qverify-contract sivs-enforcer
→ Verifies .qe/contracts/active/sivs-enforcer.md
→ Locates impl + test files via contract-file-resolver
→ Computes 3 hashes, checks cache
→ On miss: invokes Econtract-judge, caches result, prints report
/Qverify-contract --all
→ Lists all active contracts
→ Verifies each one (in sequence or parallel)
→ Prints table of results
→ Exits non-zero if any FAIL found
After contract verification completes, use standard handoff format:
Phase 3: Contract Layer — Verification complete
PSE: [x] Plan [x] Spec [x] Execute [>] Verify
Contract: {name} — {verdict}
Next: /Qcode-run-task
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.