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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # aislop
2
2
 
3
- **Stop AI slop from shipping.**
3
+ **The quality gate for agentic coding.**
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/aislop.svg)](https://www.npmjs.com/package/aislop)
6
6
  [![npm downloads](https://img.shields.io/npm/dm/aislop.svg)](https://www.npmjs.com/package/aislop)
@@ -8,9 +8,9 @@
8
8
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
9
9
  [![Node >= 20](https://img.shields.io/badge/node-%3E%3D20-brightgreen.svg)](https://nodejs.org)
10
10
 
11
- `aislop` is a unified code-quality CLI that catches the lazy patterns AI coding tools leave behind. One command, one score out of 100.
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
- `aislop` helps teams review AI-assisted code faster by combining formatting, linting, maintainability, AI-pattern detection, architecture checks, and security checks into a single report.
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
- aislop scan v0.2.1
42
-
43
- Project my-app (typescript)
44
- Source files: 142
45
-
46
- Formatting: done (0 issues)
47
- ! Linting: done (2 warnings)
48
- ! Code Quality: done (1 warning)
49
- ✓ Maintainability: done (0 issues)
50
- Security: done (0 issues)
51
-
52
- ------------------------------------------------------------
53
- Summary
54
- Score: 89/100 (Healthy)
55
- Issues: 0 errors, 3 warnings
56
- Auto-fixable: 2
57
- Files: 142
58
- Time: 2.3s
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-generated changes often pass review because problems are spread across many files and many categories.
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
- - **One command, full picture**: formatting + lint + maintainability + AI slop + security (+ architecture)
70
- - **Score-based quality gate**: use a single 0-100 score in CI and PR checks
71
- - **AI-slop-first scoring**: defaults weight AI-pattern findings more than generic style noise
72
- - **Auto-fix support**: remove unused imports, apply lint suggestions, and format in one pass
73
- - **Duplication visibility**: flag repeated blocks and encourage extraction into shared modules
74
- - **Software engineering best practices**: enforce function/file size limits, nesting limits, dead code cleanup, and safer patterns
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: **Formatting**, **Linting**, **Code Quality**, **AI Slop Detection**, **Security**, and **Architecture** (opt-in).
84
+ Six deterministic engines run in parallel:
81
85
 
82
- | Engine | Examples |
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, duplication, dead code, unused dependencies (knip) |
87
- | AI Slop | Trivial comments, swallowed exceptions, unused imports, console leftovers, type assertion abuse, TODO stubs |
88
- | Security | Hardcoded secrets, eval, innerHTML, SQL/shell injection, dependency audits |
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-fix unused imports, formatting, and lint fixes
134
- aislop fix --force # aggressive mode: dependency audit + Expo alignment
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/setup-node@v6
210
+ - uses: actions/checkout@v4
211
+ - uses: actions/setup-node@v4
181
212
  with:
182
213
  node-version: 20
183
- - run: npm ci
184
- - run: npx aislop ci
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/) formatting and linting for JS/TS
223
- - [oxlint](https://oxc.rs/) fast JavaScript/TypeScript linter
224
- - [knip](https://knip.dev/) unused files, exports, and dependencies
225
- - [ruff](https://docs.astral.sh/ruff/) Python linting and formatting
226
- - [golangci-lint](https://golangci-lint.run/) Go linting
227
- - [expo-doctor](https://docs.expo.dev/) Expo/React Native project health
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