원클릭으로
rigor
Validate data correctness in web3 components
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Validate data correctness in web3 components
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Generate or validate UI with design physics
Slot external knowledge into Rune constructs
Capture taste preferences for design physics
Hypothesis validation and closed-loop learning
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
UI quality enforcement skills from ibelick/ui-skills. Prevents AI-generated interface slop.
| name | rigor |
| description | Validate data correctness in web3 components |
| user-invocable | true |
| disable-model-invocation | true |
| allowed-tools | ["Read","Glob"] |
Validate data correctness in web3 components.
/rigor file.tsx # Validate specific file
/rigor # Validate current context
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.
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
| 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!
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])
useEffect callbacks capture state at creation time.
Safe Pattern:
const amountRef = useRef(currentAmount)
amountRef.current = currentAmount
useEffect(() => {
if (receipt) processReceipt(amountRef.current)
}, [receipt])
## 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 | Example | Action |
|---|---|---|
| CRITICAL | Transaction from indexed data | Block |
| HIGH | BigInt falsy check | Require fix |
| MEDIUM | Stale closure risk | Warn |
| LOW | Missing type annotation | Note |
.claude/constructs/packs/rune/rules/rigor/*.md.claude/rules/rigor/*.md (local overrides)