包安装不执行依赖生命周期脚本,需额外运行一次 aislop-tools 才有内置 Ruff 和 golangci-lint 覆盖;hook 直接调用 aislop,须先安装 CLI;非 11 种目标语言为主的仓库会拒绝给分,--json 返回 score: null
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.
npx aislop@latest scan
npm install -g aislop && aislop hook installREADME 未说明硬件要求;需 Node.js >= 20,Homebrew 安装会自动带上 Node.js,pipx 安装也要求 PATH 中有 Node.js
检测并修复 AI 编码代理留下的死代码、不安全类型转换、吞异常等代码质量问题
专治 AI 编码助手留下的烂摊子:死代码、不安全类型转换、吞异常、重复代码和安全风险,50+ 条确定性规则覆盖 10 种语言,提供 CLI、CI 和 GitHub Actions 集成,运行时不调用 LLM。
核心能力
- 50+ 条确定性规则覆盖 11 种语言目标
- 每次改动打 0–100 分,亚秒级且结果可复现
- 运行时不用 LLM,相同代码得到相同分数
- 支持 CLI、CI 门禁、GitHub Actions 与 SARIF 输出
- 可安装编辑器 hook,在每次代理编辑后即时反馈
容易踩的坑
- v0.20.0最新正式版2026-11-01 · 2026-11-01 04:46 UTC
A minor release.
aislop scan --shareprints 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 GitHuboriginremote, prints the public report linkhttps://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.
- v0.19.12026-10-28 · 2026-10-28 20:51 UTC
查看更新说明
v0.19.1 is a patch release. Info notices such as
knip/skippedno longer fail a baselinedaislop cirun, and the README no longer lists Java as unsupported.Fixed
- Info notices no longer fail a baselined
cirun. With a CI baseline, any finding not in the baseline failed the gate, including info notices. 0.19.0 addedknip/skipped, so projects with a baseline and no Knip setup started failingaislop ciafter 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] scanIf 0.19.0 started failing
aislop cion a project with a baseline, upgrading fixes it with no config change. To pin the GitHub Action and the CLI together, useuses: scanaislop/[email protected]with noversioninput.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
- Info notices no longer fail a baselined
- 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.knipsetting.auto(the default) runs Knip for projects that declare or configure it.alwaysruns aislop's bundled Knip on every JavaScript or TypeScript project, andoffnever runs it and reports noknip/skipped. Knip loads the project's config files, soalwaysruns 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/(andkotlin/) are no longer read as excluded or non-production folders, socom/example/demoororg/springframework/samplescode is scanned and gets the full ai-slop checks. - Formatting runs google-java-format, including the AOSP style, when the build configures it (Spotless
googleJavaFormatorfmt-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, andObjectInputStream/XMLDecoderdeserialization. - AI-slop rules cover unused and duplicate imports,
System.outleftovers, catch blocks that only print, and the newai-slop/java-broad-throws. aislop doctorshows the Java tools and how to install them.
knip/skippednotice. When Knip is not set up, times out or fails, an info finding says so (advisory, likesecurity/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 inpackage.jsonnow counts, sonpx knipusers 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-urlfalse positives. A URL's own host no longer counts as config context and the TLD is never an environment signal, so vendorapi.hosts and.dev/.appdomains 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-assertionignores comments. Comments are masked before matching, so a cast written inside a comment is no longer reported (#475).eslint/no-undefrespects/* global */directives, matching ESLint (#478).- Knip unused files are reported again. Knip 6 moved them under
issues[].files, soknip/fileswas 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.aislopis never used (#472). - **Dependency advice no longer suggests downgrades as
- 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 agentshows 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
versioninput, a release tag ref such asuses: scanaislop/[email protected]runs[email protected], a commit SHA ref runs the version in that commit'spackage.json, and@v1or a branch still runs the latest release. Pinning the Action now pins the CLI, and Dependabot'sgithub-actionsupdates bump both. An explicitversioninput still wins.
Fixed
- Dependency advisories.
proxy-addr(critical, through@modelcontextprotocol/sdkandexpress),source-map-js, andsmol-tomlare raised to patched releases. aislop agentshows 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] scanTo pin the GitHub Action and the CLI together, use
uses: scanaislop/[email protected]with noversioninput. Dependabot'sgithub-actionsupdates then bump both.@v1still runs the latest release, and an explicitversioninput 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 vulnerabilitiesnpm pack --dry-runproducesaislop-0.18.1.tgz, 32 files, 600 kB
- The GitHub Action runs the CLI version that matches its ref. From this release, with no
- 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 writelets an existing codebase gate CI on new findings only. Python import checks read every requirements file, PEP 723 metadata, and a newimports.providedlist. Biome and ruff follow the project's own config and version. Missing tools are reported instead of silently skipped.Added
- Baseline mode.
aislop baseline writerecords the current findings in.aislop/ci-baseline.json, and withci.baselineset,scanandcifail 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 andaislop baseline pruneremoves 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.providedconfig. Modules that the runtime provides instead of a manifest (Home Assistant'shomeassistant, Sage'sfpylll,vscodein a VS Code extension) can be listed underimports.providedin.aislop/config.ymlsoai-slop/hallucinated-importdoes not report them. Each entry covers its submodules.ci.failOnMissingTools. Opt-in setting that makesscanandciexit 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. Anaislop-ignore-*comment with a scope aislop does not recognise (for exampleaislop-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.yamlnow setsstages: [pre-commit]. Projects that also installpre-pushhooks ranaislop scan --stagedon push, which checks the index rather than the pushed commits. Requires pre-commit 3.2.0 or later. bracesadvisory (GHSA-vfj7-8cjw-p6xm).micromatch, which pulled inbraces, is replaced withpicomatch, which has no dependencies. No patchedbracesrelease exists yet. Glob matching behaves the same.- Python import checks read more dependency sources.
ai-slop/hallucinated-importnow reads everyrequirements*.txtvariant (requirements_dev.txt,requirements-test.txt,dev-requirements.txt, ...), files in arequirements/directory,-rincludes, and PEP 723 inline script metadata. Projects that kept dependencies outsiderequirements.txtandpyproject.tomlgot an error for every third-party import. - Ruff respects the project's
excludesettings. aislop passes each Python file to ruff by name, and ruff ignoresexclude/extend-excludefor explicitly named files unless told otherwise. Files a project excludes from ruff (vendored or legacy code) were reported bypython-formattingand the ruff lint rules, andaislop fixcould reformat them. Scan and fix now pass--force-exclude, so aislop checks the same files the project's ownruff formatandruff checkdo. - Biome formatting respects the project's Biome config. When a project has
biome.jsonorbiome.jsonc,scanandfixnow 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, andaislop fixrewrote files so the project'sbiome formatfailed.biome.jsoncis now detected too. - Missing format and lint tools are reported. When a detected language's tool is not installed (for example
rufffor Python), the scan output now says so with anaislop doctorhint, even on a clean run, and--jsonlists it in the engine'smissingTools. Skipped engines also carry askipReason, so a skip because of a missing tool can b
- Baseline mode.
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
aislop
Catch the slop AI coding agents leave in your code.
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
[](https://scanaislop.com)
Run npx aislop@latest badge to auto-generate. Free at scanaislop.com.
See it in action
Scan

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 scanworks on any repo. Add.aislop/config.ymlto tune.
What it catches
Six deterministic engines run in parallel:
| Engine | What it checks | How |
|---|---|---|
| Formatting | Code style consistency | Biome, ruff, gofmt, cargo fmt, rubocop, php-cs-fixer, google-java-format, dotnet format, clang-format |
| Linting | Language-specific issues | oxlint, ruff, golangci-lint, clippy, expo-doctor, PMD, Checkstyle, Roslynator, JetBrains InspectCode, cppcheck, clang-tidy |
| Code Quality | Complexity and dead code | Function/file size limits, deep nesting, unused files/deps (knip), AST-based unused-declaration removal |
| AI Slop | AI-authored code patterns | Narrative comments, trivial comments, dead patterns, unused imports, as any, console.log leftovers, TODO stubs, generic names |
| Security | Vulnerabilities and risky code | eval, innerHTML, SQL/shell injection, unsafe deserialization, dependency audits for JavaScript, Python, Rust, Go, and .NET |
| Architecture | Structural 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.