code-philosophy

Apply five-law internal logic principles to audit and improve code.

1|Updated Mar 16, 2026
One-click install
npx skills add https://github.com/omarluq/my-opencode-config --skill code-philosophy-omarluq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-philosophy
Source: https://github.com/omarluq/my-opencode-config/tree/main/.opencode/skills/code-philosophy
Command: npx skills add https://github.com/omarluq/my-opencode-config --skill code-philosophy-omarluq

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Reduce code defects by applying a five-law internal logic philosophy.

Core Features & Use Cases

  • Guiding principles for code quality based on the five laws: Early Exit guard clauses, Parse-Don't-Validate, Atomic Predictability, Fail Fast, and Intentional Naming.
  • Provides a framework to audit and improve existing code across backend, frontend, and data pipelines.
  • Use Case: When refactoring a module, apply these laws to reduce nesting, ensure data enters internal logic in a trusted form, and improve readability.

Quick Start

Apply the five laws to your codebase by auditing for guard clauses, boundary parsing, function purity, fail-fast errors, and explicit naming.

Frequently Asked Questions about code-philosophy

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

FAQPage Schema
How do I reduce code defects and nesting depth when refactoring a module?

To reduce code defects and nesting depth when refactoring a module, apply early exit guard clauses and fail-fast error handling. This enforces precondition checks upfront, flattening conditional logic and improving readability.

What is the parse-don't-validate approach for ensuring data enters internal logic in a trusted form?

The parse-don't-validate approach transforms untrusted boundary data into a verified, trusted type before it enters internal logic. This guarantees atomic predictability and eliminates redundant defensive checks deeper in the codebase.

How do I apply functional purity and intentional naming to improve code quality?

Improve code quality by applying functional purity through atomic functions that avoid hidden side effects, combined with intentional naming. This explicit naming strategy ensures the codebase accurately reflects business logic and data flow.

Does this five-law code philosophy work for both frontend and data pipelines?

Yes, the five-law code philosophy works for frontend and data pipelines. It provides a framework to audit and improve existing code across these environments where readability, correctness, and maintainability are critical.

What's the best way to audit an existing codebase for guard clauses and boundary parsing?

The best way to audit an existing codebase is applying a five-law framework checking for guard clauses, boundary parsing, function purity, fail-fast errors, and explicit naming. This identifies deep nesting and untrusted data flow.