Review Hog Perspective Logic Correctness

作者 PostHog469d1773e9cb无许可证收录于 2026年10月8日更新于 2026年10月8日

The Logic & Correctness review perspective for PostHog Review. 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.

AI 生成的概览

作为 PostHog Review 的一个视角,仅审查拉取请求代码变更中的逻辑与正确性问题。

功能
该技能定义了一个单一审查视角——逻辑与正确性,用于检查拉取请求中的某个代码片段。它指导审查者检查业务逻辑、边界情况、数据转换与变更、查询与数据访问逻辑以及 LLM 提示处理,并且只报告正确性问题。它提供了调查领域、示例搜索命令、关注重点指引,以及有效发现的判定清单。
适用场景
适用于审查代码变更以确认其行为是否符合预期,尤其是逻辑密集的文件,如服务实现、数据处理代码和查询层。它设计为与其他视角并行使用,因为安全、性能和契约问题已明确交由其他视角处理。
运行要求
不包含脚本或软件包,仅为指令。它假定可以访问待审查的拉取请求代码片段,并可使用代码搜索工具(如 ripgrep)执行建议的命令。

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 PostHog Review 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

来源与署名

来源:PostHog/ai-plugin位于skills/review-hog-perspective-logic-correctness提交469d177

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架

更多来自 PostHog/ai-plugin 的技能

Writing Simplified Technical English

PostHog

应用 ASD-STE100 简化技术英语规则,让智能体撰写的文字含义明确、便于执行。

Writing & Content2026年10月8日

Working With Task Comments

PostHog

通过 PostHog MCP exec 调度器读取并解读 PostHog 任务、产物和画布上的评论。

Productivity & Workflow2026年10月8日

Working With Skills

PostHog

指导智能体使用 PostHog 的 skill-* MCP 工具来发现、读取、创建、更新和重构技能。

AI & Agents2026年10月8日

Working With Scouts

PostHog

关于如何把监控任务委派给 PostHog Signals 侦察代理、处理其报告并长期调校整个代理集群的操作手册。

AI & Agents2026年10月8日

Validating And Publishing Canvases

PostHog

Validate and publish a canvas source project safely: the source-project shape, declared capabilities, reading the current version pointer, iterating on validation diagnostics, guarded publishing with expected_current_version_id, staging a draft build and promoting it, waiting out the queued build, and recovering from a 409 version_conflict or a 429 capacity limit without overwriting concurrent work. Use whenever a canvas edit is ready to save, a draft build is wanted, a canvas publish or build returns diagnostics or a conflict, or a task needs to understand canvas version history.

待分类2026年10月8日

Understanding Billing Usage

PostHog

Explains PostHog billing usage and spend from the customer's visible Billing MCP tools. Use when the user asks why usage or spend is high, which product or project is driving usage, what a usage type means, how to reduce usage, what changed over time, why they got a usage change alert, or whether a spike/drop alert was real or noisy. Also use before product-specific analytics skills when the user names a billable PostHog product metric such as events, recordings, feature flag requests, exceptions, survey responses, synced rows, logs, AI events, AI credits, or Inbox credits. Starts from Billing usage/spend tools, then routes to customer-visible product MCP surfaces for deeper investigation.

待分类2026年10月8日