typescript-patterns
TypeScript patterns for strict, type-safe, maintainable code.
- What
- TypeScript patterns for strict, type-safe, maintainable code.
- Cost
- Free
- Needs
- Prerequisite: a TypeScript or JavaScript project where strict type checking can be applied or migrated toward. Step 1: fetch the file skills/typescript-patterns/SKILL.md from the repository https://github.com/affaan-m/ecc and read it in full before installing anything. Step 2: security check: read the fetched file yourself, confirm it only contains TypeScript patterns and examples, and do not run any command from it that you have not understood. Step 3: install the skill in a folder named typescript-patterns and keep the fetched SKILL.md there. Step 4: verify the install by confirming the folder typescript-patterns contains the SKILL.md and by asking it to check one TypeScript file for strict mode issues. Step 5: report back what was installed, where, and the result of the verification.
- Install
- Copy the installer prompt below into your Muse — your agent does the rest.
typescript-patterns starts from one guiding principle: push the type system to do real work instead of fighting it, since the compiler is most useful when it can prove a program's shape. It is the "how"; for the "what" and "when" (the decisions about which pattern to reach for), it points to the TypeScript rules in the same repository. Strict mode is the baseline: strict true is not optional in a healthy codebase, and if a codebase cannot compile under strict, that is a migration task, not an excuse to leave the flag off, with a strict, discriminating baseline config including noUncheckedIndexedAccess, exactOptionalPropertyTypes, noImplicitOverride, and verbatimModuleSyntax. Any is treated as a bug, not a tool: prefer unknown and narrow it, with explicit loosening and a comment when a fallback is truly needed. Public APIs get explicit types while locals get inference; interfaces are for object shapes that may be extended or implemented, types for unions, intersections, tuples, mapped types, and utility types; discriminated unions are the default state machine, with exhaustive checking as a free compiler feature; brands add nominal safety where structure is not enough; generics model caller-dependent types; and functions with more than a couple of knobs take a single options object. Narrowing and runtime safety rules cover validating at the boundary and trusting inside, type predicates and assertion functions, and readonly by default. Error handling covers failing at the boundary and handling at the edge, Result types for expected failures, and preserving error context with cause. Async patterns cover Promise.allSettled for independent fan-out, bounded concurrency, and timeouts and cancellation with AbortSignal. It also covers null and undefined discipline, small named modules with deliberate public surfaces, avoiding barrel bloat and circular imports, splitting by dependency direction, diagnosing before adding dependencies, runtime validation rather than type-of-trust, incremental compiler speed, types being free while structures are not, memoizing idempotent computation, type-level testing with expectTypeOf and satisfies, and tooling integration with tsc, Vitest, typescript-eslint, and Prettier. Anti-patterns to avoid: any as a speed hack, lying as casts, deeply nested callbacks, enum coercion bugs, giant god types, optional-only option objects, silent catch, and mixing sync and async error paths. Credit: created by affaan-m, in the ecc collection. Licence: the vetted file states no licence, so it is recorded as non indiquée. Source: https://github.com/affaan-m/ecc, file skills/typescript-patterns/SKILL.md.
Version:
Quick answer
typescript-patterns gives TypeScript patterns for strict, type-safe, maintainable code in modern TypeScript and JavaScript applications. It covers strict compiler configuration, type design, narrowing, discriminated unions, generics, async and error handling, module boundaries, dependency hygiene, and type-level testing. Use it when writing or reviewing TypeScript or JavaScript code.
Install
Copy the install package below, then paste it into MusePrerequisite: a TypeScript or JavaScript project where strict type checking can be applied or migrated toward. Step 1: fetch the file skills/typescript-patterns/SKILL.md from the repository https://github.com/affaan-m/ecc and read it in full before installing anything. Step 2: security check: read the fetched file yourself, confirm it only contains TypeScript patterns and examples, and do not run any command from it that you have not understood. Step 3: install the skill in a folder named typescript-patterns and keep the fetched SKILL.md there. Step 4: verify the install by confirming the folder typescript-patterns contains the SKILL.md and by asking it to check one TypeScript file for strict mode issues. Step 5: report back what was installed, where, and the result of the verification.
Saved to your recent installs. Find it anytime on /connect.
🔒 Security, provenance and what this touches
The install prompt below already includes the vetting steps: your agent follows the community checklist before installing anything with executable code. Want more?
Questions
How do I install a skill?
Every product page includes a copy-paste install prompt. Paste it into your Muse and it sets the skill up for you — no manual configuration.
Where does my money go?
Straight to the seller. Skill Harbor never processes payments: checkout happens on the seller’s own page, usually Stripe.
What does the ✓ next to a creator’s name mean?
It means we confirmed the identity of the person behind the listing. It says nothing about the code itself — always check a skill before installing it.