Communitygithub.com

AmanVarshney01/tcut

根據 OpenSpec 變更來執行任務。當使用者想要開始實作、繼續實作或逐步完成任務時使用。

tcut 是什麼?

此技能專為 AI 代理人(如 Claude Code、Cursor 或 Codex)設計,透過指令列工具 `openspec` 與 OpenSpec 變更互動,以結構化方式執行任務。它會先讀取變更的狀態與套用指示,取得工作的上下文檔案與任務清單,接著逐一實作待辦工作,並在完成後更新任務核取方塊。此技能支援多種工作流程模式(如 spec-driven),並能處理卡住、錯誤或設計問題等暫停情況,提供清晰的進度報告與後續選項。其設計強調靈活整合,可在任務就緒的任何時候啟動,不強制階段性鎖定,讓實作與設計更新得以交錯進行。主要透過 `openspec status`、`openspec instructions apply` 與 `openspec list` 等指令來取得資訊,並使用 `--json` 輸出格式以便解析。

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

在你喜歡的 AI 中提問

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

說明文件

根據 OpenSpec 變更來執行任務。

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

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

步驟

  1. 選擇變更

    如果有提供名稱,則直接使用。否則:

    • 若使用者在對話中提及某個變更,則從上下文推斷
    • 如果只有一個活躍的變更,則自動選取
    • 如果不明確,執行 openspec list --json 取得可用的變更,並使用 AskUserQuestion 工具 讓使用者選擇

    務必宣告:「正在使用變更:<名稱>」並說明如何覆蓋(例如 /opsx:apply <其他>)。

  2. 檢查狀態以了解結構

    openspec status --change "<名稱>" --json
    

    解析 JSON 以了解:

    • schemaName:正在使用的工作流程(例如「spec-driven」)
    • planningHome、changeRoot、actionContext:規劃範圍與編輯限制
    • 哪個成品包含任務(通常 spec-driven 是「tasks」;其他請檢查 status)
  3. 取得套用指示

    openspec instructions apply --change "<名稱>" --json
    

    這會回傳:

    • contextFiles:成品 ID → 具體檔案路徑陣列(依結構而異——可能是 proposal/specs/design/tasks 或 spec/tests/implementation/docs)
    • 進度(總數、完成數、剩餘數)
    • 任務清單與狀態
    • 基於當前狀態的動態指示

    處理各種狀態:

    • 如果 state: "blocked"(缺少成品):顯示訊息,建議使用 openspec-continue-change
    • 如果 state: "all_done":道賀,建議歸檔
    • 否則:繼續進行實作
  4. 讀取上下文檔案

    讀取套用指示輸出中 contextFiles 下列出的所有檔案路徑。 檔案取決於使用的結構:

    • spec-driven:proposal、specs、design、tasks
    • 其他結構:遵循 CLI 輸出的 contextFiles
  5. 顯示當前進度

    顯示:

    • 正在使用的結構
    • 進度:「已完成 N/M 個任務」
    • 剩餘任務總覽
    • CLI 的動態指示
  6. 執行任務(迴圈直到完成或卡住)

    對於每個待辦任務:

    • 顯示正在處理的任務
    • 進行所需的程式碼變更
    • 保持變更最小且聚焦
    • 在任務檔案中標記任務完成:- [ ] → - [x]
    • 繼續下一個任務

    暫停條件:

    • 任務不明確 → 要求澄清
    • 實作時發現設計問題 → 建議更新成品
    • 遇到錯誤或阻礙 → 回報並等待指示
    • 使用者打斷
  7. 完成或暫停時,顯示狀態

    顯示:

    • 本次作業完成的任務
    • 整體進度:「已完成 N/M 個任務」
    • 如果全部完成:建議歸檔
    • 如果暫停:說明原因並等待指示

實作期間的輸出

## 正在實作:<變更名稱>(結構:<結構名稱>)

正在處理任務 3/7:<任務描述>
[...正在實作...]
✓ 任務完成

正在處理任務 4/7:<任務描述>
[...正在實作...]
✓ 任務完成

完成時的輸出

## 實作完成

**變更:** <變更名稱>
**結構:** <結構名稱>
**進度:** 7/7 個任務完成 ✓

### 本次作業完成
- [x] 任務 1
- [x] 任務 2
...

所有任務完成!已可歸檔此變更。

暫停時的輸出(遇到問題)

## 實作暫停

**變更:** <變更名稱>
**結構:** <結構名稱>
**進度:** 4/7 個任務完成

### 遇到的問題
<問題描述>

**選項:**
1. <選項 1>
2. <選項 2>
3. 其他方法

您希望怎麼做?

護欄

  • 持續處理任務直到完成或卡住
  • 開始前務必先讀取上下文檔案(來自套用指示的輸出)
  • 如果任務不明確,暫停並在實作前詢問
  • 如果實作時發現問題,暫停並建議更新成品
  • 保持程式碼變更最小,且僅限於每個任務的範圍
  • 完成每個任務後立即更新任務核取方塊
  • 遇到錯誤、阻礙或不明確的需求時暫停——不要猜測
  • 使用 CLI 輸出的 contextFiles,不要假設特定檔案名稱

彈性工作流程整合

此技能支援「對變更執行操作」的模型:

  • 隨時可被呼叫:在所有成品完成之前(如果已有任務)、部分實作之後、與其他動作交錯進行
  • 允許更新成品:如果實作時發現設計問題,建議更新成品——不鎖定階段,可彈性工作

Individual skills in this repo

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

AmanVarshney01/tcut

Archive a completed change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete.

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.

相關技能