✨ Add KubeStellar Console cursor rules#269
Conversation
Adds development rules for KubeStellar Console, a multi-cluster Kubernetes dashboard. Covers card development patterns, array safety, styling (Tailwind), i18n, and Go backend conventions. https://github.com/kubestellar/console Signed-off-by: clubanderson <clubanderson@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughAdds a new KubeStellar Console development rules document describing frontend (React/TypeScript) and backend (Go/Fiber v2) conventions, build/lint steps, dashboard data-fetching and hook/loading rules, styling and i18n standards, and multi-cluster querying patterns. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
rules-new/kubestellar-console.mdc (1)
26-27: Relax the numeric-literal rule to reduce false positives.At Line 26, “Every numeric literal” is likely too absolute for idiomatic TS/Go (
0,1, simple lengths/indices). Consider explicit exceptions.Proposed fix
-- Every numeric literal must be a named constant +- Numeric literals should be named constants, except trivial literals (`0`, `1`, `-1`) in clear local contexts🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@rules-new/kubestellar-console.mdc` around lines 26 - 27, The rule text in kubestellar-console.mdc is too strict—change the “Every numeric literal must be a named constant” rule to allow explicit exceptions for common/idiomatic literals (e.g., 0, 1, -1, simple array indices, enum-like flags, small loop counters, and literal lengths/sizes) while still recommending constants for meaningful domain values; update the rule wording to list these exceptions and add a note to prefer constants from lib/constants/(time.ts, network.ts, ui.ts) for domain-specific numbers, and ensure the rule name/heading remains “numeric-literal” so tooling still recognizes it.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@rules-new/kubestellar-console.mdc`:
- Around line 31-33: The doc currently conflicts: one line forbids raw/palette
classes and mandates semantic classes (`text-foreground`, `bg-primary`), while
the next line prescribes specific palette classes (green-400, yellow-400,
red-400, cyan-400); resolve by choosing a single approach—preferably replace the
palette-specific guidance with semantic status tokens (e.g., `text-success`,
`bg-success`, `text-warning`, `bg-warning`, `text-error`, `bg-error`,
`text-info`, `bg-info`) and add a short note that these semantic tokens map to
the underlying palette (green-400, yellow-400, red-400, cyan-400) in the design
system, or alternatively allow palette classes only when defining those semantic
tokens; update the lines referencing `text-foreground`, `bg-primary` and the
status color line to use the chosen semantic token names and mention the
mapping.
- Line 3: Update the globs entry to remove the unnecessary surrounding quotes so
it matches the repository convention used in other .mdc files; specifically edit
the globs key (globs: "...") and change it to an unquoted, comma-separated list
(globs: **/*.tsx, **/*.ts, **/*.go, web/src/**/*.ts, web/src/**/*.tsx,
pkg/**/*.go, cmd/**/*.go) so the file's globs value follows the same style as
fastapi.mdc, react.mdc, and typescript.mdc.
---
Nitpick comments:
In `@rules-new/kubestellar-console.mdc`:
- Around line 26-27: The rule text in kubestellar-console.mdc is too
strict—change the “Every numeric literal must be a named constant” rule to allow
explicit exceptions for common/idiomatic literals (e.g., 0, 1, -1, simple array
indices, enum-like flags, small loop counters, and literal lengths/sizes) while
still recommending constants for meaningful domain values; update the rule
wording to list these exceptions and add a note to prefer constants from
lib/constants/(time.ts, network.ts, ui.ts) for domain-specific numbers, and
ensure the rule name/heading remains “numeric-literal” so tooling still
recognizes it.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 0c6ab695-8546-4699-a9d9-b8e273079141
📒 Files selected for processing (1)
rules-new/kubestellar-console.mdc
| - Never use raw hex colors — use semantic classes (`text-foreground`, `bg-primary`) | ||
| - Status colors: green-400 (success), yellow-400 (warning), red-400 (error), cyan-400 (info) | ||
|
|
There was a problem hiding this comment.
Resolve conflicting color guidance.
At Line 31 you require semantic classes, but Line 32 mandates specific palette classes. This creates conflicting enforcement.
Proposed fix
-- Never use raw hex colors — use semantic classes (`text-foreground`, `bg-primary`)
-- Status colors: green-400 (success), yellow-400 (warning), red-400 (error), cyan-400 (info)
+- Never use raw hex colors — use semantic classes (`text-foreground`, `bg-primary`)
+- Status colors must also be semantic tokens (e.g., `text-success`, `text-warning`, `text-error`, `text-info`)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@rules-new/kubestellar-console.mdc` around lines 31 - 33, The doc currently
conflicts: one line forbids raw/palette classes and mandates semantic classes
(`text-foreground`, `bg-primary`), while the next line prescribes specific
palette classes (green-400, yellow-400, red-400, cyan-400); resolve by choosing
a single approach—preferably replace the palette-specific guidance with semantic
status tokens (e.g., `text-success`, `bg-success`, `text-warning`, `bg-warning`,
`text-error`, `bg-error`, `text-info`, `bg-info`) and add a short note that
these semantic tokens map to the underlying palette (green-400, yellow-400,
red-400, cyan-400) in the design system, or alternatively allow palette classes
only when defining those semantic tokens; update the lines referencing
`text-foreground`, `bg-primary` and the status color line to use the chosen
semantic token names and mention the mapping.
- Relax numeric literal rule to allow trivial literals (0, 1, -1) - Clarify status color classes as explicit exception to semantic-class rule Signed-off-by: clubanderson <clubanderson@users.noreply.github.com>
1. Removed quotes from globs to match repo convention (fastapi.mdc, react.mdc) 2. Clarified status color guidance: palette classes are semantic status tokens, not exceptions — resolves conflict between semantic-only and palette rules Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: clubanderson <clubanderson@users.noreply.github.com>
|
Addressed all three CodeRabbit review items:
Thanks for the thorough review! |
Add KubeStellar Console Rules
Adds cursor rules for KubeStellar Console, a multi-cluster Kubernetes dashboard with AI-powered operations.
Rules Included
useCache/useCached*hook patterns,isDemoData/isRefreshingwiring, loading state management.map()/.filter()/.join()cn()utilityreact-i18nextt()slogloggingDeduplicatedClusters()when iterating clustersAbout the Project
Summary by CodeRabbit