aislop 0.3.2 → 0.5.0
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 +101 -52
- package/dist/cli.js +3153 -1337
- package/dist/{expo-doctor-Cm5892Y8.js → expo-doctor-Bz0LZhQ6.js} +13 -76
- package/dist/generic-BrcWMW7E.js +109 -0
- package/dist/index.d.ts +76 -16
- package/dist/index.js +4507 -2644
- package/dist/{json-L5x3hQdy.js → json-B51etWTw.js} +2 -0
- package/dist/{json-gLNX92Bu.js → json-BScQXSOX.js} +3 -1
- package/dist/rolldown-runtime-Cbj13DAv.js +20 -0
- package/dist/subprocess-CQUJDGgn.js +59 -0
- package/dist/{engine-info-N9t3U_CZ.js → version-CxBRws3M.js} +11 -11
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# aislop
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**The quality gate for agentic coding.**
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/aislop)
|
|
6
6
|
[](https://www.npmjs.com/package/aislop)
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
[](https://opensource.org/licenses/MIT)
|
|
9
9
|
[](https://nodejs.org)
|
|
10
10
|
|
|
11
|
-
`aislop`
|
|
11
|
+
`aislop` scans the code your agent wrote and gives you one score, 0–100. It rolls formatters, linters, complexity limits, dependency audits, and an AI-slop detector into a single command. It auto-fixes what's safely fixable and hands the rest to your coding agent with full context.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Every check is deterministic. Regex patterns, AST analysis, and standard tooling (Biome, oxlint, knip, ruff). Same code in, same score out. No API calls, no LLMs, no network dependency (except optional dependency audits). The name refers to what it *catches*.
|
|
14
14
|
|
|
15
15
|
## See it in action
|
|
16
16
|
|
|
@@ -38,55 +38,59 @@ npx aislop ci
|
|
|
38
38
|
Sample output:
|
|
39
39
|
|
|
40
40
|
```text
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
41
|
+
[ok] Formatting: done (0 issues, 426ms)
|
|
42
|
+
[ok] Linting: done (0 issues, 396ms)
|
|
43
|
+
[!] Code Quality: done (2 warnings, 812ms)
|
|
44
|
+
[!] AI Slop: done (4 warnings, 455ms)
|
|
45
|
+
[ok] Security: done (0 issues, 1.3s)
|
|
46
|
+
aislop 0.5.0 · the quality gate for agentic coding
|
|
47
|
+
|
|
48
|
+
scan · my-app · typescript · 142 files
|
|
49
|
+
|
|
50
|
+
> Code Quality
|
|
51
|
+
[WARN] [auto] Unused export (2)
|
|
52
|
+
src/lib/format-bytes.ts:12
|
|
53
|
+
src/utils/retry.ts:8
|
|
54
|
+
|
|
55
|
+
> AI Slop
|
|
56
|
+
[WARN] [auto] Narrative comment block (2)
|
|
57
|
+
src/lib/auth.ts:86
|
|
58
|
+
[WARN] 'as any' bypasses type safety
|
|
59
|
+
src/api/normalize.ts:47
|
|
60
|
+
|
|
61
|
+
87 / 100 Healthy 0 errors · 6 warnings · 4 fixable
|
|
62
|
+
142 files · 5 engines · 1.9s
|
|
63
|
+
|
|
64
|
+
→ Run npx aislop fix to auto-fix 4 issues
|
|
65
|
+
→ Run npx aislop fix --claude to hand off the rest to an agent
|
|
60
66
|
```
|
|
61
67
|
|
|
62
68
|
---
|
|
63
69
|
|
|
64
70
|
## Why aislop
|
|
65
71
|
|
|
66
|
-
AI
|
|
67
|
-
`aislop` gives you one view and one score.
|
|
72
|
+
AI coding tools generate code that compiles and passes tests but ships with patterns no engineer would write: trivial comments, swallowed exceptions, unused imports, `as any` casts, oversized functions, and leftover `console.log` calls. These problems are spread across many files and slip through review.
|
|
68
73
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
- **
|
|
72
|
-
- **Auto-fix
|
|
73
|
-
- **
|
|
74
|
-
- **
|
|
75
|
-
- **Works across stacks**: TypeScript, JavaScript, Python, Go, Rust, Ruby, PHP, Expo/React Native
|
|
76
|
-
- **Zero-config start**: run `npx aislop scan` and get useful output immediately
|
|
74
|
+
`aislop` gives you one view and one score. Fully deterministic, no AI in the loop.
|
|
75
|
+
|
|
76
|
+
- **One score, one gate**: a 0-100 number you can enforce in CI with `aislop ci`. Weighted so sloppy patterns (dead code, `as any`, swallowed errors) hit harder than style noise.
|
|
77
|
+
- **Auto-fix first, agent second**: `aislop fix` clears what's mechanically safe (formatters, unused imports, trivial comments, dead patterns). For the rest, one flag hands off to Claude Code, Codex, Cursor, Gemini, Windsurf, Amp, Aider, Goose, and 7 more, with full diagnostic context pre-filled.
|
|
78
|
+
- **Deterministic**: regex, AST, and standard tooling. No LLMs, no API keys, no network dependency. Same repo in, same score out.
|
|
79
|
+
- **Zero-config start**: `npx aislop scan` works on any repo. Add `.aislop/config.yml` when you want to tune thresholds or enable the architecture engine.
|
|
80
|
+
- **Works across stacks**: TypeScript, JavaScript, Python, Go, Rust, Ruby, PHP, Expo / React Native.
|
|
77
81
|
|
|
78
82
|
## What it catches
|
|
79
83
|
|
|
80
|
-
Six engines run in parallel:
|
|
84
|
+
Six deterministic engines run in parallel:
|
|
81
85
|
|
|
82
|
-
| Engine |
|
|
83
|
-
|
|
84
|
-
| Formatting | Biome, ruff, gofmt, cargo fmt, rubocop, php-cs-fixer |
|
|
85
|
-
| Linting | oxlint, ruff, golangci-lint, clippy, expo-doctor |
|
|
86
|
-
| Code Quality | Function/file size limits, deep nesting,
|
|
87
|
-
| AI Slop |
|
|
88
|
-
| Security |
|
|
89
|
-
| Architecture | Custom import bans, layering rules, required patterns |
|
|
86
|
+
| Engine | What it checks | How |
|
|
87
|
+
|---|---|---|
|
|
88
|
+
| **Formatting** | Code style consistency | Biome, ruff, gofmt, cargo fmt, rubocop, php-cs-fixer |
|
|
89
|
+
| **Linting** | Language-specific issues | oxlint, ruff, golangci-lint, clippy, expo-doctor |
|
|
90
|
+
| **Code Quality** | Complexity and dead code | Function/file size limits, deep nesting, unused files/deps (knip), AST-based unused-declaration removal |
|
|
91
|
+
| **AI Slop** | AI-authored code patterns | Narrative comments, trivial comments, dead patterns, unused imports, `as any`, `console.log` leftovers, TODO stubs, generic names |
|
|
92
|
+
| **Security** | Vulnerabilities and risky code | eval, innerHTML, SQL/shell injection, dependency audits (npm/pip/cargo/govulncheck) |
|
|
93
|
+
| **Architecture** | Structural rules (opt-in) | Custom import bans, layering rules, required patterns |
|
|
90
94
|
|
|
91
95
|
See the full [rules reference](docs/rules.md).
|
|
92
96
|
|
|
@@ -130,8 +134,30 @@ aislop scan --json # output JSON
|
|
|
130
134
|
### Fix issues automatically
|
|
131
135
|
|
|
132
136
|
```bash
|
|
133
|
-
aislop fix # auto-
|
|
134
|
-
aislop fix
|
|
137
|
+
aislop fix # safe auto-fixes: unused imports, formatting, lint
|
|
138
|
+
aislop fix -f # aggressive: dependency audit, unused files, Expo alignment
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Hand off to your coding agent
|
|
142
|
+
|
|
143
|
+
When auto-fix can't solve it, aislop generates a prompt with full context and opens your agent. 14 supported:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
aislop fix --claude # Claude Code
|
|
147
|
+
aislop fix --codex # Codex CLI
|
|
148
|
+
aislop fix --cursor # Cursor (copies prompt to clipboard)
|
|
149
|
+
aislop fix --gemini # Gemini CLI
|
|
150
|
+
aislop fix --windsurf # Windsurf (copies prompt to clipboard)
|
|
151
|
+
aislop fix --amp # Amp
|
|
152
|
+
aislop fix --aider # Aider
|
|
153
|
+
aislop fix --goose # Goose
|
|
154
|
+
aislop fix --opencode # OpenCode
|
|
155
|
+
aislop fix --warp # Warp
|
|
156
|
+
aislop fix --kimi # Kimi Code CLI
|
|
157
|
+
aislop fix --antigravity # Antigravity
|
|
158
|
+
aislop fix --deep-agents # Deep Agents
|
|
159
|
+
aislop fix --vscode # VS Code Copilot (copies prompt to clipboard)
|
|
160
|
+
aislop fix --prompt # print the prompt (agent-agnostic)
|
|
135
161
|
```
|
|
136
162
|
|
|
137
163
|
### Use in CI pipelines
|
|
@@ -176,12 +202,23 @@ npx aislop scan --staged
|
|
|
176
202
|
|
|
177
203
|
### GitHub Actions
|
|
178
204
|
|
|
205
|
+
Fastest path: run `npx aislop init` and say yes to "Add a GitHub Actions workflow?". It drops a working `.github/workflows/aislop.yml` for you.
|
|
206
|
+
|
|
207
|
+
Manual form:
|
|
208
|
+
|
|
179
209
|
```yaml
|
|
180
|
-
- uses: actions/
|
|
210
|
+
- uses: actions/checkout@v4
|
|
211
|
+
- uses: actions/setup-node@v4
|
|
181
212
|
with:
|
|
182
213
|
node-version: 20
|
|
183
|
-
- run:
|
|
184
|
-
|
|
214
|
+
- run: npx aislop@latest ci .
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Or use the composite action (one-liner):
|
|
218
|
+
|
|
219
|
+
```yaml
|
|
220
|
+
- uses: actions/checkout@v4
|
|
221
|
+
- uses: heavykenny/aislop@v0.5
|
|
185
222
|
```
|
|
186
223
|
|
|
187
224
|
### Quality gate
|
|
@@ -211,6 +248,18 @@ ci:
|
|
|
211
248
|
|
|
212
249
|
---
|
|
213
250
|
|
|
251
|
+
## For engineering teams
|
|
252
|
+
|
|
253
|
+
`aislop` runs locally and in your CI. [scanaislop](https://scanaislop.com) is the hosted platform built on top of it for teams that want enforcement without wiring every workflow themselves.
|
|
254
|
+
|
|
255
|
+
- **PR gates on every repo** with a score threshold and block-to-merge
|
|
256
|
+
- **Standards hierarchy**: org baseline, team overrides, project config
|
|
257
|
+
- **Per-team dashboards** and agent attribution over time
|
|
258
|
+
- **Visual rules manager** so engineering leads set standards without editing YAML
|
|
259
|
+
- **Same engines, same rule IDs, same score**. The CLI remains the source of truth.
|
|
260
|
+
|
|
261
|
+
The CLI is MIT-licensed and always will be. [Learn more about the platform →](https://scanaislop.com)
|
|
262
|
+
|
|
214
263
|
## Contributing
|
|
215
264
|
|
|
216
265
|
See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and how to add new rules. AI coding assistants can find project context in [AGENTS.md](AGENTS.md).
|
|
@@ -219,12 +268,12 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and how to add new
|
|
|
219
268
|
|
|
220
269
|
`aislop` is built on top of excellent open-source projects:
|
|
221
270
|
|
|
222
|
-
- [Biome](https://biomejs.dev/)
|
|
223
|
-
- [oxlint](https://oxc.rs/)
|
|
224
|
-
- [knip](https://knip.dev/)
|
|
225
|
-
- [ruff](https://docs.astral.sh/ruff/)
|
|
226
|
-
- [golangci-lint](https://golangci-lint.run/)
|
|
227
|
-
- [expo-doctor](https://docs.expo.dev/)
|
|
271
|
+
- [Biome](https://biomejs.dev/) for formatting and linting JS/TS
|
|
272
|
+
- [oxlint](https://oxc.rs/) for fast JS/TS linting
|
|
273
|
+
- [knip](https://knip.dev/) for unused files, exports, and dependencies
|
|
274
|
+
- [ruff](https://docs.astral.sh/ruff/) for Python linting and formatting
|
|
275
|
+
- [golangci-lint](https://golangci-lint.run/) for Go linting
|
|
276
|
+
- [expo-doctor](https://docs.expo.dev/) for Expo/React Native project health
|
|
228
277
|
|
|
229
278
|
## Contributors
|
|
230
279
|
|