tla-plus
БесплатноБез исполняемых скриптовНе проверенUse when writing, model checking, reviewing or repairing a TLA+ or PlusCal spec, answering whether a concurrent algorithm satisfies a property, extracting a…
от sammcj★ 175 звёзд на GitHubОб этом скилле
A spec is trusted because of checker runs. Every claim made about a spec names the run behind it: the constants, the properties checked, the state count.
The checker is tla (tla-rs, written in Rust). This skill uses no Java tooling, so TLC, SANY, Apalache and the PlusCal translator are unavailable. Write pure TLA+.
Run command -v tla before the first check. If it is missing, ask the user whether to install it with cargo install tla-checker, and install only after they agree, because it downloads and compiles a third-party package. If they decline, write the spec and report that nothing was checked.
Workflow
To review or audit an existing spec, do steps 1 and 2, follow references/review.md in place of steps 3 to 8, then report as in step 9 with the findings in that file's format.
- Create a task per step below, phrased with its completion criterion, then work them to completion. With no task tool, keep the list in your reply.
- Scope. Read any existing
.tlaand.cfgfiles first. Then write one line for each of: the processes and their environment (network, clock, adversary); the failure model (crash, recovery, loss, duplication, reorder, Byzantine); what must never happen; what must eventually happen; the bounds of the model. Ask the user only what the code and documents cannot answer. - Sample behaviours. Before any module, write two behaviours as sequences of states: one normal run, and one containing the interleaving or failure most likely to break the design. Done when every step says which values change. The step boundaries give the grain of atomicity. Keep both in the module header comment, because step 6 replays them.
- Model in layers. Start from
assets/Template.tlaandassets/Template.cfg. Write constants, variables andTypeOK, thenInit, then one action at a time, thenNextandSpec, then the properties. Begin the.cfgwithCONSTANTSonly, and addSPECIFICATION,INVARIANTSandPROPERTYas each definition appears, because a cfg that names a missing definition fails. After each layer runpython3 scripts/tla_check.py Spec.tla --validate-onlyand fix what it reports before adding the next. - Skeleton check. Confirm all five before the first check run:
TypeOKhas one conjunct per variable, and every sentinel is excluded from its real domain by anASSUME.Initassigns every variable.Nextis a disjunction of named actions, each with a guard, an effect, andUNCHANGEDfor every other variable.- At least one invariant beyond
TypeOKstates what the system must guarantee, with a comment arguing why each action preserves it. - The module header lists the abstraction decisions and the grain of atomicity.
- Check. In the
.cfg, nameSPECIFICATIONand everyINVARIANTandPROPERTY, with the smallest constants that still exhibit the protocol. Replay both sample behaviours withpython3 scripts/tla_check.py Spec.tla --scenario FILEuntil each printsVERDICT: allowed(file format inreferences/modelling.md). Then runpython3 scripts/tla_check.py Spec.tla(--helplists the options). On a violation, read the trace as a behaviour and decide which is wrong: the model, the design or the property. Fix that one and run again. Done when a run printsVERDICT: pass.- When the design is wrong, keep that cfg as the failing variant. Put each candidate fix behind its own constant switch and check each alone before combining them. The smallest fix is the fewest switches that pass.
- Make it fail. A model that cannot fail shows nothing. Add a second
.cfg, or a constant switch, that removes a guard or enables a known attack, and run it with--expect violation --expect-property Name, naming the property you care about. Done when it printsEXPECTED violation Name: ok. A deadlock, or a different property failing, does not count. If the variant still passes, the property is too weak or the model never reaches the dangerous state. - Liveness, when claimed. Add it after safety passes. State the fairness assumption for each action that must make progress, and check the property through
PROPERTYin the cfg. The template'sFairnessandFinishesshow the shape. Delete them when no liveness is claimed. - Report. Give:
- the abstraction decisions: what the model leaves out and why
- each run: cfg, constants, properties checked, verdict, states and depth
- the scope: a pass for 3 processes is a bounded result, so say "checked for 3 processes", and name the checker and its version (
tla --version) - what was not checked: larger bounds, liveness, proofs
- for a design bug: the violating trace, restated in the system's own terms
References
Read the one that matches the task in front of you.
- Choosing variables, the grain of atomicity or action boundaries ->
references/modelling.md - A parse error, a
TypeOKidiom or a.cfgquestion ->
Установить tla-plus в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл tla-plus?
Use when writing, model checking, reviewing or repairing a TLA+ or PlusCal spec, answering whether a concurrent algorithm satisfies a property, extracting a spec from code, or formally verifying a concurrent or distributed design.
Как установить скилл tla-plus?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл tla-plus запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic