Up & Running with GitHub Spec Kit #2 - The /constitution Command
Key Takeaways
The video demonstrates how to use GitHub Spec Kit with Copilot to implement a spec-driven workflow, utilizing the /constitution command to update the constitution file and ensure adherence to project principles.
Full Transcript
Okay then my friends. Now we have spec kit set up inside the project. We can begin the specd driven development cycle. And we're going to start by using the constitution command to update the constitution file. So if we take a look inside the specify folder inside that we're going to see a constitution.mmd file within the memory directory. So this is just a markdown file that already contains a bit of template within it. And the whole premise of this constitution file is to outline some governing principles for your project or organization which are non-negotiable. For example, if accessibility should always be first and forefront no matter what, then that should go in your constitution file. If you must use certain frameworks or libraries like Next or Drizzle OM without fail, then that should go in your constitution file. If the UX must always be clean, simple, and clear no matter what, then that should go in your constitution file. And if you must unit test every single component, that should go in your constitution file. Then that file will be kept as memory for the coding agent to refer back to and ensure no matter what feature or task is being implemented, these principles are adhered to. Well, that's the idea anyway. So then we could manually fill this constitution file in ourselves or we could just use the constitution command that specit gave to us in copilot. So I could type forward slash constitution followed by a bit of input as to what kind of principles I want to put in this file. Now I'm just going to paste that in right now to save you watching me type this out from scratch. But it says, "Declare principles for clean code, simple UX, responsive design, and minimal dependencies, absolutely no testing, no unit tests, no integration tests, no end to end tests. This must supersede any other guidance. The project must use the Nex.js, React, and Tailwind versions as per the package.json file. And we can attach that file if we wanted to as context to the prompt as well. Now, I've deliberately pulled right back on the testing for two reasons. First, because I think the prompts that SpecKit provides are geared towards test-driven development, which can take a lot of time. And because this is only going to be a dummy throwaway app for a tutorial video, I want to pull back on that a lot. So you might see me occasionally trying to do that like in this constitution file. But for an application intended for production, I probably wouldn't pull back as much and instead I'd outline my testing preferences. And by the way, I would try this whole process out with different models, right? Because they do produce different results. I personally like Sonic for this stage because it goes through step by step in real time what it's doing and I can see that. But when it comes to making tasks, sometimes I might switch to GPT5. So definitely play around yourself and see what suits you best. Anyway, we're going to fire this off in a moment. And when we do that, because we use the constitution command, Copilot is going to find that custom constitution prompt in the GitHub folder and it's going to run it. So let's open that up and have a quick look inside to see exactly what it says. And by the way, it might read differently on yours because SpecKit is very new and there's changes coming thick and fast. But right here it says the user input is the dollar sign arguments and this arguments thing is how we access what a user types after the command no matter what that command is. So if we typed constitution to run that command which in turn fires this constitution prompt then any words typed directly after that command in the chat would be taken as the arguments and those arguments can then be accessed in this prompt and by the coding agent if we tell it to. Right? So then it also tells the agent to update the constitution file in the memory folder and to replace any placeholder tokens in square brackets based on our input after the command. And down here it provides concrete details on how to do that. So first of all it explains how to find the file and which parts to update. Then it tells the agent to collect possible values for the placeholders based on our import the arguments. After that, it instructs it to replace all those placeholder token values with values derived from our collected input. It also might update other specit template files based on this constitution to make sure they're in alignment with it. There's a few other steps down here as well after the agents filled in the blanks to make sure everything checks out correctly and the type of feedback it should give us in the chat when it's done. But essentially when we run this constitution command, it fires the constitution prompt which tells the coding agent to fill in the constitution file in the memory folder by extracting any input we give it and using that to fill in any placeholder tokens. And when we open this, we can see it's basically just a template with a bunch of different placeholders for different principles. And these are the placeholders copilot or whatever other coding agent you're using should be updating with our principles that we gave it. So then this constitution file would serve as a reference to all future specs or plans or code generated by the coding agent with the goal being that anything in this file should trump all other information because these are your non-negotiable principles. All right, so now let's close some of these files and we're going to hit enter on the prompt to see if it does what it should do. Now, it might take a little bit of time to complete, and along the way, it might ask us for permission to do certain things, which I'm going to give it. But right now, I'm just going to speed this up and come back when it's done. All right, so it looks like it's all done and you can see the output right here. If we scroll up a little bit, this is the kind of summary. So it says it successfully created the constitution with our specified principles. And down here it just lists the different principles we gave it. So clean code, simple UX, responsive design, minimal dependencies, and then also it's been very explicit in the no testing policy. So much so that it's gone to update other files as well. So if we click off this, you can see not only did we update the constitution file, but we also updated three other template files right here. And prior to running this command, these template files had in them information about testing the different features that we implement. And because I said, look, this is a non-negotiable thing that I want to put in the constitution, it's gone into all of these different files, read them, and updated them where it had any kind of testing in place and removed them or updated them to be explicit in that we don't want testing in place. So, that was good. Not only does it update this file, it updates other template files as well. All right, so let's just have a little scroll through this constitution file. And you can see now all of those placeholders are gone, right? And it's updated it with actual content. So this is the first core principle, clean code. I'm not going to read all of this out, but basically it's saying that the code must be readable, maintainable, etc., etc. And then down here we have a simple UX principle. Uh, then we have responsive design. I don't know whether I actually said to implement the responsive design. Let's have a little look if we scroll right up here because I can't remember saying that. Maybe I did. Simple. Oh, yeah, I did. Responsive design. Okay, so yeah, that is the next principle. Responsive design, minimal dependencies. Uh the technology stack is down here. So it's looked at the package.json file and found the different technologies we're using and put the versions here. Uh the development workflow down here. So code changes must be manually verified. Blah blah blah. Yeah. Governance. All right. So yeah, that all looks pretty good to me. I'm not going to go through these other files. I'm going to trust that it's updated them accordingly. What I am going to do is just commit these changes. So I'm going to use copilot to come up with the commit message. Commit that. All right. Okay then. So now we've run this first command which updates the constitution file with any governing principles. In turn that also updates any other template files in accordance with those principles so that when we come to use them later they'll incorporate that information. So going forward when we start to use other commands the idea is that this constitution file serves as memory or guidance to the coding agent and forces it to stay within these outlined principles. So we're kind of putting walls around the application and we're saying stay within these boundaries at all times. Anyway, now that's done, the next step is to start making a spec for a new feature, which we'll do 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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Regular Expressions (RegEx) Tutorial #14 - Matching a Username
Net Ninja
Regular Expressions (RegEx) Tutorial #15 - Email RegEx Pattern
Net Ninja
Regular Expressions (RegEx) Tutorial #16 - Finishing Touches
Net Ninja
GraphQL Tutorial #1 - Introduction to GraphQL
Net Ninja
GraphQL Tutorial #2 - A Birdseye View of GraphQL
Net Ninja
GraphQL Tutorial #3 - Project (stack) Overview
Net Ninja
GraphQL Tutorial #4 - Making Queries (front-end preview)
Net Ninja
GraphQL Tutorial #5 - Express App Setup
Net Ninja
GraphQL Tutorial #6 - Setting up GraphQL
Net Ninja
GraphQL Tutorial #7 - GraphQL Schema
Net Ninja
GraphQL Tutorial #8 - Root Query
Net Ninja
GraphQL Tutorial #9 - The Resolve Function
Net Ninja
GraphQL Tutorial #10 - Testing Queries in Graphiql
Net Ninja
GraphQL Tutorial #11 - GraphQL ID Type
Net Ninja
GraphQL Tutorial #12 - Author Type
Net Ninja
GraphQL Tutorial #13 - Type Relations
Net Ninja
GraphQL Tutorial #14 - GraphQL Lists
Net Ninja
GraphQL Tutorial #15 - More on Root Queries
Net Ninja
GraphQL Tutorial #16 - Connecting to mLab
Net Ninja
GraphQL Tutorial #17 - Mongoose Models
Net Ninja
GraphQL Tutorial #18 - Mutations
Net Ninja
GraphQL Tutorial #19 - More on Mutations
Net Ninja
GraphQL Tutorial #20 - Updating the Resolve Functions
Net Ninja
GraphQL Tutorial #21 - GraphQL NonNull
Net Ninja
GraphQL Tutorial #22 - Adding a Front-end
Net Ninja
GraphQL Tutorial #23 - Create React App
Net Ninja
GraphQL Tutorial #24 - Book List Component
Net Ninja
GraphQL Tutorial #25 - Apollo Client Setup
Net Ninja
GraphQL Tutorial #26 - Making Queries from React
Net Ninja
GraphQL Tutorial #27 - Rendering Data in a Component
Net Ninja
GraphQL Tutorial #28 - Add Book Component
Net Ninja
GraphQL Tutorial #29 - External Query File
Net Ninja
GraphQL Tutorial #30 - Updating Component State
Net Ninja
GraphQL Tutorial #31 - Composing Queries
Net Ninja
GraphQL Tutorial #32 - query variables
Net Ninja
GraphQL Tutorial #33 - Re-fetching Queries
Net Ninja
GraphQL Tutorial #34 - Book Details Component
Net Ninja
GraphQL Tutorial #36 - Styling the App
Net Ninja
GraphQL Tutorial #35 - Making a Single Query
Net Ninja
Build Apps with Vue & Firebase - Udemy Course
Net Ninja
Updated Vue & Firebase Course (Udemy)
Net Ninja
Vue & Firebase Real-time Chat (Preview) #1 - Intro
Net Ninja
Vue & Firebase Real-time Chat (Preview) #2 - Project Structure
Net Ninja
Vue & Firebase Real-time Chat (Preview) #3 - Firestore Setup
Net Ninja
Vue & Firebase Real-time Chat (Preview) #4 - Welcome Screen
Net Ninja
Vue & Firebase Real-time Chat (Preview) #5 - Props in Routes
Net Ninja
Vue & Firebase Real-time Chat (Preview) #6 - Route Guards
Net Ninja
Vue & Firebase Real-time Chat (Preview) #7 - Chat Window
Net Ninja
Vue & Firebase Real-time Chat (Preview) #8 - New Message Component
Net Ninja
Object Oriented JavaScript Tutorial #1 - Introduction
Net Ninja
Object Oriented JavaScript Tutorial #2 - Object Literals
Net Ninja
Object Oriented JavaScript Tutorial #3 - Updating Properties
Net Ninja
Object Oriented JavaScript Tutorial #4 - Classes
Net Ninja
Object Oriented JavaScript Tutorial #5 - Class Constructors
Net Ninja
Object Oriented JavaScript Tutorial #6 - Class Methods
Net Ninja
Object Oriented JavaScript Tutorial #7 - Method Chaining
Net Ninja
Object Oriented JavaScript Tutorial #8 - Class Inheritance
Net Ninja
Object Oriented JavaScript Tutorial #9 - Constructors (under the hood)
Net Ninja
Object Oriented JavaScript Tutorial #10 - Prototype
Net Ninja
Object Oriented JavaScript Tutorial #11 - Prototype Inheritance
Net Ninja
More on: Agentic Coding
View skill →Related Reads
📰
📰
📰
📰
A Software Engineer’s Notes from a Generative AI Bootcamp
Medium · Machine Learning
I Copied OpenAI’s Exact Codex Setup — the One That Reviews 100% of Their PRs
Medium · Programming
Still in the Game: Why We Keep Coding Against the Machine
Dev.to AI
The AI Coding Agent Ecosystem in 2026: Every Major Tool, Framework, and Skill System Ranked
Dev.to AI
🎓
Tutor Explanation
DeepCamp AI