Agent skill
static-analysis
Static code analysis tools and patterns
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/static-analysis-baphled-dotopencode
SKILL.md
Skill: static-analysis
What I do
I provide guidance on static code analysis tools and patterns across multiple languages. I help detect bugs, code smells, security vulnerabilities, and style violations without executing code, ensuring issues are caught early in the development cycle.
When to use me
- Before committing code (pre-commit hooks)
- During code review to automate style/convention checks
- Setting up CI/CD pipelines with quality gates
- Investigating code quality or complexity issues
Core principles
- Fast Feedback - Run tools that provide immediate results without execution.
- Prevent, Don't Detect - Catch issues locally before they reach the team/repo.
- Automate Everything - Integrate into IDE, pre-commit hooks, and CI pipelines.
- Configuration as Code - Store tool configs (e.g.,
.golangci.yml) in version control. - Progressive Enforcement - Start with basic rules and gradually tighten them.
Analysis Categories & Tools
| Category | Purpose | Tools (Go/Ruby/TS) |
|---|---|---|
| Formatting | Consistent style | gofmt / rubocop / prettier |
| Linting | Idioms & conventions | golangci-lint / rubocop / eslint |
| Bugs | Logic errors | staticcheck / reek / tsc |
| Security | Vulnerabilities | gosec / brakeman / npm audit |
| Complexity | Maintainability | gocyclo / flog / complexity (eslint) |
| Duplication | DRY violations | dupl / flay / jscpd |
Integration Patterns
- IDE: Real-time feedback and auto-fix on save.
- Pre-commit: Local gate preventing commits with lint errors.
- CI/CD: Team gate ensuring all merged code meets quality standards.
Handling False Positives
- Inline: Use specific comments (e.g.,
//nolint:errcheck,# rubocop:disable) with justification. - Exclusion: Update configuration files to exclude specific files or rules if justified.
Anti-patterns to avoid
- ❌ Disabling without understanding - Learn the rule's purpose before silencing it.
- ❌ Ignoring legacy violations - Technical debt grows if not addressed incrementally.
- ❌ No CI enforcement - Local checks are easily bypassed or forgotten.
- ❌ Too many tools - Overwhelming noise leads to the team ignoring results.
KB Reference
~/vaults/baphled/3. Resources/Knowledge Base/AI Development System/Skills/Code-Quality/Static Analysis.md
Related skills
clean-code- The standards that static analysis enforcescheck-compliance- Running the full suite of checksfix-architecture- Remediating architectural violations detectedsecurity- Deep-dive security analysis
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?