AgentSkillsCN

cleanup

在实现代码后,运用清理技能验证代码质量。

SKILL.md
--- frontmatter
name: cleanup
description: Cleanup skill for verifying code quality after implementation
license: MIT
compatibility: opencode
metadata:
  audience: developers
  workflow: validation

Cleanup Skill

Purpose

After every implementation, clean up and verify code quality before considering the task complete.

Cleanup Checklist

  1. Remove Duplicate Code

    • Find and remove any duplicate implementations
    • Consolidate similar functions
    • Extract common patterns into utilities
  2. Check for Errors

    • TypeScript/TSX errors
    • ESLint/Prettier issues
    • Python type errors (if using mypy)
    • Syntax errors in any language
  3. Verify Code Functionality

    • Check that the code actually works
    • Look for logical errors
    • Verify edge cases are handled
  4. Check Dependencies

    • Ensure all imports are valid
    • Verify packages are in package.json/requirements.txt
    • Check for missing type definitions
  5. Run Dev/Type-Check

    • Run npm run dev to verify development server starts
    • Run npm run type-check or tsc --noEmit for TypeScript errors
    • Verify no type errors
  6. Verify File Management

    • Check .gitignore includes .history/
    • Ensure all build outputs are ignored

If Errors Found

Critical Rule: If ANY error is found during cleanup, continue fixing the problems directly. The Super Coder worker agent has full edit access and can fix issues autonomously.

Report Format:

code
Cleanup found the following issues:

1. [Error type]: [Description]
   File: [path/to/file]
   Line: [line number]
   
2. [Error type]: [Description]
   File: [path/to/file]
   
Fixing these issues now...

Validation Commands

Node.js/TypeScript:

bash
npm run dev          # Verify dev server starts
npm run lint         # Check linting errors
npm run type-check   # Or: tsc --noEmit

Python:

bash
python -m py_compile [file.py]
mypy [file.py]
flake8 [file.py]

File Management Validation

Verify .gitignore includes:

gitignore
.history/

Post-Cleanup

After cleanup passes with no errors:

  1. Provide final summary of implementation
  2. Report successful completion
  3. If session is ending, provide compact summary for orchestrator
  4. Task is complete

Key Rules

  1. ALWAYS run cleanup after implementation
  2. NEVER skip cleanup
  3. Fix errors directly using edit access
  4. Keep working until cleanup passes cleanly
  5. Verify .gitignore is correct