code-philosophy

code-philosophy is a skill for OpenCode from delorenj/ssbnk. It costs 32 tokens per session (582 once invoked), scanned A, a copy of code-philosophy, MIT.

A set of programming principles for keeping application logic simple, predictable, and resistant to errors. It covers early returns, trusted data structures, predictable functions, and clear data flow.

In plain words
What is it for?
Use it when designing or reviewing backend logic, React components, hooks, state management, or other code that processes data.
Why use it?
It gives developers practical rules for reducing deeply nested code, repeated checks, invalid states, and surprising behavior.

Skill for OpenCode

Written for OpenCode: installed under .opencode/.

Good fit Use it when designing or reviewing backend logic, React components, hooks, state management, or other code that processes data.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/delorenj/ssbnk/code-philosophy
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add delorenj/ssbnk --skill code-philosophy
Clone the repo
git clone --depth 1 https://github.com/delorenj/ssbnk

Made for: OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for code-philosophy

README.md
[![agentmods](https://agentmods.dev/badge/skills/delorenj/ssbnk/code-philosophy/github.svg)](https://agentmods.dev/skills/delorenj/ssbnk/code-philosophy)
Your own site
<a href="https://agentmods.dev/skills/delorenj/ssbnk/code-philosophy"><img src="https://agentmods.dev/badge/skills/delorenj/ssbnk/code-philosophy/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for code-philosophy

Your own site · 80×15
<a href="https://agentmods.dev/skills/delorenj/ssbnk/code-philosophy"><img src="https://agentmods.dev/badge/skills/delorenj/ssbnk/code-philosophy.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 582 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00032 $0.00582
Opus 5 $0.00016 $0.00291
Sonnet 5 $0.00006 $0.00116
Haiku 4.5 $0.00003 $0.00058

Measured 5d ago against content hash 7f15b42b52e5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

code-philosophy scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to code-philosophy — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.opencode/skills/code-philosophy/SKILL.md · 48 lines

How it starts

The opening of the file, as written. The whole thing — 48 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Internal Logic Philosophy: The 5 Laws of Elegant Defense

Role: Principal Engineer for all Internal Logic & Data Flow — applies to backend, React components, hooks, state management, and any code where functionality matters.

Philosophy: Elegant Simplicity — code should guide data so naturally that errors become impossible, keeping core logic flat, readable, and pristine.

The 5 Laws

1. The Law of the Early Exit (Guard Clauses)

  • Concept: Indentation is the enemy of simplicity. Deep nesting hides bugs.
  • Rule: Handle edge cases, nulls, and errors at the very top of functions.
  • Practice: Use if (!valid) return; doWork(); instead of if (valid) { doWork(); }.

2. Make Illegal States Unrepresentable (Parse, Don't Validate)

  • Concept: Don't check data repeatedly; structure it so it can't be wrong.
  • Rule: Parse inputs at the boundary. Once data enters internal logic, it must be in trusted, typed state.
  • Why: Removes defensive checks deep in algorithmic code, keeping core logic pristine.

3. The Law of Atomic Predictability

  • Concept: A function must never surprise the caller.
  • Rule: Functions should be "Pure" where possible. Same Input = Same Output. No hidden mutations.
  • Defense: Avoid void functions that mutate global state. Return new data structures instead.

4. The Law of "Fail Fast, Fail Loud"

  • Concept: Silent failures cause complexity later.
  • Rule: If a state is invalid, halt immediately with a descriptive error. Do not try to "patch" bad data.
  • Result: Keeps logic simple by never accounting for "half-broken" states.

5. The Law of Intentional Naming

  • Concept: Comments are often a crutch for bad code.
  • Rule: Variables and functions must be named so clearly that logic reads like an English sentence.
  • Defense: isUserEligible is better than check(). The name itself guarantees the boolean logic.

Adherence Checklist

Before completing your task, verify:

  • Guard Clauses: Are all edge cases handled at the top with early returns?
  • Parsed State: Is data parsed into trusted types at the boundary?
  • Purity: Are functions predictable and free of hidden mutations?
  • Fail Loud: Do invalid states throw clear, descriptive errors immediately?
  • Readability: Does the logic read like an English sentence?

Read the full file on GitHub · 48 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 48 lines · 32 tokens per session scan A 7f15b42b52e5

Subscribe to this mod's changes

code-philosophy is a skill published in the GitHub repository delorenj/ssbnk (2 stars, last pushed 4d ago), licensed MIT. It adds 32 tokens to every session and 582 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to code-philosophy, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

post-build-flow

Handles workflow verification and setup after build-workflow succeeds, or when the message contains workflow-verification-follow-up or workflow-setup-required. Load after direct builds, when verificationReadiness requires action, or on orchestrator verify/setup follow-up turns.

n8n-io/n8n · 53 tokens

spec-kitty-charter-doctrine

Run charter interview, generation, context, and sync workflows for project governance in Spec Kitty 3.x. Access doctrine artifacts programmatically via DoctrineService. Resolve agent profiles. Load action-scoped governance context iteratively, not all at once. Triggers: "interview for charter", "generate charter"…

Priivacy-ai/spec-kitty · 135 tokens

debugging-executions

Debug failed or wrong-output workflow executions using executions tools. Load when the user reports execution failures, unexpected node output, empty parameter values after a successful run, or a node showing a red or failed expression error.

n8n-io/n8n · 48 tokens

whatsapp-send-skill

Send WhatsApp messages to contacts, groups, or channels. Supports text, images, videos, audio, documents, stickers, locations, and contacts.

zeenie-ai/OpenCompany · 36 tokens

workflow-builder

Load before calling build-workflow. Default path for all single-workflow work: new one-off workflows, existing-workflow edits, verification repairs, and workflow-local data tables. Write or edit a workspace source file, run workflow-sdk validate via workspaceexecutecommand, then call build-workflow with filePath. When…

n8n-io/n8n · 113 tokens

mongodb-query-optimizer

Help with MongoDB query optimization and indexing. Use only when the user asks for optimization or performance: "How do I optimize this query?", "How do I index this?", "Why is this query slow?", "Can you fix my slow queries?", "What are the slow queries on my cluster?", etc. Do not invoke for general MongoDB query…

fcakyon/claude-codex-settings · 98 tokens