pr-to-go-linter
Generate a new pkg/linters analyzer from a merged or open PR pattern.
- License 许可
- MIT
- 所属仓库
- github/gh-aw
- 最近更新
- 2026-11-15
- Stars
- ★ 5.6k
- Forks
- 626
01 前言 Front Matter
- name
- pr-to-go-linter
- description
- Generate a new pkg/linters analyzer from a merged or open PR pattern.
03 SKILL.md 正文
PR to Go Linter
Use this skill when a user asks to create a new custom Go linter based on a code pattern fixed in a pull request.
Goal
Convert one concrete PR pattern into a new go/analysis linter under pkg/linters/<name>/ with tests and runner registration.
Inputs
- Repository owner/name
- Pull request number
- Target linter name (kebab-case)
Workflow
- Read PR metadata and changed files.
- Read the PR diff and extract the repeated pattern that was fixed.
- Define one precise diagnostic rule from that pattern.
- Confirm no existing linter in
pkg/linters/already covers it. - Implement:
pkg/linters/<name>/<name>.gowith exportedAnalyzerpkg/linters/<name>/<name>_test.gousinganalysistestpkg/linters/<name>/testdata/src/<name>/<name>.gofixtures with// wantcmd/linters/main.goregistration inmultichecker.Main(...)
- Validate:
go test ./pkg/linters/<name>/...go build ./cmd/lintersmake golint-custom
Rule quality checks
- High signal, low false positives on this repository.
- Diagnostic is specific and fixable.
- Rule scope matches code in the PR (do not generalize beyond evidence).
- Do not change unrelated linter packages.
Example pattern source
For PR #33038 (Refactor pkg mutex sites to use deferred unlocks consistently), derive a linter idea that reports lock/unlock sections that manually unlock instead of deferring unlock immediately after lock when the function body matches the same cache/logger-style critical section pattern.
Output expectations
- Minimal implementation-only diff in
pkg/linters/<name>/andcmd/linters/main.go. - Tests prove both flagged and non-flagged cases.
- PR summary explains: source PR, extracted pattern, and why the rule is safe.
04 同仓库更多 Skills
cracktro
Edit, preview, and verify the standalone interactive talk deck in docs/public/cracktro (slides, SVG diagrams, transitions, WebAudio sound).
create-connector
Create or extend a declaration-only third-party connector, with narrow reads, separate safe outputs, optional protected triggers, and offline conformance evidence.
GitHub Agentic Workflows
GitHub Agentic Workflows (`gh-aw`) is a GitHub CLI extension for writing Agentic Workflows in markdown and compiling them to GitHub Actions.
windows-compatibility
Cross-platform path handling and command patterns
versioning-policy
Semver versioning rules for Squad SDK and CLI — prevents prerelease version incidents
tiered-memory
Three-tier agent memory model (hot/cold/wiki) for context reduction per spawn