-
Notifications
You must be signed in to change notification settings - Fork 37
feat: add AGENTS.md symlink support with comprehensive testing #429
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
Conversation
Add support for Cursor and other AI tools that use AGENTS.md by creating a symlink to CLAUDE.md. This provides zero-maintenance dual-tool support with comprehensive validation. Changes: - Create AGENTS.md -> CLAUDE.md symlink for Cursor compatibility - Add minimal inline symlink validation to e2e workflow (fails fast) - Add comprehensive standalone test script (10 checks) - Add dedicated GitHub Actions workflow for symlink validation - Add tests/README.md documenting the testing strategy - Update .gitignore to exclude .cursor/ and .tessl/ directories Testing Strategy: 1. E2E inline check - Fast validation on every e2e run (~1 second) 2. Dedicated workflow - Runs when AGENTS.md/CLAUDE.md change 3. Local test script - Comprehensive validation with detailed output The symlink approach eliminates duplication and sync issues while supporting both Claude Code (CLAUDE.md) and Cursor (AGENTS.md). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Claude Code ReviewSummaryThis PR adds AGENTS.md symlink support to enable Cursor and other AI coding tools to access the project documentation. The implementation is excellent with comprehensive testing, proper CI integration, and follows all project standards. The symlink approach is smart and maintainable. Overall Assessment: ✅ APPROVED - Ready to merge Issues by Severity🚫 Blocker IssuesNone - This PR is ready to merge. 🔴 Critical IssuesNone - All critical aspects are properly handled. 🟡 Major IssuesNone - Implementation follows all best practices. 🔵 Minor Issues1. Missing executable permissions check in e2e.ymlLocation: The inline validation in the e2e workflow doesn't set executable permissions on the test script before running it. While the script uses Current: - name: Validate AGENTS.md symlink
run: |
echo "Validating AGENTS.md → CLAUDE.md symlink..."
[ -L AGENTS.md ] || (echo "❌ AGENTS.md is not a symlink" && exit 1)Recommendation: This is actually fine as-is since the e2e workflow doesn't call the script file - it runs direct bash commands. This is intentional for fast fail. No change needed. 2. Test script exit code on warning (Line 72-73)Location: if ! git ls-files --error-unmatch AGENTS.md > /dev/null 2>&1; then
echo "WARNING"
echo "Warning: AGENTS.md is not tracked by git (will be added in commit)"
else
echo "OK"
fiThe script shows a WARNING but doesn't exit. This is intentional for local development but could be confusing. The dedicated GitHub Actions workflow properly validates git tracking separately (lines 48-64 of Recommendation: Consider adding a comment explaining why this is a warning and not an error: # Test 7: Check that file is tracked by git
# Note: Shows warning (not error) to allow local testing before commit
echo -n "✓ Checking AGENTS.md is tracked by git... "Positive Highlights🎯 Excellent Design Decisions
🛡️ Security & Best Practices
📚 Documentation Quality
✅ Code Quality
Architecture AlignmentThis PR aligns perfectly with the project's testing strategy documented in CLAUDE.md:
RecommendationsPriority 1: Optional Improvements (Can do in follow-up PR)
# Test 7: Check that file is tracked by git
# Note: Shows warning (not error) to allow local testing before commit
echo -n "✓ Checking AGENTS.md is tracked by git... "
Priority 2: Nice-to-Have Additions
Testing VerificationI verified the implementation: ✅ AGENTS.md symlink exists and points to CLAUDE.md: ✅ Git tracks it correctly as symlink (mode 120000): ✅ All workflow paths configured correctly ✅ Test script has proper executable permissions ✅ .gitignore properly excludes AI tool directories Final VerdictThis is excellent work! The PR demonstrates:
Recommendation: Merge immediately ✅ The minor suggestions above are truly optional and could be addressed in a follow-up PR if desired. The current implementation is production-ready and follows all project standards. 🤖 Generated with Claude Code Co-Authored-By: Claude noreply@anthropic.com 🔍 View AI decision process (logs available for 90 days) 📋 View memory system files loaded (click to expand)What Amber Loaded for Code ReviewAmber automatically loaded these repository standards from the memory system:
Impact: This review used your repository's specific code quality standards, security patterns, and best practices from the memory system (PRs #359, #360) - not just generic code review guidelines. |
|
|
||
| echo "✅ Symlink works correctly on Linux" | ||
|
|
||
| - name: Validate git tracking |
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.
er...a whole github actions workflow to verify a file is in the git repository?
That feels like massive overkill?
| # Test that AGENTS.md symlink works for Cursor and other AI tools | ||
| # This validates that: | ||
| # 1. AGENTS.md exists and is a valid symlink | ||
| # 2. It points to CLAUDE.md | ||
| # 3. Content is readable and identical to CLAUDE.md | ||
| # 4. File is tracked by git correctly |
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.
This testing feels pretty excessive for something so simple. What I think would be enough testing and more useful would be to verify some agent other than claude (like goose or whatever) running on this repo has successfully read in the content.
|
To be clear is this intended to replace #366 or is it a smaller preparatory step and we could still merge that PR or a variant of it that is actually aiming to not have everything be about Claude? |
| ## Test Structure | ||
|
|
||
| - `integration/` - Integration tests requiring real Kubernetes clusters | ||
| - `test_agents_md_symlink.sh` - Validates AGENTS.md symlink for Cursor compatibility |
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.
How about generalizing this to something like structure/ which is tests that statically verify the git repository state (without building anything). Could also be written in Go perhaps and not shell script.
| The `test_agents_md_symlink.sh` script validates that the `AGENTS.md` → `CLAUDE.md` symlink works correctly for Cursor and other AI coding tools. | ||
|
|
||
| ### What It Tests | ||
|
|
||
| 1. ✅ AGENTS.md exists and is a valid symlink | ||
| 2. ✅ Symlink points to CLAUDE.md | ||
| 3. ✅ Content is readable through symlink | ||
| 4. ✅ Content matches CLAUDE.md exactly | ||
| 5. ✅ File is tracked by git correctly (mode 120000) | ||
| 6. ✅ Contains expected project context | ||
| 7. ✅ All required documentation sections exist | ||
| 8. ✅ File size is reasonable |
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.
And all of this stuff is already described in the test itself - what value is there in duplicating it? It can only get out of date.
Summary
Add support for Cursor and other AI tools that use
AGENTS.mdby creating a symlink toCLAUDE.md. This provides zero-maintenance dual-tool support with comprehensive validation.Changes
AGENTS.md→CLAUDE.mdsymlink for Cursor compatibilitytests/README.mddocumenting the testing strategy.gitignoreto exclude.cursor/and.tessl/directoriesTesting Strategy
Three-tier validation approach:
E2E inline check - Fast validation on every e2e run (~1 second)
Dedicated workflow - Runs when
AGENTS.mdorCLAUDE.mdchangeLocal test script -
tests/test_agents_md_symlink.shWhy a Symlink?
Problem: Claude Code uses
CLAUDE.md, Cursor usesAGENTS.mdSolution: Symlink eliminates duplication and maintenance overhead
Benefits:
Test Results
Test Plan
AGENTS.mdsuccessfully (manual verification)🤖 Generated with Claude Code