Comprehensive CLAUDE.md guidelines + enforcement agents for Test-Driven Development, TypeScript strict mode, and functional programming.
π Watch a real coding session showing how CLAUDE.md guides AI pair programming in Claude Code.
- What This Is
- CLAUDE.md: The Development Framework
- Claude Code Agents: Automated Enforcement
- How to Use This in Your Projects
- Documentation
- Who This Is For
- Philosophy
- Continuous Improvement
- Personal Dotfiles
- Contributing
- Contact
This is my personal dotfiles repository. I use it to manage my shell configurations, git aliases, and development environment setup.
It became unexpectedly popular when I shared the CLAUDE.md file - development guidelines I wrote for AI-assisted programming. That's likely why you're here.
This repository now serves two purposes:
- CLAUDE.md + Skills + Eight enforcement agents - Development guidelines, 9 auto-discovered skill patterns, and automated quality enforcement (what most visitors want)
- Personal dotfiles - My shell configs, git aliases, and tool configurations (what this repo was originally for)
Most people are here for CLAUDE.md and the agents. This README focuses primarily on those, with dotfiles coverage at the end.
β Read the full CLAUDE.md file
CLAUDE.md is a living document that defines development principles, patterns, and anti-patterns. It transforms abstract concepts into actionable decision frameworks.
- TDD is non-negotiable - Every line of production code must be test-driven
- Behavior over implementation - Tests verify what code does, not how it does it
- Immutability by default - Pure functions and immutable data structures
- Schema-first with nuance - Runtime validation at trust boundaries, types for internal logic
- Semantic refactoring - Abstract based on meaning, not structure
- Explicit documentation - Capture learnings while context is fresh
Unlike typical style guides, CLAUDE.md provides:
- Decision frameworks - Concrete questions to answer before taking action
- Priority classifications - Objective severity levels (Critical/High/Nice/Skip)
- Quality gates - Verifiable checklists before commits
- Anti-pattern catalogs - Side-by-side good/bad examples
- Git verification methods - How to audit compliance retrospectively
| Section | What It Provides | Detailed Patterns |
|---|---|---|
| Testing Principles | Behavior-driven testing, 100% coverage strategy, factory patterns | β skills/testing |
| Front-End Testing | DOM Testing Library patterns, accessibility-first queries, userEvent best practices (framework-agnostic) | β skills/front-end-testing |
| React Testing | React Testing Library patterns for components, hooks, context, and forms | β skills/react-testing |
| TypeScript Guidelines | Schema-first decision framework, type vs interface clarity, immutability patterns | β skills/typescript-strict |
| TDD Process | RED-GREEN-REFACTOR cycle, quality gates, anti-patterns | β skills/tdd |
| Refactoring | Priority classification, semantic vs structural framework, DRY decision tree | β skills/refactoring |
| Functional Programming | Immutability violations catalog, pure functions, composition patterns | β skills/functional |
| Expectations | Learning capture guidance, documentation templates, quality criteria | β skills/expectations |
| Planning | Small increments, three-document model (PLAN/WIP/LEARNINGS), commit approval | β skills/planning |
v3.0 Architecture: Skills are auto-discovered patterns loaded on-demand when relevant. This reduces always-loaded context from ~3000+ lines to ~100 lines.
"I'm struggling with..." β Go here:
| Problem | Skill | Key Insight |
|---|---|---|
| Tests that break when I refactor | testing | Test behavior through public APIs, not implementation |
| Tests break when refactoring UI components | front-end-testing | Query by role (getByRole), not implementation (framework-agnostic) |
| Testing React components, hooks, or context | react-testing | renderHook for hooks, wrapper for context, test components as functions |
| Don't know when to use schemas vs types | typescript-strict | 5-question decision framework |
| Code that "looks the same" - should I abstract it? | refactoring | Semantic vs structural abstraction guide |
| Refactoring everything vs nothing | refactoring | Priority classification (Critical/High/Nice/Skip) |
| Understanding what "DRY" really means | refactoring | DRY = knowledge, not code structure |
| Accidental mutations breaking things | functional | Complete immutability violations catalog |
| Writing code before tests | tdd | TDD quality gates + git verification |
| Losing context on complex features | expectations | Learning capture framework (7 criteria) |
| Planning significant work | planning | Three-document model (PLAN/WIP/LEARNINGS), commit approval |
Skills are auto-discovered by Claude when relevant:
- Writing TypeScript? β
typescript-strictskill loads automatically - Running tests? β
testingskill provides factory patterns - After GREEN tests? β
refactoringskill assesses opportunities
No manual invocation needed - Claude detects when skills apply.
π§ͺ Testing Principles β skills/testing
Problem it solves: Tests that break on every refactor, unclear what to test, low coverage despite many tests
What's inside:
- Behavior-driven testing principles with anti-patterns
- Factory function patterns for test data (no
let/beforeEach) - Achieving 100% coverage through business behavior (not implementation)
- React component testing strategies
- Validating test data with schemas
Concrete example from the docs:
// β BAD - Implementation-focused test (breaks on refactor)
it("should call validateAmount", () => {
const spy = jest.spyOn(validator, 'validateAmount');
processPayment(payment);
expect(spy).toHaveBeenCalled(); // Will break if we rename or restructure
});
// β
GOOD - Behavior-focused test (refactor-safe)
it("should reject payments with negative amounts", () => {
const payment = getMockPayment({ amount: -100 });
const result = processPayment(payment);
expect(result.success).toBe(false);
expect(result.error.message).toBe("Invalid amount");
});Why this matters: The first test will fail if you refactor validateAmount into a different structure. The second test only cares about behavior - refactor all you want, as long as negative amounts are rejected.
Key insight: A separate payment-validator.ts file gets 100% coverage without dedicated tests - it's fully tested through payment-processor behavior tests. No 1:1 file mapping needed.
π· TypeScript Guidelines β skills/typescript-strict
Problem it solves: Overusing schemas everywhere, or not using them when needed; confusion about type vs interface
What's inside:
- Strict mode requirements and tsconfig setup
- Type vs interface distinction (data vs behavior contracts)
- 5-question decision framework: When schemas ARE vs AREN'T required
- Schema-first development with Zod
- Schema usage in tests (import from shared locations, never redefine)
- Branded types for type safety
The 5-question framework from the docs:
Ask these in order:
- Does data cross a trust boundary? (external β internal) β β Schema required
- Does type have validation rules? (format, constraints) β β Schema required
- Is this a shared data contract? (between systems) β β Schema required
- Used in test factories? β β Schema required (for validation)
- Pure internal type? (utility, state, behavior) β β Type is fine
Concrete example from the docs:
// β Schema NOT needed - pure internal type
type Point = { readonly x: number; readonly y: number };
type CartTotal = { subtotal: number; tax: number; total: number };
// β
Schema REQUIRED - API response (trust boundary + validation)
const UserSchema = z.object({
id: z.string().uuid(),
email: z.string().email(),
role: z.enum(["admin", "user", "guest"]),
});
const user = UserSchema.parse(apiResponse);Key insight: Not all types need schemas. Use schemas at trust boundaries and for validation. For internal types and utilities, plain TypeScript types are sufficient.
Critical rule: Tests must import real schemas from shared locations, never redefine them. This prevents type drift between tests and production.
π Development Workflow (TDD + Refactoring) β skills/tdd + skills/refactoring
Problem it solves: Writing code before tests, refactoring too much/too little, not knowing when to abstract
What's inside:
- TDD process with quality gates (what to verify before each commit)
- RED-GREEN-REFACTOR cycle with complete examples
- Refactoring priority classification (Critical/High/Nice/Skip)
- Semantic vs structural abstraction (the most important refactoring rule)
- Understanding DRY - knowledge vs code duplication
- 4-question decision framework for abstraction
- Git verification methods (audit TDD compliance retrospectively)
- Commit guidelines and PR standards
The refactoring priority system from the docs:
π΄ Critical (Fix Now): Immutability violations, semantic knowledge duplication, deep nesting (>3 levels)
π‘ Nice to Have: Minor improvements
β Skip: Code that's already clean, structural similarity without semantic relationship
The semantic vs structural rule (THE BIG ONE):
// β DO NOT ABSTRACT - Structural similarity, DIFFERENT semantics
const validatePaymentAmount = (amount: number): boolean => {
return amount > 0 && amount <= 10000; // Fraud rules
};
const validateTransferAmount = (amount: number): boolean => {
return amount > 0 && amount <= 10000; // Account type rules
};
// They'll evolve independently - abstracting couples unrelated business rules
// β
SAFE TO ABSTRACT - Same semantic meaning
const formatUserDisplayName = (first: string, last: string) => `${first} ${last}`.trim();
const formatCustomerDisplayName = (first: string, last: string) => `${first} ${last}`.trim();
const formatEmployeeDisplayName = (first: string, last: string) => `${first} ${last}`.trim();
// All represent "how we display person names" - same business concept
const formatPersonDisplayName = (first: string, last: string) => `${first} ${last}`.trim();Key insight: "Duplicate code is far cheaper than the wrong abstraction." Only abstract code that shares the same semantic meaning, not just similar structure.
DRY revelation: DRY means "Don't Repeat Knowledge" not "Don't Repeat Code Structure". The shipping threshold example in the docs shows this perfectly.
π¨ Code Style (Functional Programming) β skills/functional
Problem it solves: Accidental mutations, nested conditionals, unclear code, when to use FP abstractions
What's inside:
- Complete immutability violations catalog (arrays, objects, nested structures)
- Functional programming patterns and when to use heavy FP abstractions
- Code structure principles (max 2 levels nesting)
- Self-documenting code patterns (no comments)
- Naming conventions (functions, types, constants, files)
- Options objects pattern (vs positional parameters)
The immutability catalog from the docs:
// β WRONG - Array mutations
items.push(newItem); // β [...items, newItem]
items.pop(); // β items.slice(0, -1)
items[0] = updatedItem; // β items.map((item, i) => i === 0 ? updatedItem : item)
items.sort(); // β [...items].sort()
// β WRONG - Object mutations
user.name = "New Name"; // β { ...user, name: "New Name" }
delete user.email; // β const { email, ...rest } = user; rest
// β WRONG - Nested mutations
cart.items[0].quantity = 5; // β { ...cart, items: cart.items.map((item, i) => i === 0 ? { ...item, quantity: 5 } : item) }Options objects pattern:
// Avoid: Unclear at call site
const payment = createPayment(100, "GBP", "card_123", "cust_456", undefined, { orderId: "789" });
// Good: Self-documenting
const payment = createPayment({
amount: 100,
currency: "GBP",
cardId: "card_123",
customerId: "cust_456",
metadata: { orderId: "789" },
});Key insight: Immutability eliminates entire classes of bugs. The catalog provides the immutable alternative for every common mutation pattern.
π€ Working with Claude β skills/expectations
Problem it solves: Losing context after complex features, forgetting gotchas, unclear expectations
What's inside:
- Complete expectations checklist for Claude
- Learning documentation framework (7 criteria for what to document)
- Types of learnings to capture (gotchas, patterns, anti-patterns, decisions, edge cases)
- Documentation format templates
- "What do I wish I'd known at the start?" prompts
The 7 criteria for documenting learnings:
Document if ANY of these are true:
- β Would save future developers >30 minutes
- β Prevents a class of bugs or errors
- β Reveals non-obvious behavior or constraints
- β Captures architectural rationale or trade-offs
- β Documents domain-specific knowledge
- β Identifies effective patterns or anti-patterns
- β Clarifies tool setup or configuration gotchas
Documentation template from the docs:
#### Gotcha: [Descriptive Title]
**Context**: When this occurs
**Issue**: What goes wrong
**Solution**: How to handle it
```typescript
// β
CORRECT
const example = "correct approach";
// β WRONG
const wrong = "incorrect approach";
**Key insight:** Capture learnings while context is fresh, not during retrospectives when details are lost. Ask "What do I wish I'd known at the start?" after every significant change.
---
## π― Why These Skills Are Different
Unlike typical style guides, these skills provide:
1. **Decision frameworks** - Concrete questions to answer before taking action (not vague principles)
2. **Priority classifications** - Objective severity levels to prevent over/under-engineering
3. **Anti-pattern catalogs** - Side-by-side good/bad examples showing exactly what to avoid
4. **Git verification methods** - How to audit compliance after the fact
5. **Quality gates** - Verifiable checklists before commits
6. **Problem-oriented** - Organized by the problems you face, not abstract concepts
**Most valuable insight across all skills:** Abstract based on **semantic meaning** (what code represents), not **structural similarity** (what code looks like). This single principle prevents most bad abstractions.
---
### Schema-First Decision Framework Example
One of the most valuable additions - a 5-question framework for when schemas ARE vs AREN'T required:
```typescript
// β
Schema REQUIRED - Trust boundary (API response)
const UserSchema = z.object({ id: z.string().uuid(), email: z.string().email() });
const user = UserSchema.parse(apiResponse);
// β Schema OPTIONAL - Pure internal type
type Point = { readonly x: number; readonly y: number };
Ask yourself:
- Does data cross a trust boundary? β Schema required
- Does type have validation rules? β Schema required
- Is this a shared data contract? β Schema required
- Used in test factories? β Schema required
- Pure internal type? β Type is fine
β Read the agents documentation
Seven specialized sub-agents that run in isolated context windows to enforce CLAUDE.md principles and manage development workflow:
Use proactively when planning to write code, or reactively to verify TDD was followed.
What it checks:
- β Tests were written before production code
- β Tests verify behavior (not implementation)
- β All code paths have test coverage
- β Tests use public APIs only
- β Flags implementation-focused tests
- β Catches missing edge case tests
Example invocation:
You: "I just implemented payment validation. Can you check TDD compliance?"
Claude Code: [Launches tdd-guardian agent]
Output:
- Lists all TDD violations with file locations
- Identifies implementation-focused tests
- Suggests missing test cases
- Provides actionable recommendations
Use before commits or when adding new types/schemas.
What it checks:
- β
anytypes (must useunknownor specific types) - β Type assertions without justification
- β
interfacefor data structures (usetype) - β Schema-first development (schemas before types at trust boundaries)
- β Immutable data patterns
- β Options objects over positional parameters
Includes the nuanced schema-first framework:
- Schema required: Trust boundaries, validation rules, contracts, test factories
- Schema optional: Internal types, utilities, state machines, behavior contracts
Example invocation:
You: "I've added new TypeScript code. Check for type safety violations."
Claude Code: [Launches ts-enforcer agent]
Output:
- Critical violations (any types, missing schemas at boundaries)
- High priority issues (mutations, poor structure)
- Style improvements (naming, parameter patterns)
- Compliance score with specific fixes
Use after achieving green tests (the REFACTOR step in RED-GREEN-REFACTOR).
What it analyzes:
- π― Knowledge duplication (DRY violations)
- π― Semantic vs structural similarity
- π― Complex nested conditionals
- π― Magic numbers and unclear names
- π― Immutability violations
What it doesn't recommend:
- β Refactoring code that's already clean
- β Abstracting structurally similar but semantically different code
- β Cosmetic changes without clear value
Example invocation:
You: "My tests are passing, should I refactor anything?"
Claude Code: [Launches refactor-scan agent]
Output:
- π΄ Critical refactoring needed (must fix)
β οΈ High value opportunities (should fix)- π‘ Nice to have improvements (consider)
- β Correctly separated code (keep as-is)
- Specific recommendations with code examples
Use proactively when creating documentation or reactively to review and improve existing docs.
What it ensures:
- β Value-first approach (why before how)
- β Scannable structure (visual hierarchy, clear headings)
- β Progressive disclosure (quick start before deep dive)
- β Problem-oriented navigation (organized by user problems)
- β Concrete examples showing value (not just descriptions)
- β Cross-references and multiple entry points
- β Actionable next steps in every section
What it checks:
- β Wall of text without visual breaks
- β Feature lists without value demonstrations
- β Installation-first (before showing what it does)
- β Missing navigation aids
- β Broken links or outdated information
Example invocation:
You: "I need to write a README for this feature."
Claude Code: [Launches docs-guardian agent]
You: "Can you review the documentation I just wrote?"
Claude Code: [Launches docs-guardian agent]
Output:
- Assessment against 7 pillars of world-class documentation
- Critical issues (must fix) vs nice-to-haves
- Specific improvement recommendations with examples
- Proposed restructuring for better discoverability
- Templates for common documentation types (README, guides, API docs)
Use proactively when discovering gotchas, or reactively after completing complex features.
What it captures:
- Gotchas or unexpected behavior discovered
- "Aha!" moments or breakthroughs
- Architectural decisions being made
- Patterns that worked particularly well
- Anti-patterns encountered
- Tooling or setup knowledge gained
Example invocation:
You: "I just fixed a tricky timezone bug. Let me document this gotcha."
Claude Code: [Launches learn agent]
Output:
- Asks discovery questions about what you learned
- Reads current CLAUDE.md to check for duplicates
- Proposes formatted additions to CLAUDE.md
- Provides rationale for placement and structure
Use proactively when starting significant multi-step work, or reactively to update progress, capture learnings, and handle blockers.
Three-Document Model:
| Document | Purpose | Updates |
|---|---|---|
| PLAN.md | What we're doing (approved steps) | Only with user approval |
| WIP.md | Where we are now (current state) | Constantly |
| LEARNINGS.md | What we discovered | As discoveries occur |
What it manages:
- Creates and maintains three documents for significant work
- Enforces small increments, TDD, and commit approval
- Never modifies PLAN.md without explicit user approval
- Captures learnings as they occur
- At end: orchestrates learning merge, then deletes all three docs
Example invocation:
You: "I need to implement OAuth with JWT tokens and refresh logic"
Claude Code: [Launches progress-guardian to create PLAN.md, WIP.md, LEARNINGS.md]
You: "Tests are passing now"
Claude Code: [Launches progress-guardian to update WIP.md and ask for commit approval]
Output:
- PLAN.md - Approved steps with acceptance criteria
- WIP.md - Current step, status, blockers, next action
- LEARNINGS.md - Gotchas, patterns, decisions discovered
- At end: learnings merged into CLAUDE.md/ADRs, all docs deleted
Key distinction: Creates TEMPORARY documents (deleted when done). Learnings merged into permanent knowledge base first.
Related skill: Load planning skill for detailed incremental work principles.
Use proactively when making significant architectural decisions, or reactively to document decisions already made.
What it documents:
- Significant architectural choices with trade-offs
- Technology/library selections with long-term impact
- Pattern decisions affecting multiple modules
- Performance vs maintainability trade-offs
- Security architecture decisions
When to use:
- β Evaluated multiple alternatives with trade-offs
- β One-way door decisions (hard to reverse)
- β Foundational choices affecting future architecture
- β Trivial implementation choices
- β Temporary workarounds
- β Standard patterns already in CLAUDE.md
Example invocation:
You: "Should we use BullMQ or AWS SQS for our job queue?"
Claude Code: [Launches adr agent to help evaluate and document]
You: "I decided to use PostgreSQL over MongoDB"
Claude Code: [Launches adr agent to document the rationale]
Output:
- Structured ADR in
docs/adr/with context and alternatives - Honest assessment of pros/cons and trade-offs
- Clear rationale for decision
- Consequences (positive, negative, neutral)
- Updated ADR index
Key distinction: Documents WHY architecture chosen (permanent), vs learn agent's HOW to work with it (gotchas, patterns).
Quick navigation by situation:
| Your Situation | Recommended Option |
|---|---|
| "I want this on all my personal projects" | Option 1: Global Install |
| "I'm setting this up for my team" | Option 2: Project-specific install |
| "I just want to try the guidelines first" | Option 3: CLAUDE.md only |
| "I need to customize for my team's standards" | Option 4: Fork and customize |
Once installed (via any option below), here's the typical development flow:
- Start feature: Plan with Claude, let tdd-guardian guide test-first approach
- Write tests: Get RED (failing test)
- Implement: Get GREEN (minimal code to pass)
- Refactor: Run refactor-scan to assess opportunities
- Review: Run ts-enforcer and tdd-guardian before commit
- Document: Use learn agent to capture insights, docs-guardian for user-facing docs
- Commit: Follow conventional commits format
Agent invocation examples:
Agents can be invoked implicitly (Claude detects when to use them) or explicitly:
- Implicit: "I just implemented payment processing. Can you verify I followed TDD?" β Claude automatically launches tdd-guardian
- Explicit: "Launch the refactor-scan agent to assess code quality" β Claude launches refactor-scan
- Multiple agents: "Run TDD, TypeScript, and refactoring checks on my recent changes" β Claude launches all three in parallel
Now choose your installation method:
Best for: Individual developers who want consistent practices across all projects
Why choose this:
- β One-time setup applies everywhere automatically
- β No per-project configuration needed
- β Works with Claude Code immediately
- β Modular structure loads details on-demand
- β Easy updates via git pull
One-liner installation:
curl -fsSL https://raw.githubusercontent.com/citypaul/.dotfiles/main/install-claude.sh | bashOne-liner with options (use bash -s -- to pass arguments):
# Install with OpenCode support
curl -fsSL https://raw.githubusercontent.com/citypaul/.dotfiles/main/install-claude.sh | bash -s -- --with-opencode
# Install specific version
curl -fsSL https://raw.githubusercontent.com/citypaul/.dotfiles/main/install-claude.sh | bash -s -- --version v2.0.0Or download and run:
curl -fsSL https://raw.githubusercontent.com/citypaul/.dotfiles/main/install-claude.sh -o install-claude.sh
chmod +x install-claude.sh
./install-claude.shInstall options:
./install-claude.sh # Install everything (CLAUDE.md + skills + commands + agents)
./install-claude.sh --claude-only # Install only CLAUDE.md
./install-claude.sh --skills-only # Install only skills
./install-claude.sh --no-agents # Install without agents
./install-claude.sh --with-opencode # Also install OpenCode configuration
./install-claude.sh --version v2.0.0 # Install v2.0.0 (modular docs)
./install-claude.sh --version v1.0.0 # Install v1.0.0 (single file)What gets installed (v3.0.0):
- β
~/.claude/CLAUDE.md(~100 lines - lean core principles) - β
~/.claude/skills/(9 auto-discovered patterns: tdd, testing, typescript-strict, functional, refactoring, expectations, planning, front-end-testing, react-testing) - β
~/.claude/commands/(1 slash command: /pr) - β
~/.claude/agents/(8 automated enforcement agents)
Optional: Enable GitHub MCP Integration
For enhanced GitHub workflows with native PR/issue integration:
Step 1: Create a GitHub Personal Access Token
Go to https://github.com/settings/tokens and create a token:
For Fine-grained token (recommended):
- Repository access: All repositories (or select specific ones)
- Permissions required:
- Contents: Read and write
- Pull requests: Read and write
- Issues: Read and write
- Metadata: Read-only (automatically included)
For Classic token:
- Select the
reposcope (full control of private repositories)
Step 2: Add the MCP Server
claude mcp add --transport http --scope user github https://api.githubcopilot.com/mcp/ \
--header "Authorization: Bearer YOUR_GITHUB_TOKEN"Replace YOUR_GITHUB_TOKEN with the token you created.
Step 3: Verify Connection
Restart Claude Code and run /mcp to verify the GitHub server shows as connected.
What this enables:
- Native PR creation, updates, and reviews
- Issue management without CLI parsing
- Structured GitHub API access
@github:pr://123- Reference PRs directly in prompts@github:issue://45- Reference issues directly in prompts
Optional: Enable OpenCode Support
These guidelines also work with OpenCode - an open source AI coding agent. OpenCode uses AGENTS.md for custom instructions (similar to CLAUDE.md in Claude Code).
How OpenCode Integration Works:
OpenCode doesn't automatically read ~/.claude/ files. Instead, it uses a configuration file to specify which instruction files to load. The opencode.json configuration tells OpenCode to load your CLAUDE.md and skills files.
Installation:
# One-liner with OpenCode support
curl -fsSL https://raw.githubusercontent.com/citypaul/.dotfiles/main/install-claude.sh | bash -s -- --with-opencode
# Or download and run with options
curl -fsSL https://raw.githubusercontent.com/citypaul/.dotfiles/main/install-claude.sh -o install-claude.sh
chmod +x install-claude.sh
./install-claude.sh --with-opencode
# Install OpenCode config only (if you already have CLAUDE.md installed)
curl -fsSL https://raw.githubusercontent.com/citypaul/.dotfiles/main/install-claude.sh | bash -s -- --opencode-onlyWhat gets installed:
~/.config/opencode/opencode.json- Configuration that loads:~/.claude/CLAUDE.md(core principles)~/.claude/skills/*/SKILL.md(all skill patterns)
Manual Installation:
If you prefer to set it up manually:
mkdir -p ~/.config/opencode
cat > ~/.config/opencode/opencode.json << 'EOF'
{
"$schema": "https://opencode.ai/config.json",
"instructions": [
"~/.claude/CLAUDE.md",
"~/.claude/skills/*/SKILL.md"
]
}
EOFLearn more:
Best for: Team projects where you want full control and project-specific configuration
Why choose this:
- β Full enforcement in a specific project
- β Team can collaborate on customizations
- β Version control with your project
- β Works without global installation
For full enforcement in a specific project, install both CLAUDE.md and the agents:
# In your project root
mkdir -p .claude/agents
# Download CLAUDE.md
curl -o .claude/CLAUDE.md https://raw.githubusercontent.com/citypaul/.dotfiles/main/claude/.claude/CLAUDE.md
# Download all agents
curl -o .claude/agents/tdd-guardian.md https://raw.githubusercontent.com/citypaul/.dotfiles/main/claude/.claude/agents/tdd-guardian.md
curl -o .claude/agents/ts-enforcer.md https://raw.githubusercontent.com/citypaul/.dotfiles/main/claude/.claude/agents/ts-enforcer.md
curl -o .claude/agents/refactor-scan.md https://raw.githubusercontent.com/citypaul/.dotfiles/main/claude/.claude/agents/refactor-scan.md
curl -o .claude/agents/docs-guardian.md https://raw.githubusercontent.com/citypaul/.dotfiles/main/claude/.claude/agents/docs-guardian.md
curl -o .claude/agents/learn.md https://raw.githubusercontent.com/citypaul/.dotfiles/main/claude/.claude/agents/learn.md
curl -o .claude/agents/progress-guardian.md https://raw.githubusercontent.com/citypaul/.dotfiles/main/claude/.claude/agents/progress-guardian.md
curl -o .claude/agents/adr.md https://raw.githubusercontent.com/citypaul/.dotfiles/main/claude/.claude/agents/adr.md
# Download agents README
curl -o .claude/agents/README.md https://raw.githubusercontent.com/citypaul/.dotfiles/main/claude/.claude/agents/README.mdBest for: Quick evaluation or when you want everything in one standalone file
Why choose this:
- β Single command, one file (1,818 lines)
- β All content included - examples, anti-patterns, decision frameworks
- β Works standalone (no broken imports)
- β No agent overhead
β οΈ Tradeoff: Larger file vs v2.0.0's modular structure (156 lines + separate docs)β οΈ Tradeoff: Uses v1.0.0 structure (content identical to v2.0.0, just organized differently)
Important: This downloads the v1.0.0 monolithic version. v3.0.0 no longer has @import issues - CLAUDE.md is fully self-contained with skills loaded on-demand. For project-level use, v3.0.0 is now recommended.
Download the complete single-file version:
# In your project root
mkdir -p .claude
curl -o .claude/CLAUDE.md https://raw.githubusercontent.com/citypaul/.dotfiles/v1.0.0/claude/.claude/CLAUDE.mdThis gives you the complete guidelines (1,818 lines) in a single standalone file.
Best for: Teams with specific standards who need full customization control
Why choose this:
- β Complete control over guidelines and enforcement
- β Customize for your team's specific tech stack
- β Modify agent behavior to match your workflow
- β Maintain team-specific patterns and anti-patterns
How to customize:
- Fork this repository
- Modify CLAUDE.md to match your team's preferences
- Customize agents to enforce your specific rules
- Commit to your fork
- Pull into your projects
Current version (v3.0.0): Skills-based architecture with lean CLAUDE.md (~100 lines) + 9 auto-discovered skills + planning workflow
Previous version (v2.0.0): Modular structure with main file (156 lines) + 6 detailed docs loaded via @imports (~3000+ lines total)
Legacy version (v1.0.0): Single monolithic file (1,818 lines, all-in-one)
| Version | Architecture | Context Size | Best For |
|---|---|---|---|
| v3.0.0 | Skills (on-demand) | ~100 lines always | Context-efficient, truly lean |
| v2.0.0 | @docs/ imports | ~3000 lines always | Full docs always loaded |
| v1.0.0 | Single file | ~1800 lines always | Standalone, no dependencies |
- v3.0.0 (current): https://github.com/citypaul/.dotfiles/tree/main/claude/.claude
- v2.0.0 modular docs: https://github.com/citypaul/.dotfiles/tree/v2.0.0/claude/.claude
- v1.0.0 single file: https://github.com/citypaul/.dotfiles/blob/v1.0.0/claude/.claude/CLAUDE.md
The installation script installs v3.0.0 by default. Use --version v2.0.0 or --version v1.0.0 for older versions.
- CLAUDE.md - Core development principles (~100 lines)
- Skills - Auto-discovered patterns (7 skills: tdd, testing, typescript-strict, functional, refactoring, expectations, planning)
- Commands - Slash commands (/pr)
- Agents README - Detailed agent documentation with examples
- Agent Definitions - Individual agent configuration files
- Teams adopting TDD - Automated enforcement prevents backsliding
- TypeScript projects - Nuanced schema-first guidance with decision frameworks
- AI-assisted development - Consistent quality with Claude Code or similar tools
- Solo developers - Institutional knowledge that doesn't rely on memory
- Code reviewers - Objective quality criteria and git verification methods
This system is based on several key insights:
-
AI needs explicit context - Vague principles β inconsistent results. Decision frameworks β reliable outcomes.
-
Quality gates prevent drift - Automated checking catches violations before they become habits.
-
Refactoring needs priority - Not all improvements are equal. Critical/High/Nice/Skip classification prevents over-engineering.
-
Semantic beats structural - Abstract based on meaning (business concepts), not appearance (code structure).
-
Document while fresh - Capture learnings immediately, not during retrospectives when context is lost.
-
Explicit "no refactoring" - Saying "code is already clean" prevents the feeling that the refactor step was skipped.
CLAUDE.md and the agents evolve based on real usage. The learn agent ensures valuable insights are captured and integrated:
- Gotchas discovered β Documented in CLAUDE.md
- Patterns that work β Added to examples
- Anti-patterns encountered β Added to warnings
- Architectural decisions β Preserved with rationale
This creates a self-improving system where each project session makes future sessions more effective.
While most visitors are here for CLAUDE.md, this repository's original purpose is managing my personal development environment. If you're interested in dotfiles, here's what's included and how to use them.
I have an extensive collection of git aliases that speed up common workflows. These are in git/.gitconfig.
Most useful aliases:
# Pretty log with graph
git lg # One-line log with graph
git lga # All branches log with graph
git lgp # Log with patch (shows changes)
# Status and diff shortcuts
git st # git status
git di # git diff
git dc # git diff --cached
git ds # git diff --stat
# Commit shortcuts
git ci # git commit
git ca # git commit --amend
git cane # git commit --amend --no-edit
# Branch management
git co # git checkout
git cob # git checkout -b (new branch)
git br # git branch
git brd # git branch -d (delete branch)
# Working with remotes
git pu # git push
git puf # git push --force-with-lease (safer force push)
git pl # git pull
git plo # git pull origin
# Stash shortcuts
git sl # git stash list
git ss # git stash save
git sp # git stash pop
# Undo shortcuts
git undo # Undo last commit (keeps changes)
git unstage # Unstage files
git uncommit # Undo commit and unstage
# Advanced workflows
git wip # Quick "work in progress" commit
git unwip # Undo WIP commit
git squash # Interactive rebase to squash commitsInstallation:
# Install just the git config
cd ~/.dotfiles
stow git
# Or manually copy specific aliases you want
cat git/.gitconfig >> ~/.gitconfigMy shell setup (for bash/zsh) includes:
- Prompt customization - Git status in prompt
- Useful functions - Project navigation helpers
- PATH management - Tool directories
- Environment variables - Editor, pager, etc.
Files:
bash/.bashrc- Bash configurationbash/.bash_profile- Bash login shellzsh/.zshrc- Zsh configuration (if you use zsh)
Installation:
cd ~/.dotfiles
stow bash # or stow zshConfiguration files for various development tools:
vim/.vimrc- Vim editor configurationtmux/.tmux.conf- Terminal multiplexer settingsnpm/.npmrc- npm configuration
The claude/.claude/settings.json file contains my personal Claude Code configuration including:
- claude-powerline - vim-style statusline with usage tracking and git integration
- Official Anthropic plugins - feature-dev, frontend-design, hookify, learning-output-style, plugin-dev, security-guidance
For CLAUDE.md only (no stow needed), see Option 3 above.
To install all dotfiles including my personal configurations:
# Install GNU Stow first (if not already installed)
# macOS: brew install stow
# Ubuntu/Debian: sudo apt-get install stow
# Fedora: sudo dnf install stow
# Clone the repository
git clone https://github.com/citypaul/.dotfiles.git ~/.dotfiles
cd ~/.dotfiles
# Run the installation script
./install.sh
# This uses GNU Stow to create symlinks for all configurationsThis will install:
- β CLAUDE.md + 9 skills + 8 agents (development guidelines)
- β Commands (/pr slash command)
- β Claude Code settings.json (plugins, hooks, statusline)
- β Git aliases and configuration
- β Shell configuration (bash/zsh)
- β Vim, tmux, npm configs
- β All personal preferences
Only want certain configurations? Install them individually:
cd ~/.dotfiles
# Install just git config
stow git
# Install just bash config
stow bash
# Install vim config
stow vim
# Install multiple at once
stow git bash vimThis repository uses GNU Stow for dotfile management:
- Each directory (
git/,bash/, etc.) represents a "package" - Files inside mirror your home directory structure
stow gitcreates symlinks from~/.gitconfigβ~/.dotfiles/git/.gitconfig- Changes to files in
~/.dotfilesare instantly reflected - Uninstall with
stow -D git
Feel free to browse the repository and cherry-pick what's useful:
- git/.gitconfig - Git aliases and configuration
- bash/.bashrc - Bash shell configuration
- vim/.vimrc - Vim editor setup
Note: These are my personal preferences. Review before installing - you may want to customize them for your workflow.
This is a personal repository that became unexpectedly popular. Contributions are welcome, especially:
- Improvements to CLAUDE.md - Better decision frameworks, clearer examples
- Agent enhancements - New checks, better error messages
- Documentation - Clarifications, additional examples
- Real-world feedback - What worked? What didn't?
Please open issues or PRs on GitHub.
Paul Hammond
- LinkedIn - Feel free to connect and discuss
- GitHub Issues - Questions, suggestions, feedback
Special thanks to contributors who have shared their work:
- Kieran O'Hara - The
use-case-data-patternsagent is adapted from Kieran's dotfiles. Thank you for creating and sharing this excellent agent specification.
This repository is open source and available for use. The CLAUDE.md file and agents are designed to be copied and customized for your projects.
If you found CLAUDE.md or the agents valuable, consider:
- Starring this repo on GitHub
- Sharing it with your team
- Contributing improvements back
- Connecting on LinkedIn to share your experience
The more people who adopt these practices, the better the AI-assisted development ecosystem becomes for everyone.