typescript-design-patterns
Skill1 starsChanged 6 days agoApache-2.0View on GitHub
Choose, compare, explain, or implement named GoF design patterns in TypeScript using Refactoring.Guru references and proportionate TypeScript idioms. Use for a concrete pattern-selection problem or an explicit pattern request; ordinary TypeScript editing, React component composition, specification review, and generic code cleanup do not by themselves trigger this skill.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- Lu1sDV/skillsmdtheir own version, first seen Nov 1, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- Lu1sDV/skillsmd★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository5 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- spec-authorSkill
- spec-refineSkill
- spec-reviewSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use patterns to resolve an observed design pressure, not to make code appear more sophisticated.
- Distinctive: line 16
Keep implementation inside the requested boundary.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
TypeScript Design Patterns
Use patterns to resolve an observed design pressure, not to make code appear more sophisticated. A function, object literal, discriminated union, or unchanged implementation can be the best answer.
Select and adapt
- Establish what must vary, what must remain stable, and the affected caller or boundary. Inspect the relevant source before proposing changes; do not infer a pattern from a filename alone.
- Compare a plausible pattern with the smallest adequate alternative. Explain the concrete benefit and added indirection, ownership, lifecycle, or change cost. Respect an explicitly requested teaching example without turning it into a repository refactor.
- Use the source navigator for the relevant family or named pattern. Read its Main article for applicability/trade-offs and its TypeScript page for Usage in TypeScript and Code example before attributing specific implementation advice to that source. Those last two links are anchors in one page, not separate documents. If retrieval fails, disclose the gap and distinguish general reasoning from verified source guidance.
- Adapt roles to TypeScript: structural interfaces and function values often replace nominal hierarchies; a tagged union can model a closed set of states or nodes. Class-based examples are instructional, not a requirement to introduce classes. Do not equate a generic factory function with GoF Factory Method, GoF Decorator with TypeScript decorator syntax, or GoF Proxy with JavaScript
Proxy. - Keep implementation inside the requested boundary. A pattern does not authorize new dependencies, global registries, provider calls, contract changes, or adjacent rewrites. For library/compiler/host API details, use the project's current official-documentation workflow; Refactoring.Guru is a design reference, not an API compatibility guarantee.
- Validate the behavior that matters: substitution, state transitions, dispatch coverage, composition order, resource disposal, error propagation or undo/stale-source rules, as applicable. Do not use pattern-shaped class structure as proof of correctness.
A useful answer names the pressure, chosen approach (including “no new pattern”), simpler alternative, trade-off, relevant source links, and the actual validation performed or still needed. Scale that explanation to the request.
Coexistence
This skill adds pattern-selection reasoning; it does not replace the surrounding workflow. Read routing boundaries only when another skill appears to overlap. In particular, React rendering/composition belongs to the React skill, public contracts to interface design, simplification to the simplification workflow, and quality/security acceptance to review. Specification authoring/refinement/EPIC scoring stays with SpecTorque's product skills. Do not invoke unrelated workflows merely because a pattern has an architectural name.
In SpecTorque, preserve the host-independent core and thin adapters. A design-pattern suggestion does not establish semantic preservation, scientific acceptance, a better heuristic score, or permission to write imported specifications.
Source use
Based on the Refactoring.Guru TypeScript catalog, consulted 2026-11-16. The navigator records catalog links, not a claim that every linked article has been read. The selection cautions are original engineering guidance. Do not reproduce the site's tutorials, diagrams, or code wholesale; attribute and link the relevant source. Check upstream terms before reusing actual source code. This project skill lives in .agents/skills, separate from the three distributed product skills in skills/.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

