Skip to content

Coding Agents

MegaLinter is designed to work hand in hand with your coding agent:

Claude Code Cursor GitHub Copilot CLI Codex Antigravity OpenCode Gemini CLI Windsurf Cline Roo Code Kilo Code Amp Goose OpenHands Qwen Code

Get started

Install the MegaLinter agent skills at the root of your repository:

With Claude Code (the skills are copied directly into .claude/skills/):

npx skills add oxsecurity/megalinter/skills -s '*' -a claude-code -y

With another coding agent, replace claude-code with your agent's identifier (cursor, github-copilot, codex, antigravity, opencode... full list in the skills CLI documentation) — or let the CLI detect your installed agents and install the skills for all of them at once:

npx skills add oxsecurity/megalinter/skills -s '*' -y --copy

Then just talk to your agent:

  • "Setup MegaLinter on this repo"
  • "Run MegaLinter and fix the errors"
  • "Why is the MegaLinter CI job failing? Fix it"

What the skills do

Skill Role
megalinter Entry point: detects the repository state and orchestrates the other skills in a check → fix → re-check loop (3 iterations max)
megalinter-setup Installs or upgrades MegaLinter using npx mega-linter-runner --install (non-interactive), then refines .mega-linter.yml
megalinter-check Collects errors: watches a MegaLinter CI job (GitHub Actions, GitLab CI, Azure Pipelines, Bitbucket Pipelines) or runs MegaLinter locally with docker/podman
megalinter-fix Fixes errors guided by a per-linter fix guide (one for each of the 124 linters, loaded only when its linter has errors), asks you before disabling rules or pushing

Sub-agents orchestration

On agents supporting sub-agents (Claude Code, OpenCode, GitHub Copilot custom agents...), megalinter-setup installs three sub-agents that keep large CI logs and linter outputs out of your main agent's context, and run on low-cost models when possible:

flowchart TD
    U(["👤 You: <i>run megalinter and fix the errors</i>"]) --> O["🎯 megalinter<br/>(orchestrator skill)"]
    O -->|"no config found"| S["🛠️ megalinter-setup"]
    S -->|"npx mega-linter-runner --install"| CFG[/".mega-linter.yml<br/>+ CI workflow"/]
    O --> C["🔍 megalinter-check"]
    C -->|"watch mode"| W[["👀 megalinter-watcher<br/>sub-agent, low-cost model"]]
    W --> CI[/"CI job logs<br/>GitHub / GitLab / Azure / Bitbucket"/]
    C -->|"local mode"| RUN[["🐳 megalinter-runner<br/>sub-agent, low-cost model"]]
    RUN --> IMG[/"MegaLinter Docker image<br/>docker or podman"/]
    W --> ERR[/"📋 Compact error list<br/>grouped by linter"/]
    RUN --> ERR
    ERR --> F["🔧 megalinter-fix"]
    F -->|"one sub-agent per failing linter,<br/>in parallel"| FX1[["🤖 megalinter-fixer<br/>+ python_ruff fix guide"]]
    F --> FX2[["🤖 megalinter-fixer<br/>+ markdown_markdownlint fix guide"]]
    FX1 --> RES[/"✏️ Fixed files<br/>+ proposed rule disables"/]
    FX2 --> RES
    RES -->|"you confirm disables"| RC["♻️ Targeted re-check<br/>parallel standalone linter images"]
    RC -->|"errors remain (max 3 loops)"| F
    RC -->|"clean"| DONE(["✅ Commit on a branch<br/>(never on main)"])

    classDef user fill:#e8f5e9,stroke:#2e7d32,stroke-width:2px,color:#1b5e20
    classDef skill fill:#ede7f6,stroke:#5e35b1,stroke-width:2px,color:#311b92
    classDef subagent fill:#e3f2fd,stroke:#1976d2,stroke-width:2px,color:#0d47a1
    classDef artifact fill:#fff8e1,stroke:#f9a825,stroke-width:1px,color:#5d4037
    classDef recheck fill:#e0f2f1,stroke:#00897b,stroke-width:2px,color:#004d40

    class U,DONE user
    class O,S,C,F skill
    class W,RUN,FX1,FX2 subagent
    class CFG,CI,IMG,ERR,RES artifact
    class RC recheck

The fix guides combine information generated from the linter descriptors (auto-fix support, rules documentation URLs, MegaLinter tuning variables) with curated fix, inline-disable and ignore instructions grounded in each linter's official documentation.

Safety rules

  • Safe fixes are applied automatically; ambiguous ones are asked to you
  • Disabling a linter or a rule always requires your confirmation
  • Commits are never pushed to the default branch

See also the installation page for coding agents.