Up & Running with GitHub Spec Kit #7 - The /analyze Command

Net Ninja · Beginner ·💻 AI-Assisted Coding ·8mo ago

Key Takeaways

The video demonstrates the use of the /analyze command in GitHub Spec Kit to analyze artifacts created for a spec-driven workflow with AI coding agents like Copilot, identifying inconsistencies, ambiguities, and coverage gaps.

Full Transcript

All right then. So now we've run the tasks command to make a kind of road map of things the coding agent needs to do to actually implement the feature. So we're almost at the point of telling copilot to do exactly that. But there's also this optional analyze command that we can run around about now which analyzes all the artifacts created so far. So the constitution, the spec file, the plan files, etc. And it analyzes the files for any inconsistencies where there might be conflicting information or any ambiguities or coverage gaps, those kinds of things. So, it's like someone taking a final glean over everything done so far, just to make sure we're absolutely ready to start running the tasks. Okay, so before we run this analyze command, I thought we'd just take a very quick look at the prompt file first of all, just to see what's actually happening under the hood. So, I've already got that file open right here, and we can see right away that again, it takes in the user input as the argument. But in the case of this analyze command, unless there's any specific guidance you want to give to the model, we don't really need to pass anything. At least I've not found so in my experience. So then down here we can see the goal of this instruction is to identify any inconsistencies, duplications, ambiguities, etc. It also says that this is strictly a read only action. So the coding agent won't be making any changes to the code. It's just going to analyze it. And then it also mentions the constitution file down here as well. And it tells the agent to flag any conflicts with that constitution in any of the other artifacts. We've also got a full breakdown of the different steps down here, starting with this script, which essentially grabs the feature directory and all the available documents in that directory. And then once the model has those, it can follow the rest of the steps down here as well to analyze them. Now, I'm not going to walk through this whole prompt file right now because it's a long one and that would take ages, but it generally asks the agent to flag any issues and report them back to us in a table format within the chat. All right, so let's give this a whirl. Let's close that down and open up the chat again and make sure we're in agent mode. And then we're going to say forward slashanalyze. In fact, I think it could be in ask mode this because it's not going to change any of the content. It is just reading them all and making sure everything looks correct. But anyway, we're going to press enter now and see what this does. [Music] All right, so it looks like this is all done. I'm going to make this bigger so we can read it properly. And I'm going to go up to the very top. I'm not going to read all this because it spat out an absolute ton of stuff. But this is where it finished. So we can see right here the executive summary analysis completed for doit goal tracking gap across spec.md and tasks.mmd. No critical constitutional violations found. So that's good. Everything we put in the constitution file has been adhered to. The artifacts demonstrate strong alignment with constitutional principles and comprehensive coverage of requirements. All right, good. So, we've got this table here, which is quite nice. And you can see, let me make this a little wider. We've got an ID for each of these items, I suppose. And we've got a category. So, this is an ambiguity. The severity is medium inside spec. MD. And it even says which functional requirement. And it says fun pastel colors lacks specific color values. Define specific color palettes in the plan or defer to a div uh design phase. So yeah, I mean I guess I could have provided actual colors. Um but I would just be happy to leave that to the AI to do later on. It doesn't bother me if they choose pink or green or whatever. I'm really not interested. So the second one is an ambiguity again inside pland this uh this time and it says the fast initial load smooth interactions is not quantified. Okay, so it wants some kind of measurable target. Again, I'm not really concerned with that at the minute. This is a throwaway app. But if we wanted to solve these ambiguities, we could do so. Right now, down here, we've got some inconsistencies, or rather just one. And the severity this time is low. It's in the tasks file, and it's T02 versus 06. And it says right here, date utils.ts referenced in both tasks. clarify T002 focuses on installation and T006 on utilities. So I would have to have a look at that. It does say it's a low severity. So I think that the AI would be capable of figuring this out. Then we've got under specification right here inside the tasks file from task 11 to 13. So it says the business logic tasks lack specific file paths. Add file paths, use goals.ts or separate service files. So again, I would have to have a look at that and I could add them in if I wanted to, but again, you know, AI models are smart and if they need to find a file, a lot of the time they will just do it. And then finally, we've got this coverage gap for FR015 that is a low priority and is to do with the local storage error handling. No specific task for error message implementation. And we should according to this add a task for local storage error UI component. So yeah, I mean we could do that. So we've got a coverage summary table right here as well. So all these key requirements have tasks. The only one that doesn't by the look of it is this thing which we just saw up here. So this coverage gap is also listed here, local storage error handling. Okay, so it's flagged it there. The constitutional alignment analysis says that it's compliance. So the clean code principle is specified in the tasks blahy blahy blah simple UX responsive design principle. So all of these things have been hit which is good especially at this one right here because if we had a lot of testing in place it would take a long time to do. So down here we've got some metrics. So total requirements 19 functional requirements we have 22 implementation tasks a coverage of almost 95% and we have two ambiguities and down here we've got some more detailed findings. We've got basically just the different issues again. So the next actions it says proceed with the implementation. So even though we've got those small ambiguities it's still advising that we just proceed with the implementation. So, we could do these improvements if we wanted to, but again, we don't have to. So, if we scroll right down, it says, "Would you like me to suggest concrete remediation edits for the top three issues?" So, we could do that if we wanted to. We could go in, we could edit all of these files. I don't really want to do that. I just wanted to show you that we can analyze these files. If there's anything in your analysis that you want to change in the plan or the spec, you could do it now and in the tasks before you go ahead and implement those tasks in the next lesson.

Original Description

In this Spec Kit tutorial series / crash course, we'll see how it can be used to implement a spec-driven workflow with various AI coding agents like Claude Code and Copilot (we'll be using Copilot). 🍿🥷🏼 Get early access to this entire course: https://netninja.dev/p/up-running-with-spec-kit 🧠🥷🏼 Get the Git and GitHub Masterclass Course: https://netninja.dev/p/git-github-masterclass 🔥🥷🏼 Get instant access to ALL premium courses on NetNinja.dev: https://netninja.dev/ Other Course Links: 🔗👇 Get Spec Kit: https://github.com/github/spec-kit 🔗👇 Spec Kit docs: https://github.github.io/spec-kit/
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Net Ninja · Net Ninja · 0 of 60

← Previous Next →
1 Regular Expressions (RegEx) Tutorial #14 - Matching a Username
Regular Expressions (RegEx) Tutorial #14 - Matching a Username
Net Ninja
2 Regular Expressions (RegEx) Tutorial #15 - Email RegEx Pattern
Regular Expressions (RegEx) Tutorial #15 - Email RegEx Pattern
Net Ninja
3 Regular Expressions (RegEx) Tutorial #16 - Finishing Touches
Regular Expressions (RegEx) Tutorial #16 - Finishing Touches
Net Ninja
4 GraphQL Tutorial #1 - Introduction to GraphQL
GraphQL Tutorial #1 - Introduction to GraphQL
Net Ninja
5 GraphQL Tutorial #2 - A Birdseye View of GraphQL
GraphQL Tutorial #2 - A Birdseye View of GraphQL
Net Ninja
6 GraphQL Tutorial #3 - Project (stack) Overview
GraphQL Tutorial #3 - Project (stack) Overview
Net Ninja
7 GraphQL Tutorial #4 - Making Queries (front-end preview)
GraphQL Tutorial #4 - Making Queries (front-end preview)
Net Ninja
8 GraphQL Tutorial #5 - Express App Setup
GraphQL Tutorial #5 - Express App Setup
Net Ninja
9 GraphQL Tutorial #6 - Setting up GraphQL
GraphQL Tutorial #6 - Setting up GraphQL
Net Ninja
10 GraphQL Tutorial #7 - GraphQL Schema
GraphQL Tutorial #7 - GraphQL Schema
Net Ninja
11 GraphQL Tutorial #8 - Root Query
GraphQL Tutorial #8 - Root Query
Net Ninja
12 GraphQL Tutorial #9 - The Resolve Function
GraphQL Tutorial #9 - The Resolve Function
Net Ninja
13 GraphQL Tutorial #10 - Testing Queries in Graphiql
GraphQL Tutorial #10 - Testing Queries in Graphiql
Net Ninja
14 GraphQL Tutorial #11 - GraphQL ID Type
GraphQL Tutorial #11 - GraphQL ID Type
Net Ninja
15 GraphQL Tutorial #12 - Author Type
GraphQL Tutorial #12 - Author Type
Net Ninja
16 GraphQL Tutorial #13 - Type Relations
GraphQL Tutorial #13 - Type Relations
Net Ninja
17 GraphQL Tutorial #14 - GraphQL Lists
GraphQL Tutorial #14 - GraphQL Lists
Net Ninja
18 GraphQL Tutorial #15 - More on Root Queries
GraphQL Tutorial #15 - More on Root Queries
Net Ninja
19 GraphQL Tutorial #16 - Connecting to mLab
GraphQL Tutorial #16 - Connecting to mLab
Net Ninja
20 GraphQL Tutorial #17 - Mongoose Models
GraphQL Tutorial #17 - Mongoose Models
Net Ninja
21 GraphQL Tutorial #18 - Mutations
GraphQL Tutorial #18 - Mutations
Net Ninja
22 GraphQL Tutorial #19 - More on Mutations
GraphQL Tutorial #19 - More on Mutations
Net Ninja
23 GraphQL Tutorial #20 - Updating the Resolve Functions
GraphQL Tutorial #20 - Updating the Resolve Functions
Net Ninja
24 GraphQL Tutorial #21 - GraphQL NonNull
GraphQL Tutorial #21 - GraphQL NonNull
Net Ninja
25 GraphQL Tutorial #22 - Adding a Front-end
GraphQL Tutorial #22 - Adding a Front-end
Net Ninja
26 GraphQL Tutorial #23 - Create React App
GraphQL Tutorial #23 - Create React App
Net Ninja
27 GraphQL Tutorial #24 - Book List Component
GraphQL Tutorial #24 - Book List Component
Net Ninja
28 GraphQL Tutorial #25 - Apollo Client Setup
GraphQL Tutorial #25 - Apollo Client Setup
Net Ninja
29 GraphQL Tutorial #26 - Making Queries from React
GraphQL Tutorial #26 - Making Queries from React
Net Ninja
30 GraphQL Tutorial #27 - Rendering Data in a Component
GraphQL Tutorial #27 - Rendering Data in a Component
Net Ninja
31 GraphQL Tutorial #28 - Add Book Component
GraphQL Tutorial #28 - Add Book Component
Net Ninja
32 GraphQL Tutorial #29 - External Query File
GraphQL Tutorial #29 - External Query File
Net Ninja
33 GraphQL Tutorial #30 - Updating Component State
GraphQL Tutorial #30 - Updating Component State
Net Ninja
34 GraphQL Tutorial #31 - Composing Queries
GraphQL Tutorial #31 - Composing Queries
Net Ninja
35 GraphQL Tutorial #32 - query variables
GraphQL Tutorial #32 - query variables
Net Ninja
36 GraphQL Tutorial #33 - Re-fetching Queries
GraphQL Tutorial #33 - Re-fetching Queries
Net Ninja
37 GraphQL Tutorial #34 - Book Details Component
GraphQL Tutorial #34 - Book Details Component
Net Ninja
38 GraphQL Tutorial #36 - Styling the App
GraphQL Tutorial #36 - Styling the App
Net Ninja
39 GraphQL Tutorial #35 - Making a Single Query
GraphQL Tutorial #35 - Making a Single Query
Net Ninja
40 Build Apps with Vue & Firebase - Udemy Course
Build Apps with Vue & Firebase - Udemy Course
Net Ninja
41 Updated Vue & Firebase Course (Udemy)
Updated Vue & Firebase Course (Udemy)
Net Ninja
42 Vue & Firebase Real-time Chat (Preview) #1 - Intro
Vue & Firebase Real-time Chat (Preview) #1 - Intro
Net Ninja
43 Vue & Firebase Real-time Chat (Preview) #2 - Project Structure
Vue & Firebase Real-time Chat (Preview) #2 - Project Structure
Net Ninja
44 Vue & Firebase Real-time Chat (Preview) #3 - Firestore Setup
Vue & Firebase Real-time Chat (Preview) #3 - Firestore Setup
Net Ninja
45 Vue & Firebase Real-time Chat (Preview) #4 - Welcome Screen
Vue & Firebase Real-time Chat (Preview) #4 - Welcome Screen
Net Ninja
46 Vue & Firebase Real-time Chat (Preview) #5 - Props in Routes
Vue & Firebase Real-time Chat (Preview) #5 - Props in Routes
Net Ninja
47 Vue & Firebase Real-time Chat (Preview) #6 - Route Guards
Vue & Firebase Real-time Chat (Preview) #6 - Route Guards
Net Ninja
48 Vue & Firebase Real-time Chat (Preview) #7 - Chat Window
Vue & Firebase Real-time Chat (Preview) #7 - Chat Window
Net Ninja
49 Vue & Firebase Real-time Chat (Preview) #8 - New Message Component
Vue & Firebase Real-time Chat (Preview) #8 - New Message Component
Net Ninja
50 Object Oriented JavaScript Tutorial #1 - Introduction
Object Oriented JavaScript Tutorial #1 - Introduction
Net Ninja
51 Object Oriented JavaScript Tutorial #2 - Object Literals
Object Oriented JavaScript Tutorial #2 - Object Literals
Net Ninja
52 Object Oriented JavaScript Tutorial #3 - Updating Properties
Object Oriented JavaScript Tutorial #3 - Updating Properties
Net Ninja
53 Object Oriented JavaScript Tutorial #4 - Classes
Object Oriented JavaScript Tutorial #4 - Classes
Net Ninja
54 Object Oriented JavaScript Tutorial #5  - Class Constructors
Object Oriented JavaScript Tutorial #5 - Class Constructors
Net Ninja
55 Object Oriented JavaScript Tutorial #6 - Class Methods
Object Oriented JavaScript Tutorial #6 - Class Methods
Net Ninja
56 Object Oriented JavaScript Tutorial #7 - Method Chaining
Object Oriented JavaScript Tutorial #7 - Method Chaining
Net Ninja
57 Object Oriented JavaScript Tutorial #8 - Class Inheritance
Object Oriented JavaScript Tutorial #8 - Class Inheritance
Net Ninja
58 Object Oriented JavaScript Tutorial #9 - Constructors (under the hood)
Object Oriented JavaScript Tutorial #9 - Constructors (under the hood)
Net Ninja
59 Object Oriented JavaScript Tutorial #10 - Prototype
Object Oriented JavaScript Tutorial #10 - Prototype
Net Ninja
60 Object Oriented JavaScript Tutorial #11 - Prototype Inheritance
Object Oriented JavaScript Tutorial #11 - Prototype Inheritance
Net Ninja

The /analyze command in GitHub Spec Kit analyzes artifacts for inconsistencies, ambiguities, and coverage gaps, providing a summary of findings and suggestions for remediation edits, enabling developers to refine their spec-driven workflow with AI coding agents.

Key Takeaways
  1. Run the /analyze command
  2. Review the prompt file
  3. Analyze the artifacts
  4. Identify inconsistencies, ambiguities, and coverage gaps
  5. Review the summary of findings
  6. Proceed with implementation or refine the spec
💡 The /analyze command provides a valuable check on the consistency and completeness of the artifacts, allowing developers to refine their spec-driven workflow and ensure successful implementation with AI coding agents.

Related Reads

Up next
99% of People Still Don't Understand Vibe Coding
Vskills Certification
Watch →