Skip to content

Commit fc8cfa2

Browse files
committed
feat(extensions): add approval-gates extension
Add Approval Gates extension to enforce approval requirements between spec-driven development phases. Features: - Command: /speckit.approval-gates.status - display gate configuration - Configuration: per-phase approval requirements (roles, min approvals) - Hook integration: after_tasks phase with optional prompt - Config template: approval-gates-config.template.yml for customization Extension includes: - extension.yml manifest with command and config definitions - commands/status.md with Markdown-based implementation - approval-gates-config.template.yml for project customization - README.md with installation and configuration guide - CHANGELOG.md with version history
1 parent 866b3f1 commit fc8cfa2

File tree

13 files changed

+449
-415
lines changed

13 files changed

+449
-415
lines changed

docs/approval-gates-guide.md

Lines changed: 0 additions & 152 deletions
This file was deleted.

docs/examples/approval-gates.yaml

Lines changed: 0 additions & 35 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Changelog
2+
3+
All notable changes to the Approval Gates extension are documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [1.0.0] - 2026-04-05
9+
10+
### Added
11+
12+
- Initial release of Approval Gates extension
13+
- `speckit.approval-gates.status` command to display approval gates configuration
14+
- Support for per-phase approval requirements (specify, plan, tasks, implement, constitution)
15+
- Configurable approval requirements:
16+
- `enabled` — Toggle approval requirement for a phase
17+
- `min_approvals` — Minimum number of approvals needed
18+
- `requires` — List of roles who can approve
19+
- `description` — Description of what the gate enforces
20+
- `approval-gates-config.template.yml` template for team customization
21+
- Hook integration: After `/speckit.tasks`, optional prompt to check approval gates
22+
- Comprehensive documentation with configuration guide and examples
23+
- Support for optional configuration (teams can use extension without configuring gates)

extensions/approval-gates/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 GitHub, Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
# Approval Gates Extension
2+
3+
Extension to enforce approval requirements between spec-driven development phases.
4+
5+
## Installation
6+
7+
### 1. Install the Extension
8+
9+
```bash
10+
specify extension add --dev extensions/approval-gates
11+
```
12+
13+
### 2. Create Configuration
14+
15+
Copy the template to your project:
16+
17+
```bash
18+
mkdir -p .specify/extensions/approval-gates
19+
cp extensions/approval-gates/approval-gates-config.template.yml \
20+
.specify/extensions/approval-gates/approval-gates-config.yml
21+
```
22+
23+
### 3. Customize for Your Team
24+
25+
Edit `.specify/extensions/approval-gates/approval-gates-config.yml` and set:
26+
27+
- Which phases require approval
28+
- How many approvals are needed
29+
- Who can approve each phase
30+
- Descriptions for each gate
31+
32+
## Configuration
33+
34+
### Schema
35+
36+
```yaml
37+
specify:
38+
enabled: bool # Enable/disable this gate
39+
requires: [role1, role2, ...] # Who can approve
40+
min_approvals: int # How many approvals required
41+
description: string # (optional) What this gate enforces
42+
```
43+
44+
### Example
45+
46+
```yaml
47+
specify:
48+
enabled: true
49+
requires: [product_lead, architect]
50+
min_approvals: 1
51+
description: "Functional spec approval"
52+
53+
plan:
54+
enabled: true
55+
requires: [architect, tech_lead]
56+
min_approvals: 2
57+
description: "Technical plan approval"
58+
59+
tasks:
60+
enabled: false
61+
```
62+
63+
## Usage
64+
65+
### Check Approval Gates Status
66+
67+
```bash
68+
> /speckit.approval-gates.status
69+
```
70+
71+
Shows which phases are gated and their approval requirements:
72+
73+
```
74+
✅ Approval gates enabled
75+
76+
📋 specify
77+
• Status: ✅ ENFORCED
78+
• Min approvals: 1
79+
• Description: Functional spec approval
80+
81+
📋 plan
82+
• Status: ✅ ENFORCED
83+
• Min approvals: 2
84+
• Description: Technical spec approval
85+
```
86+
87+
### After Tasks Phase
88+
89+
The extension integrates with the workflow:
90+
91+
```bash
92+
> /speckit.tasks
93+
# ... task generation ...
94+
# Prompt appears:
95+
# ❓ Check approval gates for next phase?
96+
> Y
97+
```
98+
99+
## Phases
100+
101+
Approval gates can be configured for the following phases:
102+
103+
- `constitution` — Project setup and context
104+
- `specify` — Functional specification
105+
- `plan` — Technical specification and architecture
106+
- `tasks` — Task breakdown and planning
107+
- `implement` — Implementation phase (optional)
108+
109+
## Troubleshooting
110+
111+
### Command Not Found
112+
113+
```
114+
❌ Command not found: speckit.approval-gates.status
115+
```
116+
117+
**Solution**: Reinstall the extension:
118+
119+
```bash
120+
specify extension remove approval-gates
121+
specify extension add --dev extensions/approval-gates
122+
```
123+
124+
### Config Not Loading
125+
126+
```
127+
ℹ️ No approval gates configured
128+
```
129+
130+
**Solution**: Ensure the config file exists:
131+
132+
```bash
133+
ls .specify/extensions/approval-gates/approval-gates-config.yml
134+
# If missing, create it from template
135+
```
136+
137+
### YAML Parse Error
138+
139+
```
140+
❌ Error parsing approval-gates-config.yml
141+
```
142+
143+
**Solution**: Validate YAML syntax:
144+
145+
```bash
146+
yq eval '.' .specify/extensions/approval-gates/approval-gates-config.yml
147+
```
148+
149+
Check for:
150+
- Proper indentation (2 spaces)
151+
- Quotes around strings
152+
- No trailing colons
153+
154+
## Related Commands
155+
156+
- `/speckit.constitution` — Project setup
157+
- `/speckit.specify` — Create specification
158+
- `/speckit.plan` — Create plan
159+
- `/speckit.tasks` — Generate tasks

0 commit comments

Comments
 (0)