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
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 32,671 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository11 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- .cursor/rules/piv-api.mdcCursor rule
- .cursor/rules/piv-general.mdcCursor rule
- .cursor/rules/piv-security.mdcCursor rule
- .cursor/rules/piv-tdd.mdcCursor rule
- adaptive-learningSkill
- api-designSkill
- code-reviewSkill
- securitySkill
- test-driven-developmentSkill
- test-writingSkill
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
- Distinctive: line 9
Implement: Write tests FIRST (TDD mandatory)
- Distinctive: line 10
Validate: Run tests, verify quality
- Distinctive: line 16
RED → GREEN → REFACTOR: - No exceptions.
- Distinctive: line 35
Understand first: Read existing code before modifying
- Distinctive: line 36
Match patterns: Follow existing codebase conventions
- Distinctive: line 37
Minimal changes: Only change what's necessary
- Distinctive: line 41
Check for existing implementations before creating new
- Distinctive: line 46
Prefer simple over clever solutions
- Distinctive: line 104
Use parameterized queries (prevent SQL injection)
- Common: line 107
Use bcrypt/Argon2 (NEVER MD5/SHA for passwords)
- Common: line 116
NEVER commit secrets to git
≈ “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.
Files
<!-- 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
- Prime: Understand codebase before changes
- Implement: Write tests FIRST (TDD mandatory)
- Validate: Run tests, verify quality
TDD Requirements (MANDATORY)
RED → GREEN → REFACTOR - No exceptions.
| Phase | Action | Validation |
| 🔴 RED | Write failing test FIRST | Test fails |
| 🟢 GREEN | Minimal code to pass | Test passes |
| 🔵 REFACTOR | Improve while green | Tests 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 outcomesTest 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 featuresfix/bug-description- Bug fixesdocs/update-description- Documentation
Commit Messages (Conventional Commits)
type(scope): description
Types: feat, fix, docs, refactor, test, choreRules
- ✅ 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:
/usersnot/getUsers - Plural nouns:
/usersnot/user - Proper HTTP verbs: GET, POST, PUT, DELETE
Response Format
// Success
{ "data": {...}, "meta": {...} }
// Error
{ "error": "ErrorCode", "message": "Description" }Quick Reference
| Principle | Rule |
| TDD | RED → GREEN → REFACTOR always |
| DRY | No duplicate logic |
| KISS | Simple over clever |
| Security | Never trust input |
| Git | Conventional commits |
| Tests | Given-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
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
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.

