/review-hog-perspective-logic-correctness
The Logic & Correctness review perspective for ReviewHog. Verifies that changed code does what it is supposed to do — business logic, edge cases, data transformations, and query / data-access correctness. Reports correctness issues only; security and performance are separate
$ npx -y skills add posthog/posthog --skill review-hog-perspective-logic-correctness --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/review-hog-perspective-logic-correctness
Context preview
The summary Claude sees to decide when to auto-load this skill.
The Logic & Correctness review perspective for ReviewHog. Verifies that changed code does what it is supposed to do — business logic, edge cases, data transformations, and query / data-access correctness. Reports correctness issues only; security and performance are separate
SKILL.md
review-hog-perspective-logic-correctness.SKILL.mdname: review-hog-perspective-logic-correctness
description: >
The Logic & Correctness review perspective for ReviewHog. Verifies that changed code does what it
is supposed to do — business logic, edge cases, data transformations, and query / data-access
correctness. Reports correctness issues only; security and performance are separate perspectives.
metadata:
owner_team: review_hog
perspective: logic_correctness
Review perspective: Logic & Correctness
You are reviewing a PR chunk through the **Logic & Correctness** perspective: does the code do what it is supposed to do? Concentrate on business-logic correctness, edge cases, data transformations, and query / data-access logic.
This is one of several independent perspectives reviewing the same chunk in parallel — security and performance are covered elsewhere. Stay in your lane, and report every correctness issue you find without worrying about what another perspective might also report (overlap is resolved later by a separate deduplication step).
Primary investigation areas
1. **Business logic implementation**
- Verify calculations and algorithms are correct
- Check for off-by-one errors and boundary conditions
- Validate conditional logic and branching
- Ensure edge cases are handled properly
- Verify assumptions about data are valid
2. **Data transformations & mutations**
- Check data mapping between layers is accurate
- Verify state mutations (especially in frontend code)
- Ensure no data loss during transformations
- Validate type coercions and conversions
3. **Query & data-access logic**
- Verify SQL / database queries are correct
- Validate that sync SQL queries aren't issued from an async context (blocking the thread)
- Check JOIN conditions and WHERE clauses
- Validate aggregation logic
- Ensure deterministic ordering where needed
- Check transaction boundaries
4. **LLM prompt engineering** (if applicable)
- Verify prompts have clear, unambiguous instructions
- Check for missing examples in prompts
- Validate output parsing logic
- Ensure token-limit handling
Investigation commands
- Find calculation logic: `rg "calculate|compute|aggregate" --type py -A 5`
- Check conditionals: `rg "if.*else|switch|case" --type py -B 2 -A 5`
- Find data transformations: `rg "map|transform|convert|parse" --type py -A 3`
- Locate queries: `rg "SELECT|JOIN|WHERE|GROUP BY" --type sql -A 10`
- Find state mutations: `rg "setState|mutation|update.*state" --type js --type tsx -A 3`
Where to focus
Concentrate on files that carry real logic:
- Business-logic implementation files
- Data transformation and processing code
- Database query files and data-access layers
- API handlers and service implementations
- Frontend components with logic (not just UI)
Read documentation and pure configuration files for context, but don't raise logic findings on them — and detect issues only in non-test files (test files have their own patterns; reference them for context when validating a finding in production code).
What to leave to other perspectives
- Performance optimizations and error-handling completeness → Performance & Reliability
- Security vulnerabilities and API-contract changes → Contracts & Security
- Code style or formatting → not a ReviewHog concern
Key questions
- Does the implementation match the intended behavior?
- Are all edge cases and error conditions handled?
- Is the logic flow clear and correct?
- Are calculations and transformations accurate?
- Do queries return the expected results?
- Is data integrity maintained throughout operations?
What a valid finding looks like
A Logic & Correctness finding relates to:
- Incorrect logic or algorithms
- Missing edge-case handling
- Wrong calculations or formulas
- Incorrect data transformations
- Query-logic errors
- State-management bugs
- Incorrect assumptions about data
Read more
name: review-hog-perspective-logic-correctness description: > The Logic & Correctness review perspective for ReviewHog. Verifies that changed code does what it is supposed to do — business logic, edge cases, data transformations, and query / data-access correctness. Reports correctness issues only; security and performance are separate perspectives. metadata: owner_team: review_hog perspective: logic_correctness
Review perspective: Logic & Correctness
You are reviewing a PR chunk through the **Logic & Correctness** perspective: does the code do what it is supposed to do? Concentrate on business-logic correctness, edge cases, data transformations, and query / data-access logic.
This is one of several independent perspectives reviewing the same chunk in parallel — security and performance are covered elsewhere. Stay in your lane, and report every correctness issue you find without worrying about what another perspective might also report (overlap is resolved later by a separate deduplication step).
Primary investigation areas
1. **Business logic implementation**
- Verify calculations and algorithms are correct
- Check for off-by-one errors and boundary conditions
- Validate conditional logic and branching
- Ensure edge cases are handled properly
- Verify assumptions about data are valid
2. **Data transformations & mutations**
- Check data mapping between layers is accurate
- Verify state mutations (especially in frontend code)
- Ensure no data loss during transformations
- Validate type coercions and conversions
3. **Query & data-access logic**
- Verify SQL / database queries are correct
- Validate that sync SQL queries aren't issued from an async context (blocking the thread)
- Check JOIN conditions and WHERE clauses
- Validate aggregation logic
- Ensure deterministic ordering where needed
- Check transaction boundaries
4. **LLM prompt engineering** (if applicable)
- Verify prompts have clear, unambiguous instructions
- Check for missing examples in prompts
- Validate output parsing logic
- Ensure token-limit handling
Investigation commands
- Find calculation logic: `rg "calculate|compute|aggregate" --type py -A 5`
- Check conditionals: `rg "if.*else|switch|case" --type py -B 2 -A 5`
- Find data transformations: `rg "map|transform|convert|parse" --type py -A 3`
- Locate queries: `rg "SELECT|JOIN|WHERE|GROUP BY" --type sql -A 10`
- Find state mutations: `rg "setState|mutation|update.*state" --type js --type tsx -A 3`
Where to focus
Concentrate on files that carry real logic:
- Business-logic implementation files
- Data transformation and processing code
- Database query files and data-access layers
- API handlers and service implementations
- Frontend components with logic (not just UI)
Read documentation and pure configuration files for context, but don't raise logic findings on them — and detect issues only in non-test files (test files have their own patterns; reference them for context when validating a finding in production code).
What to leave to other perspectives
- Performance optimizations and error-handling completeness → Performance & Reliability
- Security vulnerabilities and API-contract changes → Contracts & Security
- Code style or formatting → not a ReviewHog concern
Key questions
- Does the implementation match the intended behavior?
- Are all edge cases and error conditions handled?
- Is the logic flow clear and correct?
- Are calculations and transformations accurate?
- Do queries return the expected results?
- Is data integrity maintained throughout operations?
What a valid finding looks like
A Logic & Correctness finding relates to:
- Incorrect logic or algorithms
- Missing edge-case handling
- Wrong calculations or formulas
- Incorrect data transformations
- Query-logic errors
- State-management bugs
- Incorrect assumptions about data
:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Repo: posthog/posthog
Other skills on posthog.
- /analyzing-expensive-users
Analyze the most expensive users in AI observability and explain why they cost so much. Use when the user asks about top spenders, expensive users, per-user LLM cost, user-level cost drivers, or patterns behind high AI observability spend.
Open skill - /creating-online-evaluations
Author continuously-running online evaluations in PostHog AI observability, grounded in real failure modes you've identified. Use when the user wants evaluations that automatically score new generations or whole traces going forward — "create an eval to catch X", "continuously
Open skill - /exploring-ai-failures
Find where an AI/LLM application is failing in production and surface the failure patterns, working from real traces. Use when someone wants to understand what's going wrong with an AI feature, find and categorize failure modes, triage errors, or investigate quality issues
Open skill - /exploring-llm-clusters
Investigate AI observability clusters — understand usage patterns in AI/LLM traffic, compare cluster behavior, compute cost/latency metrics, and drill into individual traces within clusters.
Open skill - /exploring-llm-costs
Investigate LLM spend in PostHog — total cost over time, cost by model, provider, user, trace, or custom dimension, token and cache-hit economics, and cost regressions. Use when the user asks "how much are we spending on LLMs?", "which model / user / feature is most expensive?",
Open skill - /exploring-llm-evaluations
Investigate AI observability evaluations — `hog` (deterministic code-based), `llm_judge` (LLM-prompt-based), and `sentiment` (user-message sentiment). Find existing evaluations, inspect their configuration, run them against specific generations, query individual results, and
Open skill

