Software design

From dean0x/devflow · View interactive version

Software design is an AI agent skill from the GitHub repository dean0x/devflow. This skill should be used when the user asks to "inject dependencies", "return Result", "make it immutable", or implements business logic or error handling.

How to use this skill

Skill file

Core Engineering Patterns

The canonical source of architectural patterns and principles for consistent, high-quality code.

Iron Law

Never throw in business logic

Every operation that can fail must return a Result type. Exceptions are allowed

only at system boundaries (API handlers, database adapters). A throw statement

in business logic is a violation.

Philosophy

  1. Functional Core, Imperative Shell — Pure business logic, side effects at boundary
  2. Explicit Error Handling — Result types, no exceptions in business logic
  3. Immutability by Default — Return new objects, never mutate (copy before .sort())
  4. Dependency Injection — All deps injected, nothing instantiated internally
  5. Make Illegal States Unrepresentable — Types enforce invariants at compile time; discriminated unions with exhaustive switches; each error variant carries its full context
  6. Parse, Don't Validate — Schema transforms at boundaries
  7. Compose with pipes, and clean up resources in finally

references/patterns.md shows each pattern in code.

Consistency Rules

Anti-Patterns

Workaround Labeling (Required)

HACK: MOCK: TODO: TEMPORARY: NOT-PRODUCTION: ARCHITECTURE EXCEPTION:

Unlabeled workarounds are violations. See references/code-smell-violations.md.

Extended References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.