Automating a lean, AI-augmented Specification β Planning β Validation workflow with GitHub Copilot & Spec Kit
This repository demonstrates a lean AI-native feature lifecycle powered by GitHub Actions + Copilot CLI. It couples:
- A minimized Azure DevOps (or similar) Feature state model: New β Specification β Planning β Validation β Ready
- Specification + clarification handled inside a single
Specificationstate (clarification questions become child Issues, not extra states) - Lightweight Planning + gated Plan Validation (boolean approval flag vs extra states)
- Optional generation workflows (spec initiation, spec refinement, code generation, Q&A)
The goal: Reduce process drag while safely injecting AI assistance without proliferating micro-states or βAI vs Humanβ ownership distinctions.
Full lifecycle details live in docs/workflow.md.
| Path | Status | Summary |
|---|---|---|
docs/workflow.md |
Active | Implementation guide: lean states (New β Specification β Planning β Validation β Ready), board model, clarification via Issues, optional rules, migration notes. |
docs/diagrams/ |
Updated | Core diagrams (02 data flow, 03 feature states, 10 clarification loop) now lean; remaining diagrams under routine review. |
Removed legacy GitHub App documentation files; focus now is only on the lean Spec + Plan + Validate flow. Core diagrams (02,03,10) reflect the current model; remaining diagrams are reviewed opportunistically.
- π§ Lean Feature Flow: Single specification loop (no Spec Draft / Clarify / Ready micro-states)
- ποΈ Description-as-Spec: Canonical spec text lives in the work item (no custom spec field required)
- π§© Clarification via Issues: Questions surfaced as child Issues; closing them drives spec completeness
- π§ͺ Planning & Validation: Plan enrichment + approval using a simple flag instead of extra states
- π€ Automated Code Generation: Trigger Copilot-powered code generation for features or adβhoc prompts
- π Pull Request Automation: Branch + PR creation with labels and structured content
- π§± Spec Kit Workflows: Initialize & (re)generate specs from repository prompts/components
- π Q&A & Research: Store AI answers in-version for traceability
- GitHub repository with Actions enabled
- GitHub Copilot subscription
- A PAT for workflows (code generation, Q&A, spec kit)
- Go to
SettingsβActionsβGeneral - Under Workflow permissions, select:
- β Read and write permissions
- β Allow GitHub Actions to create and approve pull requests
Feature branches are created automatically when a Feature work item in Azure DevOps is assigned to "AI Teammate" and moved to the "Specification β Doing" board column.
Trigger: Azure DevOps Service Hook β GitHub Actions Workflow
Integration Flow:
- Azure DevOps: Product Owner assigns Feature to "AI Teammate" and moves to "Specification β Doing"
- Service Hook: ADO sends webhook payload to GitHub repository dispatch endpoint
- GitHub Actions: Workflow
spec-kit-specify.ymlis triggered automatically - Workflow Execution:
- Step 1: GitHub Copilot generates short branch name from Feature description
- Step 2: Script
.specify/scripts/bash/create-new-feature.shcreates feature branch:- Scans
specs/directory for highest feature number (e.g., 001, 002) - Increments to get next number (e.g., 003)
- Combines with short name:
003-oauth2-api - Validates branch name length (β€244 bytes, GitHub limit)
- Runs
git checkout -b {branch-name}to create new branch - Creates directory structure:
specs/{branch-name}/ - Copies spec template:
.specify/templates/spec-template.mdβspecs/{branch-name}/spec.md - Sets environment variable:
SPECIFY_FEATURE={branch-name} - Returns JSON with branch name, spec file path, and feature number
- Scans
- Step 3-6: Copilot generates full specification using Spec Kit prompts
- Step 7: Commits specification to feature branch
- Step 8: Overwrites ADO Feature Description with generated spec (bidirectional sync)
See: specs/001-ado-github-spec/ for detailed integration specification and webhook contract
For testing or one-off spec generation without ADO integration:
Workflow: .github/workflows/spec-kit-specify.yml
Steps:
- Navigate to
ActionsβSpec Kit - Specify Feature - Click
Run workflow - Provide inputs:
- feature_description (required): "Add user authentication system"
- create_branch (optional):
true(default) - work_item_id (optional): Azure DevOps work item ID for Description sync
Pattern: {feature-number}-{feature-slug}
-
Feature Number: Auto-incremented 3-digit number (001, 002, 003, ...)
- Scans
specs/directory for highest existing number - Increments by 1 for new feature
- Scans
-
Feature Slug:
- Generated by Copilot from feature description (Step 1)
- 2-4 meaningful words in kebab-case
- Filters common stop words (a, the, to, for, of, etc.)
- Total branch name limited to 244 bytes (GitHub limit)
Examples:
"Add user authentication system"β001-user-authentication"Implement OAuth2 API integration"β002-oauth2-api-integration"Fix payment processing bug"β003-payment-processing-bug
What gets created:
- Git branch:
{number}-{slug} - Feature directory:
specs/{branch-name}/ - Spec file:
specs/{branch-name}/spec.md - Checklists:
specs/{branch-name}/checklists/(if generated) - Initial commit with feature specification
For advanced users or testing, you can run the script manually:
.specify/scripts/bash/create-new-feature.sh --short-name "oauth2-api" "Implement OAuth2 integration"Note: This only creates the branch scaffold; you'll need to generate the spec separately using Copilot.
High-level lifecycle (see docs/workflow.md for full detail):
- Create Feature (state: New β Specification)
- Run spec generation (stays in Specification β Doing; clarifications become Issues)
- Close clarification Issues β move to Specification β Done (still Specification)
- Enter Planning (state: Planning) β enrich plan
- Move to Validation (state: Validation) β approve (PlanApproved=true) β state transitions to Ready
- Decompose into Stories / Tasks; proceed with normal development and optional code generation support
For detailed setup and usage of specific integrations (e.g., Azure DevOps β GitHub spec generation), see:
specs/001-ado-github-spec/quickstart.md- ADO β GitHub integration guide
Current workflow files (see .github/workflows/):
| File | Purpose | Auth Mode |
|---|---|---|
spec-kit-specify.yml |
Generate / refine specification artifacts using Spec Kit | PAT |
For feature-specific integration guides (such as Azure DevOps β GitHub integration), see specs/[feature-id]/quickstart.md in each feature directory.
Archived / disabled former workflows are stored under
.github/workflows/archive/and suffixed with.disabled(e.g. previous feature, QA, query, init demos). Reactivate by moving them back and removing the suffix.
Primary (active) workflow: invokes Spec Kit to generate or refine specification artifacts using repository context. See its YAML for inputs.
- YAML / GitHub Actions lint: use
actionlintor@action-validator/cli - Mermaid diagrams: run
scripts/validate_diagrams.sh(internally usescheck_mermaid.js+ mermaid-cli) - Pre-commit (optional): add a hook calling both diagram + action lint steps
- See
docs/workflow.mdfor governance and optional edit control patterns
Validate all diagrams:
scripts/validate_diagrams.shOnly staged (changed) diagrams:
scripts/validate_diagrams.sh changedSample .git/hooks/pre-commit snippet (make executable):
#!/usr/bin/env bash
set -euo pipefail
scripts/validate_diagrams.sh changed
actionlint || { echo "actionlint failed" >&2; exit 1; }Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- GitHub Copilot - AI pair programmer
- GitHub Actions - CI/CD platform
- @github/copilot - Copilot CLI
- Ensure you've created a PAT with Copilot scope
- Add it as a secret named
COPILOT_TOKENin repository settings
- Check that "Allow GitHub Actions to create and approve pull requests" is enabled
- Verify workflow has
pull-requests: writepermission
Made with β€οΈ using a lean AI-native workflow (Copilot CLI + Spec Kit)