Skip to content

docs: add CLAUDE.md#13

Open
myasnikovdaniil wants to merge 1 commit into
mainfrom
docs/claude-md
Open

docs: add CLAUDE.md#13
myasnikovdaniil wants to merge 1 commit into
mainfrom
docs/claude-md

Conversation

@myasnikovdaniil
Copy link
Copy Markdown
Contributor

@myasnikovdaniil myasnikovdaniil commented May 18, 2026

Summary

  • Add CLAUDE.md as the authoritative dev guide for this Claude-driven SPA: stack, dev loop, code style (no semicolons, .ts/.tsx import extensions, import type, path aliases), architecture rules (direct-to-Kubernetes, dynamic discovery from ApplicationDefinition, watch via useK8sList, tenant scoping, oauth2-proxy), the RJSF form pipeline in SchemaForm.tsx, project layout, testing setup, CI, and PR conventions.

Test plan

  • N/A — docs only

Summary by CodeRabbit

  • Documentation
    • Added internal development documentation outlining project conventions, architecture constraints, and development guidelines for contributors.

Note: This is an internal documentation update with no end-user-facing changes.

Review Change Stack

Add the authoritative dev guide for this Claude-driven SPA: stack, dev
loop, code style, architecture rules (direct-to-Kubernetes, dynamic
discovery from ApplicationDefinitions, watch via useK8sList, tenant
scoping, oauth2-proxy), the RJSF form pipeline, project layout,
testing, CI, and PR conventions.

Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

📝 Walkthrough

Walkthrough

Added CLAUDE.md to document Cozystack console's development model and project conventions. The guide covers development workflow, strict code style rules (no semicolons, explicit imports), Kubernetes-API-first architecture (direct API access, CRD runtime discovery, watch semantics, tenant scoping), RJSF form pipeline constraints, testing practices, and PR expectations.

Changes

Development Conventions and Architecture Documentation

Layer / File(s) Summary
Project conventions and architecture guide
CLAUDE.md
CLAUDE.md establishes development model including: stack/tooling, local dev/production routing (kubectl proxy/nginx), strict code style (no semicolons, explicit imports, type-only imports), Kubernetes API architecture (direct access, ApplicationDefinition CRDs, watch semantics, tenant scoping, oauth2-proxy auth), RJSF pipeline rules (schema sanitization, deterministic widget binding, default-state behavior, schema traversal testing), testing/CI practices, and PR scope rules.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A guide to code so neat and clean,
No semicolons in between,
Kubernetes API rules so strict and tight,
Forms sanitized, tests pinned just right.
With conventions clear, the path shines bright!

🚥 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 'docs: add CLAUDE.md' is concise, clear, and directly describes the main change—adding a new documentation file to the repository.
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
  • Commit unit tests in branch docs/claude-md

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

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces CLAUDE.md, a comprehensive development guide for the cozystack-ui project that outlines the architecture, tech stack, and coding standards for AI-driven development. Review feedback identifies several documentation inaccuracies, including non-existent versions for Vite and TypeScript, inconsistencies in the form widget binding instructions compared to the current implementation, and a mismatch regarding missing patch support in the Kubernetes client hooks.

Comment thread CLAUDE.md
## Stack

- **pnpm workspace** — `apps/console` is the SPA; `packages/{k8s-client,ui,types}` are workspace deps.
- **React 19 + Vite 8 + TypeScript ~6.0** with `module: esnext`,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The versions for Vite (8) and TypeScript (6.0) are incorrect as these versions have not been released. This may cause the LLM to assume the availability of non-existent features or APIs. Consider updating these to the actual versions used in the project (e.g., Vite 6 and TypeScript 5.x).

Comment thread CLAUDE.md
When you add a new widget binding:

- Add it to the chain in `SchemaForm.tsx` in a deterministic order.
- Walk `properties` *and* `items` for arrays. Do **not** walk
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The guide states that widget binding logic should walk both properties and items for arrays. However, several helper functions in apps/console/src/components/SchemaForm.tsx (such as addStorageClassWidgets, addBackupClassWidgets, and addAdditionalPropertiesWidgets) currently only walk properties. This inconsistency should be resolved to ensure the guide accurately reflects the required implementation pattern.

Comment thread CLAUDE.md
hooks/
test/setup.ts # vitest + jest-dom + manual RTL cleanup
packages/
k8s-client/ # K8sClient (list/get/create/update/patch/delete/watch) + React Query hooks
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The description for packages/k8s-client/ mentions patch support, but the useK8sPatch hook is missing from packages/k8s-client/src/hooks.ts. If patching is a supported operation, the corresponding hook should be implemented or the documentation updated to reflect the available hooks.

Copy link
Copy Markdown

@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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CLAUDE.md`:
- Around line 121-137: Add a language token to the fenced code block in
CLAUDE.md (the multi-line listing block that begins with ``` and shows the
apps/console/ structure) so markdownlint rule MD040 stops flagging it; change
the opening fence from ``` to ```text (or another appropriate language) and
leave the closing ``` unchanged.
🪄 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: cf75dcda-977e-49ae-adfd-23b8b4e5f01b

📥 Commits

Reviewing files that changed from the base of the PR and between 7c20a20 and c90aa71.

📒 Files selected for processing (1)
  • CLAUDE.md

Comment thread CLAUDE.md
Comment on lines +121 to +137
```
apps/console/
src/
App.tsx, main.tsx # entry + routing
routes/ # one file per top-level page
detail/ # ApplicationDetailPage + tabs (Overview, Workloads, …)
components/ # page-level components, form widgets, command palette
lib/ # app-definitions, tenant-context, sensitive-fields, …
hooks/
test/setup.ts # vitest + jest-dom + manual RTL cleanup
packages/
k8s-client/ # K8sClient (list/get/create/update/patch/delete/watch) + React Query hooks
ui/ # AppShell, Sidebar, Header, Button, StatusBadge, Spinner, Dropdown, Section
types/ # ApplicationDefinition, ApplicationInstance, Tenant, TenantNamespace, group/version constants
Containerfile # multi-stage build → nginx-unprivileged on :8080
.github/workflows/ # test.yaml (typecheck + vitest), build.yaml (multi-arch image to ghcr)
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add a language to the fenced code block to satisfy markdownlint.

Line 121 opens a fenced block without a language, which triggers MD040. Add a language token (for example text) to avoid lint noise/failures.

Proposed fix
-```
+```text
 apps/console/
   src/
     App.tsx, main.tsx              # entry + routing
@@
 .github/workflows/                  # test.yaml (typecheck + vitest), build.yaml (multi-arch image to ghcr)
-```
+```
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
```
apps/console/
src/
App.tsx, main.tsx # entry + routing
routes/ # one file per top-level page
detail/ # ApplicationDetailPage + tabs (Overview, Workloads, …)
components/ # page-level components, form widgets, command palette
lib/ # app-definitions, tenant-context, sensitive-fields, …
hooks/
test/setup.ts # vitest + jest-dom + manual RTL cleanup
packages/
k8s-client/ # K8sClient (list/get/create/update/patch/delete/watch) + React Query hooks
ui/ # AppShell, Sidebar, Header, Button, StatusBadge, Spinner, Dropdown, Section
types/ # ApplicationDefinition, ApplicationInstance, Tenant, TenantNamespace, group/version constants
Containerfile # multi-stage build → nginx-unprivileged on :8080
.github/workflows/ # test.yaml (typecheck + vitest), build.yaml (multi-arch image to ghcr)
```
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 121-121: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CLAUDE.md` around lines 121 - 137, Add a language token to the fenced code
block in CLAUDE.md (the multi-line listing block that begins with ``` and shows
the apps/console/ structure) so markdownlint rule MD040 stops flagging it;
change the opening fence from ``` to ```text (or another appropriate language)
and leave the closing ``` unchanged.

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