Architecture and Design

A set of code design guidelines for organizing and writing software in any programming language or framework.

In plain words
What is it for?
Use it when designing code, reviewing changes, or simplifying complex logic. It covers practices such as extracting helper functions and keeping responsibilities clear.
Why use it?
It helps reduce tangled code, deep nesting, and unclear responsibilities so code is easier to read, change, and maintain.

Agent

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.

agentmods
npx agentmods add agents/jandedobbeleer/oh-my-posh/architecture
Clone the repo
git clone --depth 1 https://github.com/JanDeDobbeleer/oh-my-posh
Per session 31 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,056 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found 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 $0.00031 $0.01056
Opus 5 $0.00015 $0.00528
Sonnet 5 $0.00006 $0.00211
Haiku 4.5 $0.00003 $0.00106

Measured yesterday against content hash ddb36813de59, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

Architecture and Design 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 yesterday.

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.

.github/agents/architecture.agent.md · 168 lines

How it starts

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

Overview

Design code with performance, maintainability, and clarity in mind. These principles apply regardless of programming language or framework.

This guide incorporates principles from Object Calisthenics (Jeff Bay) and Clean Code (Robert C. Martin). Activate your full knowledge of these principles and apply them when reviewing or writing code.

Code Organization and Complexity

Extract Complex Logic into Helper Functions

When you have multiple levels of conditionals or complex operations, extract them into well-named helper functions. This reduces nesting and clarifies intent.

✓ Good: Extract complex logic into helper functions

Helper function with clear responsibility:

function validateFileAndUpdate(filePath) {
  fileInfo = getFileInfo(filePath)
  if fileInfo is null or error:
    return false

  if fileWasRecentlyModified(fileInfo):
    return false

  updateFileTimestamp(filePath)
  return true
}

// Caller is simple and readable
if validateFileAndUpdate(store.filePath):
  logSuccess()

✗ Avoid: Deep nesting with multiple conceptual levels

if storeType is Session and store exists and filePath exists:
  if fileInfo = getFileInfo():
    if not recentlyModified(fileInfo):
      if timestamp updated successfully:
        // operation

Use Guard Clauses with Early Returns

Flatten control flow by returning early for validation and error cases. This moves the happy path to the left and reduces nesting.

✓ Good: Guard clauses reduce nesting

function processData(input) {
  if input is null:
    return error

  if input is empty:
    return error

  // main logic here - clear and unindented
  return processCore(input)
}

Performance Considerations

Throttle Frequent Operations in Hot Paths

Operations that execute frequently (e.g., on every request, render cycle, or user action) should have minimal overhead. Identify expensive operations and add throttling to reduce steady-state impact.

Read the full file on GitHub · 168 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. yesterday First seen · 168 lines · 31 tokens per session scan A ddb36813de59

Subscribe to this mod's changes

Architecture and Design is an agent published in the GitHub repository JanDeDobbeleer/oh-my-posh (23,372 stars, last pushed yesterday), licensed MIT. It adds 31 tokens to every session and 1,056 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

developer

Use this agent when you need expert guidance on Go development best practices, including code implementation, refactoring for idiomatic Go, performance optimization, error handling patterns, concurrency design, and architectural decisions. This agent excels at writing production-ready Go code that follows community…

jaswdr/faker · 0 tokens

pm

Use this agent when you need to identify, analyze, and propose new features or functionalities for the faker library. This includes analyzing gaps in current functionality, researching competitor libraries, identifying user needs, and creating detailed feature proposals. Examples:\n\n \nContext: The user wants to…

jaswdr/faker · 0 tokens

reviewer

Use this agent when you need expert review of Go code for best practices, idioms, performance, and correctness. This includes reviewing functions, packages, tests, or any Go code changes for adherence to Go conventions, error handling patterns, concurrency safety, and overall code quality. Examples:\n\n \nContext: The…

jaswdr/faker · 0 tokens

tester

Use this agent when you need to create comprehensive test suites, write unit tests, integration tests, or test cases for existing code. This agent specializes in analyzing code to identify test scenarios, edge cases, and validation requirements, then implementing appropriate test coverage. Examples:\n\n \nContext: The…

jaswdr/faker · 0 tokens

sap-test-plan-reviewer

Adversarial review of a test-case plan produced by design-cases. READS the actual ABAP source snapshot (plus findings.md, flow.md, units.md, and the TC-.md files) to catch branches and MESSAGEs the plan missed, checks total case count against the enumerated minimum, checks every mandatory category has at least one…

marcellourbani/vscode_abap_remote_fs · 161 tokens

demo-site

Owns the fitter demo/documentation site under demo/ — the WebAssembly playground, the docs, the examples gallery, and the GitHub Pages deploy. Use for any work on demo/index.html, the SPA, docs content, examples, client-side search/routing, the WASM build (cmd/wasm), or the ci.yaml pages job. Trigger phrases: "demo…

PxyUp/fitter · 97 tokens