docs: add AI coding agent guidelines #3446
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.50) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 573 lines diff across 7 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.380
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3446"
general
weight: 0.35
stevenh
What does this PR do?
Adds a comprehensive
AI.mdfile in the repository root to guide AI coding agents working on the Testcontainers for Go codebase.Content Overview
1. Repository Overview
- Monorepo structure (core, modules, examples, docs)
- Project organization and layout
2. Environment Setup
- Go 1.24.7 requirement and gvm usage
- Critical environment setup commands
3. Development Workflow
- Module development process
- Git conventions and commit format
- PR creation guidelines
- Testing procedures
4. Module Development Best Practices
- Container struct design (use
Container, not module-specific names)- Run function pattern (5-step implementation guide)
- Container options patterns (built-in vs custom)
- State inspection techniques with
strings.CutPrefix- Variadic arguments usage
- Return types (struct not interface)
5. Testing Guidelines
- How to run tests properly
- Test patterns to follow
- Troubleshooting common test failures
6. Common Pitfalls
- Code anti-patterns to avoid
- Git workflow mistakes
- Testing issues
7. Reference Documentation
- Pointers to detailed docs for deep dives
Why is it important?
Implementation Notes
This document distills knowledge from:
docs/modules/index.mdThe AI.md file follows emerging industry standards for AI agent guidance, providing actionable instructions while referencing detailed documentation for deeper context.
Alternatives
The industry is still evolving practices for instructing AI coding agents, but several patterns are emerging:
Current Practices
1. .claude/ directory (Anthropic's approach)
- .claude/commands/ - Custom slash commands
- .claude/settings.json - Project-specific settings
- This is what you're using now and is becoming a standard for Claude Code
2. .github/ directory extensions
- .github/AI_INSTRUCTIONS.md or .github/CONTRIBUTING_AI.md
- Co-located with existing developer docs
- Some teams add AI-specific guidelines to existing CONTRIBUTING.md
3. Root-level files (emerging standards)
Common names being used:
- AI.md or AI_GUIDELINES.md - Generic instructions
- AGENTS.md - Specifically for AI agents
- .cursorrules - Cursor IDE specific
- .aiderignore - Aider specific
- CLAUDE.md - Claude-specific (less common)
4. Inline documentation
- docs/ai/ directory with structured guides
- Tool-specific: docs/claude/, docs/cursor/, etc.
What's Working Well
Most effective patterns:
1. Hybrid approach: Root AI.md + .claude/ for tool-specific features
/AI.md # High-level guidelines
/.claude/
/commands/ # Custom commands
/settings.json # Tool settings
2. Content structure that works:
- Architecture overview - "This is a Go monorepo with modules in /modules"
- Workflow rules - "Always run tests before committing"
- Code patterns - "Use testcontainers.Run() not GenericContainer()"
- Anti-patterns - "Don't use interface types as return values"
- Commit conventions - "Use conventional commits with co-author footer"
- Testing requirements - "Run make pre-commit test before committing"
3. Reference to existing docs - Don't duplicate, point to:
See plan.txt for migration patterns
See docs/modules/index.md for best practices
Industry Momentum
- Anthropic (Claude): .claude/ directory approach
- Cursor: .cursorrules file
- GitHub Copilot: Exploring .github/copilot-instructions.md
- Aider: .aiderignore for exclusions
- OpenAI: No official standard yet
Related issues