Skip to content

chore(rules): Configure AI agent rules and improve project guidelines#734

Merged
yamadashy merged 2 commits intomainfrom
chore/rules
Jul 15, 2025
Merged

chore(rules): Configure AI agent rules and improve project guidelines#734
yamadashy merged 2 commits intomainfrom
chore/rules

Conversation

@yamadashy
Copy link
Owner

Summary

This PR enhances the project's AI agent rules and development guidelines with the following improvements:

Key Changes

AI Agent Rules Configuration

  • Add alwaysApply and inclusion fields to .agents/rules/base.md frontmatter
  • Create symlinks for cross-tool compatibility:
    • .cursor/rules/base.mdc for Cursor AI
    • .kiro/steering/base.md for Kiro AI
  • Update .gitignore to allow .cursor/rules/ directory
  • Enable rule sharing across multiple AI coding assistants

Enhanced Coding Guidelines

  • Add guideline to maintain feature-based directory structure and avoid cross-feature dependencies
  • Improve code organization and maintainability standards

Claude Commands Reorganization

  • Reorganize .claude/commands/ files into categorized subdirectories:
    • agent/ for AI agent-related commands
    • code/ for code quality commands
    • git/ for git workflow commands
  • Translate command files to English for better accessibility

Impact

  • Improved consistency across different AI coding tools
  • Better project structure guidelines for maintainability
  • More organized command structure for Claude AI interactions
  • Enhanced developer experience with clearer guidelines

Checklist

  • Run `npm run test`
  • Run `npm run lint`

- Add alwaysApply and inclusion fields to base.md frontmatter
- Create symlinks for Cursor (.cursor/rules/base.mdc) and Kiro (.kiro/steering/base.md)
- Update .gitignore to allow .cursor/rules/ directory
- Enable rule sharing across multiple AI coding assistants
- Fix trailing whitespace in base.md
…Claude commands

- Add guideline to maintain feature-based directory structure and avoid cross-feature dependencies
- Reorganize .claude/commands/ files into categorized subdirectories:
  - agent/ for AI agent-related commands
  - code/ for code quality commands
  - git/ for git workflow commands
- Translate gemini-discuss.md and lint-fix.md to English
- Improve code organization and maintainability guidelines
Copilot AI review requested due to automatic review settings July 15, 2025 15:49
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 15, 2025

Walkthrough

This update adds new documentation and configuration files referencing a central rules file, updates the central rules file with additional metadata and guidelines, and modifies the .gitignore to start tracking a previously ignored directory. No changes were made to code or exported entities.

Changes

Files/Paths Change Summary
.agents/rules/base.md Added new YAML frontmatter keys, a guideline on feature-based structure, and minor formatting cleanup.
.cursor/rules/base.mdc, .kiro/steering/base.md Added new files referencing .agents/rules/base.md by relative path.
.gitignore Removed .cursor/rules/ from ignored paths, allowing it to be tracked by git.
.claude/commands/agent/gemini-discuss.md Added documentation on using Gemini CLI for in-depth discussions.
.claude/commands/code/lint-fix.md Added documentation instructing to run and fix issues with npm run lint.

Possibly related PRs

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/rules

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@claude
Copy link
Contributor

claude bot commented Jul 15, 2025

Claude finished @yamadashy's task —— View job


PR Review: AI Agent Rules Configuration and Project Guidelines

Tasks:

  • Analyze changes to .agents/rules/base.md frontmatter
  • Review cross-tool compatibility approach (symlinks)
  • Evaluate .claude/commands/ reorganization
  • Check .gitignore modifications
  • Assess overall architecture and design decisions
  • Provide specific feedback and recommendations

Summary

This PR effectively improves AI agent configuration and project organization. The changes are well-structured and address real needs for cross-tool compatibility and better command organization.

Detailed Review

✅ Strengths

1. Frontmatter Enhancement (.agents/rules/base.md, CLAUDE.md:3-4)

  • Excellent: Adding alwaysApply: true and inclusion: always provides clear directive for AI agents
  • Good practice: Ensures rules are consistently applied across all interactions
  • Consistent: Both files use identical frontmatter structure

2. Cross-Tool Compatibility (.cursor/rules/base.mdc, .kiro/steering/base.md)

  • Smart approach: Symlinks enable rule sharing across multiple AI tools
  • Practical: Addresses real-world usage where teams use different AI assistants
  • Efficient: Avoids code duplication while maintaining consistency

3. Command Organization (.claude/commands/)

  • Logical structure: Clear categorization into agent/, code/, git/ directories
  • Improved discoverability: Commands are easier to find and manage
  • English translation: Better accessibility for international developers

4. Feature-Based Architecture Guideline (.agents/rules/base.md:51)

  • Excellent addition: "Always maintain feature-based directory structure and avoid dependencies between features"
  • Aligns with best practices: Promotes modular, maintainable code architecture
  • Clear guidance: Provides specific direction for code organization

⚠️ Areas for Improvement

1. Symlink Compatibility Issues

  • Windows compatibility: Git symlinks may not work properly on Windows systems
  • Repository cloning: Some CI/CD systems or deployment environments may not handle symlinks correctly
  • Alternative suggestion: Consider using a build script to copy files instead of symlinks

2. Missing Documentation

  • Command structure: No documentation about the new .claude/commands/ directory structure
  • Usage examples: Missing examples of how to use the new command categories
  • Cross-tool setup: No instructions for setting up other AI tools with the new structure

3. Version Control Considerations

  • Symlink tracking: Ensure symlinks are properly tracked in version control
  • File permissions: Verify that symlinked files maintain proper permissions across platforms

🔧 Specific Recommendations

1. Add Documentation

# Suggested addition to CLAUDE.md or README.md
## AI Agent Configuration

### Command Structure
- `agent/` - AI agent-specific commands and interactions
- `code/` - Code quality and formatting commands  
- `git/` - Git workflow and version control commands

### Cross-Tool Compatibility
This project supports multiple AI coding assistants:
- **Cursor AI**: `.cursor/rules/base.mdc`
- **Kiro AI**: `.kiro/steering/base.md`
- **Claude**: `.agents/rules/base.md`

2. Consider Alternative to Symlinks

# Alternative: Build script approach
#!/bin/bash
# scripts/sync-ai-rules.sh
cp .agents/rules/base.md .cursor/rules/base.mdc
cp .agents/rules/base.md .kiro/steering/base.md

3. Add Validation

Consider adding a CI check to ensure all AI rule files stay in sync:

# .github/workflows/ai-rules-sync.yml
- name: Verify AI rules sync
  run: |
    diff .agents/rules/base.md .cursor/rules/base.mdc
    diff .agents/rules/base.md .kiro/steering/base.md

🎯 Architecture Assessment

Overall Design: Excellent

  • Clear separation of concerns with categorized commands
  • Consistent rule application across tools
  • Maintainable structure that scales well

Maintainability: Good

  • Organized directory structure
  • Clear naming conventions
  • Potential symlink maintenance overhead

Cross-Platform Compatibility: Moderate

  • Symlinks may cause issues on some systems
  • Consider testing on Windows environments

Conclusion

This PR successfully addresses important needs for AI agent configuration and project organization. The approach is thoughtful and practical, with only minor concerns around symlink compatibility. The addition of feature-based architecture guidelines is particularly valuable.

Recommendation: Approve with minor suggestions

  • Consider documentation additions
  • Test symlink behavior on different platforms
  • Monitor for any cross-platform issues post-merge

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @yamadashy, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on standardizing and improving the project's development environment by enhancing AI agent rules, refining coding guidelines, and reorganizing AI-assisted command structures. The changes aim to foster greater consistency across various AI coding assistants, enforce better code organization, and streamline the use of AI-driven development tools, ultimately contributing to a more maintainable codebase and an improved developer experience.

Highlights

  • AI Agent Rules Configuration: Configured core AI agent rules in .agents/rules/base.md with alwaysApply: true and inclusion: always to ensure consistent application. Symlinks (.cursor/rules/base.mdc and .kiro/steering/base.md) were created to enable rule sharing across Cursor AI and Kiro AI, improving consistency across different AI coding tools.
  • Enhanced Coding Guidelines: Added a new coding guideline to .agents/rules/base.md emphasizing the maintenance of a feature-based directory structure and the avoidance of cross-feature dependencies, aiming to improve overall code organization and maintainability.
  • Claude Commands Reorganization: Reorganized Claude AI command files into categorized subdirectories (agent/, code/) for better structure and accessibility. New commands like gemini-discuss.md and lint-fix.md were added within these new categories.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR configures AI agent rules for cross-tool consistency, reorganizes Claude command files, and strengthens project coding guidelines.

  • Expanded AI agent frontmatter with alwaysApply and inclusion and created symlink wrappers for Kiro and Cursor.
  • Reorganized Claude commands into agent/, code/, and git/ subdirectories with English translations.
  • Added a guideline enforcing feature-based directory structure for improved maintainability.

Reviewed Changes

Copilot reviewed 5 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
.kiro/steering/base.md Added wrapper to include core agent rules
.cursor/rules/base.mdc Added wrapper to include core agent rules
.claude/commands/code/lint-fix.md Added documentation for lint-fix command
.claude/commands/agent/gemini-discuss.md Added documentation for Gemini discussion workflow
.agents/rules/base.md Enhanced frontmatter and added feature-based guideline
Comments suppressed due to low confidence (3)

.claude/commands/agent/gemini-discuss.md:3

  • [nitpick] The description references "Claude Code's accuracy" in a Gemini-focused command; this may confuse readers. Consider rephrasing to clarify the intended target (e.g., "project code" or remove the specific tool reference).
Conduct detailed discussions about current work and use Gemini CLI to improve Claude Code's accuracy through multi-faceted analysis and iterative improvements.

.agents/rules/base.md:3

  • Add a brief comment or doc snippet explaining the purpose and valid values for the new alwaysApply and inclusion frontmatter fields so maintainers understand when and how these rules are applied.
alwaysApply: true

@cloudflare-workers-and-pages
Copy link

Deploying repomix with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8f0b74b
Status: ✅  Deploy successful!
Preview URL: https://58093303.repomix.pages.dev
Branch Preview URL: https://chore-rules.repomix.pages.dev

View logs

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request effectively configures rules for AI agents and improves project guidelines. The changes are well-structured and align with the goal of enhancing developer experience and maintainability. I've left a few minor suggestions regarding file formatting to ensure consistency and adherence to best practices for text files. Overall, great work!

@codecov
Copy link

codecov bot commented Jul 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.23%. Comparing base (f04fd3f) to head (8f0b74b).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #734   +/-   ##
=======================================
  Coverage   90.23%   90.23%           
=======================================
  Files         100      100           
  Lines        5768     5768           
  Branches     1205     1205           
=======================================
  Hits         5205     5205           
  Misses        563      563           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

♻️ Duplicate comments (1)
.kiro/steering/base.md (1)

1-145: Same duplication issue as Cursor rules

base.md is embedded rather than referenced, risking divergence between agents. Apply the same symlink/one-liner fix recommended for .cursor/rules/base.mdc.

🧹 Nitpick comments (3)
.agents/rules/base.md (1)

51-51: Clarify “feature-based directory” rule to avoid ambiguity

The new bullet is valuable, yet “feature” can be interpreted differently by backend vs. frontend teams. Consider adding a one-sentence example (e.g., src/user/, src/billing/) or linking to a doc so reviewers have a shared baseline.

.claude/commands/code/lint-fix.md (1)

1-1: Offer an auto-fix variant

Most teams run npm run lint -- --fix to resolve trivial issues automatically. Adding that note keeps the command self-contained.

-Run `npm run lint` and fix any errors that occur.
+Run `npm run lint -- --fix` to auto-resolve trivial issues, then address any remaining errors manually.
.claude/commands/agent/gemini-discuss.md (1)

7-9: Specify language for fenced code block (markdownlint MD040)

Add a language identifier (bash or shell) to silence linters and improve syntax highlighting.

-```
-gemini -p "<discussion content>"
-```
+```bash
+gemini -p "<discussion content>"
+```
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f04fd3f and 8f0b74b.

📒 Files selected for processing (6)
  • .agents/rules/base.md (3 hunks)
  • .claude/commands/agent/gemini-discuss.md (1 hunks)
  • .claude/commands/code/lint-fix.md (1 hunks)
  • .cursor/rules/base.mdc (1 hunks)
  • .gitignore (0 hunks)
  • .kiro/steering/base.md (1 hunks)
💤 Files with no reviewable changes (1)
  • .gitignore
🧰 Additional context used
📓 Path-based instructions (1)
.agents/rules/base.md

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursorrules
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
PR: yamadashy/repomix#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T16:07:20.939Z
Learning: Check the rules written in `.agents/rules/base.md` as they contain important project-specific guidelines and instructions.
Learnt from: CR
PR: yamadashy/repomix#0
File: .cursorrules:0-0
Timestamp: 2025-06-30T16:07:18.316Z
Learning: Applies to .agents/rules/base.md : Check the rules written in `.agents/rules/base.md` as they contain important project-specific guidelines and instructions.
.cursor/rules/base.mdc (2)
Learnt from: CR
PR: yamadashy/repomix#0
File: .cursorrules:0-0
Timestamp: 2025-06-30T16:07:18.316Z
Learning: Applies to .agents/rules/base.md : Check the rules written in `.agents/rules/base.md` as they contain important project-specific guidelines and instructions.
Learnt from: CR
PR: yamadashy/repomix#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T16:07:20.939Z
Learning: Check the rules written in `.agents/rules/base.md` as they contain important project-specific guidelines and instructions.
.kiro/steering/base.md (2)
Learnt from: CR
PR: yamadashy/repomix#0
File: .cursorrules:0-0
Timestamp: 2025-06-30T16:07:18.316Z
Learning: Applies to .agents/rules/base.md : Check the rules written in `.agents/rules/base.md` as they contain important project-specific guidelines and instructions.
Learnt from: CR
PR: yamadashy/repomix#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T16:07:20.939Z
Learning: Check the rules written in `.agents/rules/base.md` as they contain important project-specific guidelines and instructions.
.agents/rules/base.md (3)
Learnt from: CR
PR: yamadashy/repomix#0
File: .cursorrules:0-0
Timestamp: 2025-06-30T16:07:18.316Z
Learning: Applies to .agents/rules/base.md : Check the rules written in `.agents/rules/base.md` as they contain important project-specific guidelines and instructions.
Learnt from: CR
PR: yamadashy/repomix#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T16:07:20.939Z
Learning: Check the rules written in `.agents/rules/base.md` as they contain important project-specific guidelines and instructions.
Learnt from: CR
PR: yamadashy/repomix#0
File: browser/CLAUDE.md:0-0
Timestamp: 2025-06-30T16:07:27.184Z
Learning: Applies to browser/app/_locales/[a-zA-Z-]*/ : Create a directory in app/_locales/[language_code]/ when adding a new language
🪛 markdownlint-cli2 (0.17.2)
.claude/commands/agent/gemini-discuss.md

7-7: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (2)
.agents/rules/base.md (1)

3-4: Validate custom front-matter keys with downstream tooling

alwaysApply and inclusion look sensible, but these keys are non-standard. Double-check that every consumer (Cursor, Kiro, Claude, docs generators, etc.) actually parses and honours them; otherwise they risk becoming dead config.

.cursor/rules/base.mdc (1)

1-145: Symlink intent lost – file now duplicates entire ruleset

The summary claims this is a symlink, yet the blob contains the full text of .agents/rules/base.md. This will drift out of sync.

Convert the file to a real Git symlink (or keep only the single relative path line) to guarantee a single source of truth.

# From repo root
rm .cursor/rules/base.mdc
ln -s ../../.agents/rules/base.md .cursor/rules/base.mdc
git add .cursor/rules/base.mdc

Likely an incorrect or invalid review comment.

@yamadashy yamadashy merged commit 2e3c180 into main Jul 15, 2025
62 checks passed
@yamadashy yamadashy deleted the chore/rules branch July 15, 2025 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants