Secure workflow guide

From cyotee/indexedex · View interactive version

Secure workflow guide is an AI agent skill from the GitHub repository cyotee/indexedex. Apply the five-step secure contract workflow: known issues, special features, diagrams, security properties, and manual review.

How to use this skill

Skill file

Secure Workflow Guide

IndexedEx integration

Read the target repository's CLAUDE.md and docs/agent/SKILL_CATALOG.md; current product law and canonical crane-* / indexedex-* guidance override generic examples here. Tests are production-first, never SUT mocks; use Crane TestBases, CREATE3/FactoryService for facets and the IndexedEx manager registry for vault/DETF DFPkgs, never direct new. For testing within the current authorized task: forge build --use solar before tests, default hermetic or FOUNDRY_PROFILE=fork; no via_ir or package profiles.

Analysis produces findings and recommendations, not silent production fixes. Commands, installation, scans, network/RPC, tests, deployments, Git writes and broadcasts require scope in the current request; examples grant none. Reading or installing this skill executes none. Current task authorization may already cover routine local analysis and validation; do not demand a second approval for those actions. Assessment-only requests do not authorize production fixes. Use Native's actual read, grep, glob, LSP and apply_patch tools as available; allowed-tools metadata is not enforcement. No Claude aliases or plugin agent registration is assumed. Report missing tools and unverified results rather than claiming success. Reports go only to the user-scoped output path. Historical examples and sample scores are illustrative, not IndexedEx findings or proof of tool correctness. Retained upstream interface metadata is inert in references/upstream-openai.yaml. Upstream pointers to audit-context-building or issue-writer are optional, not installed commands; use scoped code reading and the included report templates when they are absent.

Purpose

Guides through Trail of Bits' secure development workflow - a 5-step process to enhance smart contract security throughout development.

Use this: On every check-in, before deployment, or when you want a security review


The 5-Step Workflow

Covers a security workflow including:

Step 1: Check for Known Security Issues

Review Slither evidence for known vulnerabilities; run a fresh scan only when explicitly within the current task:

Goal: Clean Slither report or documented triages

Step 2: Check Special Features

Detect and validate applicable features:

Note: Only runs checks that apply to your codebase

Step 3: Visual Security Inspection

Generate 3 security diagrams:

Review each diagram for security concerns

Step 4: Document Security Properties

Help document critical security properties:

Then propose testing, implemented only in a separately requested testing task:

Note: Most important activity for security

Step 5: Manual Review Areas

Analyze areas automated tools miss:

Search codebase for these patterns and flag risks

For detailed instructions, commands, and explanations for each step, see WORKFLOW_STEPS.md.


How I Work

When invoked, I will:

  1. Explore your codebase to understand structure
  2. Review Step 1: Existing Slither evidence and scan gaps
  3. Assess Step 2: Applicable special features; execute checks only when authorized
  4. Generate Step 3: Visual security diagrams
  5. Guide Step 4: Security property documentation
  6. Analyze Step 5: Manual review areas
  7. Provide action plan: Prioritized fixes and next steps

Adapts based on:


Rationalizations (Do Not Skip)

| Rationalization | Why It's Wrong | Required Action |

|-----------------|----------------|-----------------|

| "Slither not available, I'll check manually" | Manual checking misses 70+ detector patterns | Document unavailable or unauthorized Slither execution; do not install tools implicitly |

| "Can't generate diagrams, I'll describe the architecture" | Descriptions aren't visual - diagrams reveal patterns text misses | Use existing outputs or source-derived diagrams; mark scanner-generated diagrams unverified if execution is not authorized |

| "No upgrades detected, skip upgradeability checks" | Proxies and upgrades are often implicit or planned | Verify with codebase search before skipping Step 2 checks |

| "Not a token, skip ERC checks" | Tokens can be integrated without obvious ERC inheritance | Check for token interactions, transfers, balances before skipping |

| "Can't set up Echidna now, suggesting it for later" | Property-based testing is Step 4, not optional | Document properties now; propose production-first Foundry invariants and separately scope any new fuzzing tooling |

| "No DeFi interactions, skip oracle/flash loan checks" | DeFi patterns appear in unexpected places (price feeds, external calls) | Complete Step 5 manual review, search codebase for patterns |

| "This step doesn't apply to my project" | "Not applicable" without verification = missed vulnerabilities | Verify with explicit codebase search before declaring N/A |

| "I'll provide generic security advice instead of running workflow" | Generic advice isn't actionable, workflow finds specific issues | Cover all 5 steps with evidence or explicit execution gaps; generate file:line findings without exceeding task scope |


Example Output

When I complete the workflow, you'll get a comprehensive security report covering:

For a complete example workflow report, see EXAMPLE_REPORT.md.


What You'll Get

Security Report:

Action Plan:

Workflow Checklist:


Getting Help

Trail of Bits Resources:

Other Security:


Ready to Start

Let me know when you're ready and I'll run through the workflow with your codebase!

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.