Skip to content

fix: add claudecode to valid targets in parser validation#2

Merged
cm-dyoshikawa merged 1 commit intodyoshikawa:mainfrom
ise:feature/addtarget
Jun 25, 2025
Merged

fix: add claudecode to valid targets in parser validation#2
cm-dyoshikawa merged 1 commit intodyoshikawa:mainfrom
ise:feature/addtarget

Conversation

@ise
Copy link
Contributor

@ise ise commented Jun 25, 2025

Summary

Fix validation error when importing from CLAUDE.md by adding claudecode to valid targets.

Problem

  • When using the import command to import from CLAUDE.md, the targets field is set to ["claudecode"]
  • However, src/core/parser.ts validation only allows ["copilot", "cursor", "cline", "claude", "roo", "*"]
  • This causes a validation error: Invalid target "claudecode" when running rulesync validate

Solution

  • Added claudecode to the validTargets array in src/core/parser.ts
  • Since claude is already being used as a target in existing configurations, we preserve both claude and claudecode for backward compatibility
  • Added comprehensive tests to ensure both single and mixed target configurations work properly

Changes

  • ✅ Updated validTargets array to include claudecode
  • ✅ Added test cases for claudecode target validation
  • ✅ Added test cases for mixed targets including claudecode
  • ✅ All existing tests pass (159/159)

Testing

pnpm test  # All tests pass

The fix resolves the validation error while maintaining backward compatibility with existing claude target configurations.


Thank you for creating such an amazing tool! 🚀
Please review when you have a chance.

Previously, the claudecode parser would generate frontmatter with
targets: ["claudecode"], but the validation logic only allowed
["copilot", "cursor", "cline", "claude", "roo", "*"], causing
validation errors when importing from Claude Code.

This commit:
- Adds "claudecode" to the validTargets array in parser.ts
- Adds comprehensive tests for claudecode target validation
- Ensures both "claude" and "claudecode" are valid targets

Fixes the issue where `rulesync validate` would fail with:
"Invalid target 'claudecode' in .rulesync/claudecode__claude-main.md"
@cm-dyoshikawa
Copy link
Collaborator

Good catch!

I will convert claude keyword to claudecode and delete all claude in this tool's specification in the near future.

Thank you so much.

@cm-dyoshikawa
Copy link
Collaborator

I will merged it after reviewing soon.

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