@michaelxwb/code-flow 0.6.4 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -3
- package/docs/USAGE.md +1529 -0
- package/docs/acceptance-contract.md +217 -0
- package/docs/ci/acceptance-evidence.md +77 -0
- package/docs/migrations/runtime-0.7.0.md +41 -0
- package/docs/migrations/runtime-0.8.0.md +154 -0
- package/docs/migrations/runtime-0.9.0.md +40 -0
- package/docs/spec-injection-hardening.md +54 -0
- package/docs/spec-injection-performance.json +73 -0
- package/docs/spec-optimization.md +12 -0
- package/package.json +18 -3
- package/src/adapters/claude/CLAUDE.md +1 -1
- package/src/adapters/claude/commands/cf-init.md +1 -3
- package/src/adapters/claude/commands/cf-spec.md +23 -3
- package/src/adapters/claude/commands/cf-stats.md +11 -1
- package/src/adapters/claude/commands/cf-sync.md +20 -6
- package/src/adapters/claude/commands/cf-task/align.md +25 -3
- package/src/adapters/claude/commands/cf-task/archive.md +36 -40
- package/src/adapters/claude/commands/cf-task/block.md +15 -2
- package/src/adapters/claude/commands/cf-task/graph.md +13 -1
- package/src/adapters/claude/commands/cf-task/note.md +13 -1
- package/src/adapters/claude/commands/cf-task/plan.md +137 -23
- package/src/adapters/claude/commands/cf-task/prd.md +13 -2
- package/src/adapters/claude/commands/cf-task/start.md +67 -35
- package/src/adapters/claude/commands/cf-task/status.md +12 -0
- package/src/adapters/claude/commands/cf-task/verify-e2e.md +72 -34
- package/src/adapters/claude/commands/cf-validate.md +30 -5
- package/src/adapters/codex/AGENTS.md +1 -1
- package/src/adapters/codex/hooks.json +14 -10
- package/src/adapters/codex/skills/cf-init/SKILL.md +4 -4
- package/src/adapters/codex/skills/cf-spec/SKILL.md +34 -6
- package/src/adapters/codex/skills/cf-stats/SKILL.md +11 -1
- package/src/adapters/codex/skills/cf-sync/SKILL.md +21 -6
- package/src/adapters/codex/skills/cf-task-align/SKILL.md +30 -8
- package/src/adapters/codex/skills/cf-task-archive/SKILL.md +36 -40
- package/src/adapters/codex/skills/cf-task-block/SKILL.md +15 -2
- package/src/adapters/codex/skills/cf-task-graph/SKILL.md +13 -1
- package/src/adapters/codex/skills/cf-task-note/SKILL.md +13 -1
- package/src/adapters/codex/skills/cf-task-plan/SKILL.md +175 -21
- package/src/adapters/codex/skills/cf-task-prd/SKILL.md +13 -2
- package/src/adapters/codex/skills/cf-task-start/SKILL.md +67 -35
- package/src/adapters/codex/skills/cf-task-status/SKILL.md +12 -0
- package/src/adapters/codex/skills/cf-task-verify-e2e/SKILL.md +73 -34
- package/src/adapters/codex/skills/cf-validate/SKILL.md +31 -5
- package/src/adapters/commands.json +115 -0
- package/src/adapters/costrict/CLAUDE.md +1 -1
- package/src/adapters/costrict/commands/cf-init.md +1 -3
- package/src/adapters/costrict/commands/cf-spec.md +23 -3
- package/src/adapters/costrict/commands/cf-stats.md +11 -1
- package/src/adapters/costrict/commands/cf-sync.md +20 -6
- package/src/adapters/costrict/commands/cf-task/align.md +25 -3
- package/src/adapters/costrict/commands/cf-task/archive.md +36 -40
- package/src/adapters/costrict/commands/cf-task/block.md +15 -2
- package/src/adapters/costrict/commands/cf-task/graph.md +13 -1
- package/src/adapters/costrict/commands/cf-task/note.md +13 -1
- package/src/adapters/costrict/commands/cf-task/plan.md +137 -23
- package/src/adapters/costrict/commands/cf-task/prd.md +13 -2
- package/src/adapters/costrict/commands/cf-task/start.md +67 -35
- package/src/adapters/costrict/commands/cf-task/status.md +12 -0
- package/src/adapters/costrict/commands/cf-task/verify-e2e.md +72 -34
- package/src/adapters/costrict/commands/cf-validate.md +30 -5
- package/src/adapters/install-plan.json +100 -0
- package/src/adapters/opencode/AGENTS.md +1 -1
- package/src/adapters/opencode/commands/cf-init.md +7 -7
- package/src/adapters/opencode/commands/cf-learn.md +6 -6
- package/src/adapters/opencode/commands/cf-spec.md +34 -2
- package/src/adapters/opencode/commands/cf-stats.md +17 -7
- package/src/adapters/opencode/commands/cf-sync.md +21 -6
- package/src/adapters/opencode/commands/cf-task/align.md +25 -8
- package/src/adapters/opencode/commands/cf-task/archive.md +36 -40
- package/src/adapters/opencode/commands/cf-task/block.md +16 -2
- package/src/adapters/opencode/commands/cf-task/graph.md +14 -1
- package/src/adapters/opencode/commands/cf-task/note.md +14 -1
- package/src/adapters/opencode/commands/cf-task/plan.md +137 -23
- package/src/adapters/opencode/commands/cf-task/prd.md +13 -2
- package/src/adapters/opencode/commands/cf-task/start.md +68 -41
- package/src/adapters/opencode/commands/cf-task/status.md +13 -0
- package/src/adapters/opencode/commands/cf-task/verify-e2e.md +72 -34
- package/src/adapters/opencode/commands/cf-validate.md +35 -9
- package/src/adapters/opencode/plugins/code-flow/index.js +128 -179
- package/src/adapters/platform-bindings.json +370 -0
- package/src/cli.js +369 -316
- package/src/core/code-flow/config.yml +4 -1
- package/src/core/code-flow/runtime-commands.json +259 -0
- package/src/core/code-flow/scripts/cf_acceptance_manifest.py +5 -289
- package/src/core/code-flow/scripts/cf_acceptance_runner.py +5 -187
- package/src/core/code-flow/scripts/cf_audit.py +10 -0
- package/src/core/code-flow/scripts/cf_codex_hook.py +10 -0
- package/src/core/code-flow/scripts/cf_design_lint.py +10 -0
- package/src/core/code-flow/scripts/cf_evidence_import.py +10 -0
- package/src/core/code-flow/scripts/cf_feedback.py +5 -51
- package/src/core/code-flow/scripts/cf_opencode_event.py +10 -0
- package/src/core/code-flow/scripts/cf_post_hook.py +6 -191
- package/src/core/code-flow/scripts/cf_pre_tool_hook.py +6 -99
- package/src/core/code-flow/scripts/cf_scenarios.py +10 -0
- package/src/core/code-flow/scripts/cf_spec_context.py +5 -1714
- package/src/core/code-flow/scripts/cf_spec_gate.py +5 -257
- package/src/core/code-flow/scripts/cf_spec_session.py +5 -114
- package/src/core/code-flow/scripts/cf_stats.py +5 -501
- package/src/core/code-flow/scripts/cf_stop_hook.py +6 -376
- package/src/core/code-flow/scripts/cf_sync.py +5 -135
- package/src/core/code-flow/scripts/cf_task_index.py +5 -143
- package/src/core/code-flow/scripts/cf_task_parallel.py +5 -380
- package/src/core/code-flow/scripts/cf_task_workflow.py +6 -103
- package/src/core/code-flow/scripts/cf_user_prompt_hook.py +6 -173
- package/src/core/code-flow/scripts/cf_validation.py +6 -77
- package/src/core/code-flow/scripts/codeflow/__init__.py +0 -0
- package/src/core/code-flow/scripts/codeflow/acceptance/__init__.py +0 -0
- package/src/core/code-flow/scripts/codeflow/acceptance/cf_acceptance_evidence.py +347 -0
- package/src/core/code-flow/scripts/codeflow/acceptance/cf_acceptance_manifest_core.py +660 -0
- package/src/core/code-flow/scripts/codeflow/acceptance/cf_acceptance_plan.py +202 -0
- package/src/core/code-flow/scripts/codeflow/acceptance/cf_acceptance_registration.py +60 -0
- package/src/core/code-flow/scripts/codeflow/acceptance/cf_acceptance_risk.py +73 -0
- package/src/core/code-flow/scripts/codeflow/acceptance/cf_acceptance_schema.py +282 -0
- package/src/core/code-flow/scripts/codeflow/acceptance/cf_acceptance_selection.py +266 -0
- package/src/core/code-flow/scripts/codeflow/acceptance/cf_check_inputs.py +172 -0
- package/src/core/code-flow/scripts/codeflow/acceptance/cf_check_registration.py +326 -0
- package/src/core/code-flow/scripts/{cf_checks.py → codeflow/acceptance/cf_checks.py} +8 -11
- package/src/core/code-flow/scripts/codeflow/acceptance/cf_plan_quality.py +197 -0
- package/src/core/code-flow/scripts/codeflow/acceptance/cf_scenario_quality.py +174 -0
- package/src/core/code-flow/scripts/codeflow/acceptance/cf_scenario_source.py +300 -0
- package/src/core/code-flow/scripts/codeflow/acceptance/cf_traceability.py +502 -0
- package/src/core/code-flow/scripts/codeflow/cli/__init__.py +0 -0
- package/src/core/code-flow/scripts/codeflow/cli/cf_acceptance_manifest.py +347 -0
- package/src/core/code-flow/scripts/codeflow/cli/cf_acceptance_runner.py +1490 -0
- package/src/core/code-flow/scripts/codeflow/cli/cf_audit.py +533 -0
- package/src/core/code-flow/scripts/codeflow/cli/cf_design_lint.py +172 -0
- package/src/core/code-flow/scripts/codeflow/cli/cf_evidence_import.py +607 -0
- package/src/core/code-flow/scripts/codeflow/cli/cf_feedback.py +53 -0
- package/src/core/code-flow/scripts/codeflow/cli/cf_scenarios.py +58 -0
- package/src/core/code-flow/scripts/codeflow/cli/cf_spec_context.py +1175 -0
- package/src/core/code-flow/scripts/codeflow/cli/cf_spec_gate.py +60 -0
- package/src/core/code-flow/scripts/codeflow/cli/cf_spec_session.py +46 -0
- package/src/core/code-flow/scripts/codeflow/cli/cf_stats.py +540 -0
- package/src/core/code-flow/scripts/codeflow/cli/cf_sync.py +144 -0
- package/src/core/code-flow/scripts/codeflow/cli/cf_task_index.py +177 -0
- package/src/core/code-flow/scripts/codeflow/cli/cf_task_parallel.py +1142 -0
- package/src/core/code-flow/scripts/codeflow/cli/cf_task_workflow.py +742 -0
- package/src/core/code-flow/scripts/codeflow/cli/cf_validation.py +31 -0
- package/src/core/code-flow/scripts/codeflow/core/__init__.py +0 -0
- package/src/core/code-flow/scripts/codeflow/core/cf_context_cache.py +67 -0
- package/src/core/code-flow/scripts/{cf_core.py → codeflow/core/cf_core.py} +119 -297
- package/src/core/code-flow/scripts/codeflow/core/cf_exec_base.py +325 -0
- package/src/core/code-flow/scripts/codeflow/core/cf_fs.py +57 -0
- package/src/core/code-flow/scripts/codeflow/core/cf_git.py +92 -0
- package/src/core/code-flow/scripts/{cf_log.py → codeflow/core/cf_log.py} +13 -7
- package/src/core/code-flow/scripts/codeflow/core/cf_markdown.py +77 -0
- package/src/core/code-flow/scripts/codeflow/core/cf_native_paths.py +26 -0
- package/src/core/code-flow/scripts/codeflow/core/cf_patch.py +33 -0
- package/src/core/code-flow/scripts/codeflow/core/cf_runtime_install.py +32 -0
- package/src/core/code-flow/scripts/codeflow/core/cf_stop_guard.py +53 -0
- package/src/core/code-flow/scripts/codeflow/core/cf_task_state.py +9 -0
- package/src/core/code-flow/scripts/codeflow/core/cf_validators.py +408 -0
- package/src/core/code-flow/scripts/codeflow/core/cf_worktree_env.py +253 -0
- package/src/core/code-flow/scripts/codeflow/evidence/__init__.py +0 -0
- package/src/core/code-flow/scripts/codeflow/evidence/cf_evidence_store.py +527 -0
- package/src/core/code-flow/scripts/codeflow/hooks/__init__.py +0 -0
- package/src/core/code-flow/scripts/codeflow/hooks/cf_codex_hook.py +95 -0
- package/src/core/code-flow/scripts/codeflow/hooks/cf_opencode_event.py +98 -0
- package/src/core/code-flow/scripts/codeflow/hooks/cf_post_hook.py +30 -0
- package/src/core/code-flow/scripts/codeflow/hooks/cf_pre_tool_hook.py +41 -0
- package/src/core/code-flow/scripts/codeflow/hooks/cf_stop_hook.py +292 -0
- package/src/core/code-flow/scripts/codeflow/hooks/cf_user_prompt_hook.py +161 -0
- package/src/core/code-flow/scripts/codeflow/spec/__init__.py +0 -0
- package/src/core/code-flow/scripts/codeflow/spec/cf_active_task.py +412 -0
- package/src/core/code-flow/scripts/codeflow/spec/cf_context_refresh.py +301 -0
- package/src/core/code-flow/scripts/codeflow/spec/cf_edit_service.py +149 -0
- package/src/core/code-flow/scripts/codeflow/spec/cf_injection.py +111 -0
- package/src/core/code-flow/scripts/codeflow/spec/cf_rule_readiness.py +114 -0
- package/src/core/code-flow/scripts/{cf_scan.py → codeflow/spec/cf_scan.py} +93 -21
- package/src/core/code-flow/scripts/codeflow/spec/cf_spec_budget.py +55 -0
- package/src/core/code-flow/scripts/codeflow/spec/cf_spec_context_model.py +477 -0
- package/src/core/code-flow/scripts/codeflow/spec/cf_spec_impact.py +119 -0
- package/src/core/code-flow/scripts/{cf_spec_metadata.py → codeflow/spec/cf_spec_metadata.py} +37 -3
- package/src/core/code-flow/scripts/{cf_spec_migrate.py → codeflow/spec/cf_spec_migrate.py} +27 -10
- package/src/core/code-flow/scripts/codeflow/spec/cf_spec_optimize.py +193 -0
- package/src/core/code-flow/scripts/codeflow/spec/cf_spec_optimize_apply.py +187 -0
- package/src/core/code-flow/scripts/{cf_spec_resolver.py → codeflow/spec/cf_spec_resolver.py} +39 -17
- package/src/core/code-flow/scripts/{cf_spec_router.py → codeflow/spec/cf_spec_router.py} +96 -36
- package/src/core/code-flow/scripts/{cf_spec_verify.py → codeflow/spec/cf_spec_verify.py} +252 -26
- package/src/core/code-flow/scripts/codeflow/spec/cf_stage_gate.py +330 -0
- package/src/core/code-flow/scripts/codeflow/spec/cf_task_projection.py +83 -0
- package/src/core/code-flow/scripts/codeflow/spec/cf_workflow_service.py +755 -0
- package/src/core/code-flow/scripts/{cf_workflow_transaction.py → codeflow/spec/cf_workflow_transaction.py} +29 -15
- package/src/core/code-flow/scripts/codeflow/task/__init__.py +0 -0
- package/src/core/code-flow/scripts/codeflow/task/cf_requirement_verification.py +867 -0
- package/src/core/code-flow/scripts/codeflow/task/cf_task_doc.py +178 -0
- package/src/core/code-flow/scripts/codeflow/task/cf_task_merge.py +635 -0
- package/src/core/code-flow/scripts/codeflow/task/cf_task_plan.py +251 -0
- package/src/core/code-flow/scripts/codeflow/task/cf_task_runtime.py +570 -0
- package/src/core/code-flow/scripts/codeflow/task/cf_validation_service.py +73 -0
- package/src/core/code-flow/scripts/runtime-resources.json +29 -0
- package/src/core/code-flow/specs/shared/design/design-frontend.md +18 -15
- package/src/core/code-flow/specs/shared/design/design-full.md +33 -23
- package/src/core/code-flow/specs/shared/design/design-lite.md +23 -13
- package/src/core/code-flow/specs/shared/scenarios-template.md +55 -0
- package/src/core/code-flow/validation.yml +9 -3
- package/src/migrate/runtime.js +213 -0
- package/src/migrate/spec-workflow.js +16 -1
- package/src/runtime.js +219 -0
- package/src/core/code-flow/scripts/cf_acceptance_evidence.py +0 -100
- package/src/core/code-flow/scripts/cf_acceptance_schema.py +0 -83
- package/src/core/code-flow/scripts/cf_exec_base.py +0 -112
- package/src/core/code-flow/scripts/cf_task_runtime.py +0 -299
- package/src/core/code-flow/scripts/cf_task_state.py +0 -3
- package/src/core/code-flow/scripts/cf_workflow_service.py +0 -366
- /package/src/core/code-flow/scripts/{cf_session_state.py → codeflow/core/cf_session_state.py} +0 -0
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"canonical_platform": "claude",
|
|
4
|
+
"platforms": {
|
|
5
|
+
"costrict": {
|
|
6
|
+
"area": "commands",
|
|
7
|
+
"replacements": [
|
|
8
|
+
[
|
|
9
|
+
"--platform=claude",
|
|
10
|
+
"--platform=costrict"
|
|
11
|
+
],
|
|
12
|
+
[
|
|
13
|
+
".claude/settings.local.json",
|
|
14
|
+
".costrict/settings.local.json"
|
|
15
|
+
]
|
|
16
|
+
],
|
|
17
|
+
"commands": {}
|
|
18
|
+
},
|
|
19
|
+
"opencode": {
|
|
20
|
+
"area": "commands",
|
|
21
|
+
"replacements": [
|
|
22
|
+
[
|
|
23
|
+
"/project:",
|
|
24
|
+
"/"
|
|
25
|
+
],
|
|
26
|
+
[
|
|
27
|
+
"--platform=claude",
|
|
28
|
+
"--platform=opencode"
|
|
29
|
+
],
|
|
30
|
+
[
|
|
31
|
+
"CLAUDE.md",
|
|
32
|
+
"AGENTS.md"
|
|
33
|
+
]
|
|
34
|
+
],
|
|
35
|
+
"commands": {
|
|
36
|
+
"cf-init": {
|
|
37
|
+
"description": "一键初始化项目规范体系,检测技术栈,生成 spec 模板和配置",
|
|
38
|
+
"afterFrontmatterBlankLines": 1,
|
|
39
|
+
"sectionReplacement": {
|
|
40
|
+
"heading": "### 6. 生成 .claude/settings.local.json Hook 配置",
|
|
41
|
+
"replacement": "### 6. 生成 OpenCode 插件配置\n\nOpenCode v2 会自动加载 `.opencode/plugins/` 下的插件目录,无需在 `opencode.json` 中声明。\n检查 `opencode.json` 是否存在。如果不存在,创建:\n\n```json\n{\n \"$schema\": \"https://opencode.ai/config.json\"\n}\n```\n\n如果 `opencode.json` 已存在,只做 v1→v2 迁移,保留用户已有配置:\n- 删除遗留的顶层 `plugin` 键(v1 写法,如 `\".opencode/plugins/code-flow\"`);其中非本地的用户条目搬入 `plugins`。\n- 不要向 `plugins` 写入 `.opencode/plugins/code-flow`(自动发现已覆盖,显式声明会导致重复加载或包解析告警)。\n\n确保 `.opencode/plugins/code-flow/` 已存在且为 v2 形态(默认导出 `{ id: \"code-flow\", setup }`,不依赖 `@opencode/plugin` 包),\n注册 `session.prompt` / `tool.execute.before` / `tool.execute.after` / `session.context` hooks,并通过 `event.subscribe` 订阅 `session.idle` 和 `session.deleted`。\n插件直接调用原生 RPC 入口 `cf_opencode_event.py`,使用 OpenCode 的 sessionID、input.path 和 input.patchText,经 context hook 注入 specs。\n\n"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"cf-learn": {
|
|
45
|
+
"description": "自动扫描项目代码,提取编码约束和团队规范,更新 spec 文件",
|
|
46
|
+
"afterFrontmatterBlankLines": 1
|
|
47
|
+
},
|
|
48
|
+
"cf-spec": {
|
|
49
|
+
"description": "管理 Spec Context、漂移恢复与一次性迁移",
|
|
50
|
+
"afterFrontmatterBlankLines": 1
|
|
51
|
+
},
|
|
52
|
+
"cf-stats": {
|
|
53
|
+
"description": "统计规范体系的 token 使用情况",
|
|
54
|
+
"afterFrontmatterBlankLines": 1
|
|
55
|
+
},
|
|
56
|
+
"cf-task-prd": {
|
|
57
|
+
"description": "从一句话需求出发产生产品需求文档(PRD)",
|
|
58
|
+
"afterFrontmatterBlankLines": 2
|
|
59
|
+
},
|
|
60
|
+
"cf-task-status": {
|
|
61
|
+
"description": "显示任务状态总览",
|
|
62
|
+
"afterFrontmatterBlankLines": 1,
|
|
63
|
+
"blankAfterTitle": 1
|
|
64
|
+
},
|
|
65
|
+
"cf-task-archive": {
|
|
66
|
+
"description": "归档已完成的 task 文件",
|
|
67
|
+
"afterFrontmatterBlankLines": 2
|
|
68
|
+
},
|
|
69
|
+
"cf-task-note": {
|
|
70
|
+
"description": "讨论文件中的 #NOTES 标记,对齐最优解后沉淀回原文",
|
|
71
|
+
"afterFrontmatterBlankLines": 1,
|
|
72
|
+
"blankAfterTitle": 1
|
|
73
|
+
},
|
|
74
|
+
"cf-task-block": {
|
|
75
|
+
"description": "标记子任务为阻塞状态",
|
|
76
|
+
"afterFrontmatterBlankLines": 1,
|
|
77
|
+
"blankAfterTitle": 1
|
|
78
|
+
},
|
|
79
|
+
"cf-task-graph": {
|
|
80
|
+
"description": "可视化子任务依赖关系 DAG",
|
|
81
|
+
"afterFrontmatterBlankLines": 1,
|
|
82
|
+
"blankAfterTitle": 1
|
|
83
|
+
},
|
|
84
|
+
"cf-validate": {
|
|
85
|
+
"description": "根据变更文件自动匹配并执行验证规则",
|
|
86
|
+
"afterFrontmatterBlankLines": 2
|
|
87
|
+
},
|
|
88
|
+
"cf-sync": {
|
|
89
|
+
"description": "双副本同步:检查漂移并一键部署 canonical 源",
|
|
90
|
+
"afterFrontmatterBlankLines": 1,
|
|
91
|
+
"blankAfterTitle": 1
|
|
92
|
+
},
|
|
93
|
+
"cf-task-align": {},
|
|
94
|
+
"cf-task-plan": {},
|
|
95
|
+
"cf-task-start": {},
|
|
96
|
+
"cf-task-verify-e2e": {}
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"codex": {
|
|
100
|
+
"area": "skills",
|
|
101
|
+
"replacements": [
|
|
102
|
+
[
|
|
103
|
+
"/project:cf-task:",
|
|
104
|
+
"cf-task-"
|
|
105
|
+
],
|
|
106
|
+
[
|
|
107
|
+
"/project:cf-",
|
|
108
|
+
"cf-"
|
|
109
|
+
],
|
|
110
|
+
[
|
|
111
|
+
"/cf-task:",
|
|
112
|
+
"cf-task-"
|
|
113
|
+
],
|
|
114
|
+
[
|
|
115
|
+
"cf-task:",
|
|
116
|
+
"cf-task-"
|
|
117
|
+
],
|
|
118
|
+
[
|
|
119
|
+
"/cf-",
|
|
120
|
+
"cf-"
|
|
121
|
+
],
|
|
122
|
+
[
|
|
123
|
+
"CLAUDE.md",
|
|
124
|
+
"AGENTS.md"
|
|
125
|
+
],
|
|
126
|
+
[
|
|
127
|
+
"--platform=claude",
|
|
128
|
+
"--platform=codex"
|
|
129
|
+
],
|
|
130
|
+
[
|
|
131
|
+
"用 Read 工具按行号范围回读",
|
|
132
|
+
"按按行号范围回读"
|
|
133
|
+
],
|
|
134
|
+
[
|
|
135
|
+
"用 Read 按行号范围读取",
|
|
136
|
+
"按行号范围读取"
|
|
137
|
+
],
|
|
138
|
+
[
|
|
139
|
+
"用 Read 加载",
|
|
140
|
+
"读取"
|
|
141
|
+
],
|
|
142
|
+
[
|
|
143
|
+
"用 Read 读取",
|
|
144
|
+
"读取"
|
|
145
|
+
],
|
|
146
|
+
[
|
|
147
|
+
"用 Glob/Read 扫描",
|
|
148
|
+
"用 `rg --files` 或 `find` 扫描"
|
|
149
|
+
],
|
|
150
|
+
[
|
|
151
|
+
"用 Glob 搜索",
|
|
152
|
+
"用 `rg --files` 或 `find` 搜索"
|
|
153
|
+
],
|
|
154
|
+
[
|
|
155
|
+
"用 Glob 检查",
|
|
156
|
+
"用 `rg --files` 检查"
|
|
157
|
+
],
|
|
158
|
+
[
|
|
159
|
+
"用 Glob 扫描",
|
|
160
|
+
"用 `rg --files` 扫描"
|
|
161
|
+
],
|
|
162
|
+
[
|
|
163
|
+
"用 Glob 定位",
|
|
164
|
+
"用 `rg --files` 或 `find` 定位"
|
|
165
|
+
],
|
|
166
|
+
[
|
|
167
|
+
"指定文件:Glob 定位后 Read",
|
|
168
|
+
"指定文件:用 `rg --files` 或 `find` 定位后读取"
|
|
169
|
+
],
|
|
170
|
+
[
|
|
171
|
+
"全部文件:Glob ",
|
|
172
|
+
"全部文件:用 `rg --files` 或 `find` 搜索 "
|
|
173
|
+
],
|
|
174
|
+
[
|
|
175
|
+
"如 Glob 搜索现有",
|
|
176
|
+
"如用 `rg` 搜索现有"
|
|
177
|
+
],
|
|
178
|
+
[
|
|
179
|
+
"Read 读取",
|
|
180
|
+
"读取"
|
|
181
|
+
],
|
|
182
|
+
[
|
|
183
|
+
"Read PRD",
|
|
184
|
+
"读取 PRD"
|
|
185
|
+
],
|
|
186
|
+
[
|
|
187
|
+
"Read 作为参考材料",
|
|
188
|
+
"读取 作为参考材料"
|
|
189
|
+
],
|
|
190
|
+
[
|
|
191
|
+
"逐个 Read",
|
|
192
|
+
"逐个读取"
|
|
193
|
+
],
|
|
194
|
+
[
|
|
195
|
+
"用 Bash 执行",
|
|
196
|
+
"用 shell 命令执行"
|
|
197
|
+
],
|
|
198
|
+
[
|
|
199
|
+
"用 Write 写入 `.code-flow/tasks",
|
|
200
|
+
"用 apply_patch 写入 `.code-flow/tasks"
|
|
201
|
+
],
|
|
202
|
+
[
|
|
203
|
+
"用 Write 写入",
|
|
204
|
+
"写入"
|
|
205
|
+
],
|
|
206
|
+
[
|
|
207
|
+
"用 Edit ",
|
|
208
|
+
"用 apply_patch "
|
|
209
|
+
],
|
|
210
|
+
[
|
|
211
|
+
"**Edit 边界约束",
|
|
212
|
+
"**apply_patch 边界约束"
|
|
213
|
+
],
|
|
214
|
+
[
|
|
215
|
+
"追加到目标文件的相近章节:",
|
|
216
|
+
"用 `apply_patch` 追加到目标文件的相近章节:"
|
|
217
|
+
],
|
|
218
|
+
[
|
|
219
|
+
"Read",
|
|
220
|
+
"读取"
|
|
221
|
+
]
|
|
222
|
+
],
|
|
223
|
+
"commands": {
|
|
224
|
+
"cf-init": {
|
|
225
|
+
"description": "Initialize the code-flow spec system in a project. Use when setting up .code-flow/ directory, generating spec files, configuring Codex hooks (.codex/hooks.json), creating AGENTS.md, or bootstrapping coding standards for a new or existing project.",
|
|
226
|
+
"sectionReplacement": {
|
|
227
|
+
"heading": "### 6. 生成 .claude/settings.local.json Hook 配置",
|
|
228
|
+
"replacement": "### 6. 生成 .codex/hooks.json 和 .codex/config.toml\n\n安装 Hook 和配置必须执行 `code-flow init --platform=codex`,由适配器模板统一生成/合并,保留用户配置。`PreToolUse`、`PostToolUse`、`UserPromptSubmit`、`Stop` 四个事件调用 `cf_codex_hook.py`,配置启用 `[features] hooks = true`,保留用户模型、sandbox、approval 设置,不得整文件覆盖;写文件 matcher 为 `^apply_patch$`,输入来自 `tool_input.command`、`cwd`、`session_id`。不得手工拼装或修改受管理 Hook。\n\n旧安装或清单校验失败时执行 `code-flow migrate --runtime --dry-run` 查看范围,再执行 `code-flow migrate --runtime --apply` 更新全部已安装平台。\n\nCodex 会要求 review/trust 非 managed command hooks。生成或更新 hook 后,提醒用户在 Codex CLI 中运行 `/hooks` 并信任 code-flow hooks。\n\n"
|
|
229
|
+
},
|
|
230
|
+
"appendix": "\n安装产物由 `code-flow init --platform=codex` 统一部署。脚本、Skill、Hook 的完整性由安装清单校验;损坏时执行 `code-flow migrate --runtime --dry-run` 查看修复范围,再执行 `code-flow migrate --runtime --apply`。不得凭技能名猜 Python 脚本入口。\n"
|
|
231
|
+
},
|
|
232
|
+
"cf-learn": {
|
|
233
|
+
"description": "Scan project configs, current workspace changes, and code patterns to extract evidence-backed coding standards and retrieval maps. Use for cf-learn, cf-learn --map, cf-learn --review, or when updating specs from existing conventions.",
|
|
234
|
+
"restore": [
|
|
235
|
+
[
|
|
236
|
+
"- 写入:AGENTS.md +A",
|
|
237
|
+
"- 写入:CLAUDE.md +A"
|
|
238
|
+
]
|
|
239
|
+
]
|
|
240
|
+
},
|
|
241
|
+
"cf-spec": {
|
|
242
|
+
"description": "Manage schema-v1 Spec Context, drift recovery, and prepared one-shot migration plans.",
|
|
243
|
+
"dropTitle": true,
|
|
244
|
+
"dropText": [
|
|
245
|
+
"管理 schema v1 Spec Context 与一次性迁移。用法:\n\n"
|
|
246
|
+
]
|
|
247
|
+
},
|
|
248
|
+
"cf-stats": {
|
|
249
|
+
"description": "Show token usage statistics for the spec system (per-file breakdown, budget utilization, L0/L1 tiers, compression, quality_loop health); --audit adds a spec quality audit. Use when checking token usage, budget, spec system health, or spec quality issues. Replaces the former cf-scan.",
|
|
250
|
+
"dropTitle": true,
|
|
251
|
+
"dropText": [
|
|
252
|
+
"统计规范体系的 token 使用情况(各文件分布、预算利用率、压缩与 quality_loop 健康度);`--audit` 附带规范质量审计。\n\n"
|
|
253
|
+
],
|
|
254
|
+
"restore": [
|
|
255
|
+
[
|
|
256
|
+
"> 原 `cf-scan`",
|
|
257
|
+
"> 原 cf-scan"
|
|
258
|
+
]
|
|
259
|
+
]
|
|
260
|
+
},
|
|
261
|
+
"cf-task-prd": {
|
|
262
|
+
"description": "Generate a Product Requirements Document (PRD) from a one-liner requirement through structured interactive dialogue. Use when starting from a vague idea without a clear PRD document. The output feeds cf-task-align for technical design.",
|
|
263
|
+
"dropTitle": true,
|
|
264
|
+
"dropText": [
|
|
265
|
+
"从一句话需求出发,通过结构化对话产出产品需求文档(PRD),为 `cf-task:align` 提供足够丰富的输入。\n\n"
|
|
266
|
+
],
|
|
267
|
+
"restore": [
|
|
268
|
+
[
|
|
269
|
+
"用 `rg --files` 检查",
|
|
270
|
+
"用 `rg --files` 或 `find` 检查"
|
|
271
|
+
],
|
|
272
|
+
[
|
|
273
|
+
"则 读取(",
|
|
274
|
+
"则读取("
|
|
275
|
+
]
|
|
276
|
+
]
|
|
277
|
+
},
|
|
278
|
+
"cf-task-align": {
|
|
279
|
+
"description": "Generate a design brief (.design.md) from a requirement through structured interactive dialogue. Accepts plain text, an existing PRD (.prd.md) to derive from, or a .design.md draft to resume. Adapts to the nature of the work — feature development, refactoring, CLI tools, background jobs, performance optimization, etc.",
|
|
280
|
+
"dropTitle": true,
|
|
281
|
+
"dropText": [
|
|
282
|
+
"从需求出发,通过结构化对话产出设计简报(`.design.md`),为 `cf-task:plan` 提供足够丰富的输入。支持三种输入:纯文本需求、`.prd.md` 产品需求文档、`.design.md` 草稿。\n\n"
|
|
283
|
+
],
|
|
284
|
+
"restore": [
|
|
285
|
+
[
|
|
286
|
+
"便于 `cf-task-archive`",
|
|
287
|
+
"便于 `cf-task:archive`"
|
|
288
|
+
]
|
|
289
|
+
]
|
|
290
|
+
},
|
|
291
|
+
"cf-task-plan": {
|
|
292
|
+
"description": "Break down a design document or design brief into structured task files with atomic subtasks, priorities, dependencies, and source chapter references. Use when starting work on a new feature from a design doc or a .design.md brief produced by cf-task-align.",
|
|
293
|
+
"dropTitle": true,
|
|
294
|
+
"dropText": [
|
|
295
|
+
"从设计文档或设计简报拆解需求,生成结构化任务文件。\n\n"
|
|
296
|
+
],
|
|
297
|
+
"restore": [
|
|
298
|
+
[
|
|
299
|
+
"从 cf-task-align 产出",
|
|
300
|
+
"从 cf-task:align 产出"
|
|
301
|
+
]
|
|
302
|
+
]
|
|
303
|
+
},
|
|
304
|
+
"cf-task-start": {
|
|
305
|
+
"description": "Activate a subtask and begin coding. Runs pre-checks (status, #NOTES, dependencies), loads design doc context by source reference, executes checklist items, and marks done when all items complete. Use when starting or continuing implementation work on a task.",
|
|
306
|
+
"dropTitle": true,
|
|
307
|
+
"dropText": [
|
|
308
|
+
"激活子任务并开始编码。支持单任务模式和整文件模式。\n\n"
|
|
309
|
+
],
|
|
310
|
+
"restore": [
|
|
311
|
+
[
|
|
312
|
+
"(cf-task-start 生成,archive 清理)",
|
|
313
|
+
"(cf-task:start 生成,archive 清理)"
|
|
314
|
+
]
|
|
315
|
+
]
|
|
316
|
+
},
|
|
317
|
+
"cf-task-status": {
|
|
318
|
+
"description": "\"Show task status overview: subtask states, progress percentages, blocked items, and overall completion. Use when checking task progress, what's done, what's blocked, or what needs to be done next.\"",
|
|
319
|
+
"dropTitle": true,
|
|
320
|
+
"dropText": [
|
|
321
|
+
"显示任务状态总览。\n\n"
|
|
322
|
+
]
|
|
323
|
+
},
|
|
324
|
+
"cf-task-archive": {
|
|
325
|
+
"description": "Archive a completed task file after completeness, correctness, traceability, and consistency validation. Use when all subtasks are done and you want to archive the task file and check for spec updates.",
|
|
326
|
+
"dropTitle": true,
|
|
327
|
+
"dropText": [
|
|
328
|
+
"归档已完成的整个 task 文件。归档前执行四维校验,归档后提示更新 specs。\n\n"
|
|
329
|
+
]
|
|
330
|
+
},
|
|
331
|
+
"cf-task-verify-e2e": {
|
|
332
|
+
"description": "Run layered verification or full requirement verification, including deferred E2E",
|
|
333
|
+
"dropTitle": true
|
|
334
|
+
},
|
|
335
|
+
"cf-task-note": {
|
|
336
|
+
"description": "Discuss #NOTES annotations in task files or design briefs, propose solutions with context, resolve questions collaboratively, and merge conclusions back removing the #NOTES marker. Use when files have unresolved #NOTES markers.",
|
|
337
|
+
"dropTitle": true,
|
|
338
|
+
"dropText": [
|
|
339
|
+
"与用户协作讨论文件中的 `#NOTES` 标记,对齐最优解后将结论沉淀回原文,删除标记。\n\n支持两种文件类型:\n- **任务文件**(`.md`):讨论任务中的实现细节问题\n- **设计简报**(`.design.md`):讨论设计方案中的缺陷或待确认项\n\n"
|
|
340
|
+
]
|
|
341
|
+
},
|
|
342
|
+
"cf-task-block": {
|
|
343
|
+
"description": "Mark a subtask as blocked with a reason. Use when a task cannot proceed due to external dependency, missing information, pending design decision, or unresolved question.",
|
|
344
|
+
"dropTitle": true,
|
|
345
|
+
"dropText": [
|
|
346
|
+
"标记子任务为阻塞状态。\n\n"
|
|
347
|
+
]
|
|
348
|
+
},
|
|
349
|
+
"cf-task-graph": {
|
|
350
|
+
"description": "Visualize task dependency DAG, identify parallelizable task groups and critical path. Use when planning execution order, understanding task dependencies, or deciding which tasks can run concurrently.",
|
|
351
|
+
"dropTitle": true,
|
|
352
|
+
"dropText": [
|
|
353
|
+
"可视化子任务的依赖关系 DAG,识别可并行执行的任务组。\n\n"
|
|
354
|
+
]
|
|
355
|
+
},
|
|
356
|
+
"cf-validate": {
|
|
357
|
+
"description": "Run validation rules (lint, type check, tests) against changed files based on .code-flow/validation.yml. Auto-fix failures. Use when validating code changes, running project checks, or after editing source files.",
|
|
358
|
+
"dropTitle": true,
|
|
359
|
+
"dropText": [
|
|
360
|
+
"根据变更文件自动匹配并执行验证规则(测试、类型检查、lint),失败时自动尝试修复。\n"
|
|
361
|
+
]
|
|
362
|
+
},
|
|
363
|
+
"cf-sync": {
|
|
364
|
+
"description": "One-command canonical → deploy sync for dual-copy artifacts, with drift check.",
|
|
365
|
+
"blankAfterTitle": 1
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|