claude-code-starter-kit
Drop-in rules, hooks, agents, and commands that make Claude Code smarter on any project. Copy the .claude/ folder into your repo and start vibe coding with guardrails.
What's Inside
.claude/
├── agents/ 4 specialist AI agents
│ ├── security-reviewer.md # OWASP security audit (read-only)
│ ├── code-reviewer.md # Convention compliance (read-only)
│ ├── test-writer.md # Auto-generate tests
│ └── refactor-splitter.md # Split oversized files
├── commands/ 7 slash commands
│ ├── verify.md # /verify — lint + typecheck + test + build
│ ├── learn.md # /learn — capture patterns into docs
│ ├── audit-docs.md # /audit-docs — find documentation gaps
│ ├── security-review.md # /security-review — run security audit
│ ├── review.md # /review — run code review
│ ├── write-tests.md # /write-tests — generate tests
│ └── split-file.md # /split-file — split large files
├── hooks/ 6 automated scripts
│ ├── block-destructive.sh # PreToolUse: blocks rm -rf, force push, curl|sh
│ ├── check-file-length.sh # PostToolUse: max 150 lines per file
│ ├── check-no-any.sh # PostToolUse: no 'any' type
│ ├── check-console-log.sh # PostToolUse: no console.log
│ ├── auto-lint-on-edit.sh # PostToolUse: auto-format after edits
│ └── session-start.sh # SessionStart: inject git status + context
├── rules/
│ └── example.md # Example path-filtered rule (customize)
└── settings.json # Wires all hooks together
tasks/
├── todo.md # Task planning + progress tracking
└── lessons.md # Self-improvement log (mistakes → rules)
CLAUDE.md # Agent behavior rules + project templateQuick Start
Option 1: Copy into existing project
# Clone this repo
git clone https://github.com/FirasLatrech/claude-code-starter-kit.git
# Copy into your project
cp -r claude-code-starter-kit/.claude your-project/
cp -r claude-code-starter-kit/tasks your-project/
cp claude-code-starter-kit/CLAUDE.md your-project/
# Make hooks executable
chmod +x your-project/.claude/hooks/*.shOption 2: Use as template
Click "Use this template" on GitHub, then customize CLAUDE.md for your project.
Option 3: Cherry-pick what you need
Only want the hooks? Copy .claude/hooks/ and .claude/settings.json.
Only want the agents? Copy .claude/agents/.
Mix and match.
Customize
After copying, edit these files for your project:
CLAUDE.md— Replace the placeholder sections (Project, Structure, Commands) with your actual project info.claude/rules/example.md— Delete it and create rules for your stack (see examples inside).claude/hooks/auto-lint-on-edit.sh— Uncomment your linter (Biome, ESLint, or Prettier).claude/hooks/check-file-length.sh— AdjustMAX_LINESif 150 is too strict
What Each Piece Does
Hooks (Deterministic Enforcement)
Hooks are shell scripts that run automatically. They can't be ignored by AI.
| Hook | When | What |
|---|---|---|
block-destructive.sh | Before bash commands | Blocks rm -rf /, git push --force main, curl|sh, DROP TABLE |
check-file-length.sh | After file edits | Rejects files over 150 lines |
check-no-any.sh | After file edits | Rejects TypeScript any type |
check-console-log.sh | After file edits | Rejects console.log (skips test files) |
auto-lint-on-edit.sh | After file edits | Auto-runs your linter/formatter |
session-start.sh | Session starts | Shows git status, current task, lesson count |
Agents (Specialist Workers)
Agents are AI workers with restricted permissions. Read-only agents can't accidentally modify your code.
| Agent | Can Edit? | Purpose |
|---|---|---|
security-reviewer | No | OWASP Top 10 audit, injection, auth, secrets |
code-reviewer | No | Conventions, DRY, performance, types |
test-writer | Yes | Writes + runs tests matching your patterns |
refactor-splitter | Yes | Splits large files, fixes all imports |
Commands (Slash Workflows)
Type these in Claude Code to trigger workflows:
| Command | What it does |
|---|---|
/verify | Run full verification: lint + typecheck + test + build |
/learn [topic] | Capture a gotcha or pattern into the right doc file |
/audit-docs | Compare codebase against docs, find undocumented gaps |
/security-review [area] | Run OWASP security audit via agent |
/review [file] | Run convention compliance check via agent |
/write-tests [file] | Generate tests for untested code |
/split-file [file] | Split files exceeding 150 lines |
Agent Behavior Rules (in CLAUDE.md)
These 7 rules change how Claude thinks, not just what code it writes:
- Plan Mode Default — Plans in
tasks/todo.mdbefore coding, waits for approval - Subagent Strategy — Offloads research to subagents, keeps context clean
- Self-Improvement Loop — After corrections → writes to
tasks/lessons.md→ never repeats - Verification Before Done — Must prove code works before saying "done"
- Demand Elegance — Pauses to think on non-trivial changes
- Autonomous Bug Fixing — Just fixes bugs, no hand-holding
- Core Principles — Simplicity first, no laziness, no guessing
Task Management (tasks/)
| File | Purpose |
|---|---|
tasks/todo.md | Claude writes plans here, tracks progress with checkboxes |
tasks/lessons.md | Mistakes are logged with rules to prevent them. Reviewed every session |
Rules System
Create .claude/rules/<name>.md files with YAML frontmatter for path-filtered rules:
---
globs: "src/components/**/*.tsx"
---
# React Component Rules
- Use functional components with hooks
- Import UI from shared library
- Add loading states for async dataRules only load when Claude works on files matching the glob pattern. See .claude/rules/example.md for more examples.
FAQ
Q: Will this work with Cursor/Windsurf/other AI editors?
A: The CLAUDE.md and tasks/ system works anywhere. The .claude/ directory (hooks, agents, commands, rules) is specific to Claude Code.
Q: Can I use this with any programming language?
A: Yes. The hooks check for .ts/.tsx/.js/.jsx by default — edit them for your language. The agents, commands, and behavior rules are language-agnostic.
Q: Will the hooks slow down Claude? A: No. They're lightweight bash scripts that run in milliseconds.
Q: How do I disable a specific hook?
A: Remove its entry from .claude/settings.json.
Contributing
Found a useful pattern? Open a PR. The goal is a collection of battle-tested rules that help anyone vibe code with confidence.
License
MIT