backend
免费Backend Java — Spring Boot controllers/services, JUnit controller tests, MakeMe. Read this first for any backend work. Use when working on the Java Spring backend.
中文简介正在准备中。当前显示原文说明。
Linting, formatting, code quality, Biome (2.6.x), Redocly, OpenAPI validation, code style, fix formatting errors, biome.json config, Vue SFC project-domain rule limitation, multi-file analysis (MFA). Use when linting, formatting, Biome, or OpenAPI validation.
中文简介正在准备中。当前显示原文说明。
实测评分 未实测
查看安装方法安装前可以查看交给 AI 代理的指令内容。
Use this rule when:
This project uses multiple linting tools to ensure code quality:
packages/donut-test-fixtures, Cypress, and other root-level TypeScript/JavaScript codeIMPORTANT: Linting is primarily for CI/CD validation. During development, format changed components explicitly before staging; the pre-commit hook only validates staged components and never formats or stages files.
Run commands from the repo root through Nix.
CURSOR_DEV=true nix develop -c pnpm lint:all
This runs:
pnpm backend:lint)pnpm frontend:lint)pnpm cli:lint)packages/donut-test-fixtures) via Biome (pnpm test-fixtures:lint)pnpm cy:lint)pnpm openapi:lint)pnpm backend:lint - Java code lintingpnpm frontend:lint - Frontend TypeScript/Vue lintingpnpm cli:lint - CLI TypeScript lintingpnpm test-fixtures:lint - Biome on packages/donut-test-fixtures onlypnpm cy:lint - Cypress E2E test lintingpnpm openapi:lint - OpenAPI spec validation./scripts/run.sh pnpm format:changed before staging — it selects
affected components from staged, unstaged, and nonignored untracked paths,
then applies their formatter commands. During slice wrap-up, the coordinator
runs it once after refactor/API generation and before the PLAN update; it does
not pre-filter paths or spawn a formatting agent. Repeat only after an
intervening repair invalidates that preparation. The format-changed skill
remains available for explicit on-demand use.CURSOR_DEV=true nix develop -c pnpm format:all only when intentionally
formatting the entire repository.pnpm lint:changed against affected staged
components. It is check-only: it does not format files or mutate the Git
index. Implementers and refactorers do not run format:changed or standalone
lint:changed; the coordinator owns formatting and the hook owns the
independent lint check. When a selected component needs workspace tools, the
hook first validates one installation through setup_pnpm_deps
(scripts/dev_setup.sh) with a frozen lockfile and the checks reuse it; a
manifest change missing from pnpm-lock.yaml fails with
ERR_PNPM_OUTDATED_LOCKFILE (run pnpm install and stage the lockfile).
The frontend check reads the committed (index) content from a temporary copy,
so unrelated unstaged or untracked work does not affect it. The copy reuses
the checkout's node_modules, so workspace packages linked there (such as
donut-test-fixtures) are still read from the working tree; its vue-tsc
run makes a frontend commit take roughly 8 s, other components about 1–2 s.
Other components still check the working tree. To measure the hook, run
bash scripts/profiling/profile-commit-hook.sh baseline <evidence-dir>
outside Nix: it times the fixed 40-change corpus in a disposable worktree
at the committed HEAD.CURSOR_DEV=true nix develop -c pnpm lint:all for CI/CD validation only — it checks without fixing (plus a few script unit tests that format does not run).The OpenAPI specification (open_api_docs.yaml) is validated using Redocly CLI. This file is auto-generated from backend controllers.
open_api_docs.yaml directly - it is auto-generatedCURSOR_DEV=true nix develop -c pnpm generateTypeScript
This runs OpenAPI generation from Spring controllers (pnpm backend:generateOpenAPIDocs) and TypeScript client generation from the spec (pnpm openAPIToTypeScript).pnpm openapi:lint again@Operation(operationId = "...") annotation or unique method name@PathVariable annotation to method parameters that match path variables{notebook} consistently, not {notebookId} in some places)After API changes, also run frontend unit tests and fix call sites — see the generate-api-client skill.
biome.json (root) and frontend/biome.jsonredocly.yamlbackend/build.gradle (Spotless for formatting, custom linting rules)This project uses @biomejs/biome@2.6.x across the workspace (package.json, frontend/package.json, packages/donut-test-fixtures/package.json). Keep those versions pinned and in sync — syncpack fix runs on postinstall to help.
biome.json (workspace root) — governs e2e_test/, cli/, mcp-server/, scripts/, infra/, packages/donut-test-fixtures/, etc. Implicit root: true.frontend/biome.json — sets "root": false; governs frontend/ only. Uses Vue-specific rules (noVueReservedProps, noVueDuplicateKeys, noVueSetupPropsReactivityLoss, etc.).When running pnpm biome check from the workspace root, Biome walks up from each file to find the nearest config. The frontend subtree uses the frontend config; everything else uses the root config.
$schema URL in sync with the CLI versionBoth configs must pin $schema to the exact CLI version. A mismatch emits a deserialize warning on every run:
i The configuration schema version does not match the CLI version 2.6.x
When upgrading @biomejs/biome, run pnpx @biomejs/biome migrate --write from both the repo root and frontend/ to bump the schema URLs (and auto-apply any rule renames / config restructuring).
biome migrate suggesting root: false in the root configRunning biome migrate from inside frontend/ sometimes suggests adding "root": false to the workspace root biome.json. Do not apply it. The workspace root must remain the root. This is a known artifact of the migrator walking up from a nested package.
files.includes, not separate linter.includesfiles.includes is the canonical include/exclude list; it scopes both formatter and linter.files.includes excludes *.yaml/*.yml: Biome 2.6+ formats YAML, which would rewrite tool-owned files (pnpm-lock.yaml, pnpm-workspace.yaml, generated open_api_docs.yaml).linter.includes and formatter.includes exist but further narrow each tool's scope and are easy to get wrong (and desynced from files.includes). Prefer files.includes plus scoped overrides when a specific tool needs different treatment.linter: { enabled: false } scoped via includes, e.g. for vitest.config.ts and src/assets/daisyui.css in frontend/biome.json. Do not rely on a hidden-in-linter.includes exclusion — that pattern is opaque.Biome 2.x introduces "project" / multi-file-analysis (MFA) rules that build a cross-file import graph. As of Biome 2.4.x, the MFA resolver does not understand Vue SFC <script setup> implicit default exports. Every import X from "./X.vue" in the frontend is flagged as unresolved once MFA activates.
Project-domain rules include (non-exhaustive):
correctness/noUnresolvedImportssuspicious/noDeprecatedImportssuspicious/noImportCyclescorrectness/noFloatingPromisescorrectness/noMisusedPromisescorrectness/noPrivateImportsRule: Do NOT enable any of these in the workspace root biome.json. Enabling them anywhere the project graph reaches Vue SFCs (which includes the root config, since it delegates to frontend/biome.json via MFA) produces 400+ false-positive noUnresolvedImports errors even in pure .ts files that import from .vue.
frontend/biome.json currently has noUnresolvedImports: "error". It is silently a no-op today because MFA is not activated (no project-domain rule is triggering it). If you add one of the rules above at the root, frontend:lint will break even though frontend/biome.json hasn't changed.cli/biome.json) — but test carefully, since MFA scope is workspace-wide.<script setup> default-export detection.noUnusedExpressions and Chai/Cypress assertionssuspicious/noUnusedExpressions is enabled at the root but turned off for e2e_test/**. Chai's property-chain assertions (e.g. expect(x).to.not.be.null, expect(x).to.be.true) look like unused expressions to Biome but are real assertions that throw. The override lives in the existing e2e_test block inside root biome.json.
Biome 2.x expects:
// biome-ignore lint/<GROUP>/<RULE>: reason
The 1.9.x form // biome-ignore lint(<GROUP>/<RULE>): reason no longer parses. biome migrate --write handles existing comments; new suppressions must use the slash form.
Bulk variants new in 2.x:
// biome-ignore-all lint/suspicious/noConsole: allowed in this file// biome-ignore-start lint/complexity/noForEach: legacy block// biome-ignore-end lint/complexity/noForEach:{ "includes": [], "linter": { "rules": {} } } and overrides whose rules object is empty do nothing and only obscure intent. Clean them up during any biome-config edit.
pnpm lint:all non-interactivelyThe lint:all script's first step is pnpm --frozen-lockfile --silent recursive install. Outside an interactive TTY, pnpm refuses to purge stale node_modules and aborts with:
ERR_PNPM_ABORTED_REMOVE_MODULES_DIR_NO_TTY
Export CI=true (or set "confirmModulesPurge": false in .npmrc) before running pnpm lint:all in agents / scripts / non-TTY shells. CI already sets CI=true.
The pnpm lint:all command is used in CI/CD pipelines to ensure code quality. All linting errors must be resolved before merging code.
还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
Backend Java — Spring Boot controllers/services, JUnit controller tests, MakeMe. Read this first for any backend work. Use when working on the Java Spring backend.
中文简介正在准备中。当前显示原文说明。
Backend Java production code, Spring Boot controllers/services/repositories, controller return values, imports, schema ERD pointer. Use when editing backend production Java.
中文简介正在准备中。当前显示原文说明。
Backend Java tests, controller-level stable-boundary tests, JUnit, @Nested, MakeMe builders, @Transactional, parameterized tests. Use when writing or changing backend JUnit tests.
中文简介正在准备中。当前显示原文说明。
related to donut CLI. Use when working on donut-cli.
中文简介正在准备中。当前显示原文说明。
Set up and run the Donut dev environment on Cursor Cloud VM (no Nix). Use when working on Cloud VM, running tests on Cloud VM, or encountering command errors related to missing nix. Triggers on: cloud VM, cloud agent, no nix available, /workspace path.
中文简介正在准备中。当前显示原文说明。
Regenerate docs/database-erd.md from MySQL information_schema (Mermaid ERD: foreign keys and key columns). Use after Flyway schema changes, new migrations, or when the diagram is stale. Triggers on: database ERD, database-erd.md, export_database_erd, schema diagram, ER diagram after migration.
中文简介正在准备中。当前显示原文说明。