一键导入
api-boundary
Use when changing Axum solver routes, HTTP contracts, limits, scan sessions, or the matching web solver client.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when changing Axum solver routes, HTTP contracts, limits, scan sessions, or the matching web solver client.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when changing Rust puzzle state, moves, notation, scrambles, or validation.
Use when extracting React components, changing shared primitives, composing pages, or adding Storybook surfaces.
Use when changing solve inputs, limits, validation, scanner review controls, or form submission behavior.
Use when changing routes, locales, SEO metadata, static generation, hydration, public SEO assets, or language routing.
Use when changing React state, hooks, stores, async workflow ownership, or visualization synchronization.
Use when changing Tailwind utilities, theme tokens, responsive layout, class composition, or visual treatment.
| name | api-boundary |
| description | Use when changing Axum solver routes, HTTP contracts, limits, scan sessions, or the matching web solver client. |
Generated from ai/registry.json. Do not edit manually.
Canonical skill: ../../../ai/skills/api-boundary.md.
Referenced context:
../../../ai/rules/api-rules.md../../../ai/rules/frontend-rules.md../../../ai/rules/testing-rules.md../../../ai/architecture/api-boundary.mdThis file is compiled from canonical AI knowledge files. Edit canonical files under ai, then run npm run ai:sync.
ai/skills/api-boundary.mdUse for Axum routes, contracts, validation, solver loading, scan sessions, or the matching web API client.
ai/rules/api-rules.mdai/rules/frontend-rules.mdai/rules/testing-rules.mdai/architecture/api-boundary.mdai/rules/api-rules.mdRules for the Axum HTTP API and the frontend API contract.
cube-engine; crates/api owns HTTP shape, safety limits, generated-solver loading, CORS, and error/status mapping.apps/web/src/api normalizes them.apps/web/src/api types and normalization when API response fields or status values change./api/wca-data as an Axum HTTP 308 redirect to /api/wca-data/v1/docs; WCA data endpoints belong to apps/wca-data.apps/web/src/api.npm run api:test or cargo test -p rubiks-cube-solver-api.cargo test -p cube-engine when API behavior depends on changed solver behavior.npm run build and npm run lint -w @rubiks-cube-solver/web.npm run test:e2e when API, web, and generated pruning-table prerequisites are available.ai/rules/frontend-rules.mdapps/web/src/api; UI consumes domain hooks/adapters.@rubiks-cube-solver/rubiks-cube package as a visualization adapter, never as canonical solver state.hydrateRoot for generated markup, and SPA navigation after hydration.en-US canonical without a prefix. Publish/index any of the nine supported locales only when its visible and SEO content is fully translated with placeholder parity.cn helper in shadcn-style primitives and established classnames as cls in feature code when Tailwind conflict resolution is unnecessary.frontend-quality-rules.md.apps/web uses React 19 with React Compiler enabled through the Vite React compiler preset. Write ordinary components and hooks and let the compiler provide memoization.useMemo, useCallback, React.memo, or other manual render memoization. Do not make referential identity a correctness requirement for effects, subscriptions, or child props.forwardRef. React 19 components accept ref as a prop; type DOM-forwarding components with ComponentPropsWithRef and pass that prop to the owning element. A deliberate non-DOM imperative handle MAY use that prop with useImperativeHandle.useEffectEvent when a callback registered by an effect must read the latest props or state without re-subscribing. Keep effect dependencies focused on the values that define the subscription lifecycle."use no memo" only as a short-lived, documented containment for a verified compiler issue.npm run build as the compiler integration check because it exercises both the client bundle and the SSG build.ai/rules/testing-rules.mdTesting rules for this repository.
crates/api behavior changes.describe, it, expect, vi.fn, and vi.spyOn for web unit and component tests.web tests in __tests__/ folders beside the source area they cover.__tests__ directory, including the established root, client, and domain-level locations; use shared helpers under apps/web/src/test.apps/web/src/core tests under apps/web/src/core/<category>/__tests__/<name>.test.ts.web coverage thresholds at 90% for statements, branches, functions, and lines..only in committed test files.jest.mock patterns in Vitest tests.web tests as loose sibling *.test.ts(x) files when a nearby __tests__/ folder is available.apps/web/src/test/render.tsx or apps/web/src/test/api.ts already covers the setup.selectOption() or locator('option') for Radix Select controls; use helpers under tests/e2e/select-helpers.ts.cargo test -p cube-engine.npm run api:test or cargo test -p rubiks-cube-solver-api.cargo test.npm run build and npm run lint -w @rubiks-cube-solver/web.npm run test -w @rubiks-cube-solver/web.npm run test:coverage -w @rubiks-cube-solver/web.npm run storybook:build -w @rubiks-cube-solver/web.npm run test:e2e after the API, web app, and pruning-table prerequisites are available.npm run test:e2e:smoke for product/responsive/timer smoke, npm run test:e2e:scan for serial manual scan coverage, and npm run test:e2e:full for the complete non-heavy suite.npm run product:gate for release-level or cross-boundary validation.npm run ai:check.ai/architecture/api-boundary.mdcrates/api is a native Axum HTTP and static-serving boundary around the Rust solver engine.
crates/api/src/routes.rs owns route composition, HTTP layers, static file serving, and handlers. Focused modules own configuration, request/response types, puzzle dispatch, scan analysis, solve preparation, and state./health, /livez, and /readyz./puzzles, /puzzles/{puzzle_slug}, /puzzles/{puzzle_slug}/strategies, /puzzles/{puzzle_slug}/solve, legacy /strategies, /solve-notation, and /solve-scan./scan/analyze-face, /scan/solve-session, and /puzzles/{puzzle_slug}/scan/solve-session./api/wca-data is a server-side permanent redirect (HTTP 308) to /api/wca-data/v1/docs; unknown /api/* paths return 404 instead of static HTML./algoritmos prefixes redirect permanently to the corresponding /algorithms path while preserving locale prefixes, suffixes, and query strings.apps/web/src/api owns request construction, runtime validation, response normalization, and React Query hooks. Shared transport code lives under apps/web/src/api/client./api/wca-data/v1 service contract; Axum does not implement those data endpoints.crates/api/src/tests.rs and focused crate test modules.__tests__ directories, including apps/web/src/api/__tests__, apps/web/src/api/client/__tests__, and domain-level __tests__.