Agent skill

Behavioral State Analysis

by quillai-network in quillai-network/quillshield_skills

Token-efficient smart contract security auditing via Behavioral State Analysis (BSA).

MITAuto-check passedSecurity

Install Behavioral State Analysis

skills CLI
$ npx skills add quillai-network/quillshield_skills --skill behavioral-state-analysis -a claude-code

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

GitHub CLI
$ gh skill install quillai-network/quillshield_skills behavioral-state-analysis --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/quillai-network/quillshield_skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/behavioral-state-analysis/skills/behavioral-state-analysis .claude/skills/behavioral-state-analysis && 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
behavioral-state-analysis
GitHub stars
129
Token cost
~1.4k tokens
SKILL.md length
589 words
Files
3 (incl. references)
Skills in repo
11
Repo updated
First seen
Licence
MIT

At a glance

Token-efficient smart contract security auditing via Behavioral State Analysis (BSA).

  • Works in 4 steps: Behavioral Decomposition (keep brief) → Threat Modeling (selected engines only) → Exploit Verification → …
  • Auditing smart contracts
  • SKILL.md covers When to Use, When NOT to Use, Token Budget Rules and Pipeline, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Behavioral State Analysis is an agent skill from quillai-network/quillshield_skills. Token-efficient smart contract security auditing via Behavioral State Analysis (BSA). Scopes analysis to contract type, runs only relevant threat engines, and uses tiered output depth. Use for auditing smart contracts, security reviews, or DeFi threat modeling.

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/confidence-scoring.md` and `references/threat-engines.md`).

It sits in Security, covering Smart contract auditing, Threat modeling and Crypto and DeFi analysis. The repository describes itself as: Structured skills for smart contract security audits. Infers state invariants, detects semantic guard gaps, models flash loan + oracle attack chains, simulates adversarial… The licence is MIT.

When your agent uses it

  • Auditing smart contracts
  • Security reviews
  • DeFi threat modeling

Example prompts

  • “/behavioral-state-analysis”

Workflow steps

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

  1. Behavioral Decomposition (keep brief)
  2. Threat Modeling (selected engines only)
  3. Exploit Verification
  4. Score & Prioritize

What it can do on your machine

Read from SKILL.md and the folder at commit 8bdd3c0. 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.

    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

Behavioral State Analysis loads about 1.4k tokens when it runs, and up to ~2.4k if it reads all its reference files. Until then it costs about 72 tokens; SKILL.md has 589 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~72
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.4k

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 quillai-network/quillshield_skills at commit 8bdd3c0, republished under its MIT licence (© quillai-network). 589 words, ~1,396 tokens.

Download SKILL.mdSave it as .claude/skills/behavioral-state-analysis/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
behavioral-state-analysis
description
Token-efficient smart contract security auditing via Behavioral State Analysis (BSA). Scopes analysis to contract type, runs only relevant threat engines, and uses tiered output depth. Use for auditing smart contracts, security reviews, or DeFi threat modeling.

Behavioral State Analysis (BSA)

Audit smart contracts by extracting behavioral intent, then systematically breaking it across security dimensions.

When to Use

  • Smart contract security audits
  • DeFi protocol threat modeling (DEXs, lending, staking, vaults)
  • Cross-contract attack surface analysis
  • Vulnerability prioritization with confidence scoring

When NOT to Use

  • Pure context building (use audit-context-building)
  • Entry point identification only (use entry-point-analyzer)
  • Single-dimension only (use semantic-guard-analysis or state-invariant-detection)

Token Budget Rules

Follow these strictly to avoid context exhaustion:

  1. Be terse. Use bullet points and tables, not prose. No filler sentences.
  2. Smart scope first. Classify the contract type in Phase 1, then run ONLY relevant engines in Phase 2 (see engine selection matrix below).
  3. Tiered output depth:
    • Critical/High findings → full detail + PoC code
    • Medium findings → root cause + exploit scenario (no PoC)
    • Low/Info findings → one-line description only
  4. No redundant analysis. If a dimension has no attack surface (e.g., no value flows = skip ETE), say "N/A" and move on.
  5. Cap Phase 1 output to ≤30 lines per contract. List invariants and states, skip verbose specification documents.
  6. PoC generation only for Critical and High severity findings. For others, describe the exploit path in ≤3 steps.
  7. Combine phases in output — don't repeat findings across phases. Each finding appears once with all metadata inline.

Pipeline

Phase 1: Behavioral Decomposition (keep brief)

Extract intent from code and docs. Output per contract:

Contract: <Name>
Type: <DeFi/Token/Governance/NFT/Utility/Proxy>
States: [list]
Key Invariants (≤5):
  - <invariant>
Privileged Roles: [list]
Value Entry/Exit Points: [list or "none"]

Then select engines:

Contract TypeRun ETERun ACTERun SITE
DeFi (DEX/lending/vault/staking)YesYesYes
Token (ERC20/721/1155)YesLiteLite
Governance/DAOLiteYesYes
NFT marketplaceYesYesLite
Utility/LibraryNoLiteLite
Proxy/UpgradeableNoYesYes

Lite = check only the top-priority item for that engine (see below).

Phase 2: Threat Modeling (selected engines only)

Run only the engines selected above. For each engine, analyze in this priority order — stop if contract surface is exhausted:

Economic Threat Engine (ETE):

  1. Value flow tracing — where can value enter/leave? Any sinks or circular flows?
  2. Economic invariant verification — does deposits == withdrawals + balance hold?
  3. Incentive analysis — any rational actor exploits (MEV, sandwich, griefing)?

Access Control Threat Engine (ACTE):

  1. Unprotected privileged functions — any admin/owner actions callable by anyone?
  2. Role escalation paths — can User → [actions] → Admin?
  3. msg.sender vs tx.origin confusion; signature replay

State Integrity Threat Engine (SITE):

  1. Non-atomic state updates — partial updates before external calls?
  2. Sequence vulnerabilities — initialization bypass, unexpected call ordering?
  3. Cross-contract stale data or reentrancy vectors

Lite mode = run only item #1 from that engine's list.

Show full SKILL.md (182 more words)Show less
Phase 3: Exploit Verification

For each hypothesis from Phase 2:

  • Build attack sequence (≤5 steps)
  • For Critical/High: generate minimal Foundry/Hardhat PoC (keep code short — test the specific vuln, not a full test suite)
  • Quantify impact: Critical (all funds/system) | High (significant loss/privesc) | Medium (griefing/DOS) | Low (info/best practice)
Phase 4: Score & Prioritize

Score: Confidence = (Evidence × Feasibility × Impact) / FP_Rate

Factor1.00.70.40.1
EvidenceConcrete path, no depsSpecific state neededPattern-basedHeuristic
FeasibilityPoC confirmedAchievable stateExternal conditionsInfeasible

Impact: 5=total loss, 4=partial loss, 3=griefing, 2=info leak, 1=best practice FP_Rate: 0.05 (known pattern) → 0.15 (moderate) → 0.40 (weak) → 0.60 (heuristic)

Prioritization: Report findings ≥10% confidence. Never suppress Impact ≥4.

Finding Format (use for every finding)

### [F-N] Title
Severity: Critical|High|Medium|Low  |  Confidence: X%
Location: contract.sol#L10-L25, functionName()
Root Cause: <1-2 sentences>
Exploit: <numbered steps, ≤5>
Impact: <1 sentence with quantified risk>
Fix: <code diff or 1-2 sentence recommendation>
PoC: <only for Critical/High — minimal test code>

Advanced Checks (run only if relevant to contract type)

  • Cross-contract: Map external call chains A→B→C, test transitive trust
  • Time-based: block.timestamp manipulation, expired signatures, replay
  • Upgradeable: Storage collisions, re-initialization, migration atomicity

Mindset

  • "Standard function" → can behave non-standardly in context
  • "Admin is trusted" → model admin compromise, check excessive powers
  • "Known pattern" → novel interactions in specific contexts
  • "Small value" → compounds; griefing scales
  • "Trusted external contract" → trust boundaries shift; verify actual code

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

Files

SKILL.md and 2 other files (references) in plugins/behavioral-state-analysis/skills/behavioral-state-analysis of quillai-network/quillshield_skills.

  • SKILL.md
  • references/confidence-scoring.md
  • references/threat-engines.md

Open the folder on GitHubat commit 8bdd3c0

Compare with similar skills

Behavioral State Analysis 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.

Behavioral State Analysis compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Behavioral State Analysis this skillquillai-network/quillshield_skills129—~1.4kAutomated safety check: PassMIT
Defi Amm Securityaffaan-m/ECC275k1 repos~1.3kAutomated safety check: PassMIT
Meme Coin Security Auditawarexone/Agentic-Bug-Hunter5.3k1 repos~2.4kAutomated safety check: PassMIT
Solana Devsolana-foundation/solana-dev-skill574—~3.8kAutomated safety check: PassMIT
Solidity AuditorGabson0x/bountyforge443—~3.7kAutomated safety check: PassNone
Solidity Auditorpashov/skills1.2k1 repos~9.9kAutomated safety check: PassMIT

Similar skills

  • Defi Amm Security

    affaan-m/ECC

    Security checklist for Solidity AMM contracts, liquidity pools, and swap flows.

    275k GitHub starsUsed in 1 repo~1.3k tokens
    Business, Finance & HRAuto-check passed
  • Meme Coin Security Audit

    awarexone/Agentic-Bug-Hunter

    Screens EVM and Solana meme coins for rug pull signs such as hidden mint, honeypot logic and fee tricks, starting with fast kill signals before any code review.

    5.3k GitHub starsUsed in 1 repo~2.4k tokens
    SecurityAuto-check passed
  • Solana Dev

    solana-foundation/solana-dev-skill

    A skill your agent uses when user asks to "build a Solana dapp", "write an Anchor program", "create a token", "debug Solana errors", "set up wallet connection", "test my Solana program", "fuzz my…

    574 GitHub stars~3.8k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Solidity Auditor

    Gabson0x/bountyforge

    Security audit of Solidity code while you develop. An agent skill from Gabson0x/bountyforge.

    443 GitHub stars~3.7k tokensUpdated 22 days ago
    Backend & APIsAuto-check passed
  • Solidity Auditor

    pashov/skills

    Security audit of Solidity code while you develop. An agent skill from pashov/skills.

    1.2k GitHub starsUsed in 1 repo~9.9k tokens
    Backend & APIsAuto-check passed
  • 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

More from quillai-network/quillshield_skills

All 11 skills in this repo
  • Dos Griefing Analysis

    quillai-network/quillshield_skills

    Detects Denial of Service and griefing vulnerabilities in smart contracts.

    129 GitHub stars~3.3k tokensUpdated 6 mo ago
    Auto-check passed
  • External Call Safety

    quillai-network/quillshield_skills

    Detects unsafe external call patterns and token integration vulnerabilities in smart contracts.

    129 GitHub stars~3.1k tokensUpdated 6 mo ago
    Auto-check passed
  • Input Arithmetic Safety

    quillai-network/quillshield_skills

    Detects input validation failures and arithmetic vulnerabilities in smart contracts.

    129 GitHub stars~3.1k tokensUpdated 6 mo ago
    Auto-check passed
  • Oracle Flashloan Analysis

    quillai-network/quillshield_skills

    Detects price oracle manipulation and flash loan attack vectors in DeFi smart contracts.

    129 GitHub stars~2.8k tokensUpdated 6 mo ago
    Auto-check passed
  • Proxy Upgrade Safety

    quillai-network/quillshield_skills

    Detects vulnerabilities in upgradeable proxy smart contracts including storage layout collisions, uninitialized implementations, function selector clashing, delegatecall context issues, and upgrade…

    129 GitHub stars~3.2k tokensUpdated 6 mo ago
    Auto-check passed
  • Reentrancy Pattern Analysis

    quillai-network/quillshield_skills

    Systematically detects all reentrancy vulnerability variants in smart contracts — classic, cross-function, cross-contract, and read-only reentrancy.

    129 GitHub stars~3.4k tokensUpdated 6 mo ago
    Auto-check passed

Categories

Questions about Behavioral State Analysis

What does Behavioral State Analysis do?

Token-efficient smart contract security auditing via Behavioral State Analysis (BSA). Behavioral State Analysis is an agent skill from quillai-network/quillshield_skills. Token-efficient smart contract security auditing via Behavioral State Analysis (BSA).

When should I use Behavioral State Analysis?

Behavioral State Analysis fits situations like: auditing smart contracts; security reviews; deFi threat modeling.

How do I install Behavioral State Analysis in Claude Code?

Run `npx skills add quillai-network/quillshield_skills --skill behavioral-state-analysis -a claude-code`. Or copy the skill folder (plugins/behavioral-state-analysis/skills/behavioral-state-analysis in quillai-network/quillshield_skills) into .claude/skills/behavioral-state-analysis in your project. Claude Code loads it when a task matches its description.

How do I install Behavioral State Analysis in Codex?

Run `npx skills add quillai-network/quillshield_skills --skill behavioral-state-analysis -a codex`. Or copy the skill folder (plugins/behavioral-state-analysis/skills/behavioral-state-analysis in quillai-network/quillshield_skills) into .agents/skills/behavioral-state-analysis in your project. Codex loads it when a task matches its description.

Can I use Behavioral State Analysis 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 quillai-network/quillshield_skills --skill behavioral-state-analysis -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/behavioral-state-analysis, .gemini/skills/behavioral-state-analysis, .github/skills/behavioral-state-analysis and .opencode/skills/behavioral-state-analysis in your project.

What does Behavioral State Analysis need to run?

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

Does Behavioral State Analysis 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 Behavioral State Analysis 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 Behavioral State Analysis use?

Behavioral State Analysis 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 Behavioral State Analysis use?

About 1.4k tokens (SKILL.md is roughly 5.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 957 tokens, read only when the agent opens those files.

What are the alternatives to Behavioral State Analysis?

Skills that share tags, products or a category with Behavioral State Analysis: Defi Amm Security (affaan-m/ECC, 275k stars), Meme Coin Security Audit (awarexone/Agentic-Bug-Hunter, 5.3k stars), Solana Dev (solana-foundation/solana-dev-skill, 574 stars) and Solidity Auditor (Gabson0x/bountyforge, 443 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Behavioral State Analysis?

quillai-network (a GitHub organization) maintains it in quillai-network/quillshield_skills, which has 129 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on March 30, 2026.

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