skills/review-script-template/SKILL.md
This skill should be used when the user asks to "review a script template", "audit a template", "check template implementation", "validate ts-templates code", or mentions reviewing BitCom templates like AIP, MAP, SIGMA, BAP. Validates ScriptTemplate implementations against best practices.
npx skillsauth add b-open-io/bsv-skills review-script-templateInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Review and validate script template implementations in ts-templates for correctness and best practices.
src/template/ appropriate subdirectoryScriptTemplate interface from @bsv/sdkdata property is public readonlybitcomIndex?: number field for protocol positionvalid?: boolean field for verification status| Method | Purpose | Requirements |
|--------|---------|--------------|
| decode() | Static. Parse from BitComDecoded | Return array of instances |
| lock() | Generate LockingScript | Use BitCom for OP_RETURN protocols |
| unlock() | Generate UnlockingScript | Throw if not applicable |
| verify() | Check signature validity | Return boolean |
script.chunks directly (no toASM().split())Correct pattern:
const script = Script.fromBinary(protocol.script)
const chunks = script.chunks
const field = Utils.toUTF8(chunks[0].data ?? [])
Incorrect patterns to flag:
// BAD: String splitting
const parts = script.toASM().split(' ')
// BAD: Buffer usage
const field = Buffer.from(chunks[0].data).toString()
// BAD: TextEncoder
new TextEncoder().encode(field)
Verify correct Utils functions:
| Operation | Correct | Incorrect |
|-----------|---------|-----------|
| String → bytes | Utils.toArray(str, 'utf8') | Buffer.from(), TextEncoder |
| Bytes → string | Utils.toUTF8(bytes) | Buffer.toString(), TextDecoder |
| Bytes → hex | Utils.toHex(bytes) | Buffer.toString('hex') |
| Bytes → base64 | Utils.toBase64(bytes) | Buffer.toString('base64') |
For protocols with signatures:
valid field after verificationFor OP_RETURN protocols:
// BAD: Can throw on missing data
const field = Utils.toUTF8(chunks[0].data)
// GOOD: Handle missing data
const field = Utils.toUTF8(chunks[0].data ?? [])
Verify chunk indices match protocol specification:
// BAD: Crashes on parse error
static decode(bitcom: BitComDecoded): Protocol[] {
const script = Script.fromBinary(protocol.script) // Can throw!
}
// GOOD: Handle parse errors
static decode(bitcom: BitComDecoded): Protocol[] {
try {
const script = Script.fromBinary(protocol.script)
} catch {
continue // Skip invalid protocols
}
}
Check that mod.ts includes:
export { default as Protocol, PREFIX } from './src/template/...'
export type { ProtocolData, ProtocolOptions } from './src/template/...'
Provide structured feedback:
## Template Review: [TemplateName]
### Structure: ✅ PASS / ❌ FAIL
- [Details]
### Methods: ✅ PASS / ❌ FAIL
- [Details]
### Code Quality: ✅ PASS / ❌ FAIL
- [Details]
### Issues Found
1. [Issue description and fix]
2. [Issue description and fix]
### Recommendations
- [Optional improvements]
references/checklist-detailed.md - Extended validation criteriareferences/common-bugs.md - Known issues and fixesdevelopment
This skill should be used when the user asks to integrate "Yours Wallet", "connect a BSV wallet", use "BRC-100", "pay with BSV wallet", add "wallet checkout in a web app", use "yours-wallet-provider", build a "pay with Yours Wallet" button, access "window.CWI", or connect a React app to a BRC-100 wallet.
development
This skill should be used when the user asks to "send BSV", "transfer satoshis", "create payment transaction", "send from WIF", "P2PKH transaction", or needs to build, sign, and broadcast P2PKH transactions from a WIF private key using @bsv/sdk.
development
This skill should be used when the user asks to "encrypt message with BSV key", "decrypt with private key", "ECDH encryption", "AES-256-GCM BSV", "EncryptedMessage", "BRC-2 encryption", or needs to encrypt/decrypt data using BSV keys and @bsv/sdk.
tools
This skill should be used when the user asks to "implement BRC-100 wallet", "use wallet-toolbox", "TypeScript BSV wallet", "BRC-100 implementation", "desktop wallet", "Electron wallet", "browser wallet", "IndexedDB wallet storage", "wallet actions", "wallet baskets", "UTXO management", "createAction", "listOutputs", "wallet certificates", "WalletClient", "noSend", "BEEF payment", "pay-beef", "send BEEF", "Transaction.fromBEEF", "toHexBEEF", or needs guidance on building conforming wallets using @bsv/wallet-toolbox or connecting to a user's BRC-100 wallet via WalletClient.