Skip to content

feat: make suggest_fix token suggestions library-agnostic#159

Merged
himerus merged 2 commits intodevfrom
feature/library-agnostic-suggest-fix
Mar 21, 2026
Merged

feat: make suggest_fix token suggestions library-agnostic#159
himerus merged 2 commits intodevfrom
feature/library-agnostic-suggest-fix

Conversation

@himerus
Copy link
Contributor

@himerus himerus commented Mar 21, 2026

Summary

  • Breaking: Removed hardcoded --sl-* Shoelace tokens from suggest_fix — violates CLAUDE.md's "no framework assumptions" mandate
  • New: tokenPrefix parameter lets agents pass the library's token prefix (from diagnose_styling) so fix suggestions use the correct prefix (e.g. --hx-color-neutral-0, --fast-spacing-medium)
  • Fallback: Without a prefix, uses generic --your-* placeholders instead of Shoelace-specific tokens
  • Applies to both token-fallback and theme-compat fix types including contrast-pair suggestions

Test plan

  • 5 new tests covering: prefix routing, generic fallback, theme-compat with prefix, contrast-pair with prefix, property-appropriate token names
  • All 32 suggest-fix tests pass
  • TypeScript: clean
  • Prettier: clean

🤖 Generated with Claude Code

- Replace hardcoded --sl-* Shoelace tokens with prefix-aware generation
- Add optional tokenPrefix parameter to SuggestFixInput and MCP tool schema
- When tokenPrefix provided (e.g. '--hx-'), generates library-specific tokens
- Without prefix, uses generic --your-* placeholders instead of --sl-* tokens
- Applies to token-fallback and theme-compat fix types
- 5 new tests covering prefix routing, generic fallback, and property-appropriate names

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Mar 21, 2026

Warning

Rate limit exceeded

@himerus has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 15 minutes and 32 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6f81e975-48bd-4cc4-83d5-d2db6ffdb508

📥 Commits

Reviewing files that changed from the base of the PR and between 0be3991 and 99c65ca.

📒 Files selected for processing (4)
  • .changeset/library-agnostic-tokens.md
  • packages/core/src/handlers/suggest-fix.ts
  • packages/core/src/tools/styling.ts
  • tests/handlers/suggest-fix.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/library-agnostic-suggest-fix

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@himerus himerus merged commit 0a30bac into dev Mar 21, 2026
8 of 10 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.

1 participant