Agent Skills
› NeverSight/learn-skills.dev
› lint
lint
GitHub对项目中变更的Shell脚本和GitHub Actions工作流执行lint检查。使用shellcheck和actionlint工具扫描代码问题,修复错误并在必要时添加禁用指令,最后报告修复内容。适用于推送前或修复lint问题时使用。
Trigger Scenarios
用户要求运行lint检查
准备推送代码前
修复代码规范问题
Install
npx skills add NeverSight/learn-skills.dev --skill lint -g -y
SKILL.md
Frontmatter
{
"name": "lint",
"description": "Run shellcheck and actionlint on shell scripts and GitHub Actions workflows. Use before pushing or when fixing lint issues."
}
Run linting tools on shell scripts and GitHub Actions workflows in this project.
Your Task
Run the following checks on changed files (relative to main branch):
1. Shell Scripts (shellcheck)
# Find changed shell scripts
changed_scripts=$(git diff --name-only main...HEAD 2>/dev/null | grep -E '\.sh$')
# Run shellcheck on each
for script in $changed_scripts; do
if [[ -f "$script" ]]; then
shellcheck -f gcc "$script"
fi
done
2. GitHub Actions Workflows (actionlint)
# Find changed workflow files
changed_workflows=$(git diff --name-only main...HEAD 2>/dev/null | grep -E '\.github/workflows/.*\.ya?ml$')
# Run actionlint on each
for workflow in $changed_workflows; do
if [[ -f "$workflow" ]]; then
actionlint "$workflow"
fi
done
Handling Issues
When lint issues are found:
- Fix the issues - Correct the code to resolve warnings/errors
- Only use disable directives as a last resort - If a warning is a false positive or truly unavoidable, add a disable comment with explanation:
# shellcheck disable=SC2034 # Variable used by sourcing script - Report what was fixed - Summarize the changes made
Optional Guidance
$ARGUMENTS
Version History
- e0220ca Current 2026-07-05 22:04


