smithery/0xhoneyjar

rigor

Validate data correctness in web3 components

Installation

$ npx skills add smithery/0xhoneyjar --skill rigor

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery/0xhoneyjar.

npx skills add smithery/0xhoneyjar

Browse all from smithery/0xhoneyjar

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Skill metadata

Parsed from SKILL.md frontmatter.

Allowed toolsRead, Glob
Declared agents claude-code

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,912 B
  • docs SUMMARY.md 57 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

Rigor

Validate data correctness in web3 components.

Usage

/rigor file.tsx          # Validate specific file
/rigor                   # Validate current context

Philosophy

Correctness over feel. A beautiful button that sends the wrong amount is worse than an ugly one that's accurate.

On-chain over indexed. When money is involved, trust the blockchain, not the indexer.

What Rigor Checks

1. BigInt Safety

JavaScript BigInt has a critical footgun: 0n is falsy.

if (0n) console.log('true')   // Never prints!

Safe Pattern:

if (amount != null && amount > 0n) { ... }

Anti-Pattern:

if (shares) { ... }  // BROKEN: 0n is valid but falsy

2. Data Sources

Use Case Source Why
Display (read-only) Indexed Faster UX
Transaction amounts On-chain Must be accurate
Button enabled state On-chain Prevents failed tx

Safe Pattern:

const { data: txShares } = useReadContract({...})  // On-chain
const canWithdraw = (txShares ?? 0n) > 0n

Anti-Pattern:

const canWithdraw = envioData?.hasBalance  // Stale!

3. Receipt Guards

Prevent re-execution when receipt updates trigger effects.

Safe Pattern:

const lastHashRef = useRef<string>()

useEffect(() => {
  if (!receipt) return
  if (receipt.transactionHash === lastHashRef.current) return
  lastHashRef.current = receipt.transactionHash
  onReceipt(receipt)
}, [receipt, onReceipt])

Anti-Pattern:

useEffect(() => {
  if (receipt) handleSuccess(receipt)  // May trigger multiple times
}, [receipt])

4. Stale Closures

useEffect callbacks capture state at creation time.

Safe Pattern:

const amountRef = useRef(currentAmount)
amountRef.current = currentAmount

useEffect(() => {
  if (receipt) processReceipt(amountRef.current)
}, [receipt])

Report Format

## Rigor Validation

### VaultWithdraw.tsx

CRITICAL: Transaction amount from indexed data (line 45)
  → Amount should come from useReadContract, not useEnvioQuery
  → Fix: Replace `envioData.shares` with on-chain read

HIGH: BigInt falsy check (line 67)
  → `if (shares)` fails when shares === 0n
  → Fix: `if (shares != null && shares > 0n)`

### Summary
- 1 file checked
- 2 findings (1 CRITICAL, 1 HIGH)

Severity Levels

Severity Example Action
CRITICAL Transaction from indexed data Block
HIGH BigInt falsy check Require fix
MEDIUM Stale closure risk Warn
LOW Missing type annotation Note

Rules Loaded

  • .claude/constructs/packs/rune/rules/rigor/*.md
  • .claude/rules/rigor/*.md (local overrides)