agentleFS
plipowczanplipowczan/claude-piv-skeleton/AGENTS.md

claude-piv-skeleton

AGENTS.md4 starsChanged 10 months agoMITView on GitHub

PIV: Prime → Implement → Validate methodology for AI-assisted development RED → GREEN → REFACTOR - No exceptions. Rules: - ❌ NEVER write code before test - ❌ NEVER skip TDD for "simple" code - ✅ Test must fail before implementation - ✅ Minimal code only - no premature optimization Universal AI Dev Framework - https://github.com/galando/piv-speckit Works with: Claude Code, Cursor, GitHub Copilot, OpenAI Codex, and 20+ AI tools

The file

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

11 rules. About 2 are common, 9 are distinctive, and 0 are very specific to this project.

  • ≈2

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    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:

    Implement: Write tests FIRST (TDD mandatory)

    line 9
  2. Distinctive:

    Validate: Run tests, verify quality

    line 10
  3. Distinctive:

    RED → GREEN → REFACTOR: - No exceptions.

    line 16
  4. Distinctive:

    Understand first: Read existing code before modifying

    line 35
  5. Distinctive:

    Match patterns: Follow existing codebase conventions

    line 36
  6. Distinctive:

    Minimal changes: Only change what's necessary

    line 37
  7. Distinctive:

    Check for existing implementations before creating new

    line 41
  8. Distinctive:

    Prefer simple over clever solutions

    line 46
  9. Distinctive:

    Use parameterized queries (prevent SQL injection)

    line 104
  10. Common:

    Use bcrypt/Argon2 (NEVER MD5/SHA for passwords)

    line 107
  11. Common:

    NEVER commit secrets to git

    line 116

≈ “Common” is an estimate: at least 1 in 5 of the 41,581 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
<!-- Universal AI Dev Framework - https://github.com/galando/piv-speckit -->

Universal AI Dev Framework - Agent Instructions

PIV: Prime → Implement → Validate methodology for AI-assisted development

Quick Start

  1. Prime: Understand codebase before changes
  2. Implement: Write tests FIRST (TDD mandatory)
  3. Validate: Run tests, verify quality

TDD Requirements (MANDATORY)

RED → GREEN → REFACTOR - No exceptions.

PhaseActionValidation
🔴 REDWrite failing test FIRSTTest fails
🟢 GREENMinimal code to passTest passes
🔵 REFACTORImprove while greenTests still pass

Rules:

  • ❌ NEVER write code before test
  • ❌ NEVER skip TDD for "simple" code
  • ✅ Test must fail before implementation
  • ✅ Minimal code only - no premature optimization

Code Style

General Principles

  • Understand first: Read existing code before modifying
  • Match patterns: Follow existing codebase conventions
  • Minimal changes: Only change what's necessary
  • Self-documenting: Clear names over comments

DRY (Don't Repeat Yourself)

  • Check for existing implementations before creating new
  • Reuse patterns, don't duplicate logic
  • Single source of truth for each piece of knowledge

KISS (Keep It Simple)

  • Prefer simple over clever solutions
  • Don't over-engineer
  • Avoid premature optimization

Testing Patterns

Given-When-Then Structure

GIVEN: Setup test data and preconditions
WHEN:  Execute the code being tested
THEN:  Verify expected outcomes

Test Requirements

  • Descriptive test names explaining behavior
  • Independent tests (no shared state)
  • Fast execution (< 100ms per unit test)
  • Mock external dependencies

Coverage Goals

  • Critical paths: 90-100%
  • Business logic: 80-90%
  • Overall: 80%+

Git Workflow

Branch Naming

  • feature/feature-name - New features
  • fix/bug-description - Bug fixes
  • docs/update-description - Documentation

Commit Messages (Conventional Commits)

type(scope): description

Types: feat, fix, docs, refactor, test, chore

Rules

  • ✅ Small, focused commits
  • ✅ Meaningful messages
  • ❌ No broken code
  • ❌ No WIP commits

Security

Golden Rule

NEVER trust user input.

Input Validation

  • Validate structure, type, format, length
  • Sanitize before use
  • Use parameterized queries (prevent SQL injection)

Authentication & Passwords

  • Use bcrypt/Argon2 (NEVER MD5/SHA for passwords)
  • Strong JWT secrets (256+ bits)
  • Short token expiration (1 hour)
  • Implement rate limiting

Data Protection

  • HTTPS in production
  • Encrypt sensitive data at rest
  • Environment variables for secrets
  • NEVER commit secrets to git

API Design (if applicable)

RESTful Principles

  • Nouns over verbs: /users not /getUsers
  • Plural nouns: /users not /user
  • Proper HTTP verbs: GET, POST, PUT, DELETE

Response Format

// Success
{ "data": {...}, "meta": {...} }

// Error
{ "error": "ErrorCode", "message": "Description" }

Quick Reference

PrincipleRule
TDDRED → GREEN → REFACTOR always
DRYNo duplicate logic
KISSSimple over clever
SecurityNever trust input
GitConventional commits
TestsGiven-When-Then

Universal AI Dev Framework - https://github.com/galando/piv-speckit Works with: Claude Code, Cursor, GitHub Copilot, OpenAI Codex, and 20+ AI tools

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.