aislop 0.9.3 → 0.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -5
- package/dist/cli.js +1133 -64
- package/dist/{version-BNO_Lw7E.js → engine-info-DCvIfZ0f.js} +1 -5
- package/dist/index.d.ts +6 -0
- package/dist/index.js +857 -53
- package/dist/{json-BhO1Ufj3.js → json-CZU3lEfE.js} +2 -1
- package/dist/mcp.js +738 -39
- package/dist/sarif-CZVuavf_.js +61 -0
- package/dist/sarif-Cneulb6L.js +60 -0
- package/dist/version-ls3wZmOU.js +5 -0
- package/package.json +93 -91
- package/scripts/gen-config-schema.mjs +35 -0
- /package/dist/{expo-doctor-Bz0LZhQ6.js → expo-doctor-BcIkOte5.js} +0 -0
- /package/dist/{generic-BrcWMW7E.js → generic-D_T4cUaC.js} +0 -0
- /package/dist/{typecheck-XJMuCczG.js → typecheck-DQSzG8fX.js} +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# aislop
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**Catch the slop AI coding agents leave in your code.**
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/aislop)
|
|
6
6
|
[](https://www.npmjs.com/package/aislop)
|
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
[](https://opensource.org/licenses/MIT)
|
|
10
10
|
[](https://nodejs.org)
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
The patterns Claude Code, Cursor, Codex, and OpenCode leave behind: narrative comments above self-explanatory code, swallowed exceptions, `as any` casts, hallucinated imports, duplicated helpers, dead code, todo stubs, oversized functions. Tests pass. Lint passes. The code rots anyway.
|
|
13
|
+
|
|
14
|
+
aislop catches them. 40+ rules across 7 languages (TS/JS, Python, Go, Rust, Ruby, PHP, Java). Scores every change 0–100. Sub-second. Deterministic — no LLM in the runtime path, same code in, same score out. MIT-licensed, free CLI.
|
|
13
15
|
|
|
14
16
|
## Quick start
|
|
15
17
|
|
|
@@ -75,6 +77,7 @@ npx aislop scan ./src # specific directory
|
|
|
75
77
|
npx aislop scan --changes # changed files from HEAD
|
|
76
78
|
npx aislop scan --staged # staged files only
|
|
77
79
|
npx aislop scan --json # JSON output
|
|
80
|
+
npx aislop scan --sarif # SARIF 2.1.0 output (GitHub code scanning)
|
|
78
81
|
```
|
|
79
82
|
|
|
80
83
|
**Exclude files**: `node_modules`, `.git`, `dist`, `build`, `coverage` excluded by default. Add more in `.aislop/config.yml`:
|
|
@@ -87,6 +90,18 @@ exclude:
|
|
|
87
90
|
|
|
88
91
|
Or via CLI: `npx aislop scan --exclude "**/*.test.ts,dist"`
|
|
89
92
|
|
|
93
|
+
**Per-rule severity**: Override the severity of any rule by id, or turn it off:
|
|
94
|
+
|
|
95
|
+
```yaml
|
|
96
|
+
# .aislop/config.yml
|
|
97
|
+
rules:
|
|
98
|
+
ai-slop/narrative-comment: warning # error | warning | off
|
|
99
|
+
ai-slop/trivial-comment: "off" # drop this rule entirely
|
|
100
|
+
security/hardcoded-secret: error
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
`off` drops matching diagnostics; `error`/`warning` rewrites severity before scoring and reporting. Absent map keeps default behavior.
|
|
104
|
+
|
|
90
105
|
**Extend config**: Project config can extend a parent:
|
|
91
106
|
|
|
92
107
|
```yaml
|
|
@@ -96,6 +111,8 @@ ci:
|
|
|
96
111
|
failBelow: 80 # override specific keys
|
|
97
112
|
```
|
|
98
113
|
|
|
114
|
+
**Editor validation**: Point your editor at the JSON Schema in [`schema/aislop.config.schema.json`](schema/aislop.config.schema.json) for autocomplete and validation of `.aislop/config.yml`. Regenerate it from the source config schema with `pnpm gen:schema`.
|
|
115
|
+
|
|
99
116
|
### Fix
|
|
100
117
|
|
|
101
118
|
Auto-fix what's mechanical (formatters, unused imports, dead code). For issues that need context, hand off to your agent with full diagnostic info.
|
|
@@ -114,7 +131,7 @@ npx aislop fix --claude # Claude Code
|
|
|
114
131
|
npx aislop fix --cursor # Cursor (copies to clipboard)
|
|
115
132
|
npx aislop fix --gemini # Gemini CLI
|
|
116
133
|
npx aislop fix --codex # Codex CLI
|
|
117
|
-
# Also: --windsurf, --amp, --aider, --goose, --opencode, --warp, --kimi, --antigravity, --deep-agents, --vscode
|
|
134
|
+
# Also: --windsurf, --amp, --aider, --goose, --pi, --crush, --opencode, --warp, --kimi, --antigravity, --deep-agents, --vscode
|
|
118
135
|
npx aislop fix --prompt # print prompt (agent-agnostic)
|
|
119
136
|
```
|
|
120
137
|
|
|
@@ -126,11 +143,12 @@ Runs after every agent edit. Feedback flows back immediately.
|
|
|
126
143
|
npx aislop hook install --claude # Claude Code
|
|
127
144
|
npx aislop hook install --cursor # Cursor
|
|
128
145
|
npx aislop hook install --gemini # Gemini CLI
|
|
146
|
+
npx aislop hook install --pi # pi
|
|
129
147
|
npx aislop hook install # all supported agents
|
|
130
148
|
npx aislop hook install claude cursor # specific agents
|
|
131
149
|
```
|
|
132
150
|
|
|
133
|
-
**Runtime adapters** (scan + feedback): `claude`, `cursor`, `gemini`.
|
|
151
|
+
**Runtime adapters** (scan + feedback): `claude`, `cursor`, `gemini`, `pi`.
|
|
134
152
|
**Rules-only** (agent reads rules): `codex`, `windsurf`, `cline`, `kilocode`, `antigravity`, `copilot`.
|
|
135
153
|
|
|
136
154
|
**Quality-gate mode**: Blocks if score regresses below baseline.
|
|
@@ -175,9 +193,12 @@ npx aislop init # create .aislop/config.yml
|
|
|
175
193
|
npx aislop init --strict # enterprise-grade gate: all engines, typecheck, failBelow 85
|
|
176
194
|
npx aislop rules # list rules
|
|
177
195
|
npx aislop badge # print badge URL
|
|
196
|
+
npx aislop trend # show score history over time
|
|
178
197
|
npx aislop # interactive menu
|
|
179
198
|
```
|
|
180
199
|
|
|
200
|
+
**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` reads it and prints a 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.
|
|
201
|
+
|
|
181
202
|
Docs: [commands](docs/commands.md)
|
|
182
203
|
|
|
183
204
|
---
|
|
@@ -186,10 +207,23 @@ Docs: [commands](docs/commands.md)
|
|
|
186
207
|
|
|
187
208
|
### Pre-commit
|
|
188
209
|
|
|
210
|
+
Run directly on staged files:
|
|
211
|
+
|
|
189
212
|
```bash
|
|
190
213
|
npx aislop scan --staged
|
|
191
214
|
```
|
|
192
215
|
|
|
216
|
+
Or wire it into the [pre-commit](https://pre-commit.com) framework via the bundled hook:
|
|
217
|
+
|
|
218
|
+
```yaml
|
|
219
|
+
# .pre-commit-config.yaml
|
|
220
|
+
repos:
|
|
221
|
+
- repo: https://github.com/scanaislop/aislop
|
|
222
|
+
rev: v0.9.4
|
|
223
|
+
hooks:
|
|
224
|
+
- id: aislop
|
|
225
|
+
```
|
|
226
|
+
|
|
193
227
|
### GitHub Actions
|
|
194
228
|
|
|
195
229
|
Run `npx aislop init` and accept the workflow prompt, or add manually:
|
|
@@ -209,6 +243,15 @@ Run `npx aislop init` and accept the workflow prompt, or add manually:
|
|
|
209
243
|
- uses: scanaislop/aislop@v0.8
|
|
210
244
|
```
|
|
211
245
|
|
|
246
|
+
**GitHub code scanning (SARIF)**: emit a SARIF 2.1.0 report and upload it so findings appear in the Security tab:
|
|
247
|
+
|
|
248
|
+
```yaml
|
|
249
|
+
- run: npx aislop@latest scan . --sarif > aislop.sarif
|
|
250
|
+
- uses: github/codeql-action/upload-sarif@v3
|
|
251
|
+
with:
|
|
252
|
+
sarif_file: aislop.sarif
|
|
253
|
+
```
|
|
254
|
+
|
|
212
255
|
### Quality gate
|
|
213
256
|
|
|
214
257
|
Set minimum score in `.aislop/config.yml`:
|
|
@@ -261,9 +304,19 @@ See the full [rules reference](docs/rules.md).
|
|
|
261
304
|
|
|
262
305
|
---
|
|
263
306
|
|
|
307
|
+
## Research
|
|
308
|
+
|
|
309
|
+
aislop rules are shaped by public scans and benchmark-derived failure modes, not only local fixtures. The [research program](docs/research-program.md) 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.
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
264
313
|
## Docs
|
|
265
314
|
|
|
266
|
-
[Installation](docs/installation.md) · [Commands](docs/commands.md) · [Rules](docs/rules.md) · [Config](docs/configuration.md) · [Scoring](docs/scoring.md) · [CI/CD](docs/ci.md) · [Telemetry](docs/telemetry.md)
|
|
315
|
+
[Installation](docs/installation.md) · [Commands](docs/commands.md) · [Rules](docs/rules.md) · [Config](docs/configuration.md) · [Scoring](docs/scoring.md) · [CI/CD](docs/ci.md) · [Telemetry](docs/telemetry.md) · [Research program](docs/research-program.md)
|
|
316
|
+
|
|
317
|
+
## Community
|
|
318
|
+
|
|
319
|
+
[Discussions](https://github.com/scanaislop/aislop/discussions) for questions, rule requests, and false-positive triage · [Issues](https://github.com/scanaislop/aislop/issues) for bugs
|
|
267
320
|
|
|
268
321
|
## Contributing
|
|
269
322
|
|