Agent skill

tla-plus-expert

TLA+ formal specification expert for writing specs, model checking, and applying formal methods to amplihack workflows

Stars 45
Forks 28

Install this agent skill to your Project

npx add-skill https://github.com/rysweet/amplihack/tree/main/.claude/skills/tla-plus-expert

SKILL.md

TLA+ Expert Skill

Purpose

Provides expert-level TLA+ formal specification assistance for designing, verifying, and reasoning about concurrent and distributed systems within amplihack.

When This Skill Activates

  • User asks to write or review a TLA+ specification
  • User needs help with model checking (TLC) configuration or output interpretation
  • User wants to formally verify a protocol or workflow design
  • User asks about invariants, liveness properties, or safety properties
  • User wants to apply formal methods to amplihack components
  • User mentions PlusCal or wants to translate between PlusCal and TLA+
  • User references Lamport, Demirbas, or formal methods best practices

How It Works

This skill delegates to the tla-plus-expert agent which has deep knowledge of:

  1. TLA+ language and idioms — writing specs, operators, temporal formulas
  2. TLC model checker — configuration, trace interpretation, state space management
  3. Seven mental models (Demirbas) — abstraction, global shared memory, local guards, invariants, stepwise refinement, atomicity refinement, communication
  4. Industry case studies — 8 production uses from AWS, MongoDB, Microsoft Azure
  5. AI + TLA+ limitations — SysMoBench findings on LLM capabilities and guardrails
  6. amplihack experiment infrastructure — manifest-driven experiments, heuristic scoring, TLC validation integration

Integration with Existing Infrastructure

The amplihack repo includes a TLA+ experiment runner at src/amplihack/eval/tla_prompt_experiment.py with:

  • Manifest-driven experiment matrix (models x prompt variants x repeats)
  • 6 heuristic scoring dimensions
  • Real TLC validation support
  • Replay and live execution modes

TLA+ specs live in experiments/hive_mind/tla_prompt_language/specs/.

Usage Examples

# Write a spec for a new protocol
/tla-plus-expert Write a TLA+ spec for our consensus voting workflow

# Review an existing spec
/tla-plus-expert Review specs/SmartOrchestrator.tla for correctness

# Help with TLC output
/tla-plus-expert TLC found a counterexample in my spec, help me understand it

# Decide if TLA+ is appropriate
/tla-plus-expert Should I formally specify this retry cascade logic?

# Generate invariants
/tla-plus-expert What invariants should I check for a parallel workstream manager?

Key Resources

  • TLA+ specs: experiments/hive_mind/tla_prompt_language/specs/
  • Experiment runner: src/amplihack/eval/tla_prompt_experiment.py
  • TLC binary: /usr/local/bin/tlc (if installed)
  • Issue #3939: TLA+ integration roadmap

Expand your agent's capabilities with these related and highly-rated skills.

rysweet/amplihack

chemist-analyst

Analyzes events through chemistry lens using molecular structure, reaction mechanisms, thermodynamics, kinetics, and analytical techniques (spectroscopy, chromatography, mass spectrometry). Provides insights on chemical processes, material properties, reaction pathways, synthesis, and analytical methods. Use when: Chemical reactions, material analysis, synthesis planning, process optimization, environmental chemistry. Evaluates: Molecular structure, reaction mechanisms, yield, selectivity, safety, environmental impact.

45 28
Explore
rysweet/amplihack

learning-path-builder

Creates personalized learning paths for technologies, frameworks, or concepts. Use for user-interactive session only for onboarding new technologies, hackathon skill-building, or personal development planning. Not for use in automated development or investigation. Sequences resources (docs, tutorials, exercises) based on current skill level and learning goals. Adapts to learning style: hands-on, theory-first, project-based.

45 28
Explore
rysweet/amplihack

gh-work-report

Generates comprehensive GitHub activity reports across all authenticated accounts. Gathers repos, PRs, features, and themes for configurable time periods (1/5/7/30/90 days). Produces shareable markdown with tables, mermaid charts, and executive summaries. Can create a private repo with GitHub Actions automation and GitHub Pages aggregation site. Use when: "github report", "work report", "activity summary", "what did I work on", "gh-work-report", "show my github activity".

45 28
Explore
rysweet/amplihack

pr-review-assistant

Philosophy-aware PR reviews checking alignment with amplihack principles. Use when reviewing PRs to ensure ruthless simplicity, modular design, and zero-BS implementation. Suggests simplifications, identifies over-engineering, verifies brick module structure. Posts detailed, constructive review comments with specific file:line references.

45 28
Explore
rysweet/amplihack

code-smell-detector

Identifies anti-patterns specific to amplihack philosophy. Use when reviewing code for quality issues or refactoring. Detects: over-abstraction, complex inheritance, large functions (>50 lines), tight coupling, missing __all__ exports. Provides specific fixes and explanations for each smell.

45 28
Explore
rysweet/amplihack

biologist-analyst

Analyzes living systems and biological phenomena through biological lens using evolution, molecular biology, ecology, and systems biology frameworks. Provides insights on mechanisms, adaptations, interactions, and life processes. Use when: Biological systems, health issues, evolutionary questions, ecological problems, biotechnology. Evaluates: Function, structure, heredity, evolution, interactions, molecular mechanisms.

45 28
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results