Agent skill

Overflow Safety

by PlamenTSV in PlamenTSV/plamen

Trigger Pattern Always required for Soroban audits - Inject Into Breadth agents, depth-edge-case

MITAuto-check passedSecurity

Install Overflow Safety

skills CLI
$ npx skills add PlamenTSV/plamen --skill overflow-safety -a claude-code

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

GitHub CLI
$ gh skill install PlamenTSV/plamen overflow-safety --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/soroban/overflow-safety .claude/skills/overflow-safety && 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
overflow-safety
GitHub stars
303
Token cost
~1.9k tokens
SKILL.md length
725 words
Files
1
Skills in repo
87
Repo updated
First seen
Licence
MIT

At a glance

Trigger Pattern Always required for Soroban audits - Inject Into Breadth agents, depth-edge-case

  • Works in 5 steps: Profile Check → Arithmetic Trace (if overflow-checks is… → Checked Arithmetic Patterns → …
  • Pattern Always required for Soroban audits - Inject Into Breadth agents
  • SKILL.md covers 1. Profile Check, 2. Arithmetic Trace (if…, 3. Checked Arithmetic Patterns and 4. i128 Boundary Analysis, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Overflow Safety is an agent skill from PlamenTSV/plamen. Trigger Pattern Always required for Soroban audits - Inject Into Breadth agents, depth-edge-case

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

It sits in Security, covering Smart contract auditing. It works with Stellar and Rust. 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 Soroban audits - Inject Into Breadth agents
  • Depth-edge-case

Example prompts

  • “/overflow-safety”

Workflow steps

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

  1. Profile Check
  2. Arithmetic Trace (if overflow-checks is false/missing)
  3. Checked Arithmetic Patterns
  4. i128 Boundary Analysis
  5. Division Precision

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 rust and 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 no API keys, tokens, secrets or passwords.

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

Context cost

Overflow Safety loads about 1.9k tokens when it runs. Until then it costs about 28 tokens; SKILL.md has 725 words of instructions outside code blocks.

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

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). 725 words, ~1,922 tokens.

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

OVERFLOW_SAFETY Skill (Soroban)

Trigger Pattern: Always required for Soroban audits Inject Into: Breadth agents, depth-edge-case Finding prefix: [OF-N] Rules referenced: R10, R14

Soroban contracts are compiled Rust. Rust's overflow behavior depends on the build profile: in debug builds, overflows panic; in release builds (used for deployment), overflows silently wrap by default unless overflow-checks = true is set. Silent wrapping in financial arithmetic is a critical vulnerability.

1. Profile Check

Before tracing any arithmetic, inspect Cargo.toml for the release profile overflow setting:

File[profile.release] Present?overflow-checks SettingSafe?
Cargo.tomlYES/NOtrue / false / MISSINGOnly if true

Interpretation:

  • overflow-checks = true → all integer arithmetic panics on overflow in release builds. The codebase is safe from silent wrapping.
  • overflow-checks = false or missing → overflows silently wrap in release. Proceed to Section 2.
  • If the file does not exist or does not contain [profile.release]: treat as false (Rust default for release).

Finding threshold: If overflow-checks is not true, the entire overflow safety of the contract depends on manual use of checked/saturating arithmetic. This is a configuration-level finding regardless of whether Section 2 finds specific overflow sites.

2. Arithmetic Trace (if overflow-checks is false/missing)

If the profile check from Section 1 found that overflow protection is NOT enabled, trace ALL arithmetic operations in financial paths:

LocationExpressionOperand TypesMax Realistic ValueOverflow Possible?Impact if Wrapped
{file:line}{a + b}u64 / i128 / u32{estimate}YES/NO{balance wraps to 0, share inflates, etc.}

Financial paths to prioritize:

  • Token balance calculations (balance + amount, total_supply + mint_amount)
  • Share/ratio calculations (shares * price / precision)
  • Fee calculations (amount * fee_bps / 10000)
  • Interest accrual (principal * rate * time)
  • Reward distributions (rewards_per_token * user_balance)

Wrapping arithmetic consequences:

  • u128 overflows near 2^128 ≈ 3.4 × 10^38 — practically unreachable for balances
  • i128 overflows near 2^127 ≈ 1.7 × 10^38 — practically unreachable for balances
  • u64 overflows near 1.8 × 10^19 — reachable with large token amounts in 6-decimal tokens
  • u32 overflows near 4.3 × 10^9 — reachable in ledger numbers, timestamps, counts

3. Checked Arithmetic Patterns

Identify all financial arithmetic and classify whether safe arithmetic methods are used:

LocationOperationMethod UsedSafe?
{file:line}{description}+ / checked_add / saturating_add / wrapping_addOnly checked_* or saturating_*

Safe methods:

  • checked_add(b) → returns Option<T>, panics or propagates None on overflow
  • checked_mul(b) → returns Option<T>
  • saturating_add(b) → clamps at MAX (safe for balances where MAX means "very rich")
  • checked_div(b) → also catches division by zero

Unsafe methods:

  • +, -, * without overflow-checks = true → silent wrapping in release
  • wrapping_add, wrapping_sub, wrapping_mul → explicitly wraps (intentionally unsafe for most contexts)
  • / → panics on divide-by-zero regardless of overflow-checks (covered in Section 5)

Flag any unchecked arithmetic where:

  • Operands are user-controlled (amounts, durations, counts)
  • The result feeds into a balance, share count, or reward calculation
Show full SKILL.md (301 more words)Show less

4. i128 Boundary Analysis

Soroban's native token and SEP-41 tokens frequently use i128 for amounts. Check operations near the boundaries:

LocationOperationUses i128?Near-Boundary RiskChecked?
{file:line}{expression}YES/NOYES/NOYES/NO

Specific checks:

  • Share calculations: shares = (amount * total_shares) / total_assets — if total_shares is near i128::MAX, multiplication overflows before division
  • Cumulative reward trackers: reward_per_token_stored += rewards * PRECISION / total_supply — accumulation can overflow over time
  • Negative balance checks: i128 allows negative values; verify contracts reject negative amount parameters via explicit require!(amount > 0)
  • Cast safety: u128 as i128 silently truncates if the u128 value exceeds i128::MAX

5. Division Precision

Soroban has no floating-point arithmetic. All division truncates toward zero (integer division). Incorrect division ordering causes precision loss or incorrect results:

LocationExpressionDivision-Before-Multiplication?Precision Loss EstimateImpact
{file:line}{a / b * c}YES → FLAG{up to b-1 units lost}{financial impact}

Anti-pattern (division before multiplication):

rust
// BAD: (amount / total_supply) loses precision before multiplying by rewards
let user_share = (user_balance / total_supply) * total_rewards;

Correct pattern (multiplication before division):

rust
// GOOD: multiply first to preserve precision
let user_share = (user_balance * total_rewards) / total_supply;

Additional checks:

  • Division by zero: verify all divisors are checked for zero before use. require!(total_supply > 0) before x / total_supply
  • Rounding direction: does truncation favor the protocol (rounding down on user withdrawals) or systematically favor attackers?
  • Precision constants: verify PRECISION / SCALAR constants match the token decimals being used
  • Intermediate type precision: if the protocol routes values through a fixed-point intermediate (e.g., FixedI128 with DENOMINATOR=10^N), verify N >= max(token_decimals) for all supported tokens. Double decimal conversion (token A decimals → intermediate → token B decimals) truncates at each step; if the intermediate has fewer precision digits than either token, significant value is silently lost

Finding Template

markdown
**ID**: [OF-N]
**Severity**: [Critical if balance wrapping, High if unchecked overflow in financial path, Medium if precision loss, Low if config-only]
**Step Execution**: ✓1,2,3,4,5 | ✗(reasons) | ?(uncertain)
**Rules Applied**: [R10:✓/✗, R14:✓/✗]
**Location**: src/{contract}.rs:LineN (or Cargo.toml for Section 1)
**Title**: {Overflow / Precision loss} in {fn_name} — {impact}
**Description**: [Specific arithmetic expression, operand types, worst-case values, and wrapping consequence]
**Impact**: [Balance wraps to near-zero / share inflation / reward theft / incorrect accounting]

Step Execution Checklist (MANDATORY)

SectionRequiredCompleted?Notes
1. Profile CheckYES✓/✗/?Read Cargo.toml [profile.release]
2. Arithmetic TraceIF overflow-checks not true✓/✗(N/A)/?All financial paths
3. Checked Arithmetic PatternsYES✓/✗/?All arithmetic in financial paths
4. i128 Boundary AnalysisYES✓/✗/?Wherever i128 used for amounts/shares
5. Division PrecisionYES✓/✗/?All division operations in financial paths

© 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/soroban/overflow-safety of PlamenTSV/plamen.

Open the folder on GitHubat commit 795962b

Compare with similar skills

Overflow Safety 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.

Overflow Safety compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Overflow Safety this skillPlamenTSV/plamen303—~1.9kAutomated safety check: PassMIT
Stellar DevVelaPayments/vela-payments131—~1.8kAutomated safety check: PassMIT
Web3 Smart Contract Auditawarexone/Agentic-Bug-Hunter5.3k3 repos~4.5kAutomated safety check: PassMIT
Solana Vulnerability Scannertrailofbits/skills7.4k—~3.6kAutomated safety check: PassCC-BY-SA-4.0
Cairo Vulnerability Scannertrailofbits/skills7.4k—~3.3kAutomated safety check: PassCC-BY-SA-4.0
Soroban Contract Auditsickn33/agentic-awesome-skills47k1 repos~1.4kAutomated safety check: PassMIT

Similar skills

  • Stellar Dev

    VelaPayments/vela-payments

    End-to-end Stellar development playbook. An agent skill from VelaPayments/vela-payments.

    131 GitHub stars~1.8k tokensUpdated 2 days ago
    Backend & APIsAuto-check passed
  • Web3 Smart Contract Audit

    awarexone/Agentic-Bug-Hunter

    Guides smart contract audits and bounty target selection with ten DeFi bug classes, kill signals, a Foundry PoC template and grep patterns.

    5.3k GitHub starsUsed in 3 repos~4.5k tokens
    SecurityAuto-check passed
  • Official

    Scans Solana programs for 6 critical vulnerabilities including arbitrary CPI, improper PDA validation, missing signer/ownership checks, and sysvar spoofing.

    7.4k GitHub stars~3.6k tokensUpdated yesterday
    SecurityAuto-check passed
  • Cairo Vulnerability Scanner

    trailofbits/skills

    Official

    Scans Cairo and StarkNet contracts for 6 vulnerability patterns, including felt252 overflow, L1 to L2 messaging faults, address conversion and signature replay.

    7.4k GitHub stars~3.3k tokensUpdated yesterday
    SecurityAuto-check passed
  • Soroban Contract Audit

    sickn33/agentic-awesome-skills

    Soroban smart contract security audit register: authorization checks, panic pathways, integer overflows, and storage footprint verification for Stellar.

    47k GitHub starsUsed in 1 repo~1.4k tokens
    SecurityAuto-check passed
  • Soroban Liquidity Pool

    sickn33/agentic-awesome-skills

    Automated market maker liquidity pool register: constant-product invariant curves, swap fee tiers, and LP token shares for Soroban DeFi.

    47k GitHub starsUsed in 1 repo~1.3k tokens
    SecurityAuto-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 13 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 13 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 13 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 13 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 13 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 13 days ago
    Auto-check passed

Works with

Categories

Questions about Overflow Safety

What does Overflow Safety do?

Trigger Pattern Always required for Soroban audits - Inject Into Breadth agents, depth-edge-case. Overflow Safety is an agent skill from PlamenTSV/plamen.

When should I use Overflow Safety?

Overflow Safety fits situations like: pattern Always required for Soroban audits - Inject Into Breadth agents; depth-edge-case.

How do I install Overflow Safety in Claude Code?

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

How do I install Overflow Safety in Codex?

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

Can I use Overflow Safety 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 overflow-safety -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/overflow-safety, .gemini/skills/overflow-safety, .github/skills/overflow-safety and .opencode/skills/overflow-safety in your project.

What does Overflow Safety need to run?

SKILL.md names no scripts, command-line tools or credentials: Overflow Safety is instructions for the agent only.

Does Overflow Safety 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 Overflow Safety 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 Overflow Safety use?

Overflow Safety 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 Overflow Safety use?

About 1.9k tokens (SKILL.md is roughly 7.7k 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 Overflow Safety?

Skills that share tags, products or a category with Overflow Safety: Stellar Dev (VelaPayments/vela-payments, 131 stars), Web3 Smart Contract Audit (awarexone/Agentic-Bug-Hunter, 5.3k stars), Solana Vulnerability Scanner (trailofbits/skills, 7.4k stars) and Cairo Vulnerability Scanner (trailofbits/skills, 7.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Overflow Safety?

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.