一键导入
fix-frontend-type-errors
Systematic TypeScript/Vue type error resolution (vue-tsc/ESLint). Load when fixing frontend type check failures
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Systematic TypeScript/Vue type error resolution (vue-tsc/ESLint). Load when fixing frontend type check failures
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
External API evaluation and MCP server wrapper generation. Load when integrating a REST/GraphQL API as a workspace tool
Capability-based provider system patterns. Load when creating providers or wiring module-provider integration
Full-stack WebSocket subscription development. Load when adding WS routes, topic services, or debugging WS data flows
Systematic Python type error resolution (mypy/pyright). Load when fixing backend type check failures
Type-first Python with Pydantic, Protocol, and discriminated unions. Load when writing models or enforcing typing
Systematic type error resolution for Python (mypy/pyright) and TypeScript (vue-tsc). Use when fixing type errors, resolving type check failures, or optimizing type imports.
| name | fix-frontend-type-errors |
| description | Systematic TypeScript/Vue type error resolution (vue-tsc/ESLint). Load when fixing frontend type check failures |
| user-invocable | false |
Systematic workflow to resolve TypeScript and Vue static type checker errors while preserving runtime behavior.
Applies when:
frontend/import type// @ts-ignore suppressions| Principle | Description |
|---|---|
| Behavior Preservation | Fixes must NOT change runtime logic. Only annotations, imports, and type assertions. |
| Zero Suppressions | // @ts-ignore is forbidden. Resolve properly or escalate. |
| Import Optimization | Use import type for type-only imports — erased at runtime. |
| Minimal Surface | One error → one minimal fix. Avoid broad refactors. |
| Priority | Command | Use Case |
|---|---|---|
| 1. Makefile | make -C frontend lint type-check | Full check (ESLint + vue-tsc) |
| 2. Direct | cd frontend && npm run type-check | vue-tsc only |
| 3. Single-file | cd frontend && npx vue-tsc --noEmit src/path/to/file.ts | Fast iteration |
[file:line] error_code: message| Category | Examples | Action |
|---|---|---|
| A: Direct Fix | Missing annotation, wrong type | Fix immediately |
| B: Import Optimization | Runtime import used only for types | Switch to import type |
| C: Structural | Generic variance, interface mismatch | Analyze deeply |
| D: External | Untyped library, upstream bug | Escalate |
For each error, apply decision tree:
*_generated/) → Skipimport typeas assertion with documentationAfter fixes, run validation (all from project root, fail-fast && chains):
| Change Type | Commands |
|---|---|
| Pure annotations | make -C frontend lint && make -C frontend type-check |
| Added type assertion | make -C frontend lint && make -C frontend type-check && make -C frontend test |
| Changed runtime imports | make -C frontend lint && make -C frontend type-check && make -C frontend test |
import type { SomeType } from './module' // Erased at runtime
import { SomeValue } from './module' // Kept at runtime
function isOrder(value: unknown): value is Order {
return typeof value === 'object' && value !== null && 'orderId' in value
}
type WsMessage = { type: 'order'; data: Order } | { type: 'error'; message: string }
function handle(msg: WsMessage) {
switch (msg.type) {
case 'order': // msg.data is Order here
case 'error': // msg.message is string here
}
}
Only after exhausting all fix approaches:
// @ts-expect-error — [reason]SUPPRESSION REQUIRED (External Issue)
File: src/path/to/file.ts:42
Error: TS2322 — Type 'X' is not assignable to type 'Y'
Root Cause: [Library/framework limitation]
Proposed: // @ts-expect-error — [library] returns untyped response
const result = untypedCall() as ExpectedType
Validation: Tested — resolves error
DO NOT apply suppressions without user acknowledgment.
// @ts-ignore — use // @ts-expect-error with explanation if suppression is unavoidable*_generated/ directories)