Spec-Driven AI Development / lesson 4 of 4

Spec Kit Bug Extension

Play
Transcript

[00:00] This is the fourth video I’ve done on GitHub’s spec-driven AI development software called SpecKit. We have covered how to use SpecKit to begin a new project, how to integrate SpecKit into an existing project, and how to transform an initial idea into a specification for your feature or application using SpecKit’s Assess extension. In this video, we’re going to talk about how to fix bugs using the SpecKit bug extension. And with the SpecKit bug extension, we get three new commands. We get Assess, which is going to reproduce the symptom and locate the root cause in the code. We get Fix, which is going to apply the proposed fix directly to the code base. And we get Test, which is going to return a verdict of either verified, partial, or failed.

[00:34] So this is our application where I’ve found a bug, and I’m going to go ahead and plug in a new task here. I’m going to select a due date of somewhere in like 2012. Yeah, we’ll just go January 1st. I’m going to say it repeats daily. And I’m going to add that. Now, if I jump in here to my calendar, it is nowhere to be seen. I cannot find it there. However, if I go in and edit this, and I go to a more recent date, let’s say, you know, 2022, and apply that change. Now, when I go to the calendar, I can see daily standup is on every single day. So the bug is actually caused by the fact that I have a hard because I’ve got a coded limit of 5,000 days. So here’s our application. And currently in our extensions, we have assessed. So we’re going to add the bug extension with specify extension add bug. Cool. So that’s installed. We can see that in our project there. We’re going to add new commands. And all of that’s great.

[02:26] So here’s my bug. And below it, I do already know what the actual cause of that is in this particular file. But I’m not going to give the agent that information. So I’m going to jump into open code. I’m going to say spec kit dot bug dot assess. And I’m going to paste in my bug description. So we’ll run that guy. And when it gets done figuring this out, it is going to come back and ask me for a slug. I’m just going to go ahead and go with its recommended slug. Now we can see that under specify, we have a new bugs directory. So I created the directory. There’s no files yet. Now we can see we do have a file. It’s the assessment markdown. And if we scrub through this, we have various sections like suspected code paths and root cause, hypothesis and proposed remediation. So the next step is to run spec kit bug fix with our slug. So I’m just going to drop this in here and it should go to work applying that proposed remediation. And then we can see here we actually have code changes going on, obviously, in addition to the assessment that we added. And now that it’s wrapped up, we have a fixed document. And we can jump in here and see all the various changes that it made, the diffs and all that good stuff. It’s just very verbose in explaining exactly what it changed.

[04:15] So the last step here is going to be to run spec kit dot bug dot test along with our slug, which is going to go through and validate that fix for us. And now that our guys done, we can jump over to our application and we’ll try this guy out. So I’ll say daily stand up. I will set the date back to 2012 again, January 1st. Say daily and we’ll add that task. And now we’ll take a look at our calendar. And there we go. We have each and every one in place.

[05:01] So it was able to find the bug, determine exactly what was causing it, apply a fix and then run a test to verify that the fix worked.


Share this post on:

Previous
Spec Kit Assess Extension