# Build Flappy Ghost with GitHub Spec-Kit, GitHub Copilot and TDD (short version)

## 1\. The Use Case: Building Flappy Ghost

Let's build a simple browser-based arcade game called **Flappy Ghost**.

The concept is inspired by Flappy Bird. Instead of a bird, the player controls a little ghost (👻) that must navigate through obstacles without colliding with them.

The game will have the following features:

- A ghost character that moves upward when the player presses Space or clicks the mouse.
- Gravity that continuously pulls the ghost downward.
- Green pipe obstacles with a gap between them.
- Pipes that move from right to left.
- Collision detection between the ghost and pipes.
- A scoring mechanism that awards points when the ghost passes through pipes.
- Game-over and restart functionality.

The visual design will use a light blue background, green pipes, a dark floor strip and a score display.

We will deliberately keep the game simple. The objective is not to build a production-quality arcade game but to demonstrate Specification-Driven Development (SDD) using GitHub Spec Kit and GitHub Copilot.

We will also incorporate Test-Driven Development (TDD), demonstrating how to write a failing test before implementing the corresponding functionality.

## 2\. What Is Specification-Driven Development (SDD)?

When developers use AI coding assistants, the typical workflow often looks like this:

Describe the application → Generate code → Fix errors → Test → Ship.

This approach can work for small applications, but it has limitations. Requirements are often undocumented, implementation decisions are implicit, and there is no clear traceability between what was requested and what was delivered.

*Specification-Driven Development* changes this workflow.

Instead of starting with code, we begin with a specification that describes the expected application behavior.

The specification becomes the reference point for planning, implementation and validation.

The typical SDD workflow is:

1. **Specify:** Describe what needs to be built and why.
2. **Clarify:** Identify ambiguities and resolve missing requirements.
3. **Plan:** Define the architecture, technology stack and implementation approach.
4. **Tasks:** Break the implementation into dependency-ordered tasks.
5. **Implement:** Execute the tasks using an AI coding assistant.
6. **Validate:** Verify that the implementation satisfies the original specification.

The artifacts generated during this process provide traceability between requirements and implementation.

A developer remains responsible for reviewing and approving the artifacts at every stage.

## 3\. What Is GitHub Spec Kit?

[GitHub Spec Kit](https://github.com/github/spec-kit) is an open-source toolkit for implementing Specification-Driven Development.

It provides a CLI called `specify` that initializes a project with the required templates, scripts, configuration and AI coding-agent integration.

When initialized with GitHub Copilot, Spec Kit provides slash commands that can be invoked directly from GitHub Copilot Chat.

Some important commands are:

| Command | Purpose |
| --- | --- |
| `/speckit-constitution` | Establish project principles |
| `/speckit-specify` | Generate the specification |
| `/speckit-clarify` | Identify and resolve ambiguities |
| `/speckit-plan` | Generate the implementation plan |
| `/speckit-checklist` | Review specification quality |
| `/speckit-tasks` | Generate implementation tasks |
| `/speckit-analyze` | Analyze consistency across artifacts |
| `/speckit-implement` | Execute implementation tasks |
| `/speckit-converge` | Validate implementation against artifacts |

These are GitHub Copilot agent commands, not commands executed in the operating-system terminal.

For this tutorial, we will use GitHub Copilot in Agent mode inside Visual Studio Code.

## 4\. Technology Stack

We will use a deliberately simple technology stack. The objective is to focus on SDD and TDD rather than learning a frontend framework.

| Component | Technology |
| --- | --- |
| AI coding assistant | GitHub Copilot |
| Specification framework | GitHub Spec Kit |
| IDE | Visual Studio Code |
| Programming language | JavaScript |
| Graphics | HTML5 Canvas |
| Styling | HTML and CSS |
| Testing | Node.js built-in test runner |
| Package management | uv |
| Version control | Git |
| Local web server | Python |

The game logic will be separated from the rendering code. This is important because we want to test the game mechanics independently of the browser.

We will use JavaScript ES modules with `.mjs` extensions and Node.js's built-in test runner.

No Jest, Mocha, React, Angular, game engine or external runtime libraries are required.

## 5\. Prerequisites

Before starting, ensure that the following tools are available.

| Requirement | Purpose |
| --- | --- |
| macOS or Windows 10/11 | Development environment |
| Python 3.11 or later | Required by Spec Kit |
| uv | Python package and tool manager |
| Git | Version control |
| Node.js 20 or later | JavaScript runtime and automated testing |
| Visual Studio Code | Development environment |
| GitHub Copilot | AI coding assistant |
| Modern browser | Running the game |

You should also have:

- A GitHub account with Copilot access.
- GitHub Copilot and Copilot Chat extensions enabled in VS Code.
- An internet connection to install the required tools and initialize Spec Kit.

### Verify existing installations

**macOS Terminal**

```bash
python3 --version
git --version
node --version
npm --version
brew --version
```

**Windows PowerShell**

```powershell
py --version
git --version
node --version
npm --version
winget --version
```

## 6\. Install Spec Kit and Initialize the Project

We will create a workspace named `workshop2` and initialize a new project named `flappy-ghost` inside it.

There are two approaches for installing and running Spec Kit:

- Persistent installation using `uv tool install`.
- One-time execution using `uvx`.

For this tutorial, we will use persistent installation because it makes the `specify` command available for subsequent operations.

### 6.1 macOS Setup

Open Terminal.

**Step 1: Create the workspace**

```bash
pwd
mkdir workshop2
cd workshop2
```

**Step 2: Install uv**

Using Homebrew:

```bash
brew install uv
```

Verify:

```bash
uv --version
```

**Step 3: Install Python, Git and Node.js**

```bash
brew install python git node
```

Verify:

```bash
python3 --version
git --version
node --version
npm --version
```

Make sure Python is version 3.11 or later.

**Step 4: Install the Spec Kit CLI**

```bash
uvx --from git+https://github.com/github/spec-kit.git specify init flappy-ghost --integration copilot
```

Verify:

```bash
specify version
```

Navigate to the project:

```bash
cd flappy-ghost
```

Initialize Git:

```bash
git init
```

Open the project in Visual Studio Code:

```bash
code .
```

### 6.2 Windows Setup

The same workflow can be executed using Windows PowerShell. WSL is not required.

**Step 1: Create the workspace**

```powershell
pwd
New-Item -ItemType Directory -Force workshop2
cd workshop2
```

**Step 2: Install uv**

Using Windows Package Manager:

```powershell
winget install --id=astral-sh.uv -e
```

Alternatively, use the official PowerShell installer:

```powershell
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
```

Open a new PowerShell window after installation.

Verify:

```powershell
uv --version
```

**Step 3: Install Python, Git and Node.js**

```powershell
winget install --id=Python.Python.3.12 -e
winget install --id=Git.Git -e
winget install --id=OpenJS.NodeJS.LTS -e
```

Restart PowerShell and verify:

```powershell
py --version
git --version
node --version
npm --version
```

Make sure Python is version 3.11 or later.

**Step 4: Install Spec Kit**

```powershell
uv tool install specify-cli --from git+https://github.com/github/spec-kit.git
```

Verify:

```powershell
specify version
```

**Step 5: Initialize the project**

```powershell
specify init flappy-ghost --integration copilot
cd flappy-ghost
git init
code .
```

If `code` is not recognized, enable the VS Code command-line launcher or use File → Open Folder in VS Code.

### Alternative: Run Spec Kit using uvx

If you do not want to install Spec Kit persistently, you can use `uvx`.

```bash
uvx --from git+https://github.com/github/spec-kit.git specify init flappy-ghost --integration copilot
```

The same command works in PowerShell.

Important: `uvx` is a one-time runner. It does not install a persistent `specify` command on your PATH. Therefore, do not run `uvx` alone and then expect to execute `specify init` separately.

For this exercise, I recommend the persistent installation approach.

## 7\. Explore the Spec Kit Project Structure

After initialization, open the project in VS Code.

Explore the generated files and folders.

You should see the Spec Kit configuration and integration files, including the `.specify` and `.github` directories.

The exact generated structure can vary by release and integration configuration.

Open GitHub Copilot Chat.

Switch to **Agent mode**.

Start typing `/speckit-` in the prompt box.

You should see the available Spec Kit commands.

Remember that these commands must be executed individually in Copilot Chat, not in the Terminal.

## 8\. Step 1 – Establish Project Principles

Before describing the application, let's establish the engineering principles that must be followed throughout the project.

In GitHub Copilot Chat, execute:

```text
/speckit-constitution

Create the project constitution for Flappy Ghost.

The project must follow these engineering principles:

1. Test-Driven Development:
   - Demonstrate the Red-Green-Refactor cycle.
   - Never modify or weaken a test simply to make it pass.
   - Implement only the minimum code required for the demonstrated test.

2. Separate game logic from rendering and browser interaction.

3. Use modular, readable and maintainable JavaScript.

4. Keep game logic independently testable.

5. Use Node.js built-in testing capabilities.

6. Avoid unnecessary third-party dependencies.

7. Every feature must be traceable to a requirement
   and an acceptance criterion.

8. Do not implement functionality outside the approved MVP specification.

Document these principles in the project constitution.
```

GitHub Copilot will generate or update the constitution.

Review the document before moving to the next step.

The constitution establishes the rules that should guide subsequent planning and implementation.

## 9\. Step 2 – Specify the Flappy Ghost Game

Now we describe the application.

The specification should focus on what the application must do and why. Avoid prescribing the technology stack at this stage.

Execute the following in Copilot Chat:

```text
/speckit-specify

Build a browser-based arcade game called "Flappy Ghost".

The player controls a small ghost character that must fly
through gaps between green pipes without colliding with them.

Game requirements:

1. Player Character
   - Represent the player using a ghost emoji (👻).
   - Position the ghost towards the left side of the screen.
   - Gravity continuously pulls the ghost downward.
   - Pressing Space or clicking the mouse makes the ghost flap upward.

2. Obstacles
   - Display one pair of green pipes with a gap between them.
   - Pipes move from right to left.
   - Reposition the pipes when they leave the screen.

3. Collision Detection
   - Detect collision between the ghost and pipes.
   - Detect collision with the ceiling and floor.
   - Any collision ends the game.

4. Scoring
   - Award one point when the ghost successfully passes a pipe pair.
   - A pipe pair must award points only once.
   - Display the current score.

5. Game States
   - Initial ready-to-play screen.
   - Active gameplay.
   - Game-over screen.
   - Restart functionality.
   - Restarting resets the current score.

6. Visual Design
   - Light blue background.
   - Simple green rectangular pipes.
   - Dark floor strip.
   - Score display.
   - Clean and minimal interface.

7. User Experience
   - Support keyboard and mouse controls.
   - Display instructions to press Space or click to start.
   - Allow restarting after Game Over.

Acceptance criteria:

Write user stories and Given/When/Then scenarios.

Cover:
- Starting the game.
- Gravity and flap behavior.
- Pipe movement.
- Collision detection.
- Score calculation.
- Game-over behavior.
- Restart behavior.

Include functional and non-functional requirements.

Do not generate implementation code.
Do not decide the technical architecture yet.
Do not introduce features outside this MVP scope.
```

Copilot should generate a specification containing user stories, functional requirements and acceptance scenarios.

For example:

```text
Feature: Ghost flight mechanics

Scenario: Ghost flaps upward

Given the game is active
And the ghost is affected by gravity
When the player presses the Space key
Then the ghost should receive an upward velocity
And the ghost should move upward
```

Review the generated specification.

Make sure the requirements accurately describe the expected gameplay.

## 10\. Step 3 – Clarify Requirements

Before designing the implementation, we should identify missing or ambiguous requirements.

Execute:

```text
/speckit-clarify

Review the Flappy Ghost specification.

Clarify the following:

1. What happens when Space is pressed before the game starts?
2. How should gravity and flap movement behave?
3. When should a pipe pair award a point?
4. What constitutes a collision?
5. What happens when Space is pressed on the Game Over screen?
6. How should the game be restarted?

Identify gaps and ask targeted questions.

Do not introduce additional features.

Update the specification after receiving my answers.
```

Participants should answer the questions raised by Copilot and review the updated specification.

Some suggested decisions:

| Area | Expected behavior |
| --- | --- |
| Space before start | Starts the game and flaps |
| Repeated flaps | Each valid key press triggers a flap |
| Gravity | Continuously pulls the ghost down |
| Pipe collision | Any overlap causes Game Over |
| Ceiling/floor | Collision causes Game Over |
| Scoring | One point per successfully passed pipe pair |
| Restart | Resets the current score |

## 11\. Step 4 – Generate the Technical Implementation Plan

Now that the requirements are clear, we can introduce the technology stack and architecture.

```text
/speckit-plan

Create the technical implementation plan for Flappy Ghost.

Technology requirements:

- Vanilla JavaScript using ES modules.
- HTML5 Canvas for game rendering.
- HTML and CSS for the game page.
- Node.js built-in test runner (node:test).
- Use .mjs file extensions for JavaScript modules.
- No frontend frameworks.
- No third-party game engine.
- No third-party testing frameworks.
- No external runtime dependencies.
- No build tools or bundlers.

Architecture requirements:

1. index.html
   Main browser page containing the canvas and game UI.

2. styles.css
   Basic game styling.

3. src/game-logic.mjs
   Pure game logic including:
   - Initial game state.
   - Ghost movement.
   - Gravity.
   - Flap mechanics.
   - Pipe movement.
   - Collision detection.
   - Scoring.
   - Restart behavior.

4. src/main.mjs
   Application entry point:
   - Canvas rendering.
   - Keyboard and mouse events.
   - Game loop using requestAnimationFrame.
   - Connecting rendering and game logic.

5. tests/game-logic.test.mjs
   Automated test for ghost flap behavior.

Keep game logic separate from rendering.

The application must support:

node --test

Generate a technical plan covering:
- Component responsibilities.
- Game state management.
- Physics calculations.
- Collision detection.
- Rendering and input.
- Testing strategy.
- File structure.

Do not implement the application yet.
```

The architecture should allow game mechanics to be tested independently of the browser.

For example, gravity, collision detection and scoring should not depend on Canvas or DOM APIs.

Review `plan.md`.

## 12\. Step 5 – Generate the Requirements Checklist

Now let's validate the completeness and quality of the specification.

```text
/speckit-checklist

Create a quality checklist for the Flappy Ghost specification.

Focus on:

- Completeness of gameplay requirements.
- Physics and collision behavior.
- Scoring rules.
- Game states and restart behavior.
- Testability of functional requirements.
- Clear Given/When/Then acceptance criteria.
- Ambiguous or contradictory requirements.

Keep the checklist concise and focused on the MVP.
```

Review the generated checklist.

Remember that this is a requirements-quality checklist, not the automated test suite.

## 13\. Step 6 – Generate Implementation Tasks

This is an important step because we want to demonstrate how Spec Kit breaks down the implementation into dependency-ordered tasks.

```text
/speckit-tasks

Generate a concise, dependency-ordered tasks.md
for the Flappy Ghost MVP.

Organize the work into these phases:

Phase 1: Project setup
- Create HTML, CSS and JavaScript files.
- Initialize Canvas.
- Set up Node.js testing.

Phase 2: TDD demonstration
- Write exactly one automated test for ghost flap.
- Run the test and observe the failure.
- Implement the minimum code to pass the test.
- Run the test again and confirm it passes.

Phase 3: Remaining game implementation
- Implement gravity and ghost movement.
- Implement moving pipes.
- Implement collision detection.
- Implement scoring and game states.
- Implement Canvas rendering and controls.

Phase 4: Validation
- Run automated tests.
- Run the game in a browser.
- Verify the main gameplay scenarios.

Important instructions:

- Demonstrate a complete TDD cycle only for ghost flap.
- Group all remaining game implementation into one
  consolidated task.
- Do not generate separate test-writing and implementation
  tasks for every individual game feature.
- Do not include clouds, high-score persistence,
  advanced animation or visual refinements.

Use the project constitution, specification and plan
as the source of truth.

Create or update tasks.md.
```

Review `tasks.md`.

The objective is to have a concise task list rather than dozens of small implementation tasks.

## 14\. Step 7 – Analyze Specifications, Plans and Tasks

Before implementation, analyze the generated artifacts for inconsistencies.

```text
/speckit-analyze

Analyze the completed project artifacts.

Check:

1. Every user story has corresponding implementation tasks.
2. Every business rule has acceptance criteria.
3. The implementation plan follows the project constitution.
4. The architecture supports independent unit testing.
5. No requirements are missing or contradictory.
6. All tasks are within the approved MVP scope.

Identify conflicts, gaps and ambiguities.

Do not implement anything.

Provide a prioritized list of findings.
```

This is a quality gate.

Resolve important issues in the source artifacts and rerun the analysis before implementation.

## 15\. Step 8 – TDD Demonstration: Create a Deliberately Failing Test

Now comes the most important part of the exercise.

We will demonstrate the Red-Green-Refactor cycle using the ghost's flap mechanism.

The requirement is simple:

When the player presses Space or clicks the mouse, the ghost should receive an upward velocity.

Rather than asking Copilot to implement this functionality, we will first ask it to write an automated test.

### 15.1 Write the test first

In GitHub Copilot Chat:

```text
/speckit-implement

Implement ONLY the test-writing task for the first TDD slice:
Ghost flap mechanics.

Create tests/game-logic.test.mjs.

Use:
- node:test
- node:assert/strict

Write exactly one test for the following requirement:

Given a ghost with vertical velocity of zero,
when the flap action is triggered,
then the ghost must receive a negative vertical velocity
indicating upward movement.

Also verify that the original game state is not mutated.

Import the flap function from:
../src/game-logic.mjs

Important:
- Write exactly one test.
- Write tests only.
- Do not implement the flap function.
- Do not create additional tests.
- Do not weaken the assertions.
- Stop after creating the test.
```

The test should be equivalent to:

```javascript
import test from 'node:test';
import assert from 'node:assert/strict';

import { flap } from '../src/game-logic.mjs';

test('flap applies upward velocity to the ghost', () => {
    const state = {
        ghost: {
            y: 100,
            velocityY: 0
        }
    };

    const nextState = flap(state);

    assert.ok(nextState.ghost.velocityY < 0);

    // Original state must not be mutated.
    assert.equal(state.ghost.velocityY, 0);
});
```

### 15.2 Run the test

Open the VS Code integrated terminal.

```bash
node --test tests/game-logic.test.mjs
```

The test will initially fail because the production module or exported function does not exist.

This is expected. However, this first failure is a module-loading failure, so we will create a placeholder to demonstrate a meaningful assertion failure.

### 15.3 Create a non-functional implementation stub

```text
Create src/game-logic.mjs.

Export a function named flap(state).

For now, return the original state unchanged.

Do not implement any game mechanics.
Do not modify the existing test file.
```

The generated code should look like:

```javascript
export function flap(state) {
    return state;
}
```

### 15.4 Run the test again

```bash
node --test tests/game-logic.test.mjs
```

This time, the module loads successfully, but the test fails because the ghost's vertical velocity remains zero.

Expected outcome: **RED**

```text
✗ flap applies upward velocity to the ghost
```

The assertion fails because:

```javascript
nextState.ghost.velocityY < 0
```

evaluates to false.

This is our deliberately failing test.

### 15.5 Implement the minimum code to make the test pass

Now ask Copilot:

```text
The flap test is failing.

Implement the minimum code necessary to make this test pass.

Requirements:

1. Do not modify the test.
2. Do not remove or weaken assertions.
3. The flap action must apply a negative vertical velocity.
4. Return a new game state without mutating the original.
5. Do not implement gravity, collision detection,
   rendering or any other feature yet.

Only implement what is necessary to make the current test pass.
```

A minimal implementation would look like:

```javascript
const FLAP_VELOCITY = -360;

export function flap(state) {
    return {
        ...state,
        ghost: {
            ...state.ghost,
            velocityY: FLAP_VELOCITY
        }
    };
}
```

### 15.6 Run the test again

```bash
node --test tests/game-logic.test.mjs
```

Expected outcome: **GREEN**

```text
✔ flap applies upward velocity to the ghost

tests 1
pass 1
fail 0
```

### 15.7 Refactor

Now ask Copilot to review the implementation.

```text
Review the flap implementation.

Refactor for readability and maintainability.

Do not change the existing test.
Do not change the expected behavior.

Run the test again and confirm that it still passes.
```

Expected outcome: **REFACTOR**

The implementation is improved without changing its behavior or weakening the test.

This completes our first TDD cycle.

The important learning is that Copilot is not the authority that decides whether its code is correct. Automated tests provide evidence that the implementation satisfies the expected behavior.

## 16\. Step 9 – Implement the Remaining Game Features

We have now demonstrated the complete Red-Green-Refactor cycle using one deliberately failing test.

For the remaining implementation, we will use a consolidated prompt instead of repeating the TDD cycle for every individual feature.

In GitHub Copilot Chat, execute:

```text
/speckit-implement

Read the project constitution, spec.md, plan.md
and tasks.md.

Complete the remaining Flappy Ghost MVP implementation
in one consolidated implementation pass.

Implement:

1. Ghost movement with gravity.
2. Flap functionality using Space and mouse click.
3. One pair of green pipes moving from right to left.
4. Reposition the pipes when they leave the screen.
5. Collision detection with pipes, ceiling and floor.
6. Score increment when the ghost passes the pipes.
7. Ready, Playing and Game Over states.
8. Restart functionality.
9. Basic HTML5 Canvas rendering.
10. Score display and basic game instructions.

Implementation guidelines:

- Keep the implementation simple.
- Use the existing game-logic.mjs and main.mjs structure.
- Separate game logic from rendering.
- Do not introduce third-party dependencies.
- Do not add cloud obstacles.
- Do not add high-score persistence.
- Do not add complex animations or unnecessary abstractions.
- Do not modify, remove or weaken the existing flap test.
- Do not create additional automated tests for this
  time-boxed demonstration.
- Run the existing automated tests after implementation.
- Update tasks.md to reflect actual completion.
- Do not stop after each individual task.
- Do not implement features outside the MVP specification.

Implement the complete playable MVP.
```

Copilot Agent will now work through the remaining tasks and create the required application files.

The objective is to demonstrate how Copilot can execute specification-driven tasks rather than manually prompting it for every individual feature.

**Important:** This consolidated implementation is a workshop shortcut, not a recommendation to skip tests in real-world development.

## 17\. Step 10 – Run the Game Locally

We can use Python's built-in HTTP server to serve the application locally.

No additional server framework is needed.

Navigate to the project root.

**macOS:**

```bash
python3 -m http.server 8000
```

**Windows:**

```powershell
py -m http.server 8000
```

Open another terminal window.

**macOS:**

```bash
open http://localhost:8000
```

**Windows PowerShell:**

```powershell
Start-Process http://localhost:8000
```

The Flappy Ghost game should now be available in the browser.

### Manual testing checklist

| Action | Expected result |
| --- | --- |
| Open game | Start screen appears |
| Press Space | Ghost moves upward |
| Release Space | Gravity pulls ghost down |
| Click mouse | Ghost flaps |
| Hit a pipe | Game Over |
| Hit the ceiling | Game Over |
| Hit the floor | Game Over |
| Pass a pipe pair | Score increases |
| Restart | Current score resets |

Run the automated test:

```bash
node --test
```

Stop the Python web server using `Ctrl+C`.

## 18\. Step 11 – Validate Implementation Against the Specification

The final step is to verify that the implementation actually satisfies the original requirements.

Start by running:

```text
/speckit-analyze

Analyze the completed implementation against:

- Project constitution.
- spec.md.
- plan.md.
- tasks.md.

Identify:

- Missing functionality.
- Requirements that are not implemented.
- Tasks that remain incomplete.
- Differences between acceptance criteria and actual behavior.
- Architectural issues.
- Test coverage gaps.

Do not modify existing tests to hide failures.

Provide a prioritized list of findings.
```

Now execute:

```text
/speckit-converge

Compare the actual implementation against the specification,
implementation plan and task list.

Identify missing features and incomplete requirements.

Append remaining work to tasks.md where necessary.

Do not mark incomplete tasks as complete.
Do not modify tests to conceal missing functionality.
```

If additional work is identified, use:

```text
/speckit-implement

Implement the remaining tasks identified during convergence.

Follow the project constitution.

Preserve the existing automated test.

Run the automated test suite after implementation.
```

Repeat the analysis and convergence process until the implementation satisfies the MVP specification.

## 19\. Step 12 – Commit the Completed Project

Once the game works and validation is complete:

```bash
git status
git add .
git commit -m "Build Flappy Ghost using Spec-Kit and GitHub Copilot"
```

The final project structure should look approximately like this:

```text
flappy-ghost/
│
├── .github/
│   └── ... Copilot integration files
│
├── .specify/
│   └── ... Spec Kit configuration and templates
│
├── specs/
│   └── ... Feature specification
│
├── src/
│   ├── game-logic.mjs
│   └── main.mjs
│
├── tests/
│   └── game-logic.test.mjs
│
├── index.html
├── styles.css
└── README.md
```

The exact directories and generated Spec Kit files can vary by release.

## 20\. Complete Command Reference

### macOS

```bash
# Create workspace
pwd
mkdir workshop2
cd workshop2

# Install development tools
brew install uv
brew install python git node

# Verify installations
uv --version
python3 --version
git --version
node --version

# Install Spec Kit
uv tool install specify-cli --from git+https://github.com/github/spec-kit.git

# Verify
specify version

# Initialize project
specify init flappy-ghost --integration copilot

# Navigate and open
cd flappy-ghost
git init
code .

# Run tests
node --test

# Run browser server
python3 -m http.server 8000

# Open game
open http://localhost:8000
```

### Windows PowerShell

```powershell
# Create workspace
pwd
New-Item -ItemType Directory -Force workshop2
cd workshop2

# Install development tools
winget install --id=astral-sh.uv -e
winget install --id=Python.Python.3.12 -e
winget install --id=Git.Git -e
winget install --id=OpenJS.NodeJS.LTS -e

# Restart PowerShell before continuing

# Verify installations
uv --version
py --version
git --version
node --version

# Install Spec Kit
uv tool install specify-cli --from git+https://github.com/github/spec-kit.git

# Verify
specify version

# Initialize project
specify init flappy-ghost --integration copilot

# Navigate and open
cd flappy-ghost
git init
code .

# Run tests
node --test

# Run browser server
py -m http.server 8000

# Open game
Start-Process http://localhost:8000
```

### GitHub Copilot Commands

Execute these commands individually in GitHub Copilot Chat, Agent mode:

```text
/speckit-constitution
/speckit-specify
/speckit-clarify
/speckit-plan
/speckit-checklist
/speckit-tasks
/speckit-analyze
/speckit-implement
/speckit-converge
```

## 21\. Key Takeaways

By completing this exercise, participants will understand:

1. How to convert an idea into a structured specification.
2. How to use GitHub Spec Kit with GitHub Copilot.
3. The difference between requirements, technical planning and implementation.
4. How to generate dependency-ordered implementation tasks.
5. How to use Test-Driven Development with the Red-Green-Refactor cycle.
6. How to use GitHub Copilot Agent mode to implement an application.
7. How to validate implementation against the original specification.

The important takeaway remains unchanged:

**AI-assisted development is not just about generating code.**

Spec Kit provides a structured workflow that connects requirements, planning, implementation and validation.

By defining what needs to be built before asking an AI coding assistant to implement it, we can make AI-assisted software development more predictable, structured and maintainable.

## References

- [GitHub Spec Kit – Repository](https://github.com/github/spec-kit)
- [GitHub Copilot Documentation](https://docs.github.com/en/copilot)
- [Visual Studio Code – GitHub Copilot](https://code.visualstudio.com/docs/copilot/overview)
- [Node.js – Test Runner](https://nodejs.org/api/test.html)
- [MDN – Canvas API](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API)
- [uv – Documentation](https://docs.astral.sh/uv/)
