agentleFS
Mi9-LLCMi9-LLC/agent-skills/skills/coding-standards/SKILL.md

coding-standards

Skill2 starsChanged 5 months agoMITView on GitHub

Reuse-before-build discipline for writing NEW TypeScript/Node or C#/.NET code. Trigger at two decision moments: (1) about to write a new function, utility, helper, wrapper, service, or algorithm in TS or C# — "write a helper to X", "implement retry / date-parsing / validation logic", "create a service/module for Y"; (2) adding or choosing a dependency — "should we add lodash/Polly", "which library for X". Walks a strict reuse ladder — built-in/standard library first, then (C#) first-party Microsoft.Extensions.*, then a library the project already uses, custom code last — plus precise types, specific error classes, and doc comments; always asks before adding a new package. Do NOT trigger for code review, debugging existing behavior, trivial edits (a typo, rename, or one-line fix), or languages other than TypeScript/C#.

138 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use everything-claude-code, everything-claude-code-conventions and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • InfopibeSkill

    everything-claude-code

    Also in 9 projects that use this

  • mryeastcodeSkill

    everything-claude-code-conventions

    Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

    Also in 8 projects that use this

  • niloykumarbarmanSkill

    agent-sort

    Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.

    Also in 8 projects that use this

  • HABUBUSSSkill

    project-guidelines-example

    Also in 10 projects that use this

  • HABUBUSSSkill

    strategic-compact

    Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction.

    Also in 38 projects that use this

  • InfopibeSkill

    investor-outreach

    Draft cold emails, warm intro blurbs, follow-ups, update emails, and investor communications for fundraising. Use when the user wants outreach to angels, VCs, strategic investors, or accelerators and needs concise, personalized, investor-facing messaging.

    Also in 22 projects that use this

  • +1 more from Infopibe
  • +1 more from HABUBUSS

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 124 edited versions we read keep these.

  • 2

    Distinctive

    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
  1. Distinctive:

    Before writing any new function or helper, walk this ladder and take the FIRST rung that solves the problem:

    line 24
  2. Distinctive:

    Never hand-roll file I/O, path manipulation, HTTP requests, date parsing, data validation, JSON handling, or retry logic when a rung 1–3 …

    line 33

“Common” is measured: kept by at least 6 in 10 of the 124 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

coding-standards

Reuse before you build. When writing new TypeScript/Node or C#/.NET code, walk the ladder below and take the FIRST rung that solves the problem — a custom implementation is the last resort, not the default.

The reuse ladder

Before writing any new function or helper, walk this ladder and take the FIRST rung that solves the problem:

  1. A built-in language feature or standard-library API.
    • TS/Node: Array/Object/Map/Set methods, structuredClone, fetch, URL, fs/promises, path, crypto, util, stream, timers/promises.
    • C#: LINQ, records, pattern matching, System.Text.Json, System.IO, System.Net.Http, System.Threading.Tasks.
  2. C# only: a first-party Microsoft.Extensions.* package — already referenced, or ask before adding (same rule as rung 3).
  3. A widely-adopted library the project ALREADY uses — check package.json / Directory.Packages.props / *.csproj first. If the right library isn't installed, ask before adding it.
  4. Only if none of the above apply: write a custom implementation.

Never hand-roll file I/O, path manipulation, HTTP requests, date parsing, data validation, JSON handling, or retry logic when a rung 1–3 option exists.

Consistency exception. Where the project already uses one library consistently for the exact task at hand (every date goes through date-fns, every HTTP call through the project's existing client), match that convention rather than introducing a rung-1 built-in alongside it — two ways to do the same thing in one codebase costs more than the heavier tool does. If you think the built-in is the better call anyway, say so and let the user decide; don't silently pick either one.

Language rules

TypeScript:

  • Strict mode on; no any — use unknown for untrusted external data; prefer discriminated unions over loose optional fields.
  • Domain failures throw custom error classes extending Error — never bare new Error(...).
  • One-line JSDoc on non-obvious functions.

C#:

  • Nullable reference types on; avoid object/dynamic; records for immutable data; specific numeric/collection types over broad ones.
  • Domain failures throw specific exceptions (ArgumentException, InvalidOperationException, or a custom Exception subclass) — never bare new Exception(...).
  • async/await with a CancellationToken for I/O; no sync-over-async (.Result, .Wait(), .GetAwaiter().GetResult()).
  • XML doc comments (///) on non-obvious public members.

Adding a dependency

Never add a package silently. When the right tool is a library the project does not yet use (rung 2 or 3), stop and ask the user first — use AskUserQuestion, naming the candidate package, what it replaces, and the hand-rolled alternative — and proceed only on their answer. A dependency is a long-term maintenance commitment the user owns, not an implementation detail.

Worked examples

  • Deep-clone a settings object (TS). Rung 1: structuredClone(settings). Not a recursive cloneDeep helper; not adding lodash for one call. (If the object holds functions or class instances structuredClone can't copy, that is a genuine rung-4 case — say so.)
  • Parse a URL query string (TS). Rung 1: new URL(href).searchParams or URLSearchParams. Never a regex splitter.
  • Group orders by customer (C#). Rung 1: LINQ orders.GroupBy(o => o.CustomerId). Not nested loops maintaining a Dictionary<string, List<Order>> by hand.
  • Retry a flaky HTTP call (C#). Rung 3: the project already references Polly (check Directory.Packages.props) → use it. Not referenced → ask before adding it; don't silently write a for + Task.Delay loop either — the user's answer decides which.
  • Validate an incoming payload (TS). Rung 3: the project already uses zod → define a schema. Only if no validation library exists and the user declines adding one: a hand-written type guard against unknown (rung 4).

When NOT to apply

  • Code review or critique asks — review against the target repo's own standards, not this ladder.
  • Debugging existing behavior — diagnose first; don't rewrite working code to fit the ladder mid-debug.
  • Trivial edits — a typo, rename, or one-line fix has no reuse decision in it.
  • Other languages — this codifies TS/Node and C#/.NET practice only.

Canonical copy & repo bootstrap

This skill is the canonical source of the ## Coding standards block checked into Mi9 repos' root CLAUDE.md files — the <!-- source: Mi9-LLC/agent-skills → skills/coding-standards --> comment in those blocks points here.

  • Updating the rules: change this skill first, then re-sync the repo blocks from it.
  • Bootstrapping a new TS/C# repo: if the repo's CLAUDE.md has no ## Coding standards section, offer to insert the tailored block — TS repos get the ladder minus the C#-only rung (remaining rungs renumbered) and the TypeScript rules only; C# repos get the full 4-rung ladder and the C# rules only.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.