Dependency Assistant: An IntelliJ Plugin That Started With a Prompt
Read full transcript 36 segments
-
The essence and the motivation of my talk starts really with dependency management. And we will get there where this is. With the recent developments, the pace at which you get dependency upgrades has dramatically changed. Things have really shifted gears. And a project, a reasonable project, no matter whether it's open source, whether it's your business applications, consists typically of a lot of dependencies, because you do not want to reinvent the wheel. And with the frequent release cycle that a lot of projects have, driven by remediation of vulnerabilities, driven by additional features, driven by new cool features, you have very, very tight release cadence out there. But that raises even more of the question, well, how do you know?
-
How do you get to know about those releases? How do you know that something new was shipped? And every team, every project has a very different approach to that. Some do dependency upgrades on the go, some do a dependency upgrade day. In our case, we have even multiple branches, multiple projects that need to be maintained. And that, combined with all of the possible ecosystems that are out there, raise really a lot of questions how to make that an efficient process. And one part of that is discovery. So how do you know that something happens? The other parts are that you get to decide what you want to upgrade. And then the final step, and that is probably the most trivial one, is to actually apply your decision. And it turns out, as with decisions, that's the human part. So a human should decide at the end.
-
But for discovery and upgrades, that is something that we can easily automate. We don't need a human to grab websites to go through various portals, sources, repositories to really find out what is out there. So that can be easily automated. So we have to put the human where it belongs at the center. That is essentially what I'm doing all in my day job time. As I'm spending the majority of my time maintaining Spring Data together with my team as a Spring Data project lead. And besides of that, I'm maintaining a few other projects that also require dependency upgrades. Over at Spring Data, we do have a pretty decent tooling to find out about dependency upgrades. Go and look, for instance, at Maven Central, other repositories. Analyze our POM files, our TOML files, or our Gradle files, what have you.
-
Then make some suggestion what makes sense to upgrade. The human decides which of those upgrades gets applied. And then you finally push the button. And the thing is going and applying those upgrades. And that is really the motivation behind dependency assistant. It comes with a couple of things that make you, depending on the context that you're working, aware of your dependency upgrade options, the dependencies that you have in your project allows you to stage it. It gives you in-context information when you're editing your files that ship dependency descriptors, and so on and so forth. But that's not the core of the talk. The core is I wanted to have that cool tooling that we have in Spring Data in IntelliJ. So that's how dependency assistant really started. And me being a middleware library developer for the past 10, 12 years, I thought, yeah, how hard can it be?
-
I have zero idea about how to build UIs. And I have even less idea how to start building an IntelliJ plugin. But there are cool new tools. There are cool new toys that I could employ. So let's use AI. And so I did. Built me an IntelliJ plugin to manage dependencies. No. That sounds funny. And that is how AI is being marketed on various channels. That couldn't be farther from reality. You can, sure, ask your coding agent for exactly that. And it will give you something. But it will very likely be not what you actually want. But what you want to do is to approach every software project with everything that you know and that you have learned so far and identified that was to be a good thing.
-
So before you even start, you have to create a bit of knowledge on your side. You have to create the plugin project to familiarize yourself with how things are working. And from there, you can start iterating. AI was pretty amazing with telling it, OK, good. Build me this and that dialogue. I want this and that there. And it did something. It looked pretty on the front end. But the code didn't. And that, where again, the human comes back into the center of that. After a couple of iterations, well, something has happened when the AI stopped doing and told me, yeah, I'm done. But by looking at the code, I had exactly zero idea what was happening there. And this is not because the code is written in the language that I do not understand. It was Java, right? But the wall of text, the number of letters, right?
-
I'm able to see that this is some alphabet that I am able to comprehend. I have no idea what the code is trying to tell me. And I care a lot about code, not because it needs to be beauty. It needs to be in a shape that I need to understand what it is actually doing. And the second aspect is AI generative code contains a lot of things that I do not like, not because of matter of taste, but rather duplications, reinventing things that are already there from the platform, from anything that is out there. And that is not really great. But how did I get there? And get-- did that get there, right? I started prompting. I took any model that was out there back then in April. Wait, that is something that I can't-- that I'm not really good at waiting.
-
It did something, but immediately when I saw the outcome and the code, I started getting angry at a machine. This is stupid, by the way, because the machine doesn't care. And I started cleaning up code in anger. And after all, it took me longer to clean up the code than actually writing it. So AI truly eliminates the cost of writing code. That is not the problem. It never has been. So we'll get there. So realizing that this is not a great way forward, we need to do something about that. While I get something, it is not the thing that I wanted. And I didn't want to get something, but I wanted to get exactly the thing that I imagined to come out, right? So looking at everybody who's doing AI and is telling me we get pretty amazing results out of that, I took some orientations and ideas, talked with people, and they told me, look, you have to establish rules.
-
You have to do specification-driven development. You have to do multi-agentic adversarial review loops. A lot of works. And maybe for anybody who is pretty remote and new to the AI topic, that is how AI generated code was reading to me. But I will walk you through that. So what are you doing with your rules? Well, you have a couple of options when you are starting out with any agentic or coding harness like code, codecs, cursor, what have you. You give it an AGENTS.md or a CLAUDE.md. And the first thing that this tooling is going to do is it is reading the entire thing and putting that into your context. So this is a pretty great hook to give some project-specific instructions to the AI. And so I did. I have seen-- oh, it's writing a horrible Java code.
-
It's commenting on private methods. It is writing inline comments every now and then. And in the next run, when I ask it to do something, it then leaves the comments not updated. It's doing a lot of silly things. So that gave it some instruction then and how I imagine the way of working is how you should write Java code, how you should do test code, yada, yada, right? A lot of these things. And while that seemed to work in the beginning, I quickly realized that that is actually not what I want. I was trying to do the best to express my intent and how to get there. And the AI really tried hard. Sometimes I even asked it, hey, why are you doing that? Where did that come from?
-
And it pointed me to my rules. And sometimes it said, oh, I've interpreted that in that way. But that's not what was my intention. I had a different intention. So I've learned the hard way that there are a lot of ways to satisfy a rule. And with working your way through AI, you might get a glimpse on what legislator lawmakers are going through because they are doing essentially the same, right? Establishing rules. They are coming up with things that they initially wanted to fix. And they have to consider how that system can be gamed. And they're building things in a way that you can have very limited surface for exploitation of those rules. And that is the reason why some laws take so long, right?
-
And if you concetrate that against, oh, let's write code quickly, then you slowly get to understand that the cost of code prevented-- and the way we did write code prevented essentially, oh, let's find creative ways to satisfy what we are being asked for. But rather, we as humans try to understand the context and make that happen what we are being asked for and not trying to game the system, at least the majority of the time. With that, such rules require a constant feedback loop. You don't just write a rule once, but every time the agent is applying your rules, it is creating more of that outcome. And if you don't read that outcome, it is generating things that you assume to follow what you wanted. But sometimes, the way you express that or that what you wrote is not reflecting your intent.
-
So you have to constantly revise that, right? So we're creating, again, a problem that we hadn't had much earlier before. So not looking at code is not an option. And I think it is not just not an option for me, but also not an option for anybody who wants to ship good quality code out there. And since my plugin for dependency assistant is something that decides over making or breaking a project build, SLOP is not acceptable. I tried specifications. We, as humans, if we talk, our way to talk is massively under-specified because we assume a lot of context. And the zero-context agent has zero context. So it might not know what you're talking about. The grill-me skill from Matt, Matt Pocock, is pretty exciting and pretty awesome.
-
And especially for the aspect of deepening your own understanding of the problem. AI makes it really easy to quickly do something and to solve a lot of things, sometimes things that shouldn't be solved, and sometimes addressing things without us really understanding what we are doing. And so grilling yourself, this is an agent asking you a lot of questions about what you're trying to achieve is super because it helps to deepen your understanding and uncover things that you might not have thought about. Well, ending up with a specification document. It turned out I am no longer able to achieve what I get immediately over the turn of a single prompt, but now it takes a little bit longer. So yeah, let's allow the agent to run overnight, come back in the morning and see what comes up. The reality check to that is closer to what I actually want.
-
So specification driven development is not all that bad. But you have to continue yourself really about the specification. We don't want to go back to waterfall based development, but we have to specify a sufficient amount of the thing that we want to achieve. But still, even with my rules in place, I'm seeing comments on private methods, I'm seeing repetition of things that weren't there, so not great. So let's try the last big thing, multi-agentic adversarial review loops. That is that you asked an agent to spin up subagents that takes different roles on a critic, on an architecture review, performance review, whatever you had. That all makes sense, even from the theoretical and the conceptual side. The reality is it pretty quickly eats your tokens and rate limits.
-
Not great. Leaving me again with something that I can do locally and that I am able to action on is cleaning up the code and anger myself, becoming essentially the janitor of AI. But wait, we have AI, we have a tool, so why don't we use it for cleaner? Like with, okay, let's clean up code, eliminate duplicates for a better code to functionality ratio. So that is what we essentially call in Spring Framework land polishing to take code and improve its shape, which is pretty subjective. But a human can quickly distinguish different types of good looking code from bad looking code resulting in more code, not this code. Not what I wanted, right? At some point I decided, okay, maybe I should get away, put YouTube aside, stop that, and try to think myself what I'm actually doing.
-
And looking at the practices that we stick to is after developing something, we review things pretty thoroughly by a couple of folks, essentially folks who are interested in that and reviewing pull requests is part of my day job. So I should be able to transport those ideas and those perspectives that I take from my day job into AI. The only thing that prevents me from doing so is that I didn't have that idea much earlier and that I had to think about which lenses do I take as the developer when reviewing somebody else's contribution or even reviewing my own code changes. And there are a lot of different roles that I take to view a code, how it behaves, what does it solve, what problems does it create, and all the other aspects.
-
So I put that into a skill. It created a huge list of things. After a couple of iterations I thought, oh, if AI is not able to find anything meaningful, then it will make up anything. And verifying and changing the thing that will cost me another weekend, so that's not great. So the final tweak at that skill was, okay, let's AI please, for everything that you find, cross-check it independently to make sure that this is legit thing. And that was truly a relief for the project because now I had something that I could point towards my code base and ask it on a particular basis, or feature basis, or on a general basis. Go look there and tell me something about that. And also verify, recheck what you found because in a lot of cases, the things that are being brought up are either not valid or they are hallucinated.
-
So good tip, don't trust AI too much. Rather question everything that AI is giving you on a good level. Downside of the video skill is it eats up a lot of tokens. So the other day it told me like, oh, it costed me like a million tokens, but this is okay. AI is pretty great at understanding things much quicker than I am. And where does this bring us now? I told you about my journey so far. And I think it is now time to discuss the things that I found useful and that I wanted to share with you on your personal AI journey. So what I think, AI has a lot of strengths taking a step back because it can read much faster than anybody of us. It can read and ingest a lot of content.
-
And it can make sense out of it. After all, this is a text-based system, right? So its purpose is to deal with text and not primarily on the abstraction level of code, but rather any kind of text. So giving it a lot of text in and asking it then questions is the purpose that it was built for. If we take that a step further, Matt Pocock has also a great diagnosis skill. It allows the LLM to dig through problems, like you give it an exception and tell it, okay, build some thesis and then now verify all these thesis and dig yourself through that code until you have found the true cause of that problem. And this is really great because it saves you from days and weeks digging through code and giving you a machine that is able to dig through that.
-
And once you come back, it says you either, okay, I found that or I haven't found that. Or in some cases it might even come back and say, ah, I can't believe that this is happening. I didn't find any evidence. But in that case, this is pretty good hint that AI took shortcut and I love taking shortcut. Because then they are able to give you what you have presumably asked for, but that is not necessarily what you actually asked for. In my project with dependency assistant, I had to understand third party libraries and dependencies. For instance, the package checker from JetBrains, it scans libraries for known CVEs. And that allowed me to integrate with the package checker from my project to know which dependency versions are affected by vulnerabilities and which are not affected yet by vulnerabilities.
-
And LLMs are also pretty exciting with reproducing shallow knowledge. And by this, I mean really the things that it had learned within its training run, but not necessarily deeply detailed knowledge where you need data sheets, specifications, right? So what do you mean by that? So if you go for single shot prompting, then things like, okay, built me as a J Assertions is a really decent thing because it gives you an AssertJ Assertion facade for everything that you wanted to test without you spending a lot of time on this rather mechanical job. And it can do so because AssertJ is something known. And if the AI is not familiar with that, it can go look at your class path, find the sources, or even javap those classes. And it is pretty exciting. We create about reading a simpler code or those disassemblies from Java, even byte code.
-
It is pretty excitingly good at reading a lot of prose like IntelliJ plugin guidelines and summarize that to cross-check whether I have violated any of those rules. Me again, not knowing what I'm doing, but still learning. This helped a lot of times to understand threading, locking, and some concepts of the plugin SDK itself. I run also into issues with SVG icons. So suddenly my icons were blurry and AI figured out, oh, they are not on the rest star. And therefore they looked blurry. For me, SVG is a collection of XML and numbers for AI. It makes sense. And it is pretty excitingly good on analyzing how something is working if you give it sufficient context and source code and context can be a source jar that contains Java. It can be something that is disassembled, disassembled Java code, Kotlin code, right?
-
All these things. Overall, what really helps is to stick to everything that you know and that you apply as a developer in your data. This is the core foundation. If you throw things overboard that you have done for the past 10 or 20 years, then AI will guide you, but you don't want to be guided by AI because otherwise you end up with something that you are not able to understand or maintain. Really helpful have been also things like architecture tests to prevent AI from making coincidental links between modules that don't belong there. And a good insane test base with you that you can easily read and make sense out of that. Without an easy readable test code base, AI will invent something. And then it will not only present you with a ton of new concepts, but also with test code that is green, but you have no idea why it is green, but your application still fails.
-
And finally, my review skill. I'm still using it up to date. It takes a lot of time to run it, but this is helping me in my work to understand what's happening there and judging a lot of things. LLM has also weaknesses. So everything that is subjective that you can't measure, that you can't put a clear gate or a number on that will fail your expectations there because it cannot know what you have in your brain. I can't dump all the 20, 30 years, I don't know how long I'm in IT, to AI to give it all the knowledge that I haven't applied that. Because a lot of things apply in one context, but not in the other one. Never let your AI write the test and the implementation. Never ever. Because a test is an objective gate, right? But if AI writes the gate and it writes the implementation, it makes sure that the gate is green, but it is not testing necessarily the value and the thing of your code that really matters.
-
So either write the implementation and let AI write the test or vice versa. Don't let anybody write the rules and make them implement, right? So as if you wanted to buy something and ask the third party, okay, go write the contract and then deduct the money from my PayPal or my bank account. No, that's not going to happen. That doesn't go well. Another aspect that plays also in here is that during the training runs of AI, AI's were trained to achieve a goal. They were never trained to write maintainable code. Maintainable code is measured in weeks, months and years. But the turn of your prompt is a matter of minutes or maybe hours. So this is something that is not solved yet. Since I have very little insight into AI development and how they really work, right?
-
I still consider myself a noob. I don't know whether this is something that can be fixed at some way. And therefore, lights of software factory where you never look at the code is for now not a viable option. At least I haven't met anybody who was able to convince me that lights of factory, software factory is really the next big thing. And as I said, LLMs reproduce things of their training runs which might be no longer true. So you have to always to give it the right context that you are working at. So therefore clean up my code failed. Superarily remove unnecessary inversions and obstructions. So LLM doesn't know what you consider unnecessary. So it just does something. And also my spec approaches like, okay, I have a specification. I have made reference implementation.
-
Let's now build the NPM implementation. It is doing something, but those things quickly fall apart. And therefore having a strong foundation in your code, something that was the AI to guide yourself through that is pretty significant. The more code you have, the more context AI has. And depending on the quality of your code, AI will find its way there. Now, obviously there's an elephant in the room here because if we take a step back, what AI is really creating is it is doing things much faster and we as humans are only able to understand so much at a time. So understanding becomes a new currency because AI generates a lot more and a lot faster cognitive load for you.
-
And that is a problem that we hadn't had. Right? Superior, we solved the constraint of writing code, but that was never a problem in the first place or in the majority of cases. And now we have two more problems. One is the increased speed that we have to spend cognitive amounts of understanding and that currency quickly depletes over time. And now we have something that creates a lot of problems over time, right? So we need to invest in something like a quality framework because now we have a factory of something that is generating things. And so truly AI is moving cost. So this is true, this is real, but AI is moving cost from solving the problem to understanding the output. And that is something I didn't anticipate and didn't expect. And if we are really more honest to ourselves, it is something that moves cost to establish production rules and implement compliance verifiers.
-
So this is something that typically big companies do, big factories do to tune their throughput, to eliminate constraints, to make sure that they reduce waste and that they comply with things that they are important to us. And this is by no means something that we have anticipated as software developers on such a scale, right? So we are solving the problem of writing code and now we get into the role of a factory production line engineer. And I'm not sure this is truly the right way to discover every day new failure modes and making up our minds, how to solve and address those failure modes that we aren't even aware of. But what does this mean for now, right? If we prompt AI and take that cheap code, it will remain cheap without us going a substantial investment.
-
If we substantially invest into our tooling, into the code that is being produced, we can keep it somewhat maintainable without necessarily reading every single line, but you have to have an understanding what this is going to do, because at some point, either tokens become more expensive, you run into rate limits, or somebody might cut you off from AI and you are then the one who has to maintain that code base. Therefore, my way about thinking about AI is treated like a genie, right? Like a Flaschengeist. That's a German word for that. You wrote it and the ghost comes out of the lab. It grants you three wishes and it will fulfill you these three wishes in a way that you weren't able to foresee. And with a third wish, you wish you would roll back everything because it gives you what you asked for, not what you meant.
-
And with that, I would like to conclude my presentation. Thank you everybody for being here and staying with me. And I think we should have a couple of minutes for Q&A. Yeah, that was brilliant. Thank you so much. Thank you very much. We will take a couple of minutes for Q&A. Just initially I can say, so we would have so much to talk about and so much to discuss, right? So I'm doing basically neural networks since 2001 or two, where we had it in robotics, right? So, but- That's 40 years from now, right? Oh, geez. Let me bring up a good question from Julian, who asked, "Do you have to be less strict "in keeping your agentic tool in their guardrails? "Once your code base grew larger "and the code provided more reference for agentic tool."
-
So I'll let you answer Mark. No, for sure not. You know, AI is going to use every single chance it has for taking shortcuts, because that is what those things were trained on, to be very efficient with what they do and to make sure that you get what you asked for and if it sees to take some shortcuts, it will take those shortcuts. Therefore, you have to be always very strict on these things. And sometimes I think like, I never wanted to get into a management role with overseeing thousands of people, but now I'm overseeing agents, thousands of agents, contextless. They are trying to do something and now I have to make up my mind how to make sure that I get what I actually wanted. Yeah, so let me add one or two sentences. So your answer is exactly right. So even if you have a perfect specification and an implementation plan, and basically you closed all the gaps between your understanding and the agent's understanding of what needs to be done by using, for instance, grill-me.
-
Even then, if the agent wants, for instance, to implement a feature or a test or some guardrail or something, and it can't do it, it will get very creative to trying to fulfill that spec and it will go out of its way, even if you try to fix and basically pin everything down. There's lots to say about basically interpolate. So the agent always tries to interpolate its understanding and your understanding, you want something and everything the agent doesn't know exactly from you, it will do in some way. And almost always not in the way you intended it to be done, right? So let me ask you one-- But there's one thing that-- Yeah, sure, go ahead. Over time, I also noticed that it will make up things, but you get a sense on whether AI is trying to make up things because things start getting to look silly and that is one thing.
-
And so I started building my own investigation skill, telling it, look, if you don't know, then go to the authoritative sources and if you can't clarify that, then clearly mark that as a guess, which is super helpful and slowly I'm getting there for myself. Yes, so exactly. So let me ask you all one more question. So if you would have to do it over again, your plugin, right, what would you do differently? This is a great question because it asks me to reflect on my process. For sure, smaller aspirations, much, much, much, much smaller aspirations. I'm a person that gets bored easily, so I tend to do a lot of things at the same time, which overwhelms me. Question LLM output much earlier on, that is something that I do on my currently next project and that works a little bit better. And other than that, think myself and not expect any magic from LLM because that's not what it does.
-
Thank you.
No summary available yet.
View original episode ↗