agentleFS
hoangNguyenAngelhackhoangNguyenAngelhack/ai-agent-setup/.claude/CLAUDE.md

ai-agent-setup

CLAUDE.md3 starsChanged 6 months agoMITView on GitHub

Maintainer: Hoang Nguyen (hoang.nguyen@angelhack.com) Tier: Standard See TIERS.md for tier options: Starter | Standard | Strict This project uses Claude AI as an intelligent development agent with structured workflows, specialized sub-agents, and mandatory coding standards. Follow this workflow for all feature development: All rules in .claude/rules/ are mandatory and must be followed: Invoke the right agent for each task type:

  • Deletes or force-pushes
  • Commits and pushes

The file

We split this CLAUDE.md into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Follow this workflow for all feature development:

    line 16
  2. Very specific:

    All rules in .claude/rules/ are mandatory and must be followed:

    line 64

≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

Claude AI Agent Configuration

Maintainer: Hoang Nguyen (hoang.nguyen@angelhack.com)
Tier: Standard

See TIERS.md for tier options: Starter | Standard | Strict

Overview

This project uses Claude AI as an intelligent development agent with structured workflows, specialized sub-agents, and mandatory coding standards.


Development Workflow

Follow this workflow for all feature development:

┌─────────────────────────────────────────────────────────────┐
│                                                             │
│   /spec  →  /plan  →  /build  →  /test  →  /review  →  Ship│
│                                                             │
│   Define    Plan     Build     Verify    Review     Deploy  │
│                                                             │
└─────────────────────────────────────────────────────────────┘
PhaseCommandPurpose
Define/specCreate PRD with objectives, scope, boundaries
Plan/planDecompose into vertical slices with acceptance criteria
Build/buildImplement incrementally using TDD (RED-GREEN-REFACTOR)
Verify/testWrite and verify tests; use Prove-It for bug fixes
Review/reviewFive-axis code review before merge
Ship/deployBuild, test, deploy with staged rollout

Supporting Commands

CommandPurpose
/debugSystematic error diagnosis and root cause analysis
/simplifyReduce complexity without changing behavior
/fix-issueAnalyze and fix reported issues

Core Principles

Code Quality

  • Test-Driven Development — Write failing tests first, then implement
  • Incremental Implementation — Small vertical slices, always buildable
  • Five-Axis Review — Correctness, Readability, Architecture, Security, Performance

Philosophy

  • Progress over perfection
  • Fix root causes, not symptoms
  • The simplest thing that could work
  • Tests are proof, not afterthought

Mandatory Rules

All rules in .claude/rules/ are mandatory and must be followed:

Code Quality

RuleDescription
clean-code.mdVariables, functions, SOLID, async/await
code-style.mdFormatting, naming conventions
error-handling.mdAppError class, global handler patterns

Architecture & Design

RuleDescription
tech-stack.mdApproved technologies (Next.js, React Native, PG, Redis, Prisma)
system-design.mdCAP theorem, caching, scaling, queues
project-structure.mdLayered architecture, folder organization
api-conventions.mdREST standards, response envelopes

Data & Naming

RuleDescription
naming-conventions.mdCache keys, DB, queues, env vars
database.mdPrisma patterns, transactions, N+1 prevention

Operations

RuleDescription
security.mdCRITICAL — Never violate security rules
monitoring.mdPrometheus, Grafana, logging, alerting
testing.mdCoverage thresholds, test patterns
git-workflow.mdBranching strategy, conventional commits

Language Patterns

RuleDescription
typescript-patterns.mdType safety, generics, utility types
python-patterns.mdPEP8, type hints, async patterns
sql-patterns.mdQuery optimization, N+1, indexes

Available Agents

Invoke the right agent for each task type:

Development Agents

AgentWhen to Invoke
🖥️ Frontend DeveloperComponents, pages, routing, state, UI performance
📱 Mobile DeveloperReact Native, Expo, navigation, native modules
🔧 Backend DeveloperAPIs, services, DB queries, background jobs
🏗️ Systems ArchitectArchitecture decisions, ADRs, system design

Quality Agents

AgentWhen to Invoke
👀 Code ReviewerFive-axis PR review, code quality assessment
🧪 Test EngineerTest strategy, TDD, coverage, bug reproduction
🔒 Security AuditorVulnerability assessment, threat modeling
✅ QA EngineerTest plans, E2E tests, bug reports

Product Agents

AgentWhen to Invoke
📋 Project ManagerUser stories, sprint planning, status reports
🎨 UI/UX DesignerDesign system, wireframes, accessibility
✍️ Copywriter/SEOPage copy, meta tags, SEO optimization

Build Resolver Agents

AgentWhen to Invoke
⚛️ React Build ResolverReact/Next.js build errors, module issues
📱 React Native ResolverMetro bundler, iOS/Android build errors
🟢 Node Build Resolvernpm errors, TypeScript, ESM/CJS issues
🔷 Prisma ResolverMigration errors, schema validation, queries

Available Skills

Agent Skills (.agents/skills/)

Open standard skills compatible with 30+ AI agents:

SkillDescriptionImpact Levels
nodejs-backendExpress, Prisma, Redis, BullMQCRITICAL/HIGH/MEDIUM
nestjs-backendNestJS, TypeORM, Guards, DICRITICAL/HIGH/MEDIUM
react-frontendNext.js/Vite, TailwindCSS, ZustandCRITICAL/HIGH/MEDIUM
react-native-mobileExpo/RN CLI, NativeWindCRITICAL/HIGH/MEDIUM
code-reviewFive-axis review frameworkCRITICAL/MAJOR/MINOR
tddRED-GREEN-REFACTOR workflowCRITICAL/HIGH/MEDIUM

Compile all skills: node scripts/compile-skills.js → generates AGENTS.md

Claude Skills (.claude/skills/)

Specialized skills for complex operations:

SkillDescription
incremental-implementationVertical slice development
deployFull deployment pipeline
security-reviewSecurity audit checklist
data-transformCRITICAL — Data conversion, validation, cleaning with zero data loss

Reference Checklists

Quick references in .claude/references/:

ReferenceUse For
security-checklist.mdPre-deploy security verification
testing-patterns.mdTest structure and anti-patterns
performance-checklist.mdCore Web Vitals, optimization
accessibility-checklist.mdWCAG 2.1 AA compliance
mobile-performance-checklist.mdReact Native performance, 60 FPS
mobile-release-checklist.mdApp Store / Play Store submission
external-skills.mdThird-party AI skills (GSAP, etc.)

Recommended Tools

CodeGraph (Optional)

CodeGraph builds a semantic knowledge graph of codebases, enabling faster and cheaper code exploration.

Benefits:

MetricImprovement
Tokens processed57% fewer
Cost35% cheaper
Response time46% faster
Tool calls71% fewer

Setup:

npx @colbymchenry/codegraph init -i

MCP Tools provided:

ToolPurpose
codegraph_searchSymbol lookup
codegraph_contextMulti-symbol context in one call
codegraph_traceCall path tracing with bodies
codegraph_callersFind all callers of a symbol
codegraph_calleesFind all callees of a symbol
codegraph_impactChange impact analysis
codegraph_exploreGrouped source for related symbols

When to use:

  • Large codebases (>10k LOC)
  • Architecture exploration ("How does X reach Y?")
  • Impact analysis before refactoring
  • Understanding call flows

Sensitive Commands Policy

CRITICAL: The following commands must NOT be executed automatically. Instead:

  1. Log the command that would run
  2. Suggest a safer alternative (if available)
  3. Continue workflow — DO NOT block, DO NOT wait for confirmation
CommandRisk LevelSafe Alternative
git push --force🔴 HIGHgit push --force-with-lease
git reset --hard🔴 HIGHgit stash before reset
rm -rf🔴 HIGHmv to .trash/ folder
DROP TABLE/DATABASE🔴 HIGHBackup first, confirm DB name
DELETE FROM (no WHERE)🔴 HIGHAdd WHERE clause or LIMIT
TRUNCATE TABLE🟠 MEDIUMBackup first
git checkout -- .🟠 MEDIUMgit stash for recovery
npm/pnpm publish🟠 MEDIUMConfirm version and registry
docker system prune🟠 MEDIUMList items before prune
Deploy to production🟠 MEDIUMDeploy to staging first

Handling Flow

┌─────────────────────────────────────────────────────────────┐
│  Detect sensitive command                                   │
│       ↓                                                     │
│  Log: "⚠️ Sensitive: [command] — using safe alternative"   │
│       ↓                                                     │
│  Execute safe alternative (if available)                    │
│       ↓                                                     │
│  Continue workflow — DO NOT BLOCK                           │
└─────────────────────────────────────────────────────────────┘

Examples

# User requests: "push changes to remote"
# ❌ DON'T: git push --force origin main
# ✅ DO: git push --force-with-lease origin main

# User requests: "clean up old files"
# ❌ DON'T: rm -rf ./tmp/*
# ✅ DO: mkdir -p .trash && mv ./tmp/* .trash/

# User requests: "reset to clean state"
# ❌ DON'T: git reset --hard HEAD
# ✅ DO: git stash -u && git reset --hard HEAD


Hooks System

Automated checks that run before/after tool operations:

HookTypePurpose
security-scanPreToolUseScan for secrets before write
lint-checkPreToolUseRun linter before commit
auto-formatPostToolUseAuto-format after edit
typescript-checkPostToolUseType-check TS files
console-log-warnPostToolUseWarn about console.log
session-summaryLifecycleSummarize session on exit
cost-trackerLifecycleTrack token usage

See .claude/hooks/README.md for details on creating custom hooks.


MCP Server Configs

Pre-configured MCP servers for common services:

ServerPurposePriority
SupabasePostgreSQL, auth, storageHIGH
VercelDeploy & previewHIGH
PlaywrightBrowser automationHIGH
GitHubEnhanced git operationsHIGH
SentryError trackingMEDIUM
MemoryPersistent contextMEDIUM

See .claude/mcp-configs/README.md for setup instructions.


Agent Behavior Guidelines

  1. Follow the workflow — Use /spec → /plan → /build → /review
  2. Apply mandatory rules — All rules in .claude/rules/ are non-negotiable
  3. Test first — Write failing tests before implementing
  4. Incremental changes — Small commits, always buildable
  5. Explain before acting — Describe changes before making them
  6. Fix root causes — Don't patch symptoms
  7. Use the right agent — Invoke specialized agents for their domains
  8. Handle sensitive commands safely — Use alternatives, never block workflow

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.