skills/formalize/SKILL.md
Verify a Python function against its intended behavior by writing an icontract contract and checking it with `edify check` (CrossHair), repairing in a loop. Triggers on "formalize", "verify this function", "add a contract and check it", or after writing a function whose correctness matters. The in-context agent holds intent and asks the user when behavior is ambiguous; CrossHair owns the deduction.
npx skillsauth add ddaanet/agent-core formalizeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Drive a propose-contract -> check -> repair loop around one Python function.
The verifier (edify check, backed by CrossHair) owns deduction. You own
intent: what the function should guarantee. Verification proves code meets a
contract; it does NOT prove the contract is the right one. That judgment is
yours, and when intent is genuinely ambiguous you ASK rather than guess.
Establish intent. Derive what the target function should guarantee from
the conversation and the surrounding code. If the intended behavior is
genuinely ambiguous (edge cases, error handling, empty inputs), use
AskUserQuestion — do not invent a specification.
Write the contract. Add icontract decorators to the function:
@require(lambda <args>: <precondition>) and
@ensure(lambda <args>, result: <postcondition>). A target needs at least
one pre/post-condition or CrossHair will not analyze it.
Check. Run:
edify check <file-or-dotted-target> --json
The result status is one of verified, refuted, or error.
Interpret — the core judgment:
verified — no counterexample within CrossHair's search budget. Report and
stop. State the honest guarantee level: bounded path-exploration, not a
total proof.refuted — read the counterexample (falsifying input + location), then
decide why it failed:
error — surface it. A common cause is a target with no contract (CrossHair
analyzed nothing); add a contract. Never report error as success.Loop with a cap. Do at most a small fixed number of repair iterations
(e.g. 5). If you hit the cap, STOP and report the honest state: the last
counterexample and what remains unresolved. Never upgrade refuted or an
error to "verified".
verified result from edify check.verified result is bounded, not a soundness/termination proof — say so.edify check wraps CrossHair (symbolic execution + Z3). It is the deduction
oracle; this skill is the intent-holder. See
docs/superpowers/specs/2026-06-08-invariant-guided-verify-loop-design.md.
tools
Manage git worktrees for parallel task execution. Triggers on "create a worktree", "set up parallel work", "merge a worktree", "branch off a task", or uses the `wt`, `wt merge`, or `wt-rm` shortcuts. Worktree lifecycle: creation, focused sessions, merge ceremony, cleanup, parallel task setup.
testing
Recall behavioral knowledge from project decisions. Triggers on "when to do X", situational patterns, or decision content for recognized situations. Invoke with "/when <trigger>".
tools
Sync edify fragments and portable justfile to match the current plugin version. Detects user-edited files and warns instead of overwriting. Use --force to overwrite conflicts.
testing
Write compact bash scripts using exec tracing pattern. Triggers when writing bash scripts with 3+ sequential commands. The exec 2>&1 + set -xeuo pipefail pattern eliminates echo statements via automatic command tracing, reducing script size by 40-60%.