Discussion
benswerd: I've seen a lot of people talking about how AI is making codebases worse. I reject that, people are making codebases worse by not being intentional about how their AI writes code.This is my take on how to not write slop.
peacebeard: Agreed. When you submit code you must take responsibility for its quality. Blaming AI for low quality code is like blaming hammers for giant holes in the drywall. If you don't know how to use AI tools without confidence that your code is high quality, you need to re-assess how you use those tools. I'm not saying AI tools are bad. They're great. But the prevalence of people pushing the tools beyond their limits is not a failure of the tools. Vibe coding may be fun but tight-leash high-oversight AI usage is underrated in my opinion.
mika-el: We did something similar — wrote markdown skill files that teach agents our coding patterns. Naming conventions, which libraries to use, how we structure components. Basically onboarding docs but for agents.One thing we learned the hard way: shorter rules work better. We started with a 600-line comprehensive guide and the agent actually got worse. Every token in the skill competes for context window space with your actual conversation. Once we cut to under 200 lines per skill, consistency went up significantly.The semantic vs pragmatic function split in this post is a good frame. I am not sure agents need that level of abstraction explained to them though — what they actually need is concrete examples. "Use pdfplumber not PyPDF2" beats "prefer minimal semantic functions" every time.
ChrisMarshallNY: Because of the way that I use AI, I am constantly looking at the code. I usually leave it alone, if I can; even if I don't really like it.I will, often go back, after the fact, and ask for refactors and documentation.It works. Probably a lot slower than using agents, but I test every step, and it is a lot faster than I would do it, unassisted.
benswerd: I don't think testing the product alone is good enough, because when you give it tests it has to pass it prioritizes passing them at the expense of everything else — including code quality. I've seen it pull in random variables, break semantic functions, etc.
clbrmbr: Page not rendering well on iPhone Safari.Good content tho!
mrbluecoat: ..but unintentional AI (aka Modern Chaos Monkey) is so much more fun!
benswerd: LOL fr. I've been talking with some friends about RL on chaos monkeying the codebase to benchmark on feature isolation for measuring good code.
hosh: I have a take-home assignment for a hiring process.Of the 12 or so I have reviewed, 4 looks clearly AI generated. 3 of those 4 were clearly slop: they ended up with a Frankenstein, mixing three different approaches and doing none of them well.The submission that was not slop was careful and explicit about scope. Crucially, it also defined what -not- to generate.You’d also have to know the constraints to add it into the specs.Myself, vibe coding is not fun. Coding is fun. I grew up in the generation before the internet and learned programming by going through books. Researching approaches with AI have been surprisingly useful for me. Tight-leash, high oversight — or, for me, more like a surgically precise AI powered “sed” is my current sweet spot. Another is if I already have a sufficiently commented template file that I can include my spec and the template file.I have friends exploring fully automated systems. I know the block is at orchestration systems. I know of a soon-to-be-published work that would take this to the next level. I would not trust the code generated from any of the current attempts at orchestration.
w29UiIm2Xz: Shouldn't all of this be implicit from the codebase? Why do I have to write a file telling it these things?
cjonas: For any sufficiently large codebase, the agent only ever has a very % of the code loaded into context. Context engineering strategies like "skills" allow the agent to more efficiently discover the key information required to produce consistent code.
gravitronic: *adds "be intentional" to the prompt*Got it, good idea.
benswerd: Wrestled with this a bit. The struggle with this one in particular is its as much for people to read as it is for agents, and the agents are secondary in its case.I generally agree on this as best practice today, though I think it will become irrelevant in the next 2 generations of models.
abcde666777: My intentionality is that I'll never let it make the changes. I make the changes. I might make changes it suggests, but only upon review and only written with my hands.Yeah it might take longer, but I still believe in quality.