Communitygithub.com

AmanVarshney01/tcut

一键提出变更并生成所有制品。当用户希望快速描述构建目标并获取包含设计、规格和任务的完整提案时使用。

tcut 是什么?

该技能将用户需求的简短描述转化为结构化的变更提案,自动生成所有必需的制品,包括提案(proposal.md,说明什么和为什么)、设计(design.md,说明如何实现)和任务(tasks.md,实现步骤)。它通过 OpenSpec CLI 管理制品生命周期,自动检测依赖顺序,并确保持续进度直到所有实现前制品完成为止。该技能支持可选的存储选择,允许用户针对已注册的 OpenSpec 仓库进行操作。完成后会提示用户应用变更,实现与实施工作流的无缝集成。该技能设计用于任何支持技能或工具的 AI 代理平台。

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

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

提出新变更 - 一步创建变更并生成所有制品。

我将创建包含以下制品的变更:

  • proposal.md(是什么和为什么)
  • design.md(如何做)
  • tasks.md(实现步骤)

准备实施时,运行 /opsx:apply


存储选择: 如果用户提到了某个存储(存储是本机注册的独立 OpenSpec 仓库)或者变更工作属于该存储,则运行 openspec store list --json 发现已注册的存储 ID,然后在读取或写入规格和变更的命令(new change、status、instructions、list、show、validate、archive、doctor、context)中传递 --store <id>。其他命令不接受该标志。命令输出的提示信息已包含该标志;后续操作中请保留。如果没有指定存储,命令则作用于最近的本地 openspec/ 根目录。

输入:用户的请求应包含变更名称(kebab-case 格式)或他们想构建的内容描述。

步骤

  1. 如果未提供明确输入,询问用户想构建什么

    使用 AskUserQuestion 工具(开放式,无预设选项)询问:

    “您想进行什么变更?描述您要构建或修复的内容。”

    根据他们的描述,推导出一个 kebab-case 格式的名称(例如,“添加用户认证” → add-user-auth)。

    重要:在明确用户想要构建的内容之前,不要继续。

  2. 创建变更目录

    openspec new change "<name>"
    

    这会在 CLI 通过 .openspec.yaml 解析的规划根目录下创建变更的脚手架。

  3. 获取制品构建顺序

    openspec status --change "<name>" --json
    

    解析 JSON 以获取:

    • applyRequires:实施前所需的制品 ID 数组(例如 ["tasks"])
    • artifacts:所有制品列表及其状态和依赖关系
    • planningHome、changeRoot、artifactPaths 和 actionContext:路径和作用域上下文。使用这些而不是假定仓库本地路径。
  4. 按顺序创建制品,直到可应用就绪

    使用 TodoWrite 工具 跟踪制品进度。

    按依赖顺序循环遍历制品(首先处理无待定依赖的制品):

    a. 对于每个 ready(依赖已满足)的制品:

    • 获取指令:
      openspec instructions <artifact-id> --change "<name>" --json
      
    • 指令 JSON 包括:
      • context:项目背景(对您的约束——不要将其包含在输出中)
      • rules:制品特定规则(对您的约束——不要将其包含在输出中)
      • template:输出文件应使用的结构
      • instruction:此制品类型的 Schema 特定指导
      • resolvedOutputPath:写入制品的已解析路径或模式
      • dependencies:已完成制品的列表,用于读取上下文
    • 读取任何已完成的依赖文件以获取上下文
    • 使用 template 作为结构创建制品文件,并写入 resolvedOutputPath
    • 应用 context 和 rules 作为约束——但不要将它们复制到文件中
    • 显示简要进度:“已创建 ”

    b. 继续直到所有 applyRequires 制品完成

    • 创建每个制品后,重新运行 openspec status --change "<name>" --json
    • 检查 applyRequires 中的每个制品 ID 是否在制品数组中具有 status: "done"
    • 当所有 applyRequires 制品完成时停止

    c. 如果某个制品需要用户输入(上下文不明确):

    • 使用 AskUserQuestion 工具 进行澄清
    • 然后继续创建
  5. 显示最终状态

    openspec status --change "<name>"
    

输出

完成所有制品后,总结:

  • 变更名称和位置
  • 已创建的制品列表及其简要描述
  • 已就绪状态:“所有制品已创建!已准备好实施。”
  • 提示:“运行 /opsx:apply 或让我实施以开始处理任务。”

制品创建指南

  • 遵循 openspec instructions 中每种制品类型的 instruction 字段
  • Schema 定义了每个制品应包含的内容——请遵循它
  • 在创建新制品之前先读取依赖制品以获取上下文
  • 使用 template 作为输出文件的结构——填写其各部分
  • 重要:context 和 rules 是对您的约束,而不是文件的内容
    • 不要将 <context>、<rules>、<project_context> 块复制到制品中
    • 它们指导您编写的内容,但绝不应出现在输出中

防护措施

  • 创建实施所需的全部制品(由 Schema 的 apply.requires 定义)
  • 在创建新制品之前务必先读取依赖制品
  • 如果上下文严重不明确,询问用户——但优先做出合理决策以保持进度
  • 如果同名变更已存在,询问用户是继续还是创建新变更
  • 在继续下一个制品之前,验证每个制品文件是否已成功写入

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

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

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.

相关技能