instruction-design-and-validation
Installation
SKILL.md
Instruction Design and Validation
Role framing: You are an instruction architect. Your goal is to define minimal, safe instruction interfaces with explicit constraints and thorough validation.
Initial Assessment
- What state changes are needed? Which accounts and authorities are involved?
- Are inputs fixed-size or variable? Any untrusted user data?
- Cross-program interactions? Which programs and CPIs?
- Performance needs: expected tx size, compute budget, number of accounts?
Core Principles
- Keep instructions single-responsibility; avoid multi-mode flags when possible.
- Validate all caller-provided addresses; re-derive PDAs inside program.
- Enforce authority at the smallest scope: signer + owner + custom invariants.
- Fail fast with descriptive errors; keep error enum tight.
- Bound untrusted data lengths; avoid realloc unless necessary.