@hunyed15/codecgc 0.1.0

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.
Files changed (128) hide show
  1. package/.claude/hooks/route-edit.ps1 +86 -0
  2. package/INSTALLATION.md +550 -0
  3. package/LICENSE +21 -0
  4. package/README.md +171 -0
  5. package/bin/cgc-build.js +4 -0
  6. package/bin/cgc-doctor.js +4 -0
  7. package/bin/cgc-entry.js +4 -0
  8. package/bin/cgc-external-audit.js +4 -0
  9. package/bin/cgc-fix.js +4 -0
  10. package/bin/cgc-history.js +4 -0
  11. package/bin/cgc-install.js +4 -0
  12. package/bin/cgc-lifecycle.js +4 -0
  13. package/bin/cgc-package-audit.js +4 -0
  14. package/bin/cgc-plan.js +4 -0
  15. package/bin/cgc-release-readiness.js +4 -0
  16. package/bin/cgc-review.js +4 -0
  17. package/bin/cgc-route.js +4 -0
  18. package/bin/cgc-status.js +4 -0
  19. package/bin/cgc-test.js +4 -0
  20. package/bin/cgc.js +4 -0
  21. package/bin/codecgc.js +1284 -0
  22. package/codecgc/cgc/SKILL.md +46 -0
  23. package/codecgc/cgc-arch/SKILL.md +61 -0
  24. package/codecgc/cgc-build/SKILL.md +53 -0
  25. package/codecgc/cgc-decide/SKILL.md +55 -0
  26. package/codecgc/cgc-fix/SKILL.md +47 -0
  27. package/codecgc/cgc-learn/SKILL.md +46 -0
  28. package/codecgc/cgc-onboard/SKILL.md +52 -0
  29. package/codecgc/cgc-plan/SKILL.md +48 -0
  30. package/codecgc/cgc-refactor/SKILL.md +46 -0
  31. package/codecgc/cgc-req/SKILL.md +61 -0
  32. package/codecgc/cgc-review/SKILL.md +57 -0
  33. package/codecgc/cgc-roadmap/SKILL.md +55 -0
  34. package/codecgc/cgc-test/SKILL.md +21 -0
  35. package/codecgc/reference/api-cgc-review-libdoc.md +13 -0
  36. package/codecgc/reference/artifact-class-policy.md +81 -0
  37. package/codecgc/reference/build-flow.md +95 -0
  38. package/codecgc/reference/checklist-contract.md +103 -0
  39. package/codecgc/reference/execution-audit.md +121 -0
  40. package/codecgc/reference/execution-model.md +118 -0
  41. package/codecgc/reference/execution-routing.md +130 -0
  42. package/codecgc/reference/executor-contract.md +87 -0
  43. package/codecgc/reference/external-capability-registry.json +104 -0
  44. package/codecgc/reference/fix-flow.md +94 -0
  45. package/codecgc/reference/fixture-governance.md +60 -0
  46. package/codecgc/reference/flow-execution.md +65 -0
  47. package/codecgc/reference/lifecycle-map.md +172 -0
  48. package/codecgc/reference/lifecycle-playbook.md +104 -0
  49. package/codecgc/reference/long-lived-artifacts.md +98 -0
  50. package/codecgc/reference/operation-guide.md +242 -0
  51. package/codecgc/reference/release-maintenance-playbook.md +150 -0
  52. package/codecgc/reference/review-writeback.md +141 -0
  53. package/codecgc/reference/role-model.md +128 -0
  54. package/codecgc/reference/runtime-boundary.md +72 -0
  55. package/codecgc/reference/shared-conventions.md +93 -0
  56. package/codecgc/reference/workflow-scaffold.md +57 -0
  57. package/codexmcp/LICENSE +21 -0
  58. package/codexmcp/README.md +294 -0
  59. package/codexmcp/pyproject.toml +37 -0
  60. package/codexmcp/src/codexmcp/__init__.py +4 -0
  61. package/codexmcp/src/codexmcp/cli.py +12 -0
  62. package/codexmcp/src/codexmcp/server.py +529 -0
  63. package/geminimcp/README.md +258 -0
  64. package/geminimcp/pyproject.toml +15 -0
  65. package/geminimcp/src/geminimcp/__init__.py +4 -0
  66. package/geminimcp/src/geminimcp/cli.py +12 -0
  67. package/geminimcp/src/geminimcp/server.py +465 -0
  68. package/model-routing.yaml +30 -0
  69. package/package.json +90 -0
  70. package/requirements.txt +1 -0
  71. package/scripts/README-codecgc-cli.md +89 -0
  72. package/scripts/audit_codecgc_external_capabilities.py +276 -0
  73. package/scripts/audit_codecgc_historical_audits.py +242 -0
  74. package/scripts/audit_codecgc_lifecycle.py +241 -0
  75. package/scripts/audit_codecgc_package_runtime.py +445 -0
  76. package/scripts/audit_codecgc_release_readiness.py +202 -0
  77. package/scripts/audit_codecgc_review_policy.py +82 -0
  78. package/scripts/audit_codecgc_workflow_history.py +317 -0
  79. package/scripts/build_codecgc_task.py +487 -0
  80. package/scripts/codecgc_artifact_roots.py +40 -0
  81. package/scripts/codecgc_cli.py +843 -0
  82. package/scripts/codecgc_command_surface.py +28 -0
  83. package/scripts/codecgc_console_io.py +45 -0
  84. package/scripts/codecgc_executor_registry.py +54 -0
  85. package/scripts/codecgc_file_evidence.py +349 -0
  86. package/scripts/codecgc_flow_control.py +233 -0
  87. package/scripts/codecgc_governance_dedupe.py +161 -0
  88. package/scripts/codecgc_plan_decision.py +103 -0
  89. package/scripts/codecgc_review_control.py +588 -0
  90. package/scripts/codecgc_roadmap_templates.py +149 -0
  91. package/scripts/codecgc_routing_paths.py +16 -0
  92. package/scripts/codecgc_routing_template.py +135 -0
  93. package/scripts/codecgc_runtime_paths.py +22 -0
  94. package/scripts/codecgc_session_recovery.py +44 -0
  95. package/scripts/codecgc_step_control.py +154 -0
  96. package/scripts/codecgc_workflow_runtime.py +63 -0
  97. package/scripts/codecgc_workflow_templates.py +437 -0
  98. package/scripts/entry_codecgc_workflow.py +3419 -0
  99. package/scripts/exercise_mcp_tools.py +109 -0
  100. package/scripts/expand_codecgc_roadmap.py +664 -0
  101. package/scripts/init_codecgc_roadmap.py +134 -0
  102. package/scripts/init_codecgc_workflow.py +207 -0
  103. package/scripts/install_codecgc.py +938 -0
  104. package/scripts/migrate_demo_workflows_to_fixtures.py +128 -0
  105. package/scripts/normalize_codecgc_audits.py +114 -0
  106. package/scripts/normalize_codecgc_governance_docs.py +79 -0
  107. package/scripts/normalize_codecgc_workflow_docs.py +269 -0
  108. package/scripts/plan_codecgc_workflow.py +970 -0
  109. package/scripts/refresh_codecgc_review_policy.py +223 -0
  110. package/scripts/review_codecgc_workflow.py +88 -0
  111. package/scripts/route_codecgc_workflow.py +671 -0
  112. package/scripts/run_codecgc_build.py +104 -0
  113. package/scripts/run_codecgc_fix.py +104 -0
  114. package/scripts/run_codecgc_flow_step.py +165 -0
  115. package/scripts/run_codecgc_task.py +410 -0
  116. package/scripts/run_codecgc_test.py +105 -0
  117. package/scripts/sync_codecgc_mcp_config.py +41 -0
  118. package/scripts/write_codecgc_architecture.py +78 -0
  119. package/scripts/write_codecgc_decision.py +83 -0
  120. package/scripts/write_codecgc_explore.py +118 -0
  121. package/scripts/write_codecgc_guide.py +141 -0
  122. package/scripts/write_codecgc_learning.py +87 -0
  123. package/scripts/write_codecgc_libdoc.py +140 -0
  124. package/scripts/write_codecgc_refactor.py +78 -0
  125. package/scripts/write_codecgc_requirement.py +78 -0
  126. package/scripts/write_codecgc_review.py +291 -0
  127. package/scripts/write_codecgc_roadmap.py +122 -0
  128. package/scripts/write_codecgc_trick.py +123 -0
@@ -0,0 +1,87 @@
1
+ # CodeCGC 执行器契约
2
+
3
+ ## 1. 目的
4
+
5
+ 这份文档定义 CodeCGC 工作流运行时与执行器 MCP 适配层之间的标准执行契约。
6
+
7
+ ## 2. 当前执行器
8
+
9
+ 前端执行器工具:
10
+
11
+ - `implement_frontend_task`
12
+
13
+ 后端执行器工具:
14
+
15
+ - `implement_backend_task`
16
+
17
+ ## 3. 成功返回的必要字段
18
+
19
+ 当执行成功时,两类执行器都必须返回:
20
+
21
+ - `success`
22
+ - `task_id`
23
+ - `SESSION_ID`
24
+ - `summary`
25
+ - `agent_messages`
26
+ - `changed_files`
27
+ - `policy_checks`
28
+ - `risks`
29
+
30
+ 可选字段:
31
+
32
+ - `all_messages`
33
+
34
+ ## 4. 失败返回的必要字段
35
+
36
+ 当执行失败时,两类执行器至少必须返回:
37
+
38
+ - `success`
39
+ - `task_id`
40
+ - `policy_checks`
41
+ - `error`
42
+
43
+ ## 5. 运行时归一化规则
44
+
45
+ 工作流运行时允许在写入 audit 之前,对执行器输出做标准化整理。
46
+
47
+ 当前归一化入口:
48
+
49
+ - `scripts/run_codecgc_task.py`
50
+
51
+ audit 层最终会稳定写入:
52
+
53
+ - `result.success`
54
+ - `result.outcome`
55
+ - `result.task_id`
56
+ - `result.session_id`
57
+ - `result.summary`
58
+ - `result.changed_files`
59
+ - `result.policy_checks`
60
+ - `result.risks`
61
+ - `result.error`
62
+
63
+ ## 6. 当前语义规则
64
+
65
+ 两个执行器目前在工作流层被视为共享同一套语义:
66
+
67
+ - `success` 表示执行器返回了结构化结果
68
+ - `changed_files` 是审核会消费的范围内文件证据
69
+ - `policy_checks` 是机器可读的策略轨迹
70
+ - `SESSION_ID` 是后续续跑所需的会话句柄
71
+
72
+ ## 7. 可审核规则
73
+
74
+ 执行器返回成功,并不等于已经可以直接通过审核。
75
+
76
+ 要进入可通过审核状态,还必须额外满足:
77
+
78
+ - 不是 `dry-run`
79
+ - 执行归属正确
80
+ - 变更文件没有超出路由范围
81
+ - audit 最终结果为 `done`
82
+
83
+ ## 8. 当前限制
84
+
85
+ 执行器成功时返回的 `changed_files`,本质上仍然首先来自执行器自身报告,而不是完整独立的版本历史证明。
86
+
87
+ CodeCGC 已经在 audit 层补充了工作区快照证据,但它还不是完整的 git 级差异证明系统。
@@ -0,0 +1,104 @@
1
+ {
2
+ "version": 1,
3
+ "last_updated": "2026-05-03",
4
+ "capabilities": [
5
+ {
6
+ "id": "codexmcp",
7
+ "name": "Codex MCP",
8
+ "category": "executor",
9
+ "integration_type": "embedded-mcp",
10
+ "status": "integrated",
11
+ "required": true,
12
+ "owner": "CodeCGC",
13
+ "probe_kind": "executor",
14
+ "executor_target": "backend",
15
+ "mcp_server_names": ["codex"],
16
+ "description": "后端执行器,负责 backend build/fix 的实际编码。"
17
+ },
18
+ {
19
+ "id": "geminimcp",
20
+ "name": "Gemini MCP",
21
+ "category": "executor",
22
+ "integration_type": "embedded-mcp",
23
+ "status": "integrated",
24
+ "required": true,
25
+ "owner": "CodeCGC",
26
+ "probe_kind": "executor",
27
+ "executor_target": "frontend",
28
+ "mcp_server_names": ["gemini"],
29
+ "description": "前端执行器,负责 frontend build/fix 的实际编码。"
30
+ },
31
+ {
32
+ "id": "memos",
33
+ "name": "MemOS",
34
+ "category": "memory",
35
+ "integration_type": "external-mcp",
36
+ "status": "integrated",
37
+ "required": false,
38
+ "owner": "External",
39
+ "probe_kind": "workspace-mcp",
40
+ "mcp_server_names": ["memos", "mem-os", "memos-mcp"],
41
+ "description": "持久记忆能力,使用官方 MemOS MCP;CodeCGC 只负责正式纳管、状态审计与协作约束,不重做记忆引擎本体。"
42
+ },
43
+ {
44
+ "id": "augment-search",
45
+ "name": "Augment Search Via Ace Tool",
46
+ "category": "code-search",
47
+ "integration_type": "external-mcp",
48
+ "status": "integrated",
49
+ "required": false,
50
+ "owner": "External",
51
+ "probe_kind": "workspace-mcp",
52
+ "mcp_server_names": ["ace-tool", "augment", "auggie"],
53
+ "description": "代码检索与语义上下文增强能力,优先复用 ace-tool 这一现成 MCP 接入面;CodeCGC 只负责正式纳管、状态审计与协作约束,不重做检索引擎本体。"
54
+ },
55
+ {
56
+ "id": "github-mcp",
57
+ "name": "GitHub MCP",
58
+ "category": "scm",
59
+ "integration_type": "external-mcp",
60
+ "status": "integrated",
61
+ "required": false,
62
+ "owner": "External",
63
+ "probe_kind": "workspace-mcp",
64
+ "mcp_server_names": ["github"],
65
+ "description": "源码托管、PR、issue 与发布协同能力,优先复用 github/github-mcp-server 官方 MCP;CodeCGC 只负责正式纳管、状态审计与协作约束,不重做 GitHub 平台能力本体。"
66
+ },
67
+ {
68
+ "id": "linear-mcp",
69
+ "name": "Linear MCP",
70
+ "category": "project-management",
71
+ "integration_type": "external-mcp",
72
+ "status": "integrated",
73
+ "required": false,
74
+ "owner": "External",
75
+ "probe_kind": "workspace-mcp",
76
+ "mcp_server_names": ["linear", "linear-server"],
77
+ "description": "需求、任务、缺陷与项目节奏管理能力,优先复用 Linear 官方 remote MCP;CodeCGC 只负责正式纳管、状态审计与协作约束,不重做 Linear 平台能力本体。"
78
+ },
79
+ {
80
+ "id": "jira-mcp",
81
+ "name": "Jira Or Atlassian MCP",
82
+ "category": "project-management",
83
+ "integration_type": "external-mcp",
84
+ "status": "planned",
85
+ "required": false,
86
+ "owner": "External",
87
+ "probe_kind": "workspace-mcp",
88
+ "mcp_server_names": ["jira", "atlassian"],
89
+ "description": "Atlassian / Jira 项目管理能力,当前仍保留为受控预留位,后续单独评估与纳管。"
90
+ },
91
+ {
92
+ "id": "sentry-mcp",
93
+ "name": "Sentry MCP",
94
+ "category": "observability",
95
+ "integration_type": "external-mcp",
96
+ "status": "planned",
97
+ "required": false,
98
+ "owner": "External",
99
+ "probe_kind": "workspace-mcp",
100
+ "mcp_server_names": ["sentry"],
101
+ "description": "线上异常、堆栈、事件追踪与问题回流能力。"
102
+ }
103
+ ]
104
+ }
@@ -0,0 +1,94 @@
1
+ # CodeCGC 问题修复流程
2
+
3
+ ## 1. 目的
4
+
5
+ 这份文档定义 `cgc-fix` 的标准行为。
6
+
7
+ 它是 CodeCGC 在问题修复场景下的受控执行流程。
8
+
9
+ ## 2. 适用范围
10
+
11
+ `cgc-fix` 只处理范围已经足够收敛的问题修复工作。
12
+
13
+ 它必须:
14
+
15
+ - 使用 `codecgc/issues/` 下的 issue 产物
16
+ - 遵守 CodeCGC 的执行归属规则
17
+ - 不绕过既有步骤契约直接自由执行
18
+
19
+ ## 3. 标准流程阶段
20
+
21
+ `cgc-fix` 应按以下顺序推进:
22
+
23
+ 1. 定位 issue 上下文
24
+ 2. 检查修复范围与执行归属
25
+ 3. 选出当前唯一可执行的问题修复步骤
26
+ 4. 校验该步骤的 `codecgc` 契约
27
+ 5. 通过 `scripts/run_codecgc_task.py` 发起委派执行
28
+ 6. 收集结构化结果与 audit 路径
29
+ 7. 把结果交给 `cgc-review`
30
+
31
+ ## 4. 执行前检查
32
+
33
+ 在真正执行之前,Claude 必须确认:
34
+
35
+ - 问题范围已经足够收敛
36
+ - 当前修复只属于一个执行器
37
+ - 当前步骤没有混合前端与后端工作
38
+ - 当前步骤具备本地验证目标
39
+
40
+ 如果这些条件不满足,就必须回到规划或范围澄清,而不是继续执行。
41
+
42
+ ## 5. 步骤契约检查
43
+
44
+ 当前修复步骤必须包含合法的 `codecgc` 区块,至少包括:
45
+
46
+ - `kind`
47
+ - `task_id`
48
+ - `task_summary`
49
+ - `target_paths`
50
+ - `constraints`
51
+ - `acceptance`
52
+ - `cd`
53
+
54
+ 只要步骤元数据缺失、混合或仍然模糊,就说明当前修复还不可执行。
55
+
56
+ ## 6. 委派规则
57
+
58
+ 执行必须通过:
59
+
60
+ - `scripts/run_codecgc_flow_step.py`
61
+ - `scripts/run_codecgc_task.py`
62
+
63
+ 这样才能保证执行器选择与项目路由模型保持一致。
64
+
65
+ ## 7. 结果采集规则
66
+
67
+ `cgc-fix` 必须收集:
68
+
69
+ - `success`
70
+ - `task_id`
71
+ - `SESSION_ID`
72
+ - `summary`
73
+ - `changed_files`
74
+ - `policy_checks`
75
+ - `risks`
76
+ - `audit.path`
77
+
78
+ audit 产物属于最小修复证据集的一部分。
79
+
80
+ 如果执行失败,必须先分类,再决定如何继续,例如:
81
+
82
+ - 范围错误
83
+ - 缺少设计或修复澄清
84
+ - 环境或工具问题
85
+ - 执行器失败
86
+
87
+ ## 8. 结束状态
88
+
89
+ `cgc-fix` 只能结束在以下几种状态之一:
90
+
91
+ - 已成功委派,等待 `cgc-review`
92
+ - 已退回范围澄清
93
+ - 被环境或工具问题阻塞
94
+ - 因步骤不可执行而拒绝继续
@@ -0,0 +1,60 @@
1
+ # CodeCGC Fixture 治理
2
+
3
+ ## 1. 目的
4
+
5
+ 这份文档说明 CodeCGC 如何管理历史 demo、验证样例和行为检查工作流。
6
+
7
+ ## 2. 治理规则
8
+
9
+ 如果一个工作流存在的主要目的,是验证以下能力,而不是交付真实项目工作:
10
+
11
+ - 路由
12
+ - 状态推进
13
+ - 审核回写
14
+ - 结构化规划
15
+ - 会话续跑
16
+ - mixed-scope 阻断
17
+
18
+ 那么它就应归入 fixture 根目录,而不是 product 根目录。
19
+
20
+ ## 3. 目录规则
21
+
22
+ 验证样例及其 audit 应放在:
23
+
24
+ - `codecgc/fixtures/features/`
25
+ - `codecgc/fixtures/issues/`
26
+ - `codecgc/fixtures/execution/`
27
+
28
+ 真实交付工作流应保留在:
29
+
30
+ - `codecgc/features/`
31
+ - `codecgc/issues/`
32
+ - `codecgc/execution/`
33
+
34
+ ## 4. 历史迁移
35
+
36
+ 仓库当前已经提供历史 demo 迁移脚本:
37
+
38
+ - `python scripts/migrate_demo_workflows_to_fixtures.py`
39
+
40
+ 这个脚本会把已知 demo 与验证工作流从 product 根目录迁入 fixture 根目录,并把它们的 `artifact_class` 改成 `fixture`。
41
+
42
+ ## 5. 当前仓库状态
43
+
44
+ 主要历史 demo 工作流已经迁入 fixture 根目录。
45
+
46
+ 这意味着:
47
+
48
+ - fixture 根目录是当前运行时验证样例的规范位置
49
+
50
+ ## 6. 操作规则
51
+
52
+ 在创建新的样例工作流前,先判断:
53
+
54
+ - 这是实际产品工作,还是运行时验证样例
55
+
56
+ 如果只是样例,应从一开始就使用:
57
+
58
+ - `--artifact-class fixture`
59
+
60
+ 并直接把产物放进 fixture 根目录。
@@ -0,0 +1,65 @@
1
+ # CodeCGC 流程执行入口
2
+
3
+ ## 1. 目的
4
+
5
+ 这份文档定义 `cgc-build` 与 `cgc-fix` 共享的步骤执行入口。
6
+
7
+ 两条流程都会通过:
8
+
9
+ - `scripts/run_codecgc_flow_step.py`
10
+
11
+ 把当前可执行步骤交给运行时执行。
12
+
13
+ ## 2. 输入
14
+
15
+ 这个共享执行入口至少需要:
16
+
17
+ - `flow`
18
+ - `slug`
19
+ - `step-number`
20
+
21
+ 可选输入:
22
+
23
+ - `checklist-file`
24
+ - `audit-root`
25
+ - `timeout-seconds`
26
+ - `dry-run`
27
+
28
+ ## 3. 解析规则
29
+
30
+ 如果没有显式传入 `checklist-file`,执行入口会自动从以下目录解析工作流文件:
31
+
32
+ - `codecgc/features/{slug}/`
33
+ - `codecgc/issues/{slug}/`
34
+
35
+ 当前查找顺序包括:
36
+
37
+ - `{slug}-checklist.yaml`
38
+ - `checklist.yaml`
39
+ - `{slug}-fix.yaml`
40
+ - `fix-checklist.yaml`
41
+
42
+ ## 4. 共享契约
43
+
44
+ 被解析出来的 YAML 文件,必须包含带有合法 `codecgc` 区块的步骤条目。
45
+
46
+ 这意味着 feature 与 issue 当前共享同一套机器可执行契约:
47
+
48
+ - 面向人的步骤元信息
49
+ - 面向运行时的 `codecgc` 执行元信息
50
+
51
+ ## 5. 产品规则
52
+
53
+ 当步骤契约已经存在时,`cgc-build` 与 `cgc-fix` 不应再手工重构执行器 prompt。
54
+
55
+ 它们应统一调用这个共享入口,然后读取:
56
+
57
+ - 结构化执行结果
58
+ - audit 产物
59
+
60
+ ## 6. 当前限制
61
+
62
+ 这个共享执行入口不负责创建 feature 或 issue 产物。
63
+
64
+ 它只负责执行一个已经准备好的步骤契约。
65
+ 产物创建、规划补全、审核回写仍然属于更上层工作流逻辑。
@@ -0,0 +1,172 @@
1
+ # CodeCGC 生命周期地图
2
+
3
+ ## 1. 生命周期总览
4
+
5
+ CodeCGC 当前采用下面这条交付闭环:
6
+
7
+ 1. Define
8
+ 2. Plan
9
+ 3. Build
10
+ 4. Verify
11
+ 5. Review
12
+ 6. Ship
13
+
14
+ 这不是“谁都能随时写代码”的自由协作模型,而是一条受控的软件交付链路。
15
+
16
+ ## 2. Define
17
+
18
+ ### 目标
19
+
20
+ 先说明到底要解决什么问题,以及边界在哪里。
21
+
22
+ ### 主要负责人
23
+
24
+ - Claude
25
+
26
+ ### 常见输出
27
+
28
+ - 问题定义
29
+ - 用户可见范围
30
+ - 非目标
31
+ - 初步分类:feature / issue / refactor / roadmap
32
+
33
+ ### 退出条件
34
+
35
+ 当需求已经清晰到可以进入规划时,Define 阶段结束。
36
+
37
+ ## 3. Plan
38
+
39
+ ### 目标
40
+
41
+ 把诉求拆成可执行步骤,并为每一步确定明确归属。
42
+
43
+ ### 主要负责人
44
+
45
+ - Claude
46
+
47
+ ### 常见输出
48
+
49
+ - design 或 fix plan
50
+ - 步骤拆解
51
+ - 契约边界
52
+ - 执行器归属
53
+ - 步骤级验收标准
54
+
55
+ ### 退出条件
56
+
57
+ 每个执行步骤都必须达到:
58
+
59
+ - 一个 owner
60
+ - 一个 scope
61
+ - 一个 acceptance target
62
+
63
+ 如果做不到,就不能进入 Build。
64
+
65
+ ## 4. Build
66
+
67
+ ### 目标
68
+
69
+ 真正产出代码改动。
70
+
71
+ ### 主要负责人
72
+
73
+ - Gemini 负责前端
74
+ - Codex 负责后端
75
+
76
+ ### Claude 的职责
77
+
78
+ - 打包步骤
79
+ - 调用正确执行器
80
+ - 阻止混合范围执行
81
+
82
+ ### 退出条件
83
+
84
+ 执行器返回结构化结果,且结果对应当前步骤边界。
85
+
86
+ ## 5. Verify
87
+
88
+ ### 目标
89
+
90
+ 确认这一步不仅“写了代码”,而且“有证据说明做对了”。
91
+
92
+ ### 责任分工
93
+
94
+ - Gemini 对前端工作提供前端可见行为证据
95
+ - Codex 对后端工作提供后端测试或运行证据
96
+ - Claude 判断这些证据是否满足步骤验收
97
+
98
+ ### 常见证据
99
+
100
+ - 测试结果
101
+ - 页面或交互确认
102
+ - 变更文件列表
103
+ - policy checks
104
+ - 执行摘要
105
+
106
+ ### 退出条件
107
+
108
+ 证据已经足以进入 Review。
109
+
110
+ ## 6. Review
111
+
112
+ ### 目标
113
+
114
+ 判断这一步是否正确、是否越界、是否还存在后续风险。
115
+
116
+ ### 主要负责人
117
+
118
+ - Claude
119
+
120
+ ### 典型审核问题
121
+
122
+ - 是否调用了正确执行器
123
+ - 是否遵守了路径边界
124
+ - 是否满足当前步骤验收条件
125
+ - 是否夹带了无关改动
126
+ - 是否还需要进一步拆分跟进
127
+
128
+ ### 退出条件
129
+
130
+ Claude 能明确做出:
131
+
132
+ - 通过
133
+ - 需修改
134
+ - 回到设计或规划
135
+
136
+ 三者之一。
137
+
138
+ ## 7. Ship
139
+
140
+ ### 目标
141
+
142
+ 完成闭环,让当前工作流状态可以继续推进、合并或进入下一阶段。
143
+
144
+ ### 主要负责人
145
+
146
+ - Claude
147
+
148
+ ### 常见输出
149
+
150
+ - 验收结论
151
+ - 工作流产物回写
152
+ - 变更摘要
153
+ - 残余风险
154
+ - 下一步建议
155
+
156
+ ## 8. 角色覆盖总结
157
+
158
+ | 阶段 | Claude | Gemini | Codex |
159
+ |---|---|---|---|
160
+ | Define | owner | 默认不参与 | 默认不参与 |
161
+ | Plan | owner | 必要时被咨询 | 必要时被咨询 |
162
+ | Build | controller | 前端 owner | 后端 owner |
163
+ | Verify | 验收控制者 | 前端证据 owner | 后端证据 owner |
164
+ | Review | owner | 按需补充 | 按需补充 |
165
+ | Ship | owner | 默认不参与 | 默认不参与 |
166
+
167
+ ## 9. 产品原则
168
+
169
+ Claude 覆盖全生命周期。
170
+
171
+ Gemini 和 Codex 不覆盖全生命周期。
172
+ 它们只在自己负责的执行边界内拥有代码交付责任。
@@ -0,0 +1,104 @@
1
+ # CodeCGC Lifecycle Playbook
2
+
3
+ ## 1. 目的
4
+
5
+ 这份文档定义 CodeCGC 在“从 0 到 1、从 1 到 2、长期维护”三种阶段下的统一使用方式。
6
+
7
+ 它补的是 `lifecycle-map.md` 的操作层。
8
+
9
+ ## 2. 三种阶段
10
+
11
+ ### 2.1 从 0 到 1
12
+
13
+ 适用场景:
14
+
15
+ - 还没有 workflow
16
+ - 还没有明确的 roadmap 或 feature / issue 资产
17
+
18
+ 优先入口:
19
+
20
+ 1. `cgc`
21
+ 2. `cgc-entry`
22
+ 3. `cgc-plan`
23
+
24
+ 目标:
25
+
26
+ - 先把需求收敛成 feature / issue / roadmap 之一
27
+ - 再进入可执行步骤
28
+
29
+ ### 2.2 从 1 到 2
30
+
31
+ 适用场景:
32
+
33
+ - 已有 roadmap
34
+ - 已有多个 feature / issue workflow
35
+ - 已有 execution 审计沉淀
36
+
37
+ 优先入口:
38
+
39
+ 1. `cgc-lifecycle`
40
+ 2. `cgc-route`
41
+ 3. `cgc-build / cgc-fix / cgc-review`
42
+
43
+ 目标:
44
+
45
+ - 判断当前是继续规划、继续执行、还是收尾审核
46
+ - 避免在多个 workflow 并行时丢失当前主线
47
+
48
+ ### 2.3 长期维护
49
+
50
+ 适用场景:
51
+
52
+ - 已经进入安装、发布、运维或生态接入阶段
53
+
54
+ 优先入口:
55
+
56
+ 1. `cgc-status`
57
+ 2. `cgc-doctor`
58
+ 3. `cgc-external-audit`
59
+ 4. `cgc-release-readiness`
60
+ 5. `cgc-lifecycle`
61
+
62
+ 目标:
63
+
64
+ - 判断当前是环境问题、发布问题、外部接入问题,还是正常的交付推进
65
+
66
+ ## 3. 生命周期总览入口
67
+
68
+ `cgc-lifecycle` 不负责直接执行 workflow。
69
+
70
+ 它只负责回答:
71
+
72
+ - 当前仓库更像 setup-only、initiative-planning、planned-not-executed,还是 active-delivery
73
+ - 当前 product / fixture 的 roadmap、workflow、execution 分布是什么
74
+ - roadmap 是否已经继续拆成 child workflow,还是还停留在 initiative 层
75
+ - 下一步更适合回到 `cgc`、`cgc-plan`、`cgc-route`,还是进入维护总检查链
76
+
77
+ ## 4. 使用规则
78
+
79
+ 如果你不知道当前仓库处在哪个阶段,优先跑:
80
+
81
+ ```bash
82
+ cgc-lifecycle
83
+ ```
84
+
85
+ 如果你已经知道自己要继续某个 workflow,优先回到:
86
+
87
+ ```bash
88
+ cgc-route --flow feature --slug <slug>
89
+ ```
90
+
91
+ 或:
92
+
93
+ ```bash
94
+ cgc-route --flow issue --slug <slug>
95
+ ```
96
+
97
+ ## 5. 边界
98
+
99
+ `cgc-lifecycle` 是总览,不是调度器。
100
+
101
+ 真正的执行、审核、发布与维护,仍然分别归:
102
+
103
+ - `cgc-entry / cgc-plan / cgc-build / cgc-fix / cgc-review / cgc-route`
104
+ - `cgc-status / cgc-doctor / cgc-package-audit / cgc-external-audit / cgc-release-readiness`