Logo van Formal Methods Drift Guard

Formal Methods Drift Guard

Community
mizchi
formal-methods-drift-guard

Gebruik deze skill nadat er al een formeel model of een verifiercontrole bestaat en de gebruiker dit op de lange termijn wil onderhouden. Helpt Codex om specificaties en documentatie te vergelijken met implementatiecode, tests, configuratiebestanden en logs, en met formele modellen of CI-controles. De skill helpt afwijkingen te classificeren als problemen in de specificatie, code, modelabstractie of testopstelling, of als onopgeloste domeinbeslissingen. Ook kan de skill verifiercontroles uitvoeren of plannen en wijzigingen in SAT/UNSAT-resultaten, tegenvoorbeeldtraces, bewijsfouten, verouderde modellen en CI-resultaten omzetten in reviewvragen in domeintaal en vermeldingen in een logboek.

Add to TypingMind

Overzicht

Uitgevermizchi
Repositoryskills
Skillnaamformal-methods-drift-guard
Sterren
333
Forks
4
Meegeleverde bestanden
10
Links
  • Instructies in Markdown

    Het model laadt het bestand SKILL.md alleen als dat nodig is. Dat kost dus alleen tokens als een verzoek daadwerkelijk bij de skill past.

  • Werkt met elk LLM

    AI-skills bestaan uit instructies in gewone Markdown, niet uit aanbiederspecifieke code. Daardoor werken ze met GPT, Claude, Gemini, Grok of een lokaal model.

  • Meegeleverde bestanden: 10

    Scripts, sjablonen en referentiemateriaal die het model tijdens het werken kan lezen. De bestanden kunnen alleen worden gelezen en worden nooit uitgevoerd.

  • Open source

    Gepubliceerd door mizchi op GitHub. Bekijk de bronbestanden voordat je de skill installeert.

Installatie

Installeer de AI-skill Formal Methods Drift Guard in TypingMind om deze met elk LLM te gebruiken, of voeg de skill toe aan een andere agent die SKILL.md kan lezen.

1

Installeren in TypingMind

TypingMind installeert een skill rechtstreeks vanuit de GitHub-map. De app leest SKILL.md, bundelt de bijbehorende bestanden en slaat het resultaat lokaal op.

  1. Open de app en ga naar Plug-ins → Skills.
  2. Kies "Installeren via GitHub".
  3. Plak de onderstaande URL van de skillmap en bevestig.
    https://github.com/mizchi/skills/tree/main/formal-methods-drift-guard
  4. Schakel de skill in voor elke chat waarin je de skill wilt kunnen gebruiken.
Plug-ins → Skills → Skill toevoegen → Via GitHub-URL. Plak vervolgens de map-URL en druk op Doorgaan.
2

Installeren in een andere agent

Elke agent die het Agent Skills-formaat kan lezen, kan deze skill gebruiken — kopieer de map naar de skillmap van die agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/mizchi/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/formal-methods-drift-guard .claude/skills/formal-methods-drift-guard
Start Claude Code na het kopiëren opnieuw op, zodat de nieuwe skill wordt herkend.

Gebruik deze skill in TypingMind

Schakel Formal Methods Drift Guard in voor een chat naar keuze in TypingMind en het model doet de rest. De naam en beschrijving staan in de systeemprompt. Zodra een verzoek bij de skill past, laadt het model zelf de volledige instructies. Je hoeft de skill nooit handmatig aan te roepen. Pas als het model de skill daadwerkelijk gebruikt, kost dat tokens.

Het model laadt Formal Methods Drift Guard automatisch zodra een verzoek erbij past.

Werkt met elk AI-model

AI-skills zijn gewone Markdown-instructies in plaats van aanbiederspecifieke code. Daardoor is Formal Methods Drift Guard niet gebonden aan het model waarvoor de skill is geschreven. Installeer de skill één keer in TypingMind en gebruik deze met GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama of een lokaal model dat je zelf draait — allemaal met je eigen API-sleutels.

  • Alleen geladen wanneer nodig

    De systeemprompt bevat alleen de naam en beschrijving. De instructies worden bij het eerste bijpassende verzoek opgehaald, dus een ongebruikte skill kost niets.

  • Wissel van model tijdens een chat

    Omdat de skill uit instructies bestaat en niet uit code, blijft deze werken als je van model wisselt — het volgende model leest hetzelfde SKILL.md-bestand.

Skillinstructies

Dit is de inhoud van SKILL.md die het model laadt. Lees deze vóór de installatie — een skill bestaat uit instructies die je model zal volgen.

Formal Methods Drift Guard

Use this skill when a team already has a model/check and now needs to keep spec -> code -> model aligned as the product changes.

This is not the first-modeling skill. If no useful model exists yet, use formal-methods-reconciler first. This skill starts after at least one of these exists: a Z3/Alloy/TLA+/P/Dafny/MoonBit/Lean/Rocq check, a CI verifier job, a model ledger, or a domain decision that was previously locked. Use formal-methods-reconciler for first extraction, tool selection, and initial model design; use this skill for ongoing drift maintenance.

Core Rule

Do not make the model green by silently changing the property.

Treat every red check, stale claim, missing source mapping, or changed witness as a drift signal. Translate it into domain language before proposing a fix.

Workflow

  1. Build the triplet inventory.

    • Spec side: docs, ADRs, API contracts, product rules, threat model, support runbooks, incident decisions.
    • Code side: implementation, tests, config, schema, migrations, logs, telemetry, traces.
    • Model side: formal files, harness scripts, expected SAT/UNSAT assertions, CI workflows, pinned tool versions, previous ledger decisions.
    • Assign stable claim IDs when missing, such as AUTHZ-SETTINGS-001.
  2. Map each claim across the three surfaces.

    • Expected domain claim: what the business rule says.
    • Implementation observation: what code/config/logs currently do.
    • Model property: predicate, invariant, reachability, liveness, theorem, or proof obligation that represents the claim.
    • Check command: exact command or CI job that decides the model result.
    • If the domain rule became more granular than the model, do not treat that as executor uncertainty. Record the abstraction choice explicitly as a model/domain question: for example, split Reachable(Settings) into settings:read and settings:write, or keep one state plus a capability relation. Classify the old coarse property as model-drift or coverage-gap until the owner accepts the new abstraction.
  3. Run the cheapest drift checks first.

    • Text/code diff: did docs, code, model, fixtures, or expected-result files change under relevant paths?
    • Harness check: do all model checks still run in CI with pinned tools?
    • Result check: did expected SAT, UNSAT, trace shape, proof success, or proof obligation count change?
    • Coverage check: is there a spec claim with no model, or a model property with no living domain claim?
    • Trace/log replay: if logs are available, check whether real event traces still refine the model.
  4. Classify drift before fixing.

    Drift classMeaningTypical next action
    spec-driftDocs/domain rule changed but model or code did notAsk whether to update model, code, or both
    code-driftCode/config behavior changed while the locked model stayed the sameTreat as likely regression until domain owner accepts it
    model-driftModel no longer represents the accepted domain rule or implementation boundaryUpdate model abstraction with review
    harness-driftTool version, CI, fixtures, expected-output parser, or path filter brokeFix harness without changing the property
    decision-driftPrevious domain decision is now ambiguous or contradictedRe-open domain question
    coverage-gapA claim exists on one surface but not the othersAdd model, docs, tests, or explicit non-goal

    Choose one primary drift class. Base it on which surface currently diverges from the accepted domain rule, not on which surface changed first. If docs and code both intentionally moved to a new accepted rule while the model still encodes the old rule, classify the primary drift as model-drift and note the spec/code change as the driver. If code moved but docs and model still encode the accepted rule, classify it as code-drift. Use secondary notes for contributing factors, but do not leave the fix target ambiguous by listing multiple primary classes.

  5. Translate machine output to domain wording.

    • Say who can do what, which order is accepted, which config is dead, which state becomes reachable, or which crash/retry sequence loses data.
    • Include the changed condition that caused drift: new doc rule, changed route guard, changed enum, changed config default, new event type, new tool version, or new trace.
    • Never show only SAT, UNSAT, proof failed, or CI red.
  6. Decide the fix target with the owner.

    • If spec is correct and code drifted: fix code and keep the model check.
    • If code is intentional and spec is stale: update spec and adjust model.
    • If model abstraction is stale: update model and preserve the domain claim.
    • If harness drifted: fix CI/scripts/pins and do not change domain text.
    • If unresolved: keep the witness and ask a domain-owner question.
  7. Lock the maintenance loop.

    • Keep model checks in CI with machine-readable exit codes.
    • Add path filters so PRs touching relevant specs/code/models run the right checks.
    • Keep a ledger entry per claim and update it when a domain decision changes.
    • Prefer explicit expected-result files for SAT/UNSAT or trace shapes so changes are reviewable.

Output Contract

For each changed or suspicious claim, produce a ledger entry:

text
claim_id:
source_of_truth:
spec_delta:
code_delta:
model_delta:
check_command:
previous_machine_result:
current_machine_result:
drift_class:
witness:
domain_wording:
domain_question:
recommended_fix_target:
lock_update:
epistemic_status:

Use references/drift-ledger.md for templates and examples.

Reporting Discipline

  • Separate confirmed machine results from inferred drift. Label them machine-confirmed, log-confirmed, diff-inferred, or not-run.
  • Preserve the exact failing command or CI URL when available.
  • Do not collapse domain uncertainty into self-report uncertainty. A missing domain decision is an output, not a failure to use the skill.
  • Do not put model-granularity choices in self-report unclear points when the deliverable can express them as domain questions. Use self-report only when the skill cannot be applied; use the ledger when the model needs a reviewed abstraction change.
  • Do not put an explicitly unrun verifier/check in self-report unclear points when the task is to produce a drift ledger. Record it as current_machine_result: not-run, add diff-inferred or log-confirmed evidence where available, and propose the exact check as lock_update. Only use self-report when the user explicitly asked you to run the verifier and the run failed or was impossible.
  • Do not mark a model obsolete only because it is red. First ask what behavior changed and whether that change is intended.
  • Do not claim the implementation refines the model unless the verifier, trace-checker, tests, or explicit replay actually checked that relation.

Common Cases

  • Authz docs changed: A role gains an exception in docs. Check whether Alloy/Z3/P route model and code guards agree; translate any witness as "role X can/cannot reach screen Y under flag Z."
  • Config default changed: Empty allowlist was clarified from "all users" to "no users." Check Z3 config validator and live config; translate dead or newly-open config in campaign language.
  • Protocol event added: A new retry or timeout event is added. Check TLA+/P model for stale state transitions; translate traces as user-visible duplicate charge, lost ack, stuck job, or stale read.
  • CI pin changed: A new solver/prover version changes output formatting or proof obligations. Classify as harness drift unless the semantic result changed.
  • Incident found a real trace: Replay the incident trace against the model. If accepted, the model permits the incident and needs a stronger contract. If rejected, the model/code gap needs investigation.

Meegeleverde bestanden

Zolang de skill geladen is, leest het model deze bestanden als dat nodig is. Het model kan ze alleen lezen; ze worden nooit uitgevoerd.

Veelgestelde vragen

Wat doet de AI-skill Formal Methods Drift Guard?

Gebruik deze skill nadat er al een formeel model of een verifiercontrole bestaat en de gebruiker dit op de lange termijn wil onderhouden. Helpt Codex om specificaties en documentatie te vergelijken met implementatiecode, tests, configuratiebestanden en logs, en met formele modellen of CI-controles. De skill helpt afwijkingen te classificeren als problemen in de specificatie, code, modelabstractie of testopstelling, of als onopgeloste domeinbeslissingen. Ook kan de skill verifiercontroles uitvoeren of plannen en wijzigingen in SAT/UNSAT-resultaten, tegenvoorbeeldtraces, bewijsfouten, veroude...

Waarom Formal Methods Drift Guard gebruiken in TypingMind?

Omdat je deze skill één keer installeert en met elk model kunt gebruiken. Formal Methods Drift Guard bestaat uit gewone Markdown in plaats van aanbiederspecifieke code. Dezelfde skill werkt dus met GPT-5, Claude, Gemini, Grok of een lokaal model. Ook als je midden in een chat van model wisselt, blijft de skill werken. TypingMind werkt met je eigen API-sleutels, dus je betaalt aanbieders rechtstreeks in plaats van een abonnement per gebruikersplek af te sluiten. Je skills en chats blijven in je eigen opslag.

Hoe installeer ik Formal Methods Drift Guard in TypingMind?

Open Plug-ins → Skills → Installeren vanaf GitHub in TypingMind en plak https://github.com/mizchi/skills/tree/main/formal-methods-drift-guard. TypingMind leest het bestand SKILL.md, bundelt de bijbehorende bestanden en installeert het geheel als een skill die je per chat kunt inschakelen.

Welke AI-modellen kunnen Formal Methods Drift Guard gebruiken?

Elk model dat je in TypingMind koppelt. AI-skills bestaan uit gewone Markdown-instructies in plaats van aanbiederspecifieke code. GPT, Claude, Gemini, Grok en lokale modellen kunnen deze skill dus allemaal laden wanneer een verzoek erbij past.

Hoeveel AI-modellen kan ik met Formal Methods Drift Guard gebruiken?

Zoveel als je wilt. Je kunt Formal Methods Drift Guard gebruiken met elk model dat skills ondersteunt, zoals GPT, Claude, Gemini, Grok, DeepSeek, Mistral of Llama. Allemaal in TypingMind met je eigen API-sleutels.

Is de AI-skill Formal Methods Drift Guard gratis?

Deze skill is door mizchi op GitHub gepubliceerd. Bekijk de repository voor de licentievoorwaarden. Je betaalt alleen je eigen AI-aanbieder voor de tokens die je gebruikt.

Wat zijn AI-skills?

Een AI-skill is een herbruikbare bundel instructies die een AI-model leert hoe het één specifieke taak moet uitvoeren. De skill volgt het open Agent Skills-formaat: het bestand SKILL.md bevat de naam en beschrijving van de skill. Daarnaast kan de skill scripts, sjablonen of referentiebestanden bevatten die het model nodig heeft. Het model leest de instructies alleen als je verzoek bij de skill past. Een geïnstalleerde skill kost dus niets zolang deze niet wordt gebruikt.

Waarin verschillen AI-skills van plug-ins of MCP-servers?

Een plug-in of MCP-server geeft een model nieuwe tools om aan te roepen: code die ergens wordt uitgevoerd en een resultaat teruggeeft. Een AI-skill geeft het model juist kennis en een werkwijze: hoe het een taak moet aanpakken, welke stappen het moet volgen en hoe goede uitvoer eruitziet. Skills bestaan uit gewone Markdown en hebben dus geen server, API-sleutel of runtime nodig. Ze werken met elk model.

Bekijk alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇