create-github-action-workflow-specification by github/awesome-copilot
npx skills add https://github.com/github/awesome-copilot --skill create-github-action-workflow-specification为 GitHub Actions 工作流创建一份全面的规范:${input:WorkflowFile}。
此规范作为工作流行为、需求和约束的规范说明。它必须与具体实现无关,重点关注工作流实现什么,而非如何实现。
保存为:/spec/spec-process-cicd-[workflow-name].md
---
title: CI/CD 工作流规范 - [工作流名称]
version: 1.0
date_created: [YYYY-MM-DD]
last_updated: [YYYY-MM-DD]
owner: DevOps 团队
tags: [process, cicd, github-actions, automation, [domain-specific-tags]]
---
## 工作流概述
**目的**:[一句话描述工作流的主要目标]
**触发事件**:[列出触发条件]
**目标环境**:[环境范围]
## 执行流程图
```mermaid
graph TD
A[触发事件] --> B[作业 1]
B --> C[作业 2]
C --> D[作业 3]
D --> E[结束]
B --> F[并行作业]
F --> D
style A fill:#e1f5fe
style E fill:#e8f5e8
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 作业名称 | 目的 | 依赖关系 | 执行上下文 |
|---|---|---|---|
| job-1 | [目的] | [先决条件] | [运行器/环境] |
| job-2 | [目的] | job-1 | [运行器/环境] |
| ID | 需求 | 优先级 | 验收标准 |
|---|---|---|---|
| REQ-001 | [需求] | 高 | [可测试的标准] |
| REQ-002 | [需求] | 中 | [可测试的标准] |
| ID | 需求 | 实现约束 |
|---|---|---|
| SEC-001 | [安全需求] | [约束描述] |
| ID | 指标 | 目标值 | 测量方法 |
|---|---|---|---|
| PERF-001 | [指标] | [目标值] | [测量方式] |
# 环境变量
ENV_VAR_1: string # 目的:[描述]
ENV_VAR_2: secret # 目的:[描述]
# 仓库触发器
paths: [路径过滤器列表]
branches: [分支模式列表]
# 作业输出
job_1_output: string # 描述:[用途]
build_artifact: file # 描述:[内容类型]
| 类型 | 名称 | 目的 | 作用域 |
|---|---|---|---|
| Secret | SECRET_1 | [目的] | 工作流 |
| Variable | VAR_1 | [目的] | 仓库 |
| 错误类型 | 响应 | 恢复操作 |
|---|---|---|
| 构建失败 | [响应] | [恢复步骤] |
| 测试失败 | [响应] | [恢复步骤] |
| 部署失败 | [响应] | [恢复步骤] |
| 门禁 | 标准 | 绕过条件 |
|---|---|---|
| 代码质量 | [标准] | [允许的情况] |
| 安全扫描 | [阈值] | [允许的情况] |
| 测试覆盖率 | [百分比] | [允许的情况] |
| 条件 | 严重性 | 通知目标 |
|---|---|---|
| [条件] | [级别] | [通知对象/位置] |
| 系统 | 集成类型 | 数据交换 | SLA 要求 |
|---|---|---|---|
| [系统] | [类型] | [数据格式] | [要求] |
| 工作流 | 关系 | 触发机制 |
|---|---|---|
| [工作流] | [类型] | [触发方式] |
| 场景 | 预期行为 | 验证方法 |
|---|---|---|
| [边界情况] | [行为] | [验证方式] |
| 版本 | 日期 | 变更 | 作者 |
|---|---|---|---|
| 1.0 | [日期] | 初始规范 | [作者] |
[链接到相关工作流规范]
[链接到基础设施规范]
[链接到部署规范]
分析工作流文件时:
A --> B --> CA --> B & A --> C; B --> D & C --> DA --> B{决策}; B -->|是| C; B -->|否| Dstyle TriggerNode fill:#e1f5fe
style SuccessNode fill:#e8f5e8
style FailureNode fill:#ffebee
style ProcessNode fill:#f3e5f5
对于包含 5 个以上作业的工作流,使用子图:
graph TD
subgraph "构建阶段"
A[代码检查] --> B[测试] --> C[构建]
end
subgraph "部署阶段"
D[预发布] --> E[生产环境]
end
C --> D
专注于创建一份既能作为文档,又能作为工作流更新模板的规范。
每周安装量
7.5K
仓库
GitHub 星标数
26.7K
首次出现
2026年2月25日
安全审计
安装于
codex7.4K
gemini-cli7.4K
opencode7.4K
cursor7.4K
github-copilot7.4K
kimi-cli7.4K
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.
Save as: /spec/spec-process-cicd-[workflow-name].md
---
title: CI/CD Workflow Specification - [Workflow Name]
version: 1.0
date_created: [YYYY-MM-DD]
last_updated: [YYYY-MM-DD]
owner: DevOps Team
tags: [process, cicd, github-actions, automation, [domain-specific-tags]]
---
## Workflow Overview
**Purpose**: [One sentence describing workflow's primary goal]
**Trigger Events**: [List trigger conditions]
**Target Environments**: [Environment scope]
## Execution Flow Diagram
```mermaid
graph TD
A[Trigger Event] --> B[Job 1]
B --> C[Job 2]
C --> D[Job 3]
D --> E[End]
B --> F[Parallel Job]
F --> D
style A fill:#e1f5fe
style E fill:#e8f5e8
| Job Name | Purpose | Dependencies | Execution Context |
|---|---|---|---|
| job-1 | [Purpose] | [Prerequisites] | [Runner/Environment] |
| job-2 | [Purpose] | job-1 | [Runner/Environment] |
| ID | Requirement | Priority | Acceptance Criteria |
|---|---|---|---|
| REQ-001 | [Requirement] | High | [Testable criteria] |
| REQ-002 | [Requirement] | Medium | [Testable criteria] |
| ID | Requirement | Implementation Constraint |
|---|---|---|
| SEC-001 | [Security requirement] | [Constraint description] |
| ID | Metric | Target | Measurement Method |
|---|---|---|---|
| PERF-001 | [Metric] | [Target value] | [How measured] |
# Environment Variables
ENV_VAR_1: string # Purpose: [description]
ENV_VAR_2: secret # Purpose: [description]
# Repository Triggers
paths: [list of path filters]
branches: [list of branch patterns]
# Job Outputs
job_1_output: string # Description: [purpose]
build_artifact: file # Description: [content type]
| Type | Name | Purpose | Scope |
|---|---|---|---|
| Secret | SECRET_1 | [Purpose] | Workflow |
| Variable | VAR_1 | [Purpose] | Repository |
| Error Type | Response | Recovery Action |
|---|---|---|
| Build Failure | [Response] | [Recovery steps] |
| Test Failure | [Response] | [Recovery steps] |
| Deployment Failure | [Response] | [Recovery steps] |
| Gate | Criteria | Bypass Conditions |
|---|---|---|
| Code Quality | [Standards] | [When allowed] |
| Security Scan | [Thresholds] | [When allowed] |
| Test Coverage | [Percentage] | [When allowed] |
| Condition | Severity | Notification Target |
|---|---|---|
| [Condition] | [Level] | [Who/Where] |
| System | Integration Type | Data Exchange | SLA Requirements |
|---|---|---|---|
| [System] | [Type] | [Data format] | [Requirements] |
| Workflow | Relationship | Trigger Mechanism |
|---|---|---|
| [Workflow] | [Type] | [How triggered] |
| Scenario | Expected Behavior | Validation Method |
|---|---|---|
| [Edge case] | [Behavior] | [How to verify] |
| Version | Date | Changes | Author |
|---|---|---|---|
| 1.0 | [Date] | Initial specification | [Author] |
[Link to related workflow specs]
[Link to infrastructure specs]
[Link to deployment specs]
When analyzing the workflow file:
A --> B --> CA --> B & A --> C; B --> D & C --> DA --> B{Decision}; B -->|Yes| C; B -->|No| DFor workflows with 5+ jobs, use subgraphs:
graph TD
subgraph "Build Phase"
A[Lint] --> B[Test] --> C[Build]
end
subgraph "Deploy Phase"
D[Staging] --> E[Production]
end
C --> D
Focus on creating a specification that serves as both documentation and a template for workflow updates.
Weekly Installs
7.5K
Repository
GitHub Stars
26.7K
First Seen
Feb 25, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex7.4K
gemini-cli7.4K
opencode7.4K
cursor7.4K
github-copilot7.4K
kimi-cli7.4K
97,600 周安装
style TriggerNode fill:#e1f5fe
style SuccessNode fill:#e8f5e8
style FailureNode fill:#ffebee
style ProcessNode fill:#f3e5f5