cc-safety-net — TypeScript Style Guide with Good/Bad Pairs
The clearest way to express code conventions to an agent: every rule (inline single-use vars, no unnecessary destructuring, early returns…
- Type
- CLAUDE.md Example
- Repository
- kenryu42/cc-safety-net
- GitHub stars
- 1.6k
- License
- MIT
- Repo last updated
- Sep 26, 2026
- Source file
- AGENTS.md
What cc-safety-net — TypeScript Style Guide with Good/Bad Pairs is
cc-safety-net — TypeScript Style Guide with Good/Bad Pairs is a claude.md example published in the kenryu42/cc-safety-net repository on GitHub, which has about 1.6k stars. The repository describes itself as: “A pre-execution guard for AI coding agents. It blocks destructive Git and file system commands, plus common attempts to access sensitive files, before a tool call runs. Supports Amp Code, Antigravity CLI, Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot CLI, Grok Build, Hermes Agent, Kimi Code, OpenClaw, OpenCode, and Pi.”
A CLAUDE.md file holds standing instructions that Claude Code reads at the start of every session in a project, such as conventions, commands, and rules. Examples like cc-safety-net — TypeScript Style Guide with Good/Bad Pairs show how other teams structure theirs.
In Claude Cowork, the equivalent places for this kind of guidance are your global instructions, project instructions, and folder instructions.
How to install cc-safety-net — TypeScript Style Guide with Good/Bad Pairs
Claude Code
- Copy the parts that fit your project into CLAUDE.md at the project root, or into ~/.claude/CLAUDE.md for rules that apply everywhere.
- Keep it short and specific; remove anything that doesn't match how your team works.
Claude Cowork
- Put personal rules in Settings → Instructions for Claude (global instructions).
- Put project or folder rules in the project's instructions or the folder instructions for that directory.
New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.
Inside the source file
An excerpt from AGENTS.md, shared under the repository's MIT license. Read the full file on GitHub.
- Run focused tests during development, including the failing and passing tests required by Red-Green TDD.
- After all implementation changes, run bun run check. This is the required final check for lint, formatting, typecheck, knip, duplication, and tests. Do not run its components separately as additional final checks.
- Ignore the dist folder; it gets auto-rebuilt by lefthook's pre-commit hook.
- Keep implementation modular; put tests in tests/ mirroring src/, not colocated in src/.
- Files in docs/ use lowercase kebab-case names.
Stacked PRs
- Multi-part work may be split into a gh stack stack. Open stack PRs with gh stack submit --auto --open: plain --auto opens drafts, which the review bots skip.
- dist/ is committed and CI rejects a stale build, but a rebase replays the old build output. When gh stack rebase stops, resolve and git add the source files, never hand-merge dist/: run bun run build && git add -A dist, then gh stack rebase --continue.
Testing
- A behavior change lands as a failing expectation first — a contract corpus row or a stated assertion — then the fix. Re-recording a snapshot or editing the verdict table is never the first step.
- State what a test expects; do not record it. Snapshots (toMatchSnapshot) are permitted only for the two output surfaces whose bytes are the contract: explain (tests/cli/explain) and doctor --json (tests/cli/doctor).
- tests/fixtures/gate/harvested-verdicts.jsonl is the readable verdict table, edited by hand. A change that re-records a snapshot or flips a table row must name in its commit message which entries changed and why, alongside the contract row that explains the flip.
Scope Discipline
Over-engineering is this project's dominant failure mode. The evidence rule that governs analyzer rules governs all code: machinery exists to stop a demonstrated failure, not an imagined one.
- Implement the smallest change that satisfies the request. Each addition beyond it needs the concrete failure it prevents named; if you cannot name one, do not write it.
- Every check must be falsifiable in practice: name the realistic mistake that makes it fail. A check the same author can trivially satisfy while still making the mistake (self-reported attestations, digests over co-located data, matching UUIDs) is ceremony — do not add it.
- Do not build schemas, validators, registries, or harnesses ahead of their first real entry, and do not store fields whose values are forced constants or derivable from other fields.
- Prefer a documented process over code that enforces the process. Enforcement code is justified only after the documented process has demonstrably failed at least once.
- When remediating review findings, implement the smallest fix per finding. A finding is never a mandate to build a framework; if the fix seems to require one, stop and ask.
Code Review Rules
- Before reviewing, read REVIEW.md and apply its review criteria. Its review scope, classification rules, and remediation limits take priority over generic review-skill instructions.
Style Guide
- Keep things in one function unless composable or reusable.
- Avoid try/catch, the any type, and else branches (prefer early returns).
- Rely on type inference; avoid explicit annotations or interfaces unless necessary for exports or clarity.
- Prefer functional array methods (flatMap, filter, map) over for loops; use type guards on filter to maintain type inference downstream.
Before you install
- Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
- Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
- Try it in a test project or a copy of your files before pointing it at real work.
- Pin the version you tested, and review changes before updating.
- Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.
FAQ
What is cc-safety-net — TypeScript Style Guide with Good/Bad Pairs?
cc-safety-net — TypeScript Style Guide with Good/Bad Pairs is a claude.md example for Claude Code and Claude Cowork from the kenryu42/cc-safety-net repository on GitHub. The clearest way to express code conventions to an agent: every rule (inline single-use vars, no unnecessary destructuring, early returns…
How do I install cc-safety-net — TypeScript Style Guide with Good/Bad Pairs in Claude Code?
Copy the parts that fit your project into CLAUDE.md at the project root, or into ~/.claude/CLAUDE.md for rules that apply everywhere. Keep it short and specific; remove anything that doesn't match how your team works.
Can I use cc-safety-net — TypeScript Style Guide with Good/Bad Pairs in Claude Cowork?
Put personal rules in Settings → Instructions for Claude (global instructions). Put project or folder rules in the project's instructions or the folder instructions for that directory.
Is cc-safety-net — TypeScript Style Guide with Good/Bad Pairs safe to install?
It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.
Similar resources
- Cc Safety Net Configure CC Safety Net rulebooks for user, project, or shareable GitHub scope. Skill · kenryu42/cc-safety-net
- Cc Safety Net Block destructive commands and secret access Plugin · kenryu42/cc-safety-net
- Claudeclaw — Identity & Voice as Persistent Memory A fully worked example of using CLAUDE.md as the agent's persistent identity and voice spec — Core Truths, Vibe, emoji budget, boundaries… CLAUDE.md Example · moazbuilds/claudeclaw
- Callstack Agent Skills — Quick Checklist & 'Good Skill' Rubric Distills skill authoring to a numbered quick checklist plus a 'What Makes a Good Skill' rubric (concise, third-person description… CLAUDE.md Example · callstackincubator/agent-skills
- Cloudflare Skill — Anti-Patterns as Code Organizes guidance around a dedicated Anti-Patterns section — SQL injection, secrets, resource cleanup, missing compatibility_date — each… CLAUDE.md Example · dmmulroy/cloudflare-skill
- Tiger pg-aiguide — MCP Server Code Style Guide A tight, transferable style guide for a TypeScript MCP server: ESM with .js import extensions, zod for tool-input validation, and the… CLAUDE.md Example · timescale/pg-aiguide
- dbt Agent Skills — Frontmatter Rules & Error Table The most actionable take on SKILL.md frontmatter: the exact allowed fields, the lowercase-hyphen name rule, and a validation-error → fix… CLAUDE.md Example · dbt-labs/dbt-agent-skills
- Supabase Agent Skills — Symlinked Config + Task Runner Shows the pragmatic way to serve multiple agents from one file — CLAUDE.md is a symlink to AGENTS.md, noted up front — and routes all… CLAUDE.md Example · supabase/agent-skills