design-patterns

design-patterns is a skill for Claude Code, Codex from Firstp1ck/pi-coding-agent-forge. It costs 46 tokens per session (2,006 once invoked), scanned A, a copy of design-patterns, MIT.

A guide to choosing reusable ways of structuring code in Rust, TypeScript and React, or Django and Python.

In plain words
What is it for?
Use it when designing interfaces, components, traits, dependency injection, callbacks, or abstraction boundaries, and when comparing two or more implementation approaches.
Why use it?
It helps match an implementation approach to the actual problem, expected changes, and trade-offs instead of adding abstractions that make code harder to maintain.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when designing interfaces, components, traits, dependency injection, callbacks, or abstraction boundaries, and when comparing two or more implementation approaches.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/firstp1ck/pi-coding-agent-forge/design-patterns
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 Firstp1ck/pi-coding-agent-forge --skill design-patterns
Clone the repo
git clone --depth 1 https://github.com/Firstp1ck/pi-coding-agent-forge

Made for: Claude Code, Codex.

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 design-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/firstp1ck/pi-coding-agent-forge/design-patterns/github.svg)](https://agentmods.dev/skills/firstp1ck/pi-coding-agent-forge/design-patterns)
Your own site
<a href="https://agentmods.dev/skills/firstp1ck/pi-coding-agent-forge/design-patterns"><img src="https://agentmods.dev/badge/skills/firstp1ck/pi-coding-agent-forge/design-patterns/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 design-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/firstp1ck/pi-coding-agent-forge/design-patterns"><img src="https://agentmods.dev/badge/skills/firstp1ck/pi-coding-agent-forge/design-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,006 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 92% 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.00046 $0.02006
Opus 5.5 $0.00018 $0.00802
Sonnet 5.5 $0.00009 $0.00401
Haiku 4.5 $0.00005 $0.00201

Measured 1mo ago against content hash 5edd2da78245, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

design-patterns 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 1mo 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

92% identical to design-patterns — 11 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.

pi-skill-design-patterns/skills/design-patterns/SKILL.md · 254 lines

How it starts

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

Design Patterns

Pattern recommendations tailored to the user's tech stacks. Every pattern recommendation includes when to use it, when to avoid it, and the trade-offs.

Quick Start

Choose a Pattern

  1. Identify the problem: What design challenge are you solving?
  2. Consider the context: What language? What scale? How often will this change?
  3. Evaluate options: 2-3 candidate patterns with trade-offs
  4. Recommend: The best fit for this specific context (not the "best pattern in general")

The golden rule: Patterns are tools, not goals. Use the simplest pattern that solves the problem. If no pattern fits, a plain function or struct is fine.


Rust Patterns

Newtype Pattern

Wrap a primitive to add type safety and domain meaning.

struct UserId(u64);
struct OrderId(u64);

// Now the compiler prevents mixing up UserId and OrderId
fn get_order(user: UserId, order: OrderId) -> Order { ... }

When to use: When two values have the same underlying type but different meanings. When to skip: One-off uses where a type alias suffices.

Builder Pattern

Construct complex objects step by step.

let config = ServerConfig::builder()
    .host("localhost")
    .port(8080)
    .max_connections(100)
    .build()?;

When to use: Structs with many optional fields, complex construction logic. When to skip: Structs with 1-3 required fields — just use new().

Typestate Pattern

Encode state transitions in the type system so invalid states are unrepresentable.

struct Connection<S: State> { /* ... */ state: PhantomData<S> }
struct Disconnected;
struct Connected;
struct Authenticated;

impl Connection<Disconnected> {
    fn connect(self) -> Result<Connection<Connected>> { ... }
}
impl Connection<Connected> {
    fn authenticate(self, creds: &Credentials) -> Result<Connection<Authenticated>> { ... }
}
impl Connection<Authenticated> {
    fn query(&self, sql: &str) -> Result<Rows> { ... }
}
// Can't call query() on a Disconnected connection — compile error

Read the full file on GitHub · 254 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. 1mo ago First seen · 254 lines · 46 tokens per session scan A 5edd2da78245

Subscribe to this mod's changes

design-patterns is a skill published in the GitHub repository Firstp1ck/pi-coding-agent-forge (91 stars, last pushed yesterday), licensed MIT. It adds 46 tokens to every session and 2,006 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 92% identical to design-patterns, differing in 11 lines, and is treated as a copy.

Related

Other skills, from other repositories

convex-component-authoring

How to create, structure, and publish self-contained Convex components with proper isolation, exports, and dependency management.

waynesutton/convexskills · 28 tokens

npm-docs

Use this skill whenever the user asks about npm, package management, publishing packages, semantic versioning, npm CLI commands, or Node.js dependencies. Covers npm 12.x including the registry, scopes, organizations, security (audit, provenance, 2FA), CI/CD integration, workspaces, scripts, .npmrc configuration, and…

pledgeandgrow/pledge-skills · 91 tokens

convex-component-authoring

How to create, structure, and publish self-contained Convex components with proper isolation, exports, and dependency management.

J-StaR-Films-Studios/VibeCode-Protocol-Suite · 28 tokens

dependency-manager

Manage project dependencies — update packages, audit vulnerabilities, resolve conflicts, and keep dependencies healthy. Use when updating packages, fixing vulnerability alerts, or resolving dependency issues.

asgarovf/locusai · 35 tokens

colab-finetuning

Fine-tune LLMs on Google Colab GPUs directly from openscience. Connects to Colab runtimes via WebSocket bridge for remote training with Unsloth. Supports SFT, GRPO, DPO, vision, and TTS workflows on free T4 to Pro A100 GPUs.

synthetic-sciences/openscience · 67 tokens

swarm-pr-review

Run a graph-guided, tool-augmented PR review using context packing, parallel exploration, mandatory repository-agnostic risk-family coverage with dispatch scaled to diff size and risk, independent reviewer validation, critic challenge, and metrics writeback. Use for deep pull request review with low false-positive…

ZaxbyHub/opencode-swarm · 91 tokens