본문으로 건너뛰기
cccskills
무료GitHub에 공개

foundations-formal-methods

Proves protocols and agent workflows with TLA+, P, Alloy, Z3, Dafny, or Lean. Use when proving protocols correct, writing TLA+ specs, or verifying LLM proofs.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(15)

  • SKILL.md8.5 KB
  • agents/openai.yaml373 B
  • assets/tla/IdempotentRetry.cfg166 B
  • assets/tla/IdempotentRetry.tla3.7 KB
  • assets/verification-report.md683 B
  • data/sources.json8.1 KB
  • references/agent-workflows.md7.5 KB
  • references/finite-checker.md2.2 KB
  • references/llm-generated-specs.md5.6 KB
  • references/model-checking.md2.2 KB
  • references/refinement.md2.1 KB
  • references/specification.md2.2 KB
  • references/tool-selection.md9.2 KB
  • scripts/check_finite_model.py3.8 KB
  • scripts/test_check_finite_model.py4.4 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Formal Methods Foundations

Turn a requirement into a checkable property, pick the cheapest method that can catch the bug class, and report precisely what the evidence establishes. A verified finite abstraction is evidence about that abstraction; implementation correctness needs a demonstrated correspondence.

When to use

Triggers: "prove this protocol is correct", "write a TLA+ / PlusCal spec", "model check this workflow", "find a race condition formally", "verify with Z3 / cvc5 / Lean / Dafny / Verus", "TLA+ or property-based testing?", "check this LLM-generated proof or spec", "can any policy combination allow X", "safety versus liveness", "refinement mapping", "find a counterexample".

Not this skill:

Use this skill when the specification, the choice of verification method, or the meaning of a result is the central question.

Quick Reference

Method ladder (full version in tool-selection.md):

Bug classCheapest adequate rungResult means
Edge-case inputs, sequential logicProperty-based testing or fuzzingFound or not found in the sampled inputs
Rare interleavings in real codeDeterministic simulationFound in the explored seeds
Design races, retries, failures, handoffsTLA+/PlusCal (TLC), P, Alloy 6; Apalache for symbolic checksCompleted exhaustive checks cover the finite model; P schedule testing and bounded symbolic checks cover only their reported exploration
Policy or config equivalence; "can any input reach X"SMT (Z3, cvc5)sat gives a witness; unsat holds for the encoding; unknown proves nothing
Small high-value core, all sizesDafny, Verus, Lean 4, Rocq, IsabelleProof against the stated spec and trusted base

Climb past PBT only for interleaving-heavy designs, authorization logic, irreversible side effects, or aggressive optimizations. For costs, when NOT to climb, and industrial evidence, read tool-selection.md.

Workflow

  1. State the requirement.
    • Name the requirement, the prohibited or required behavior, the environment, and the observed interface.
    • Classify it as state safety, temporal safety, liveness, or a performance requirement. Read specification.md.
  2. Build the model.
    • Define initial states, variables, transitions, atomicity, and environment assumptions, including the failures and concurrency the property depends on.
    • Choose constants large enough to express the bug class. Two concurrent actors is the minimum for a race.
    • Track every abstraction and every omitted behavior.
  3. Pick a rung. Use tool-selection.md and model-checking.md. State the scope and tool limits before interpreting any result.
  4. Run the check.
    • Preserve the model, config, tool version, property, result, and trace.
    • Triage each counterexample: it is a system defect, an abstraction artifact, or a wrong property.
    • Add vacuity probes: the good path must be reachable.
  5. Gate LLM output. If a model drafted or edited the spec, invariant, proof, or config, run the gate in llm-generated-specs.md before accepting any result.
  6. Tie the claim to code. For claims about deployed code, read refinement.md and name the correspondence obligations. Trace conformance is the practical bridge.
  7. Report. Produce the verification-report.md. Use "holds in this finite model", "counterexample found", or "inconclusive". Never upgrade a bounded or model result to general correctness.

Agent-shaped worked example

agent-workflows.md holds a TLC-checked spec of an idempotent tool call with retries (spec, TLC config). It shows three things:

  • A check-then-act race that TLC finds only with two workers, so a one-worker model gives a false "holds".
  • A phantom-acknowledgement bug introduced by the first fix.
  • The protocol that passes both invariants, with vacuity probes.

The same reference covers approval gates bound to argument hashes, cancellation, leases, and policy-as-SMT.

Lightweight finite checker

scripts/check_finite_model.py checks a state invariant over an explicit, fully enumerated finite graph and returns the shortest violating trace. It does not check liveness or code correspondence. For the contract and tests, see finite-checker.md. Run it with python3 scripts/check_finite_model.py model.json.

Assumptions and pitfalls

  • An invariant must hold in initial states as well as after transitions. An unreachable prohibited state is not a violation of reachable-state safety.
  • Stuttering, action granularity, scheduling, and fairness can change temporal claims. Safety success cannot establish eventual completion.
  • A bounded SAT/SMT unsat result excludes counterexamples only within its encoding and bound. unknown, timeouts, and partial searches establish no absence claim.
  • A satisfiable formula is a witness for its encoded constraints, not automatically an execution. Inspect the encoding and decode the witness.
  • Symmetry reduction, constraints, abstractions, and omitted failures each need justification relative to each property. Undersized constants hide races.
  • A proof of a wrong specification does not establish the intended requirement. Check requirements and implementation mappings separately.
  • Verify tool semantics and versions against the tool's current primary documentation before treating them as current. Quote benchmark figures with model, version, and date. Do not present generated claims, parser success, or bounded searches as proof beyond their stated evidence.

Completion criteria

A useful result identifies:

  • the property and the model
  • the assumptions and the method or tool, with its version
  • the bounds and constants
  • the evidence and the counterexample status
  • the vacuity probes
  • the conformance gap

Report verification failures directly, and never silently weaken a property to make a check pass.

Navigation

Related skills

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Configures Claude Code hooks and Codex hooks.json/notify. Use when adding PreToolUse guards, Stop hooks, managed hooks, format-on-save, preflight, audits, or worktree/budget hooks.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

vasilyu1983/AI-Agents-public1012026년 10월 16일 업데이트

Configures and hardens Claude Code and Codex MCP servers. Use when connecting databases, APIs, SaaS, building servers, or serving a clearance-filtered knowledge base.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

vasilyu1983/AI-Agents-public1012026년 10월 16일 업데이트

Owns instruction files: AGENTS.md, CLAUDE.md, personal and repo rules. Use when writing, pruning, auditing them, sharing rules across Claude and Codex, or fixing ignored rules.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

vasilyu1983/AI-Agents-public1012026년 10월 16일 업데이트

Creates and audits agent skills: SKILL.md, references, scripts, runtime metadata. Use when writing, validating, or security-reviewing a skill, or fixing truncated skill listings.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

vasilyu1983/AI-Agents-public1012026년 10월 16일 업데이트

Adds per-skill learnings loops for dated patterns, mistakes, and domain facts. Use when wiring skill memory, consolidation, or drift audits.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

vasilyu1983/AI-Agents-public1012026년 10월 16일 업데이트

Chooses subagent, team, workflow, or debate and launches it on Claude Code or Codex. Use when delegating, running agent review boards, or installing shared agents.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

vasilyu1983/AI-Agents-public1012026년 10월 16일 업데이트

vasilyu1983의 스킬 모두 보기

이 스킬의 문제 신고