Skip to content

docs: Add documentation for automatic rule file detection #1141

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

Merged

Conversation

codegen-sh[bot]
Copy link
Contributor

@codegen-sh codegen-sh bot commented Jun 17, 2025

This PR adds comprehensive documentation for Codegen's automatic rule file detection feature that was previously undocumented.

What's Added

New Documentation Section: "Automatic Rule File Detection"

  • Documents how set_active_codebase automatically discovers agent rule files
  • Explains the supported file patterns:
    • .cursorrules (Cursor AI editor rules)
    • .clinerules (Cline AI assistant rules)
    • .windsurfrules (Windsurf AI editor rules)
    • **/*.mdc (Markdown files with .mdc extension)
    • .cursor/rules/**/*.mdc (Markdown files in .cursor/rules/ directory)

Technical Details Covered

  • How file discovery works using ripgrep
  • 3,000 character limit and truncation behavior
  • Integration with manual repository rules
  • Performance considerations

Examples and Best Practices

  • Example rule file structures for different file types
  • Benefits of using automatic rule files vs manual configuration
  • Tips for managing rule file size limits

Why This Matters

This feature was already implemented and working in production but completely undocumented, leading to potential confusion for users who might not understand why certain behaviors were occurring when they had rule files in their repositories.

The documentation now provides clear guidance on:

  • How to structure rule files in repositories
  • What file patterns are automatically detected
  • How automatic and manual rules work together
  • Best practices for rule file management

Files Changed

  • docs/settings/repo-rules.mdx - Enhanced with new automatic detection section

The existing docs.json navigation structure already includes this page, so no changes were needed there.


💻 View my workAbout Codegen

- Document how set_active_codebase automatically discovers agent rule files
- Add supported file patterns: .cursorrules, .clinerules, .windsurfrules, *.mdc
- Explain 3000 character limit and truncation behavior
- Provide examples of rule file structures
- Clarify relationship between manual and automatic rules
@codegen-sh codegen-sh bot requested review from codegen-team and a team as code owners June 17, 2025 17:12
@jayhack jayhack merged commit 491cfee into develop Jun 17, 2025
14 of 15 checks passed
@jayhack jayhack deleted the codegen-bot/document-automatic-rule-file-detection-1750180327 branch June 17, 2025 17:13
Copy link
Contributor

🎉 This PR is included in version 0.56.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant