-
-
Notifications
You must be signed in to change notification settings - Fork 586
docs: add AI coding agent guidelines #3446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: add AI coding agent guidelines #3446
Conversation
Add comprehensive AI.md file to guide AI coding agents working on the repository. This document combines best practices learned from module development with practical workflow guidelines. Key sections: - Repository overview and structure - Environment setup (Go version, gvm usage) - Development workflow (testing, git, PRs) - Module development best practices: - Container struct design (use Container, not module-specific names) - Run function pattern (5-step implementation) - Container options (when to use built-in vs custom) - State inspection with strings.CutPrefix - Variadic arguments usage - Testing guidelines and common pitfalls - Reference documentation pointers This helps AI agents understand the codebase architecture, follow established patterns, and avoid common mistakes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Summary by CodeRabbit
WalkthroughAdded Changes
Sequence Diagram(s)Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
AI.md(1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
AI.md
48-48: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (18)
- GitHub Check: lint (modules/registry) / lint: modules/registry
- GitHub Check: lint (modules/redis) / lint: modules/redis
- GitHub Check: lint (modules/k3s) / lint: modules/k3s
- GitHub Check: lint (modules/dockermodelrunner) / lint: modules/dockermodelrunner
- GitHub Check: lint (modules/socat) / lint: modules/socat
- GitHub Check: lint (modules/elasticsearch) / lint: modules/elasticsearch
- GitHub Check: lint (modules/chroma) / lint: modules/chroma
- GitHub Check: lint (modules/minio) / lint: modules/minio
- GitHub Check: lint (modules/mysql) / lint: modules/mysql
- GitHub Check: lint (modules/azure) / lint: modules/azure
- GitHub Check: lint (modules/scylladb) / lint: modules/scylladb
- GitHub Check: lint / lint:
- GitHub Check: lint (modulegen) / lint: modulegen
- GitHub Check: lint (modules/etcd) / lint: modules/etcd
- GitHub Check: lint (modules/dind) / lint: modules/dind
- GitHub Check: lint (modules/pulsar) / lint: modules/pulsar
- GitHub Check: lint (modules/artemis) / lint: modules/artemis
- GitHub Check: Analyze (go)
Update AI.md with specific details from the conventions.yml GitHub workflow: - Enforced commit types: security, fix, feat, docs, chore, deps - Scope rules: optional, must be lowercase - Subject rules: must not start with uppercase - Breaking change notation with ! - PR title validation details - Warning about main branch PRs being auto-closed This ensures AI agents follow the exact conventions enforced by CI. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Replace lengthy module development examples with quick reference that links to docs/modules/index.md for complete details. This: - Avoids duplication between AI.md and existing documentation - Keeps AI.md concise and scannable - Ensures single source of truth for detailed patterns - Provides just enough context for AI agents to get started 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Add 'text' language hint to the commit message example code fence for proper syntax highlighting. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
AI.md(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (17)
- GitHub Check: lint (modules/consul) / lint: modules/consul
- GitHub Check: lint (modules/mariadb) / lint: modules/mariadb
- GitHub Check: lint (examples/nginx) / lint: examples/nginx
- GitHub Check: lint (modules/redis) / lint: modules/redis
- GitHub Check: lint (modules/weaviate) / lint: modules/weaviate
- GitHub Check: lint (modules/nebulagraph) / lint: modules/nebulagraph
- GitHub Check: lint (modules/databend) / lint: modules/databend
- GitHub Check: lint (modules/registry) / lint: modules/registry
- GitHub Check: lint (modules/couchbase) / lint: modules/couchbase
- GitHub Check: lint (modules/aerospike) / lint: modules/aerospike
- GitHub Check: lint (modules/rabbitmq) / lint: modules/rabbitmq
- GitHub Check: lint (modules/k3s) / lint: modules/k3s
- GitHub Check: lint (modules/redpanda) / lint: modules/redpanda
- GitHub Check: lint (modules/elasticsearch) / lint: modules/elasticsearch
- GitHub Check: lint (modules/meilisearch) / lint: modules/meilisearch
- GitHub Check: lint (modules/gcloud) / lint: modules/gcloud
- GitHub Check: Analyze (go)
Include gvm commands for both Apple Silicon (arm64) and Intel/AMD (amd64) architectures to support all users. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Add AI.md to the excluded_files list in changed-modules.sh to prevent documentation-only changes from triggering unnecessary module builds. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
scripts/changed-modules.sh (1)
92-92: LGTM — excluding AI.md is correct. Optional robustness: normalize paths in loop.To ensure exclusions also match when paths come as "./AI.md" (or similar), strip a leading "./" before checks.
for file in $modified_files; do + # normalize path by stripping an optional leading "./" + file="${file#./}" # check if the file is in one of the excluded files for exclude_file in ${excluded_files[@]}; do if [[ $file == $exclude_file ]]; then
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
AI.md(1 hunks)scripts/changed-modules.sh(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- AI.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: lint (modules/memcached) / lint: modules/memcached
- GitHub Check: Analyze (go)
stevenh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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
Repository Overview
Environment Setup
Development Workflow
Module Development Best Practices
Container, not module-specific names)strings.CutPrefixTesting Guidelines
Common Pitfalls
Reference Documentation
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
Common names being used:
What's Working Well
Most effective patterns:
/AI.md # High-level guidelines
/.claude/
/commands/ # Custom commands
/settings.json # Tool settings
- 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"
See plan.txt for migration patterns
See docs/modules/index.md for best practices
Industry Momentum
Related issues