phaselock

Enforces institutional coding and architectural rules for AI-generated code in PHP, Python, Magento 2 projects.

24|2|Updated Feb 6, 2026
One-click install
npx skills add https://github.com/infinri/Phaselock --skill phaselock
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: phaselock
Source: https://github.com/infinri/Phaselock/tree/main
Command: npx skills add https://github.com/infinri/Phaselock --skill phaselock

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

AI code generation fails in predictable, recurring ways: monolithic output, skipped planning phases, self-auditing without verification, and tests as afterthoughts. Phaselock converts each failure mode into a hard rule with mechanical enforcement through hooks and verification scripts, ensuring AI agents generate, review, and verify code against institutional knowledge.

Core Features & Use Cases

  • Tiered Workflow Routing: Classifies tasks into four tiers (Research, Patch, Standard, Complex) to apply the right level of ceremony.
  • Phased Implementation Protocol: Enforces sequential planning phases (call-path declaration, domain invariants, seam justification, system dynamics) with human approval gates.
  • Sliced Code Generation: Breaks implementation into dependency-ordered slices with per-slice validation, static analysis, and handoff JSON.
  • Comprehensive Rule Library: 80 enforceable rules across architecture, database, security, performance, testing, and framework-specific domains (Magento 2, PHP, Python).

Quick Start

Use the phaselock skill to review your AI-generated code against the institutional coding bible and enforce all applicable architectural, security, and performance rules before committing.

Frequently Asked Questions about phaselock

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

FAQPage Schema
How do I enforce coding standards on AI-generated code?

AI code generation skips planning phases and produces monolithic output without verification. Enforcing coding standards converts each failure mode into a hard rule with mechanical enforcement hooks that block writes and verify output against architectural invariants before committing.

How do I stop AI code generation from skipping planning and testing phases?

To stop AI code generation from skipping phases, implement a phased implementation protocol with sequential planning gates and test-first verification. This forces the AI to declare call-paths and domain invariants first, breaking monolithic output into dependency-ordered slices with per-slice validation.

Can I enforce architectural rules for Magento 2 and PHP projects?

Yes, you can enforce architectural rules for Magento 2 and PHP projects. The enforcement library includes 80 framework-specific rules across architecture, database, security, performance, and testing domains tailored for PHP, Python, and Magento 2 environments.

What is sliced code generation in AI-assisted development?

Sliced code generation is a technique that breaks implementation into dependency-ordered slices with per-slice validation. It prevents monolithic output by enforcing static analysis and handoff JSON validation between each slice, ensuring AI agents generate and verify code incrementally.

Does static analysis integration work with tiered workflow routing?

Yes, static analysis integration works with tiered workflow routing by classifying tasks into four tiers (Research, Patch, Standard, Complex). Each tier applies the appropriate level of ceremony, routing complex tasks to phased implementation gates with full static analysis verification.

Why does AI-generated code fail architectural reviews?

AI-generated code fails architectural reviews because it self-audits without verification and treats tests as afterthoughts. Mechanical enforcement hooks prevent this by blocking writes that violate the 80 enforceable rules and requiring test-first verification against institutional coding knowledge.