Skip to content
Back to skills

External Precondition Audit

ASecurity

Trigger Pattern Any external contract interaction detected in attack_surface.md - Inject Into Breadth agents (merged via M7 hierarchy)

  • 281 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 6, 2026
blockchaingo

Security analysis

A100/100

Scanned September 6, 2026

npx -y skills add PlamenTSV/plamen --skill external-precondition-audit --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of External Precondition Audit?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for External Precondition Audit
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/plamentsv-external-precondition-audit-plamen/badge)](https://www.skillsdirectory.com/skills/plamentsv-external-precondition-audit-plamen)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: "external-precondition-audit"
description: "Trigger Pattern Any external contract interaction detected in attack_surface.md - Inject Into Breadth agents (merged via M7 hierarchy)"
---

# EXTERNAL_PRECONDITION_AUDIT Skill

> **Trigger Pattern**: Any external contract interaction detected in attack_surface.md
> **Inject Into**: Breadth agents (merged via M7 hierarchy)
> **Constraint**: Interface-level inference only -- no production fetch required

For every external contract the protocol interacts with:

## 1. Interface-Level Requirement Inference

From the interface/import used by the protocol, infer what the external contract requires:

| External Function Called | Parameters Passed | Likely Preconditions (from interface) | Our Protocol Validates? |
|-------------------------|-------------------|---------------------------------------|------------------------|

**Inference method**: Read the function signature, parameter names, NatSpec comments (if any),
and common patterns for that function type. Example: `IVault.swap(FundManagement memory funds)`
-> infer that `funds.sender` must be authorized, `funds.recipient` determines where output goes.

## 2. Return Value Consumption

| External Call | Return Type | How Protocol Uses Return | Failure Mode if Return Unexpected |
|--------------|-------------|-------------------------|----------------------------------|

For each return value: what happens if it returns 0? What happens if it returns MAX?
What happens if the external call reverts?

- For each external data structure received (Vec, array, Map, list): (a) What ordering/uniqueness does the consuming code assume? (b) Does the external contract's spec guarantee that ordering? (c) What happens if the assumption is violated (unsorted, duplicates, gaps)?

## 3. State Dependency Mapping

| Protocol State | Depends on External State | External State Can Change Without Our Knowledge? |
|---------------|--------------------------|--------------------------------------------------|

For each dependency: model what happens when the external state changes between
our protocol's read and use.

## Step Execution Checklist
| Section | Required | Completed? |
|---------|----------|------------|
| 1. Interface-Level Requirement Inference | YES | Y/N/? |
| 2. Return Value Consumption | YES | Y/N/? |
| 3. State Dependency Mapping | YES | Y/N/? |

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.