一键导入
security-check
Run local security checks (golangci-lint gosec, go vet) before pushing to catch issues before CI
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Run local security checks (golangci-lint gosec, go vet) before pushing to catch issues before CI
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Guided dependency upgrade workflow for Go or frontend packages with lockstep bumping and CI verification
Development discipline guardrails for Go and Angular work. Use when implementing features, fixing bugs, or writing validation code. Enforces validation-first development, research escalation after repeated failures, real data testing, and comprehensive failure reporting.
Scaffold a new PostgreSQL migration pair (up + down) with sequential numbering
Run full pre-deployment validation for both frontend and backend
Scaffold a new Angular standalone component following project conventions
| name | security-check |
| description | Run local security checks (golangci-lint gosec, go vet) before pushing to catch issues before CI |
| disable-model-invocation | true |
Run local security analysis to catch issues before CI. Mirrors what CodeQL, govulncheck, and gosec check in the GitHub Actions pipeline.
/security-check [go|frontend|all]
Default: all
golangci-lint run
This runs gosec along with other linters configured in .golangci.yml. Any new findings in upstream code should be suppressed with exclusion rules, not code changes.
go vet ./...
go install golang.org/x/vuln/cmd/govulncheck@latest 2>/dev/null
govulncheck ./...
If govulncheck reports a vulnerability, check if the vulnerable code path is actually called. govulncheck uses call-graph analysis — only real invocations trigger alerts.
Search for common security anti-patterns in changed files:
# Log injection: user-controlled values logged without sanitization
git diff --name-only HEAD~1 -- '*.go' | xargs grep -n 'zap\.\(String\|Any\).*r\.\(URL\|Header\|Form\|Body\)' 2>/dev/null
# SQL injection: string concatenation in queries
git diff --name-only HEAD~1 -- '*.go' | xargs grep -n 'fmt\.Sprintf.*SELECT\|fmt\.Sprintf.*INSERT\|fmt\.Sprintf.*UPDATE\|fmt\.Sprintf.*DELETE' 2>/dev/null
# Hardcoded secrets
git diff --name-only HEAD~1 -- '*.go' '*.ts' | xargs grep -in 'password\s*=\s*"[^"]\+"\|secret\s*=\s*"[^"]\+"\|token\s*=\s*"[^"]\+"\|api_key\s*=\s*"[^"]\+' 2>/dev/null
npm run lint
npm audit
# innerHTML usage (XSS risk)
git diff --name-only HEAD~1 -- '*.ts' '*.html' | xargs grep -n 'innerHTML\|bypassSecurityTrust' 2>/dev/null
Security Check Results
──────────────────────
Go gosec (golangci-lint): PASS / FAIL / <N> findings
Go vet: PASS / FAIL
govulncheck: PASS / FAIL / <N> vulnerabilities
Pattern checks (Go): CLEAN / <N> warnings
Frontend lint: PASS / FAIL
npm audit: CLEAN / <N> advisories
Pattern checks (FE): CLEAN / <N> warnings
──────────────────────
Result: SECURE / NEEDS ATTENTION
If any step reports findings, list each one with file, line, and description. For gosec findings in upstream code, recommend adding exclusion rules to .golangci.yml.