chore: optimize AI rules and conventions for Cursor and Claude Code#41671
chore: optimize AI rules and conventions for Cursor and Claude Code#41671
Conversation
…ntions - Add .ai/rules/global/project-conventions.md as shared content source - Add .cursor/rules/project-conventions.mdc (always-on, ~80 lines vs ~400+) - Add .cursor/rules/commit-conventions.mdc (always-on, ~30 lines vs ~170) - Add root CLAUDE.md for Claude Code users (mirrors project-conventions) - Remove index.mdc (verbose master entry point, replaced by project-conventions) - Remove semantic-pr-validator.mdc (verbose JS pseudocode, replaced by commit-conventions) - Remove task-list.mdc (broken, missing frontmatter) - Remove react-hook-best-practices.mdc (empty placeholder) Reduces always-on token cost from ~11-14K to ~750 tokens (94% reduction). Remaining old rules will be replaced by targeted globs/description rules in follow-up commits.
…rbose rules - Add .ai/rules/backend/java-spring-conventions.md (shared content) - Add .ai/rules/backend/server-unit-tests.md (shared content) - Add .cursor/rules/backend-java.mdc (globs: app/server/**/*.java) - Add .cursor/rules/server-unit-tests.mdc (globs: *Test.java, *Tests.java) - Add app/server/CLAUDE.md for Claude Code users - Remove performance-optimizer.mdc (verbose JS pseudocode, generic advice) - Remove pre-commit-checks.mdc (referenced wrong build tools, Husky handles this) - Remove test-generator.mdc (generic test plan generator, replaced by concrete patterns) Backend rules cover: CE-EE 3-tier service pattern, feature flags via AOP, reactive patterns, controller/repository/domain conventions, build commands, and test infrastructure (embedded MongoDB, Testcontainers Redis, env setup).
- Add .ai/rules/frontend/react-typescript-conventions.md (shared content) - Add .ai/rules/frontend/client-unit-tests.md (shared content) - Add .ai/rules/e2e/cypress-conventions.md (shared content) - Add .cursor/rules/frontend-react.mdc (globs: app/client/src/**/*.ts,*.tsx) - Add .cursor/rules/client-unit-tests.mdc (globs: **/*.test.ts,*.test.tsx) - Add .cursor/rules/cypress-tests.mdc (globs: app/client/cypress/**) - Add app/client/CLAUDE.md for Claude Code users - Add app/client/cypress/CLAUDE.md for Claude Code users Frontend rules cover: CE-EE import pattern, Redux handler-map pattern, styled-components, ESLint rules (named useEffect, objectKeys, jsx-sort-props), Jest + RTL + MSW testing patterns, Cypress page objects, selector strategy, testIsolation:false numbered it blocks, and DSL fixture loading.
…d workflow-ci rule - Add .ai/rules/verification/bug-fix-checklist.md (shared content) - Add .ai/rules/verification/feature-checklist.md (shared content) - Add .cursor/rules/bug-fix-verification.mdc (description-based, loaded when fixing bugs) - Add .cursor/rules/feature-verification.mdc (description-based, loaded for feature work) - Add .cursor/rules/workflow-ci.mdc (globs: .github/workflows/**/*.yml) - Remove bug-fix-verifier.mdc (716 lines JS pseudocode → 30 lines checklist) - Remove feature-verifier.mdc (627 lines JS pseudocode → 50 lines checklist) - Remove feature-implementation-validator.mdc (743 lines JS pseudocode, merged into feature checklist) - Remove workflow-validator.mdc (252 lines JS pseudocode → 30 lines concise) Verification rules now use description-based auto-attach instead of alwaysApply, so they only load when the conversation is about bug fixes or feature development.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
WalkthroughThis PR replaces Appsmith's Cursor automation rules with comprehensive documentation files (CLAUDE.md) that establish development conventions, including CE-EE three-tier architecture patterns, backend/frontend/testing standards, and CI/CD workflows. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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: 11
🧹 Nitpick comments (8)
.ai/rules/e2e/cypress-conventions.md (1)
20-34: Optional: Add language identifier to code block.Markdownlint warns that the fenced code block (directory tree) should have a language specified. Consider adding
textorplaintextafter the opening backticks to silence the linter.Suggested fix
-``` +```text app/client/cypress/ ├── e2e/🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.ai/rules/e2e/cypress-conventions.md around lines 20 - 34, The fenced code block that contains the directory tree lacks a language identifier and triggers markdownlint; update the opening fence (the ``` before the directory tree) to include a language such as text or plaintext (e.g., change ``` to ```text) so the block is lint-clean while leaving the tree content unchanged..cursor/rules/feature-verification.mdc (1)
6-53: Convert this to a thin wrapper over the shared checklist.The body duplicates
.ai/rules/verification/feature-checklist.md, which creates avoidable maintenance drift across rule systems.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.cursor/rules/feature-verification.mdc around lines 6 - 53, Replace the duplicated checklist body in .cursor/rules/feature-verification.mdc (the "# Feature Implementation Checklist" section) with a thin wrapper that includes or redirects to the single source of truth (.ai/rules/verification/feature-checklist.md); remove all checklist bullet duplication and leave only a one-line include/redirect so this file references the shared checklist, keeping the same header or a short note that it delegates to the shared file..cursor/rules/bug-fix-verification.mdc (1)
6-36: Prefer thin wrapper here to avoid doc drift.Line 6 onward duplicates the shared checklist content already present in
.ai/rules/verification/bug-fix-checklist.md. Keeping full copies in both places will drift over time; make this.mdca lightweight wrapper/reference to the shared source.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.cursor/rules/bug-fix-verification.mdc around lines 6 - 36, The file duplicates the full checklist starting at the header "# Bug Fix Verification Checklist"; replace the duplicated content with a thin wrapper that preserves the header and includes/points to the single source of truth (the shared bug-fix-checklist.md) instead of copying all items, so future changes won’t drift—locate the block under the "# Bug Fix Verification Checklist" heading in .cursor/rules/bug-fix-verification.mdc and replace the body with a short reference line (or include directive) that points to the shared bug-fix-checklist.md..cursor/rules/project-conventions.mdc (1)
6-89: Use a single source of truth for project conventions.This wrapper currently duplicates the shared doc content in
.ai/rules/global/project-conventions.md. Please convert to a pointer/thin summary to keep updates centralized.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.cursor/rules/project-conventions.mdc around lines 6 - 89, The "Appsmith Project Conventions" file duplicates the canonical project-conventions doc; replace the full duplicated content in this document with a short one-paragraph pointer that says "This file is a thin summary — see the canonical 'project-conventions' document in the global rules repo for the authoritative version" (include a relative reference to that canonical doc name), and remove all duplicated sections (Codebase Structure, CE-EE Architecture, Backend/Frontend patterns, Git & PR Conventions, Automation, Build & Verify) so updates are centralized; ensure the file still contains a brief summary line and a link/reference to the single source of truth and run the usual lint/format checks after the change.app/server/CLAUDE.md (1)
12-16: Add fence language for the inheritance block (MD040).Line 12 has an unlabeled fenced code block; add
textfor lint/tooling consistency.Suggested markdown diff
-``` +```text Interface: ServiceCE → ServiceCECompatible → Service Impl: ServiceCEImpl → ServiceCECompatibleImpl → ServiceImpl (`@Service`) Package: com.x.services.ce com.x.services.ce_compatible com.x.services</details> <details> <summary>🤖 Prompt for AI Agents</summary>Verify each finding against the current code and only fix it if needed.
In
@app/server/CLAUDE.mdaround lines 12 - 16, The unlabeled fenced code block
in CLAUDE.md (the three-line inheritance matrix starting with "Interface:
ServiceCE → ServiceCECompatible → Service") needs an explicit fence language to
satisfy MD040; modify the opening backticks of that block to include the
language label text (i.e., changetotext) so the block is labeled and
tooling/linting will accept it.</details> </blockquote></details> <details> <summary>.ai/rules/backend/java-spring-conventions.md (2)</summary><blockquote> `128-128`: **Prefer “5 min” over “5min” for readability/consistency.** Line 128 uses “5min”; use “5 min”. <details> <summary>🤖 Prompt for AI Agents</summary> ``` Verify each finding against the current code and only fix it if needed. In @.ai/rules/backend/java-spring-conventions.md at line 128, Update the documentation entry for the annotation `@DistributedLock` to use a space in the TTL description: replace the string "5min" with "5 min" so the line reads "Distributed lock with TTL (default 5 min)" for consistency and readability. ``` </details> --- `12-18`: **Specify languages for fenced blocks (MD040).** Unlabeled code fences at Line 12, Line 26, and Line 47 trigger markdownlint warnings. <details> <summary>Suggested markdown diff</summary> ```diff -``` +```text appsmith-server/ — Main server module (controllers, services, repositories, domains) ... ``` -``` +```text Interface: ServiceCE → ServiceCECompatible → Service ... ``` -``` +```text CE class (in controllers/ce/): All endpoint logic, NOT annotated as `@RestController` ... ``` ``` </details> Also applies to: 26-30, 47-50 <details> <summary>🤖 Prompt for AI Agents</summary>Verify each finding against the current code and only fix it if needed.
In @.ai/rules/backend/java-spring-conventions.md around lines 12 - 18, The
markdown has unlabeled fenced code blocks (around the module list
"appsmith-server/ — Main server module...", the mapping block starting
"Interface: ServiceCE → ServiceCECompatible → Service", and the CE class note
"CE class (in controllers/ce/): All endpoint logic..."); fix by adding a
language label (e.g., ```text) to each of those fenced blocks so markdownlint
MD040 is satisfied, updating the three blocks containing the module list, the
Interface mapping, and the CE class note accordingly.</details> </blockquote></details> <details> <summary>.cursor/rules/backend-java.mdc (1)</summary><blockquote> `17-23`: **Add languages to fenced code blocks to satisfy markdownlint.** Lines 17, 31, and 52 use unlabeled fenced blocks; this triggers MD040 and reduces readability/tooling support. <details> <summary>Suggested markdown diff</summary> ```diff -``` +```text appsmith-server/ — Main server module (controllers, services, repositories, domains) appsmith-interfaces/ — Shared contracts (models, exceptions, plugin interfaces) appsmith-plugins/ — 25+ database/API connector plugins appsmith-git/ — Git integration module reactive-caching/ — Custom reactive caching framework ``` -``` +```text Interface: ServiceCE → ServiceCECompatible → Service Impl: ServiceCEImpl → ServiceCECompatibleImpl → ServiceImpl (`@Service`) Package: com.x.services.ce com.x.services.ce_compatible com.x.services ``` -``` +```text CE class (in controllers/ce/): All endpoint logic, NOT annotated as `@RestController` EE class (in controllers/): `@RestController` + `@RequestMapping`, empty body, extends CE ``` ``` </details> Also applies to: 31-35, 52-55 <details> <summary>🤖 Prompt for AI Agents</summary>Verify each finding against the current code and only fix it if needed.
In @.cursor/rules/backend-java.mdc around lines 17 - 23, The three unlabeled
fenced code blocks containing the directory list (starting with
"appsmith-server/"), the interface/impl/package mapping (starting with
"Interface: ServiceCE"), and the controller notes (starting with "CE class (in
controllers/ce/)") should be updated to include a language tag (e.g., text)
after the opening triple backticks; locate the three blocks and change ``` tothese plain-text blocks.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.ai/rules/backend/java-spring-conventions.md:
- Around line 34-38: The rule about `@Service`/`@Component` placement is out of
sync with the codebase—update the convention text to reflect that `@Service` is
present on CE and CE-Compatible classes (e.g.,
ApplicationServiceCECompatibleImpl) or explicitly state a migration plan to move
annotations to only final `*Impl` classes; modify the doc lines describing
"`@Service` / `@Component` annotation **only** on the final `*Impl` class", the
bullets referencing "CE impl" and "CE-Compatible", and add a clear note about
current practice vs. intended future changes (or steps to migrate) so readers
know whether CE/CE-Compatible classes are allowed to be annotated now or must be
changed.
In @.ai/rules/backend/server-unit-tests.md:
- Around line 56-71: The test SomeServiceUnitTest incorrectly uses `@MockBean`
with only `@ExtendWith`(SpringExtension.class); either convert this to a pure unit
test by replacing `@MockBean` on dependencyService with Mockito's `@Mock` and
annotate the system under test (serviceUnderTest) with `@InjectMocks` (or
constructor-inject a mocked dependency) so Mockito initializes mocks, or turn it
into a Spring Boot slice/integration test by adding a Spring test annotation
such as `@SpringBootTest` or an appropriate test slice (e.g., `@WebMvcTest`) and
keep `@MockBean`; update imports accordingly and ensure initialization
(MockitoExtension or Spring context) matches the chosen approach.
In @.ai/rules/frontend/client-unit-tests.md:
- Around line 126-128: The example import uses the wrong module for the exported
symbol "server" (it imports from "test/__mocks__/server"); update the import
statement that brings in "server" (the same line that imports "rest" from "msw")
to reference the repository's shared test setup module that actually exports the
server so the example matches the real setup and copy-paste will work.
- Around line 7-8: Replace any uses and documentation referencing the deprecated
package `@testing-library/react-hooks` so that renderHook (and act where used
together) are imported from `@testing-library/react`; specifically update the doc
bullets that mention hook testing to state renderHook comes from
`@testing-library/react` and change any import statements like import {
renderHook, act } from "@testing-library/react-hooks" to import { renderHook,
act } from "@testing-library/react" (search for renderHook and act to locate all
occurrences).
In @.ai/rules/global/project-conventions.md:
- Around line 34-37: The fenced code block containing the diagram "Interface:
ServiceCE → ServiceCECompatible → Service / Impl: ServiceCEImpl →
ServiceCECompatibleImpl → ServiceImpl (`@Service`)" lacks a language tag; update
that block to include a language identifier (e.g., add "text" after the opening
``` so it becomes ```text) so it satisfies MD040, referring to the symbols
ServiceCE, ServiceCECompatible, Service, ServiceCEImpl, ServiceCECompatibleImpl,
and ServiceImpl in the annotated block.
In @.cursor/rules/backend-java.mdc:
- Around line 39-43: The rule doc currently mandates that
`@Service`/`@Component` be placed only on final `*Impl` classes, which
contradicts existing CE-compatible classes that are annotated (e.g.,
ApplicationServiceCECompatibleImpl); update the guideline text in
`.cursor/rules/backend-java.mdc` to allow `@Service`/`@Component` on
CE-Compatible classes (such as ApplicationServiceCECompatibleImpl) or explicitly
document the accepted exception for CE-Compatible classes, and adjust the
bullets referring to CE impl and final `*Impl` behavior so they no longer
require removing annotations from CE-Compatible classes.
In @.cursor/rules/commit-conventions.mdc:
- Around line 24-30: Update the “Pre-commit Checks (Automatic via Husky)”
section to reflect the conditional behavior implemented in
app/client/.husky/check-staged-files.sh: rephrase the three bullets to start
with "When server files are staged → mvn spotless:apply runs" and "When client
files are staged → eslint --fix --cache + prettier --write --cache (via
lint-staged) runs", and keep "All files → gitleaks secret scanning runs"; also
mention that both formatting steps are skipped during merge commits. Ensure the
commands include the --cache flags and reference the actual commands (mvn
spotless:apply, eslint --fix --cache, prettier --write --cache, gitleaks) so the
doc matches the script behavior.
In @.cursor/rules/server-unit-tests.mdc:
- Around line 62-66: Replace the Spring-based mock setup in SomeServiceUnitTest:
remove `@MockBean` and the SpringExtension and instead use
`@ExtendWith`(MockitoExtension.class) at the class level, annotate
DependencyService with `@Mock` and add an `@InjectMocks` field for the service under
test (SomeService) so tests run as lightweight Mockito unit tests without
loading a Spring context.
In @.cursor/rules/workflow-ci.mdc:
- Around line 31-38: The sequence of repeated cd commands (e.g., "cd app/server
&& mvn spotless:check" and later "cd app/server && mvn test", and similarly for
"cd app/client && yarn ...") makes the block unsafe to copy-paste into a single
shell session; change each line to run in an isolated subshell or use pushd/popd
so path changes don't affect subsequent lines — for example replace lines like
"cd app/server && mvn spotless:check" with "(cd app/server && mvn
spotless:check)" or wrap server commands into a single subshell "(cd app/server
&& mvn spotless:check && mvn test)" and client commands into "(cd app/client &&
yarn lint && yarn prettier && yarn test:unit && yarn check-types)" to ensure
safe, idempotent execution.
- Line 13: Update the documentation text that currently lists required top-level
keys to correctly state that only `on` and `jobs` are required (the `name` key
is optional); locate the line mentioning "Required top-level keys: `name`, `on`,
`jobs`" and edit it to "Required top-level keys: `on`, `jobs`".
In `@app/server/CLAUDE.md`:
- Around line 18-22: Update the guidance so it reflects the actual backend
convention: allow `@Service` / `@Component` on CE-Compatible implementations as
well as on the final `*Impl` classes (i.e., remove the absolute "only"
restriction), keep the constructor-based DI recommendation
(`@RequiredArgsConstructor`) and the CE/EE layering rules, and explicitly state
that CE-Compatible implementations may carry `@Service`/`@Component` annotations
in the server codebase; revise the sentence that currently forbids annotations
on CE-Compatible classes to this corrected wording mentioning `@Service`,
`@Component`, "CE-Compatible", and final `*Impl`.
---
Nitpick comments:
In @.ai/rules/backend/java-spring-conventions.md:
- Line 128: Update the documentation entry for the annotation `@DistributedLock`
to use a space in the TTL description: replace the string "5min" with "5 min" so
the line reads "Distributed lock with TTL (default 5 min)" for consistency and
readability.
- Around line 12-18: The markdown has unlabeled fenced code blocks (around the
module list "appsmith-server/ — Main server module...", the mapping block
starting "Interface: ServiceCE → ServiceCECompatible → Service", and the CE
class note "CE class (in controllers/ce/): All endpoint logic..."); fix by
adding a language label (e.g., ```text) to each of those fenced blocks so
markdownlint MD040 is satisfied, updating the three blocks containing the module
list, the Interface mapping, and the CE class note accordingly.
In @.ai/rules/e2e/cypress-conventions.md:
- Around line 20-34: The fenced code block that contains the directory tree
lacks a language identifier and triggers markdownlint; update the opening fence
(the ``` before the directory tree) to include a language such as text or
plaintext (e.g., change ``` to ```text) so the block is lint-clean while leaving
the tree content unchanged.
In @.cursor/rules/backend-java.mdc:
- Around line 17-23: The three unlabeled fenced code blocks containing the
directory list (starting with "appsmith-server/"), the interface/impl/package
mapping (starting with "Interface: ServiceCE"), and the controller notes
(starting with "CE class (in controllers/ce/)") should be updated to include a
language tag (e.g., text) after the opening triple backticks; locate the three
blocks and change ``` to ```text so markdownlint MD040 is satisfied and tooling
can correctly recognize these plain-text blocks.
In @.cursor/rules/bug-fix-verification.mdc:
- Around line 6-36: The file duplicates the full checklist starting at the
header "# Bug Fix Verification Checklist"; replace the duplicated content with a
thin wrapper that preserves the header and includes/points to the single source
of truth (the shared bug-fix-checklist.md) instead of copying all items, so
future changes won’t drift—locate the block under the "# Bug Fix Verification
Checklist" heading in .cursor/rules/bug-fix-verification.mdc and replace the
body with a short reference line (or include directive) that points to the
shared bug-fix-checklist.md.
In @.cursor/rules/feature-verification.mdc:
- Around line 6-53: Replace the duplicated checklist body in
.cursor/rules/feature-verification.mdc (the "# Feature Implementation Checklist"
section) with a thin wrapper that includes or redirects to the single source of
truth (.ai/rules/verification/feature-checklist.md); remove all checklist bullet
duplication and leave only a one-line include/redirect so this file references
the shared checklist, keeping the same header or a short note that it delegates
to the shared file.
In @.cursor/rules/project-conventions.mdc:
- Around line 6-89: The "Appsmith Project Conventions" file duplicates the
canonical project-conventions doc; replace the full duplicated content in this
document with a short one-paragraph pointer that says "This file is a thin
summary — see the canonical 'project-conventions' document in the global rules
repo for the authoritative version" (include a relative reference to that
canonical doc name), and remove all duplicated sections (Codebase Structure,
CE-EE Architecture, Backend/Frontend patterns, Git & PR Conventions, Automation,
Build & Verify) so updates are centralized; ensure the file still contains a
brief summary line and a link/reference to the single source of truth and run
the usual lint/format checks after the change.
In `@app/server/CLAUDE.md`:
- Around line 12-16: The unlabeled fenced code block in CLAUDE.md (the
three-line inheritance matrix starting with "Interface: ServiceCE →
ServiceCECompatible → Service") needs an explicit fence language to satisfy
MD040; modify the opening backticks of that block to include the language label
text (i.e., change ``` to ```text) so the block is labeled and tooling/linting
will accept 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 2d4b5e2b-1161-4ba8-bb99-be671ff36f9b
📒 Files selected for processing (33)
.ai/rules/backend/java-spring-conventions.md.ai/rules/backend/server-unit-tests.md.ai/rules/e2e/cypress-conventions.md.ai/rules/frontend/client-unit-tests.md.ai/rules/frontend/react-typescript-conventions.md.ai/rules/global/project-conventions.md.ai/rules/verification/bug-fix-checklist.md.ai/rules/verification/feature-checklist.md.cursor/rules/backend-java.mdc.cursor/rules/bug-fix-verification.mdc.cursor/rules/client-unit-tests.mdc.cursor/rules/commit-conventions.mdc.cursor/rules/commit/semantic-pr-validator.mdc.cursor/rules/cypress-tests.mdc.cursor/rules/feature-verification.mdc.cursor/rules/frontend-react.mdc.cursor/rules/index.mdc.cursor/rules/project-conventions.mdc.cursor/rules/quality/performance-optimizer.mdc.cursor/rules/quality/pre-commit-checks.mdc.cursor/rules/quality/react-hook-best-practices.mdc.cursor/rules/server-unit-tests.mdc.cursor/rules/task-list.mdc.cursor/rules/testing/test-generator.mdc.cursor/rules/verification/bug-fix-verifier.mdc.cursor/rules/verification/feature-implementation-validator.mdc.cursor/rules/verification/feature-verifier.mdc.cursor/rules/verification/workflow-validator.mdc.cursor/rules/workflow-ci.mdcCLAUDE.mdapp/client/CLAUDE.mdapp/client/cypress/CLAUDE.mdapp/server/CLAUDE.md
💤 Files with no reviewable changes (11)
- .cursor/rules/quality/react-hook-best-practices.mdc
- .cursor/rules/index.mdc
- .cursor/rules/task-list.mdc
- .cursor/rules/verification/workflow-validator.mdc
- .cursor/rules/quality/pre-commit-checks.mdc
- .cursor/rules/quality/performance-optimizer.mdc
- .cursor/rules/verification/feature-verifier.mdc
- .cursor/rules/verification/feature-implementation-validator.mdc
- .cursor/rules/verification/bug-fix-verifier.mdc
- .cursor/rules/testing/test-generator.mdc
- .cursor/rules/commit/semantic-pr-validator.mdc
| import { rest } from "msw"; | ||
| import { server } from "test/__mocks__/server"; | ||
|
|
There was a problem hiding this comment.
MSW server import path in example appears inconsistent with repo setup.
Line 127 imports server from test/__mocks__/server, but the shared setup exports server from app/client/test/setup.ts. Please align the example import to avoid copy-paste failures.
Suggested markdown diff
-import { server } from "test/__mocks__/server";
+import { server } from "test/setup";🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.ai/rules/frontend/client-unit-tests.md around lines 126 - 128, The example
import uses the wrong module for the exported symbol "server" (it imports from
"test/__mocks__/server"); update the import statement that brings in "server"
(the same line that imports "rest" from "msw") to reference the repository's
shared test setup module that actually exports the server so the example matches
the real setup and copy-paste will work.
.cursor/rules/workflow-ci.mdc
Outdated
| When editing workflow files, ensure: | ||
|
|
||
| - Valid YAML syntax | ||
| - Required top-level keys: `name`, `on`, `jobs` |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
In GitHub Actions workflow syntax, are name, on, and jobsall required keys, or isname optional?
💡 Result:
In GitHub Actions workflow syntax, name is optional, while on and jobs are required keys. The official GitHub documentation explicitly states that the name key is optional: "If you omit name, GitHub displays the workflow file path relative to the root of the repository." All examples in the docs include name, but its omission is supported and falls back to the file path. on is required to define workflow triggers, as workflows must specify events or conditions to run. Without it, the workflow cannot be triggered. jobs is required, as a workflow consists of one or more jobs; without jobs, there is no executable content. Minimal valid workflow (name omitted): on: [push] jobs: example: runs-on: ubuntu-latest steps: - run: echo "Hello" Validation tools and schema checkers confirm name is not mandatory in the workflow YAML schema.
Citations:
- 1: https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions
- 2: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
- 3: https://docs.github.com/actions/reference/workflow-syntax-for-github-actions
- 4: https://docs.github.com/en/actions/tutorials/create-an-example-workflow
- 5: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions
- 6: https://docs.github.com/en/actions/writing-workflows/quickstart
- 7: https://github.com/actions/starter-workflows/blob/main/ci/blank.yml
- 8: https://docs.github.com/en/actions/reference/github_token-reference
- 9: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/using-jobs-in-a-workflow
- 10: https://docs.github.com/actions/using-jobs/using-jobs-in-a-workflow
- 11: https://github.com/mpalmer/action-validator
- 12: Workflow schema validation to the validate script actions/starter-workflows#1014
Line 13 incorrectly lists name as a required top-level key.
Per GitHub Actions documentation, name is optional—GitHub defaults to displaying the workflow file path if omitted. Only on and jobs are required. Update line 13 to reflect this.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.cursor/rules/workflow-ci.mdc at line 13, Update the documentation text that
currently lists required top-level keys to correctly state that only `on` and
`jobs` are required (the `name` key is optional); locate the line mentioning
"Required top-level keys: `name`, `on`, `jobs`" and edit it to "Required
top-level keys: `on`, `jobs`".
| cd app/server && mvn spotless:check # Formatting | ||
| cd app/server && mvn test # Unit tests | ||
|
|
||
| # Client | ||
| cd app/client && yarn lint # ESLint | ||
| cd app/client && yarn prettier # Prettier | ||
| cd app/client && yarn test:unit # Jest | ||
| cd app/client && yarn check-types # TypeScript |
There was a problem hiding this comment.
Local run commands are not safely copy-pasteable in one shell session.
Line 31-38 repeats cd into the same directory, so running the block top-to-bottom can break path resolution (for example, second cd app/server).
Suggested doc fix
# Server
-cd app/server && mvn spotless:check # Formatting
-cd app/server && mvn test # Unit tests
+(cd app/server && mvn spotless:check) # Formatting
+(cd app/server && mvn test) # Unit tests
# Client
-cd app/client && yarn lint # ESLint
-cd app/client && yarn prettier # Prettier
-cd app/client && yarn test:unit # Jest
-cd app/client && yarn check-types # TypeScript
+(cd app/client && yarn lint) # ESLint
+(cd app/client && yarn prettier) # Prettier
+(cd app/client && yarn test:unit) # Jest
+(cd app/client && yarn check-types) # TypeScript📝 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.
| cd app/server && mvn spotless:check # Formatting | |
| cd app/server && mvn test # Unit tests | |
| # Client | |
| cd app/client && yarn lint # ESLint | |
| cd app/client && yarn prettier # Prettier | |
| cd app/client && yarn test:unit # Jest | |
| cd app/client && yarn check-types # TypeScript | |
| cd app/server && mvn spotless:check # Formatting | |
| cd app/server && mvn test # Unit tests | |
| # Client | |
| (cd app/client && yarn lint) # ESLint | |
| (cd app/client && yarn prettier) # Prettier | |
| (cd app/client && yarn test:unit) # Jest | |
| (cd app/client && yarn check-types) # TypeScript |
| cd app/server && mvn spotless:check # Formatting | |
| cd app/server && mvn test # Unit tests | |
| # Client | |
| cd app/client && yarn lint # ESLint | |
| cd app/client && yarn prettier # Prettier | |
| cd app/client && yarn test:unit # Jest | |
| cd app/client && yarn check-types # TypeScript | |
| # Server | |
| (cd app/server && mvn spotless:check) # Formatting | |
| (cd app/server && mvn test) # Unit tests | |
| # Client | |
| (cd app/client && yarn lint) # ESLint | |
| (cd app/client && yarn prettier) # Prettier | |
| (cd app/client && yarn test:unit) # Jest | |
| (cd app/client && yarn check-types) # TypeScript |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.cursor/rules/workflow-ci.mdc around lines 31 - 38, The sequence of repeated
cd commands (e.g., "cd app/server && mvn spotless:check" and later "cd
app/server && mvn test", and similarly for "cd app/client && yarn ...") makes
the block unsafe to copy-paste into a single shell session; change each line to
run in an isolated subshell or use pushd/popd so path changes don't affect
subsequent lines — for example replace lines like "cd app/server && mvn
spotless:check" with "(cd app/server && mvn spotless:check)" or wrap server
commands into a single subshell "(cd app/server && mvn spotless:check && mvn
test)" and client commands into "(cd app/client && yarn lint && yarn prettier &&
yarn test:unit && yarn check-types)" to ensure safe, idempotent execution.
- Fix @service annotation rule: CE-Compatible classes also carry @service, not just final *Impl (verified against ApplicationServiceCECompatibleImpl) - Fix unit test mock pattern: use MockitoExtension/@Mock/@Injectmocks instead of SpringExtension/@MockBean (which requires Spring Boot context) - Fix deprecated @testing-library/react-hooks: use @testing-library/react for renderHook (deprecated since RTL v14) - Fix GitHub Actions: name is optional, only on and jobs are required - Clarify pre-commit checks: add --cache flags, lint-staged mention, note that merge commits skip formatting - Add text language tags to all unlabeled fenced code blocks (MD040) - Fix "5min" → "5 min" spacing in @distributedlock description
The .ai/rules/ directory was intended as a single source of truth for both Cursor and Claude rules, but neither platform can reference external files — both require inline content. The directory served no runtime purpose and only added maintenance overhead. Cursor rules live in .cursor/rules/*.mdc, Claude rules in CLAUDE.md files. These are the actual sources each platform reads.
Replace flat checklist with sequenced TDD approach: 1. Understand → 2. Write failing test → 3. Verify RED → 4. Implement fix → 5. Verify GREEN → 6. Sanity check Key changes: - Agent must verify test FAILS before writing fix code - Agent must verify same test PASSES after fix - Regression check is targeted (same package/module tests), not full suite — full regression delegated to CI
Description
Restructures the
.cursor/rules/configuration to reduce context bloat, improve signal-to-noise for AI agents, and add cross-platform support for both Cursor and Claude Code users.Problem
.mdcrule files usedalwaysApply: true, injecting ~11-14K tokens into every AI conversation regardless of contextyarn check-circular-deps)CLAUDE.mdfiles)react-hook-best-practices.mdcwas empty,task-list.mdchad no frontmatter)Solution
Tiered rule loading replaces the "load everything always" approach:
alwaysApply: trueproject-conventions,commit-conventionsglobsbackend-java,server-unit-tests,frontend-react,client-unit-tests,cypress-tests,workflow-cidescriptionbug-fix-verification,feature-verificationShared content library (
.ai/rules/) serves as the single source of truth, with platform-specific wrappers:.cursor/rules/*.mdcfiles with Cursor-specific targeting metadata (globs,description)CLAUDE.mdfiles at root,app/server/,app/client/, andapp/client/cypress/for Claude CodeComprehensive coding conventions now cover:
@FeatureFlaggedAOP dispatchee/only, neverce/), Redux handler-map, styled-components, ESLint rulest--selector strategy,testIsolation: falsenumbereditblocks, DSL fixturesImpact
CLAUDE.mdfilesFiles changed
Added:
.ai/rules/— 8 shared content files (global, backend, frontend, e2e, verification).cursor/rules/— 10 new targeted.mdcrulesCLAUDE.md— root +app/server/+app/client/+app/client/cypress/Removed:
.cursor/rules/index.mdc— verbose master entry with JS pseudocode.cursor/rules/commit/semantic-pr-validator.mdc— 174 lines of JS → 30 lines prose.cursor/rules/task-list.mdc— broken (no frontmatter).cursor/rules/quality/react-hook-best-practices.mdc— empty file.cursor/rules/quality/performance-optimizer.mdc— 358 lines generic JS pseudocode.cursor/rules/quality/pre-commit-checks.mdc— referenced wrong build tools.cursor/rules/testing/test-generator.mdc— 295 lines generic test generator.cursor/rules/verification/bug-fix-verifier.mdc— 717 lines JS → 30 lines checklist.cursor/rules/verification/feature-verifier.mdc— 628 lines JS → merged into feature checklist.cursor/rules/verification/feature-implementation-validator.mdc— 744 lines JS → merged.cursor/rules/verification/workflow-validator.mdc— 253 lines JS → 39 lines conciseFixes https://linear.app/appsmith/issue/APP-15062/optimize-ai-rules-and-conventions-for-cursor-and-claude-code
Automation
/ok-to-test tags=""
🔍 Cypress test results
Warning
Tests have not run on the HEAD 0636337 yet
Mon, 30 Mar 2026 07:10:30 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
Documentation
Added comprehensive development guidelines establishing standardized practices for backend services, frontend components, testing strategies, and feature implementation workflows to improve code consistency and contributor clarity.
Reorganized verification and automation rules to consolidate and refine CI/CD workflows, commit conventions, and pre-commit quality checks.
Removed standalone verification automation modules in favor of documented checklists and manual verification workflows for improved transparency and control.