js-gof

js-gof is a skill for Claude Code, Codex from metarhia/metaskills. It costs 107 tokens per session (4,746 once invoked), scanned A, original, MIT.

A set of common ways to organise JavaScript and TypeScript code, such as factories, adapters, decorators, and proxies. It also gives guidance on keeping parts of a program separate and reducing dependencies between them.

In plain words
What is it for?
Use it when designing or refactoring JavaScript or TypeScript systems that need object creation, interchangeable components, wrappers, or clearer boundaries between parts.
Why use it?
It helps choose and apply familiar code structures without adding patterns where they are not needed. This can make code easier to change and test.

Skill for Claude CodeCodex

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

Good fit Use it when designing or refactoring JavaScript or TypeScript systems that need object creation, interchangeable components, wrappers, or clearer boundaries between parts.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/metarhia/metaskills/js-gof
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 metarhia/metaskills --skill js-gof
Clone the repo
git clone --depth 1 https://github.com/metarhia/metaskills

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 js-gof

README.md
[![agentmods](https://agentmods.dev/badge/skills/metarhia/metaskills/js-gof/github.svg)](https://agentmods.dev/skills/metarhia/metaskills/js-gof)
Your own site
<a href="https://agentmods.dev/skills/metarhia/metaskills/js-gof"><img src="https://agentmods.dev/badge/skills/metarhia/metaskills/js-gof/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 js-gof

Your own site · 80×15
<a href="https://agentmods.dev/skills/metarhia/metaskills/js-gof"><img src="https://agentmods.dev/badge/skills/metarhia/metaskills/js-gof.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 107 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,746 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original 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.1 $0.00107 $0.04746
Opus 5 $0.00053 $0.02373
Sonnet 5 $0.00021 $0.00949
Haiku 4.5 $0.00011 $0.00475

Measured 11d ago against content hash a218dab3d3f8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

js-gof 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 11d 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.

skills/js-gof/SKILL.md · 874 lines

How it starts

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

GoF Patterns

  • Use structural composition over inheritance
  • Use multiparadigm code and contract-programming
  • Use domain-specific languages (DSLs), prefer declarative way
  • Separate and do not mix system and domain code
  • Use GRASP and SOLID principles; especially reduce coupling
  • Remember about referential transparency
  • Prefer platform-agnostic code
  • Implement isolation and layer borders with IoC & DI
  • Use object/Map lookup for Strategy and polymorphic/dynamic dispatch
  • Keep patterns simple
  • Do not over-engineer for the sake of the pattern name

Creational patterns

Abstract factory

Creates related objects belonging to one family without specifying their concrete classes, e.g., UI components for different platforms.

Refs: https://github.com/HowProgrammingWorks/AbstractFactory

const dataAccess = {
  fs: {
    createDatabase: (...args) => new FileStorage(...args),
    createCursor: (...args) => new FileLineCursor(...args),
  },
  minio: {
    // factories collection for minio
  },
  // other implementations
};

// Usage

const accessLayer = dataAccess.fs;
const storage = accessLayer.createDatabase('./storage.dat');
const cursor = accessLayer.createCursor({ city: 'Roma' }, storage);
for await (const record of cursor) {
  console.dir(record);
}

Builder

Step-by-step assembly of a complex configurable object, often using chaining, e.g., Query Builder or Form Generator.

Refs: https://github.com/HowProgrammingWorks/Builder

class QueryBuilder {
  #options;

  constructor(table) {
    this.#options = { table, where: {}, limit: null, order: null };
  }

  where(cond) {
    Object.assign(this.#options.where, cond);
    return this;
  }

  order(field) {
    this.#options.order = field;
    return this;
  }

  limit(n) {
    this.#options.limit = n;
    return this;
  }

  build() {
    return { ...this.#options };
  }
}
const query = new QueryBuilder('User')
  .where({ active: true })
  .order('name')
  .limit(10)
  .build();

Read the full file on GitHub · 874 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. 11d ago First seen · 874 lines · 107 tokens per session scan A a218dab3d3f8

Subscribe to this mod's changes

js-gof is a skill published in the GitHub repository metarhia/metaskills (50 stars, last pushed 1mo ago), licensed MIT. It adds 107 tokens to every session and 4,746 once invoked, about $0.0005 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

autovault-skill

Understand AutoVault-managed skills and how to install or update them. Use when a skill is visible via symlink, when authoring or editing SKILL.md, or before touching /.autovault/skills. Vault writes must go through autovault add-local or MCP proposeskill/updateskill so AutoVault re-signs; never hand-edit vaulted…

autoworks-ai/autovault · 84 tokens

typescript

TypeScript coding conventions, best practices, and patterns for writing clean, maintainable code.

genkit-ai/genkit · 20 tokens

loom-typescript

TypeScript language expertise for type-safe, production-quality code.

cosmix/loom · 16 tokens

zcfg

Integrate zcfg (Zero Dependency Configuration Utility) into Java applications. Use when adding configuration loading, reading properties files, setting up application configuration, or integrating zcfg into a Java project. Triggers on "zcfg", "add configuration", "load properties", "application configuration with…

AdamBien/airails · 75 tokens

zcl

Add colored terminal output to Java applications using zcl (Zero-dependency Colour Logger). Use when adding colored console output, terminal logging with colors, ANSI color support, or integrating zcl into a Java project. Triggers on "zcl", "colored output", "colored logging", "terminal colors", "ANSI colors"…

AdamBien/airails · 85 tokens

java-cli-app

Create and maintain multi-file Java 25 CLI applications packaged as executable JARs with zb (Zero Dependencies Builder). Use when asked to create a Java CLI application, a CLI project with multiple source files, or an executable JAR. Triggers on "Java CLI app", "CLI application", "multi-file Java", "executable JAR"…

AdamBien/airails · 106 tokens