aislop

scanaislopMIT活跃维护

专治 AI 编码助手留下的烂摊子:死代码、不安全类型转换、吞异常、重复代码和安全风险,50+ 条确定性规则覆盖 10 种语言,提供 CLI、CI 和 GitHub Actions 集成,运行时不调用 LLM。

Catch and fix the code-quality issues AI coding agents leave behind - dead code, unsafe casts, swallowed errors, duplication, security risks, and more. 50+ deterministic rules across 10 language targets, with CLI, CI, and GitHub Actions. No LLM at runtime. MIT.

v0.20.0发布于 2026-11-01 04:46 UTC737star +7 / 7 天42fork同步于 2026-11-10 17:56 UTC

怎么上手

由 README 提炼,执行前请确认
npx aislop@latest scan
npm install -g aislop && aislop hook install
硬件要求按 README 说明

README 未说明硬件要求;需 Node.js >= 20,Homebrew 安装会自动带上 Node.js,pipx 安装也要求 PATH 中有 Node.js

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

检测并修复 AI 编码代理留下的死代码、不安全类型转换、吞异常等代码质量问题

专治 AI 编码助手留下的烂摊子:死代码、不安全类型转换、吞异常、重复代码和安全风险,50+ 条确定性规则覆盖 10 种语言,提供 CLI、CI 和 GitHub Actions 集成,运行时不调用 LLM。

核心能力

  • 50+ 条确定性规则覆盖 11 种语言目标
  • 每次改动打 0–100 分,亚秒级且结果可复现
  • 运行时不用 LLM,相同代码得到相同分数
  • 支持 CLI、CI 门禁、GitHub Actions 与 SARIF 输出
  • 可安装编辑器 hook,在每次代理编辑后即时反馈

容易踩的坑

包安装不执行依赖生命周期脚本,需额外运行一次 aislop-tools 才有内置 Ruff 和 golangci-lint 覆盖;hook 直接调用 aislop,须先安装 CLI;非 11 种目标语言为主的仓库会拒绝给分,--json 返回 score: null

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v0.20.0
  1. v0.20.0最新正式版2026-11-01 · 2026-11-01 04:46 UTC

    A minor release. aislop scan --share prints a public report link and README badge for GitHub repos, and the scan summary points to it instead of the team invitation.

    Added

    • aislop scan --share. For a project with a GitHub origin remote, prints the public report link https://scanaislop.com/<owner>/<repo> and the README badge markdown. The report works for public repos only. The link is built from the local remote: nothing is uploaded and no network call is made. ssh://[email protected]/... remotes are now recognised as well.

    Changed

    • Scan summary hint. Interactive scans end with Share this report: aislop scan --share. The hint is left out of JSON and SARIF output, piped output, CI runs, aislop ci, and runs that already pass --share.
  2. v0.19.12026-10-28 · 2026-10-28 20:51 UTC
    查看更新说明

    v0.19.1 is a patch release. Info notices such as knip/skipped no longer fail a baselined aislop ci run, and the README no longer lists Java as unsupported.

    Fixed

    • Info notices no longer fail a baselined ci run. With a CI baseline, any finding not in the baseline failed the gate, including info notices. 0.19.0 added knip/skipped, so projects with a baseline and no Knip setup started failing aislop ci after upgrading. Info notices are still reported but no longer count as new findings.
    • README lists Java as supported. The unsupported-languages paragraph still said 10 language targets and named Java.

    Upgrading

    npx [email protected] scan
    

    If 0.19.0 started failing aislop ci on a project with a baseline, upgrading fixes it with no config change. To pin the GitHub Action and the CLI together, use uses: scanaislop/[email protected] with no version input.

    Validation

    • 2,411 tests passing across 233 files
    • Typecheck and build clean
    • aislop self-scan (aislop ci .) passes
    • pnpm audit: no known vulnerabilities
    • Reproduced the regression: a baselined project without Knip exits 1 on 0.19.0 and 0 on this release
  3. v0.19.02026-10-28 · 2026-10-28 18:47 UTC
    查看更新说明

    v0.19.0 is a minor release. Java projects now get real engine coverage, Knip can be set to run always or never, and a round of false positives and missed findings is fixed across hardcoded-url, unsafe-type-assertion, no-undef, unused-css, secret detection and dependency advice.

    Added

    • quality.knip setting. auto (the default) runs Knip for projects that declare or configure it. always runs aislop's bundled Knip on every JavaScript or TypeScript project, and off never runs it and reports no knip/skipped. Knip loads the project's config files, so always runs code from the scanned repository (#474).
    • Java support. Java projects get real engine coverage instead of detection only:
      • Strings, text blocks, chars, and comments are masked, so braces inside them no longer distort function lengths.
      • Package directories under src/<set>/java/ (and kotlin/) are no longer read as excluded or non-production folders, so com/example/demo or org/springframework/samples code is scanned and gets the full ai-slop checks.
      • Formatting runs google-java-format, including the AOSP style, when the build configures it (Spotless googleJavaFormat or fmt-maven-plugin).
      • Linting runs PMD with a focused set of bug-finding rules, or the project's own PMD ruleset, plus Checkstyle when the project has a checkstyle.xml.
      • Security flags SQL and process commands built by string concatenation or String.format, and ObjectInputStream / XMLDecoder deserialization.
      • AI-slop rules cover unused and duplicate imports, System.out leftovers, catch blocks that only print, and the new ai-slop/java-broad-throws.
      • aislop doctor shows the Java tools and how to install them.
    • knip/skipped notice. When Knip is not set up, times out or fails, an info finding says so (advisory, like security/dependency-audit-skipped) instead of the check disappearing while the scan still scores 100 (#474).

    Changed

    • Knip runs when a project declares or configures it. A knip config file or a "knip" key in package.json now counts, so npx knip users are covered. aislop always runs its own bundled Knip, never a copy from the scanned project (#474).
    • Links to scanaislop.com carry utm parameters. The visible link text is unchanged.

    Fixed

    • ai-slop/hardcoded-url false positives. A URL's own host no longer counts as config context and the TLD is never an environment signal, so vendor api. hosts and .dev/.app domains stay quiet. Social profiles, app store listings and legal pages (/privacy, /terms) are treated as public content links. Config-like names (API_ENDPOINT, apiBase) and internal hosts (orders-internal, myapp-staging) are still flagged (#479, #482, #493).
    • ai-slop/unsafe-type-assertion ignores comments. Comments are masked before matching, so a cast written inside a comment is no longer reported (#475).
    • eslint/no-undef respects /* global */ directives, matching ESLint (#478).
    • Knip unused files are reported again. Knip 6 moved them under issues[].files, so knip/files was never reported (#474).
    • Agent hooks write state at the project root. Lock, baseline and session files resolve to the project root instead of the agent's working directory, so stray nested .aislop/ folders are no longer created and the home directory's .aislop is never used (#472).
    • **Dependency advice no longer suggests downgrades as
  4. v0.18.12026-10-06 · 2026-10-06 22:17 UTC
    查看更新说明

    v0.18.1 is a patch release. Pinning the GitHub Action to a release tag now pins the CLI it runs, aislop agent shows the provider's own error when it fails, and dependency advisories are patched.

    Changed

    • The GitHub Action runs the CLI version that matches its ref. From this release, with no version input, a release tag ref such as uses: scanaislop/[email protected] runs [email protected], a commit SHA ref runs the version in that commit's package.json, and @v1 or a branch still runs the latest release. Pinning the Action now pins the CLI, and Dependabot's github-actions updates bump both. An explicit version input still wins.

    Fixed

    • Dependency advisories. proxy-addr (critical, through @modelcontextprotocol/sdk and express), source-map-js, and smol-toml are raised to patched releases.
    • aislop agent shows why the provider failed. When the provider exits with an error, the message now includes its last stderr lines instead of only the exit code (#228).

    Upgrading

    npx [email protected] scan
    

    To pin the GitHub Action and the CLI together, use uses: scanaislop/[email protected] with no version input. Dependabot's github-actions updates then bump both. @v1 still runs the latest release, and an explicit version input still wins.

    Validation

    • 2,324 tests passing across 219 files
    • Typecheck and build clean
    • aislop self-scan at 100/100 with no findings
    • pnpm audit: no known vulnerabilities
    • npm pack --dry-run produces aislop-0.18.1.tgz, 32 files, 600 kB
  5. v0.18.02026-10-05 · 2026-10-05 21:58 UTC
    查看更新说明

    v0.18.0 adds baseline mode, plus fixes for false positives reported by users. aislop baseline write lets an existing codebase gate CI on new findings only. Python import checks read every requirements file, PEP 723 metadata, and a new imports.provided list. Biome and ruff follow the project's own config and version. Missing tools are reported instead of silently skipped.

    Added

    • Baseline mode. aislop baseline write records the current findings in .aislop/ci-baseline.json, and with ci.baseline set, scan and ci fail only on findings that are not in it. Findings match on rule, file, and the text of the reported line rather than the line number, so unrelated edits do not re-raise them. Stale entries are reported and aislop baseline prune removes them, only when the fix can be confirmed, so a tool that fails quietly cannot shrink the baseline. The score still counts every finding. Thanks to @tykeal (#405).
    • imports.provided config. Modules that the runtime provides instead of a manifest (Home Assistant's homeassistant, Sage's fpylll, vscode in a VS Code extension) can be listed under imports.provided in .aislop/config.yml so ai-slop/hallucinated-import does not report them. Each entry covers its submodules.
    • ci.failOnMissingTools. Opt-in setting that makes scan and ci exit 1 when a format or lint tool needed for a detected language is not installed, instead of passing on a partial scan. Off by default.
    • ai-slop/unknown-directive. An aislop-ignore-* comment with a scope aislop does not recognise (for example aislop-ignore-nextline) used to be silently ignored. It is now reported as a warning, with the closest valid directive suggested, in JS/TS, Python, Go, C#, and C/C++ files.

    Fixed

    • The pre-commit hook runs only at the commit stage. .pre-commit-hooks.yaml now sets stages: [pre-commit]. Projects that also install pre-push hooks ran aislop scan --staged on push, which checks the index rather than the pushed commits. Requires pre-commit 3.2.0 or later.
    • braces advisory (GHSA-vfj7-8cjw-p6xm). micromatch, which pulled in braces, is replaced with picomatch, which has no dependencies. No patched braces release exists yet. Glob matching behaves the same.
    • Python import checks read more dependency sources. ai-slop/hallucinated-import now reads every requirements*.txt variant (requirements_dev.txt, requirements-test.txt, dev-requirements.txt, ...), files in a requirements/ directory, -r includes, and PEP 723 inline script metadata. Projects that kept dependencies outside requirements.txt and pyproject.toml got an error for every third-party import.
    • Ruff respects the project's exclude settings. aislop passes each Python file to ruff by name, and ruff ignores exclude/extend-exclude for explicitly named files unless told otherwise. Files a project excludes from ruff (vendored or legacy code) were reported by python-formatting and the ruff lint rules, and aislop fix could reformat them. Scan and fix now pass --force-exclude, so aislop checks the same files the project's own ruff format and ruff check do.
    • Biome formatting respects the project's Biome config. When a project has biome.json or biome.jsonc, scan and fix now use its settings instead of forcing a 120-column line width. Before, a project that relied on Biome's default width of 80 got formatting findings that its own Biome rejected, and aislop fix rewrote files so the project's biome format failed. biome.jsonc is now detected too.
    • Missing format and lint tools are reported. When a detected language's tool is not installed (for example ruff for Python), the scan output now says so with an aislop doctor hint, even on a clean run, and --json lists it in the engine's missingTools. Skipped engines also carry a skipReason, so a skip because of a missing tool can b

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    aislop

    Catch the slop AI coding agents leave in your code.

    npm version npm downloads PyPI downloads Homebrew tap CI aislop score License: MIT Node >= 20 Discord

    The patterns Claude Code, Cursor, Codex, and OpenCode leave behind: narrative comments above self-explanatory code, swallowed exceptions, hidden fallbacks, as any casts, hallucinated imports, duplicated helpers, dead code, todo stubs, oversized functions. Tests pass. Lint passes. The code rots anyway.

    aislop catches them. 50+ rules across 11 language targets (TypeScript, JavaScript, Expo / React Native, Python, Go, Rust, Ruby, PHP, Java, C#, C/C++). Scores every change 0–100. Sub-second. Deterministic: no LLM in the runtime path, same code in, same score out. MIT-licensed, free CLI.

    Quick start

    1. Scan. Get your score in seconds. No install needed, works on any project.

    npx aislop@latest scan
    

    2. Install the hook so your coding agent fixes slop before it lands, on every edit. The hook calls aislop directly, so install the CLI first.

    npm install -g aislop && aislop hook install
    

    Also available on npm, Yarn, Bun, Homebrew, and PyPI:

    npm install -g aislop                # npm
    yarn dlx aislop scan                 # Yarn (no install)
    bunx aislop scan                     # Bun (no install)
    bun add -g aislop                    # Bun
    brew install scanaislop/tap/aislop   # Homebrew
    pipx install aislop                  # Python
    

    See Installation for every option.

    Language support

    aislop supports TypeScript, JavaScript, Expo / React Native, Python, Go, Rust, Ruby, PHP, Java, C#, and C/C++.

    Coverage includes formatting, linting, complexity, AI-slop detection, and security checks. Some checks use optional system tools; see Installation and the rules reference for details.

    aislop agent                 # repair with your coding agent (Codex/Claude/OpenCode)
    aislop fix                   # auto-fix the mechanical issues
    aislop fix -f                # aggressive fixes (deps, unused files)
    aislop ci                    # CI mode (JSON + gate)
    aislop hook install --claude # per-edit hook
    

    Public badge: Show your score on your README

    [![aislop](https://badges.scanaislop.com/score/<owner>/<repo>.svg)](https://scanaislop.com)
    

    Run npx aislop@latest badge to auto-generate. Free at scanaislop.com.

    See it in action

    Scan

    aislop scan demo


    Installation

    The same CLI is published to npm, Homebrew, and PyPI. Pick whichever fits your stack.

    Node / npm

    # Run without installing
    npx aislop@latest scan
    bunx aislop@latest scan   # Bun
    
    # npm
    npm install --save-dev aislop
    
    # yarn
    yarn add --dev aislop
    
    # pnpm
    pnpm add -D aislop
    
    # bun
    bun add -d aislop
    
    # Global
    npm install -g aislop
    

    Also available as @scanaislop/aislop on GitHub Packages.

    Package installation does not run dependency lifecycle scripts. After installing, run aislop-tools once if you want bundled Ruff and golangci-lint coverage; the core scanner works without it.

    Homebrew (macOS / Linux)

    brew install scanaislop/tap/aislop
    

    Homebrew installs Node.js as a dependency if it isn't already present. Details: homebrew-tap.

    Python / pipx

    pipx install aislop
    

    pipx keeps aislop in its own isolated environment. Needs Node.js on PATH. Details: PyPI package.

    Full reference for every channel, optional bundled tooling, and external tools: docs/installation.md.


    Usage

    Examples below use the installed aislop binary. For a one-off latest run, prefix the command with npx aislop@latest, for example npx aislop@latest scan.

    Command reference

    aislop --help              # clean overview
    aislop commands            # every public command and major flag
    aislop <command> --help    # detailed help for one command
    aislop version             # installed version
    aislop -V                  # installed version
    aislop update              # current and latest npm versions
    

    Scan

    aislop scan                       # current directory
    aislop scan ./src                 # specific directory
    aislop scan --changes             # changed files from HEAD
    aislop scan --changes --base origin/main  # changed vs a base branch (PRs)
    aislop scan --staged              # staged files only
    aislop scan -d                    # verbose file/rule detail
    aislop scan --json                # JSON output
    aislop scan --sarif               # SARIF 2.1.0 output (GitHub code scanning)
    aislop scan --format json         # alternate JSON form
    aislop scan --include "src/**"    # only matching paths
    aislop scan --exclude "dist,gen"  # skip extra paths
    aislop scan --share               # print a public report link and badge
    

    Share: --share reads the origin remote and, for a GitHub repo, prints the public report link https://scanaislop.com/<owner>/<repo> and the README badge markdown. The report works for public repos only. Anyone with the link can see the score for the default branch. Nothing is uploaded and no network call is made; the page scans the public repo itself.

    Exclude files: node_modules, .git, dist, build, coverage excluded by default. Add more in .aislop/config.yml:

    exclude:
      - "**/*.test.ts"
      - src/generated
    

    Or via CLI: aislop scan --exclude "**/*.test.ts,dist"

    Unsupported languages: aislop only analyses the 11 language targets above. If a repo is mostly something else (Swift, Kotlin, Scala, …), scoring a handful of incidental files would misrepresent it, so aislop withholds the score and says so rather than printing a number off code it never read. --json returns score: null, scoreable: false, and a coverage breakdown.

    Per-rule severity: Override the severity of any rule by id, or turn it off:

    # .aislop/config.yml
    rules:
      ai-slop/narrative-comment: warning   # error | warning | off
      ai-slop/trivial-comment: "off"       # drop this rule entirely
      security/hardcoded-secret: error
    

    off drops matching diagnostics; error/warning rewrites severity before scoring and reporting. Absent map keeps default behavior.

    Suppress findings inline: Silence a specific line when you know better, with an optional reason after --:

    // aislop-ignore-next-line ai-slop/hidden-fallback -- options is validated upstream
    const opts = { ...defaults, ...(input || {}) };
    
    const legacy = doThing(); // aislop-ignore-line
    

    aislop-ignore-next-line covers the line below, aislop-ignore-line (or a bare aislop-ignore) the line it sits on, and aislop-ignore-file (place anywhere in the file) the whole file. Name one or more rules to scope the suppression, or omit them to silence every rule on that line. The directive works in any comment syntax (//, #, <!-- -->). Suppressed findings are removed before scoring, and the run reports how many were silenced. A misspelled directive such as aislop-ignore-nextline suppresses nothing and is reported as ai-slop/unknown-directive.

    Ignore whole paths: Add an .aislopignore at the project root (same glob semantics as exclude, # comments allowed):

    src/generated
    **/*.snap
    legacy
    

    Extend config: Project config can extend a parent:

    # .aislop/config.yml
    extends: ../../.aislop/base.yml
    ci:
      failBelow: 80             # override specific keys
    

    Editor validation: Point your editor at the JSON Schema in schema/aislop.config.schema.json for autocomplete and validation of .aislop/config.yml. Regenerate it from the source config schema with pnpm gen:schema.

    Fix

    The deterministic layer beneath aislop agent: auto-fix what's purely mechanical (formatters, unused imports, dead code). For anything that needs judgement, reach for aislop agent or hand off to your coding agent with full diagnostic info.

    aislop fix                 # auto-fixes
    aislop fix --dry-run       # preview planned steps without writing files
    aislop fix --changes       # only rewrite files changed vs HEAD
    aislop fix --staged        # only rewrite staged files
    aislop fix -d              # detailed fix progress
    aislop fix --safe          # only reversible fixes (imports, comment removal, safe formatters)
    aislop fix -f              # aggressive: deps, unused files
    aislop fix -p              # print an agent handoff prompt
    

    --safe restricts the run to fixes that cannot change behaviour — unused-import removal, import merging, narrative-comment removal, and formatter runs that do not execute project-controlled configuration. Anything that deletes code, rewrites behaviour/attributes, or can load executable formatter configuration (console/dead-code removal, lint autofixes, Ruby/PHP formatter config, unused-declaration and dependency pruning) is skipped, so a --safe run is genuinely "apply and commit".

    Run a local repair agent

    aislop agent keeps the deterministic scanner in charge while using the coding agent you already have installed. It creates a local git worktree, runs safe fixes, streams a headless Codex / Claude Code / OpenCode / Pi repair session, verifies the result with aislop scan --json, writes a local session transcript, and leaves the diff for review.

    aislop agent providers        # see installed providers and setup hints
    aislop agent connect codex    # run the provider's own local login flow
    aislop agent use codex        # save a repo-local default provider
    aislop agent use auto         # clear the default and auto-detect
    aislop agent plan             # preview provider, worktree, findings, PR/apply behavior
    aislop agent monitor          # stream scans when local git changes settle
    aislop agent monitor --background
    aislop agent monitor list     # list background monitors
    aislop agent monitor stop     # stop the latest background monitor
    aislop agent monitor --repair --in-place
    aislop agent                  # auto-pick an installed provider
    aislop agent --provider codex # switch provider
    aislop agent --background     # run locally in the background
    aislop agent --apply          # apply verified diff back to this repo
    aislop agent --pr             # commit, push, and open a draft PR
    aislop agent sessions         # list recent local repair sessions
    aislop agent show             # show the latest session timeline and summary
    aislop agent apply            # apply a reviewed worktree session later
    aislop agent watch            # stream the latest session transcript
    aislop agent stop             # stop the latest running background session
    

    No OpenAI or Anthropic API key is requested by aislop; provider CLIs use their own existing local auth. A saved provider default lives in .aislop/agent/provider.json and is kept out of commits through the repo's local Git exclude. Session transcripts live under .aislop/agent/sessions/, and agent sessions/worktrees are also excluded locally. Provider JSONL is normalized in the terminal stream while raw lines stay in the transcript.

    Hand off to agent

    When auto-fix can't solve it, pass the remaining issues to your coding agent with full context:

    aislop fix --claude        # Claude Code
    aislop fix --codex         # Codex CLI
    aislop fix --cursor        # Cursor (copies to clipboard)
    aislop fix --gemini        # Gemini CLI
    aislop fix --prompt        # print prompt (agent-agnostic)
    

    Other fix handoff flags: --windsurf, --vscode, --amp, --antigravity, --deep-agents, --kimi, --opencode, --warp, --aider, --goose, --pi, --crush.

    Install hook

    Runs after every agent edit. Feedback flows back immediately.

    aislop hook install --claude           # Claude Code
    aislop hook install --cursor           # Cursor
    aislop hook install --gemini           # Gemini CLI
    aislop hook install --pi               # pi
    aislop hook install                    # pick agents interactively
    aislop hook install claude cursor      # specific agents
    aislop hook install --agent claude,pi  # comma-separated agents
    aislop install claude cursor           # alias for hook install
    aislop install hooks --claude          # natural alias for hook install
    

    Runtime adapters (scan + feedback): claude, cursor, gemini, pi.
    Rules-only (agent reads rules): codex, windsurf, cline, kilocode, antigravity, copilot.

    Hook install flags: --agent <names>, -g, --global, --project, --dry-run, --yes, --quality-gate, plus per-agent shortcuts --claude, --cursor, --gemini, --pi, --codex, --windsurf, --cline, --kilocode, --antigravity, --copilot.

    Quality-gate mode: Blocks if score regresses below baseline.

    aislop hook install --claude --quality-gate
    aislop hook baseline                    # re-capture baseline
    aislop hook status                      # list installed
    aislop hook uninstall --claude          # remove
    aislop uninstall claude                  # alias for hook uninstall
    aislop uninstall hooks --claude          # natural alias for hook uninstall
    

    Docs: /docs/hooks

    MCP server

    Expose aislop as MCP tools for Claude Desktop, Cursor, Codex:

    // ~/.cursor/mcp.json or Claude Desktop config
    {
      "mcpServers": {
        "aislop": {
          "command": "npx",
          "args": ["-y", "aislop-mcp"]
        }
      }
    }
    

    Tools: aislop_scan, aislop_fix, aislop_why, aislop_baseline

    CI

    aislop ci                  # JSON output, exits 1 if score < threshold
    aislop ci --changes --base origin/main  # gate only the files a PR changes
    aislop ci --human          # human-friendly CI output
    aislop ci --sarif          # SARIF output for code scanning
    aislop baseline write      # accept current findings; ci then fails only on new ones
    aislop baseline prune      # drop baseline entries for findings you fixed
    

    Set ci.baseline: .aislop/ci-baseline.json after aislop baseline write so scan and ci use it. See docs/ci.md.

    ci accepts the same --changes / --staged / --base <ref> scoping as scan. Use --changes --base origin/<target> to gate a pull request on only the files it touches; the score gate and exit code still apply.

    Other commands

    aislop                         # interactive menu
    aislop init                    # create .aislop/config.yml
    aislop init --strict           # enterprise-grade gate: all engines, typecheck, failBelow 85
    aislop doctor                  # check which engines can run here
    aislop rules                   # list rules with severity, fixability, and score impact
    aislop rules --search          # searchable rule explorer
    aislop badge                   # print badge URL
    aislop badge --owner o --repo r --json
    aislop trend                   # show score history over time
    aislop trends                  # alias for trend
    aislop trend --limit 20
    aislop update                  # show current and latest npm versions
    aislop upgrade                 # alias for update
    aislop commands                # full command list
    

    Score history: a normal (full-project, interactive) scan appends a compact record to .aislop/history.jsonl (timestamp, score, error/warning counts, file count, CLI version). aislop trend and aislop trends read it and print a relative-time table plus an ASCII sparkline of recent scores. History is a local side effect only: it is never written for --json/--sarif output, in CI, or when AISLOP_NO_HISTORY=1 is set, so machine output stays clean.

    Docs: commands


    CI integration

    Pre-commit

    Run directly on staged files:

    aislop scan --staged
    

    Or wire it into the pre-commit framework via the bundled hook:

    # .pre-commit-config.yaml
    repos:
      - repo: https://github.com/scanaislop/aislop
        rev: v1
        hooks:
          - id: aislop
    

    GitHub Actions

    Run aislop init and accept the workflow prompt, or add manually. The self-contained form always runs the latest CLI, so there's nothing to bump:

    name: aislop
    
    on:
      pull_request:
      push:
        branches: [main]
    
    jobs:
      quality-gate:
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v4
          - uses: actions/setup-node@v4
            with:
              node-version: 24
          - run: npx --yes aislop@latest ci
    

    Prefer the Marketplace Action? @v1 runs the latest release. From v0.18.1, pinning a release tag such as @v0.18.1 (or its commit SHA) runs the matching CLI version, so Dependabot's github-actions updates keep it current. Older tags run the latest CLI unless version is set.

    - uses: actions/checkout@v4
    - uses: scanaislop/[email protected]
    

    GitHub code scanning (SARIF): emit a SARIF 2.1.0 report and upload it so findings appear in the Security tab:

    - run: npx aislop@latest scan . --sarif > aislop.sarif
    - uses: github/codeql-action/upload-sarif@v3
      with:
        sarif_file: aislop.sarif
    

    Bitbucket Pipelines

    Bitbucket clones shallow by default, so fetch the PR target branch and gate on only the changed files with ci --changes --base:

    # bitbucket-pipelines.yml
    pipelines:
      pull-requests:
        "**":
          - step:
              name: aislop gate
              image: node:24
              clone:
                depth: full   # branch diffs need history
              script:
                - git fetch origin "$BITBUCKET_PR_DESTINATION_BRANCH"
                - npx --yes aislop@latest ci --changes --base FETCH_HEAD
    

    ci applies the score gate and exit code, so no JSON parsing or hand-rolled threshold is needed. More providers: CI/CD.

    Quality gate

    Set minimum score in .aislop/config.yml:

    ci:
      failBelow: 70
    

    aislop ci exits 1 when score < threshold. Docs: CI/CD


    For teams

    scanaislop is the hosted platform for teams:

    • PR gates with score thresholds
    • Standards hierarchy (org → team → project)
    • Dashboards and agent attribution
    • Visual rules manager

    Same engines, same scores. CLI is MIT-licensed. Learn more →


    Why aislop

    AI coding tools generate code that compiles and passes tests but ships with patterns no engineer would write. aislop gives you one score, one gate, and auto-fixes what it can.

    • One score: 0-100, enforced in CI. Weighted so sloppy patterns hit harder than style noise.
    • Auto-fix first: Clears formatters, unused imports, dead code mechanically. Hands off the rest to your agent with full context.
    • Deterministic: Regex + AST + standard tooling. No LLMs, no API calls. Same code in, same score out.
    • Zero-config start: npx aislop@latest scan works on any repo. Add .aislop/config.yml to tune.

    What it catches

    Six deterministic engines run in parallel:

    EngineWhat it checksHow
    FormattingCode style consistencyBiome, ruff, gofmt, cargo fmt, rubocop, php-cs-fixer, google-java-format, dotnet format, clang-format
    LintingLanguage-specific issuesoxlint, ruff, golangci-lint, clippy, expo-doctor, PMD, Checkstyle, Roslynator, JetBrains InspectCode, cppcheck, clang-tidy
    Code QualityComplexity and dead codeFunction/file size limits, deep nesting, unused files/deps (knip), AST-based unused-declaration removal
    AI SlopAI-authored code patternsNarrative comments, trivial comments, dead patterns, unused imports, as any, console.log leftovers, TODO stubs, generic names
    SecurityVulnerabilities and risky codeeval, innerHTML, SQL/shell injection, unsafe deserialization, dependency audits for JavaScript, Python, Rust, Go, and .NET
    ArchitectureStructural rules (opt-in)Custom import bans, layering rules, required patterns

    See the full rules reference.


    Research

    aislop rules are shaped by public scans and benchmark-derived failure modes, not only local fixtures. The research program defines how to run repeatable open-source scans: pin the cohort, store raw JSON, classify findings, fix noisy rules with regression tests, and publish the limits.


    Docs

    Docs on the website (preferred for search and agents): start · commands · rules · configure · scoring · CI · hooks

    In this repo: Installation · Commands · Rules · Config · Scoring · CI/CD · Telemetry · Research program

    Community

    Discord for community chat and support · Discussions for questions, rule requests, and false-positive triage · Issues for bugs

    Contributing

    See CONTRIBUTING.md. AI assistants: AGENTS.md.

    Acknowledgments

    Built on: Biome, oxlint, knip, ruff, golangci-lint, expo-doctor

    Contributors

    Auto-updated by .github/workflows/contributors.yml. Link commit email or add to .github/contributors-overrides.json.

    License

    MIT