Communitygithub.com

AmanVarshney01/tcut

在实验工作流程中归档一个已完成变更。当用户希望在实施完成后最终确定并归档变更时使用。

tcut 是什么?

该技能用于在基于 OpenSpec 的实验性工作流程中归档一个已完成变更。它通过 `openspec` CLI 管理变更生命周期,支持可选变更名称和商店选择。技能会检查工件和任务是否完成,评估差异规格同步状态,并提示用户确认。最终,它会将变更文件移至归档目录,并显示包含变更名称、所用架构、归档位置和同步状态摘要的完成信息。该技能与任何支持 OpenSpec 的 AI Agent 平台兼容,例如 Claude Code、Cursor 或 Codex。

兼容平台~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 工具 让用户选择。

    仅显示活跃的变更(尚未归档)。 如果可用,包含每个变更所使用的架构。

    重要:不要猜测或自动选择变更。始终让用户选择。

  2. 检查工件完成状态

    运行 openspec status --change "<name>" --json 检查工件完成情况。

    解析 JSON 以了解:

    • schemaName:正在使用的工作流程
    • planningHome、changeRoot、artifactPaths 和 actionContext:路径和作用域上下文
    • artifacts:工件列表,及其状态(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. 显示摘要

    显示归档完成摘要,包括:

    • 变更名称
    • 所使用的架构
    • 归档位置
    • 规格是否已同步(如果适用)
    • 关于任何警告(未完成的工件/任务)的说明

成功输出

## 归档完成

**变更:** <change-name>
**架构:** <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.

相关技能