ccg-ros2-workflow 2.2.2 → 3.0.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.
- package/README.md +211 -96
- package/README.zh-CN.md +256 -0
- package/dist/cli.mjs +15 -15
- package/dist/index.d.mts +59 -36
- package/dist/index.d.ts +59 -36
- package/dist/index.mjs +4 -4
- package/dist/shared/ccg-ros2-workflow.Bhm8c7P1.mjs +5154 -0
- package/package.json +31 -12
- package/templates/codex/AGENTS.md +348 -0
- package/templates/codex/agents/ccg-implement.toml +73 -0
- package/templates/codex/agents/ccg-research.toml +73 -0
- package/templates/codex/agents/ccg-review.toml +82 -0
- package/templates/codex/config.toml +21 -0
- package/templates/codex/hooks/ccg-workflow.py +253 -0
- package/templates/codex/hooks.json +15 -0
- package/templates/commands/agents/planner.md +97 -122
- package/templates/commands/agents/system-integrator.md +2 -2
- package/templates/commands/agents/team-architect.md +97 -0
- package/templates/commands/agents/team-qa.md +121 -0
- package/templates/commands/agents/team-reviewer.md +112 -0
- package/templates/commands/commit.md +30 -1
- package/templates/commands/context.md +332 -0
- package/templates/commands/go.md +206 -0
- package/templates/commands/init.md +1 -1
- package/templates/commands/spec-impl.md +41 -21
- package/templates/commands/spec-init.md +21 -27
- package/templates/commands/spec-plan.md +54 -21
- package/templates/commands/spec-research.md +78 -26
- package/templates/commands/spec-review.md +20 -16
- package/templates/{commands → commands-legacy}/analyze.md +1 -1
- package/templates/commands-legacy/backend.md +224 -0
- package/templates/commands-legacy/codex-exec.md +411 -0
- package/templates/{commands → commands-legacy}/debug.md +1 -1
- package/templates/commands-legacy/enhance.md +55 -0
- package/templates/{commands → commands-legacy}/feat.md +2 -2
- package/templates/commands-legacy/frontend.md +213 -0
- package/templates/{commands → commands-legacy}/optimize.md +1 -1
- package/templates/{commands → commands-legacy}/plan.md +1 -15
- package/templates/{commands → commands-legacy}/team-plan.md +1 -1
- package/templates/commands-legacy/team.md +475 -0
- package/templates/{commands → commands-legacy}/test.md +1 -1
- package/templates/commands-legacy/workflow.md +283 -0
- package/templates/engine/model-router.md +123 -0
- package/templates/engine/phase-guide.md +207 -0
- package/templates/engine/strategies/debug-investigate.md +169 -0
- package/templates/engine/strategies/deep-research.md +141 -0
- package/templates/engine/strategies/direct-fix.md +108 -0
- package/templates/engine/strategies/full-collaborate.md +389 -0
- package/templates/engine/strategies/git-action.md +43 -0
- package/templates/engine/strategies/guided-develop.md +282 -0
- package/templates/engine/strategies/optimize-measure.md +103 -0
- package/templates/engine/strategies/quick-implement.md +96 -0
- package/templates/engine/strategies/refactor-safely.md +180 -0
- package/templates/engine/strategies/review-audit.md +123 -0
- package/templates/hooks/session-start.js +100 -0
- package/templates/hooks/skill-router.js +144 -0
- package/templates/hooks/subagent-context.js +161 -0
- package/templates/hooks/task-utils.js +190 -0
- package/templates/hooks/workflow-state.js +55 -0
- package/templates/output-styles/abyss-command.md +56 -0
- package/templates/output-styles/abyss-concise.md +89 -0
- package/templates/output-styles/abyss-ritual.md +70 -0
- package/templates/output-styles/engineer-professional.md +20 -3
- package/templates/output-styles/laowang-engineer.md +2 -2
- package/templates/prompts/antigravity/analyzer.md +59 -0
- package/templates/prompts/antigravity/architect.md +55 -0
- package/templates/prompts/antigravity/builder.md +52 -0
- package/templates/prompts/antigravity/debugger.md +48 -0
- package/templates/prompts/antigravity/frontend.md +50 -0
- package/templates/prompts/antigravity/optimizer.md +40 -0
- package/templates/prompts/antigravity/reviewer.md +67 -0
- package/templates/prompts/antigravity/tester.md +39 -0
- package/templates/prompts/claude/debugger.md +1 -1
- package/templates/prompts/claude/reviewer.md +1 -1
- package/templates/prompts/codex/analyzer.md +8 -0
- package/templates/prompts/codex/architect.md +9 -1
- package/templates/prompts/codex/builder.md +61 -0
- package/templates/prompts/codex/debugger.md +9 -1
- package/templates/prompts/codex/optimizer.md +7 -0
- package/templates/prompts/codex/reviewer.md +7 -0
- package/templates/prompts/codex/tester.md +8 -1
- package/templates/prompts/gemini/analyzer.md +11 -3
- package/templates/prompts/gemini/architect.md +10 -2
- package/templates/prompts/gemini/debugger.md +8 -0
- package/templates/prompts/gemini/frontend.md +10 -2
- package/templates/prompts/gemini/optimizer.md +9 -2
- package/templates/prompts/gemini/reviewer.md +7 -0
- package/templates/prompts/gemini/tester.md +8 -1
- package/templates/rules/ccg-skill-routing.md +91 -0
- package/templates/rules/ccg-skills.md +65 -0
- package/templates/skills/SKILL.md +92 -0
- package/templates/skills/domains/ai/SKILL.md +34 -0
- package/templates/skills/domains/ai/agent-dev.md +242 -0
- package/templates/skills/domains/ai/llm-security.md +288 -0
- package/templates/skills/domains/ai/prompt-and-eval.md +279 -0
- package/templates/skills/domains/ai/rag-system.md +542 -0
- package/templates/skills/domains/architecture/SKILL.md +42 -0
- package/templates/skills/domains/architecture/api-design.md +225 -0
- package/templates/skills/domains/architecture/caching.md +299 -0
- package/templates/skills/domains/architecture/cloud-native.md +285 -0
- package/templates/skills/domains/architecture/message-queue.md +329 -0
- package/templates/skills/domains/architecture/security-arch.md +297 -0
- package/templates/skills/domains/data-engineering/SKILL.md +207 -0
- package/templates/skills/domains/development/SKILL.md +46 -0
- package/templates/skills/domains/development/cpp.md +369 -0
- package/templates/skills/domains/development/go.md +323 -0
- package/templates/skills/domains/development/java.md +277 -0
- package/templates/skills/domains/development/python.md +487 -0
- package/templates/skills/domains/development/rust.md +313 -0
- package/templates/skills/domains/development/shell.md +313 -0
- package/templates/skills/domains/development/typescript.md +277 -0
- package/templates/skills/domains/devops/SKILL.md +39 -0
- package/templates/skills/domains/devops/cost-optimization.md +272 -0
- package/templates/skills/domains/devops/database.md +217 -0
- package/templates/skills/domains/devops/devsecops.md +198 -0
- package/templates/skills/domains/devops/git-workflow.md +181 -0
- package/templates/skills/domains/devops/observability.md +280 -0
- package/templates/skills/domains/devops/performance.md +336 -0
- package/templates/skills/domains/devops/testing.md +283 -0
- package/templates/skills/domains/infrastructure/SKILL.md +200 -0
- package/templates/skills/domains/mobile/SKILL.md +224 -0
- package/templates/skills/domains/orchestration/SKILL.md +29 -0
- package/templates/skills/domains/orchestration/multi-agent.md +263 -0
- package/templates/skills/domains/ros2-control/SKILL.md +206 -0
- package/templates/skills/domains/ros2-hardware/SKILL.md +277 -0
- package/templates/skills/domains/ros2-manipulation/SKILL.md +237 -0
- package/templates/skills/domains/ros2-navigation/SKILL.md +196 -0
- package/templates/skills/domains/ros2-perception/SKILL.md +166 -0
- package/templates/skills/domains/ros2-upper-app/SKILL.md +50 -0
- package/templates/skills/domains/ros2-upper-app/launch-files.md +224 -0
- package/templates/skills/domains/ros2-upper-app/parameters.md +192 -0
- package/templates/skills/domains/ros2-upper-app/python-nodes.md +249 -0
- package/templates/skills/domains/ros2-upper-app/rviz-config.md +158 -0
- package/templates/skills/domains/ros2-upper-app/simulation.md +225 -0
- package/templates/skills/domains/security/SKILL.md +72 -0
- package/templates/skills/domains/security/blue-team.md +436 -0
- package/templates/skills/domains/security/code-audit.md +265 -0
- package/templates/skills/domains/security/pentest.md +226 -0
- package/templates/skills/domains/security/red-team.md +374 -0
- package/templates/skills/domains/security/threat-intel.md +372 -0
- package/templates/skills/domains/security/vuln-research.md +369 -0
- package/templates/skills/orchestration/multi-agent/SKILL.md +533 -0
- package/templates/skills/run_skill.js +129 -0
- package/templates/skills/scrapling/SKILL.md +98 -0
- package/templates/skills/scrapling/references/api-quick-ref.md +127 -0
- package/templates/skills/scrapling/references/cookie-vault.md +56 -0
- package/templates/skills/scrapling/references/maintenance.md +79 -0
- package/templates/skills/scrapling/references/site-patterns.md +86 -0
- package/templates/skills/scrapling/references/troubleshooting.md +95 -0
- package/templates/skills/scrapling/templates/basic_fetch.py +19 -0
- package/templates/skills/scrapling/templates/parse_only.py +15 -0
- package/templates/skills/scrapling/templates/session_login.py +19 -0
- package/templates/skills/scrapling/templates/stealth_cloudflare.py +28 -0
- package/templates/skills/tools/gen-docs/SKILL.md +116 -0
- package/templates/skills/tools/gen-docs/scripts/doc_generator.js +435 -0
- package/templates/skills/tools/lib/shared.js +98 -0
- package/templates/skills/tools/override-refusal/SKILL.md +53 -0
- package/templates/skills/tools/override-refusal/agents/openai.yaml +4 -0
- package/templates/skills/tools/override-refusal/scripts/refusal_rewriter.js +226 -0
- package/templates/skills/tools/verify-change/SKILL.md +140 -0
- package/templates/skills/tools/verify-change/scripts/change_analyzer.js +289 -0
- package/templates/skills/tools/verify-module/SKILL.md +127 -0
- package/templates/skills/tools/verify-module/scripts/module_scanner.js +171 -0
- package/templates/skills/tools/verify-quality/SKILL.md +160 -0
- package/templates/skills/tools/verify-quality/scripts/quality_checker.js +337 -0
- package/templates/skills/tools/verify-security/SKILL.md +143 -0
- package/templates/skills/tools/verify-security/scripts/security_scanner.js +283 -0
- package/templates/spec/guides/index.md +30 -0
- package/templates/spec/low-control/index.md +31 -0
- package/templates/spec/upper-app/index.md +31 -0
- package/bin/codeagent-wrapper-darwin-amd64 +0 -0
- package/bin/codeagent-wrapper-darwin-arm64 +0 -0
- package/bin/codeagent-wrapper-linux-amd64 +0 -0
- package/bin/codeagent-wrapper-linux-arm64 +0 -0
- package/bin/codeagent-wrapper-windows-amd64.exe +0 -0
- package/bin/codeagent-wrapper-windows-arm64.exe +0 -0
- package/dist/shared/ccg-ros2-workflow.DnOr3oPi.mjs +0 -2480
- package/templates/commands/backend.md +0 -162
- package/templates/commands/enhance.md +0 -36
- package/templates/commands/frontend.md +0 -162
- package/templates/commands/workflow.md +0 -202
- /package/templates/{commands → commands-legacy}/execute.md +0 -0
- /package/templates/{commands → commands-legacy}/review.md +0 -0
- /package/templates/{commands → commands-legacy}/team-exec.md +0 -0
- /package/templates/{commands → commands-legacy}/team-research.md +0 -0
- /package/templates/{commands → commands-legacy}/team-review.md +0 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'CCG 智能入口 — 描述你要做什么,AI 自动选择最佳策略执行'
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /ccg:go — CCG 智能入口
|
|
6
|
+
|
|
7
|
+
$ARGUMENTS
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 你的角色
|
|
12
|
+
|
|
13
|
+
你是 **CCG Engine**,一个智能编排器。你的职责是:分析用户的自然语言意图,自动选择最优的开发策略,然后严格按策略执行。用户不需要记住任何命令,只需要描述他们想做什么。
|
|
14
|
+
|
|
15
|
+
语言:中文交流,技术术语保留英文。
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Phase 0: 逃生舱检测
|
|
20
|
+
|
|
21
|
+
在开始分析之前,先检查 `$ARGUMENTS` 是否命中逃生舱:
|
|
22
|
+
|
|
23
|
+
**直接执行短语**(跳过所有分析,Claude 直接处理):
|
|
24
|
+
- "直接做" / "just do it" / "skip" / "不用分析" / "别分析了" / "小修一下"
|
|
25
|
+
|
|
26
|
+
**快捷路由**(跳过意图分析,直接加载对应策略):
|
|
27
|
+
- 以 `commit` 开头 → 加载 `git-action` 策略
|
|
28
|
+
- 以 `rollback` / `回滚` 开头 → 加载 `git-action` 策略
|
|
29
|
+
- 以 `review` / `审查` 开头 → 加载 `review-audit` 策略
|
|
30
|
+
- 以 `clean` 开头且含 `branch` → 加载 `git-action` 策略
|
|
31
|
+
|
|
32
|
+
如果命中逃生舱或快捷路由,跳到 Phase 3。否则继续 Phase 1。
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Phase 1: 意图分析 [required]
|
|
37
|
+
|
|
38
|
+
### 1.1 获取项目上下文 [required · 不可跳过]
|
|
39
|
+
|
|
40
|
+
**先行动,再判断**。必须执行以下操作获取上下文:
|
|
41
|
+
|
|
42
|
+
1. `git status` — 当前变更状态、分支信息
|
|
43
|
+
2. 读取项目配置文件(`package.json` / `go.mod` / `pyproject.toml` / `Cargo.toml` 等,取存在的第一个)— 技术栈
|
|
44
|
+
3. 快速浏览目录结构(`ls` 或 `find . -maxdepth 2 -type f | head -30`)— 项目规模
|
|
45
|
+
|
|
46
|
+
### 1.2 任务类型分类
|
|
47
|
+
|
|
48
|
+
根据 `$ARGUMENTS` 中的关键词和语义判断:
|
|
49
|
+
|
|
50
|
+
| 类型 | 信号词(中/英) |
|
|
51
|
+
|------|----------------|
|
|
52
|
+
| **bug-fix** | fix, bug, error, 500, crash, 报错, 修复, broken, 坏了, 失败, failed |
|
|
53
|
+
| **feature** | add, implement, create, 新增, 添加, 开发, build, 做一个, 加一个 |
|
|
54
|
+
| **refactor** | refactor, restructure, 重构, extract, simplify, clean up, 整理 |
|
|
55
|
+
| **research** | what, how, compare, 分析, 研究, 方案, 调研, 评估, 对比, 怎么做 |
|
|
56
|
+
| **optimize** | performance, optimize, speed, slow, 优化, 性能, latency, 慢 |
|
|
57
|
+
| **review** | review, audit, check quality, 审查, 审计, 看看代码 |
|
|
58
|
+
| **git** | commit, rollback, branch, merge, push, clean, worktree, 提交, 回滚 |
|
|
59
|
+
|
|
60
|
+
如果多个类型匹配,选择最核心的那个(动词决定类型,形容词/名词决定领域)。
|
|
61
|
+
|
|
62
|
+
### 1.3 复杂度评估
|
|
63
|
+
|
|
64
|
+
**基于 Phase 1.1 获取的项目上下文**评估,不是凭空猜测:
|
|
65
|
+
|
|
66
|
+
| 级别 | 判定标准 |
|
|
67
|
+
|------|---------|
|
|
68
|
+
| **S** | 单文件变更,范围清晰,预估 <30 行 |
|
|
69
|
+
| **M** | 2-5 文件,单模块内,路径明确 |
|
|
70
|
+
| **L** | 5+ 文件,跨模块,需要规划和协调 |
|
|
71
|
+
| **XL** | 架构级变更,API/Schema 变动,多模块协作 |
|
|
72
|
+
|
|
73
|
+
**不确定时默认选高一级**。
|
|
74
|
+
|
|
75
|
+
### 1.4 风险评估
|
|
76
|
+
|
|
77
|
+
| 级别 | 判定标准 |
|
|
78
|
+
|------|---------|
|
|
79
|
+
| **low** | 无生产影响,可逆,有测试覆盖 |
|
|
80
|
+
| **medium** | 修改现有行为,需要测试验证 |
|
|
81
|
+
| **high** | API 契约变更,数据库迁移,认证/加密逻辑 |
|
|
82
|
+
|
|
83
|
+
### 1.5 领域检测
|
|
84
|
+
|
|
85
|
+
从 `$ARGUMENTS` + 项目上下文推断:
|
|
86
|
+
- **frontend** — UI, component, CSS, React, Vue, Angular, style, layout, 页面, 组件
|
|
87
|
+
- **backend** — API, database, server, endpoint, auth, queue, 接口, 数据库
|
|
88
|
+
- **fullstack** — 同时涉及前底层控制
|
|
89
|
+
- **security** — vulnerability, auth, injection, encryption, 漏洞, 认证
|
|
90
|
+
- **devops** — CI/CD, Docker, deploy, infrastructure, 部署, 运维
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Phase 2: 策略选择
|
|
95
|
+
|
|
96
|
+
展示分析结果,用户可纠正:
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
📋 CCG 分析
|
|
100
|
+
任务: [type] 复杂度: [S/M/L/XL] 领域: [domain] 风险: [level]
|
|
101
|
+
策略: [strategy] — [一句话说明]
|
|
102
|
+
📍 Next: 加载策略并开始执行
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### 决策矩阵
|
|
106
|
+
|
|
107
|
+
| 类型 \ 复杂度 | S | M | L / XL |
|
|
108
|
+
|--------------|---|---|--------|
|
|
109
|
+
| **bug-fix** | direct-fix | debug-investigate | debug-investigate |
|
|
110
|
+
| **feature** | quick-implement | guided-develop | full-collaborate |
|
|
111
|
+
| **refactor** | direct-fix | refactor-safely | refactor-safely |
|
|
112
|
+
| **research** | deep-research | deep-research | deep-research |
|
|
113
|
+
| **optimize** | optimize-measure | optimize-measure | optimize-measure |
|
|
114
|
+
| **review** | review-audit | review-audit | review-audit |
|
|
115
|
+
| **git** | git-action | git-action | git-action |
|
|
116
|
+
|
|
117
|
+
**风险修正**:如果风险为 high 且策略不含外部模型审查,升级一档(如 direct-fix → debug-investigate)。
|
|
118
|
+
|
|
119
|
+
### ⛔ 创建任务 [required · 策略加载前必须完成]
|
|
120
|
+
|
|
121
|
+
如果复杂度 ≥ M **且策略不是 git-action**,**必须先创建任务目录再加载策略**:
|
|
122
|
+
|
|
123
|
+
**Step 1**: 生成任务名 — 用户请求核心词转 kebab-case(如 `add-oauth2-login`、`fix-api-timeout`)
|
|
124
|
+
**Step 2**: 执行命令创建目录和文件:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
mkdir -p .ccg/tasks/{task-name}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**Step 3**: 获取当前 git 分支名:`git rev-parse --abbrev-ref HEAD`
|
|
131
|
+
|
|
132
|
+
**Step 4**: 写入 `.ccg/tasks/{task-name}/task.json`:
|
|
133
|
+
|
|
134
|
+
```json
|
|
135
|
+
{
|
|
136
|
+
"id": "{task-name}",
|
|
137
|
+
"title": "{用户请求一句话摘要}",
|
|
138
|
+
"status": "in_progress",
|
|
139
|
+
"strategy": "{selected-strategy}",
|
|
140
|
+
"currentPhase": "1",
|
|
141
|
+
"nextAction": "{策略第一阶段的描述}",
|
|
142
|
+
"gate": null,
|
|
143
|
+
"branch": "{当前 git 分支}",
|
|
144
|
+
"scope": "{task-name}",
|
|
145
|
+
"createdAt": "{当前 ISO 日期时间}"
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
**Step 5**: 创建 `.ccg/tasks/{task-name}/context.jsonl` 种子文件:
|
|
150
|
+
- 第一行写种子示例:`{"_example": "Fill with {\"file\": \"path\", \"reason\": \"why\"}. Seed rows are skipped."}`
|
|
151
|
+
- 如果 `.ccg/spec/` 存在 → 追加 spec 文件条目
|
|
152
|
+
|
|
153
|
+
**复杂度 S → 跳过任务创建**(保持轻量)。
|
|
154
|
+
|
|
155
|
+
**确认任务已创建后**,输出:
|
|
156
|
+
```
|
|
157
|
+
✅ Task created: .ccg/tasks/{task-name}/
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### 加载策略
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
Read("~/.claude/.ccg/engine/strategies/{selected-strategy}.md")
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
如果用户对分析结果提出异议(如"用完整协作模式"),**接受用户覆盖**,加载指定策略。
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Phase 3: 执行策略
|
|
171
|
+
|
|
172
|
+
严格按照加载的策略文件执行。遵守以下原则:
|
|
173
|
+
|
|
174
|
+
1. 标记为 `[required]` 的阶段**不可跳过**
|
|
175
|
+
2. 标记为 `HARD STOP` 的 Gate **必须等待用户确认**
|
|
176
|
+
3. 策略文件底部的 `## 铁律` 区块必须遵守
|
|
177
|
+
4. 如需调用外部模型,先 `Read("~/.claude/.ccg/engine/model-router.md")` 获取调用模板
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## 铁律(MUST NOT)
|
|
182
|
+
|
|
183
|
+
1. **不可在未获取项目上下文的情况下评估复杂度** — Phase 1.1 不可跳过
|
|
184
|
+
2. **不可自行发明逃生舱** — 只有 Phase 0 明确列出的短语才能跳过分析
|
|
185
|
+
3. **不可在用户未确认的情况下降级策略** — 可升级,不可降级
|
|
186
|
+
4. **M+ 复杂度必须先创建 Task 再加载策略** — 没有 `task.json` 就没有 Hook 面包屑注入,等于丢失状态追踪
|
|
187
|
+
5. **不可跳过策略中 [required] 标记的阶段** — 即使"看起来很简单"
|
|
188
|
+
6. **复杂度有疑问时,默认选高一级** — 宁可多做一步,不可漏掉关键步骤
|
|
189
|
+
7. **⛔ 写代码前必须让用户选择执行模式** — 如果策略包含执行模式选择(Agent Teams / Codex / Claude),你**必须明确向用户展示选项并等待回复**。不可默认选择任何模式,不可跳过选择直接开始写代码。违反此条 = 最严重的流程失控
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## 附录:策略一览
|
|
194
|
+
|
|
195
|
+
| 策略 | 适用场景 | 外部模型 |
|
|
196
|
+
|------|---------|---------|
|
|
197
|
+
| `direct-fix` | 简单修复,范围清晰 | 无 |
|
|
198
|
+
| `quick-implement` | 小功能,单文件/组件 | 无 |
|
|
199
|
+
| `guided-develop` | 中等功能,需要规划 | 可选单模型 |
|
|
200
|
+
| `full-collaborate` | 复杂功能,需要多模型协作 | 双模型并行 |
|
|
201
|
+
| `debug-investigate` | 复杂调试,原因不明 | 双模型并行 |
|
|
202
|
+
| `refactor-safely` | 代码重构,需要安全保障 | 可选 |
|
|
203
|
+
| `deep-research` | 技术研究,方案对比 | 双模型探索 |
|
|
204
|
+
| `optimize-measure` | 性能优化,需要度量 | 可选 |
|
|
205
|
+
| `review-audit` | 代码审查 | 双模型交叉 |
|
|
206
|
+
| `git-action` | Git 操作 | 无(委托现有命令) |
|
|
@@ -49,7 +49,7 @@ Task({
|
|
|
49
49
|
```
|
|
50
50
|
Task({
|
|
51
51
|
subagent_type: "init-architect",
|
|
52
|
-
prompt: "扫描项目并生成 CLAUDE.md 文档。\n\n项目摘要:$ARGUMENTS\n当前时间戳:$TIMESTAMP\n
|
|
52
|
+
prompt: "扫描项目并生成 CLAUDE.md 文档。\n\n项目摘要:$ARGUMENTS\n当前时间戳:$TIMESTAMP\n工作目录:{{WORKDIR}}\n\n请执行:\n1. 阶段 A:全仓清点(文件统计、模块识别)\n2. 阶段 B:模块优先扫描(入口、接口、依赖、测试)\n3. 阶段 C:深度补捞(按需)\n4. 阶段 D:生成文档(根级 + 模块级 CLAUDE.md)\n\n输出覆盖率报告与推荐下一步。",
|
|
53
53
|
description: "初始化项目文档"
|
|
54
54
|
})
|
|
55
55
|
```
|
|
@@ -9,20 +9,30 @@ description: '按规范执行 + 多模型协作 + 归档'
|
|
|
9
9
|
- Minimize documentation—prefer self-explanatory code over comments.
|
|
10
10
|
|
|
11
11
|
**Guardrails**
|
|
12
|
-
- **NEVER** apply
|
|
12
|
+
- **NEVER** apply 底层控制/上层应用模型 prototypes directly—all outputs are reference only.
|
|
13
13
|
- **MANDATORY**: Request `unified diff patch` format from external models; they have zero write permission.
|
|
14
14
|
- Keep implementation strictly within `tasks.md` scope—no scope creep.
|
|
15
15
|
- Refer to `openspec/config.yaml` for conventions.
|
|
16
|
+
- **USER GUIDANCE RULE**: When suggesting next steps to the user, ALWAYS use CCG commands (`/ccg:spec-research`, `/ccg:spec-plan`, `/ccg:spec-impl`, `/ccg:spec-review`). NEVER suggest `/opsx:*` commands to the user. If OpenSpec CLI returns error messages referencing OPSX skills, translate them to CCG equivalents.
|
|
17
|
+
- **TASKS FORMAT RULE**: When generating or modifying `tasks.md`, ALL tasks MUST use checkbox format (`- [ ] X.Y description`). Heading+bullet format will cause OpenSpec CLI to parse 0 tasks and block the workflow.
|
|
16
18
|
|
|
17
19
|
**Steps**
|
|
18
20
|
1. **Select Change**
|
|
19
|
-
- Run
|
|
21
|
+
- Run `openspec list --json` to inspect Active Changes.
|
|
20
22
|
- Confirm with user which change ID to implement.
|
|
21
|
-
- Run
|
|
22
|
-
|
|
23
|
-
2. **Apply OPSX Change**
|
|
24
|
-
-
|
|
25
|
-
|
|
23
|
+
- Run `openspec status --change "<change_id>" --json` to review tasks.
|
|
24
|
+
|
|
25
|
+
2. **Apply OPSX Change (Pre-flight Check)**
|
|
26
|
+
- Call `/opsx:apply` internally to enter implementation mode:
|
|
27
|
+
```
|
|
28
|
+
/opsx:apply
|
|
29
|
+
```
|
|
30
|
+
- This will load the change context and guide you through the tasks defined in `tasks.md`.
|
|
31
|
+
- **Note**: This is an internal call. If this step fails, guide the user to re-run `/ccg:spec-impl`.
|
|
32
|
+
- **HARD GATE**: Check the returned `state` field:
|
|
33
|
+
- If `state: "blocked"` → STOP immediately. Inform the user which artifacts are missing and suggest: "Run `/ccg:spec-plan` to generate missing artifacts first."
|
|
34
|
+
- If `progress.total === 0` → STOP immediately. Inform: "tasks.md has no parseable tasks. Run `/ccg:spec-plan` to regenerate."
|
|
35
|
+
- Only proceed to Step 3 when `state: "ready"` and `progress.total > 0`.
|
|
26
36
|
|
|
27
37
|
3. **Identify Minimal Verifiable Phase**
|
|
28
38
|
- Review `tasks.md` and identify the **smallest verifiable phase**.
|
|
@@ -30,12 +40,14 @@ description: '按规范执行 + 多模型协作 + 归档'
|
|
|
30
40
|
- Announce: "Implementing Phase X: [task group name]"
|
|
31
41
|
|
|
32
42
|
4. **Route Tasks to Appropriate Model**
|
|
33
|
-
- **Route A:
|
|
34
|
-
- **Route B:
|
|
43
|
+
- **Route A: {{FRONTEND_PRIMARY}}** — Frontend/UI/styling (CSS, React, Vue, HTML, components)
|
|
44
|
+
- **Route B: {{BACKEND_PRIMARY}}** — Backend/logic/algorithm (API, data processing, business logic)
|
|
45
|
+
|
|
46
|
+
**工作目录**:`{{WORKDIR}}` **必须通过 Bash 执行 `pwd`(Unix)或 `cd`(Windows CMD)获取当前工作目录的绝对路径**,禁止从 `$HOME` 或环境变量推断。如果用户通过 `/add-dir` 添加了多个工作区,先确定任务相关的工作区。
|
|
35
47
|
|
|
36
48
|
For each task:
|
|
37
49
|
```
|
|
38
|
-
codeagent-wrapper --backend <
|
|
50
|
+
codeagent-wrapper --progress --backend <{{BACKEND_PRIMARY}}|{{FRONTEND_PRIMARY}}> {{GEMINI_MODEL_FLAG}}- "{{WORKDIR}}" <<'EOF'
|
|
39
51
|
TASK: <task description from tasks.md>
|
|
40
52
|
CONTEXT: <relevant code context>
|
|
41
53
|
CONSTRAINTS: <constraints from spec>
|
|
@@ -43,6 +55,8 @@ description: '按规范执行 + 多模型协作 + 归档'
|
|
|
43
55
|
EOF
|
|
44
56
|
```
|
|
45
57
|
|
|
58
|
+
**会话复用**:保存返回的 `SESSION_ID:`({{BACKEND_PRIMARY}} → `CODEX_PROTO_SESSION`,{{FRONTEND_PRIMARY}} → `GEMINI_PROTO_SESSION`),Step 7 审查时复用。
|
|
59
|
+
|
|
46
60
|
5. **Rewrite Prototype to Production Code**
|
|
47
61
|
Upon receiving diff patch, **NEVER apply directly**. Rewrite by:
|
|
48
62
|
- Removing redundancy
|
|
@@ -61,28 +75,28 @@ description: '按规范执行 + 多模型协作 + 归档'
|
|
|
61
75
|
If issues found, make targeted corrections.
|
|
62
76
|
|
|
63
77
|
7. **Multi-Model Review (PARALLEL)**
|
|
64
|
-
- **CRITICAL**: You MUST launch BOTH
|
|
78
|
+
- **CRITICAL**: You MUST launch BOTH {{BACKEND_PRIMARY}} AND {{FRONTEND_PRIMARY}} in a SINGLE message with TWO Bash tool calls.
|
|
65
79
|
- **DO NOT** call one model first and wait. Launch BOTH simultaneously with `run_in_background: true`.
|
|
66
80
|
|
|
67
81
|
**Step 7.1**: In ONE message, make TWO parallel Bash calls:
|
|
68
82
|
|
|
69
|
-
**FIRST Bash call (
|
|
83
|
+
**FIRST Bash call ({{BACKEND_PRIMARY}})**:
|
|
70
84
|
```
|
|
71
85
|
Bash({
|
|
72
|
-
command: "~/.claude/bin/codeagent-wrapper --backend
|
|
86
|
+
command: "~/.claude/bin/codeagent-wrapper --progress --backend {{BACKEND_PRIMARY}} {{GEMINI_MODEL_FLAG}}resume <CODEX_PROTO_SESSION> - \"{{WORKDIR}}\" <<'EOF'\nReview the implementation changes:\n- Correctness: logic errors, edge cases\n- Security: injection, auth issues\n- Spec compliance: constraints satisfied\nOUTPUT: JSON with findings\nEOF",
|
|
73
87
|
run_in_background: true,
|
|
74
88
|
timeout: 300000,
|
|
75
|
-
description: "
|
|
89
|
+
description: "{{BACKEND_PRIMARY}}: correctness/security review"
|
|
76
90
|
})
|
|
77
91
|
```
|
|
78
92
|
|
|
79
|
-
**SECOND Bash call (
|
|
93
|
+
**SECOND Bash call ({{FRONTEND_PRIMARY}}) - IN THE SAME MESSAGE**:
|
|
80
94
|
```
|
|
81
95
|
Bash({
|
|
82
|
-
command: "~/.claude/bin/codeagent-wrapper --backend
|
|
96
|
+
command: "~/.claude/bin/codeagent-wrapper --progress --backend {{FRONTEND_PRIMARY}} {{GEMINI_MODEL_FLAG}}resume <GEMINI_PROTO_SESSION> - \"{{WORKDIR}}\" <<'EOF'\nReview the implementation changes:\n- Maintainability: readability, complexity\n- Patterns: consistency with project style\n- Integration: cross-module impacts\nOUTPUT: JSON with findings\nEOF",
|
|
83
97
|
run_in_background: true,
|
|
84
98
|
timeout: 300000,
|
|
85
|
-
description: "
|
|
99
|
+
description: "{{FRONTEND_PRIMARY}}: maintainability/patterns review"
|
|
86
100
|
})
|
|
87
101
|
```
|
|
88
102
|
|
|
@@ -92,6 +106,9 @@ description: '按规范执行 + 多模型协作 + 归档'
|
|
|
92
106
|
TaskOutput({ task_id: "<gemini_task_id>", block: true, timeout: 600000 })
|
|
93
107
|
```
|
|
94
108
|
|
|
109
|
+
⛔ **上层应用模型失败必须重试**:若上层应用模型调用失败,最多重试 2 次(间隔 5 秒)。3 次全败才跳过。
|
|
110
|
+
⛔ **底层控制模型结果必须等待**:底层控制模型执行 5-15 分钟属正常,超时后继续轮询,禁止跳过。
|
|
111
|
+
|
|
95
112
|
Address any critical findings before proceeding.
|
|
96
113
|
|
|
97
114
|
8. **Update Task Status**
|
|
@@ -105,13 +122,16 @@ description: '按规范执行 + 多模型协作 + 归档'
|
|
|
105
122
|
|
|
106
123
|
10. **Archive on Completion**
|
|
107
124
|
- When ALL tasks in `tasks.md` are marked `[x]`:
|
|
108
|
-
-
|
|
125
|
+
- Call `/opsx:archive` internally to archive the change:
|
|
126
|
+
```
|
|
127
|
+
/opsx:archive
|
|
128
|
+
```
|
|
109
129
|
- This merges spec deltas to `openspec/specs/` and moves change to archive.
|
|
130
|
+
- **Note**: This is an internal call. If archiving fails, guide the user to re-run `/ccg:spec-impl`.
|
|
110
131
|
|
|
111
132
|
**Reference**
|
|
112
|
-
- Check task status:
|
|
113
|
-
-
|
|
114
|
-
- View active changes: `/opsx:list`
|
|
133
|
+
- Check task status: `openspec status --change "<id>" --json`
|
|
134
|
+
- View active changes: `openspec list --json`
|
|
115
135
|
- Search existing patterns: `rg -n "function|class" <file>`
|
|
116
136
|
|
|
117
137
|
**Exit Criteria**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: '初始化 OpenSpec (OPSX) 环境 + 验证多模型 MCP
|
|
2
|
+
description: '初始化 OpenSpec (OPSX) 环境 + 验证多模型 MCP 工具'
|
|
3
3
|
---
|
|
4
4
|
<!-- CCG:SPEC:INIT:START -->
|
|
5
5
|
**Core Philosophy**
|
|
@@ -38,15 +38,20 @@ description: '初始化 OpenSpec (OPSX) 环境 + 验证多模型 MCP 工具(RO
|
|
|
38
38
|
```
|
|
39
39
|
- **Note**: Always use `openspec` (not `opsx`) for CLI commands.
|
|
40
40
|
|
|
41
|
-
3. **Initialize OPSX for Current
|
|
41
|
+
3. **Initialize OPSX for Current Project**
|
|
42
|
+
- **重要**:所有命令必须在当前工作目录下执行,禁止 `cd` 到其他路径。如不确定当前目录,先执行 `pwd` 确认。
|
|
42
43
|
- Check if already initialized:
|
|
43
44
|
```bash
|
|
44
45
|
ls -la openspec/ .claude/skills/openspec-* 2>/dev/null || echo "Not initialized"
|
|
45
46
|
```
|
|
46
|
-
- If not initialized, run:
|
|
47
|
+
- If not initialized, run interactive setup (v1.2+ auto-detects AI tools):
|
|
47
48
|
```bash
|
|
48
|
-
npx @fission-ai/openspec init
|
|
49
|
+
npx @fission-ai/openspec init
|
|
49
50
|
```
|
|
51
|
+
- **Profile Selection** (v1.2+):
|
|
52
|
+
- `core` profile (default): 4 essential workflows (`propose`, `explore`, `apply`, `archive`)
|
|
53
|
+
- `custom` profile: Pick any subset of workflows
|
|
54
|
+
- To change profile later: `openspec config profile`
|
|
50
55
|
- Verify initialization:
|
|
51
56
|
- Check `openspec/` directory exists
|
|
52
57
|
- Check `.claude/skills/` contains `openspec-*` skills
|
|
@@ -55,27 +60,18 @@ description: '初始化 OpenSpec (OPSX) 环境 + 验证多模型 MCP 工具(RO
|
|
|
55
60
|
|
|
56
61
|
4. **Validate Multi-Model MCP Tools**
|
|
57
62
|
- Check `codeagent-wrapper` availability: `~/.claude/bin/codeagent-wrapper --version`
|
|
58
|
-
- **工作目录**:`{{WORKDIR}}`
|
|
59
|
-
- Test
|
|
63
|
+
- **工作目录**:`{{WORKDIR}}` **必须通过 Bash 执行 `pwd`(Unix)或 `cd`(Windows CMD)获取当前工作目录的绝对路径**,禁止从 `$HOME` 或环境变量推断。如果用户通过 `/add-dir` 添加了多个工作区,先确定任务相关的工作区。
|
|
64
|
+
- Test {{BACKEND_PRIMARY}} backend:
|
|
60
65
|
```bash
|
|
61
|
-
~/.claude/bin/codeagent-wrapper --backend
|
|
66
|
+
echo "echo test" | ~/.claude/bin/codeagent-wrapper --backend {{BACKEND_PRIMARY}} {{GEMINI_MODEL_FLAG}}- "{{WORKDIR}}"
|
|
62
67
|
```
|
|
63
|
-
- Test
|
|
68
|
+
- Test {{FRONTEND_PRIMARY}} backend:
|
|
64
69
|
```bash
|
|
65
|
-
~/.claude/bin/codeagent-wrapper --backend
|
|
70
|
+
echo "echo test" | ~/.claude/bin/codeagent-wrapper --backend {{FRONTEND_PRIMARY}} {{GEMINI_MODEL_FLAG}}- "{{WORKDIR}}"
|
|
66
71
|
```
|
|
67
72
|
- For each unavailable tool, display warning with installation instructions.
|
|
68
73
|
|
|
69
|
-
5. **
|
|
70
|
-
- **Check Active Tool**: Is `{{MCP_SEARCH_TOOL}}` available in the current session?
|
|
71
|
-
- **Check Configuration**: If tool is missing, check `~/.claude.json` for `"ace-tool"` or `"ace-tool-rs"` in `mcpServers`.
|
|
72
|
-
- **Diagnosis**:
|
|
73
|
-
- If tool available: Mark as "✓ Active".
|
|
74
|
-
- If config exists but tool missing: Mark as "⚠️ Configured but inactive (Try restarting Claude)".
|
|
75
|
-
- If neither: Mark as "○ Not installed (Optional)".
|
|
76
|
-
- If not installed/configured, suggest: "Run `npx ccg-ros2-workflow` and select ace-tool MCP option."
|
|
77
|
-
|
|
78
|
-
6. **Summary Report**
|
|
74
|
+
5. **Summary Report**
|
|
79
75
|
Display status table:
|
|
80
76
|
```
|
|
81
77
|
Component Status
|
|
@@ -84,9 +80,8 @@ description: '初始化 OpenSpec (OPSX) 环境 + 验证多模型 MCP 工具(RO
|
|
|
84
80
|
Project initialized ✓/✗
|
|
85
81
|
OPSX Skills ✓/✗
|
|
86
82
|
codeagent-wrapper ✓/✗
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
ace-tool MCP ✓/✗ (optional)
|
|
83
|
+
{{BACKEND_PRIMARY}} backend ✓/✗
|
|
84
|
+
{{FRONTEND_PRIMARY}} backend ✓/✗
|
|
90
85
|
```
|
|
91
86
|
|
|
92
87
|
**Next Steps (Use CCG Encapsulated Commands)**
|
|
@@ -99,9 +94,8 @@ description: '初始化 OpenSpec (OPSX) 环境 + 验证多模型 MCP 工具(RO
|
|
|
99
94
|
|
|
100
95
|
**Reference**
|
|
101
96
|
- OpenSpec (OPSX) CLI: `npx @fission-ai/openspec --help`
|
|
102
|
-
-
|
|
103
|
-
- CCG
|
|
104
|
-
-
|
|
105
|
-
- Node.js >=
|
|
106
|
-
- ROS2 Humble: https://docs.ros.org/en/humble/
|
|
97
|
+
- Profile Management: `openspec config profile`
|
|
98
|
+
- CCG Workflow: `npx ccg-ros2-workflow`
|
|
99
|
+
- 底层控制/上层应用模型 MCP: Bundled with codeagent-wrapper
|
|
100
|
+
- Node.js >= 18.x required for OpenSpec
|
|
107
101
|
<!-- CCG:SPEC:INIT:END -->
|
|
@@ -10,39 +10,43 @@ description: '多模型分析 → 消除歧义 → 零决策可执行计划'
|
|
|
10
10
|
|
|
11
11
|
**Guardrails**
|
|
12
12
|
- Do not proceed to implementation until every ambiguity is resolved.
|
|
13
|
-
- Multi-model collaboration is **mandatory**: use both
|
|
13
|
+
- Multi-model collaboration is **mandatory**: use both {{BACKEND_PRIMARY}} and {{FRONTEND_PRIMARY}}.
|
|
14
14
|
- If constraints cannot be fully specified, escalate to user or return to research phase.
|
|
15
15
|
- Refer to `openspec/config.yaml` for project conventions.
|
|
16
|
+
- **USER GUIDANCE RULE**: When suggesting next steps to the user, ALWAYS use CCG commands (`/ccg:spec-research`, `/ccg:spec-plan`, `/ccg:spec-impl`, `/ccg:spec-review`). NEVER suggest `/opsx:*` commands to the user. If OpenSpec CLI returns error messages referencing OPSX skills, translate them to CCG equivalents.
|
|
17
|
+
- **TASKS FORMAT RULE**: When generating or modifying `tasks.md`, ALL tasks MUST use checkbox format (`- [ ] X.Y description`). Heading+bullet format will cause OpenSpec CLI to parse 0 tasks and block the workflow.
|
|
18
|
+
- **PHASE BOUNDARY**: This phase ONLY generates OPSX artifacts (specs.md, design.md, tasks.md). Do NOT modify any source code. Do NOT proceed to implementation. After artifacts are generated, STOP and inform the user: "Plan complete. Run `/ccg:spec-impl` to start implementation."
|
|
16
19
|
|
|
17
20
|
**Steps**
|
|
18
21
|
1. **Select Change**
|
|
19
|
-
- Run
|
|
22
|
+
- Run `openspec list --json` to display Active Changes.
|
|
20
23
|
- Confirm with user which change ID to refine.
|
|
21
|
-
- Run
|
|
24
|
+
- Run `openspec status --change "<change_id>" --json` to review current state.
|
|
22
25
|
|
|
23
26
|
2. **Multi-Model Implementation Analysis (PARALLEL)**
|
|
24
|
-
- **CRITICAL**: You MUST launch BOTH
|
|
27
|
+
- **CRITICAL**: You MUST launch BOTH {{BACKEND_PRIMARY}} AND {{FRONTEND_PRIMARY}} in a SINGLE message with TWO Bash tool calls.
|
|
25
28
|
- **DO NOT** call one model first and wait. Launch BOTH simultaneously with `run_in_background: true`.
|
|
29
|
+
- **工作目录**:`{{WORKDIR}}` **必须通过 Bash 执行 `pwd`(Unix)或 `cd`(Windows CMD)获取当前工作目录的绝对路径**,禁止从 `$HOME` 或环境变量推断。如果用户通过 `/add-dir` 添加了多个工作区,先确定任务相关的工作区。
|
|
26
30
|
|
|
27
31
|
**Step 2.1**: In ONE message, make TWO parallel Bash calls:
|
|
28
32
|
|
|
29
|
-
**FIRST Bash call (
|
|
33
|
+
**FIRST Bash call ({{BACKEND_PRIMARY}})**:
|
|
30
34
|
```
|
|
31
35
|
Bash({
|
|
32
|
-
command: "~/.claude/bin/codeagent-wrapper --backend
|
|
36
|
+
command: "~/.claude/bin/codeagent-wrapper --progress --backend {{BACKEND_PRIMARY}} {{GEMINI_MODEL_FLAG}}- \"{{WORKDIR}}\" <<'EOF'\nAnalyze change <change_id> from backend perspective:\n- Implementation approach\n- Technical risks\n- Alternative architectures\n- Edge cases and failure modes\nOUTPUT: JSON with analysis\nEOF",
|
|
33
37
|
run_in_background: true,
|
|
34
38
|
timeout: 300000,
|
|
35
|
-
description: "
|
|
39
|
+
description: "{{BACKEND_PRIMARY}}: backend analysis"
|
|
36
40
|
})
|
|
37
41
|
```
|
|
38
42
|
|
|
39
|
-
**SECOND Bash call (
|
|
43
|
+
**SECOND Bash call ({{FRONTEND_PRIMARY}}) - IN THE SAME MESSAGE**:
|
|
40
44
|
```
|
|
41
45
|
Bash({
|
|
42
|
-
command: "~/.claude/bin/codeagent-wrapper --backend
|
|
46
|
+
command: "~/.claude/bin/codeagent-wrapper --progress --backend {{FRONTEND_PRIMARY}} {{GEMINI_MODEL_FLAG}}- \"{{WORKDIR}}\" <<'EOF'\nAnalyze change <change_id> from frontend/integration perspective:\n- Maintainability assessment\n- Scalability considerations\n- Integration conflicts\nOUTPUT: JSON with analysis\nEOF",
|
|
43
47
|
run_in_background: true,
|
|
44
48
|
timeout: 300000,
|
|
45
|
-
description: "
|
|
49
|
+
description: "{{FRONTEND_PRIMARY}}: frontend analysis"
|
|
46
50
|
})
|
|
47
51
|
```
|
|
48
52
|
|
|
@@ -52,11 +56,14 @@ description: '多模型分析 → 消除歧义 → 零决策可执行计划'
|
|
|
52
56
|
TaskOutput({ task_id: "<gemini_task_id>", block: true, timeout: 600000 })
|
|
53
57
|
```
|
|
54
58
|
|
|
59
|
+
⛔ **上层应用模型失败必须重试**:若上层应用模型调用失败,最多重试 2 次(间隔 5 秒)。3 次全败才跳过。
|
|
60
|
+
⛔ **底层控制模型结果必须等待**:底层控制模型执行 5-15 分钟属正常,超时后继续轮询,禁止跳过。
|
|
61
|
+
|
|
55
62
|
- Synthesize responses and present consolidated options to user.
|
|
56
63
|
|
|
57
64
|
3. **Uncertainty Elimination Audit**
|
|
58
|
-
- **
|
|
59
|
-
- **
|
|
65
|
+
- **{{BACKEND_PRIMARY}}**: "Review proposal for unspecified decision points. List each as: [AMBIGUITY] → [REQUIRED CONSTRAINT]"
|
|
66
|
+
- **{{FRONTEND_PRIMARY}}**: "Identify implicit assumptions. Specify: [ASSUMPTION] → [EXPLICIT CONSTRAINT NEEDED]"
|
|
60
67
|
|
|
61
68
|
**Anti-Pattern Detection** (flag and reject):
|
|
62
69
|
- Information collection without decision boundaries
|
|
@@ -71,8 +78,8 @@ description: '多模型分析 → 消除歧义 → 零决策可执行计划'
|
|
|
71
78
|
Iterate with user until ALL ambiguities resolved.
|
|
72
79
|
|
|
73
80
|
4. **PBT Property Extraction**
|
|
74
|
-
- **
|
|
75
|
-
- **
|
|
81
|
+
- **{{BACKEND_PRIMARY}}**: "Extract PBT properties. For each requirement: [INVARIANT] → [FALSIFICATION STRATEGY]"
|
|
82
|
+
- **{{FRONTEND_PRIMARY}}**: "Define system properties: [PROPERTY] | [DEFINITION] | [BOUNDARY CONDITIONS] | [COUNTEREXAMPLE GENERATION]"
|
|
76
83
|
|
|
77
84
|
**Property Categories**:
|
|
78
85
|
- **Commutativity/Associativity**: Order-independent operations
|
|
@@ -83,11 +90,37 @@ description: '多模型分析 → 消除歧义 → 零决策可执行计划'
|
|
|
83
90
|
- **Bounds**: Value ranges, size limits, rate constraints
|
|
84
91
|
|
|
85
92
|
5. **Update OPSX Artifacts**
|
|
86
|
-
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
93
|
+
- **BEFORE calling `/opsx:continue`** (internal skill call — do NOT expose this command to user), output a structured summary for OPSX context:
|
|
94
|
+
```markdown
|
|
95
|
+
## Planning Summary for OPSX
|
|
96
|
+
|
|
97
|
+
**Multi-Model Analysis Results**:
|
|
98
|
+
- {{BACKEND_PRIMARY}} (Backend): [Key findings and recommendations]
|
|
99
|
+
- {{FRONTEND_PRIMARY}} (Frontend): [Key findings and recommendations]
|
|
100
|
+
- Consolidated Approach: [Selected implementation strategy]
|
|
101
|
+
|
|
102
|
+
**Resolved Constraints**:
|
|
103
|
+
- [All explicit constraints from Step 3]
|
|
104
|
+
|
|
105
|
+
**PBT Properties**:
|
|
106
|
+
- [All extracted properties from Step 4 with falsification strategies]
|
|
107
|
+
|
|
108
|
+
**Technical Decisions**:
|
|
109
|
+
- [All finalized technology choices, algorithms, configurations]
|
|
110
|
+
|
|
111
|
+
**Implementation Tasks**:
|
|
112
|
+
- [High-level task breakdown ready for tasks.md]
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
- Then call `/opsx:continue` internally to generate next artifacts:
|
|
116
|
+
```
|
|
117
|
+
/opsx:continue
|
|
118
|
+
```
|
|
119
|
+
- The OPSX skill will use the above summary to create specs.md, design.md, and tasks.md.
|
|
120
|
+
- **Note**: This is an internal call. If this step fails, guide the user to re-run `/ccg:spec-plan`.
|
|
121
|
+
- **STOP**: After artifacts are generated, verify they exist and inform user:
|
|
122
|
+
"Plan phase complete. Artifacts generated: specs.md, design.md, tasks.md. Run `/ccg:spec-impl` to start implementation."
|
|
123
|
+
Do NOT proceed to modify source code.
|
|
91
124
|
|
|
92
125
|
6. **Context Checkpoint**
|
|
93
126
|
- Report current context usage.
|
|
@@ -102,8 +135,8 @@ A change is ready for implementation only when:
|
|
|
102
135
|
- [ ] User has explicitly approved all constraint decisions
|
|
103
136
|
|
|
104
137
|
**Reference**
|
|
105
|
-
- Inspect change:
|
|
106
|
-
-
|
|
138
|
+
- Inspect change: `openspec status --change "<id>" --json`
|
|
139
|
+
- List changes: `openspec list --json`
|
|
107
140
|
- Search patterns: `rg -n "INVARIANT:|PROPERTY:" openspec/`
|
|
108
141
|
- Use `AskUserQuestion` for ANY ambiguity—never assume
|
|
109
142
|
<!-- CCG:SPEC:PLAN:END -->
|