Logic-Lens Skills

Trace code execution to find behavioral bugs and explain semantic differences.

Logic-Lens publishes six Skills for review, explanation, comparison, root-cause location, health reporting, and audit-and-fix work. Its method follows premises, execution traces, divergence, triggers, and remedies.

Use cases

  • Review code for behavioral bugs
  • Compare two implementations
  • Diagnose failing tests and crashes

How to use

Provide the code, expected behavior, and any failure evidence. Use the upstream plugin for command integration; repository development helpers are separate from this six-Skill package.

Skills

  • logic-diff

    Compare two code versions for semantic equivalence via semi-formal tracing of both versions side-by-side. Trigger when the user shares a refactor, rewrite, migration, or A/B implementation and wants to confirm behavior is unchanged — "did I break anything", "is this equivalent", "are these equivalent", "semantically equivalent", "are these two implementations semantically equivalent", "check my refactor", "same behavior after the change?", "does my rewrite produce the same output", "switched from X to Y — same results?". SCOPE HARD RULE: requires two code versions (A and B). A single version for bug-finding uses logic-review; one version + a failing test uses logic-locate; explaining what one piece of code does uses logic-explain; codebase audit uses logic-health. Do NOT trigger for: single-version review, performance comparison, design-quality comparison, or "which is better-written" questions.

    hyhmrright/logic-lens
  • logic-explain

    Explain what a specific piece of code actually does for a given input by producing a step-by-step execution trace (interprocedural, with name resolution and type transitions). Trigger when the user is confused about behavior or asks why code produces X instead of Y — "walk me through this", "trace through X with input Y", "why does this return X", "what does yield-from do here", "explain the execution path". SCOPE HARD RULE: a specific function + a specific input scenario. If the user wants to find bugs without a scenario in mind, use logic-review; two-version comparison uses logic-diff; concrete failures use logic-locate; codebase-wide audit uses logic-health. Do NOT trigger for: finding bugs without a behavioral question, style or design discussion, or concept explanations not tied to specific code.

    hyhmrright/logic-lens
  • logic-fix-all

    Autonomous repository-wide audit-and-fix pipeline: health → review → locate/explain → fix → diff-verify → iterate until clean. Starts with a mandatory consent prompt (token-intensive); after consent runs hands-free. Trigger when the user wants ALL logic issues found and fixed — "fix everything", "fix all logic issues", "fix all logic issues in this code", "clean up all logic issues", "audit and fix the whole repo", "fix all bugs automatically", or frustration with recurring bugs wanting a one-shot pass. SCOPE RULE: repo-wide by default; also trigger for a pasted code snippet when the user says "fix all" — produce the full Fix Report (Fix Log, before/after Logic Score). Analysis-only requests use logic-health or logic-review. Single failure uses logic-locate. Two versions uses logic-diff. One path explanation uses logic-explain. Do NOT trigger for: analysis-only ("show me the bugs"), style/lint/format concerns, or fixing a single named finding.

    hyhmrright/logic-lens
  • logic-health

    Sweep a directory, module, or full codebase for logic correctness and produce a scored health dashboard with systemic patterns. Trigger when the user requests a health view — "audit the whole codebase", "health check", "health overview", "logic health overview", "audit src/", "audit auth and payments modules", "where should I focus testing", "onboarding review", "logic overview before we ship", "give me a health overview of this module". SCOPE RULE: prefer multi-file; also trigger for a single module when the user explicitly uses "health check", "health overview", or "logic health" — a concrete failure uses logic-locate; two versions uses logic-diff; explaining a path uses logic-explain; "fix everything" uses logic-fix-all. Do NOT trigger for: style/architecture-only audits, security-only scans, performance-only audits.

    hyhmrright/logic-lens
  • logic-locate

    Locate the root cause of a CONFIRMED failure via backward-then-forward semi-formal tracing. Trigger when the user provides a stack trace, failing assertion, error message, or specific wrong-value observation — "find the bug", "this test is failing", "track down this crash", "why is this test failing", "KeyError at line 89", "expected 70, got 100", "NoneType has no attribute X", "cart empties when second tab opens". SCOPE HARD RULE: requires a concrete failure (exception, failing test, or specific wrong output). Vague suspicion without evidence uses logic-review; behavior explanation uses logic-explain; refactor comparison uses logic-diff; codebase audit uses logic-health. Do NOT trigger for: vague "what's wrong" without a concrete symptom, style questions, or performance issues.

    hyhmrright/logic-lens
  • logic-review

    Find logic bugs in a single file or function via semi-formal execution tracing (Premises → Trace → Divergence → Trigger → Remedy). Trigger when a user shares code and suspects something is wrong without naming a concrete failure — phrases like "review this", "does this look right", "check this function", "audit this code", "tests pass but prod fails". SCOPE HARD RULE: one file or one function only. For a directory or whole module use logic-health; for a confirmed failure (stack trace, failing test, specific wrong value) use logic-locate; for two versions use logic-diff; for repo-wide autonomous fixing use logic-fix-all. Do NOT trigger for: style/formatting, security scanning, performance, test generation, architecture or design questions.

    hyhmrright/logic-lens