pr-to-go-linter

โดย github

สร้างตัววิเคราะห์ pkg/linters ใหม่จากรูปแบบ PR ที่ถูกผสานหรือเปิดอยู่

npx skills add https://github.com/github/gh-aw --skill pr-to-go-linter

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 matches the same cache/logger-style critical section pattern.

Output expectations

  • Minimal implementation-only diff in pkg/linters/<name>/ and cmd/linters/main.go.
  • Tests prove both flagged and non-flagged cases.
  • PR summary explains: source PR, extracted pattern, and why the rule is safe.

Skills เพิ่มเติมจาก github

debugging-workflows
github
คู่มือการดีบัก GitHub Agentic Workflows - การวิเคราะห์ล็อก การตรวจสอบการรัน และการแก้ไขปัญหา
go-codemod
github
ใช้และทดสอบการปรับเปลี่ยนโค้ด Go สำหรับคำสั่ง gh aw fix
acreadiness-policy
github
ช่วยผู้ใช้เลือก เขียน หรือใช้ AgentRC policy นโยบายปรับแต่งการให้คะแนนความพร้อมโดยปิดการตรวจสอบที่ไม่เกี่ยวข้อง เปลี่ยนระดับผลกระทบ/ระดับ การตั้งค่า…
ai-ready
github
ทำให้ repo ใดๆ พร้อมสำหรับ AI — วิเคราะห์โค้ดเบสของคุณและสร้าง AGENTS.md, copilot-instructions.md, ขั้นตอนการทำงาน CI, เทมเพลต issue และอื่นๆ ขุดรีวิว PR ของคุณ…
create-oo-component-documentation
github
สร้างเอกสารประกอบที่ครอบคลุมและเป็นมาตรฐานสำหรับคอมโพเนนต์เชิงวัตถุตามแนวทางปฏิบัติที่ดีที่สุดในอุตสาหกรรมและมาตรฐานเอกสารทางสถาปัตยกรรม
dependabot
github
Dependabot เป็นเครื่องมือจัดการ dependencies ในตัวของ GitHub ที่มีความสามารถหลักสามประการ:
doublecheck
github
ไปป์ไลน์การตรวจสอบสามชั้นสำหรับผลลัพธ์ของ AI แยกข้อความที่สามารถตรวจสอบได้ ค้นหาแหล่งข้อมูลที่สนับสนุนหรือขัดแย้งผ่านการค้นหาเว็บ ดำเนินการตรวจสอบเชิงโต้แย้ง…
foundry-agent-sync
github
สร้างและซิงโครไนซ์เอเจนต์ AI ที่ใช้พรอมพ์โดยตรงภายใน Azure AI Foundry ผ่าน REST API จากไฟล์ JSON ในเครื่อง ซึ่งแตกต่างจากสกิลโครงสร้างพื้นฐานที่ทำได้เพียง...