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.
npx agentmods add skills/firstp1ck/pi-coding-agent-forge/design-patternsnpx skills add Firstp1ck/pi-coding-agent-forge --skill design-patternsgit clone --depth 1 https://github.com/Firstp1ck/pi-coding-agent-forgeWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00046 | $0.02006 |
| Opus 5 | $0.00023 | $0.01003 |
| Sonnet 5 | $0.00009 | $0.00401 |
| Haiku 4.5 | $0.00005 | $0.00201 |
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 2d 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.
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.
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
- Identify the problem: What design challenge are you solving?
- Consider the context: What language? What scale? How often will this change?
- Evaluate options: 2-3 candidate patterns with trade-offs
- 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
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.
- 2d ago First seen · 254 lines · 46 tokens per session scan A 5edd2da78245
design-patterns is a skill published in the GitHub repository Firstp1ck/pi-coding-agent-forge (74 stars, last pushed 2d ago), licensed MIT. It adds 46 tokens to every session and 2,006 once invoked, about $0.0002 per session on Opus 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.
Other skills, from other repositories
flow-nexus-platform
Comprehensive Flow Nexus platform management - authentication, sandboxes, app deployment, payments, and challenges.
github-code-review
Comprehensive GitHub code review with AI-powered swarm coordination.
github-project-management
Comprehensive GitHub project management with swarm-coordinated issue tracking, project board automation, and sprint planning.
github-release-management
Comprehensive GitHub release orchestration with AI swarm coordination for automated versioning, testing, deployment, and rollback management.
github-workflow-automation
Advanced GitHub Actions workflow automation with AI swarm coordination, intelligent CI/CD pipelines, and comprehensive repository management.
Pair Programming
AI-assisted pair programming with multiple modes (driver/navigator/switch), real-time verification, quality monitoring, and comprehensive testing. Supports TDD, debugging, refactoring, and learning sessions. Features automatic role switching, continuous code review, security scanning, and performance optimization with…