AgentSkillsCN

lint

在项目中运行 golangci-lint,并修复发现的问题。适用于代码质量检查,或在提交前进行代码审查时使用。

SKILL.md
--- frontmatter
name: lint
description: Run golangci-lint on the project and fix issues. Use when checking code quality or before committing.
argument-hint: "[--fix or package-path]"
allowed-tools: Bash(golangci-lint *), Bash(go vet *), Read, Edit, Glob

Run Linter

Steps

  1. Run golangci-lint run ./... (or on $ARGUMENTS if a specific path is given)
  2. If --fix is passed as argument, run with --fix flag
  3. For each issue found:
    • Read the file and understand the context
    • Apply the fix using Edit tool
    • Explain what was changed and why
  4. Re-run the linter to verify all issues are resolved

Rules

  • Follow existing code style in the project
  • Do not add unnecessary comments or docstrings
  • Do not refactor surrounding code - only fix linter issues