diff --git a/extensions/approval-gates/CHANGELOG.md b/extensions/approval-gates/CHANGELOG.md new file mode 100644 index 0000000000..b053215fe3 --- /dev/null +++ b/extensions/approval-gates/CHANGELOG.md @@ -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) diff --git a/extensions/approval-gates/LICENSE b/extensions/approval-gates/LICENSE new file mode 100644 index 0000000000..7d30d37a7e --- /dev/null +++ b/extensions/approval-gates/LICENSE @@ -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. diff --git a/extensions/approval-gates/README.md b/extensions/approval-gates/README.md new file mode 100644 index 0000000000..7033403ac3 --- /dev/null +++ b/extensions/approval-gates/README.md @@ -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 diff --git a/extensions/approval-gates/approval-gates-config.template.yml b/extensions/approval-gates/approval-gates-config.template.yml new file mode 100644 index 0000000000..874e524918 --- /dev/null +++ b/extensions/approval-gates/approval-gates-config.template.yml @@ -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" diff --git a/extensions/approval-gates/commands/status.md b/extensions/approval-gates/commands/status.md new file mode 100644 index 0000000000..5a1173f8e4 --- /dev/null +++ b/extensions/approval-gates/commands/status.md @@ -0,0 +1,164 @@ +--- +description: "Show approval gates configuration and enforcement status" +--- + +# Approval Gates Status + +Display the current approval gates configuration. + +## Steps + +### Step 1: Check if Approval Gates are Configured + +```bash +config_file=".specify/extensions/approval-gates/approval-gates-config.yml" + +if [ ! -f "$config_file" ]; then + echo "ℹ️ No approval gates configured" + echo "" + echo "To enable approval gates:" + echo " 1. Create .specify/extensions/approval-gates/ directory" + echo " 2. Copy the template: approval-gates-config.template.yml" + echo " 3. Customize for your team's workflow" + echo "" + echo "See: extensions/approval-gates/README.md for setup instructions" + exit 0 +fi +``` + +### Step 2: Display Approval Gates Status + +```bash +echo "✅ Approval gates enabled" +echo "" + +# Parse YAML and display each phase +phases=$(yq eval 'keys[]' "$config_file" 2>/dev/null || echo "") + +if [ -z "$phases" ]; then + echo "⚠️ No phases configured in approval-gates-config.yml" + exit 0 +fi + +for phase in $phases; do + enabled=$(yq eval ".${phase}.enabled" "$config_file" 2>/dev/null) + + if [ "$enabled" = "true" ]; then + min_approvals=$(yq eval ".${phase}.min_approvals // 1" "$config_file" 2>/dev/null) + requires=$(yq eval ".${phase}.requires // []" "$config_file" 2>/dev/null) + description=$(yq eval ".${phase}.description" "$config_file" 2>/dev/null) + + echo " 📋 $phase" + echo " • Status: ✅ ENFORCED" + echo " • Min approvals: $min_approvals" + + if [ -n "$description" ] && [ "$description" != "null" ]; then + echo " • Description: $description" + fi + + echo "" + else + echo " ⊘ $phase: disabled" + echo "" + fi +done +``` + +## Configuration + +This command reads from `.specify/extensions/approval-gates/approval-gates-config.yml`. + +### Example Configuration + +```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 spec approval" + +tasks: + enabled: true + requires: [tech_lead] + min_approvals: 1 + description: "Task breakdown approval" + +implement: + enabled: false +``` + +### Configuration Fields + +- **enabled** (boolean): Whether this phase requires approval + - `true`: Approval is required + - `false`: Phase can proceed without approval + +- **min_approvals** (number): Minimum approvals needed from the required roles + - Example: `1` (at least one person from `requires` must approve) + +- **requires** (array): List of roles who can approve + - Example: `[product_lead, architect, tech_lead]` + +- **description** (string, optional): What this gate enforces + - Example: "Technical spec approval" + +## Examples + +### Check Current Gates + +```bash +> /speckit.approval-gates.status +``` + +Output: +``` +✅ Approval gates enabled + + 📋 specify + • Status: ✅ ENFORCED + • Min approvals: 1 + • Description: Functional spec approval + + 📋 plan + • Status: ✅ ENFORCED + • Min approvals: 2 + • Description: Technical spec approval + + 📋 tasks + • Status: ✅ ENFORCED + • Min approvals: 1 + • Description: Task breakdown approval + + ⊘ implement: disabled +``` + +### No Configuration + +```bash +> /speckit.approval-gates.status +``` + +Output: +``` +ℹ️ No approval gates configured + +To enable approval gates: + 1. Create .specify/extensions/approval-gates/ directory + 2. Copy the template: approval-gates-config.template.yml + 3. Customize for your team's workflow + +See: extensions/approval-gates/README.md for setup instructions +``` + +## Related Commands + +- `/speckit.specify` — Create functional specification +- `/speckit.plan` — Create technical specification and task breakdown +- `/speckit.tasks` — Generate implementation tasks + diff --git a/extensions/approval-gates/extension.yml b/extensions/approval-gates/extension.yml new file mode 100644 index 0000000000..4692150aac --- /dev/null +++ b/extensions/approval-gates/extension.yml @@ -0,0 +1,52 @@ +schema_version: "1.0" + +extension: + id: "approval-gates" + name: "Approval Gates" + version: "1.0.0" + description: "Enforce approval requirements between spec-driven development phases" + author: "Spec Kit Team" + repository: "https://github.com/github/spec-kit/tree/main/extensions/approval-gates" + license: "MIT" + homepage: "https://github.com/github/spec-kit/tree/main/extensions/approval-gates" + +requires: + speckit_version: ">=0.1.0" + +provides: + commands: + - name: "speckit.approval-gates.status" + file: "commands/status.md" + description: "Show approval gates configuration and enforcement status" + aliases: ["speckit.approval-gates.check"] + + config: + - name: "approval-gates-config.yml" + template: "approval-gates-config.template.yml" + description: "Approval gates configuration for this project" + required: false + +hooks: + after_tasks: + command: "speckit.approval-gates.status" + optional: true + prompt: "Check approval gates for next phase?" + description: "Show approval requirements after task breakdown" + +tags: + - "workflow" + - "governance" + - "approval" + - "quality-gates" + +defaults: + specify: + enabled: false + plan: + enabled: false + tasks: + enabled: false + implement: + enabled: false + constitution: + enabled: false