typescript
Skill514 starsChanged 9 days agoMITView on GitHub
TypeScript anti-slop guardrails. Use when writing or reviewing .ts, .tsx, and .mts files. Covers patterns that Biome, tsc, and rslint do not catch.
66 other projects use a version of this.
Adopted by
Most recently taken up by
- bbartling/open-fddtheir own version, first seen Nov 9, 2026
- TheLunchTrae/claude-code-configstheir own version, first seen Nov 8, 2026
- testdino-hq/google-styleguides-skillstheir own version, first seen Nov 8, 2026
- lobehub/lobehubtheir own version, first seen Nov 5, 2026
- its-ash/skillstheir own version, first seen Nov 1, 2026
- sentimony/skillstheir own version, first seen Nov 1, 2026
Used with
Projects with it also use msw, rust and 9 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.
thongdn-itSkillmsw
MSW (Mock Service Worker) best practices for API mocking in tests (formerly test-msw). This skill should be used when setting up MSW, writing request handlers, or mocking HTTP APIs. This skill does NOT cover general testing patterns (use test-vitest or test-tdd skills) or test methodology.
Also in 3 projects that use this
MicrosoftSkillrust
Use this guide when working on Rust changes in the FAST monorepo.
Also in 9 projects that use this
SupabaseSkillreact-hook-form
Correct React Hook Form usage anywhere in the monorepo — data flow, subscriptions,
Also in 3 projects that use this
VercelSkillreact
React renderer for json-render that turns JSON specs into React components. Use when working with @json-render/react, building React UIs from JSON, creating component catalogs, or rendering AI-generated specs.
Also in 10 projects that use this
leonaaardobSkilldrizzle
Complete Drizzle ORM documentation in markdown format. Use when working with Drizzle ORM - covers schema definition, queries, migrations, database connections (PostgreSQL, MySQL, SQLite), integrations (Neon, Supabase, PlanetScale, Cloudflare D1, Turso), column types, relations, transactions, and framework usage (Next.js, SvelteKit, Astro).
Also in 3 projects that use this
thongdn-itSkilltailwind
Tailwind CSS v4 performance optimization and best practices guidelines (formerly tailwindcss-v4-style). This skill should be used when writing, reviewing, or refactoring Tailwind CSS v4 code to ensure optimal build performance, minimal CSS output, and correct usage of v4 features. Triggers on tasks involving Tailwind configuration, @theme directive, utility classes, responsive design, dark mode, container queries, or CSS generation optimization.
Also in 5 projects that use this
- +1 more from thongdn-it
Other versions66 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 66
- lobehub/lobe-chat★ 84ksame name
- lobehub/lobehub★ 84ksame name
- recharts/recharts★ 28ksame name
- ccusage/ccusage★ 19ksame name
- ryoppippi/ccusage★ 19ksame name
- scalar/scalar★ 16ksame name
- prowler-cloud/prowler★ 15ksame name
- microsoft/fast★ 9.7ksame name
- epicenter-md/epicenter★ 4.8ksame name
- EpicenterHQ/epicenter★ 4.8ksame name
56 more not listed
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 repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- website/AGENTS.mdAGENTS.md
- api-doc-syncSkill
- create-draft-release-notesSkill
- create-release-blogSkill
- developmentSkill
- pr-creatorSkill
- rstack-docs-writerSkill
- testingSkill
- verifySkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. 0 are common, 9 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 52 edited versions we read keep these.
9
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
When in doubt, copy the local pattern in the file you are editing rather than importing a style from elsewhere.
- Distinctive: line 35
Do not add runtime checks that the type system already guarantees.
- Very specific: line 56
Treat as as a last resort, not a way to silence errors.
- Very specific: line 68
Never as any or as unknown as X unless at a proven interop seam or test-only partial mock.
- Distinctive: line 69
If control flow already proved the type, the cast is redundant — remove it.
- Distinctive: line 70
When a cast is truly needed, add a one-line comment explaining why.
- Distinctive: line 78
Do not extract a function, class, or type that is used exactly once, unless it genuinely improves readability at the call site.
- Very specific: line 98
If a catch block doesn't add information or recover, delete the try/catch.
- Distinctive: line 125
When two declarations describe the same thing — types, constants, defaults, validation rules — one must derive from the other.
- Very specific: line 129
Before writing a helper function, search the codebase.
- Distinctive: line 133
Don't introduce deep conditional types, mapped types, or template literal types unless they clearly reduce complexity.
- Distinctive: line 134
Don't create a reusable utility type for one call site.
- Distinctive: line 135
Prefer the smallest type shape that explains the contract.
- Very specific: line 140
Use import type for type-only imports.
“Common” is measured: kept by at least 6 in 10 of the 52 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.
Files
TypeScript Anti-Slop guardrails
Skip formatting and lint rules — tooling handles those. This skill targets patterns that produce valid-looking but poor-quality code.
When in doubt, copy the local pattern in the file you are editing rather than importing a style from elsewhere.
1. No restating comments
Comments that repeat what the next line does are noise. Only comment why, never what.
// wrong
// Set the current file path
context.setFilePath(filePath);
// Initialize the reporter
const reporter = new Reporter(config);
// right — let code speak; comment only non-obvious intent
// Force sequential execution — parallel runs corrupt shared fixture state
context.setFilePath(filePath);
const reporter = new Reporter(config);Also avoid: section-header comments inside functions (// --- Validate ---), JSDoc that adds nothing beyond the signature, temporal markers (// added for, // Phase 1).
2. No unnecessary defensive code
Do not add runtime checks that the type system already guarantees. Trust the types.
// wrong — param is already typed string
function resolvePattern(pattern: string): string {
if (typeof pattern !== 'string') {
throw new Error('pattern must be a string');
}
return glob(pattern);
}
// right — trust the type system
function resolvePattern(pattern: string): string {
return glob(pattern);
}Also avoid: redundant ?? [] / || {} on fields that are always initialized (normalize once at construction instead), null checks on values you just produced, try/catch around code that cannot throw.
3. Minimize as
Treat as as a last resort, not a way to silence errors. If you need as, the types are probably wrong.
// wrong — casting to escape a type error
const name = (config as any).testName;
// right — narrow or fix the type
if ('testName' in config) {
const name = config.testName;
}- Never
as anyoras unknown as Xunless at a proven interop seam or test-only partial mock. - If control flow already proved the type, the cast is redundant — remove it.
- When a cast is truly needed, add a one-line comment explaining why.
4. Minimize any
noExplicitAny is off in this repository, so self-police. Prefer unknown + narrowing, or a generic, before reaching for any. Never let any leak into exported APIs, config types, or cross-package contracts.
5. No One-Use abstractions
Do not extract a function, class, or type that is used exactly once, unless it genuinely improves readability at the call site.
// wrong — called once, five lines away
function formatTestName(name: string): string {
return name.replace(/\.test$/, '');
}
// ... later:
const display = formatTestName(file);
// right — inline it
const display = file.replace(/\.test$/, '');Also avoid: interfaces with single implementations, factory functions that create one thing, options objects with 10 optional fields for features that don't exist yet.
Threshold: extract when used in 3+ places, or when the extraction meaningfully shortens a complex function.
6. No Catch-and-Rethrow without context
If a catch block doesn't add information or recover, delete the try/catch.
// wrong — catches and rethrows with just a message rewrite
try {
await loadConfig(path);
} catch (error) {
throw new Error(
`Failed to load: ${error instanceof Error ? error.message : error}`,
);
}
// right — use cause to preserve the chain
try {
await loadConfig(path);
} catch (error) {
throw new Error(`Failed to load config at ${path}`, { cause: error });
}
// also right — just don't catch if you add nothing
await loadConfig(path);Also avoid: bare rethrow (catch (e) { throw e; }), empty catch blocks, catch blocks that only console.log.
7. Single source of truth — prevent drift
When two declarations describe the same thing — types, constants, defaults, validation rules — one must derive from the other. Duplicating independently causes drift: they match today, diverge silently tomorrow. Derive via extends, Pick, ReturnType, typeof, satisfies, or simply importing the canonical definition.
8. Search before creating utilities
Before writing a helper function, search the codebase. If it exists, import it. If it exists but isn't exported, export it. Don't create a second isObject() or normalizeSlashes().
9. No Over-Engineered types
- Don't introduce deep conditional types, mapped types, or template literal types unless they clearly reduce complexity.
- Don't create a reusable utility type for one call site.
- Prefer the smallest type shape that explains the contract.
- This repository uses both
typeandinterface— follow nearby code.
Repository conventions
- Use
import typefor type-only imports. - Public config properties: use JSDoc with
@default. - Preserve existing file-local patterns unless there is a clear bug or maintenance win.
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.

