ccg-workflow 2.1.16 → 3.0.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 +119 -250
- package/README.zh-CN.md +125 -258
- package/dist/cli.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/shared/{ccg-workflow.CewMlBCj.mjs → ccg-workflow.2vO_S-e7.mjs} +160 -34
- package/package.json +6 -30
- package/templates/commands/go.md +205 -0
- package/templates/commands-legacy/team.md +475 -0
- package/templates/engine/model-router.md +117 -0
- package/templates/engine/phase-guide.md +95 -0
- package/templates/engine/strategies/debug-investigate.md +162 -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 +305 -0
- package/templates/engine/strategies/git-action.md +43 -0
- package/templates/engine/strategies/guided-develop.md +214 -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 +163 -0
- package/templates/engine/strategies/review-audit.md +116 -0
- package/templates/hooks/session-start.js +100 -0
- package/templates/hooks/skill-router.js +144 -0
- package/templates/hooks/subagent-context.js +118 -0
- package/templates/hooks/task-utils.js +167 -0
- package/templates/hooks/workflow-state.js +39 -0
- package/templates/spec/backend/index.md +31 -0
- package/templates/spec/frontend/index.md +31 -0
- package/templates/spec/guides/index.md +30 -0
- /package/templates/{commands → commands-legacy}/analyze.md +0 -0
- /package/templates/{commands → commands-legacy}/backend.md +0 -0
- /package/templates/{commands → commands-legacy}/codex-exec.md +0 -0
- /package/templates/{commands → commands-legacy}/debug.md +0 -0
- /package/templates/{commands → commands-legacy}/enhance.md +0 -0
- /package/templates/{commands → commands-legacy}/execute.md +0 -0
- /package/templates/{commands → commands-legacy}/feat.md +0 -0
- /package/templates/{commands → commands-legacy}/frontend.md +0 -0
- /package/templates/{commands → commands-legacy}/optimize.md +0 -0
- /package/templates/{commands → commands-legacy}/plan.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-plan.md +0 -0
- /package/templates/{commands → commands-legacy}/team-research.md +0 -0
- /package/templates/{commands → commands-legacy}/team-review.md +0 -0
- /package/templates/{commands → commands-legacy}/test.md +0 -0
- /package/templates/{commands → commands-legacy}/workflow.md +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Backend Spec — 后端编码规范
|
|
2
|
+
|
|
3
|
+
> 本文件定义后端代码的编码规范。子 Agent 在写代码前会自动读取此文件。
|
|
4
|
+
> 按项目实际情况修改内容。
|
|
5
|
+
|
|
6
|
+
## API 规范
|
|
7
|
+
|
|
8
|
+
- 路由命名: RESTful, kebab-case
|
|
9
|
+
- 请求/响应格式: JSON, camelCase fields
|
|
10
|
+
- 错误格式: `{ "error": { "code": "...", "message": "..." } }`
|
|
11
|
+
- 认证: Bearer token in Authorization header
|
|
12
|
+
|
|
13
|
+
## 错误处理
|
|
14
|
+
|
|
15
|
+
- 所有 API 端点必须返回结构化错误
|
|
16
|
+
- 4xx: 客户端错误(验证失败、未授权等)
|
|
17
|
+
- 5xx: 服务端错误(包装内部异常,不暴露堆栈)
|
|
18
|
+
- 超时: 设置合理超时,超时后返回 504
|
|
19
|
+
|
|
20
|
+
## 测试要求
|
|
21
|
+
|
|
22
|
+
- 核心逻辑覆盖率 > 80%
|
|
23
|
+
- API 端点必须有集成测试
|
|
24
|
+
- 测试命名: `describe('模块') → it('should 行为')`
|
|
25
|
+
|
|
26
|
+
## 安全清单
|
|
27
|
+
|
|
28
|
+
- [ ] 输入验证(不信任任何用户输入)
|
|
29
|
+
- [ ] SQL 参数化(禁止字符串拼接)
|
|
30
|
+
- [ ] 密钥不硬编码(使用环境变量)
|
|
31
|
+
- [ ] 敏感数据日志脱敏
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Frontend Spec — 前端编码规范
|
|
2
|
+
|
|
3
|
+
> 本文件定义前端代码的编码规范。子 Agent 在写代码前会自动读取此文件。
|
|
4
|
+
> 按项目实际情况修改内容。
|
|
5
|
+
|
|
6
|
+
## 组件规范
|
|
7
|
+
|
|
8
|
+
- 组件命名: PascalCase
|
|
9
|
+
- 文件结构: 一个组件一个文件
|
|
10
|
+
- Props: TypeScript 接口定义,必须有类型
|
|
11
|
+
- 状态: 优先 local state,跨组件共享用 store
|
|
12
|
+
|
|
13
|
+
## 样式规范
|
|
14
|
+
|
|
15
|
+
- 方案: CSS Modules / Tailwind / styled-components(按项目选择)
|
|
16
|
+
- 命名: BEM 或 utility-first
|
|
17
|
+
- 响应式: mobile-first
|
|
18
|
+
- 主题: 使用 CSS 变量 / design tokens
|
|
19
|
+
|
|
20
|
+
## 可访问性
|
|
21
|
+
|
|
22
|
+
- [ ] 语义化 HTML(button 不用 div)
|
|
23
|
+
- [ ] ARIA 标签(交互元素必须有 label)
|
|
24
|
+
- [ ] 键盘导航(Tab 序和 Focus 管理)
|
|
25
|
+
- [ ] 颜色对比度 > 4.5:1
|
|
26
|
+
|
|
27
|
+
## 性能
|
|
28
|
+
|
|
29
|
+
- 图片: 使用 lazy loading + 合适格式(WebP)
|
|
30
|
+
- 包大小: 关注 bundle analyzer,避免大依赖
|
|
31
|
+
- 渲染: 避免不必要的 re-render
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Guides — 跨模块开发指南
|
|
2
|
+
|
|
3
|
+
> 本文件定义跨前后端的通用指南。适用于所有模块和子 Agent。
|
|
4
|
+
> 按项目实际情况修改内容。
|
|
5
|
+
|
|
6
|
+
## 架构原则
|
|
7
|
+
|
|
8
|
+
- 单一职责: 每个模块/函数只做一件事
|
|
9
|
+
- 依赖方向: 高层依赖低层,禁止循环
|
|
10
|
+
- 接口优先: 跨模块通过接口通信,不直接访问内部
|
|
11
|
+
|
|
12
|
+
## Git 提交规范
|
|
13
|
+
|
|
14
|
+
- 格式: Conventional Commits (`feat:`, `fix:`, `refactor:`, `docs:`, `chore:`)
|
|
15
|
+
- 原子提交: 一个逻辑变更一个 commit
|
|
16
|
+
- 不提交: `.env`, `node_modules/`, 编译产物, IDE 配置
|
|
17
|
+
|
|
18
|
+
## 代码审查清单
|
|
19
|
+
|
|
20
|
+
- [ ] 变更是否符合需求?
|
|
21
|
+
- [ ] 是否有测试覆盖?
|
|
22
|
+
- [ ] 是否引入安全风险?
|
|
23
|
+
- [ ] 是否有性能影响?
|
|
24
|
+
- [ ] 命名是否清晰?
|
|
25
|
+
|
|
26
|
+
## 文档要求
|
|
27
|
+
|
|
28
|
+
- 公共 API 必须有类型注释
|
|
29
|
+
- 复杂逻辑加注释说明 WHY(不是 WHAT)
|
|
30
|
+
- 新模块需要 README
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|