从固定点(commit、branch、tag 或 merge-base)开始,沿两条轴线审查变更——规范(代码是否遵循仓库文档化的编码规范?)和规格(代码是否与原始 issue/PRD 的要求一致?)。两条审查线在并行子 agent 中运行,并以并排方式报告结果。当用户想审查一个分支、PR、进行中的变更,或要求"从 X 开始审查"时使用。
中文简介正在准备中。当前显示原文说明。
Use when working on AUTO-MAS frontend Vue, TypeScript, Vite, Electron renderer, routing, API composables, state, styles, forms, validation, or frontend verification tasks.
中文简介正在准备中。当前显示原文说明。
实测评分 未实测
查看安装方法安装前可以查看交给 AI 代理的指令内容。
Keep AUTO-MAS frontend changes aligned with the current Vue 3, TypeScript, Vite, Electron, Ant Design Vue, Vue Router, OpenAPI, ESLint, Prettier, and Yarn 4 project conventions.
frontend/ directory.yarn install by default.yarn cross-env ELECTRON_MIRROR="https://npmmirror.com/mirrors/electron/" yarn install.This skill is self-contained for frontend engineering rules. If local code differs from this summary, inspect neighboring implementations and prefer the current module pattern unless it violates a red line here.
Before editing frontend code:
mas-frontend-ui as a required companion for any UI, layout, component, form, table, modal, feedback, or visual-state change.| Code type | Place it here | Do not place it here |
|---|---|---|
| Route page | src/views/<module>/index.vue or src/views/Xxx.vue | src/components |
| Single-module component | src/views/<module>/components | src/components root |
| Cross-module component | src/components | Copied across page folders |
| Business API wrapper | src/composables/useXxxApi.ts | Vue page or src/api |
| Reusable page flow | src/views/<module>/useXxxLogic.ts or composable | Template expressions |
| Pure utility | src/utils | Copied inside components |
| Domain type | src/types or generated src/api/models | Repeated local component types |
| Shared reactive application state | src/stores with Pinia | Page-level localStorage access |
| Global style token | src/style.css or future src/styles | Repeated page-local variables |
| Global browser UI style such as scrollbars | src/styles, imported once by the renderer entry | Repeated component-level browser pseudo-elements |
| Electron capability | electron and preload types | Direct renderer Node access |
Use the narrowest module boundary first. Promote to shared directories only after real cross-module reuse.
<script setup lang="ts"> unless a compatibility reason exists.src/api.axios or fetch calls directly in Vue pages.src/api types and services through src/composables/useXxxApi.ts or module logic.response.code !== 200 as failure unless the local contract proves otherwise.HEAD requests are not precedent for backend business API calls.axios + OpenAPI.BASE URLs in composables either. If the endpoint is in the generated Service, call it; if it is missing, regenerate the client rather than bypass it.ApiError on non-2xx responses. Read the backend's message from error.body after narrowing it (instanceof ApiError, object check, typeof message === 'string'), then rethrow as Error. Wanting AxiosError.response.data is not a reason to skip the generated client. useMaaFWUpdateApi.ts and useHSRPluginApi.ts are the reference.MaaFWProjectUpdateIn.action.CHECK) instead of string literals cast to the request type.meta.title.navigateTo or navigateToByName; avoid scattered hardcoded paths.localStorage, and do not keep Pinia and localStorage as competing sources of truth.localStorage only for small, non-sensitive browser-local preferences that must survive application restarts and do not belong to Pinia, backend data, or Electron configuration. Namespace keys, validate parsed values, and provide safe defaults for missing or invalid data.localStorage mirroring.localStorage.VITE_ prefix.<style scoped>..queue-page.@/ imports over deep relative paths.any; if unavoidable, narrow the scope and explain why.console.log in business code; use window.electronAPI.getLogger('module').src/styles/appOverlays.css, imported once by src/main.ts; module dialogs should reuse it instead of duplicating title-bar offsets. Portal overrides must target the rendered DOM; see the companion UI skill's overlay layout reference.All commands run from frontend/.
The repo-wide baseline is clean. On untouched dev (verified 2026-08-30), yarn lint reports 0 errors and exactly 1 warning (vue/no-v-html in LogPatternDocsModal.vue, which arrived with #399 on 2026-08-27), yarn typecheck reports 0 errors, and yarn test is fully green. weekly-format.yml re-runs ruff format, yarn lint:fix and yarn format on dev every Monday, so formatting drift does not accumulate.
Therefore any lint or typecheck error you see is almost certainly yours. Do not dismiss it as pre-existing noise without first checking the same command on an untouched checkout — the repository runs no lint, typecheck or test CI, so this baseline is held by convention alone and can drift.
Maintenance note: the warning budget of 1 exists only because that single vue/no-v-html is unfixed. Once it is suppressed or resolved, tighten the gate to --max-warnings 0; leaving the budget at 1 silently permits one arbitrary new warning.
| Touched surface | Command | Passing criterion |
|---|---|---|
| Any business code | yarn lint --max-warnings 1 | exit 0. The budget of 1 covers the single known warning (vue/no-v-html, introduced with #399), so any additional warning fails the gate. Plain yarn lint prints warnings but does not fail on them. |
| Types, props/emits, API usage, generated-client consumption | yarn typecheck | 0 errors |
A module with a sibling *.test.ts, or shared logic under test | yarn test | fully green |
| Build, routing, or Electron entry | yarn build | succeeds |
| Documentation only | file existence, headings, sections, git status --short | — |
| UI | also follow mas-frontend-ui verification | — |
Rules:
yarn lint --max-warnings 1, yarn typecheck, yarn test. They can and should pass; there is no baseline to subtract. Use the --max-warnings form, not plain yarn lint, or new warnings slip through.yarn lint:fix resolves prettier/prettier findings; use it rather than hand-formatting. Warnings are part of the gate — do not leave a new one behind.Prefer yarn typecheck over a full yarn build for type validation; it is much faster and covers the renderer via tsconfig.app.json.
If a command cannot run, state the exact command and the reason. Never claim "complete", "fixed", or "passed" without verification evidence.
Vitest runs with no config file and no DOM environment. There is no vitest.config.ts, no jsdom, and no @vue/test-utils. Tests execute in the default node environment and are colocated next to their subject as *.test.ts.
Three established patterns, in order of preference:
.vue file into a sibling .ts, then import and test it directly. views/scripts/scriptSearch.ts with scriptSearch.test.ts is the reference. This is the main reason to extract logic from a component: testability.vi.mock() for boundaries. Mock @/api (the generated Service) and ant-design-vue (message) rather than reaching for a DOM. See composables/useEmulatorDeviceOptions.test.ts.createSSRApp + renderToString from @vue/server-renderer (ships with vue) and assert on the HTML. Stub Ant Design Vue components with slot-passthrough placeholders so the assertion covers this component's decisions, not antd's markup. See views/Initialization/components/LaunchFailure.test.ts and views/EditView/MaaFWFlavor/MaaFWFlavorSlot.test.ts.Do not introduce mount(), jsdom, happy-dom, or @vue/test-utils for a routine change; that is a project-wide testing-stack decision, not a task-level one. If a behavior genuinely cannot be covered by these three patterns, say so in your result instead of adding a test dependency.
Do not write tests that readFileSync a .vue, .ts, or .css file and assert it contains or lacks particular code — template bindings, handler bodies, style values, imports, or "does not use X" architecture greps. They break on harmless refactors, pass on broken behavior, and were removed in bulk for that reason. Cover the behavior with one of the three patterns above, or leave it to review and say so.
Reading source text is acceptable only when nothing importable exists:
utils/maafwTaskInstance.test.ts and views/setting/notifyChannelsI18n.test.ts.t('ns.key') in src existing in zh-CN. See i18n/locales.test.ts.When an existing source-text test fails because you refactored the code it greps, and it guards neither kind of contract, delete it rather than re-pinning the new string.
| Temptation | Reality |
|---|---|
| "I can generate a fresh page faster." | Inspect and reuse local page, component, and composable patterns first. |
| "The API call is tiny, so direct fetch is fine." | Business API calls go through generated services and composables. |
| "Shared state is easiest to put in localStorage." | Shared reactive application state belongs in Pinia; localStorage is only the narrow fallback for durable, non-sensitive local preferences. |
| "Pinia should hold every frontend value." | Keep isolated short-lived state local, and keep persistent authoritative data in its backend or Electron configuration owner. |
| "I can tweak generated API files." | src/api is generated; regenerate through the project command instead. |
| "New UI text is just a string; inline is faster." | User-facing text goes through the i18n catalog in src/i18n/locales. Add the key to zh-CN.ts (source language); en-US.ts is partial by design and missing keys fall back. |
| "This Chinese literal is untranslated; I'll translate it." | Chinese literals that drive logic must stay verbatim — e.g. tab.status === '运行', result.includes('异常'), SchedulerStatus values. Translating them breaks behaviour silently, with no error. Leave them and add a comment saying why. |
| "This UI-only change can ignore engineering rules." | UI tasks still obey module, state, API, and verification boundaries. |
"yarn lint is failing, but the repo baseline is dirty anyway." | It is not. Clean dev passes lint, typecheck and tests. A failure is yours until you verify otherwise on an untouched checkout. |
| "Lint passed, so the types are fine." | The two are orthogonal and check different things. Run both. |
| "I'll fix the surrounding lint noise while I'm here." | weekly-format.yml already formats dev every Monday. Unrelated cleanup buries your real diff. |
| "I need jsdom to test this component." | Tests run in node with no DOM. Extract logic to a sibling .ts, or render with @vue/server-renderer. |
"I'll lock this in with a test that greps the .vue source." | Source-text assertions on implementation details are not accepted. Test behavior, or leave it to review. |
"The generated client throws ApiError, so I'll call axios directly to read the error message." | Read it from ApiError.body. Business requests always go through the generated client. |
For frontend tasks, report:
State that no business code was changed when the task is documentation-only.
还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
从固定点(commit、branch、tag 或 merge-base)开始,沿两条轴线审查变更——规范(代码是否遵循仓库文档化的编码规范?)和规格(代码是否与原始 issue/PRD 的要求一致?)。两条审查线在并行子 agent 中运行,并以并排方式报告结果。当用户想审查一个分支、PR、进行中的变更,或要求"从 X 开始审查"时使用。
中文简介正在准备中。当前显示原文说明。
一场无休止的盘问,用来打磨你的计划或设计。
中文简介正在准备中。当前显示原文说明。
对用户的计划、决策或想法进行层层盘问。当用户想要压力测试自己的思考,或使用任何 'grill' 触发短语时使用。
中文简介正在准备中。当前显示原文说明。
Define backend API contract standards for FastAPI services. Use when adding or refactoring HTTP/WebSocket endpoints in app/api, designing request/response schemas in app/models/schema.py, standardizing status/error contracts, and maintaining backward compatibility for clients.
中文简介正在准备中。当前显示原文说明。
Use when an AUTO-MAS PR is red in CI, when reproducing a dev-PR gate locally before pushing, when a workflow needs a skip-changelog or changelog-maintenance label, or when editing .github/workflows, .github/actions, scripts/changelog.py or scripts/check_reverts.py. Covers every gate that runs on a PR to dev and the exact local command for each.
中文简介正在准备中。当前显示原文说明。
Use when implementing, fixing, refactoring, or reviewing non-generated AUTO-MAS code, or when preparing code-style guidance, comments, docstrings, version notes, or Conventional Commit wording. Skip read-only diagnosis, explanation, exploration, and planning unless code conventions are requested.
中文简介正在准备中。当前显示原文说明。