@baoanaz/cviauto 0.6.5 → 0.6.8
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/dist/templates/claude/agents/trellis-check.md +61 -61
- package/dist/templates/claude/agents/trellis-implement.md +58 -58
- package/dist/templates/claude/agents/trellis-research.md +67 -67
- package/dist/templates/codebuddy/agents/trellis-check.md +61 -61
- package/dist/templates/codebuddy/agents/trellis-implement.md +58 -58
- package/dist/templates/codebuddy/agents/trellis-research.md +67 -67
- package/dist/templates/codex/agents/trellis-check.toml +99 -30
- package/dist/templates/codex/agents/trellis-implement.toml +99 -16
- package/dist/templates/codex/agents/trellis-research.toml +116 -39
- package/dist/templates/common/bundled-skills/trellis-channel/SKILL.md +41 -41
- package/dist/templates/common/bundled-skills/trellis-channel/references/command-reference.md +194 -261
- package/dist/templates/common/bundled-skills/trellis-channel/references/forum.md +59 -93
- package/dist/templates/common/bundled-skills/trellis-channel/references/progress-debugging.md +72 -110
- package/dist/templates/common/bundled-skills/trellis-channel/references/workers.md +120 -171
- package/dist/templates/common/bundled-skills/trellis-channel/references/workflows.md +35 -43
- package/dist/templates/common/bundled-skills/trellis-meta/SKILL.md +78 -78
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/add-project-local-conventions.md +24 -24
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-agents.md +29 -29
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-context-loading.md +46 -46
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-hooks.md +28 -28
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-skills-or-commands.md +66 -66
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-spec-structure.md +32 -32
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-task-lifecycle.md +40 -40
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-workflow.md +40 -40
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/overview.md +44 -44
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/bundled-skills.md +79 -79
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/context-injection.md +37 -37
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/generated-files.md +43 -43
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/multi-agent-channel.md +47 -47
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/overview.md +40 -40
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/spec-system.md +33 -33
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/task-system.md +61 -61
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/workflow.md +41 -41
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/workspace-memory.md +31 -31
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md +40 -40
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/hooks-and-settings.md +40 -41
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.md +36 -36
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md +36 -38
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/skills-and-commands.md +52 -52
- package/dist/templates/common/bundled-skills/trellis-session-insight/SKILL.md +45 -45
- package/dist/templates/common/bundled-skills/trellis-session-insight/references/cli-quick-reference.md +41 -42
- package/dist/templates/common/bundled-skills/trellis-session-insight/references/triggering-patterns.md +28 -28
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/SKILL.md +30 -30
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/mcp-setup.md +34 -34
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/repository-analysis.md +30 -30
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-task-planning.md +39 -39
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-writing.md +40 -40
- package/dist/templates/common/commands/continue.md +28 -29
- package/dist/templates/common/commands/finish-work.md +32 -40
- package/dist/templates/cursor/agents/trellis-check.md +61 -61
- package/dist/templates/cursor/agents/trellis-implement.md +58 -58
- package/dist/templates/cursor/agents/trellis-research.md +67 -67
- package/dist/templates/droid/droids/trellis-check.md +64 -56
- package/dist/templates/droid/droids/trellis-implement.md +61 -53
- package/dist/templates/droid/droids/trellis-research.md +67 -67
- package/dist/templates/gemini/agents/trellis-check.md +64 -57
- package/dist/templates/gemini/agents/trellis-implement.md +61 -54
- package/dist/templates/gemini/agents/trellis-research.md +67 -67
- package/dist/templates/kiro/agents/trellis-check.json +15 -3
- package/dist/templates/kiro/agents/trellis-implement.json +15 -3
- package/dist/templates/kiro/agents/trellis-research.json +10 -2
- package/dist/templates/kiro/agents/trellis.json +19 -5
- package/dist/templates/opencode/agents/trellis-check.md +61 -61
- package/dist/templates/opencode/agents/trellis-implement.md +58 -59
- package/dist/templates/opencode/agents/trellis-research.md +67 -67
- package/dist/templates/pi/agents/trellis-check.md +99 -21
- package/dist/templates/pi/agents/trellis-implement.md +90 -22
- package/dist/templates/pi/agents/trellis-research.md +124 -12
- package/dist/templates/qoder/agents/trellis-check.md +64 -57
- package/dist/templates/qoder/agents/trellis-implement.md +61 -54
- package/dist/templates/qoder/agents/trellis-research.md +67 -67
- package/dist/templates/trae/agents/trellis-check.md +64 -57
- package/dist/templates/trae/agents/trellis-implement.md +61 -54
- package/dist/templates/trae/agents/trellis-research.md +67 -67
- package/dist/templates/trellis/agents/check.md +29 -29
- package/dist/templates/trellis/agents/implement.md +30 -30
- package/dist/templates/trellis/workflow.md +349 -356
- package/dist/templates/zcode/agents/trellis-check.md +64 -51
- package/dist/templates/zcode/agents/trellis-implement.md +61 -53
- package/package.json +2 -2
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 触发模式
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
用户的确切表述,这些表述应使 AI 主动使用 `cviauto mem`。根据这些模式校准直觉——如果用户消息匹配其中某个模式而你却没有使用 `mem`,那你很可能错过了一次明显的回忆检索。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
模式按表述背后的**意图**分组,而非表面用词。同一意图会以不同语言和语域出现。
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## 过往解决方案回忆
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
用户正在问"我们(或我)之前是怎么解决这个的"。过往对话中存有答案;代码库展示了结果而非推理过程。
|
|
10
10
|
|
|
11
11
|
- "How did we solve this last time?"
|
|
12
12
|
- "What did we end up doing about X?"
|
|
@@ -15,11 +15,11 @@ The user is asking "how did we (or I) solve this before". Past dialogue holds th
|
|
|
15
15
|
- "之前是怎么搞定 X 的?"
|
|
16
16
|
- "我记得以前修过类似的"
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
操作:`cviauto mem search "<症状关键词>" --global --limit 10`,然后对看起来最匹配的命中结果执行 `context`。
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
## 决策检索
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
用户正在引用一个存在于旧对话中、而非任何已提交文件中的决策。请在头脑风暴窗口中查找。
|
|
23
23
|
|
|
24
24
|
- "What was the decision on X?"
|
|
25
25
|
- "Did we decide to use Postgres or SQLite?"
|
|
@@ -28,11 +28,11 @@ The user is referencing a decision that lives in old dialogue, not in any commit
|
|
|
28
28
|
- "关于 X 我们之前是怎么定的?"
|
|
29
29
|
- "之前讨论过 X 的方案吗?"
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
操作:`cviauto mem search "<决策关键词>"` 找到会话,然后 `extract <id> --phase brainstorm` 恢复讨论内容。
|
|
32
32
|
|
|
33
|
-
##
|
|
33
|
+
## 跨会话续接
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
用户在间隔一段时间后恢复工作,上下文是隐式的。
|
|
36
36
|
|
|
37
37
|
- "Where were we?"
|
|
38
38
|
- "Continue from last time."
|
|
@@ -41,11 +41,11 @@ The user resumed work after a gap and the context is implicit.
|
|
|
41
41
|
- "我们上次做到哪了"
|
|
42
42
|
- "接着昨天那个任务"
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
操作:`cviauto mem list --task <current-task-dir>` 找到与当前任务关联的最近会话,然后 `extract` 最后一个。
|
|
45
45
|
|
|
46
|
-
##
|
|
46
|
+
## 熟悉 bug 排查
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
当前的 bug 感觉像是之前遇到过的。过往会话中很可能保存了解决路径。
|
|
49
49
|
|
|
50
50
|
- "I feel like I've hit this before."
|
|
51
51
|
- "Doesn't this look like that bug from last month?"
|
|
@@ -54,11 +54,11 @@ The current bug feels like one already seen. Past sessions probably hold the res
|
|
|
54
54
|
- "这个 bug 是不是上次那个?"
|
|
55
55
|
- "怎么又是这个 error?"
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
操作:`cviauto mem search "<错误信息片段>" --global`。从实际错误字符串中锚定一个短小、有辨识度的 token。
|
|
58
58
|
|
|
59
|
-
##
|
|
59
|
+
## 自我模式识别
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
用户正在问自己是否在反复犯同类错误或做同类决策。
|
|
62
62
|
|
|
63
63
|
- "Do I always make this mistake?"
|
|
64
64
|
- "How often have I run into X?"
|
|
@@ -67,11 +67,11 @@ The user is asking whether they keep repeating the same kind of mistake or decis
|
|
|
67
67
|
- "我老犯这个错?"
|
|
68
68
|
- "这类问题之前出现过几次?"
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
操作:`cviauto mem search "<话题>" --global --limit 50` 并浏览列表中的日期/项目。可选地对两三个结果执行 `extract` 进行比较。
|
|
71
71
|
|
|
72
|
-
##
|
|
72
|
+
## 完成工作复盘(按需)
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
用户明确希望回顾本次任务——不是强制步骤,仅在用户要求时执行。
|
|
75
75
|
|
|
76
76
|
- "Summarize what we did in this task."
|
|
77
77
|
- "What were the key decisions / surprises?"
|
|
@@ -80,14 +80,14 @@ The user explicitly wants to look back at this task — not as a forced step, on
|
|
|
80
80
|
- "记一下这次踩的坑"
|
|
81
81
|
- "复盘下这个任务"
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
操作:识别当前任务的会话 ID(从 `.cviauto/.runtime/sessions/*.json` 或 `mem list --task <task-dir>`),然后 `extract <id> --phase brainstorm` 和 `--phase implement`。给出摘要——尽可能提供具体的文件:行号引用。是否将摘要写入某处(PRD、spec、笔记文件)由用户决定;主动提议,不要自动写入。
|
|
84
84
|
|
|
85
|
-
##
|
|
85
|
+
## 反模式:不要在以下场景使用 `mem`
|
|
86
86
|
|
|
87
|
-
- "
|
|
88
|
-
- "
|
|
89
|
-
- "
|
|
90
|
-
- "
|
|
91
|
-
- "
|
|
87
|
+
- "这个函数是做什么的?" → 读取文件。
|
|
88
|
+
- "这个测试为什么失败?" → 读取测试输出和文件。
|
|
89
|
+
- "我们代码库中 X 的正确模式是什么?" → grep / 读取 spec 文件。
|
|
90
|
+
- "Y 的最新 npm 版本是什么?" → 调用 `npm view`。
|
|
91
|
+
- "修复这个 bug。" → 调试。只有在你怀疑存在先验上下文时才使用 `mem`;否则它只是噪音。
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
判断标准始终是:在回答之前,一个资深同事会问"我们之前不是讨论过这个吗?" 如果是,就使用 `mem`。如果不是,就不要用。
|
|
@@ -3,39 +3,39 @@ name: cviauto-spec-bootstrap
|
|
|
3
3
|
description: "Bootstrap project-specific Cviauto coding specs with a platform-neutral single-agent workflow. Use when creating or refreshing .cviauto/spec guidelines, analyzing a codebase with GitNexus, ABCoder, or source inspection, decomposing package/layer spec work, and writing real codebase-backed spec docs without placeholder text."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Cviauto Spec
|
|
6
|
+
# Cviauto Spec 引导
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
使用此技能从真实代码库创建或刷新 `.cviauto/spec/` 指南。一个有能力 Agent 拥有完整循环:分析仓库、选择 spec 边界、编写文档、验证结果。此工作流不依赖特定的宿主、CLI 或 Agent 品牌。
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## 工作流
|
|
11
11
|
|
|
12
|
-
1.
|
|
13
|
-
2.
|
|
14
|
-
3.
|
|
15
|
-
4.
|
|
16
|
-
5.
|
|
12
|
+
1. 确认 Cviauto 已初始化并检查当前 `.cviauto/spec/` 树。
|
|
13
|
+
2. 使用最佳可用工具分析仓库架构:GitNexus、ABCoder、语言工具和直接源码阅读。
|
|
14
|
+
3. 仅在反映实际代码库时按 package 和 layer 分解 spec 工作。
|
|
15
|
+
4. 用项目中的具体模式、文件路径、示例和反模式填充或重塑 spec 文件。
|
|
16
|
+
5. 验证最终 spec 内部一致且不含模板占位符。
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## 参考路由
|
|
19
19
|
|
|
20
|
-
|
|
|
20
|
+
| 需求 | 阅读 |
|
|
21
21
|
|------|------|
|
|
22
|
-
|
|
|
23
|
-
| Spec
|
|
24
|
-
|
|
|
25
|
-
| GitNexus
|
|
26
|
-
|
|
27
|
-
##
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
|
|
35
|
-
##
|
|
36
|
-
|
|
37
|
-
- `.cviauto/spec/`
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
- `index.md`
|
|
41
|
-
-
|
|
22
|
+
| 仓库架构分析 | [references/repository-analysis.md](references/repository-analysis.md) |
|
|
23
|
+
| Spec 工作分解与任务规划 | [references/spec-task-planning.md](references/spec-task-planning.md) |
|
|
24
|
+
| 编写高信号 Cviauto spec 文件 | [references/spec-writing.md](references/spec-writing.md) |
|
|
25
|
+
| GitNexus 和 ABCoder MCP 设置 | [references/mcp-setup.md](references/mcp-setup.md) |
|
|
26
|
+
|
|
27
|
+
## 操作规则
|
|
28
|
+
|
|
29
|
+
- 将模板视为起点,而非契约。当仓库需要时,删除、重命名、拆分或添加 spec 文件。
|
|
30
|
+
- 优先基于源码的规则而非通用建议。每条重要建议都应指向真实文件或重复出现的本地模式。
|
|
31
|
+
- 默认保持单执行者。可选的辅助 Agent 是实现细节,而非需求或用户可见的依赖。
|
|
32
|
+
- 除非目标项目已标准化在该平台上,否则不编写平台特定指令。
|
|
33
|
+
- 不在 `.cviauto/spec/` 中留占位符文本、空标题或复制的样板内容。
|
|
34
|
+
|
|
35
|
+
## 完成标准
|
|
36
|
+
|
|
37
|
+
- `.cviauto/spec/` 描述了项目当前的实际状态。
|
|
38
|
+
- 每个相关 package 或 layer 都有包含真实示例的实用编码指导。
|
|
39
|
+
- 不适用的模板部分已移除。
|
|
40
|
+
- `index.md` 文件与最终 spec 文件集匹配。
|
|
41
|
+
- 任何所需设置或分析假设已在相关 spec 或任务笔记中记录。
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
# MCP
|
|
1
|
+
# MCP 设置
|
|
2
2
|
|
|
3
|
-
GitNexus
|
|
3
|
+
GitNexus 和 ABCoder 是在引导 Cviauto 规格(spec)时推荐使用的工具,因为它们能向 agent 暴露架构和 AST 上下文。它们是工具选择,而非平台要求。请通过你的 agent 宿主提供的任何 MCP 机制来配置它们。
|
|
4
4
|
|
|
5
5
|
## GitNexus
|
|
6
6
|
|
|
7
|
-
GitNexus
|
|
7
|
+
GitNexus 从仓库构建代码知识图谱。用于模块边界、执行流程、依赖关系、影响范围(blast radius)和图查询。
|
|
8
8
|
|
|
9
|
-
###
|
|
9
|
+
### 安装与索引
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
#
|
|
12
|
+
# 从仓库根目录运行。
|
|
13
13
|
npx gitnexus analyze
|
|
14
14
|
|
|
15
|
-
#
|
|
15
|
+
# 检查索引状态。
|
|
16
16
|
npx gitnexus status
|
|
17
17
|
|
|
18
|
-
#
|
|
18
|
+
# 代码变更后,当分析结果过时时重新索引。
|
|
19
19
|
npx gitnexus analyze
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
索引写入 `.gitnexus/` 目录。仅在项目已使用嵌入(embeddings)时才保留它们;否则,普通索引就足以支持 spec 引导。
|
|
23
23
|
|
|
24
|
-
### MCP
|
|
24
|
+
### MCP 服务器命令
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
在宿主 MCP 配置中使用以下服务器命令:
|
|
27
27
|
|
|
28
28
|
```bash
|
|
29
29
|
npx -y gitnexus mcp
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
###
|
|
32
|
+
### 常用工具
|
|
33
33
|
|
|
34
|
-
|
|
|
34
|
+
| 工具 | 用途 |
|
|
35
35
|
|------|---------|
|
|
36
|
-
| `gitnexus_query` |
|
|
37
|
-
| `gitnexus_context` |
|
|
38
|
-
| `gitnexus_impact` |
|
|
39
|
-
| `gitnexus_detect_changes` |
|
|
40
|
-
| `gitnexus_cypher` |
|
|
41
|
-
| `gitnexus_list_repos` |
|
|
36
|
+
| `gitnexus_query` | 按概念查找执行流程和功能区域 |
|
|
37
|
+
| `gitnexus_context` | 检查某个符号的调用者、被调用者、引用以及参与的执行流程 |
|
|
38
|
+
| `gitnexus_impact` | 在修改某个符号之前了解其影响范围 |
|
|
39
|
+
| `gitnexus_detect_changes` | 在完成前检查变更的符号和受影响的功能流程 |
|
|
40
|
+
| `gitnexus_cypher` | 运行直接图查询 |
|
|
41
|
+
| `gitnexus_list_repos` | 列出已索引的仓库 |
|
|
42
42
|
|
|
43
43
|
## ABCoder
|
|
44
44
|
|
|
45
|
-
ABCoder
|
|
45
|
+
ABCoder 将代码解析为 UniAST,并提供精确的包、文件和节点级结构。用于签名、类型形态、实现、依赖关系和反向引用。
|
|
46
46
|
|
|
47
|
-
###
|
|
47
|
+
### 安装
|
|
48
48
|
|
|
49
49
|
```bash
|
|
50
50
|
go install github.com/cloudwego/abcoder@latest
|
|
51
51
|
abcoder --help
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
###
|
|
54
|
+
### 解析仓库
|
|
55
55
|
|
|
56
56
|
```bash
|
|
57
57
|
abcoder parse /absolute/path/to/package \
|
|
@@ -60,31 +60,31 @@ abcoder parse /absolute/path/to/package \
|
|
|
60
60
|
--output ~/abcoder-asts
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
对于 monorepo,使用稳定的 `--name` 解析每个包,以便任务笔记可以引用相同的仓库名称。
|
|
64
64
|
|
|
65
|
-
### MCP
|
|
65
|
+
### MCP 服务器命令
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
在宿主 MCP 配置中使用以下服务器命令:
|
|
68
68
|
|
|
69
69
|
```bash
|
|
70
70
|
abcoder mcp ~/abcoder-asts
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
###
|
|
73
|
+
### 常用工具
|
|
74
74
|
|
|
75
|
-
|
|
|
75
|
+
| 工具 | 层级 | 用途 |
|
|
76
76
|
|------|-------|---------|
|
|
77
|
-
| `list_repos` | 1 |
|
|
78
|
-
| `get_repo_structure` | 2 |
|
|
79
|
-
| `get_package_structure` | 3 |
|
|
80
|
-
| `get_file_structure` | 3 |
|
|
81
|
-
| `get_ast_node` | 4 |
|
|
77
|
+
| `list_repos` | 1 | 列出已解析的仓库 |
|
|
78
|
+
| `get_repo_structure` | 2 | 检查包和文件 |
|
|
79
|
+
| `get_package_structure` | 3 | 检查包内的节点 |
|
|
80
|
+
| `get_file_structure` | 3 | 检查文件中的函数、类、类型和签名 |
|
|
81
|
+
| `get_ast_node` | 4 | 检索代码、依赖关系、引用和实现 |
|
|
82
82
|
|
|
83
|
-
##
|
|
83
|
+
## 验证
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
配置完成后,从 agent 宿主验证两个 MCP 服务器均可见。然后在开始 spec 编写之前,对每个服务器运行一个简单查询。
|
|
86
86
|
|
|
87
87
|
```bash
|
|
88
88
|
ls .gitnexus/meta.json
|
|
89
89
|
ls ~/abcoder-asts/*.json
|
|
90
|
-
```
|
|
90
|
+
```
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 仓库分析
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
目标是在编写规则之前发现项目的真实架构。不要从通用 spec 模板开始填空,而应从代码出发,让 spec 结构跟随代码。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 分析顺序
|
|
6
6
|
|
|
7
|
-
1.
|
|
8
|
-
2.
|
|
9
|
-
3.
|
|
10
|
-
4.
|
|
11
|
-
5.
|
|
7
|
+
1. 阅读现有的 `.cviauto/spec/` 目录树,注意哪些文件是模板、哪些已过时、哪些已针对项目定制。
|
|
8
|
+
2. 检查包清单、构建脚本、工作区配置和顶层文档,以识别包和运行时分层。
|
|
9
|
+
3. 使用 GitNexus 获取执行流程、模块集群、依赖枢纽和影响敏感区域。
|
|
10
|
+
4. 使用 ABCoder 或语言原生工具获取精确的签名、类型、类边界和实现示例。
|
|
11
|
+
5. 在将任何发现转化为 spec 规则之前,直接阅读有代表性的源文件和测试文件。
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## 需要捕获的内容
|
|
14
14
|
|
|
15
|
-
|
|
|
15
|
+
| 领域 | 要回答的问题 |
|
|
16
16
|
|------|-----------|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
22
|
-
|
|
|
23
|
-
|
|
|
17
|
+
| 包边界 | 每个包拥有什么?哪些导入跨越了边界? |
|
|
18
|
+
| 运行时分层 | 哪些代码是 CLI、后端、前端、worker、共享库、仅测试代码或工具? |
|
|
19
|
+
| 核心抽象 | 哪些类型、服务、存储、命令、路由或适配器定义了系统形态? |
|
|
20
|
+
| 数据流 | 用户输入从哪里进入,如何验证,状态在哪里持久化? |
|
|
21
|
+
| 错误处理 | 失败如何表示、记录、暴露和测试? |
|
|
22
|
+
| 配置 | 默认值、环境配置、生成文件和模板分别存放在哪里? |
|
|
23
|
+
| 测试 | 哪些测试风格可以作为新工作的可信范例? |
|
|
24
24
|
|
|
25
|
-
## GitNexus
|
|
25
|
+
## GitNexus 用法
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
从宽泛入手,然后检查具体符号:
|
|
28
28
|
|
|
29
29
|
```text
|
|
30
30
|
gitnexus_query({query: "CLI command execution flow"})
|
|
@@ -33,11 +33,11 @@ gitnexus_context({name: "SymbolName"})
|
|
|
33
33
|
gitnexus_cypher({query: "MATCH (n)-[r]->(m) RETURN n.name, type(r), m.name LIMIT 30"})
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
使用 GitNexus 结果来查找重要文件和流程。在检查相关源文件之前,不要将图输出作为最终权威。
|
|
37
37
|
|
|
38
|
-
## ABCoder
|
|
38
|
+
## ABCoder 用法
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
当 spec 需要精确的代码形态时使用 ABCoder:
|
|
41
41
|
|
|
42
42
|
```text
|
|
43
43
|
list_repos()
|
|
@@ -46,14 +46,14 @@ get_file_structure({repo_name: "package-name", file_path: "src/example.ts"})
|
|
|
46
46
|
get_ast_node({repo_name: "package-name", node_ids: [{mod_path: "...", pkg_path: "...", name: "SymbolName"}]})
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
ABCoder
|
|
49
|
+
ABCoder 在记录构造器模式、函数签名、类型契约和引用链时最有价值。
|
|
50
50
|
|
|
51
|
-
##
|
|
51
|
+
## 分析笔记
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
分析时保持简短记录。笔记应包含:
|
|
54
54
|
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
-
|
|
55
|
+
- 包或层名称。
|
|
56
|
+
- 定义了本地模式的文件。
|
|
57
|
+
- spec 应教授的规则。
|
|
58
|
+
- 在旧代码、注释、测试或迁移路径中发现的的反模式(anti-pattern)。
|
|
59
|
+
- 应创建、删除、重命名或合并的 spec 文件。
|
package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-task-planning.md
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
# Spec
|
|
1
|
+
# Spec 任务规划
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
使用单个 agent 作为默认执行模型。agent 可以创建 Cviauto 任务以便追踪,但此 skill 不应要求特定平台、CLI 或并行 worker 模型。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 分解
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
围绕真实的归属边界创建 spec 工作单元:
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
9
|
+
- 当一个包有自己的约定时,作为一个工作单元。
|
|
10
|
+
- 当同一个包有独立的前端、后端、CLI、worker 或共享库规则时,每个层作为一个工作单元。
|
|
11
|
+
- 当某个模式跨越多个包且不属于某个层时,作为一个跨领域指南。
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
避免人为分解。一个小型库通常只需要一次集中的 spec 编写,而不是多个任务。
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## 任务形态
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
当 Cviauto 任务有用时,编写一份简洁的 PRD,包含以下章节:
|
|
18
18
|
|
|
19
19
|
```markdown
|
|
20
|
-
#
|
|
20
|
+
# 填写 <包或层名称> Cviauto Specs
|
|
21
21
|
|
|
22
|
-
## Goal
|
|
23
|
-
|
|
22
|
+
## 目标(Goal)
|
|
23
|
+
为 <范围> 编写项目特定的 `.cviauto/spec/` 指导。
|
|
24
24
|
|
|
25
|
-
## Scope
|
|
26
|
-
- Spec
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
25
|
+
## 范围(Scope)
|
|
26
|
+
- Spec 目录:
|
|
27
|
+
- 需要检查的源目录:
|
|
28
|
+
- 需要检查的测试:
|
|
29
|
+
- 超出范围:
|
|
30
30
|
|
|
31
|
-
## Architecture Context
|
|
32
|
-
|
|
31
|
+
## 架构上下文(Architecture Context)
|
|
32
|
+
汇总仓库分析中的具体发现。
|
|
33
33
|
|
|
34
|
-
##
|
|
34
|
+
## 需要创建或更新的文件
|
|
35
35
|
- `.cviauto/spec/.../index.md`
|
|
36
36
|
- `.cviauto/spec/.../<topic>.md`
|
|
37
37
|
|
|
38
|
-
##
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
|
|
44
|
-
## Acceptance Criteria
|
|
45
|
-
- [ ]
|
|
46
|
-
- [ ]
|
|
47
|
-
- [ ]
|
|
48
|
-
- [ ]
|
|
38
|
+
## 规则
|
|
39
|
+
- 让 spec 文件集适配真实代码库。
|
|
40
|
+
- 使用带有文件路径的真实源码示例。
|
|
41
|
+
- 删除不适用的纯模板章节。
|
|
42
|
+
- 除非任务明确要求,否则不要修改产品源代码。
|
|
43
|
+
|
|
44
|
+
## 验收标准(Acceptance Criteria)
|
|
45
|
+
- [ ] Spec 包含来自仓库的具体示例和反模式。
|
|
46
|
+
- [ ] 没有残留的占位文本。
|
|
47
|
+
- [ ] 索引文件与实际 spec 文件匹配。
|
|
48
|
+
- [ ] 所有声明都有源文件、测试或项目文档作为支撑。
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
##
|
|
51
|
+
## 可选的辅助 Agent
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
如果宿主支持子 agent,辅助 agent 可以检查独立的包或运行验证。它们是可选的。主 agent 仍然负责集成和最终质量。
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
辅助任务必须有明确的归属:
|
|
56
56
|
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
-
|
|
57
|
+
- 只读研究任务可以检查分配给其范围内的任何源文件。
|
|
58
|
+
- 写入任务应拥有互不重叠的 spec 目录。
|
|
59
|
+
- 验证任务应检查占位符残留、断链和一致性。
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
不要在 skill 中硬编码辅助 agent 名称、供应商特定命令或平台特定路由。在任务中只放入所需的工作和验收标准。
|
package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-writing.md
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
# Spec
|
|
1
|
+
# Spec 编写
|
|
2
2
|
|
|
3
|
-
Cviauto
|
|
3
|
+
Cviauto spec 是面向未来 agent 的编码指导。它们应当解释如何在这个仓库中工作,而不是描述一个通用项目可能如何组织。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 基于证据编写
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
每条重要规则都应得到以下内容之一的支持:
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
9
|
+
- 一个展示了首选模式的源文件。
|
|
10
|
+
- 一个展示了预期行为的测试文件。
|
|
11
|
+
- 一个定义了该约定的项目文档。
|
|
12
|
+
- 跨多个文件重复出现的模式。
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
仅在能使规则更清晰时使用简短代码片段。优先链接到文件路径并命名符号或行为。
|
|
15
15
|
|
|
16
|
-
##
|
|
16
|
+
## 文件结构
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
保持 spec 目录树与项目对齐:
|
|
19
19
|
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
20
|
+
- 保留 `index.md` 作为 spec 目录的导航文件。
|
|
21
|
+
- 当开发者会独立查找某个主题时,将其拆分。
|
|
22
|
+
- 当独立文件会重复同一规则时,将主题合并。
|
|
23
|
+
- 删除不适用的模板文件。
|
|
24
|
+
- 为模板遗漏的重要本地模式添加新文件。
|
|
25
25
|
|
|
26
|
-
##
|
|
26
|
+
## 内容标准
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
好的 spec 章节应包含:
|
|
29
29
|
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
30
|
+
- 规则适用的场景。
|
|
31
|
+
- 应遵循的本地模式。
|
|
32
|
+
- 证明该模式的源文件或测试文件。
|
|
33
|
+
- 常见错误或反模式。
|
|
34
|
+
- 当具体可靠时,提供验证命令或检查方法。
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
应避免:
|
|
37
37
|
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
38
|
+
- 占位文字。
|
|
39
|
+
- 通用框架建议。
|
|
40
|
+
- 仅在某个 agent 宿主中有效的工具指令。
|
|
41
|
+
- 大段复制的代码块。
|
|
42
|
+
- 基于单个偶然实现细节的规则。
|
|
43
43
|
|
|
44
|
-
##
|
|
44
|
+
## 示例形态
|
|
45
45
|
|
|
46
46
|
```markdown
|
|
47
|
-
## Command Handlers
|
|
47
|
+
## 命令处理器(Command Handlers)
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
命令处理器应将参数解析、验证和副作用分离。本地模式是:
|
|
50
50
|
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
51
|
+
- 在命令边界解析 CLI 标志。
|
|
52
|
+
- 在调用核心逻辑之前,将原始输入转换为类型化的任务选项。
|
|
53
|
+
- 将文件系统写入保留在命令层或服务层,而非模板辅助函数中。
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
参考文件:
|
|
56
56
|
- `packages/cli/src/commands/example.ts`
|
|
57
57
|
- `packages/cli/test/commands/example.test.ts`
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
避免将原始 `process.argv` 或未验证的配置对象传递给共享辅助函数。
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
##
|
|
62
|
+
## 最终检查
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
完成前:
|
|
65
65
|
|
|
66
66
|
```bash
|
|
67
67
|
grep -R "To be filled\\|TODO: fill\\|placeholder" .cviauto/spec
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
同时检查链接、索引文件,以及是否有 spec 仍然描述模板而非本仓库。
|