Create GitHub Actions Workflow Specification
Create a comprehensive specification for the GitHub Actions workflow: ${input:WorkflowFile}.
This specification serves as a specification for the workflow's behavior, requirements, and constraints. It must be implementation-agnostic, focusing on what the workflow accomplishes rather than how it's implemented.
AI-Optimized Requirements
- Token Efficiency: Use concise language without sacrificing clarity
- Structured Data: Leverage tables, lists, and diagrams for dense information
- Semantic Clarity: Use precise terminology consistently throughout
- Implementation Abstraction: Avoid specific syntax, commands, or tool versions
- Maintainability: Design for easy updates as workflow evolves
Specification Template
Save as: /spec/spec-process-cicd-[workflow-name].md
Jobs & Dependencies
| Job Name | Purpose | Dependencies | Execution Context |
|---|
| job-1 | [Purpose] | [Prerequisites] | [Runner/Environment] |
| job-2 | [Purpose] | job-1 | [Runner/Environment] |
Requirements Matrix
Functional Requirements
| ID | Requirement | Priority | Acceptance Criteria |
|---|
| REQ-001 | [Requirement] | High | [Testable criteria] |
| REQ-002 | [Requirement] | Medium | [Testable criteria] |
Security Requirements
| ID | Requirement | Implementation Constraint |
|---|
| SEC-001 | [Security requirement] | [Constraint description] |
Performance Requirements
| ID | Metric | Target | Measurement Method |
|---|
| PERF-001 | [Metric] | [Target value] | [How measured] |
Input/Output Contracts
Inputs
Outputs
Secrets & Variables
| Type | Name | Purpose | Scope |
|---|
| Secret | SECRET_1 | [Purpose] | Workflow |
| Variable | VAR_1 | [Purpose] | Repository |
Execution Constraints
Runtime Constraints
- Timeout: [Maximum execution time]
- Concurrency: [Parallel execution limits]
- Resource Limits: [Memory/CPU constraints]
Environmental Constraints
- Runner Requirements: [OS/hardware needs]
- Network Access: [External connectivity needs]
- Permissions: [Required access levels]
Error Handling Strategy
| Error Type | Response | Recovery Action |
|---|
| Build Failure | [Response] | [Recovery steps] |
| Test Failure | [Response] | [Recovery steps] |
| Deployment Failure | [Response] | [Recovery steps] |
Quality Gates
Gate Definitions
| Gate | Criteria | Bypass Conditions |
|---|
| Code Quality | [Standards] | [When allowed] |
| Security Scan | [Thresholds] | [When allowed] |
| Test Coverage | [Percentage] | [When allowed] |
Monitoring & Observability
Key Metrics
- Success Rate: [Target percentage]
- Execution Time: [Target duration]
- Resource Usage: [Monitoring approach]
Alerting
| Condition | Severity | Notification Target |
|---|
| [Condition] | [Level] | [Who/Where] |
Integration Points
External Systems
| System | Integration Type | Data Exchange | SLA Requirements |
|---|
| [System] | [Type] | [Data format] | [Requirements] |
Dependent Workflows
| Workflow | Relationship | Trigger Mechanism |
|---|
| [Workflow] | [Type] | [How triggered] |
Compliance & Governance
Audit Requirements
- Execution Logs: [Retention policy]
- Approval Gates: [Required approvals]
- Change Control: [Update process]
Security Controls
- Access Control: [Permission model]
- Secret Management: [Rotation policy]
- Vulnerability Scanning: [Scan frequency]
Edge Cases & Exceptions
Scenario Matrix
| Scenario | Expected Behavior | Validation Method |
|---|
| [Edge case] | [Behavior] | [How to verify] |
Validation Criteria
Workflow Validation
- VLD-001: [Validation rule]
- VLD-002: [Validation rule]
Performance Benchmarks
- PERF-001: [Benchmark criteria]
- PERF-002: [Benchmark criteria]
Change Management
Update Process
- Specification Update: Modify this document first
- Review & Approval: [Approval process]
- Implementation: Apply changes to workflow
- Testing: [Validation approach]
- Deployment: [Release process]
Version History
| Version | Date | Changes | Author |
|---|
| 1.0 | [Date] | Initial specification | [Author] |
Related Specifications
- [Link to related workflow specs]
- [Link to infrastructure specs]
- [Link to deployment specs]
Complex Workflows
For workflows with 5+ jobs, use subgraphs:
Token Optimization Strategies
- Use Tables: Dense information in structured format
- Abbreviate Consistently: Define once, use throughout
- Bullet Points: Avoid prose paragraphs
- Code Blocks: Structured data over narrative
- Cross-Reference: Link instead of repeat information
Focus on creating a specification that serves as both documentation and a template for workflow updates.