Skip to main content
skill CX Codex

vstack-s3-model — Claude Code skill: modeling and install

The vstack-s3-model Claude Code skill builds transition models from pinned source code. It captures environment actions, engine responses, and visible interleavings.

MIT ★ 89 updated 2026-11-16

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add hao-ai-lab/vstack
/plugin install vstack@hao-ai-lab-vstack
Open on GitHub

What vstack-s3-model does

The skill guides construction of a transition model from frozen contracts and source maps. It ties actions and ledger methods to source lines and revisions, and extracts constants from pinned code when possible.

Separate visible shared writes stay separate model steps, with Next defined as their disjunction. External events such as cancellation, disconnects, and timeouts get environment actions; engine responses get their own actions. Critical paths need reachability witnesses, while mapping dependencies that have not been checked go in an ASSUMES header.

The workflow covers invariant checks, fairness, termination, and failure paths, as well as switch combinations against the source revision. scripts/assumptions_check.sh and scripts/op_mirror.sh validate limited syntax; neither parses TLA+ semantics. Source-anchor checking has no generic checker, so some review remains manual.

What it helps with

  • bind model actions to source lines and revisions
  • keep visible shared writes as separate model steps
  • represent external stimuli and engine responses
  • check critical-path reachability and model invariants

Example prompts for the agent

  • Build a transition model from the pinned code and bind each action to its source lines and revision.
  • Represent cancellation and timeout as environment actions, with engine responses modeled separately.
  • Review action boundaries, termination, and deadlock checks in the model.

How to install vstack-s3-model

1Plugin marketplace

/plugin marketplace add hao-ai-lab/vstack
/plugin install vstack@hao-ai-lab-vstack

This installs the whole vstack plugin with all its skills

2Skills CLI (Vercel)

npx skills add hao-ai-lab/vstack --skill vstack-s3-model -a claude-code

3Manually: put the files in place

~/.claude/skills/vstack-s3-model/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/vstack-s3-model/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about vstack-s3-model

How do I install vstack-s3-model in Claude Code?

Add the marketplace with /plugin marketplace add hao-ai-lab/vstack, then install the plugin with /plugin install vstack@hao-ai-lab-vstack.

What does vstack-s3-model do?

It guides transition modeling from pinned source code, linking actions to source locations while preserving interleavings and modeling environment and engine behavior.

How does vstack-s3-model handle external events?

Events such as cancellation and timeout are represented by Env_* actions, while engine responses use Engine_* actions. Fairness applies to engine actions, except in named control configurations.

Source text

SKILL.md · MIT
---
name: vstack-s3-model
description: "Construct state transitions or computation descriptors from pinned code without hiding interleavings or unchecked assumptions."
---

# S3 — Build an anchored model

Read [Layer 0: shared operating rules](../../docs/layer-0.md), this stage and the assigned input bundle.

## Role and write scope

The worker owns a new model version and append-only notes, never upstream pins or gold expectations.

## 1. Input

Frozen contracts from S2 and maps from S0, with hashes.

## 2. Procedure

1. Fill [the case playbook](../../templates/case-playbook.md). Bind every action, descriptor and ledger method to source lines and revision. For the full adequacy readout, write each modeled guard and state update as a named operator and list it in the [anchor map](../../docs/model-adequacy.md#anchor-map).
2. Extract constants from pinned source when possible; do not let a correct verdict hide a transcribed constant error.
3. Preserve atomicity: two separately visible shared writes are two model steps. Name actions; make `Next` their disjunction; keep deadlock checking and an explicit legitimate terminal action.
4. Use switches for historical bugs and repair components in one model. `Bug*` needs a real historic revision; use `Mut*` otherwise. Check complete switch combinations against the source revision.
5. Give critical paths reachability witnesses (`W_*`, see [anti-vacuity checks](../../docs/exposure-gate.md#anti-vacuity-checks)). Declare unchecked mapping dependencies in one `ASSUMES` header and ensure every using configuration checks them; this comment is not permission to add proof axioms.
6. Finish invariant discovery and have the coordinator pin its full definition before deductive proof. Prove this calibrated model; prove bridges from proof-layer helpers to its pinned definitions. Do not replace the model.
7. Model the environment by the rules below.

### Open environment

Model each external stimulus `E` (cancel, disconnect, session close, admin pause, cache flush, weight update, timeout expiry) as `Env_*` actions and the engine's responses as `Engine_*` actions; one action may carry both when the code dispatches them together.

| Rule | Requirement |
|---|---|
| Input enabled | For each `E`, define `InputEnabled_<E> == EnvPremise_<E> => ENABLED Handle_<E>` and check it as an invariant. `EnvPremise_<E>` holds while the environment's own finite budget lasts and the object exists from the client's side (for example `nAbort < MaxAbort` and the request is still open for its client). `Handle_<E>` is any action that takes `E`: handles it now, records it as pending, or rejects it by a code branch. TLC evaluates `ENABLED` in invariants; with a checker that cannot, cover every branch explicitly or give each branch a reachability witness. |
| Guard rule | Every enabling guard of every action, `Engine_*` included, is either the condition the code evaluates at its `file:line@commit` anchor or a registered finite bound or `\* ASSUMES:` premise. Anything else is illegal pruning; keep real failure paths, such as a full allocator raising or asserting. |
| Caller contracts | Restrict a call order only when the engine's documentation forbids it and the code rejects it. Name the restriction `EnvContract_<name>`, declare it in the `\* ASSUMES:` header with the documentation quoted verbatim and its source, and run a robustness control without it. Report a violation in that control as a robustness finding outside the documented contract. |
| Fairness | Put `WF`/`SF` on `Engine_*` actions only. Environment actions get no fairness except in a named control. Every liveness check registers `EnvEventuallyQuiet`: a finite total of arrivals, or a named constant after which the environment stops. |
| Restrictions | Named environment timing restrictions follow the [asymmetric rule](../../docs/run-review.md#environment-restrictions-and-freedoms): hunt and control configurations only, never a configuration reported as passing. |

## 3. Exit checks

- Check every source anchor. The source workflow has case-specific checkers; no generic anchor checker is bundled.
- Review action boundaries, named `Next`, termination and deadlock settings manually.
- Check every `InputEnabled_<E>` invariant and every `W_*` witness in each delivered configuration. Review each guard against its anchor or registered bound; this is partly manual.
- `scripts/assumptions_check.sh MANIFEST` checks the supported header/config syntax. `scripts/op_mirror.sh` checks only its documented record-update dialect; neither is a semantic TLA+ parser.
- Confirm that frozen inputs remain unchanged.

## 4. Rollback

A missing writer returns to S0 with its source location. A contract defect returns to S2. Do not patch upstream artifacts to fit the new model. Use [a rollback ticket](../../templates/rollback.md).

## Concrete Examples

In a PD KV slot lifecycle, dequeue accounting and the following status check may be separately visible. Preserve that interleaving instead of merging both into one atomic model step.

© Hao AI Lab · MIT · hao-ai-lab/vstack

Similar skills

All skills for Testing and QA →

From the same set13

The whole set →
vstack-s6-hunt-fix The vstack-s6-hunt-fix Claude Code skill searches for bugs within a trace-validated model and checks proposed fixes. It classifies counterexamples and tests changes against real code. CX Codex +1 ★ 89repo stars vstack-s0-decompose vstack-s0-decompose is a Claude Code skill that maps system control, data flow, and boundaries, then builds evidence-backed historical anchors. It runs during analysis of a pinned source revision before verification. CX Codex +1 ★ 89repo stars vstack-s4-calibrate-tv The vstack-s4-calibrate-tv Claude Code skill calibrates behavior models and checks them against real traces. It runs stage S4 checks for bugs, fixes, repair components, and reachability witnesses. CX Codex +1 ★ 89repo stars vstack-mode The vstack-mode Claude Code skill runs staged verification for concurrent, distributed, and systems software. It takes a property from source investigation through proof and regression. CX Codex +1 ★ 89repo stars vstack-s2-spec The vstack-s2-spec Claude Code skill turns a design into testable specifications and pinned checks. It runs during specification work based on an approved S1 design and obligation matrix. CX Codex +1 ★ 89repo stars vstack-s5-redteam The vstack-s5-redteam Claude Code skill probes a model and its gates with independent attacks. It runs at stage S5 to expose weak checks and verify findings against real code. CX Codex +1 ★ 89repo stars vstack-s8-package-maintain The vstack-s8-package-maintain Claude Code skill turns verified project scope into a five-step regression workflow. It handles regression setup and upkeep as code changes. CX Codex +1 ★ 89repo stars vstack-s7-prove The vstack-s7-prove Claude Code skill guides deductive proofs of design-model properties in TLAPS. It starts after invariant discovery, model calibration, and trace alignment with code. CX Codex +1 ★ 89repo stars

Project sponsors

Companies that keep this analytics open