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 skills add darellchua2/opencode-config-template --skill design-patterns-skillgit clone --depth 1 https://github.com/darellchua2/opencode-config-templateWrote 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.
[](https://agentmods.dev/skills/darellchua2/opencode-config-template/design-patterns-skill)<a href="https://agentmods.dev/skills/darellchua2/opencode-config-template/design-patterns-skill"><img src="https://agentmods.dev/badge/skills/darellchua2/opencode-config-template/design-patterns-skill/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.
<a href="https://agentmods.dev/skills/darellchua2/opencode-config-template/design-patterns-skill"><img src="https://agentmods.dev/badge/skills/darellchua2/opencode-config-template/design-patterns-skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector warn
SkillSpector: 1 finding, up to medium
These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →
- medium Data Exfiltration · line 249 Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00032 | $0.00689 |
| Opus 5.5 | $0.00013 | $0.00276 |
| Sonnet 5.5 | $0.00006 | $0.00138 |
| Haiku 4.5 | $0.00003 | $0.00069 |
Grade A, and why
design-patterns-skill 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 2mo 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.
How it starts
The opening of the file, as written. The whole thing — 38 lines — stays where its author put it; the contents beside it link to each section on GitHub.
What I do
Apply design patterns where they fit — and refuse to force them. Patterns solve problems you HAVE, not problems you MIGHT have; let them emerge from refactoring, not upfront design.
When to use me
- A design problem you recognize (repeated type-switching, behavior addable without modification, complex object construction)
- You're tempted to add a pattern and want a second opinion on whether it's warranted
House Learnings
Learning: zai-client-class
Instead of per-endpoint adapters, wrap all API endpoints in a single client class handling key resolution, base URL config, and error mapping centrally (combined Adapter + Facade): one ZaiClient with _headers()/_request() internals and typed endpoint methods (search, summarize, analyze); missing ZAI_API_KEY raises at construction.
Learning: enum-strategy-resolution
Dispatch via str + Enum with a default member: one dispatch point, Open/Closed-compliant (new strategies need no dispatcher edit), callers pass raw strings or enum members interchangeably. Unknown values fall through to the UNKNOWN member's handler instead of raising.
Learning: atomic-sql-update-race-free-transition
Use a single UPDATE ... WHERE expected_state RETURNING cols as an optimistic lock — the WHERE guards the transition, RETURNING fetches columns in one round-trip, losers re-read and reconcile idempotently. Never read-then-write state transitions (two workers both commit, duplicate side effects).
Detection: rg 'get_.*\(|fetch_.*\(' --type py -A 10 | rg 'status|state' | rg 'commit|save|update'
Learning: double-checked-locking-async-refresh
Async token/cache refresh must use double-checked locking (unlocked check → acquire lock → RE-CHECK → refresh only if still invalid) so exactly ONE caller hits the upstream provider per expiry window; hot path stays lock-free. Pair with time.monotonic() (NTP-immune) and proactive refresh at 80% of TTL.
Detection: rg 'async with self\._lock|async with.*Lock' --type py -A 15 | rg 'await.*refresh|await.*fetch' | rg -v 'if.*stale|if.*expired'
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.
- 2mo ago Changed · -835 lines 5c9ff2effabc
- 3mo ago First seen · 873 lines · 32 tokens per session scan A 94968fc1f697
design-patterns-skill is a skill published in the GitHub repository darellchua2/opencode-config-template (6 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 32 tokens to every session and 689 once invoked, about $0.0001 per session on Opus 5.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-09-03.
design-patterns-skill compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| design-patterns-skilldarellchua2/opencode-config-template | Skill | 6 | 2mo ago | Apache-2.0 | A | 32 | Claude Code, Codex |
| brooks-sweephyhmrright/brooks-lint | Skill | 1.6k | yesterday | MIT | A | 178 | Claude Code |
| driftdadbodgeoff/drift | Skill | 795 | 4d ago | Apache-2.0 | A | 84 | Claude Code |
| llm-friendly-contextshinpr/claude-code-workflows | Skill | 725 | 4d ago | MIT | A | 52 | Claude Code |
| laravel-owasp-securityAsyrafHussin/agent-skills | Skill | 116 | yesterday | MIT | A | 111 | Claude Code |
| laravel-audit-databaseMrPunyapal/laravel-auditor | Skill | 85 | yesterday | MIT | A | 33 | Claude Code, Codex |
| megalinter-checkoxsecurity/megalinter | Skill | 2.7k | today | AGPL-3.0 | A | 116 | Claude Code |