Standard collaboration patterns for all squad agents — worktree awareness, decisions, cross-agent communication
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Add and validate custom Go analysis linters in gh-aw.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
설치 방법 보기설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.
Use this guide when adding a new custom Go analysis linter in this repository.
For PR-driven linter generation (derive a rule from a specific pull request pattern), use .github/skills/pr-to-go-linter/SKILL.md.
pkg/linters/<linter-name>/.Analyzer).analysistest with fixtures under testdata/src/....cmd/linters/main.go so it runs via the multichecker binary.go test ./pkg/linters/<linter-name>/...go build ./cmd/lintersmake golint-custommake golint-custom builds cmd/linters and runs it against ./cmd/... and ./pkg/....
Expressions wrapped in parentheses appear as *ast.ParenExpr. Unwrap expressions before
asserting their AST type or comparing identifiers, so forms such as (nil) and (err) are
handled like nil and err. Use the shared helper:
if ident, ok := astutil.UnwrapParenExpr(expr).(*ast.Ident); ok && ident.Name == "nil" {
// Handle nil.
}
Semantically similar calls can appear in different statement nodes. A call that discards a
result may be a bare *ast.ExprStmt or part of an *ast.AssignStmt; filtering only for one
shape misses the other. Include and handle each relevant node shape:
nodeFilter := []ast.Node{(*ast.AssignStmt)(nil), (*ast.ExprStmt)(nil)}
return analyzerutil.Preorder(pass, nodeFilter, func(n ast.Node) {
switch stmt := n.(type) {
case *ast.AssignStmt:
analyzeAssign(stmt)
case *ast.ExprStmt:
analyzeExpr(stmt)
}
})
Before submitting a linter, check expression-shape assertions for parenthesis unwrapping and verify its node filter covers relevant equivalent syntax forms.
For linters that flag micro-optimizations (allocation/perf rules), only apply them on lines that
tests actually exercise — "hot paths" — rather than on dead or rarely-executed code where the
optimization brings no measurable benefit. Use the shared pkg/linters/internal/coverage package:
In your analyzer file, register a -hot-threshold flag in init() (not as a var initializer,
to avoid an Analyzer/run/flag initialization cycle):
var hotThreshold *int
func init() {
hotThreshold = coverage.RegisterHotThresholdFlag(Analyzer)
}
Immediately before reporting a diagnostic, gate it with coverage.ShouldApply:
if !coverage.ShouldApply(pass, node.Pos(), *hotThreshold) {
return
}
coverage.ShouldApply is permissive by default: when no coverage profile is loaded via the
GH_AW_LINT_COVERAGE_PROFILE environment variable, or when hot-threshold is 0, it always
returns true, preserving pre-coverage-aware behavior. Only wire this into linters whose fix has
a genuine performance rationale (extra allocations, O(n²) behavior, etc.) — purely
readability/style linters should not be coverage-gated.
go test -covermode=count -coverprofile=/tmp/coverage.out ./...
export GH_AW_LINT_COVERAGE_PROFILE=/tmp/coverage.out
make golint-custom
This profile is read once per linter-runner process. To lint only a specific subtree, scope
the go test and golint-custom commands to the same package path.
아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.
로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.
아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.
Standard collaboration patterns for all squad agents — worktree awareness, decisions, cross-agent communication
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Shared hard rules enforced across all squad agents
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Route gh-aw design, creation, diagnosis, patching, active debugging, and upgrade requests to the right strategies.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
How to write comprehensive architectural proposals that drive alignment before code is written
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Upgrade gh-aw to latest gh-aw-firewall release and identify follow-up spec tasks.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
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.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.