tasks

A command that creates an ordered task list from design documents. The list explains what to build and which tasks depend on others.

In plain words
What is it for?
Reading plan.md and spec.md, optionally using data models, interface contracts, research, and test scenarios to generate tasks.md.
Why use it?
It breaks a feature plan into concrete work items so implementation can follow a clear sequence.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/linfee/spec-kit-cn/tasks
Clone the repo
git clone --depth 1 https://github.com/Linfee/spec-kit-cn
Per session 25 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,551 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00025 $0.02551
Opus 5 $0.00013 $0.01275
Sonnet 5 $0.00005 $0.00510
Haiku 4.5 $0.00003 $0.00255

Measured 3d ago against content hash 541bbc157b67, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

tasks scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

templates/commands/tasks.md · 204 lines

How it starts

The opening of the file, as written. The whole thing — 204 lines — stays where its author put it; the contents beside it link to each section on GitHub.

用户输入

$ARGUMENTS

在继续之前,你必须考虑用户输入(如果不为空)。

执行前检查

检查扩展钩子(任务生成前):

  • 检查项目根目录下是否存在 .specify/extensions.yml
  • 如果存在,读取该文件并查找 hooks.before_tasks 键下的条目
  • 如果 YAML 无法解析或无效,静默跳过钩子检查并正常继续
  • 过滤掉 enabled 显式为 false 的钩子。没有 enabled 字段的钩子默认视为已启用
  • 对于每个剩余的钩子,不要尝试解释或评估钩子的 condition 表达式:
    • 如果钩子没有 condition 字段,或为 null/空,则将钩子视为可执行
    • 如果钩子定义了非空的 condition,则跳过该钩子,将条件评估留给 HookExecutor 实现
  • 对于每个可执行的钩子,根据其 optional 标志输出以下内容:
    • 可选钩子 (optional: true):
      ## 扩展钩子
      
      **可选前置钩子**: {extension}
      命令: `/{command}`
      描述: {description}
      
      提示: {prompt}
      执行方式: `/{command}`
      
    • 必选钩子 (optional: false):
      ## 扩展钩子
      
      **自动前置钩子**: {extension}
      正在执行: `/{command}`
      EXECUTE_COMMAND: {command}
      
      等待钩子命令的结果后再继续执行大纲。
      
  • 如果没有注册钩子或 .specify/extensions.yml 不存在,静默跳过

大纲

  1. 设置: 从仓库根目录运行 {SCRIPT} 并解析 FEATURE_DIR 和 AVAILABLE_DOCS 列表。所有路径必须是绝对路径。对于参数中的单引号(如 "I'm Groot"),使用转义语法: 例如 'I'''m Groot'(或尽可能使用双引号: "I'm Groot")。

  2. 加载设计文档: 从 FEATURE_DIR 读取:

    • 必需: plan.md(技术栈、库、结构),spec.md(带优先级的用户故事)
    • 可选: data-model.md(实体),contracts/(接口契约),research.md(决策),quickstart.md(测试场景)
    • 注意: 不是所有项目都有所有文档。根据可用的文档生成任务。
  3. 执行任务生成工作流:

    • 加载 plan.md 并提取技术栈、库、项目结构
    • 加载 spec.md 并提取用户故事及其优先级(P1, P2, P3 等)
    • 如果存在 data-model.md: 提取实体并映射到用户故事
    • 如果存在 contracts/: 将接口契约映射到用户故事
    • 如果存在 research.md: 提取用于设置任务的决策
    • 按用户故事组织任务生成(见下方任务生成规则)
    • 生成依赖关系图,显示用户故事完成顺序
    • 为每个用户故事创建并行执行示例
    • 验证任务完整性(每个用户故事都有所需的所有任务,可独立测试)
  4. 生成 tasks.md: 使用 templates/tasks-template.md 作为结构,填充以下内容:

    • 从 plan.md 获取正确的功能名称
    • Phase 1: 设置任务(项目初始化)
    • Phase 2: 基础任务(所有用户故事的阻塞性前置条件)
    • Phase 3+: 每个用户故事一个阶段(按 spec.md 中的优先级顺序)
    • 每个阶段包括: 故事目标、独立测试标准、测试(如有请求)、实现任务
    • 最终阶段: 收尾与横切关注点
    • 所有任务必须遵循严格的清单格式(见下方任务生成规则)
    • 每个任务的清晰文件路径
    • 显示故事完成顺序的依赖关系部分
    • 每个故事的并行执行示例
    • 实现策略部分(MVP 优先,增量交付)
  5. 报告: 输出生成的 tasks.md 路径和摘要:

    • 总任务数
    • 每个用户故事的任务数
    • 识别出的并行执行机会
    • 每个故事的独立测试标准
    • 建议的 MVP 范围(通常仅用户故事 1)
    • 格式验证: 确认所有任务都遵循清单格式(复选框、ID、标签、文件路径)

Read the full file on GitHub · 204 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 204 lines · 25 tokens per session scan A 541bbc157b67

Subscribe to this mod's changes

tasks is a command published in the GitHub repository Linfee/spec-kit-cn (695 stars, last pushed 1mo ago), licensed MIT. It adds 25 tokens to every session and 2,551 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.