跳到正文
cccskills
免费在 GitHub 公开

pr-to-go-linter

Turn a code pattern fixed in a pull request into a custom Go linter, a tool that checks code without running it. Covers a focused detection rule, tests, and registration in the linter runner.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

Generate a new pkg/linters analyzer from a merged or open PR pattern.

查看安装方法

适用场景

  • Turning a PR fix into a repeatable code check
  • Adding a custom Go linter
  • Testing cases that should and should not be flagged
  • Checking for overlap with existing linters

包含的文件(1)

  • SKILL.md1.9 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

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.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Coordinate work across AI agents with shared rules for locating team files, recording decisions and their reasons, and requesting help. It also defines who owns revisions after a reviewer rejects an artifact.

中文简介正在准备中。当前显示英语简介。

  • Locate team files across separate working directories
  • Record decisions that affect other agents
  • Request input from another specialist
github/gh-aw54212026年10月19日 更新

Set shared development rules for an agent team: keep specific agent names out of product code, tests, and CI configuration, verify affected tests before finishing, and record lessons learned from mistakes.

中文简介正在准备中。当前显示英语简介。

  • Share development rules across multiple agents
  • Keep team-specific agent names out of code and tests
  • Check affected tests before declaring work complete
github/gh-aw54212026年10月19日 更新

Route gh-aw design, creation, diagnosis, patching, active debugging, and upgrade requests to the right strategies.

中文简介正在准备中。当前显示原文说明。

github/gh-aw54212026年10月19日 更新

How to write comprehensive architectural proposals that drive alignment before code is written

中文简介正在准备中。当前显示原文说明。

github/gh-aw54212026年10月19日 更新

Upgrade gh-aw to latest gh-aw-firewall release and identify follow-up spec tasks.

中文简介正在准备中。当前显示原文说明。

github/gh-aw54212026年10月19日 更新

Review code that performs git or gh operations against repository checkouts in gh-aw, checking that the right credentials are available at the right time and that sparseness, shallowness and credential-free factors are properly considered.

中文简介正在准备中。当前显示原文说明。

github/gh-aw54212026年10月19日 更新

查看 github 的全部技能

报告此技能的问题