// Run static analysis, security scans, and dependency checks on .NET code. Use when task involves code quality, security audits, or vulnerability detection.
| name | code-analyze |
| version | 0.1.0 |
| kind | cli |
| description | Run static analysis, security scans, and dependency checks on .NET code. Use when task involves code quality, security audits, or vulnerability detection. |
| inputs | {"analysis_type":["static","security","dependencies","all"],"project_path":"string","severity_filter":["error","warning","suggestion","all"]} |
| contracts | {"success":"Analysis completes with findings report; exit code 0","failure":"Non-zero exit code or tool execution errors"} |
Goal: Guide agent to the exact analysis procedure needed.
references/static-analysis.mdreferences/security-scan.mdreferences/dependency-check.mdNOT for: building (dotnet-build), testing (dotnet-test), or formatting (code-format)
Inputs: analysis_type (static/security/dependencies/all), project_path (default: ./dotnet/PigeonPea.sln), severity_filter (error/warning/suggestion)
Outputs: analysis_report (findings with file/line), exit_code (0=clean, 1=issues), metrics (violations by severity)
Guardrails: Analyze only, never modify code, report all findings with context, fail on critical issues
1. Static Code Analysis โ references/static-analysis.md
2. Security Scanning โ references/security-scan.md
3. Dependency Vulnerability Check โ references/dependency-check.md
cd ./dotnet
dotnet build PigeonPea.sln /p:TreatWarningsAsErrors=true
dotnet list package --vulnerable
cd ./dotnet
dotnet build PigeonPea.sln /p:RunAnalyzers=true /warnaserror
pre-commit run gitleaks --all-files
pre-commit run detect-secrets --all-files
cd ./dotnet
dotnet list package --vulnerable --include-transitive
dotnet list package --outdated
# Run from repository root
.agent/skills/code-analyze/scripts/analyze.sh --all
cd ./dotnet
# Errors only
dotnet build PigeonPea.sln /p:TreatWarningsAsErrors=false
# Warnings as errors
dotnet build PigeonPea.sln /p:TreatWarningsAsErrors=true
No analyzers found: Verify Roslyn analyzers enabled. See references/static-analysis.md.
Too many warnings: Filter by severity or add suppressions. See references/static-analysis.md.
False positives: Use .editorconfig or suppressions. See references/static-analysis.md.
Secrets not detected: Check .gitleaksignore and .secrets.baseline. See references/security-scan.md.
Dependency scan fails: Network issues or package restore needed. See references/dependency-check.md.
Static Analysis:
Build succeeded.
0 Warning(s)
0 Error(s)
Security Scan:
gitleaks................Passed
detect-secrets...........Passed
Dependency Check:
No vulnerable packages found.
Before commit: Run security scans (gitleaks, detect-secrets) After build: Run static analysis (Roslyn, StyleCop) Regular checks: Run dependency vulnerability checks
CI/CD Integration: Include all analysis in build pipeline, fail on critical issues
./dotnet/ARCHITECTURE.md - Project structure.pre-commit-config.yaml - Pre-commit hooks.editorconfig - Code style rulesdotnet-build - Build skill