---
name: SDD Environment Preflight
description: Spec-Driven Development (SDD) environment preflight and configuration guide | Spec-Driven Development Environment Preflight
---

# SDD Environment Preflight Skill

## Overview

This skill detects and configures the runtime environment required for SDD development, ensuring that speckit workflows can execute correctly.

## When to Invoke

This skill should be invoked in the following situations:

1. The user runs `/speckit.specify`, `/speckit.plan`, `/speckit.implement`, or other speckit workflows for the first time
2. A `pwsh not found` error is encountered when executing PowerShell scripts
3. The user explicitly requests an SDD environment check

## Preflight Steps

### 1. PowerShell Core Detection

Check whether `pwsh` is installed:

```bash
# Detect PowerShell Core
which pwsh || command -v pwsh
```

- **If successful**: Output version via `pwsh --version` and continue subsequent checks
- **If failed**: Provide installation instructions (see below)

### 2. Git Configuration Check

```bash
git config user.name && git config user.email
```

### 3. .specify Directory Integrity

Check whether required files exist:

```bash
test -d .specify/scripts/powershell && \
test -f .specify/scripts/powershell/create-new-feature.ps1 && \
test -f .specify/scripts/powershell/common.ps1 && \
test -d .specify/templates
```

## PowerShell Core Installation Guide

### macOS (Homebrew)

```bash
# Recommended method
brew install powershell

# Verify installation
pwsh --version
```

### macOS (Official PKG)

Download the `.pkg` installer from the [Microsoft official release page](https://github.com/PowerShell/PowerShell/releases).

### Linux (Ubuntu/Debian)

```bash
# Add Microsoft repository
sudo apt-get update
sudo apt-get install -y wget apt-transport-https software-properties-common
wget -q "https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb"
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb

# Install PowerShell
sudo apt-get update
sudo apt-get install -y powershell
```

### Linux (Other Distributions)

Refer to the [Microsoft official documentation](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-linux)

## Preflight Result Output Format

```text
=== SDD Environment Preflight Report ===

[✓] PowerShell Core: 7.4.x
[✓] Git: Configured (user@example.com)
[✓] .specify directory: Structure intact

Status: READY - speckit workflows can be executed
```

Or:

```text
=== SDD Environment Preflight Report ===

[✗] PowerShell Core: Not installed
    Install command: brew install powershell
[✓] Git: Configured
[✓] .specify directory: Structure intact

Status: BLOCKED - Please install PowerShell Core first
```

## Related Resources

- [troubleshooting.md](resources/troubleshooting.md) - Common issue resolution
