fix
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 4m27s
Docker Build & Deploy / Deploy to Production (push) Successful in 7s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s
Docker Build & Deploy / WeChat Notification (push) Successful in 1s
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 4m27s
Docker Build & Deploy / Deploy to Production (push) Successful in 7s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s
Docker Build & Deploy / WeChat Notification (push) Successful in 1s
This commit is contained in:
156
.opencode/skills/openspec-apply-change/SKILL.cn.md
Normal file
156
.opencode/skills/openspec-apply-change/SKILL.cn.md
Normal file
@@ -0,0 +1,156 @@
|
||||
---
|
||||
name: openspec-apply-change
|
||||
description: Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks.
|
||||
license: MIT
|
||||
compatibility: Requires openspec CLI.
|
||||
metadata:
|
||||
author: openspec
|
||||
version: "1.0"
|
||||
generatedBy: "1.1.1"
|
||||
---
|
||||
|
||||
从 OpenSpec 变更中实施任务。
|
||||
|
||||
**输入**:可选地指定变更名称。如果省略,则检查是否可以从对话上下文推断。如果模糊或不明确,您**必须**提示用户选择可用的变更。
|
||||
|
||||
**步骤**
|
||||
|
||||
1. **选择变更**
|
||||
|
||||
如果提供了名称,则使用它。否则:
|
||||
- 如果用户提到了变更,则从对话上下文推断
|
||||
- 如果只存在一个活动变更,则自动选择
|
||||
- 如果不明确,运行 `openspec list --json` 获取可用变更并使用 **AskUserQuestion 工具**让用户选择
|
||||
|
||||
始终宣布:"使用变更: <名称>" 以及如何覆盖(例如 `/opsx-apply <其他>`)。
|
||||
|
||||
2. **检查状态以了解 schema**
|
||||
```bash
|
||||
openspec status --change "<name>" --json
|
||||
```
|
||||
解析 JSON 以了解:
|
||||
- `schemaName`: 正在使用的工作流(例如 "spec-driven")
|
||||
- 哪个 artifact 包含任务(对于 spec-driven 通常是 "tasks",其他情况请检查状态)
|
||||
|
||||
3. **获取应用说明**
|
||||
|
||||
```bash
|
||||
openspec instructions apply --change "<name>" --json
|
||||
```
|
||||
|
||||
这将返回:
|
||||
- 上下文文件路径(因 schema 而异 - 可能是 proposal/specs/design/tasks 或 spec/tests/implementation/docs)
|
||||
- 进度(总数、已完成、剩余)
|
||||
- 带状态的任务列表
|
||||
- 基于当前状态的动态指令
|
||||
|
||||
**处理状态:**
|
||||
- 如果 `state: "blocked"`(缺少 artifacts): 显示消息,建议使用 openspec-continue-change
|
||||
- 如果 `state: "all_done"`: 祝贺,建议归档
|
||||
- 否则: 继续实施
|
||||
|
||||
4. **读取上下文文件**
|
||||
|
||||
读取应用说明输出中 `contextFiles` 列出的文件。
|
||||
文件取决于使用的 schema:
|
||||
- **spec-driven**: proposal、specs、design、tasks
|
||||
- 其他 schemas: 遵循 CLI 输出中的 contextFiles
|
||||
|
||||
5. **显示当前进度**
|
||||
|
||||
显示:
|
||||
- 正在使用的 Schema
|
||||
- 进度: "已完成 N/M 个任务"
|
||||
- 剩余任务概览
|
||||
- 来自 CLI 的动态指令
|
||||
|
||||
6. **实施任务(循环直到完成或阻塞)**
|
||||
|
||||
对于每个待处理任务:
|
||||
- 显示正在处理哪个任务
|
||||
- 进行所需的代码更改
|
||||
- 保持更改最小且专注
|
||||
- 在任务文件中标记任务完成: `- [ ]` → `- [x]`
|
||||
- 继续下一个任务
|
||||
|
||||
**暂停如果:**
|
||||
- 任务不清楚 → 请求澄清
|
||||
- 实施揭示设计问题 → 建议更新 artifacts
|
||||
- 遇到错误或阻塞 → 报告并等待指导
|
||||
- 用户中断
|
||||
|
||||
7. **完成或暂停时,显示状态**
|
||||
|
||||
显示:
|
||||
- 本次会话完成的任务
|
||||
- 总体进度: "已完成 N/M 个任务"
|
||||
- 如果全部完成: 建议归档
|
||||
- 如果暂停: 解释原因并等待指导
|
||||
|
||||
**实施期间的输出**
|
||||
|
||||
```
|
||||
## 正在实施: <change-name> (schema: <schema-name>)
|
||||
|
||||
正在处理任务 3/7: <任务描述>
|
||||
[...正在实施...]
|
||||
✓ 任务完成
|
||||
|
||||
正在处理任务 4/7: <任务描述>
|
||||
[...正在实施...]
|
||||
✓ 任务完成
|
||||
```
|
||||
|
||||
**完成时的输出**
|
||||
|
||||
```
|
||||
## 实施完成
|
||||
|
||||
**变更:** <change-name>
|
||||
**Schema:** <schema-name>
|
||||
**进度:** 7/7 个任务完成 ✓
|
||||
|
||||
### 本次会话已完成
|
||||
- [x] 任务 1
|
||||
- [x] 任务 2
|
||||
...
|
||||
|
||||
所有任务完成! 准备归档此变更。
|
||||
```
|
||||
|
||||
**暂停时的输出(遇到问题)**
|
||||
|
||||
```
|
||||
## 实施已暂停
|
||||
|
||||
**变更:** <change-name>
|
||||
**Schema:** <schema-name>
|
||||
**进度:** 已完成 4/7 个任务
|
||||
|
||||
### 遇到的问题
|
||||
<问题描述>
|
||||
|
||||
**选项:**
|
||||
1. <选项 1>
|
||||
2. <选项 2>
|
||||
3. 其他方法
|
||||
|
||||
您想怎么做?
|
||||
```
|
||||
|
||||
**护栏**
|
||||
- 持续处理任务直到完成或阻塞
|
||||
- 开始前始终读取上下文文件(从应用说明输出中)
|
||||
- 如果任务不明确,在实施前暂停并询问
|
||||
- 如果实施揭示问题,暂停并建议更新 artifact
|
||||
- 保持代码更改最小且限定在每个任务范围内
|
||||
- 完成每个任务后立即更新任务复选框
|
||||
- 遇到错误、阻塞或不清楚的需求时暂停 - 不要猜测
|
||||
- 使用 CLI 输出中的 contextFiles,不要假设特定文件名
|
||||
|
||||
**流畅工作流集成**
|
||||
|
||||
此技能支持"对变更的操作"模型:
|
||||
|
||||
- **可以随时调用**: 在所有 artifacts 完成之前(如果存在任务)、部分实施后、与其他操作交错进行
|
||||
- **允许更新 artifact**: 如果实施揭示设计问题,建议更新 artifacts - 不是阶段锁定,灵活工作
|
||||
156
.opencode/skills/openspec-apply-change/SKILL.md
Normal file
156
.opencode/skills/openspec-apply-change/SKILL.md
Normal file
@@ -0,0 +1,156 @@
|
||||
---
|
||||
name: openspec-apply-change
|
||||
description: Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks.
|
||||
license: MIT
|
||||
compatibility: Requires openspec CLI.
|
||||
metadata:
|
||||
author: openspec
|
||||
version: "1.0"
|
||||
generatedBy: "1.1.1"
|
||||
---
|
||||
|
||||
Implement tasks from an OpenSpec change.
|
||||
|
||||
**Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
|
||||
|
||||
**Steps**
|
||||
|
||||
1. **Select the change**
|
||||
|
||||
If a name is provided, use it. Otherwise:
|
||||
- Infer from conversation context if the user mentioned a change
|
||||
- Auto-select if only one active change exists
|
||||
- If ambiguous, run `openspec list --json` to get available changes and use the **AskUserQuestion tool** to let the user select
|
||||
|
||||
Always announce: "Using change: <name>" and how to override (e.g., `/opsx-apply <other>`).
|
||||
|
||||
2. **Check status to understand the schema**
|
||||
```bash
|
||||
openspec status --change "<name>" --json
|
||||
```
|
||||
Parse the JSON to understand:
|
||||
- `schemaName`: The workflow being used (e.g., "spec-driven")
|
||||
- Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
|
||||
|
||||
3. **Get apply instructions**
|
||||
|
||||
```bash
|
||||
openspec instructions apply --change "<name>" --json
|
||||
```
|
||||
|
||||
This returns:
|
||||
- Context file paths (varies by schema - could be proposal/specs/design/tasks or spec/tests/implementation/docs)
|
||||
- Progress (total, complete, remaining)
|
||||
- Task list with status
|
||||
- Dynamic instruction based on current state
|
||||
|
||||
**Handle states:**
|
||||
- If `state: "blocked"` (missing artifacts): show message, suggest using openspec-continue-change
|
||||
- If `state: "all_done"`: congratulate, suggest archive
|
||||
- Otherwise: proceed to implementation
|
||||
|
||||
4. **Read context files**
|
||||
|
||||
Read the files listed in `contextFiles` from the apply instructions output.
|
||||
The files depend on the schema being used:
|
||||
- **spec-driven**: proposal, specs, design, tasks
|
||||
- Other schemas: follow the contextFiles from CLI output
|
||||
|
||||
5. **Show current progress**
|
||||
|
||||
Display:
|
||||
- Schema being used
|
||||
- Progress: "N/M tasks complete"
|
||||
- Remaining tasks overview
|
||||
- Dynamic instruction from CLI
|
||||
|
||||
6. **Implement tasks (loop until done or blocked)**
|
||||
|
||||
For each pending task:
|
||||
- Show which task is being worked on
|
||||
- Make the code changes required
|
||||
- Keep changes minimal and focused
|
||||
- Mark task complete in the tasks file: `- [ ]` → `- [x]`
|
||||
- Continue to next task
|
||||
|
||||
**Pause if:**
|
||||
- Task is unclear → ask for clarification
|
||||
- Implementation reveals a design issue → suggest updating artifacts
|
||||
- Error or blocker encountered → report and wait for guidance
|
||||
- User interrupts
|
||||
|
||||
7. **On completion or pause, show status**
|
||||
|
||||
Display:
|
||||
- Tasks completed this session
|
||||
- Overall progress: "N/M tasks complete"
|
||||
- If all done: suggest archive
|
||||
- If paused: explain why and wait for guidance
|
||||
|
||||
**Output During Implementation**
|
||||
|
||||
```
|
||||
## Implementing: <change-name> (schema: <schema-name>)
|
||||
|
||||
Working on task 3/7: <task description>
|
||||
[...implementation happening...]
|
||||
✓ Task complete
|
||||
|
||||
Working on task 4/7: <task description>
|
||||
[...implementation happening...]
|
||||
✓ Task complete
|
||||
```
|
||||
|
||||
**Output On Completion**
|
||||
|
||||
```
|
||||
## Implementation Complete
|
||||
|
||||
**Change:** <change-name>
|
||||
**Schema:** <schema-name>
|
||||
**Progress:** 7/7 tasks complete ✓
|
||||
|
||||
### Completed This Session
|
||||
- [x] Task 1
|
||||
- [x] Task 2
|
||||
...
|
||||
|
||||
All tasks complete! Ready to archive this change.
|
||||
```
|
||||
|
||||
**Output On Pause (Issue Encountered)**
|
||||
|
||||
```
|
||||
## Implementation Paused
|
||||
|
||||
**Change:** <change-name>
|
||||
**Schema:** <schema-name>
|
||||
**Progress:** 4/7 tasks complete
|
||||
|
||||
### Issue Encountered
|
||||
<description of the issue>
|
||||
|
||||
**Options:**
|
||||
1. <option 1>
|
||||
2. <option 2>
|
||||
3. Other approach
|
||||
|
||||
What would you like to do?
|
||||
```
|
||||
|
||||
**Guardrails**
|
||||
- Keep going through tasks until done or blocked
|
||||
- Always read context files before starting (from the apply instructions output)
|
||||
- If task is ambiguous, pause and ask before implementing
|
||||
- If implementation reveals issues, pause and suggest artifact updates
|
||||
- Keep code changes minimal and scoped to each task
|
||||
- Update task checkbox immediately after completing each task
|
||||
- Pause on errors, blockers, or unclear requirements - don't guess
|
||||
- Use contextFiles from CLI output, don't assume specific file names
|
||||
|
||||
**Fluid Workflow Integration**
|
||||
|
||||
This skill supports the "actions on a change" model:
|
||||
|
||||
- **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
|
||||
- **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly
|
||||
Reference in New Issue
Block a user