pr-to-go-linter
SolidGenerate a new pkg/linters analyzer from a merged or open PR pattern.
Code & Development 4,612 stars
420 forks Updated today MIT
Install
Quality Score: 89/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# 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
1. Read PR metadata and changed files.
2. Read the PR diff and extract the repeated pattern that was fixed.
3. Define one precise diagnostic rule from that pattern.
4. Confirm no existing linter in `pkg/linters/` already covers it.
5. Implement:
- `pkg/linters/<name>/<name>.go` with exported `Analyzer`
- `pkg/linters/<name>/<name>_test.go` using `analysistest`
- `pkg/linters/<name>/testdata/src/<name>/<name>.go` fixtures with `// want`
- `cmd/linters/main.go` registration in `multichecker.Main(...)`
6. Validate:
- `go test ./pkg/linters/<name>/...`
- `go build ./cmd/linters`
- `make 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 ma...
Details
- Author
- github
- Repository
- github/gh-aw
- Created
- 10 months ago
- Last Updated
- today
- Language
- Go
- License
- MIT
Integrates with
Similar Skills
Semantically similar based on skill content — not just same category
Code & Development Solid
go-linters
Add and validate custom Go analysis linters in gh-aw.
4,612 Updated today
github Code & Development Listed
pr-reviewer
Automated GitHub PR code review with diff analysis, lint integration, and structured reports. Use when reviewing pull requests, checking for security issues, error handling gaps, test coverage, or code style problems. Supports Go, Python, and JavaScript/TypeScript. Requires `gh` CLI authenticated with repo access.
2 Updated today
Silex-Research Data & Documents Listed
pr-contribution-excellence
Patterns for excellent open-source PR contributions, distilled from analyzing real PRs across repositories
2 Updated today
kookr-ai