mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-12 02:37:45 +08:00
- Create task-schema.json (JSON Schema draft-07) with 10 field blocks fusing Unified JSONL, 6-field Task JSON, and Solution Schema advantages - Migrate unified-execute-with-file from JSONL to .task/*.json directory scanning - Migrate 3 producers (lite-plan, plan-converter, collaborative-plan) to .task/*.json multi-file output - Add review-cycle Phase 7.5 export-to-tasks (FIX-*.json) and issue-resolve --export-tasks option - Add schema compatibility annotations to action-planning-agent, workflow-plan, and tdd-plan - Add spec-generator skill phases and templates - Add memory v2 pipeline (consolidation, extraction, job scheduler, embedder) - Add secret-redactor utility and core-memory enhancements - Add codex-lens accuracy benchmarks and staged env config overrides
379 lines
12 KiB
JSON
379 lines
12 KiB
JSON
{
|
||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||
"$id": "task-schema.json",
|
||
"title": "Unified Task JSON Schema",
|
||
"description": "统一任务定义 schema v1.0 — 每个任务一个独立 JSON 文件,自包含所有执行所需信息。融合 Unified JSONL (convergence)、6-field Task JSON (execution_config)、Solution Schema (modification_points) 三者优势。",
|
||
"type": "object",
|
||
"required": ["id", "title", "description", "depends_on", "convergence"],
|
||
|
||
"properties": {
|
||
|
||
"_comment_IDENTITY": "IDENTITY 区块 (必填) — 任务基本信息",
|
||
"id": {
|
||
"type": "string",
|
||
"description": "任务ID,前缀由生产者决定 (TASK-001 / IMPL-001 / L0 / T1 / FIX-001 等)"
|
||
},
|
||
"title": {
|
||
"type": "string",
|
||
"description": "任务标题 (动词+目标,如 'Create unified task schema')"
|
||
},
|
||
"description": {
|
||
"type": "string",
|
||
"description": "目标+原因 (1-3 句,描述做什么和为什么)"
|
||
},
|
||
|
||
"_comment_CLASSIFICATION": "CLASSIFICATION 区块 (可选) — 任务分类",
|
||
"type": {
|
||
"type": "string",
|
||
"enum": ["infrastructure", "feature", "enhancement", "fix", "refactor", "testing", "docs", "chore"],
|
||
"description": "任务类型"
|
||
},
|
||
"priority": {
|
||
"type": "string",
|
||
"enum": ["critical", "high", "medium", "low"],
|
||
"description": "优先级"
|
||
},
|
||
"effort": {
|
||
"type": "string",
|
||
"enum": ["small", "medium", "large"],
|
||
"description": "工作量估算"
|
||
},
|
||
"action": {
|
||
"type": "string",
|
||
"enum": ["Create", "Update", "Implement", "Refactor", "Add", "Delete", "Configure", "Test", "Fix"],
|
||
"description": "操作动作 (便于 issue 系统分类)"
|
||
},
|
||
|
||
"_comment_SCOPE": "SCOPE 区块 (可选) — 覆盖范围",
|
||
"scope": {
|
||
"oneOf": [
|
||
{ "type": "string" },
|
||
{ "type": "array", "items": { "type": "string" } }
|
||
],
|
||
"description": "覆盖范围 (模块路径或功能区域)"
|
||
},
|
||
"excludes": {
|
||
"type": "array",
|
||
"items": { "type": "string" },
|
||
"description": "明确排除的范围"
|
||
},
|
||
"focus_paths": {
|
||
"type": "array",
|
||
"items": { "type": "string" },
|
||
"description": "重点文件/目录路径"
|
||
},
|
||
|
||
"_comment_DEPENDENCIES": "DEPENDENCIES 区块 (必填) — 依赖关系",
|
||
"depends_on": {
|
||
"type": "array",
|
||
"items": { "type": "string" },
|
||
"default": [],
|
||
"description": "依赖任务 ID 列表 (无依赖则 [])"
|
||
},
|
||
"parallel_group": {
|
||
"type": "number",
|
||
"description": "并行分组编号 (同组可并行执行)"
|
||
},
|
||
|
||
"_comment_CONVERGENCE": "CONVERGENCE 区块 (必填) — 完成标准",
|
||
"convergence": {
|
||
"type": "object",
|
||
"required": ["criteria"],
|
||
"properties": {
|
||
"criteria": {
|
||
"type": "array",
|
||
"items": { "type": "string" },
|
||
"minItems": 1,
|
||
"description": "可测试的完成条件 (可写为断言或手动步骤)"
|
||
},
|
||
"verification": {
|
||
"type": "string",
|
||
"description": "可执行的验证步骤 (命令或明确步骤)"
|
||
},
|
||
"definition_of_done": {
|
||
"type": "string",
|
||
"description": "业务语言完成定义 (非技术人员可判断)"
|
||
}
|
||
},
|
||
"additionalProperties": false
|
||
},
|
||
|
||
"_comment_FILES": "FILES 区块 (可选) — 文件级修改点",
|
||
"files": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "object",
|
||
"required": ["path"],
|
||
"properties": {
|
||
"path": {
|
||
"type": "string",
|
||
"description": "文件路径"
|
||
},
|
||
"action": {
|
||
"type": "string",
|
||
"enum": ["modify", "create", "delete"],
|
||
"description": "文件操作类型"
|
||
},
|
||
"target": {
|
||
"type": "string",
|
||
"description": "修改目标 (函数名/类名,来自 Solution Schema)"
|
||
},
|
||
"changes": {
|
||
"type": "array",
|
||
"items": { "type": "string" },
|
||
"description": "修改描述列表"
|
||
},
|
||
"conflict_risk": {
|
||
"type": "string",
|
||
"enum": ["low", "medium", "high"],
|
||
"description": "冲突风险等级"
|
||
}
|
||
},
|
||
"additionalProperties": false
|
||
},
|
||
"description": "涉及文件列表及修改详情"
|
||
},
|
||
|
||
"_comment_IMPLEMENTATION": "IMPLEMENTATION 区块 (可选) — 实施指南",
|
||
"implementation": {
|
||
"type": "array",
|
||
"items": { "type": "string" },
|
||
"description": "步骤化实施指南 (来自 Solution Schema)"
|
||
},
|
||
"test": {
|
||
"type": "object",
|
||
"properties": {
|
||
"commands": {
|
||
"type": "array",
|
||
"items": { "type": "string" },
|
||
"description": "测试命令"
|
||
},
|
||
"unit": {
|
||
"type": "array",
|
||
"items": { "type": "string" },
|
||
"description": "单元测试要求"
|
||
},
|
||
"integration": {
|
||
"type": "array",
|
||
"items": { "type": "string" },
|
||
"description": "集成测试要求"
|
||
},
|
||
"coverage_target": {
|
||
"type": "number",
|
||
"minimum": 0,
|
||
"maximum": 100,
|
||
"description": "覆盖率目标 (%)"
|
||
}
|
||
},
|
||
"additionalProperties": false,
|
||
"description": "测试要求"
|
||
},
|
||
"regression": {
|
||
"type": "array",
|
||
"items": { "type": "string" },
|
||
"description": "回归检查点"
|
||
},
|
||
|
||
"_comment_EXECUTION": "EXECUTION 区块 (可选) — 执行策略",
|
||
"meta": {
|
||
"type": "object",
|
||
"properties": {
|
||
"agent": {
|
||
"type": "string",
|
||
"description": "分配的 agent (@code-developer / @test-fix-agent 等)"
|
||
},
|
||
"module": {
|
||
"type": "string",
|
||
"description": "所属模块 (frontend/backend/shared)"
|
||
},
|
||
"execution_config": {
|
||
"type": "object",
|
||
"properties": {
|
||
"method": {
|
||
"type": "string",
|
||
"enum": ["agent", "cli"],
|
||
"description": "执行方式"
|
||
},
|
||
"cli_tool": {
|
||
"type": "string",
|
||
"enum": ["codex", "gemini", "qwen", "auto"],
|
||
"description": "CLI 工具选择"
|
||
},
|
||
"enable_resume": {
|
||
"type": "boolean",
|
||
"description": "是否启用会话恢复"
|
||
}
|
||
},
|
||
"additionalProperties": false
|
||
}
|
||
},
|
||
"additionalProperties": true,
|
||
"description": "执行元信息"
|
||
},
|
||
"cli_execution": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"description": "CLI 会话 ID (WFS-{session}-TASK-{id})"
|
||
},
|
||
"strategy": {
|
||
"type": "string",
|
||
"enum": ["new", "resume", "fork", "merge_fork"],
|
||
"description": "CLI 执行策略"
|
||
},
|
||
"resume_from": {
|
||
"type": "string",
|
||
"description": "父任务 CLI ID (用于 resume/fork)"
|
||
},
|
||
"merge_from": {
|
||
"type": "array",
|
||
"items": { "type": "string" },
|
||
"description": "合并来源 CLI ID 列表 (用于 merge_fork)"
|
||
}
|
||
},
|
||
"additionalProperties": false,
|
||
"description": "CLI 执行配置"
|
||
},
|
||
|
||
"_comment_CONTEXT": "CONTEXT 区块 (可选) — 来源与上下文",
|
||
"source": {
|
||
"type": "object",
|
||
"properties": {
|
||
"tool": {
|
||
"type": "string",
|
||
"description": "产出工具名 (workflow-plan / lite-plan / issue-resolve / review-cycle 等)"
|
||
},
|
||
"session_id": {
|
||
"type": "string",
|
||
"description": "来源 session ID"
|
||
},
|
||
"original_id": {
|
||
"type": "string",
|
||
"description": "转换前原始 ID"
|
||
},
|
||
"issue_id": {
|
||
"type": "string",
|
||
"description": "关联的 Issue ID"
|
||
}
|
||
},
|
||
"additionalProperties": false,
|
||
"description": "任务来源信息"
|
||
},
|
||
"context_package_path": {
|
||
"type": "string",
|
||
"description": "上下文包路径"
|
||
},
|
||
"evidence": {
|
||
"type": "array",
|
||
"description": "支撑证据"
|
||
},
|
||
"risk_items": {
|
||
"type": "array",
|
||
"items": { "type": "string" },
|
||
"description": "风险项"
|
||
},
|
||
"inputs": {
|
||
"type": "array",
|
||
"items": { "type": "string" },
|
||
"description": "消费的产物 (文件/资源)"
|
||
},
|
||
"outputs": {
|
||
"type": "array",
|
||
"items": { "type": "string" },
|
||
"description": "产出的产物 (文件/资源)"
|
||
},
|
||
"commit": {
|
||
"type": "object",
|
||
"properties": {
|
||
"type": {
|
||
"type": "string",
|
||
"enum": ["feat", "fix", "refactor", "test", "docs", "chore"],
|
||
"description": "提交类型"
|
||
},
|
||
"scope": {
|
||
"type": "string",
|
||
"description": "提交范围"
|
||
},
|
||
"message_template": {
|
||
"type": "string",
|
||
"description": "提交消息模板"
|
||
}
|
||
},
|
||
"additionalProperties": false,
|
||
"description": "提交信息模板"
|
||
},
|
||
|
||
"_comment_RUNTIME": "RUNTIME 区块 (执行时填充) — 运行时状态",
|
||
"status": {
|
||
"type": "string",
|
||
"enum": ["pending", "in_progress", "completed", "failed", "skipped", "blocked"],
|
||
"default": "pending",
|
||
"description": "执行状态 (执行引擎填充)"
|
||
},
|
||
"executed_at": {
|
||
"type": "string",
|
||
"format": "date-time",
|
||
"description": "执行时间戳 (ISO 8601)"
|
||
},
|
||
"result": {
|
||
"type": "object",
|
||
"properties": {
|
||
"success": {
|
||
"type": "boolean",
|
||
"description": "是否成功"
|
||
},
|
||
"files_modified": {
|
||
"type": "array",
|
||
"items": { "type": "string" },
|
||
"description": "修改的文件列表"
|
||
},
|
||
"summary": {
|
||
"type": "string",
|
||
"description": "执行摘要"
|
||
},
|
||
"error": {
|
||
"type": "string",
|
||
"description": "错误信息 (失败时)"
|
||
},
|
||
"convergence_verified": {
|
||
"type": "array",
|
||
"items": { "type": "boolean" },
|
||
"description": "收敛标准验证结果 (对应 convergence.criteria 每项)"
|
||
},
|
||
"commit_hash": {
|
||
"type": "string",
|
||
"description": "提交哈希"
|
||
}
|
||
},
|
||
"additionalProperties": false,
|
||
"description": "执行结果 (执行引擎填充)"
|
||
}
|
||
},
|
||
|
||
"additionalProperties": true,
|
||
|
||
"_field_usage_by_producer": {
|
||
"workflow-plan": "IDENTITY + CLASSIFICATION + SCOPE + DEPENDENCIES + CONVERGENCE + FILES + EXECUTION(meta+cli_execution) + CONTEXT(context_package_path)",
|
||
"lite-plan": "IDENTITY + CLASSIFICATION + DEPENDENCIES + CONVERGENCE + FILES",
|
||
"req-plan": "IDENTITY + CLASSIFICATION + SCOPE + DEPENDENCIES + CONVERGENCE + CONTEXT(inputs/outputs/risk_items)",
|
||
"collaborative-plan": "IDENTITY + CLASSIFICATION + SCOPE + DEPENDENCIES + CONVERGENCE + FILES + CONTEXT(source)",
|
||
"issue-resolve": "IDENTITY + CLASSIFICATION + SCOPE + DEPENDENCIES + CONVERGENCE + FILES(with target) + IMPLEMENTATION + CONTEXT(commit/source)",
|
||
"review-cycle": "IDENTITY + CLASSIFICATION + FILES + CONVERGENCE + IMPLEMENTATION + CONTEXT(source/evidence)",
|
||
"tdd-plan": "IDENTITY + CLASSIFICATION + DEPENDENCIES + CONVERGENCE + EXECUTION + IMPLEMENTATION(test focused)",
|
||
"analyze-brainstorm": "IDENTITY + CLASSIFICATION + DEPENDENCIES + CONVERGENCE + CONTEXT(evidence/source)"
|
||
},
|
||
|
||
"_directory_convention": {
|
||
"standard_path": "{session_folder}/.task/",
|
||
"file_naming": "TASK-{id}.json (或保留原有 ID 前缀: IMPL-, L0-, T1-, FIX-)",
|
||
"examples": {
|
||
"workflow-plan": ".workflow/active/WFS-xxx/.task/IMPL-001.json",
|
||
"lite-plan": ".workflow/.lite-plan/{id}/.task/TASK-001.json",
|
||
"req-plan": ".workflow/.req-plan/RPLAN-{id}/.task/TASK-001.json",
|
||
"collab-plan": ".workflow/.planning/CPLAN-{id}/.task/TASK-001.json",
|
||
"review-cycle": ".workflow/active/WFS-{id}/.review/.task/FIX-001.json",
|
||
"issue-resolve": ".workflow/issues/{issue-id}/.task/TASK-001.json"
|
||
}
|
||
}
|
||
} |