feat: add antiPatterns to styling_preflight output#174
Conversation
Exports buildAntiPatterns from quick-ref and includes component-specific negative examples in the styling_preflight result. Agents now get positive examples (correctSnippet), validation (issues), AND negative examples (antiPatterns) in one call — reducing the need for separate tool invocations and preventing common Shadow DOM mistakes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
The barrel re-exports both quick-ref.js and styling-diagnostics.js, both of which exported buildAntiPatterns (with different return types). Rename quick-ref's version to buildAntiPatternHints to resolve TS2308. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Both features now present in styling_preflight: antiPatterns array from PR #174 and inline fix suggestions from this branch. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
buildAntiPatternsfromquick-ref.tsand imports it instyling-preflight.tsantiPatterns: string[]toPreflightResultinterfacestyling_preflightcallWhy
The
styling_preflighttool is the primary validation tool agents call after writing CSS. It returned validation issues and correct snippets but no explicit "don't do this" examples. Agents kept repeating the same mistakes (descendant selectors into shadow DOM, tokens on:root,::part()chaining) because they only saw what was wrong with their specific CSS, not the broader patterns to avoid.Test plan
🤖 Generated with Claude Code