unslop-ci 0.1.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/LICENSE +27 -0
- package/README.md +232 -0
- package/dist/action.js +1618 -0
- package/dist/cli.js +1716 -0
- package/dist/index.d.ts +289 -0
- package/dist/index.js +1577 -0
- package/package.json +73 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 cj-vana
|
|
4
|
+
|
|
5
|
+
The detection rules in this project are a TypeScript port of the scanners from
|
|
6
|
+
"vibecoded-design-tells" by J. Carter Johnson
|
|
7
|
+
(https://github.com/JCarterJohnson/vibecoded-design-tells), MIT licensed, which
|
|
8
|
+
grounds every rule in a large-scale Reddit analysis of what people actually
|
|
9
|
+
name as a giveaway of AI-generated code, prose, and design.
|
|
10
|
+
|
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions:
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
# unslop-ci
|
|
2
|
+
|
|
3
|
+
[](https://github.com/cj-vana/unslop-ci/actions/workflows/ci.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/unslop-ci)
|
|
5
|
+
[](./LICENSE)
|
|
6
|
+
|
|
7
|
+
**A diff-aware CI gate for AI slop.** It scans only the lines a change adds
|
|
8
|
+
for the tells that make code, prose, and UI read as AI-generated, and fails
|
|
9
|
+
the build when a strong tell lands. Lines that already existed never block,
|
|
10
|
+
so you can adopt it on a codebase of any age without a cleanup project first.
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npx unslop-ci diff --base origin/main
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Three scanners run over the added lines, each routed by file type:
|
|
17
|
+
|
|
18
|
+
- **code** (`.ts`, `.py`, `.go`, `.sql`, 26 more) catches leftover chat
|
|
19
|
+
artifacts ("Here's the updated code"), placeholder stubs (`// rest of your
|
|
20
|
+
code`), swallowed errors (`catch (e) {}`), emoji in source, narrating
|
|
21
|
+
comments, and generic names like `process_data`.
|
|
22
|
+
- **text** (`.md`, `.mdx`, `.txt`, `.rst`, `.html`) catches the em dash, the
|
|
23
|
+
"not just X, it's Y" cadence, assistant boilerplate and sign-offs,
|
|
24
|
+
sycophantic openers, the `delve`/`leverage` diction cluster, listicle
|
|
25
|
+
scaffolding, and the "In conclusion" closer.
|
|
26
|
+
- **ui** (`.tsx`, `.css`, `.vue`, `.svelte`, more) catches untouched shadcn
|
|
27
|
+
defaults, the AI purple/indigo band, gradient heading text, the cream+serif
|
|
28
|
+
"tasteful default", emoji-as-icons, and unprompted neon glow.
|
|
29
|
+
|
|
30
|
+
The rules are a TypeScript port of the scanners from
|
|
31
|
+
[vibecoded-design-tells](https://github.com/JCarterJohnson/vibecoded-design-tells)
|
|
32
|
+
(MIT), which grounds every rule in a large-scale Reddit analysis of what
|
|
33
|
+
people actually name as a giveaway. Severity follows those measured shares,
|
|
34
|
+
not vibes. The port is behavior-identical: on a 606-file corpus all three
|
|
35
|
+
scanners produce the same per-rule counts as the originals.
|
|
36
|
+
|
|
37
|
+
## Why diff-aware
|
|
38
|
+
|
|
39
|
+
Run any slop scanner over a mature repo and you get thousands of findings
|
|
40
|
+
nobody will ever fix; gate CI on that and every PR is red on day one. The
|
|
41
|
+
useful contract is narrower: **the lines you are adding right now should not
|
|
42
|
+
carry fresh slop.** unslop-ci parses `git diff -U0` against the merge base,
|
|
43
|
+
scans only files the change touches, and keeps only findings whose line the
|
|
44
|
+
diff added. Everything else in the file is invisible to the gate.
|
|
45
|
+
|
|
46
|
+
## GitHub Actions
|
|
47
|
+
|
|
48
|
+
```yaml
|
|
49
|
+
jobs:
|
|
50
|
+
unslop:
|
|
51
|
+
runs-on: ubuntu-latest
|
|
52
|
+
steps:
|
|
53
|
+
- uses: actions/checkout@v5
|
|
54
|
+
with:
|
|
55
|
+
fetch-depth: 0 # the diff needs history back to the merge base
|
|
56
|
+
- uses: cj-vana/unslop-ci@v1
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
On `pull_request` events the base resolves automatically from the event
|
|
60
|
+
payload; the same is true for `merge_group` and `push`. Blocking findings
|
|
61
|
+
show up as `::error` annotations on the exact changed lines, warnings as
|
|
62
|
+
`::warning`, and a summary table lands in the step summary.
|
|
63
|
+
|
|
64
|
+
Action inputs (all optional): `base`, `head`, `config`, `fail-on`,
|
|
65
|
+
`scanners`, `working-directory`, `annotations`, `summary`, `report-file`.
|
|
66
|
+
Outputs: `blocking-count`, `finding-count`, `added-lines`.
|
|
67
|
+
|
|
68
|
+
Pin the action to a commit sha on self-hosted runners, same as you would any
|
|
69
|
+
third-party action.
|
|
70
|
+
|
|
71
|
+
## CLI
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
npm install --save-dev unslop-ci
|
|
75
|
+
|
|
76
|
+
npx unslop-ci diff --base origin/main # gate your branch's added lines
|
|
77
|
+
npx unslop-ci diff # in CI, base resolves from the event
|
|
78
|
+
npx unslop-ci diff --base HEAD # gate your uncommitted changes
|
|
79
|
+
npx unslop-ci scan src/ # audit a whole tree (everything, not just new lines)
|
|
80
|
+
npx unslop-ci diff --base origin/main --json > report.json
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Flags: `--base <ref>`, `--head <ref>`, `--no-merge-base`, `--config <path>`,
|
|
84
|
+
`--fail-on <level>`, `--scanners code,text,ui`, `--max <n>`, `--json`,
|
|
85
|
+
`--no-annotations`, `--no-summary`, `--no-color`, `--cwd <dir>`.
|
|
86
|
+
|
|
87
|
+
Exit codes: `0` clean, `1` blocking findings, `2` usage or environment error.
|
|
88
|
+
|
|
89
|
+
## What blocks
|
|
90
|
+
|
|
91
|
+
Every rule carries two independent axes. **Severity** (high, medium, low) is
|
|
92
|
+
how loudly the finding reads as AI-generated. **Class** (`bug` or `cosmetic`)
|
|
93
|
+
is whether the code is actually wrong: a swallowed error eats the one clue
|
|
94
|
+
you needed, and a placeholder stub means the file shipped unfinished.
|
|
95
|
+
|
|
96
|
+
The default gate is `high+bugs`: high-severity findings block, and bug-class
|
|
97
|
+
findings block at any severity. Everything else surfaces as a warning. Set
|
|
98
|
+
`fail-on` to `high`, `medium`, or `any` to move the line.
|
|
99
|
+
|
|
100
|
+
An intentional line keeps the gate honest instead of fighting it:
|
|
101
|
+
|
|
102
|
+
```ts
|
|
103
|
+
console.log('🚀 launch banner'); // unslop-ignore
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
`unslop-ignore` skips that line; `unslop-ignore-next-line` on the line above
|
|
107
|
+
skips the next one (for lines that cannot carry a comment).
|
|
108
|
+
|
|
109
|
+
## Configuration
|
|
110
|
+
|
|
111
|
+
`unslop.config.json` at the repo root is picked up automatically:
|
|
112
|
+
|
|
113
|
+
```json
|
|
114
|
+
{
|
|
115
|
+
"failOn": "high+bugs",
|
|
116
|
+
"exclude": ["**/generated/**", "**/*.snap"],
|
|
117
|
+
"disableRules": ["verbose-naming"],
|
|
118
|
+
"rules": {
|
|
119
|
+
"chat-artifact": "medium",
|
|
120
|
+
"em-dash": "off"
|
|
121
|
+
},
|
|
122
|
+
"scanners": {
|
|
123
|
+
"code": {
|
|
124
|
+
"exclude": ["supabase/migrations/**"],
|
|
125
|
+
"disableRules": ["narrating-comment"]
|
|
126
|
+
},
|
|
127
|
+
"text": { "include": ["docs/**", "*.md"] },
|
|
128
|
+
"ui": false
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
- `failOn` sets the gate level (`high+bugs`, `high`, `medium`, `any`).
|
|
134
|
+
- `exclude` removes paths globally; per-scanner `include`/`exclude` narrow a
|
|
135
|
+
single scanner. Globs support `*`, `**`, `?`, and `{a,b}`.
|
|
136
|
+
- `disableRules` (global or per-scanner) removes rules; `rules` overrides a
|
|
137
|
+
rule's severity or turns it `off` everywhere.
|
|
138
|
+
- Setting a scanner to `false` disables it entirely.
|
|
139
|
+
|
|
140
|
+
## Rule catalog
|
|
141
|
+
|
|
142
|
+
### code
|
|
143
|
+
|
|
144
|
+
| rule | severity | class |
|
|
145
|
+
| ----------------------------------------------------------------------------------- | -------- | -------- |
|
|
146
|
+
| `chat-artifact` leftover assistant text or markdown fences in source | high | cosmetic |
|
|
147
|
+
| `placeholder-comment` ellipsis stubs like `// rest of your code` | high | bug |
|
|
148
|
+
| `emoji-in-code` emoji in code, strings, or logs | medium | cosmetic |
|
|
149
|
+
| `swallowed-errors` bare `except:`, empty `catch`, empty `if err != nil` | medium | bug |
|
|
150
|
+
| `narrating-comment` comments that restate the next line | medium | cosmetic |
|
|
151
|
+
| `generic-naming` `process_data`, `handleData`, `doStuff` | medium | cosmetic |
|
|
152
|
+
| `verbose-naming` sentence-length identifiers | low | cosmetic |
|
|
153
|
+
| `boilerplate-marker` `lorem ipsum`, `YOUR_API_KEY`, `John Doe`, "Successfully" logs | low | cosmetic |
|
|
154
|
+
|
|
155
|
+
### text
|
|
156
|
+
|
|
157
|
+
| rule | severity |
|
|
158
|
+
| ------------------------------------------------------------------------- | -------- |
|
|
159
|
+
| `em-dash` the single most-cited AI tell | high |
|
|
160
|
+
| `not-just-x-y` the negate-then-assert cadence | high |
|
|
161
|
+
| `assistant-boilerplate` "as an AI language model", cutoff lines, refusals | high |
|
|
162
|
+
| `sycophancy-opener` "Great question!", "I'd be happy to" | high |
|
|
163
|
+
| `bolded-lead-in` `**Label:**` then a sentence | high |
|
|
164
|
+
| `assistant-offer` "Would you like me to", "I hope this helps" | high |
|
|
165
|
+
| `ai-diction` `delve`, `tapestry`, `leverage`, `seamless` | medium |
|
|
166
|
+
| `dive-in` "deep dive", "let's dive in" | medium |
|
|
167
|
+
| `listicle-scaffold` "5 ways to", "7 signs" | medium |
|
|
168
|
+
| `fast-paced-opener` "In today's fast-paced world" | medium |
|
|
169
|
+
| `unlock-potential` "unlock the full potential" | medium |
|
|
170
|
+
| `emoji-decoration` emoji bullets and headings | medium |
|
|
171
|
+
| `in-conclusion` the signposted recap closer | medium |
|
|
172
|
+
| `transition-stack` "Moreover", "Furthermore", "Firstly" | low |
|
|
173
|
+
| `generic-diction` `utilize`, `comprehensive`, `robust` | low |
|
|
174
|
+
| `hype-marketing` "revolutionary", "say goodbye to" | low |
|
|
175
|
+
| `hedge-cliche` "it depends", "on one hand" | low |
|
|
176
|
+
| `note-hedge` "it's worth noting" | low |
|
|
177
|
+
| `hr-divider` rule lines between every section | low |
|
|
178
|
+
| `honestly-opener` "Honestly,", "let's be real" | low |
|
|
179
|
+
|
|
180
|
+
The text scanner lints your own prose: quoted material, inline code, fenced
|
|
181
|
+
blocks, and YAML frontmatter are skipped, so quoting a cliche to discuss it
|
|
182
|
+
is fine. The em dash is the one exception; it is flagged everywhere.
|
|
183
|
+
|
|
184
|
+
### ui
|
|
185
|
+
|
|
186
|
+
| rule | severity |
|
|
187
|
+
| -------------------------------------------------------- | -------- |
|
|
188
|
+
| `shadcn-default-card` untouched shadcn card/theme tokens | high |
|
|
189
|
+
| `ai-purple` indigo/violet/purple as primary | high |
|
|
190
|
+
| `gradient-text` gradient-filled headings | high |
|
|
191
|
+
| `purple-blue-gradient` the rainbow hero gradient | high |
|
|
192
|
+
| `claude-default-look` cream background + display serif | high |
|
|
193
|
+
| `hero-three-cards` the centered hero + 3-card grid | medium |
|
|
194
|
+
| `rounded-everything` pill radius on everything | medium |
|
|
195
|
+
| `fade-in-animations` boilerplate scroll/hover motion | medium |
|
|
196
|
+
| `neon-glow` unprompted glow shadows | medium |
|
|
197
|
+
| `emoji-as-icons` emoji standing in for an icon set | medium |
|
|
198
|
+
| `generic-font` Inter/Geist/Roboto as the only choice | medium |
|
|
199
|
+
| `hype-copy` template marketing copy | low |
|
|
200
|
+
| `stock-illustration` undraw-style blob art | low |
|
|
201
|
+
|
|
202
|
+
## What it deliberately cannot see
|
|
203
|
+
|
|
204
|
+
The loudest tells in the underlying study are structural: tutorial-shaped
|
|
205
|
+
boilerplate, hallucinated APIs, over-engineering, and code that ignores the
|
|
206
|
+
surrounding repo. No regex sees those. Build, type-check, and run the code
|
|
207
|
+
for the hallucinated calls; read the diff for the rest. This gate removes
|
|
208
|
+
the mechanical tells so review time goes where a human is actually needed.
|
|
209
|
+
|
|
210
|
+
## Related
|
|
211
|
+
|
|
212
|
+
- [buttonmash](https://github.com/cj-vana/buttonmash) is this project's
|
|
213
|
+
sibling: a CI chaos monkey that crawls your running app, mashes every
|
|
214
|
+
control, and fails the build on crashes. buttonmash tests what the app
|
|
215
|
+
does; unslop-ci gates what the diff says.
|
|
216
|
+
- [vibecoded-design-tells](https://github.com/JCarterJohnson/vibecoded-design-tells)
|
|
217
|
+
is the upstream research and the original Python scanners, including the
|
|
218
|
+
Claude skills for interactive unslopping.
|
|
219
|
+
|
|
220
|
+
## Development
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
npm install
|
|
224
|
+
npm test # vitest, includes an end-to-end suite against a temp git repo
|
|
225
|
+
npm run lint
|
|
226
|
+
npm run typecheck
|
|
227
|
+
npm run build # tsup; dist/ is committed because the action runs from it
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
MIT. Rule research and original scanners by
|
|
231
|
+
[J. Carter Johnson](https://github.com/JCarterJohnson); port and CI gate by
|
|
232
|
+
[cj-vana](https://github.com/cj-vana).
|