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/versoxbt/claude-initial-setup/immutability-patternsnpx skills add VersoXBT/claude-initial-setup --skill immutability-patternsgit clone --depth 1 https://github.com/VersoXBT/claude-initial-setupWrote 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/versoxbt/claude-initial-setup/immutability-patterns)<a href="https://agentmods.dev/skills/versoxbt/claude-initial-setup/immutability-patterns"><img src="https://agentmods.dev/badge/skills/versoxbt/claude-initial-setup/immutability-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.00063 | $0.01747 |
| Opus 5 | $0.00032 | $0.00873 |
| Sonnet 5 | $0.00013 | $0.00349 |
| Haiku 4.5 | $0.00006 | $0.00175 |
Grade A, and why
immutability-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 4d 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.
How it starts
The opening of the file, as written. The whole thing — 254 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Immutability Patterns
Create new objects instead of mutating existing ones. Immutability prevents shared-state bugs, makes code easier to reason about, and enables reliable change detection.
When to Use
- Writing any function that transforms data
- Updating React/Vue/Svelte state
- Working with Redux or other state management
- Reviewing code that modifies objects or arrays in place
- Any time
.push(),.splice(),delete, or direct property assignment appears on shared data
Core Patterns
JavaScript/TypeScript: Object Updates
// WRONG: Mutation
function updateUser(user: User, name: string): User {
user.name = name; // Mutates the original!
return user;
}
// CORRECT: Spread operator
function updateUser(user: User, name: string): User {
return { ...user, name };
}
// CORRECT: Nested object update
function updateAddress(user: User, city: string): User {
return {
...user,
address: {
...user.address,
city,
},
};
}
// CORRECT: Conditional field update
function toggleAdmin(user: User): User {
return {
...user,
role: user.role === "admin" ? "user" : "admin",
};
}
JavaScript/TypeScript: Array Operations
// WRONG: Mutating arrays
function addItem(items: Item[], item: Item): Item[] {
items.push(item); // Mutates!
return items;
}
// CORRECT: Immutable array operations
const added = [...items, newItem]; // append
const prepended = [newItem, ...items]; // prepend
const removed = items.filter((item) => item.id !== id); // remove
const updated = items.map((item) => // update
item.id === id ? { ...item, name: "new" } : item
);
const inserted = [ // insert at index
...items.slice(0, index),
newItem,
...items.slice(index),
];
TypeScript: Readonly Types
// Mark data as immutable at the type level
interface Config {
readonly apiUrl: string;
readonly timeout: number;
readonly retries: number;
}
// Readonly arrays
function processItems(items: readonly Item[]): readonly Item[] {
// items.push(x) -> TypeScript error!
return items.filter((item) => item.active);
}
// Deep readonly utility
type DeepReadonly<T> = {
readonly [K in keyof T]: T[K] extends object ? DeepReadonly<T[K]> : T[K];
};
// Readonly records
const routes: Readonly<Record<string, string>> = {
home: "/",
login: "/auth/login",
dashboard: "/app/dashboard",
};
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.
- 4d ago First seen · 254 lines · 63 tokens per session scan A 3e8812d7b7dc
immutability-patterns is a skill published in the GitHub repository VersoXBT/claude-initial-setup (4 stars, last pushed 3mo ago), licensed MIT. It adds 63 tokens to every session and 1,747 once invoked, about $0.0003 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-31.
Other skills, from other repositories
add-agent-property
Add a new property to the AI agents database. Use when the user wants to add, create, or introduce a new column, property, field, or feature to track across all agents in the comparison matrix. Handles all four required steps - database updates, groups.json, table display, and GitHub issue templates.
api-design
REST/GraphQL/gRPC API design best practices. Use when designing APIs, defining contracts, handling versioning. Covers OpenAPI 3.2, GraphQL Federation, gRPC streaming.
vc-audit-vc
Audit agent harness health: Claude/Codex agent parity, skill registry consistency, README.md sync, and protocol file wiring. Use when agents, skills, README.md, or development-protocol files move, split, or drift.
clash-doctor
Clash Verge 与 mihomo 诊断和 profile 管理。当用户遇到代理失败、需要配置 AI 工具路由、本地 Hub 拓扑、多机对齐、TUN 绕过、克隆或切换订阅,或同步后 配置未生效时使用。进程线路使用 clash-routes,出口 IP 质量使用 ip-check。 普通网络测速不使用。.
lov-env-management
统一管理平台、账号与多组 API Key,维护有效期和启用状态,安全同步到 zsh 或用户会话环境,并提供脱敏 Dashboard;用户说“管理环境变量”“rotate API keys”时使用。.
lov-deploy-to-vercel
Deploy frontend projects to Vercel with automatic custom domain setup. Handles Vite, Next.js, CRA, and static sites. Auto-configures Cloudflare DNS CNAME records and Vercel domain aliases. Supports SPA routing via vercel.json. Trigger when user says "deploy to vercel", "部署到 vercel", "vercel deploy", or mentions a…