rnv について
rnvは、初稿、独立検証、最終結果を分ける4段階のCoVeプロセスを適用するエージェントスキルです。実装や主張を明示的に確認したい作業に向いています。
主な機能
- 014段階の検証プロトコル
- 02初稿と検証の分離
- 03確認項目のチェックリスト生成
- 04敵対的な検証プロンプト
- 05技術スタック別チェックリスト
活用シーン
- 01状態管理や非同期コードのレビュー
- 02データベースや認証変更の確認
- 03簡単なタスクプロンプトの具体化
- 04データ変換の境界条件の検証
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ aaarnv/ claude-skills --skill rnvインストール後、Claude Code で/rnvを入力して読み込まれたか確認します。
同梱ファイルchecklists.mdtemplates.md
詳細
Chain-of-Verification(CoVe)システム
CoVe モードで動作しています。これは、生成と検証を分離し、幻覚や微妙な誤りを排除するための厳密な検証フレームワークです。
基本原則
「LLM が支援するコードレビューであり、LLM が生成するコードではありません。」 生成は簡単です。正しさは検証によって確立されます。
CoVe の4段階プロトコル
どのようなタスクが与えられた場合も、必ず以下の4段階を順番に実行してください。
═══════════════════════════════════════════════════════════════
ステージ1:初期解(未検証の草案)
═══════════════════════════════════════════════════════════════
次のタスクに対する最善の解決策を生成してください:$ARGUMENTS
ステージ1のルール:
- 完全に動作する実装を作成する
- この出力は意図的に未検証です
- 自己検閲したり、曖昧な表現を使ったりせず、最善の試みを示す
[UNVERIFIED DRAFT]と明記する
## [UNVERIFIED DRAFT]
[Your initial implementation here]
═══════════════════════════════════════════════════════════════
ステージ2:検証計画
═══════════════════════════════════════════════════════════════
問題を解き直すことなく、検証が必要なすべての項目を列挙してください。
次のテンプレートを使ってチェックリストを作成してください。
## Verification Plan
### Critical Claims to Verify
- [ ] Claim 1: [specific assertion from Stage 1]
- [ ] Claim 2: [specific assertion from Stage 1]
### API/Library Correctness
- [ ] [API name]: [specific usage to verify]
- [ ] [Library]: [version compatibility, correct method signature]
### Edge Cases
- [ ] [Edge case 1]: [what could break]
- [ ] [Edge case 2]: [what could break]
### Concurrency & State
- [ ] [Race condition risk]: [where it could occur]
- [ ] [State mutation]: [potential issues]
### Type Safety
- [ ] [Type assertion 1]: [verify correctness]
- [ ] [Implicit any or unsafe cast]: [location]
### Environment Assumptions
- [ ] [Runtime]: [Node version, browser, etc.]
- [ ] [Database]: [engine, isolation level]
- [ ] [Dependencies]: [version requirements]
### Performance Claims
- [ ] [Complexity claim]: [O(n), O(n log n), etc.]
- [ ] [Memory usage]: [any concerns]
### Security Considerations
- [ ] [Input validation]: [where needed]
- [ ] [Injection risks]: [SQL, XSS, command]
- [ ] [Auth/authz]: [any assumptions]
═══════════════════════════════════════════════════════════════
ステージ3:独立検証
═══════════════════════════════════════════════════════════════
重要:ステージ1の推論に頼らないでください。各項目を独立して検証してください。
チェックリストの各項目について、次の内容を示してください。
## Independent Verification
### ✓ PASSED | ✗ FAILED | ⚠ WARNING
#### [Item Name]
- **Verdict**: ✓ PASSED / ✗ FAILED / ⚠ WARNING
- **Evidence**: [Concrete proof or counterexample]
- **If Failed**: [Specific fix required]
使用する検証手法:
-
制約に基づく検証
- 明示された環境制約に照らして検証する
- バージョンの互換性を確認する
- 型の正しさを検証する
-
敵対的検証
- コードを破綻させる入力を考案する
- 次の点に重点を置く:競合状態、オフバイワン、null の経路、古くなったクロージャ
-
差分推論
- 素朴な実装や全探索の代替手段と比較する
- トレードオフを説明する
-
行単位の意味監査(重要な処理経路の場合)
- 各行の処理内容を説明する
- 削除しても動作が変わらない行に印を付ける
═══════════════════════════════════════════════════════════════
ステージ4:最終検証済みソリューション
═══════════════════════════════════════════════════════════════
すべての検証を終えてから、最終結果を提示してください。
## [VERIFIED SOLUTION]
### Changes from Draft
- [Change 1]: [Why it was needed]
- [Change 2]: [Why it was needed]
### Verification Summary
- Total items checked: [N]
- Passed: [X]
- Failed & Fixed: [Y]
- Warnings acknowledged: [Z]
### Final Implementation
[Corrected code here]
### Remaining Caveats
- [Any known limitations]
- [Assumptions that couldn't be verified]
簡単なプロンプトの変換
ユーザーが簡単なプロンプトを入力した場合、次のテンプレートを使って自動的に内容を拡張してください。
ユーザーの指示:「削除ボタンを追加して」
CoVe による変換:
Task: Add a delete button to [inferred component/location]
Stage 1 - Initial Solution:
- Implement the delete button with proper UI
- Add click handler with confirmation
- Call appropriate API/mutation
- Handle loading/error states
- Update cache/state after deletion
Stage 2 - Verification Plan:
- [ ] Button placement follows design system
- [ ] Confirmation prevents accidental deletion
- [ ] API endpoint exists and is correct
- [ ] Optimistic update handles rollback on failure
- [ ] Cache invalidation is complete
- [ ] Loading state prevents double-clicks
- [ ] Error state is user-friendly
- [ ] Accessibility (aria-label, keyboard nav)
Stage 3 - Independent Verification:
[Verify each item]
Stage 4 - Final Verified Solution:
[Corrected implementation]
スタック別の検証チェックリスト
React / Next.js
- [ ] useEffect dependency array is complete
- [ ] useMemo/useCallback dependencies are correct
- [ ] No stale closures in event handlers
- [ ] Keys are stable and unique
- [ ] Server/Client component boundary is correct
- [ ] Suspense boundaries handle loading
- [ ] Error boundaries catch failures
TanStack Query / React Query
- [ ] Query keys are consistent and follow pattern
- [ ] Mutations invalidate correct queries
- [ ] Optimistic updates have proper rollback
- [ ] Stale time / cache time are appropriate
- [ ] Infinite queries handle page boundaries
- [ ] Prefetching doesn't cause waterfalls
tRPC
- [ ] Procedure types match (query vs mutation)
- [ ] Input validation is complete (Zod schema)
- [ ] Error handling uses TRPCError
- [ ] Context has required auth/session
- [ ] Batching is considered for multiple calls
Prisma / データベース
- [ ] Transactions wrap related operations
- [ ] Isolation level is appropriate
- [ ] N+1 queries are avoided (include/select)
- [ ] Unique constraints are enforced
- [ ] Cascade deletes are intentional
- [ ] Indexes exist for query patterns
TypeScript
- [ ] No `any` types (explicit or implicit)
- [ ] Null/undefined handled properly
- [ ] Type narrowing is sound
- [ ] Generics are constrained appropriately
- [ ] Return types are explicit for public APIs
非同期処理 / 並行処理
- [ ] Promise.all used for independent operations
- [ ] Race conditions are prevented
- [ ] Cleanup functions in useEffect
- [ ] AbortController for cancellable requests
- [ ] Debounce/throttle where appropriate
ステージ3用の敵対的プロンプト
ステージ1のソリューションに対するストレステストに使用してください。
非同期コード向け
Attempt to construct a sequence of events that would cause:
1. Race condition between two concurrent calls
2. Stale data displayed after mutation
3. Memory leak from uncancelled subscription
4. Deadlock or infinite loop
状態管理向け
Attempt to reach an invalid state by:
1. Rapid successive user actions
2. Network failure mid-operation
3. Component unmount during async operation
4. Browser back/forward navigation
API エンドポイント向け
Attempt to break this endpoint with:
1. Missing or malformed input
2. Unauthorized access
3. SQL/NoSQL injection
4. Excessive payload size
5. Concurrent conflicting requests
React コンポーネント向け
Attempt to cause incorrect rendering by:
1. Props changing faster than render cycle
2. Parent re-rendering with same props
3. Context value changing mid-render
4. Suspense boundary resolution order
CoVe を使用する場面
常に使用する場面:
- 状態を持つコード
- 並行処理/非同期処理のロジック
- データベース操作
- 認証/認可
- 金融計算
- エッジケースを含むデータ変換
次の場合に限り省略する:
- ごく単純な一行のコード
- 純粋にスタイルを変更する場合
- 使い捨てのプロトタイプ
- README やドキュメントの更新
例:CoVe の全フロー
ユーザーのプロンプト:「ユーザーテーブルにページネーションを追加して」
ステージ1:[UNVERIFIED DRAFT]
// Initial implementation
const { data, fetchNextPage, hasNextPage } = useInfiniteQuery({
queryKey: ['users'],
queryFn: ({ pageParam = 0 }) => fetchUsers({ offset: pageParam, limit: 20 }),
getNextPageParam: (lastPage) => lastPage.nextOffset,
})
ステージ2:検証計画
- [ ] Query key includes filter/sort params
- [ ] Offset calculation is correct at boundaries
- [ ] Loading state shown during fetch
- [ ] Empty state handled
- [ ] Error state handled
- [ ] Total count displayed correctly
- [ ] Page size is configurable
- [ ] URL state synced with pagination
- [ ] Keyboard navigation works
- [ ] Screen reader announces page changes
ステージ3:独立検証
✗ FAILED: Query key includes filter/sort params
- Evidence: queryKey is just ['users'], doesn't include filters
- Fix: queryKey: ['users', { filters, sort }]
✗ FAILED: URL state synced with pagination
- Evidence: Page state is local, lost on refresh
- Fix: Use URL search params or router state
✓ PASSED: Offset calculation
- Evidence: getNextPageParam correctly returns nextOffset from API
⚠ WARNING: Total count displayed
- Evidence: API returns total but we don't display it
- Recommendation: Show "Page X of Y" or "Showing 1-20 of 156"
ステージ4:[VERIFIED SOLUTION]
// Corrected implementation with all fixes applied
const [searchParams, setSearchParams] = useSearchParams()
const page = Number(searchParams.get('page')) || 0
const { data, fetchNextPage, hasNextPage, isLoading, error } = useInfiniteQuery({
queryKey: ['users', { filters, sort, page }],
queryFn: ({ pageParam = page }) => fetchUsers({
offset: pageParam * PAGE_SIZE,
limit: PAGE_SIZE
}),
getNextPageParam: (lastPage, allPages) =>
lastPage.hasMore ? allPages.length : undefined,
})
// Sync to URL
const goToPage = (newPage: number) => {
setSearchParams({ page: String(newPage) })
}
/wavybaby との統合
/wavybaby は、複雑なタスクに対して CoVe を自動的に実行します。wavybaby ツールキット全体の分析なしで検証したい場合は、/cove を直接呼び出すこともできます。
/wavybaby [task] → native dispatch + skill discovery + CoVe
/cove [task] → just the 4-stage verification protocol
$ARGUMENTS に対して、CoVe プロトコルを実行します。