ag-reverse-code-review
Trigger keywords: reverse review, compare options, trade-off analysis, eval approaches, which pattern is better. Reverse Code Review skill for evaluating architectural trade-offs, comparing multi-option implementations (Trade-off Matrix), and evaluating student critical thinking rather than just syntax correctness.
- License 许可
- MIT
- 最近更新
- 2026-08-02
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- ag-reverse-code-review
- layer
- helper
- description
- Trigger keywords: reverse review, compare options, trade-off analysis, eval approaches, which pattern is better. Reverse Code Review skill for evaluating architectural trade-offs, comparing multi-option implementations (Trade-off Matrix), and evaluating student critical thinking rather than just syntax correctness.
- trigger_keywords
- reverse, code, review
03 SKILL.md 正文
Reverse Code Review Protocol (ag-reverse-code-review)
When to Apply
This skill is designed for the agent to reference when:
- The user is a student or developer choosing between multiple architectural patterns or implementation approaches.
- The agent needs to present multi-option Trade-off Matrices to evaluate student critical thinking and mental models.
- Triggered by explicit keywords:
reverse review,compare options,trade-off analysis,eval approaches,which pattern is better.
How to Use
1. Step-by-Step Instructions
- Generate 2-4 Architectural Options (
INV-1): When presented with a complex problem, generate 2-4 distinct implementation approaches (e.g., Option A: Optimistic Lock, Option B: Pessimistic Row Lock, Option C: Redis Redlock). - Mandate Student Trade-Off Analysis (
INV-2): Refuse to declare a "winner" immediately. Require the student to evaluate each option across:- Time/Space Complexity & Latency
- Data Consistency & Race Condition Guarantees
- Operational & Cognitive Complexity
- Grade Reasoning & Uncover Blind Spots (
INV-3): Evaluate the student's analysis, pointing out unexamined edge cases (e.g., DB connection pool exhaustion, Redis split-brain). - Format Decision into ADR (
INV-4): Once the student justifies their choice, assist them in formatting the decision into an Architectural Decision Record (ADR) forsecond-brain/30_Resources/Architectures/ordocs/adr/.
2. Examples
Example 1: Evaluating Concurrency Locking Options
- Context: Student needs to select a locking mechanism for a high-concurrency ticket system.
- User prompt: "Should I use Optimistic Locking or Redis Redlock for ticket reservation?"
- Action/Result: The agent presents Option A (TypeORM Optimistic Lock
@Version), Option B (SELECT FOR UPDATE), and Option C (Redis Redlock). It asks the student to construct a Trade-off Matrix evaluating Latency vs Consistency under 10,000 req/sec.
Example 2: Comparing State Management Strategies
- Context: Student is deciding between local Zustand store vs server-side Redis session for cart state.
- User prompt: "Compare Zustand vs Redis for managing user cart state."
- Action/Result: The agent presents Option A (Client-side Zustand), Option B (Server Redis Session), and Option C (Hybrid optimistic UI). It requires the student to evaluate offline support vs cross-device sync trade-offs.
Quick Reference
multi-approach-generation- Present 2-4 distinct architectural options for complex problems.student-tradeoff-mandate- Require student to evaluate Latency, Consistency, and Complexity.socratic-evaluation- Grade student reasoning and highlight unexamined edge cases.adr-export-gate- Format finalized choices into Architectural Decision Records (ADRs).
References
- process/context/all-context.md - Project context and architecture guidelines.
- second-brain-integration - Obsidian Second Brain integration skill.
04 同仓库更多 Skills
zustand
Rules and standards for state management using Zustand in React and Next.js. Use when implementing client-side stores, persistence with localStorage, or preventing SSR hydration mismatch.
zod
Zod v4 schema validation best practices. Use when defining schemas, utilizing safeParse, or customizing error messages.
upstash-ratelimit
Rules, standards, and references for rate limiting in serverless environments using Upstash Ratelimit. Use when implementing rate limiting, configuring Upstash Redis, or handling request blocking.
ui-design
UI/UX and frontend design best practices guidelines (formerly frontend-design). This skill should be used when writing, reviewing, or designing frontend code to ensure accessibility, performance, and usability. Triggers on tasks involving HTML structure, CSS styling, responsive layouts, form design, animations, or accessibility improvements.
typescript
TypeScript performance, tsconfig, type errors, async patterns — triggered when the user asks to "optimize TypeScript performance", "speed up tsc compilation", "configure tsconfig.json", "fix type errors", "improve async patterns", or encounters TS errors (TS2322, TS2339, "is not assignable to"). Also triggers on .ts, .tsx, .d.ts file work involving type definitions, module organization, or memory management. Does NOT cover TypeScript basics, framework-specific patterns, or testing.
typescript-refactor
TypeScript and TSX refactoring and modernization guidelines from a principal specialist perspective, current to TypeScript 6.0 and React 19. This skill should be used when refactoring, reviewing, or modernizing TypeScript or React/TSX code for type safety, compiler performance, and idiomatic patterns. Triggers on tasks involving type architecture, narrowing, generics, discriminated unions, error handling, React component and hook typing, or migration to modern TypeScript features (satisfies, using, const type parameters, inferred type predicates, isolatedDeclarations, erasable syntax, import attributes).