One-click install
npx skills add https://github.com/gil0mendes/dotfiles --skill code-philosophy-gil0mendes
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-philosophy
Source: https://github.com/gil0mendes/dotfiles/tree/main/configs/opencode/skill/code-philosophy
Command: npx skills add https://github.com/gil0mendes/dotfiles --skill code-philosophy-gil0mendes

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the challenge of writing complex, maintainable code by establishing a clear philosophy for internal logic and data flow, aiming to prevent errors before they occur.

Core Features & Use Cases

  • Error Prevention: Implements principles like "Guard Clauses" and "Make Illegal States Unrepresentable" to minimize bugs.
  • Code Readability: Emphasizes "Intentional Naming" and "Atomic Predictability" for clearer, more understandable code.
  • Use Case: A developer can use this Skill's principles to refactor a complex function, ensuring it's more robust, easier to debug, and simpler to extend in the future.

Quick Start

Apply the 5 Laws of Elegant Defense to refactor the provided code snippet for improved clarity and error prevention.

Frequently Asked Questions about code-philosophy

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

FAQPage Schema
How do I make illegal states unrepresentable in software design?

Guard clauses prevent errors by validating conditions upfront and exiting early if requirements fail. This Skill enforces guard clauses as a core law to ensure fail-fast predictability, halting execution before invalid data propagates through internal logic or state management.

What's the best way to refactor complex functions for readability and maintainability?

Refactoring for readability and maintainability requires applying atomic predictability and intentional naming. This Skill guides developers through its core laws to transform complex functions into pristine, naturally flowing code that is easier to debug and simpler to extend.

Does this code philosophy approach work with React components and backend logic?

Yes, this code philosophy works with React components and backend logic by enforcing strict internal data flow rules. It guides state management and component architecture to ensure errors are impossible and data is handled naturally across your stack.

When should I use fail-fast principles in programming?

Fail-fast principles should be used whenever handling data flow to catch errors immediately at their source. This Skill enforces fail-fast mechanisms alongside guard clauses to prevent invalid states from corrupting backend logic or component state management.

What are the limitations of applying strict code quality laws to existing codebases?

Applying strict code quality laws to existing codebases requires significant refactoring to align internal logic with guard clauses and atomic predictability. The Skill's strict philosophy may demand substantial structural changes to achieve unrepresentable illegal states and fail-fast predictability.