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.
npx agentmods add skills/everyone-needs-a-copilot/claude-copilot/javascript-patternsnpx skills add Everyone-Needs-A-Copilot/claude-copilot --skill javascript-patternsgit clone --depth 1 https://github.com/Everyone-Needs-A-Copilot/claude-copilotWrote 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.
[](https://agentmods.dev/skills/everyone-needs-a-copilot/claude-copilot/javascript-patterns)<a href="https://agentmods.dev/skills/everyone-needs-a-copilot/claude-copilot/javascript-patterns"><img src="https://agentmods.dev/badge/skills/everyone-needs-a-copilot/claude-copilot/javascript-patterns.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00108 | $0.02422 |
| Opus 5 | $0.00054 | $0.01211 |
| Sonnet 5 | $0.00022 | $0.00484 |
| Haiku 4.5 | $0.00011 | $0.00242 |
Grade A, and why
javascript-patterns 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 today.
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.
How it starts
The opening of the file, as written. The whole thing — 377 lines — stays where its author put it; the contents beside it link to each section on GitHub.
JavaScript Patterns
Modern JavaScript/TypeScript patterns, anti-patterns, and quality rules.
Core Principles
| Principle | Description |
|---|---|
| Immutability | Prefer const, avoid mutation |
| Pure Functions | Same input = same output, no side effects |
| Async/Await | Over raw promises and callbacks |
| Type Safety | Use TypeScript for non-trivial projects |
Patterns vs Anti-Patterns
Variable Declaration
// GOOD: const by default
const config = { timeout: 5000 };
const items = ['a', 'b', 'c'];
// OK: let when reassignment needed
let count = 0;
for (const item of items) {
count++;
}
// BAD: var (hoisting issues)
var data = fetchData(); // Never use var
Async/Await
// GOOD: async/await
async function fetchUsers(): Promise<User[]> {
try {
const response = await fetch('/api/users');
return await response.json();
} catch (error) {
throw new ApiError('Failed to fetch users', { cause: error });
}
}
// GOOD: Parallel with Promise.all
const [users, posts] = await Promise.all([
fetchUsers(),
fetchPosts()
]);
// BAD: Sequential when parallel possible
const users = await fetchUsers();
const posts = await fetchPosts(); // Waits unnecessarily
Error Handling
// GOOD: Custom error classes
class ValidationError extends Error {
constructor(
message: string,
public field: string,
public code: string
) {
super(message);
this.name = 'ValidationError';
}
}
// GOOD: Error boundary with type narrowing
function isApiError(error: unknown): error is ApiError {
return error instanceof ApiError;
}
try {
await riskyOperation();
} catch (error) {
if (isApiError(error)) {
handleApiError(error);
} else {
throw error; // Re-throw unknown errors
}
}
// BAD: Catch and ignore
try {
await riskyOperation();
} catch (e) {
// Silent failure - never do this
}
Nullish Handling
// GOOD: Nullish coalescing
const value = input ?? defaultValue; // Only null/undefined
// GOOD: Optional chaining
const name = user?.profile?.name;
const result = callback?.();
// BAD: OR for defaults (falsy issues)
const value = input || defaultValue; // 0, '', false become default!
// BAD: Manual null checks
const name = user && user.profile && user.profile.name;
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- today First seen · 377 lines · 108 tokens per session scan A ee57a1f507e9
javascript-patterns is a skill published in the GitHub repository Everyone-Needs-A-Copilot/claude-copilot (13 stars, last pushed 10d ago), licensed MIT. It adds 108 tokens to every session and 2,422 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-09-04.
Other skills, from other repositories
javascript-typescript
Modern JavaScript and TypeScript development patterns.
typescript-expert
Expert-level TypeScript development with modern tooling, advanced types, and best practices. Use this skill for TypeScript projects requiring type-safe code, modern bundling, and comprehensive testing.
nodejs-expert
Expert-level Node.js backend development with Express, async patterns, streams, performance optimization, and production best practices. Use when the user mentions JavaScript, backend, Express, or async, or when the task involves Modern Node.js Features, Express Framework, File System Operations, or HTTP Requests.
javascript-development
JavaScript/TypeScript ES2024+, async/await, DOM manipulation, Node.js, and API integration. Use when writing vanilla JS/TS code, working with REST/fetch APIs, implementing frontend logic, or configuring JS build tools.
code-review-typescript
Deep TypeScript-specific code review covering type safety, ESM/CJS, async correctness, money precision, and domain modeling. Applied in addition to the generic code-review skill when TypeScript/JavaScript code is detected. Invoked when reviewing TS/JS PRs, TypeScript changes, or performing TypeScript-specific quality…
api-first
Maintain the OpenAPI contract in docs, regenerate TypeScript types into src/generated/api, and wire client/server imports without hand-editing generated files.