review-hog-perspective-logic-correctness

Reviews pull request code for business logic, edge case, and query correctness issues.

713|118|Updated Aug 11, 2020
One-click install
npx skills add https://github.com/PostHog/posthog-foss --skill review-hog-perspective-logic-correctness
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: review-hog-perspective-logic-correctness
Source: https://github.com/PostHog/posthog-foss/tree/main/products/review_hog/skills/review-hog-perspective-logic-correctness
Command: npx skills add https://github.com/PostHog/posthog-foss --skill review-hog-perspective-logic-correctness

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Code reviews often miss subtle logic bugs like off-by-one errors, incorrect data transformations, or flawed SQL queries. This Skill applies a dedicated Logic & Correctness perspective to PR chunks so correctness issues are systematically detected and reported.

Core Features & Use Cases

  • Business Logic Verification: Checks calculations, algorithms, conditional branching, boundary conditions, and edge-case handling in changed code.
  • Data Transformation & Query Review: Validates data mapping between layers, state mutations, SQL queries, JOIN conditions, aggregations, and transaction boundaries.
  • Use Case: When reviewing a PostHog pull request that modifies an analytics aggregation query, this Skill inspects the WHERE clauses, grouping logic, and async/sync query usage to flag correctness defects before merge.

Quick Start

Review this pull request chunk for logic and correctness issues, focusing on business logic, data transformations, and query correctness.

Frequently Asked Questions about review-hog-perspective-logic-correctness

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I review a pull request for logic and correctness bugs?

Apply a dedicated correctness perspective that checks calculations, conditional branching, boundary conditions, and edge cases in the changed code. This Skill guides the review with investigation commands and key questions, reporting only correctness findings.

What kinds of bugs does a logic correctness code review catch?

It catches incorrect algorithms, off-by-one errors, missing edge-case handling, wrong data transformations, SQL query-logic errors, and state-management bugs. Security vulnerabilities and performance issues are intentionally left to other review perspectives.

Does this review perspective check test files for issues?

No, findings are raised only on non-test files. Test files are read for context when validating a finding in production code, since test code follows its own patterns and conventions.

Can this review detect blocking sync queries in async code?

Yes, one of its explicit checks is validating that synchronous SQL queries are not issued from an async context, which would block the event loop thread. It also reviews JOIN conditions, aggregations, and transaction boundaries.

What are the limitations of a single-perspective code review?

It deliberately stays in its lane: performance, error-handling completeness, security, and API-contract changes are covered by separate perspectives. Overlap between perspectives is resolved later by a deduplication step.