fix-errors

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Fix Errors

修复错误

Fix all ESLint and TypeScript errors by breaking them into areas and processing in parallel.
通过将错误划分到不同区域并进行并行处理,修复所有ESLint和TypeScript错误。

Workflow

工作流程

  1. DISCOVER COMMANDS: Check
    package.json
    for exact script names
    • Look for:
      lint
      ,
      typecheck
      ,
      type-check
      ,
      tsc
      ,
      eslint
      ,
      prettier
      ,
      format
  2. RUN DIAGNOSTICS:
    • Run
      pnpm run lint
      (or equivalent)
    • Run
      pnpm run typecheck
      or
      tsc --noEmit
    • Capture all error output
  3. ANALYZE ERRORS:
    • Extract file paths from error messages
    • Group errors by file location
    • Count total errors and affected files
  4. CREATE ERROR AREAS:
    • MAX 5 FILES PER AREA
    • Group related files together (same directory/feature)
    • Example:
      Area 1: [file1, file2, file3, file4, file5]
  5. PARALLEL PROCESSING: Launch snipper agents for each area
    • Use Task tool with multiple agents simultaneously
    • Each agent processes one area (max 5 files)
    • Provide specific error details for each file
  6. VERIFICATION: Re-run diagnostics after fixes
    • Wait for all agents to complete
    • Re-run lint and typecheck
    • Report remaining errors
  7. FORMAT CODE: Apply Prettier (if available)
    • Run
      pnpm run format
      or equivalent
  1. 查找命令:检查
    package.json
    获取准确的脚本名称
    • 查找以下脚本:
      lint
      typecheck
      type-check
      tsc
      eslint
      prettier
      format
  2. 运行诊断
    • 运行
      pnpm run lint
      (或等效命令)
    • 运行
      pnpm run typecheck
      tsc --noEmit
    • 捕获所有错误输出
  3. 分析错误
    • 从错误信息中提取文件路径
    • 按文件位置对错误进行分组
    • 统计错误总数和受影响的文件数量
  4. 创建错误处理区域
    • 每个区域最多5个文件
    • 将相关文件分组到一起(同一目录/功能模块)
    • 示例:
      区域1: [file1, file2, file3, file4, file5]
  5. 并行处理:为每个区域启动snipper agents
    • 使用Task工具同时启动多个agents
    • 每个agent处理一个区域(最多5个文件)
    • 为每个文件提供具体的错误详情
  6. 验证:修复完成后重新运行诊断
    • 等待所有agents完成任务
    • 重新运行lint和typecheck
    • 报告剩余错误
  7. 格式化代码:应用Prettier格式化(如果可用)
    • 运行
      pnpm run format
      或等效命令

Snipper Agent Instructions

Snipper Agent 说明

Fix all ESLint and TypeScript errors in these files:
[list of files with their specific errors]

Focus only on these files. Make minimal changes to fix errors while preserving functionality.
Fix all ESLint and TypeScript errors in these files:
[list of files with their specific errors]

Focus only on these files. Make minimal changes to fix errors while preserving functionality.

Rules

规则

  • ALWAYS check package.json first for correct commands
  • ONLY fix linting and TypeScript errors
  • NO feature additions - minimal fixes only
  • PARALLEL ONLY - use Task tool for concurrent processing
  • Every error must be assigned to an area
User: $ARGUMENTS
  • 始终先检查package.json获取正确的命令
  • 仅修复linting和TypeScript错误
  • 禁止添加新功能 - 仅做最小必要修复
  • 必须并行处理 - 使用Task工具进行并发处理
  • 每个错误都必须分配到对应的处理区域
用户:$ARGUMENTS