agentleFS
d-o-hubd-o-hub/github-template-ai-agents/.agents/skills/static-analysis/SKILL.md

static-analysis

Skill2 starsChanged 10 days agoMITView on GitHub

Triage and fix static analysis findings across any programming language. Use this skill when running linters (ruff, eslint, clippy, shellcheck), analyzing lint output, fixing warnings or errors, or managing cross-language static analysis results in a project — even if they just say "run the linter" or "fix the lint warnings". Trigger on "lint", "static analysis", "triage warnings", "fix findings". Not for code-review-assistant, security-code-auditor.

12 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use build-keil, can-debug and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • ZhongYechengSkill

    build-keil

    当需要通过 Keil MDK 命令行编译嵌入式工程,调用自带脚本解析工程文件、执行构建并定位固件产物时使用。

    Also in 3 projects that use this

  • ZhongYechengSkill

    can-debug

    当需要调试 CAN 总线通信时使用,支持通过 USB-CAN 适配器监听、发送 CAN 帧和扫描节点。

    Also in 3 projects that use this

  • iPlug2Skill

    build-cmake

    Build an iPlug2 plugin project using CMake with Ninja, Xcode, or Visual Studio generators

    Also in 3 projects that use this

  • +9 more from ZhongYecheng

The file

Show its rules and text

We split this skill into the rules it gives an agent

20 rules. 0 are common, 13 are distinctive, and 7 are very specific to this project.

  • 0

    Common

    Most of the 7 edited versions we read keep these.

  • 13

    Distinctive

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before committing changes (local linting).

    line 26
  2. Distinctive:

    When CI quality gates or linting workflows fail.

    line 27
  3. Distinctive:

    When integrating new languages or linters into a project.

    line 29
  4. Distinctive:

    Always run local linters before pushing to minimize CI round-trips.

    line 33
  5. Very specific:

    Run Targeted Linters: Use tools like markdownlint, shellcheck, or language-specific linters (e.g., eslint, ruff) on changed files.

    line 36
  6. Very specific:

    Verify Quality Gate: Run ./scripts/quality_gate.sh (if available) to ensure all local checks pass.

    line 37
  7. Distinctive:

    Read linter output from CI artifacts and PR annotations to identify regressions.

    line 41
  8. Very specific:

    Check CI Summary: Read ci-summary.md or GitHub Action logs.

    line 43
  9. Distinctive:

    Inspect Annotations: Look for line-specific comments from automated tools (Codacy, SonarCloud, GitHub Actions).

    line 44
  10. Distinctive:

    Follow this structured process when responding to analysis findings:

    line 49
  11. Distinctive:

    Error: Must be fixed or formally suppressed.

    line 52
  12. Distinctive:

    Warning: Should be fixed if possible.

    line 53
  13. Distinctive:

    If a fix is non-trivial or requires architectural changes, file a follow-up issue and document the technical debt.

    line 57
  14. Distinctive:

    Never suppress an error without documenting *why*.

    line 59
  15. Distinctive:

    Use the Required Comment Format.

    line 60
  16. Distinctive:

    Use the Codacy Analysis CLI for targeted pre-commit and PR-scoped analysis:

    line 76
  17. Very specific:

    If codacy.yml or a Codacy project exists:

    line 109
  18. Very specific:

    Triage via CLI: Use codacy pull-request to fetch and ignore false positives if the dashboard is not accessible.

    line 112
  19. Very specific:

    Configuration: Check .codacy.yml in the root for project-specific rules.

    line 113
  20. Very specific:

    When suppressing a linter finding (e.g., via eslint-disable, noqa, or # shellcheck disable), you MUST include a comment in the following …

    line 117

“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Static Analysis & Linter Triage

Expert skill for managing static analysis, PR triage, and linting feedback loops across any programming language.

Quick Check

  • Run pre-commit linters locally
  • Classify CI lint failures by severity
  • Auto-fix safe style/formatting issues
  • Document every suppression with a valid reason
  • File issues for complex architectural findings

When to Use

  • Before committing changes (local linting).
  • When CI quality gates or linting workflows fail.
  • During PR reviews to triage static analysis findings.
  • When integrating new languages or linters into a project.

Pre-commit Workflow

Always run local linters before pushing to minimize CI round-trips.

  1. Detect Changes: Identify files modified in the current session.
  2. Run Targeted Linters: Use tools like markdownlint, shellcheck, or language-specific linters (e.g., eslint, ruff) on changed files.
  3. Verify Quality Gate: Run ./scripts/quality_gate.sh (if available) to ensure all local checks pass.

CI Integration

Read linter output from CI artifacts and PR annotations to identify regressions.

  • Check CI Summary: Read ci-summary.md or GitHub Action logs.
  • Inspect Annotations: Look for line-specific comments from automated tools (Codacy, SonarCloud, GitHub Actions).
  • Match to Source: Map CI errors back to local files and line numbers.

Agent Triage Workflow

Follow this structured process when responding to analysis findings:

  1. Classify Severity:
    • Error: Must be fixed or formally suppressed. Blocks merge.
    • Warning: Should be fixed if possible. Indicates potential future issues.
  2. Auto-fix Safe Findings:
    • Immediately apply automated fixes for formatting (Prettier, gofmt), imports (ruff, isort), or simple style rules.
  3. Handle Complex Findings:
    • If a fix is non-trivial or requires architectural changes, file a follow-up issue and document the technical debt.
  4. Suppressions:
    • Never suppress an error without documenting why.
    • Use the Required Comment Format.

Linter Tool Registry

Language/TypeRecommended LinterLocal Command
Markdownmarkdownlint-cli2npx markdownlint-cli2 "**/*.md"
Shellshellcheckshellcheck scripts/*.sh
JS / TSeslintnpm run lint or npx eslint .
Pythonruffruff check .
Rustclippycargo clippy
Gogolangci-lintgolangci-lint run
Secretsgitleaksgitleaks detect --source . -v

Codacy Git-Aware Analysis

Use the Codacy Analysis CLI for targeted pre-commit and PR-scoped analysis:

# Pre-commit: analyze only staged files
codacy-analysis analyze --staged --output-format json

# Branch analysis: all changes vs merge base
codacy-analysis analyze --diff --output-format json

# PR analysis: changes vs PR target branch
codacy-analysis analyze --pr --output-format json

# Combine with specific tools
codacy-analysis analyze --staged --tool Ruff --tool ESLint9 --output-format json

When to use:

  • --staged — Before committing; catches issues in exactly the code you're about to commit
  • --diff — During development; sees all uncommitted + committed changes on the branch
  • --pr — During PR review; compares against the PR's target branch

Parse results with jq for triage:

# Count issues by severity
codacy-analysis analyze --staged --output-format json | jq '.issues | group_by(.severity) | map({severity: .[0].severity, count: length})'

# Get critical/high only
codacy-analysis analyze --staged --output-format json | jq '[.issues[] | select(.severity == "Error" or .severity == "High")]'

Codacy Integration

If codacy.yml or a Codacy project exists:

  1. Read PR Comments: Codacy posts findings as PR comments. Treat these as blocking if they are categorized as "Issues".
  2. Triage via CLI: Use codacy pull-request to fetch and ignore false positives if the dashboard is not accessible.
  3. Configuration: Check .codacy.yml in the root for project-specific rules.

Suppression Guidelines

When suppressing a linter finding (e.g., via eslint-disable, noqa, or # shellcheck disable), you MUST include a comment in the following format:

[tool-disable] <rule-id>: <reason> -- <agent-id> (<date>)

Example:

# shellcheck disable=SC2034: Variable is used in sourced lib -- Jules (2025-05-15)
UNUSED_VAR="internal"

Rationalizations

RationalizationReality
"Linting slows me down"Automated linting prevents 80% of trivial PR feedback, saving time in the long run.
"It's just a warning"Warnings today are bugs tomorrow. Fixing them early maintains a "broken window" free codebase.
"I'll fix it in the next PR"Technical debt starts with a single "I'll fix it later." Fix it now while the context is fresh.

Red Flags

  • Suppressing lint errors without a documented reason.
  • Pushing code that fails local ./scripts/quality_gate.sh.
  • Ignoring "style" findings that affect readability (e.g., inconsistent naming).
  • Manually fixing formatting instead of using automated tools.

See Also

  • code-review-assistant — PR review workflow with code smell detection
  • codacy — Local Codacy Analysis CLI for static analysis
  • codacy — Codacy CLI for local analysis and cloud data queries

Voice & Context

  • Default: professional + blog
  • Reference: voice-profiles skill for definitions and auto-detection.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.