agentleFS
charliehzmcharliehzm/medharness/.claude/skills/task-decomposition/SKILL.md

task-decomposition

Skill86 starsChanged 7 months agoApache-2.0View on GitHub

Use this skill at Step 4 of the v2 SOP to decompose an OpenSpec change's tasks.md into atomic, prioritized, single-document, ≤2-file-change tasks. Enforces strict separation of frontend vs backend tracks, Chinese naming for task documents, and explicit dependency order. Each task gets its own task document under tasks/, referenced from tasks.md. Chinese trigger examples: "任务拆解", "Step 4", "拆任务", "task 拆分", "前后端分离任务". Do NOT use before openspec-continue-change finalizes specs, do NOT bundle ≥3 files per task. Success = every task ≤ 2 files, every task has its own document, ordering reflects priority + dependency, frontend / backend tracks are separated.

14 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use git-workflow.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • Microsoft AzureSkill

    git-workflow

    Squad branching model: dev-first workflow with insiders preview channel

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 13 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Write tasks.md index linking to each.

    line 78

“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Task Decomposition

Translates an implementation-ready change into a queue of bite-sized tasks.

The canonical prompt (verbatim from v1 SOP)

将所有任务进行拆分,其中前端与后端任务要分开,每个任务不超过 2 个文件的改动,每个任务单独任务文档,任务按照优先级排序,任务文档名称和文件夹名称尽可能用中文。

Why these constraints

ConstraintWhy
≤ 2 filesForces tight blast radius; Agent stays focused; reviews are easy.
One doc per taskAudit / trace / parallel review without merge conflicts.
Chinese namesProject policy; improves PM legibility.
FE/BE separationDifferent reviewers; different risk profiles; cleaner deploys.
Priority orderFirst task to clear must unlock the most downstream value.

Output structure

openspec/changes/<slug>/
├── tasks.md                    # index, ordered list with links + status checkboxes
└── tasks/
    ├── 后端-01-用户匹配引擎雏形.md
    ├── 后端-02-匹配规则配置层.md
    ├── 前端-01-匹配结果展示页.md
    └── ...

Each task document:

# 后端-01 · 用户匹配引擎雏形

- **状态**: [ ] 未开始 / [x] 已完成
- **优先级**: P0
- **依赖**: -
- **预计文件**:
  - backend/match/engine.py (new)
  - backend/match/__init__.py (edit)
- **Spec 引用**: S1-match-engine
- **验收**: <criteria>
- **风险**: <if any>

Workflow

  1. Walk specs/* — derive 1-N tasks per spec.
  2. Classify each task as Frontend / Backend / Both (Both is rare; usually splits into two tasks).
  3. Estimate files touched — if > 2, split further.
  4. Order by P0 → P3.
  5. Write per-task documents.
  6. Write tasks.md index linking to each.

Common failure modes

  1. Mega-task with 5 files — "refactor + add" combo. Mitigation: hard limit, refuse to write a task with > 2 files.
  2. No priority — "all P0". Mitigation: enforce at most 30% P0 of total.
  3. Cross-track dependency — frontend task waits on backend task, no annotation. Mitigation: dependencies field is required.
  4. English-only naming — "task-001-match-engine". Mitigation: project policy is Chinese; apply unless team agrees otherwise.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.