Skip to content

Conversation

@luisfmsouza
Copy link
Contributor

Summary

The goal of this pull request is adding support for rules nested into subdirectories (fixes #43 #56).

Please, point me for possible mistakes or things that I might be overlooking in the implementation.

Features

  • Import rules that exist in .claude/rules/frontend/react.md into .rulesync/rules/frontend/react.md
  • Generate rules from any subdirectory .rulesync/rules/**/*

Examples

rulesync Cursor and Claude
Screenshot 2026-01-24 at 12 48 56 Screenshot 2026-01-24 at 12 49 21

Last words

Thanks for creating and supporting this package, I implemented this week and it has been very helpful for us.

@dyoshikawa
Copy link
Owner

@luisfmsouza

Thank you for this great contribution! The subdirectories support feature is a valuable addition.

Code Review Comment

Issue: process.cwd() hardcoding in rules-processor.ts

In the loadRulesyncFiles method, process.cwd() is used directly:

const rulesyncBaseDir = join(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);

However, the RulesProcessor class has a this.baseDir property that should be used instead for better testability and design consistency.

Suggested fix:

const rulesyncBaseDir = join(this.baseDir, RULESYNC_RULES_RELATIVE_DIR_PATH);

This ensures that the base directory can be properly mocked in tests and maintains consistency with the existing class design.

@luisfmsouza luisfmsouza force-pushed the feat-add-subfolder-support branch from b1b426d to ebe1296 Compare January 26, 2026 11:25
@luisfmsouza
Copy link
Contributor Author

Thanks @dyoshikawa for the feedback, I've fixed that 4364f4b

@dyoshikawa
Copy link
Owner

@luisfmsouza Thank you!

@dyoshikawa dyoshikawa merged commit 648c56b into dyoshikawa:main Jan 26, 2026
6 checks passed
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.

RFC: Support subdirectory categorization within .rulesync directory

2 participants