go-lint-audit
WHEN: User wants to run linting on their Go project, understand lint findings, improve their golangci-lint configuration, or asks "what's wrong with my code?" from a linting perspective. WHEN NOT: Deep code quality audit (use go-code-audit), or auto-fixing lint issues (use /lint-fix command).
What this skill does
# Go Lint Audit
Extended lint analysis with human-readable explanations. Wraps golangci-lint with better categorization, explanations, and configuration recommendations.
## What It Does
1. **Runs golangci-lint** with comprehensive linter set
2. **Groups findings** by category and severity
3. **Explains each finding** in plain language with fix examples
4. **Recommends config improvements** for `.golangci.yml`
## Steps
### API Integration (Optional)
If `GOPHER_GUIDES_API_KEY` is set, verify it:
```bash
curl -s -H "Authorization: Bearer $GOPHER_GUIDES_API_KEY" \
https://gopherguides.com/api/gopher-ai/me
```
If not set, local analysis tools (go vet, staticcheck, golangci-lint) still provide comprehensive analysis. Set the key for enhanced API-powered insights. Get your key at [gopherguides.com](https://gopherguides.com).
### 1. Check Configuration
```bash
# Find existing config
ls .golangci.yml .golangci.yaml .golangci.toml 2>/dev/null
# If no config exists, note it โ will recommend one
```
### 2. Run Analysis
```bash
# Run with all findings shown
golangci-lint run \
--max-issues-per-linter 0 \
--max-same-issues 0 \
--out-format json \
./... 2>&1
```
If `golangci-lint` is not installed:
```bash
# Install
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
```
### 3. Categorize Findings
Group findings into categories:
| Category | Linters | Severity |
|----------|---------|----------|
| **Bugs** | govet, staticcheck, gosec | ๐ด Critical |
| **Error Handling** | errcheck, errorlint | ๐ด Critical |
| **Performance** | prealloc, bodyclose | ๐ก Warning |
| **Style** | gofmt, goimports, misspell | ๐ข Suggestion |
| **Complexity** | cyclop, gocognit, funlen | ๐ก Warning |
| **Maintainability** | gocritic, revive, dupl | ๐ก Warning |
| **Security** | gosec | ๐ด Critical |
### 4. Explain Findings
For each finding, provide:
- **What it means** in plain language
- **Why it matters** (bug risk, performance, maintainability)
- **How to fix it** with a code example
- **When to ignore it** (if applicable, with `//nolint` directive)
Example:
```markdown
#### errcheck: Error return value of `os.Remove` is not checked
**What:** The function `os.Remove()` returns an error that your code ignores.
**Why:** If the file doesn't exist or can't be deleted, your program won't know,
potentially leaving stale files or masking permission issues.
**Fix:**
โ```go
// Before
os.Remove(tempFile)
// After
if err := os.Remove(tempFile); err != nil {
return fmt.Errorf("failed to remove temp file %s: %w", tempFile, err)
}
โ```
**Ignore:** Only if the file removal is truly best-effort:
โ```go
_ = os.Remove(tempFile) //nolint:errcheck // best-effort cleanup
โ```
```
### 5. Configuration Recommendations
Suggest `.golangci.yml` improvements:
```yaml
# Recommended golangci-lint configuration
linters:
enable:
# Bug detection
- govet
- staticcheck
- gosec
# Error handling
- errcheck
- errorlint
# Style
- gofmt
- goimports
- misspell
# Complexity
- cyclop
- gocognit
# Maintainability
- gocritic
- revive
- dupl
# Performance
- prealloc
- bodyclose
linters-settings:
cyclop:
max-complexity: 15
gocognit:
min-complexity: 20
funlen:
lines: 80
statements: 50
goimports:
local-prefixes: github.com/yourorg
errcheck:
check-type-assertions: true
check-blank: true
issues:
exclude-use-default: false
max-issues-per-linter: 0
max-same-issues: 0
run:
timeout: 5m
```
## Output Format
```markdown
## Lint Audit Report
**Project:** {name}
**Linters:** {count} active
**Total Findings:** {count}
### Summary
| Category | Count | Severity |
|----------|-------|----------|
| Bugs | {n} | ๐ด |
| Error Handling | {n} | ๐ด |
| Performance | {n} | ๐ก |
| Style | {n} | ๐ข |
| Complexity | {n} | ๐ก |
### Findings by Category
#### ๐ด Bugs ({n})
{detailed findings with explanations}
#### ๐ด Error Handling ({n})
{detailed findings with explanations}
...
### Configuration Recommendations
{suggested .golangci.yml changes}
### Quick Fixes Available
{list of auto-fixable issues with `golangci-lint run --fix`}
```
## Gopher Guides API Integration
> **Note:** API calls send source code to gopherguides.com for analysis. Ensure your organization's policy permits external code analysis.
For full API usage examples, see [API Usage Reference](../references/api-usage.md).
### Helper Script
After installation via `install.sh`, scripts are at `.github/skills/scripts/`. Run the full audit including lint + API:
```bash
bash .github/skills/scripts/audit.sh
```
### Severity Configuration
After installation via `install.sh`, lint categories map to severity levels at `.github/skills/config/severity.yaml`. See the [Setup Guide](../SETUP.md) for details.
## References
- Existing gopher-ai command: `plugins/go-dev/commands/lint-fix.md`
- [golangci-lint documentation](https://golangci-lint.run/)
- [Go Code Review Comments](https://github.com/golang/go/wiki/CodeReviewComments)
---
*Powered by [Gopher Guides](https://gopherguides.com) training materials.*
Related in Security
mac-ops
IncludedComprehensive macOS workstation operations โ diagnose kernel panics, identify failing drives, audit launchd startup items, decode wake reasons, triage TCC permission denials, manage APFS snapshots, recover from no-boot. Use for: Mac is slow, slow bootup, won't boot, kernel panic, kernel_task hot, mds_stores CPU, photoanalysisd, cloudd, login loop, gray screen, sleep wake failure, drive failing, IO errors, APFS snapshots eating space, Time Machine local snapshots, Spotlight indexing, launchd, LaunchAgent, LaunchDaemon, login items, TCC permissions, Full Disk Access, Screen Recording denied, Gatekeeper, quarantine, com.apple.quarantine, app is damaged, helper tool, /Library/PrivilegedHelperTools, pmset, wake reasons, dark wake, sysdiagnose, panic.ips, DiagnosticReports, configuration profile, MDM profile, remote diagnostics over SSH.
a11y-audit
IncludedRun accessibility audits on web projects combining automated scanning (axe-core, Lighthouse) with WCAG 2.1 AA compliance mapping, manual check guidance, and structured reporting. Output is configurable: markdown report only, markdown plus machine-readable JSON, or markdown plus issue tracker integration. Use this skill whenever the user mentions "accessibility audit", "a11y audit", "WCAG audit", "accessibility check", "compliance scan", or asks to check a web project for accessibility issues. Also trigger when the user wants to verify WCAG conformance or map findings to a specific standard (CAN-ASC-6.2, EN 301 549, ADA/AODA).
erpclaw
IncludedAI-native ERP system with self-extending OS. Full accounting, invoicing, inventory, purchasing, tax, billing, HR, payroll, advanced accounting (ASC 606/842, intercompany, consolidation), and financial reporting. 413 actions across 14 domains, 43 expansion modules. Constitutional guardrails, adversarial audit, schema migration. Double-entry GL, immutable audit trail, US GAAP.
assess
IncludedAssesses and rates quality 0-10 across multiple dimensions (correctness, maintainability, security, performance, testability, simplicity) with pros/cons analysis. Compares against project conventions and prior decisions from memory. Produces structured evaluation reports with actionable improvement suggestions. Use when evaluating code, designs, architectures, or comparing alternative approaches.
spring-boot-security-jwt
IncludedProvides JWT authentication and authorization patterns for Spring Boot 3.5.x covering token generation with JJWT, Bearer/cookie authentication, database/OAuth2 integration, and RBAC/permission-based access control using Spring Security 6.x. Use when implementing authentication or authorization in Spring Boot applications.
code-hardcode-audit
IncludedDetect hardcoded values, magic numbers, and leaked secrets. TRIGGERS - hardcode audit, magic numbers, PLR2004, secret scanning.