Skip to content

✨ Add KubeStellar Console cursor rules#269

Merged
PatrickJS merged 3 commits into
PatrickJS:mainfrom
clubanderson:add-kubestellar-console
May 2, 2026
Merged

✨ Add KubeStellar Console cursor rules#269
PatrickJS merged 3 commits into
PatrickJS:mainfrom
clubanderson:add-kubestellar-console

Conversation

@clubanderson
Copy link
Copy Markdown
Contributor

@clubanderson clubanderson commented Apr 26, 2026

Add KubeStellar Console Rules

Adds cursor rules for KubeStellar Console, a multi-cluster Kubernetes dashboard with AI-powered operations.

Rules Included

  • Card Development: useCache/useCached* hook patterns, isDemoData/isRefreshing wiring, loading state management
  • Array Safety: Guard against undefined before .map()/.filter()/.join()
  • No Magic Numbers: Named constants for all numeric literals
  • Styling: Tailwind CSS with semantic color classes, cn() utility
  • i18n: All user-facing strings through react-i18next t()
  • Go Backend: Fiber v2 handler patterns, multi-cluster goroutine patterns, slog logging
  • Cluster Deduplication: Always use DeduplicatedClusters() when iterating clusters

About the Project

  • License: Apache-2.0
  • CNCF: Part of the KubeStellar CNCF Sandbox project
  • Tech: Go backend (Fiber v2), React/TypeScript frontend (Tailwind CSS)
  • Website: https://console.kubestellar.io

Summary by CodeRabbit

  • Documentation
    • Added development guidelines for KubeStellar Console: repo layout and build/lint steps, standardized data‑fetching and UI hook patterns and loading/demo-state handling, array-safety guards, use of named constants instead of magic numbers, Tailwind-based styling with semantic color rules, mandatory internationalization for UI text, and backend conventions for handlers, errors, logging, concurrency, and cluster deduplication.

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>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ee921c8f-71cc-48fe-85d7-a0d6b442c2a0

📥 Commits

Reviewing files that changed from the base of the PR and between 881f5e5 and 69b3c4e.

📒 Files selected for processing (1)
  • rules-new/kubestellar-console.mdc
✅ Files skipped from review due to trivial changes (1)
  • rules-new/kubestellar-console.mdc

📝 Walkthrough

Walkthrough

Adds 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

Cohort / File(s) Summary
KubeStellar Console Development Rules
rules-new/kubestellar-console.mdc
Introduces a ruleset specifying repo layout (frontend web/, Go backend), required build/lint command (cd web && npm run build && npm run lint), dashboard data-fetching via useCache/useCached*, loading-state via useCardLoadingState (isDemoData, isRefreshing, isDemoFallback rules), hook ordering with demo-data providers, array-safety guards, prohibition of magic numbers in favor of lib/constants/, Tailwind + cn() styling and restricted status palette, i18n requirement using t() with English locale keys, and Go patterns (Fiber handler signatures, fiber.NewError, non-nil slices for JSON, log/slog, goroutines + sync.WaitGroup, DeduplicatedClusters() usage).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested reviewers

  • PatrickJS

Poem

🐇 I hopped through rules both neat and clear,
Hooks aligned and goroutines near,
Tailwind tokens, locale keys to send,
Clusters deduped before we send,
A tiny rabbit cheers this doc — well penned!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add KubeStellar Console cursor rules' accurately describes the main change—a new documentation ruleset file for KubeStellar Console development. The emoji is stylistic but not noise.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between fc2ce04 and 8b414b6.

📒 Files selected for processing (1)
  • rules-new/kubestellar-console.mdc

Comment thread rules-new/kubestellar-console.mdc Outdated
Comment thread rules-new/kubestellar-console.mdc Outdated
Comment on lines +31 to +33
- 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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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.

clubanderson and others added 2 commits April 26, 2026 12:09
- 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>
@clubanderson
Copy link
Copy Markdown
Contributor Author

Addressed all three CodeRabbit review items:

  1. Globs format — removed surrounding quotes to match repo convention (fastapi.mdc, react.mdc, typescript.mdc all use unquoted globs)
  2. Numeric-literal rule — already relaxed in previous commit to allow trivial literals (0, 1, -1)
  3. Color guidance conflict — clarified that status palette classes (text-green-400 etc.) map to the design system's semantic status tokens and are the only permitted palette classes, resolving the apparent contradiction

Thanks for the thorough review!

@PatrickJS PatrickJS merged commit bda19dd into PatrickJS:main May 2, 2026
1 check 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.

2 participants