Agent skill

Choice Semantics

by PlamenTSV in PlamenTSV/plamen

Trigger Pattern Always required for DAML audits - Inject Into Breadth agents, depth-state-trace, depth-edge-case

MITAuto-check passed

Install Choice Semantics

skills CLI
$ npx skills add PlamenTSV/plamen --skill choice-semantics -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install PlamenTSV/plamen choice-semantics --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/PlamenTSV/plamen.git skills-src && mkdir -p .claude/skills && cp -r skills-src/agents/skills/daml/choice-semantics .claude/skills/choice-semantics && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
choice-semantics
GitHub stars
303
Token cost
~1.5k tokens
SKILL.md length
556 words
Files
1
Skills in repo
87
Repo updated
First seen
Licence
MIT

At a glance

Trigger Pattern Always required for DAML audits - Inject Into Breadth agents, depth-state-trace, depth-edge-case

  • Works in 4 steps: Consume-Mode Inventory → Pre/Postconsuming Ordering Trace → Successor-State Completeness → …
  • Pattern Always required for DAML audits - Inject Into Breadth agents
  • SKILL.md covers 1. Consume-Mode Inventory, 2. Pre/Postconsuming Ordering…, 3. Successor-State Completeness and 4. Cancel / Abort Unwind, plus 2 more sections
  • Needs NO_SUCH_KEY

What it does

Choice Semantics is an agent skill from PlamenTSV/plamen. Trigger Pattern Always required for DAML audits - Inject Into Breadth agents, depth-state-trace, depth-edge-case

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: Autonomous Web3 security audit agent for Claude Code. The licence is MIT.

When your agent uses it

  • Pattern Always required for DAML audits - Inject Into Breadth agents
  • Depth-state-trace
  • Depth-edge-case

Example prompts

  • “/choice-semantics”

Requirements

  • A credential in NO_SUCH_KEY

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Consume-Mode Inventory
  2. Pre/Postconsuming Ordering Trace
  3. Successor-State Completeness
  4. Cancel / Abort Unwind

What it can do on your machine

Read from SKILL.md and the folder at commit 795962b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are markdown).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • NO_SUCH_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Choice Semantics loads about 1.5k tokens when it runs. Until then it costs about 32 tokens; SKILL.md has 556 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~32
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from PlamenTSV/plamen at commit 795962b, republished under its MIT licence (© PlamenTSV). 556 words, ~1,546 tokens.

Download SKILL.mdSave it as .claude/skills/choice-semantics/SKILL.md (or your agent's skills folder).
name
choice-semantics
description
Trigger Pattern Always required for DAML audits - Inject Into Breadth agents, depth-state-trace, depth-edge-case

CHOICE_SEMANTICS Skill (DAML)

Trigger Pattern: Always required for DAML audits Inject Into: Breadth agents, depth-state-trace, depth-edge-case Finding prefix: [DML-CHS-N] Rules referenced: R8, R10, R12, R14

In DAML a "write" is a choice that archives a contract and creates a successor. The consume-mode of a choice determines whether the contract survives the exercise: a consuming choice (the default) archives the contract on the first exercise; a nonconsuming choice leaves it active. Misusing consume-mode is the DAML analog of double-spend: a value-moving choice marked nonconsuming can be exercised repeatedly on the same contract. Pre/postconsuming ordering bugs (self-fetch after archive), value-conservation gaps across split/merge/transfer, accumulator/cap drift across transactions, and cancel/abort paths that leave consequences un-unwound round out this class.

1. Consume-Mode Inventory

For EVERY choice, record its consume-mode and whether the action should be one-shot:

Template.ChoiceConsume-ModeMoves Value / Mutates State?Should Be One-Shot?Mismatch?
{T.C}consuming/nonconsuming/preconsuming/postconsumingYES/NOYES/NO[DML-CHS-N] if nonconsuming + should-be-one-shot

Critical patterns to flag:

  • A nonconsuming choice that transfers, mints, splits, or withdraws value → exercisable repeatedly on the same active contract ([ELEVATE:NONCONSUMING_REPLAY], double-spend).
  • A consuming choice intended to be repeatable that archives the contract and strands its peers.

DAML note: A consuming choice archives the contract; a SECOND exerciseCmd on the same ContractId MUST fail with CONTRACT_NOT_FOUND. That failure REFUTES a double-spend claim for a consuming choice. Double-spend is only reachable when the value-mover is nonconsuming (or recreates an equivalent contract).

2. Pre/Postconsuming Ordering Trace

preconsuming archives BEFORE the body runs; postconsuming archives AFTER. A body that fetches self (or this via key) behaves differently across the two.

Template.ChoiceConsume-ModeBody Self-Fetch / Self-Exercise?Reads Pre-Archive State?Finding?
{T.C}pre/postconsumingYES/NOYES/NO[DML-CHS-N] if ordering-dependent

Attack: A preconsuming choice that fetches its own contract by key in the body gets NO_SUCH_KEY/CONTRACT_NOT_FOUND because the archive already happened — either a brick (liveness) or, if guarded by a lookupByKey, a silent wrong branch. A postconsuming choice that re-exercises a sibling assuming self is gone may double-act.

Show full SKILL.md (234 more words)Show less

3. Successor-State Completeness

Each value-moving choice should produce successor contracts that conserve value and carry forward every invariant field.

Template.ChoiceInputs (contracts/amounts)Outputs CreatedConservation CheckFields Carried ForwardGap?
{T.C}{in}{out}out1.amt + out2.amt == in.amt?owner/lock/maintainer[DML-CHS-N] if value created/destroyed or field dropped

Check for:

  • Split/merge where the sum of outputs ≠ input (value created or burned; rounding direction favors the caller) — R14 cross-variable conservation.
  • A successor that drops a locked, owner, or maintainer field present in the predecessor (metadata/lock erase).
  • An accumulator/cap field (totalIssued, mintedSoFar) that is NOT updated on the create path, so the cap is never enforced across transactions ([ELEVATE:VALUE_CONSERVATION], R14).

4. Cancel / Abort Unwind

A choice that allocates or locks resources must unwind them on the cancel/abort/reject path.

Template.ChoiceAllocates/Locks On SuccessCancel/Reject Choice Exists?Unwinds Allocation?Finding?
{T.C}{child created / asset locked}YES/NOYES/NO[DML-CHS-N] if no unwind

Attack: A Propose/Reserve choice creates a child contract or locks an asset; the Cancel/Reject choice archives the proposal but leaves the child/locked asset active. The reserved value is stranded or double-counted. Verify the cancel path archives every contract the success path created.

Finding Template

markdown
**ID**: [DML-CHS-N]
**Severity**: [Critical if double-spend/value-creation, High if conservation/lock-erase, Medium if liveness-only]
**Step Execution**: ✓1,2,3,4 | ✗(reasons) | ?(uncertain)
**Rules Applied**: [R8:✓/✗, R10:✓/✗, R12:✓/✗, R14:✓/✗]
**Location**: {Module}.daml:LineN (template X, choice Y)
**Title**: {Choice} nonconsuming value-mover / value-conservation gap allows {double-spend / value inflation}
**Description**: [Consume-mode or conservation gap with the exact in/out amounts and the field or successor that breaks]
**Impact**: [Repeated exercise on same contract / value created or destroyed / stranded locked asset / cap unenforced]
**PoC steer**: exercise the same `ContractId` twice (nonconsuming double-spend), or assert `out1.amt + out2.amt /= in.amt`, or `query@T` a stranded child after cancel.

Step Execution Checklist (MANDATORY)

SectionRequiredCompleted?Notes
1. Consume-Mode InventoryYES✓/✗/?Every choice, value-movers especially
2. Pre/Postconsuming Ordering TraceIF pre/postconsuming present✓/✗(N/A)/?Every self-fetch/self-exercise
3. Successor-State CompletenessYES✓/✗/?Every split/merge/transfer + accumulator
4. Cancel / Abort UnwindIF allocate/lock-then-cancel pattern✓/✗(N/A)/?Every reserve/propose with a cancel path

© PlamenTSV, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in agents/skills/daml/choice-semantics of PlamenTSV/plamen.

Open the folder on GitHubat commit 795962b

Compare with similar skills

Choice Semantics next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Choice Semantics compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Choice Semantics this skillPlamenTSV/plamen303—~1.5kAutomated safety check: PassMIT
Golang Patternsaffaan-m/ECC275k—~1.1kAutomated safety check: PassMIT
React Audit Grep Patternsgithub/awesome-copilot40k1 repos~461Automated safety check: PassMIT
Dotnet Patternsaffaan-m/ECC275k1 repos~2.3kAutomated safety check: PassMIT
Fastapi Patternsaffaan-m/ECC275k—~2.3kAutomated safety check: PassMIT
Kotlin Exposed Patternsaffaan-m/ECC275k4 repos~5.5kAutomated safety check: PassMIT

Similar skills

  • Golang Patterns

    affaan-m/ECC

    Go-specific design patterns and best practices including functional options, small interfaces, dependency injection, concurrency patterns, error handling, and package organization.

    275k GitHub stars~1.1k tokensUpdated 3 days ago
    DevelopmentAuto-check passed
  • React Audit Grep Patterns

    github/awesome-copilot

    Official

    Provides the complete, verified grep scan command library for auditing React codebases before a React 18.3.1 or React 19 upgrade.

    40k GitHub starsUsed in 1 repo~461 tokens
    Auto-check passed
  • Dotnet Patterns

    affaan-m/ECC

    Idiomatic C and .NET patterns, conventions, dependency injection, async/await, and best practices for building robust, maintainable .NET applications.

    275k GitHub starsUsed in 1 repo~2.3k tokens
    DevelopmentAuto-check passed
  • Fastapi Patterns

    affaan-m/ECC

    FastAPI patterns for async APIs, dependency injection, Pydantic request and response models, OpenAPI docs, tests, security, and production readiness.

    275k GitHub stars~2.3k tokensUpdated 3 days ago
    Backend & APIsAuto-check passed
  • JetBrains Exposed ORM patterns including DSL queries, DAO pattern, transactions, HikariCP connection pooling, Flyway migrations, and repository pattern.

    275k GitHub starsUsed in 4 repos~5.5k tokens
    DatabasesAuto-check passed
  • Python Patterns

    affaan-m/ECC

    Python-specific design patterns and best practices including protocols, dataclasses, context managers, decorators, async/await, type hints, and package organization.

    275k GitHub stars~2.3k tokensUpdated 3 days ago
    DevelopmentAuto-check passed

More from PlamenTSV/plamen

All 87 skills in this repo
  • Audit Prep

    PlamenTSV/plamen

    Prepare Solidity projects for a security audit — test coverage, test quality, NatSpec docs, code hygiene, dependency health, best-practice enforcement, deployment readiness, and project…

    303 GitHub stars~3.7k tokensUpdated 12 days ago
    Auto-check passed
  • Verification Protocol

    PlamenTSV/plamen

    Trigger Pattern Always (used by all verifier agents) - Inject Into security-verifier agents (Phase 5)

    303 GitHub stars~3.5k tokensUpdated 12 days ago
    Auto-check passed
  • Ability Analysis

    PlamenTSV/plamen

    Trigger Pattern Always (Aptos Move) - foundational security check - Inject Into Breadth agents, depth agents

    303 GitHub stars~3.3k tokensUpdated 12 days ago
    Auto-check passed
  • Ability Analysis

    PlamenTSV/plamen

    Trigger Pattern Always (Sui Move) -- foundational security check - Inject Into Breadth agents, depth agents

    303 GitHub stars~3.2k tokensUpdated 12 days ago
    Auto-check passed
  • Account Lifecycle

    PlamenTSV/plamen

    Trigger Pattern ACCOUNTCLOSING flag detected (close/CloseAccount usage) - Inject Into Breadth agents, depth agents

    303 GitHub stars~1.2k tokensUpdated 12 days ago
    Auto-check passed
  • Account Validation

    PlamenTSV/plamen

    Trigger Pattern Always required for Solana audits - Inject Into Breadth agents, depth agents

    303 GitHub stars~1.7k tokensUpdated 12 days ago
    Auto-check passed

Questions about Choice Semantics

What does Choice Semantics do?

Trigger Pattern Always required for DAML audits - Inject Into Breadth agents, depth-state-trace, depth-edge-case. Choice Semantics is an agent skill from PlamenTSV/plamen.

When should I use Choice Semantics?

Choice Semantics fits situations like: pattern Always required for DAML audits - Inject Into Breadth agents; depth-state-trace; depth-edge-case.

How do I install Choice Semantics in Claude Code?

Run `npx skills add PlamenTSV/plamen --skill choice-semantics -a claude-code`. Or copy the skill folder (agents/skills/daml/choice-semantics in PlamenTSV/plamen) into .claude/skills/choice-semantics in your project. Claude Code loads it when a task matches its description.

How do I install Choice Semantics in Codex?

Run `npx skills add PlamenTSV/plamen --skill choice-semantics -a codex`. Or copy the skill folder (agents/skills/daml/choice-semantics in PlamenTSV/plamen) into .agents/skills/choice-semantics in your project. Codex loads it when a task matches its description.

Can I use Choice Semantics in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add PlamenTSV/plamen --skill choice-semantics -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/choice-semantics, .gemini/skills/choice-semantics, .github/skills/choice-semantics and .opencode/skills/choice-semantics in your project.

What does Choice Semantics need to run?

Going by SKILL.md and its folder, Choice Semantics needs credentials named NO_SUCH_KEY. Our summary lists: A credential in NO_SUCH_KEY.

Does Choice Semantics access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Choice Semantics safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Choice Semantics use?

Choice Semantics is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Choice Semantics use?

About 1.5k tokens (SKILL.md is roughly 6.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Choice Semantics?

Skills that share tags, products or a category with Choice Semantics: Golang Patterns (affaan-m/ECC, 275k stars), React Audit Grep Patterns (github/awesome-copilot, 40k stars), Dotnet Patterns (affaan-m/ECC, 275k stars) and Fastapi Patterns (affaan-m/ECC, 275k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Choice Semantics?

PlamenTSV (a GitHub user) maintains it in PlamenTSV/plamen, which has 303 GitHub stars. The repository holds 87 skills in this directory. The repository was last updated on September 26, 2026.

Source: PlamenTSV/plamen on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.