Skip to content
Back to skills

Software Design

ASecurity

This skill should be used when the user asks to "inject dependencies", "return Result", "make it immutable", or implements business logic or error handling.

  • 23 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 3, 2026
developmentshellapidatabase

Works with

  • api

Security analysis

A100/100

Pro scans all 7 files and shows the line behind each finding

Scanned November 9, 2026

npx -y skills add dean0x/devflow --skill software-design --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Software Design?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Software Design
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/dean0x-software-design/badge)](https://www.skillsdirectory.com/skills/dean0x-software-design)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: software-design
description: This skill should be used when the user asks to "inject dependencies", "return Result", "make it immutable", or implements business logic or error handling.
user-invocable: false
allowed-tools: Read, Grep, Glob, AskUserQuestion
---

# 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

- Result types: if one method returns Result, all must
- DI: apply consistently throughout
- Async: single pattern (don't mix callbacks/promises)

## Anti-Patterns

- Throwing in business logic — use Result
- Silent failures — swallowed catch blocks
- Mutable state — return new objects
- Service locator — inject instead

### Workaround Labeling (Required)

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

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

## Extended References

- `references/sources.md` — Full bibliography (25 sources with access links)
- `references/violations.md` — Violation patterns with citations
- `references/patterns.md` — The core patterns and extended correct patterns, with citations
- `references/checklist.md` — Pre-implementation and review checklists
- `references/code-smell-violations.md` — Fake solutions, deceptive code, magic values
- `references/detection.md` — Grep patterns for automated detection

Files in this skill

  • SKILL.md4.9 KB
  • references/checklist.md7.1 KB
  • references/code-smell-violations.md5.2 KB
  • references/detection.md7.7 KB
  • references/patterns.md9.5 KB
  • references/sources.md4.7 KB
  • references/violations.md8.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.