cmodel

Translate security specifications into Alloy models and run the Alloy Analyzer.

65|2|Updated Mar 27, 2026
One-click install
npx skills add https://github.com/joshft/correctless --skill cmodel
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cmodel
Source: https://github.com/joshft/correctless/tree/main/correctless/skills/cmodel
Command: npx skills add https://github.com/joshft/correctless --skill cmodel

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Translate security-relevant specifications into formal Alloy models and run the Alloy Analyzer to detect design-level issues before coding.

Core Features & Use Cases

  • Formalize state-machine, protocol, and trust-boundary behavior into an Alloy model and run analysis.
  • Provide counterexample-guided insights to refine specifications and design.
  • Integrate after /cspec to validate invariants against the modeled system.

Quick Start

After creating the spec with /cspec, run /cmodel to generate an Alloy model and run the Analyzer.

Frequently Asked Questions about cmodel

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I translate a security specification into an Alloy formal model?

You can translate a security specification into an Alloy formal model by using the generation command after your spec is created. It outputs an Alloy model file using signatures, facts, and assertions to represent trust boundaries and state machines.

Can I use formal modeling to verify access control assumptions before coding?

Yes, formal modeling verifies access control assumptions by running the Alloy Analyzer with an attacker model. It detects design-level security issues and provides counterexamples to refine invariants and access control logic before you write code.

What is counterexample-guided analysis for security design in Alloy?

Counterexample-guided analysis in Alloy is a verification method that checks security invariants against a bounded system model. It identifies design flaws by generating counterexamples, which you use to refine your specifications and trust-boundary definitions.

Does formal security modeling work with state machines and protocol handling?

Formal security modeling supports features with state machines and protocol handling by mapping transitions and trust boundaries into an Alloy model. This allows you to verify state invariants and protocol security assumptions before implementation.

Do I need a specification before generating an Alloy model for security analysis?

Yes, you need a specification created first. The Alloy model generation integrates after the spec creation step to formalize the documented security-relevant behavior, invariants, and trust boundaries into an analyzable format.

What are the limitations of bounded analysis in Alloy for security verification?

Bounded analysis in Alloy verifies security within a finite scope, meaning it can find counterexamples up to a defined bound but cannot mathematically prove the absence of vulnerabilities in unbounded state spaces or infinitely large protocol instances.