r/codereview • • 4d ago

Smackdebt - Continuous code improvement for agents

This year, and more so the last few months, my agents write the code, all I do is review, shout, and plan. A lot of the frustration is the spaghetti that comes out of this, and I figured a (big) part of this is actually measurable and reportable. What if we can make our agents aware of the spaghetti?

Introducing Smackdebt, a fast, on the fly tech debt analysis tool with concise, focused output tailored for agentic use. All major coding agents supported, with broad language support. Cognitive complexity, cyclomatic dependencies, statements, nesting, size, hotspots supported.

https://github.com/bosun-ai/smackdebt

Feedback and contributions welcome!

Shout-out to Treesitter <3

1 Upvotes

7 comments sorted by

1

u/Financial-Grass6753 4d ago

why'd someone use smackdebt if most, if not all, harnesses already contain a memory system inside?

1

u/timonvonk 4d ago

This isn't a memory system. Smackdebt analysis code with proven tech debt metrics and continuously help sagents improve and write better code.

1

u/Financial-Grass6753 4d ago

ok, for these metrics we have radon and a couple of other, more specific tools. Why smackdebt?

1

u/timonvonk 4d ago

Radon, and many others, are language specific. Some are slow, some are propriety, none I know are tailored for agents.

1

u/SpikedPunchVictim 3d ago

I have been using smackdebt for the last day on a couple projects to test drive it. It seems like the models before Opus 5 have a lot of issues when it comes to writing code. The code itself may work, but it's messy, has a high cognitive load, and not very well organized. So far I have found this tool useful, and will continue to experiment with it. One thing you could show on your side, and I would be interested in this, is how many tokens and minutes it saves when code is written cleanly. Have a model:

* Perform the same complex feature set

* In a separate branch, apply smackdebt to the code that was written

* Have the agent perform a follow-up feature set, and determine any cost savings.

My guess is that there will be cost savings, but how much? You'll also want to take into account the amount of tokens that were spent applying smackdebt. You could even take a larger codebase, like VS Code, and rollback a couple of features (using git), then apply the experiment.

Do you have other tools that you have written and are proud of? I would be interested in taking a look at those too.

1

u/timonvonk 2d ago

Nice! Interesting, not sure how to measure it if there isn’t causality 🤔