工厂模式

工厂模式 is a skill for Claude Code, Codex from microwind/ai-skills. It costs 37 tokens per session (8,473 once invoked), scanned A, original, no licence file.

A design pattern that creates objects through a shared creation interface without requiring callers to name the exact class.

In plain words
What is it for?
Use it when code may need to create different implementations of the same general type based on a setting, input, or subclass decision.
Why use it?
It separates object creation from object use, so the chosen concrete type can change without changing calling code.

Skill for Claude CodeCodex

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 skills/microwind/ai-skills/factory-pattern
Any agent
npx skills add microwind/ai-skills --skill factory-pattern
Clone the repo
git clone --depth 1 https://github.com/microwind/ai-skills

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 工厂模式

README.md
[![agentmods](https://agentmods.dev/badge/skills/microwind/ai-skills/factory-pattern.svg)](https://agentmods.dev/skills/microwind/ai-skills/factory-pattern)
Your own site
<a href="https://agentmods.dev/skills/microwind/ai-skills/factory-pattern"><img src="https://agentmods.dev/badge/skills/microwind/ai-skills/factory-pattern.svg" alt="Measured on agentmods" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 8,473 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin unknown 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.00037 $0.08473
Opus 5 $0.00018 $0.04236
Sonnet 5 $0.00007 $0.01695
Haiku 4.5 $0.00004 $0.00847

Measured 4d ago against content hash 152c51f2154c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

工厂模式 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 4d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/analyze_factory.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

design-patterns/factory-pattern/SKILL.md · 1,228 lines

The source is not reproduced here

No licence file

A repository with no LICENSE is all rights reserved by default, so the body is not copied here. The metadata, the measurements and the link are.

Read it on GitHub

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 4d ago First seen · 1,228 lines · 37 tokens per session scan A 152c51f2154c

Subscribe to this mod's changes

工厂模式 is a skill published in the GitHub repository microwind/ai-skills (75 stars, last pushed 3mo ago), with no licence file. It adds 37 tokens to every session and 8,473 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 skills, from other repositories

super-design

Use when the user asks you to build, style, theme, refine, audit, or recreate UI — or uploads a screenshot to rebuild. Reads DESIGN.md as a closed token layer, detects the project's framework (Tailwind v4/v3, ShadCN, MUI, Radix, Geist), and enforces production design rules (tokens only, full state matrix, WCAG 2.2 AA…

Eldergenix/SUPER-DESIGN · 122 tokens

noosphere-memory-hermes

Set up and use the Noosphere memory provider in Hermes Agent. Use when a user gives Hermes a Noosphere API key, asks to connect Hermes to Noosphere, configure durable memory, verify the provider, or troubleshoot Hermes Noosphere memory setup.

SweetSophia/noosphere · 55 tokens

noosphere-memory

Use when Codex should recall, inspect, or save durable knowledge in Noosphere through the configured MCP server.

SweetSophia/noosphere · 26 tokens

tcx-calculation

Run reproducible financial calculations from governed Dataset slices or declared private inputs, reuse exact prior results, and bind decision-relevant metrics to recorded Calculation Runs. Use for returns, risk, valuation, regression, optimization, scenario, or portfolio math that can affect an investment artifact.

monarchjuno/tradingcodex · 59 tokens

goga-apply

Materialize an architectural plan into the cells file structure.

qarium/goga · 15 tokens

spec-to-svg-flow-map

Chuyển spec sản phẩm, tính năng, UI, backend, auth, sync, lifecycle, external contract, hoặc spec đa nhánh thành SVG flow map ngữ nghĩa có metadata máy đọc được, source coverage, render từng flow, gap detection, verification report, và trạng thái BLOCKED hoặc READYFOROWNERREVIEW. Dùng khi cần biến spec thành flow map…

tamnguyendinh/Anvien · 120 tokens