Show HN: AISlop, a CLI for catching AI generated code smells
github.com
You can try it out with npx aislop scan.
It’s all local and no code is transferred. Thank you.
github.com
You can try it out with npx aislop scan.
It’s all local and no code is transferred. Thank you.
- DRY principle violations, multiple definitions of the same helpers or utilities.
- Changes that deviate from existing patterns and architecture already in the code, especially in nearby and related code
- Comments that add no context or simply restate the field name.
- Naming violations (enterprise factoryfactoryabstraction stuff, excessively long names, overly technical names, banned words like “seam”, “durable”, and no-value-qualifiers like “SaveGame” -> “Save”).
- Tests that check implementations instead of correct business behavior.
- Overly backwards-compatible unless asked for (this one is incredibly hard to keep under control, as AI loves to guard everything even if the previous code was never deployed and thus there is no contract break)
- Un-necessary guard code (this is hard to control, most common case is the AI not relying on the serializer error handler and instead adding guards that the library already handles)
- Changing public API contracts without express permission to do so (depends on the code, eg a library JAR or versioned REST service)
- Meta references to previous code versions, to tasks or todos, or to instructions and other non-code context (e.g you tell the AI the adder should ignore negative numbers and that meta fact enters the comments or code)
I usually hand review all changes myself but it’s incredibly tedious so I try to first pass with the review agent until it comes back clean. I hate wasting tokens on it though.
(Not that I think you didn't probably already know that.)
I’m a much bigger fan of surfacing problems like missing values immediately and loudly so they bubble up, particularly during early prototyping and development.
I’ve collected a set of best practices in my AGENTS.md that covers issues like this, and that’s helped a fair bit. Obviously, you want to offload as much as possible to a deterministic linter, but this pattern is a bit tougher to catch in post.
https://gist.github.com/scpedicini/1407c776b82945b723199a91a...
This has bitten me a couple of times, and it’s surprisingly annoying to nudge agents into good/resilient patterns or identify situations that should fail loudly, at least in my experience. The retry mechanisms they come up with on their own are often pretty terrible as well.
I’ll note, though, that I have seen this from human engineers plenty of times, and at least the AI usually adds some logs rather than just totally silently absorbing an exception!
I'm additionally concerned about removing the LLM's voice to begin with, as though an LLM may far overuse specific words and phrases, so too do individual authors. Reducing an LLM towards the average author would result in an 'average' voice, paradoxically unlike any specific author.
I am currently doing research on something very similar over the summer but more towards the detection as opposed to the generation side - I'd love to discuss this with someone in the field if you had a few minutes sometime!
This made me chuckle.
Cool tool, the dead code checks can be very helpful. I’ve seen Claude leave unused functions when iterating which always frustrates me.
> Don't post generated comments or AI-edited comments. HN is for conversation between humans.
https://scanaislop.com/postgres/postgres ( @ 5ab239c )
- Errors: 0 ; Warnings: 6 --> "56 / 100 Failing" ???
Everyone should be doing regular code reviews and this helps a lot.
I'd love for it to have flags for Pi and Crush too :)
Would be nice to have a way to tell the scan that some parts are intentional, like #[allow(...)] in rust
One real bug tho:
> [ERROR] Imports "mdast" but it's not declared in package.json
A type-only import like `import type { Blockquote, RootContent } from 'mdast';` is actually acceptable if `"@types/mdast": "^4.0.4"` is included in the package.json.
One funny thing I see it doing is deleting seemingly random comments lines, for example if a file has a comment that spans multiple lines but doesn’t use a multi line comment syntax. It just chooses one at random transforming the once useful comment into slop.
I wouldn’t say they fixed it. Rather it was an intentional choice to put an anime girl on websites unless you paid for the product.
Concentrate on code quality, and whether it does what it needs to do. Not whether it was written by AI or not.
They certainly do in my experience. Maybe you've been lucky and haven't worked with really messy programmers.