agentleFS
VersoXBTVersoXBT/claude-initial-setup/AGENTS.md

claude-initial-setup

AGENTS.md4 starsChanged 9 months agoMITView on GitHub

A curated library of 75 Claude Code skills across 25 categories, providing coding standards, patterns, and best practices for software development. Skills cover coding style, git workflow, testing, debugging, security, and language-specific patterns for TypeScript, Python, Go, Rust, Java, React/Next.js, Express/Node, FastAPI, Django, Docker, CI/CD, databases, and more. Always create new objects instead of mutating existing ones. Immutability prevents shared-state bugs and enables reliable change detection. Array operations must also be immutable: Python: Use @dataclass(frozen=True) and replace() for immutable data.…

  • Reads credentials

The file

Show its rules and text

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

36 rules. About 2 are common, 29 are distinctive, and 5 are very specific to this project.

  • ≈2

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈29

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Always create new objects instead of mutating existing ones.

    line 13
  2. Distinctive:

    Keep functions under 50 lines

    line 51
  3. Distinctive:

    No deep nesting beyond 4 levels

    line 52
  4. Distinctive:

    Follow language-specific casing (camelCase for JS/TS, snake_case for Python, PascalCase for Go exports)

    line 61
  5. Distinctive:

    Keep PRs under 400 lines of changes

    line 103
  6. Distinctive:

    Use draft PRs for early feedback

    line 105
  7. Distinctive:

    Use factories for dynamic test data, fixtures for static data

    line 128
  8. Distinctive:

    Do NOT mock: pure functions, internal utilities, the code under test

    line 133
  9. Distinctive:

    Use dependency injection for testability

    line 134
  10. Very specific:

    Always restore mocks in afterEach

    line 135
  11. Distinctive:

    Use Zod (TypeScript), Pydantic (Python), or equivalent

    line 142
  12. Distinctive:

    Prefer allowlists over denylists

    line 143
  13. Distinctive:

    Always use parameterized queries or an ORM

    line 148
  14. Distinctive:

    Never concatenate user input into SQL strings

    line 149
  15. Distinctive:

    Use framework-provided escaping (React auto-escapes by default)

    line 153
  16. Common:

    Never hardcode secrets, API keys, or passwords

    line 159
  17. Very specific:

    Use environment variables with .env files (never committed)

    line 160
  18. Very specific:

    Always include .env, .env.local, *.pem, *.key in .gitignore

    line 162
  19. Common:

    Never log sensitive data (passwords, tokens, PII)

    line 171
  20. Distinctive:

    Always handle errors explicitly with try/catch

    line 175
  21. Distinctive:

    Never swallow errors silently

    line 177
  22. Very specific:

    Check response.ok on fetch calls

    line 178
  23. Distinctive:

    Use custom error classes for domain-specific errors

    line 179
  24. Distinctive:

    Follow the loop: REPRODUCE -> HYPOTHESIZE -> TEST -> ISOLATE -> FIX -> VERIFY

    line 192
  25. Distinctive:

    Use binary search (git bisect, comment out halves) to narrow causes

    line 193
  26. Distinctive:

    Test one hypothesis at a time with targeted logging

    line 195
  27. Very specific:

    Avoid N+1 queries: use joins, include, or select_related

    line 200
  28. Distinctive:

    Use appropriate caching: in-memory for hot paths, Redis for distributed, CDN for static

    line 202
  29. Distinctive:

    Use lazy loading and code splitting for frontend

    line 204
  30. Distinctive:

    Use multi-stage builds to separate build from runtime

    line 208
  31. Distinctive:

    Run as non-root user

    line 209
  32. Distinctive:

    Use Alpine-based images for smaller size

    line 212
  33. Distinctive:

    Use snake_case for table and column names

    line 217
  34. Distinctive:

    Add indexes for columns used in WHERE, JOIN, and ORDER BY

    line 218
  35. Distinctive:

    Use foreign key constraints for referential integrity

    line 219
  36. Distinctive:

    No N+1 queries or unbounded results

    line 230

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.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
AGENTS.md

AGENTS.md

Project Overview

A curated library of 75 Claude Code skills across 25 categories, providing coding standards, patterns, and best practices for software development. Skills cover coding style, git workflow, testing, debugging, security, and language-specific patterns for TypeScript, Python, Go, Rust, Java, React/Next.js, Express/Node, FastAPI, Django, Docker, CI/CD, databases, and more.

Development Conventions

Code Style

Immutability

Always create new objects instead of mutating existing ones. Immutability prevents shared-state bugs and enables reliable change detection.

// WRONG: Mutation
function updateUser(user, name) {
  user.name = name;
  return user;
}

// CORRECT: Immutable update
function updateUser(user, name) {
  return { ...user, name };
}

Array operations must also be immutable:

const added = [...items, newItem];                      // append
const removed = items.filter(x => x.id !== id);         // remove
const updated = items.map(x =>                          // update
  x.id === id ? { ...x, name: "new" } : x
);
const sorted = items.toSorted((a, b) => a.name.localeCompare(b.name));

Python: Use @dataclass(frozen=True) and replace() for immutable data. Go: Use value receivers and return new structs instead of mutating via pointers.

File Organization

  • Target 200-400 lines per file, 800 maximum
  • Organize by feature/domain, not by type
  • Co-locate tests, styles, and types with their source files
  • Move code to shared/ only when used by 3+ features

Functions

  • Keep functions under 50 lines
  • No deep nesting beyond 4 levels
  • Name functions with a verb: getUserById, formatDate, validateEmail

Naming

  • Variables describe WHAT, not HOW: activeUsers not data
  • Booleans use is/has/can/should prefix: isActive, hasPermission
  • Collections use plural nouns: users, orderItems
  • Constants use SCREAMING_SNAKE: MAX_RETRIES, API_BASE_URL
  • Follow language-specific casing (camelCase for JS/TS, snake_case for Python, PascalCase for Go exports)

Git Workflow

Conventional Commits

Format: <type>(<scope>): <description>

TypePurpose
featNew feature
fixBug fix
refactorCode restructuring
docsDocumentation only
testAdding or fixing tests
choreMaintenance, dependencies
perfPerformance improvement
ciCI/CD changes

Rules:

  • Imperative mood: "add feature" not "added feature"
  • Under 72 characters
  • Lowercase after type prefix
  • No trailing period

Branch Naming

Format: <type>/<ticket-id>-<description>

feature/AUTH-123-add-sso-login
fix/BUG-456-null-pointer-on-logout
hotfix/SEC-101-patch-xss-vulnerability
release/v2.3.0
  • Lowercase with hyphens (kebab-case)
  • Under 50 characters after prefix
  • Include ticket ID when available

Pull Requests

  • Keep PRs under 400 lines of changes
  • Include summary, changes list, and test plan
  • Use draft PRs for early feedback
  • Squash merge for feature PRs, merge commit for releases

Testing

TDD Workflow (Red-Green-Refactor)

  1. RED: Write a failing test first
  2. GREEN: Write minimal code to pass the test
  3. REFACTOR: Clean up while keeping tests green
  4. Verify 80%+ coverage

Test Pyramid

  • Many fast unit tests (80%+ coverage)
  • Moderate integration tests (API, database)
  • Few E2E tests (critical user paths via Playwright)

Test Organization

  • Co-locate unit tests next to source: auth.ts / auth.test.ts
  • Integration tests in test/integration/
  • E2E tests in test/e2e/
  • Use factories for dynamic test data, fixtures for static data

Mocking

  • Mock at system boundaries only: external APIs, databases, file I/O
  • Do NOT mock: pure functions, internal utilities, the code under test
  • Use dependency injection for testability
  • Always restore mocks in afterEach

Security

Input Validation

  • Validate all user input at system boundaries
  • Use Zod (TypeScript), Pydantic (Python), or equivalent
  • Prefer allowlists over denylists
  • Parse, then validate: transform raw input into typed domain objects

SQL Injection Prevention

  • Always use parameterized queries or an ORM
  • Never concatenate user input into SQL strings

XSS Prevention

  • Use framework-provided escaping (React auto-escapes by default)
  • Sanitize with DOMPurify when rich HTML is needed
  • Set Content Security Policy headers

Secret Management

  • Never hardcode secrets, API keys, or passwords
  • Use environment variables with .env files (never committed)
  • Validate required secrets at startup with schema validation
  • Always include .env, .env.local, *.pem, *.key in .gitignore

Additional Security

  • CSRF protection with anti-CSRF tokens and SameSite cookies
  • SSRF prevention with URL allowlisting
  • Authorization checks on every resource access (prevent IDOR)
  • Rate limiting on authentication endpoints
  • Security headers via helmet or equivalent middleware
  • Never log sensitive data (passwords, tokens, PII)

Error Handling

  • Always handle errors explicitly with try/catch
  • Throw descriptive errors with context
  • Never swallow errors silently
  • Check response.ok on fetch calls
  • Use custom error classes for domain-specific errors
try {
  const result = await riskyOperation();
  return result;
} catch (error) {
  throw new Error(`Operation failed for user ${userId}: ${error.message}`);
}

Debugging

  • Follow the loop: REPRODUCE -> HYPOTHESIZE -> TEST -> ISOLATE -> FIX -> VERIFY
  • Use binary search (git bisect, comment out halves) to narrow causes
  • Create minimal reproductions
  • Test one hypothesis at a time with targeted logging
  • Fix root causes, not symptoms

Performance

  • Avoid N+1 queries: use joins, include, or select_related
  • Bound all database queries with LIMIT/pagination
  • Use appropriate caching: in-memory for hot paths, Redis for distributed, CDN for static
  • Set proper Cache-Control headers
  • Use lazy loading and code splitting for frontend

Docker

  • Use multi-stage builds to separate build from runtime
  • Run as non-root user
  • Order COPY instructions for optimal layer caching
  • Include HEALTHCHECK directives
  • Use Alpine-based images for smaller size

Database

  • Normalize to 3NF, denormalize selectively for performance
  • Use snake_case for table and column names
  • Add indexes for columns used in WHERE, JOIN, and ORDER BY
  • Use foreign key constraints for referential integrity
  • Plan for zero-downtime migrations

Code Review

Priority order: Correctness > Security > Performance > Maintainability > Testing > Style.

  • Logic handles edge cases (empty, null, zero, negative)
  • Error states handled (network failures, invalid data, timeouts)
  • User input validated at boundaries
  • Authorization checks on every resource access
  • No N+1 queries or unbounded results
  • Functions focused and under 50 lines
  • New code has corresponding tests

Available Agents

AgentPurpose
plannerImplementation planning for complex features and refactoring
architectSystem design and architectural decisions
code-reviewerCode quality, security, and maintainability review
security-reviewerOWASP vulnerabilities, secrets detection, injection prevention
tdd-guideTest-driven development, 80%+ coverage enforcement
debuggerSystematic debugging with hypothesis testing and binary search
build-error-resolverFix build and type errors with minimal diffs
refactor-cleanerDead code cleanup and consolidation
doc-updaterDocumentation and README updates
performance-optimizerProfiling, caching, and optimization
database-reviewerSchema design, query optimization, migration review
api-designerREST and GraphQL API design and review
devops-engineerDocker, CI/CD, infrastructure, and deployment
e2e-runnerPlaywright end-to-end testing for critical user flows

Commands

CommandPurpose
/reviewRun code review on current changes
/tddStart TDD workflow for a feature
/debugSystematic debugging assistance
/build-fixResolve build errors
/security-checkSecurity audit of current code
/refactorGuided refactoring

Skill Categories

Coding Style, Core Workflow, Testing, Debugging, Security, Code Review, Performance, TypeScript, Python, Go, Rust, Java, React/Next.js, Express/Node, FastAPI, Django, Docker, CI/CD, Database, Claude API, MCP Development, Agent Patterns, Agent Orchestration, Hooks, Memory Management.

75 skills total. Each skill is a standalone SKILL.md with trigger conditions, core patterns, anti-patterns, and a quick reference.

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.