Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Tla From Code To Spec

ASecurity

Systematic method for extracting faithful TLA+ specifications from real source code in Rust Go Erlang Python or other languages. Use when the user supplies implementation code and wants a matching formal model or when checking conformance between code and an existing spec. Trigger on code-to-spec reverse engineering or implementation-aware modeling.

3 stars
0 votes
0 copies
0 views
Added 9/11/2026
businesspythonrustgo

Security Analysis

A100/100

Scanned 9/11/2026

Install to Claude Code

$npx -y skills add DylanCkawalec/Mermate --skill tla-from-code-to-spec --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Tla From Code To Spec?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Tla From Code To Spec
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/dylanckawalec-tla-from-code-to-spec/badge)](https://www.skillsdirectory.com/skills/dylanckawalec-tla-from-code-to-spec)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: tla-from-code-to-spec
description: Systematic method for extracting faithful TLA+ specifications from real source code in Rust Go Erlang Python or other languages. Use when the user supplies implementation code and wants a matching formal model or when checking conformance between code and an existing spec. Trigger on code-to-spec reverse engineering or implementation-aware modeling.
---

# From Code to Specification

## Persona Orientation

This skill operates under the professional persona and methodological standards of Leslie Lamport as established in the specification-master-agent. The goal is never a beautiful textbook model but a specification that is faithful to the actual system under study. Abstract only after the concrete transitions are understood, in the spirit of the sample-behavior discipline of Specifying Systems Chapter 7.

## Overview

The most common failure of AI-generated TLA+ is producing a clean textbook formalization that does not match the concrete system. This skill enforces a disciplined extraction process that keeps the model faithful to the actual code.

## Extraction Workflow

1. Identify the essential shared state and the per-process or per-component local state that matters for the properties.
2. Locate the atomic steps in the code (critical sections lock acquisitions message handlers transaction boundaries etc.). Each such step becomes a candidate action.
3. For every candidate action write the precise guard (when it is enabled) and the exact state update (how variables change). Mirror the data-structure operations used in the code (overwrite vs union map update vs set add etc.).
4. Abstract only after the concrete transitions are understood. Drop pure implementation details (logging buffers temporary variables) but keep the control and data flow that affect safety or liveness.
5. Validate by mentally or actually replaying execution traces from the real system against the model (transition validation).

## Language-Specific Notes

- **Rust** — ownership and borrowing already make mutation points explicit. Focus on the points where &mut or interior mutability is used and on concurrent primitives (Mutex channels atomics).
- **Go** — pay attention to goroutine creation channel operations and the select statement; these define the interleaving points.
- **Erlang/Elixir** — map processes to TLA+ process variables and message receives to actions that consume from a mailbox variable.
- **Python or other** — identify the concurrent units (threads async tasks) and the shared objects they mutate.

## Conformance Criteria

A model is faithful when

- every important transition the code can take is enabled by some action under the corresponding state
- the model does not enable transitions the code cannot take (or those extra transitions are explicitly documented as abstractions)
- the state representation is rich enough that the key invariants can be stated

When the code and the model diverge document the divergence and decide whether to change the model the code or the abstraction level.

## Anti-Patterns

- Emitting the Raft paper formalization when the user asked for etcd or RedisRaft.
- Collapsing multi-step code sequences into a single action that erases intermediate states the system actually reaches.
- Using set-union for a map overwrite or vice versa.

Always prefer a slightly uglier model that matches the code over a beautiful model that does not.

Attribution

DylanCkawalecDylanCkawalec
View sourceMore from DylanCkawalec →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Solution Architect

Designs system architecture, component specifications, and technical integration strategy. Use when: designing solutions, system architecture, technology stack, or integration approaches.

192 votes

Akorchak:Venture Assessment

Generate a comprehensive VC investment assessment report for a company

72 votes

Just Fucking Cancel

Find and cancel unwanted subscriptions by analyzing bank transactions. Detects recurring charges, calculates annual waste, and helps you cancel with direct URLs and browser automation. Use when: 'cancel subscriptions', 'audit subscriptions', 'find recurring charges', 'what am I paying for', 'save money', 'subscription cleanup', 'stop wasting money'. Supports CSV import (Apple Card, Chase, Amex, Citi, Bank of America, Capital One, Mint, Copilot) OR Plaid API for automatic transaction pull. Out...

6511 votes

Stock Analysis

Analyze stocks and cryptocurrencies using Yahoo Finance data. Supports portfolio management (create, add, remove assets), crypto analysis (Top 20 by market cap), and periodic performance reports (daily/weekly/monthly/quarterly/yearly). 8 analysis dimensions for stocks, 3 for crypto. Use for stock analysis, portfolio tracking, earnings reactions, or crypto monitoring.

6511 votes

Telegram Compose

Compose rich, readable Telegram messages using HTML formatting via direct Telegram API. Use when: (1) Sending any Telegram message beyond a simple one-line reply, (2) Creating structured messages with sections, lists, or status updates, (3) Need formatting unavailable via Clawdbot's Markdown conversion (underline, spoilers, expandable blockquotes, user mentions by ID), (4) Sending alerts, reports, summaries, or notifications to Telegram, (5) Want professional, scannable message formatting wit...

6511 votes
View all in business →