fix-lint-format
GitHub在提交代码或PR前修复代码的格式和Lint错误,确保通过项目自动化检查。支持检测Go、Node等多语言项目结构,按规范执行格式化、静态分析及测试,特别适配Monorepo场景,避免跨包误操作。
Trigger Scenarios
Install
npx skills add AjayIrkal23/agentic-mercy-10x --skill fix-lint-format -g -y
SKILL.md
Frontmatter
{
"name": "fix-lint-format",
"schema": 1,
"category": "general",
"surfaces": [
"general"
],
"triggers": {
"paths": [],
"intents": [
"general"
],
"keywords": [
"adapts",
"checks",
"code",
"commands",
"committing",
"ensure",
"errors",
"examples",
"failures",
"fix",
"format",
"formatting",
"have",
"issues",
"lint",
"node",
"passes",
"project",
"react",
"repo",
"upstream"
]
},
"platforms": [
"linux",
"darwin",
"windows"
],
"token-cost": 436,
"description": "Use when you have lint errors, formatting issues, CI failures, or before committing code to ensure it passes project checks. Adapts commands to the repo (Go, Node, React upstream examples)."
}
Fix lint and formatting
Goal
Get the working tree to a state that would pass the project’s automated checks (format, lint, tests where appropriate) before commit or PR.
Portable workflow
- Detect the project from the workspace root and changed paths:
go.mod+Makefile→ likely Go; prefermake lintandgo test ./...when documentedpackage.json→ usenpm run lint,pnpm lint, oryarn lintas defined inscripts
- Format first when the repo documents a formatter (
gofmt/goimports, Prettier, etc.) - Lint / static analysis second
- Tests for substantial logic changes when quick to run locally
Multi-package / monorepo layouts
If the repository has sibling packages (e.g. client/ and server/, or apps/web and services/api), run each package’s documented lint, format, and test commands from that package’s root—not from a parent folder unless the docs say so. Follow AGENTS.md or README when the repo defines a matrix of commands.
Example — facebook/react monorepo (upstream reference)
From facebook/react fix skill:
- Run
yarn prettierto fix formatting (repo-specific) - Run
yarn lincto check for remaining lint issues - Report any remaining manual fixes
Use this block only when actually working inside the React repository.
Common mistakes
- Running a client lint command against server changes (or vice versa)
- Assuming
npm run preflightexists — prefer readingpackage.jsonandMakefile - Ignoring errors that will fail CI — fix or explicitly call out blockers
References
Version History
- 581d130 Current 2026-07-19 09:07


