Communitygithub.com

AmanVarshney01/tcut

在實驗工作流程中封存一個已完成的變更。當使用者想要在實作完成後最終確定並封存變更時使用。

tcut 是什麼?

此技能為一個 AI 代理工具(例如 Claude Code、Cursor 或 Codex),專為封存實驗性工作流程中的已完成變更而設計。它會引導使用者完成完整的封存流程:若未指定則提示選擇變更,透過解析 `openspec status --json` 的輸出檢查成品是否完成,檢查 `tasks.md` 中是否有未完成的任務,並評估增量規格是否已同步。若有增量規格,它會比較每個增量規格與對應的主規格,展示變更摘要(新增、修改、刪除、重新命名),並提供同步選項(「立即同步(建議)」、」不進行同步即封存「等)。最終,它會將變更目錄移動到 `planningHome.changesDir/archive/` 之下,以 `YYYY-MM-DD-<變更名稱>` 的格式命名,並顯示包含變更名稱、所使用的規格、封存位置、規格同步狀態以及任何警告(例如未完成的成品或任務)的摘要。該技能支援「store」參數,以處理在多個 OpenSpec 註冊儲存庫環境中的工作,確保指令操作正確的儲存庫。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/AmanVarshney01/tcut/tree/HEAD/.claude/skills/openspec-archive-change

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

在實驗工作流程中封存一個已完成的變更。

儲存庫選擇: 如果使用者指定了一個儲存庫(一個儲存庫是此機器上註冊的獨立 OpenSpec 倉庫),或者工作位於其中,請執行 openspec store list --json 來發現已註冊的儲存庫 ID,然後在讀取或寫入規格和變更的指令(new change、status、instructions、list、show、validate、archive、doctor、context)中傳遞 --store <id>。其他指令不接受此旗標。指令輸出的提示已包含該旗標;請在後續操作中保留它。若無指定儲存庫,指令會在最近的本地 openspec/ 根目錄中執行。

輸入:可選,指定變更名稱。若省略,請檢查是否能從對話上下文中推斷。如果模糊或不明確,你必須提示可用的變更。

步驟

  1. 若未提供變更名稱,提示選擇

    執行 openspec list --json 以取得可用的變更。使用 AskUserQuestion 工具 讓使用者選擇。

    僅顯示活躍的變更(尚未封存的)。 若可行,包含每個變更所使用的 schema。

    重要事項:請勿猜測或自動選擇變更。務必讓使用者選擇。

  2. 檢查成品完成狀態

    執行 openspec status --change "<name>" --json 以檢查成品完成度。

    解析 JSON 以了解:

    • schemaName:正在使用的 workflow
    • planningHome、changeRoot、artifactPaths 與 actionContext:路徑與作用域上下文
    • artifacts:成品列表及其狀態(done 或其他)

    若有任何成品狀態不是 done:

    • 顯示警告,列出未完成的成品
    • 使用 AskUserQuestion 工具 確認使用者是否要繼續
    • 若使用者確認,則繼續
  3. 檢查任務完成狀態

    讀取任務檔案(通常為 tasks.md)以檢查是否有未完成的任務。

    計算標記為 - [ ](未完成)與 - [x](完成)的任務數量。

    若發現未完成的任務:

    • 顯示警告,說明未完成的任務數量
    • 使用 AskUserQuestion 工具 確認使用者是否要繼續
    • 若使用者確認,則繼續

    若任務檔案不存在: 直接進行,不發送與任務相關的警告。

  4. 評估增量規格同步狀態

    使用狀態 JSON 中的 artifactPaths.specs.existingOutputPaths 檢查是否存在增量規格。若無,則直接進行,不發送同步提示。

    若存在增量規格:

    • 將每個增量規格與 openspec/specs/<capability>/spec.md 中對應的主要規格進行比較
    • 判斷會套用哪些變更(新增、修改、刪除、重新命名)
    • 在提示之前顯示合併摘要

    提示選項:

    • 如果需要變更:「立即同步(建議)」、「不進行同步即封存」
    • 如果已經同步:「立即封存」、「無論如何都同步」、「取消」

    若使用者選擇同步,請使用 Task 工具(subagent_type: "general-purpose",提示詞:「使用 Skill 工具為變更 '' 調用 openspec-sync-specs。增量規格分析:<包含分析的增量規格摘要>」)。無論選擇為何,都繼續進行封存。

  5. 執行封存

    在 planningHome.changesDir 下建立 archive 目錄(如果不存在):

    mkdir -p "<planningHome.changesDir>/archive"
    

    使用目前日期產生目標名稱:YYYY-MM-DD-<change-name>

    檢查目標是否已存在:

    • 如果是:因錯誤而失敗,建議重新命名現有封存或使用不同日期
    • 如果否:將 changeRoot 移動到封存目錄
    mv "<changeRoot>" "<planningHome.changesDir>/archive/YYYY-MM-DD-<name>"
    
  6. 顯示摘要

    顯示封存完成摘要,包含:

    • 變更名稱
    • 所使用的 Schema
    • 封存位置
    • 規格是否已同步(如果適用)
    • 關於任何警告的備註(未完成的成品/任務)

成功時輸出

## 封存完成

**變更:** <change-name>
**Schema:** <schema-name>
**封存至:** 從 `planningHome.changesDir` 推導出的路徑/YYYY-MM-DD-<name>/
**規格:** ✓ 已同步至主要規格(或「無增量規格」或「跳過同步」)

所有成品已完成。所有任務已完成。

防護措施

  • 若未提供變更,務必提示選擇
  • 使用成品圖表(openspec status --json)進行完成度檢查
  • 不要因警告而阻止封存 - 只需告知並確認
  • 移動至封存時保留 .openspec.yaml(它會隨目錄一起移動)
  • 顯示清楚的事件摘要
  • 如果要求同步,使用 openspec-sync-specs 方法(由代理驅動)
  • 若存在增量規格,務必先執行同步評估並在提示前顯示合併摘要

Individual skills in this repo

This repo contains 7 individual skills — each has its own dedicated page.

AmanVarshney01/tcut

Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks.

AmanVarshney01/tcut

Enter explore mode - a thinking partner for exploring ideas, investigating problems, and clarifying requirements. Use when the user wants to think through something before or during a change.

AmanVarshney01/tcut

Propose a new change with all artifacts generated in one step. Use when the user wants to quickly describe what they want to build and get a complete proposal with design, specs, and tasks ready for implementation.

AmanVarshney01/tcut

Sync delta specs from a change to main specs. Use when the user wants to update main specs with changes from a delta spec, without archiving the change.

AmanVarshney01/tcut

Update an OpenSpec change by revising its existing planning artifacts and keeping them coherent with one another. Use when the user wants to revise a change's plan, fold new decisions into it, or reconcile its artifacts after an edit. Never edits code.

AmanVarshney01/tcut

Combine tcut terminal recordings with Remotion to produce polished, motion-designed launch/promo videos (title cards, animated captions, layered terminal footage). Use when the user wants a product video, launch video, or social video that features terminal/CLI footage.

AmanVarshney01/tcut

Record reproducible terminal videos (MP4/GIF/SVG/HTML) from TypeScript scripts or live sessions with the tcut CLI. Use when the user wants a terminal demo, CLI screencast, TUI recording, or animated terminal GIF for a README, website, or social post.

相關技能