Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions extensions/approval-gates/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Changelog

All notable changes to the Approval Gates extension are documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.0] - 2026-04-05

### Added

- Initial release of Approval Gates extension
- `speckit.approval-gates.status` command to display approval gates configuration
- Support for per-phase approval requirements (specify, plan, tasks, implement, constitution)
- Configurable approval requirements:
- `enabled` — Toggle approval requirement for a phase
- `min_approvals` — Minimum number of approvals needed
- `requires` — List of roles who can approve
- `description` — Description of what the gate enforces
- `approval-gates-config.template.yml` template for team customization
- Hook integration: After `/speckit.tasks`, optional prompt to check approval gates
- Comprehensive documentation with configuration guide and examples
- Support for optional configuration (teams can use extension without configuring gates)
21 changes: 21 additions & 0 deletions extensions/approval-gates/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 GitHub, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
159 changes: 159 additions & 0 deletions extensions/approval-gates/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
# Approval Gates Extension

Extension to enforce approval requirements between spec-driven development phases.

## Installation

### 1. Install the Extension

```bash
specify extension add --dev extensions/approval-gates
```

### 2. Create Configuration

Copy the template to your project:

```bash
mkdir -p .specify/extensions/approval-gates
cp extensions/approval-gates/approval-gates-config.template.yml \
.specify/extensions/approval-gates/approval-gates-config.yml
```

### 3. Customize for Your Team

Edit `.specify/extensions/approval-gates/approval-gates-config.yml` and set:

- Which phases require approval
- How many approvals are needed
- Who can approve each phase
- Descriptions for each gate

## Configuration

### Schema

```yaml
specify:
enabled: bool # Enable/disable this gate
requires: [role1, role2, ...] # Who can approve
min_approvals: int # How many approvals required
description: string # (optional) What this gate enforces
```

### Example

```yaml
specify:
enabled: true
requires: [product_lead, architect]
min_approvals: 1
description: "Functional spec approval"

plan:
enabled: true
requires: [architect, tech_lead]
min_approvals: 2
description: "Technical plan approval"

tasks:
enabled: false
```

## Usage

### Check Approval Gates Status

```bash
> /speckit.approval-gates.status
```

Shows which phases are gated and their approval requirements:

```
✅ Approval gates enabled

📋 specify
• Status: ✅ ENFORCED
• Min approvals: 1
• Description: Functional spec approval

📋 plan
• Status: ✅ ENFORCED
• Min approvals: 2
• Description: Technical spec approval
```

### After Tasks Phase

The extension integrates with the workflow:

```bash
> /speckit.tasks
# ... task generation ...
# Prompt appears:
# ❓ Check approval gates for next phase?
> Y
```

## Phases

Approval gates can be configured for the following phases:

- `constitution` — Project setup and context
- `specify` — Functional specification
- `plan` — Technical specification and architecture
- `tasks` — Task breakdown and planning
- `implement` — Implementation phase (optional)

## Troubleshooting

### Command Not Found

```
❌ Command not found: speckit.approval-gates.status
```

**Solution**: Reinstall the extension:

```bash
specify extension remove approval-gates
specify extension add --dev extensions/approval-gates
```

### Config Not Loading

```
ℹ️ No approval gates configured
```

**Solution**: Ensure the config file exists:

```bash
ls .specify/extensions/approval-gates/approval-gates-config.yml
# If missing, create it from template
```

### YAML Parse Error

```
❌ Error parsing approval-gates-config.yml
```

**Solution**: Validate YAML syntax:

```bash
yq eval '.' .specify/extensions/approval-gates/approval-gates-config.yml
```

Check for:
- Proper indentation (2 spaces)
- Quotes around strings
- No trailing colons

## Related Commands

- `/speckit.constitution` — Project setup
- `/speckit.specify` — Create specification
- `/speckit.plan` — Create plan
- `/speckit.tasks` — Generate tasks
42 changes: 42 additions & 0 deletions extensions/approval-gates/approval-gates-config.template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Approval Gates Configuration
# Copy this file to .specify/extensions/approval-gates/approval-gates-config.yml
# Then customize for your team's approval workflow

# Define approval requirements for each phase
# Each phase can be enabled/disabled independently

specify:
enabled: true
requires: [product_lead, architect]
min_approvals: 1
description: "Functional specification approval"

plan:
enabled: true
requires: [architect, tech_lead]
min_approvals: 2
description: "Technical specification and architecture approval"

tasks:
enabled: true
requires: [tech_lead]
min_approvals: 1
description: "Task breakdown and planning approval"

implement:
enabled: false
requires: [tech_lead]
min_approvals: 1
description: "Implementation gate (optional)"

constitution:
enabled: false
requires: [owner]
min_approvals: 1
description: "Project constitution approval"

# Future: GitHub Actions integration for automated checks
github_actions:
enabled: false
# repository: "your-org/your-repo"
# branch: "main"
Loading