logic-guardian

Preserve critical business logic by validating edits with invariant checks and diff validation.

1|Updated May 18, 2026
One-click install
npx skills add https://github.com/linenoize/topia --skill logic-guardian-linenoize
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: logic-guardian
Source: https://github.com/linenoize/topia/tree/main/skills/logic-guardian
Command: npx skills add https://github.com/linenoize/topia --skill logic-guardian-linenoize

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents AI agents from accidentally deleting or rewriting important business logic when working on complex codebases.

Core Features & Use Cases

  • Maintains a machine-readable logic manifest for critical components and functions.
  • Enforces a pre-edit gate that reveals the current component spec before any change.
  • Checks cross-file invariants and validates edits after the fact so regressions are caught quickly.
  • Use it when refactoring trading systems, payment flows, state machines, or other interconnected modules that must stay behaviorally intact.

Quick Start

Ask the assistant to scan the project, load the logic manifest, and protect the target module before making any edit.

Frequently Asked Questions about logic-guardian

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

FAQPage Schema
How do I prevent silent regressions when refactoring complex business logic?

To prevent silent regressions during refactoring, load a machine-readable logic manifest and enforce pre-edit gating with invariant checks and post-edit diff validation. This preserves existing function signatures and behavior across interconnected modules.

How does invariant checking protect state machine and payment flow code?

Invariant checking protects state machine and payment flow code by validating cross-file invariants before and after edits. It enforces a pre-edit gate that reveals component specs, ensuring refactors do not accidentally delete or overwrite load-bearing logic.

What's the best way to safeguard critical trading system logic from accidental deletion during code reviews?

The best way to safeguard trading system logic during code reviews is to apply post-edit diff validation and test execution. By loading a logic manifest, the system catches accidental deletions and overwrites in interconnected modules quickly.

Do I need a logic manifest to protect load-bearing code paths during AI-assisted refactoring?

Yes, a logic manifest is required to protect load-bearing code paths during AI-assisted refactoring. It provides the machine-readable component specs needed for pre-edit gating, invariant checks, and post-edit validation to prevent accidental overwrites.

Can I use post-edit diff validation to catch regressions in interconnected modules?

Yes, you can use post-edit diff validation to catch regressions in interconnected modules. It compares edits against the loaded logic manifest and cross-file invariants, then runs test execution to verify that existing functions and signatures stay behaviorally intact.

When should I not rely solely on test validation for logic protection?

You should not rely solely on test validation for logic protection when refactoring complex state machines or payment flows. Combining pre-edit gating, manifest loading, and cross-file invariant checks is necessary to prevent silent regressions from accidental overwrites.