claude-everything-workflow 0.2.4 → 0.2.6
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/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/AGENTS.md +6 -4
- package/bin/claude-everything-workflow.js +15 -0
- package/commands/pr.md +2 -2
- package/harness/manifest.json +1 -1
- package/hooks/check-code-size.js +1 -1
- package/package.json +2 -1
- package/rules/01-base.md +4 -1
- package/rules/02-implementation.md +27 -0
- package/rules/05-git-workflow.md +2 -1
- package/rules/08-specialty-rules-index.md +1 -1
- package/rules/09-first-principles-adversarial-testing.md +1 -2
- package/rules/common/testing.md +1 -0
- package/scripts/install.ps1 +28 -44
- package/scripts/install.sh +31 -3
- package/scripts/learning/migrate-homunculus.js +10 -5
- package/scripts/learning/project-utils.js +9 -0
- package/scripts/learning/promote.js +27 -10
- package/scripts/merge-claude-settings.cjs +88 -25
- package/scripts/verify/install-rules.test.js +183 -0
- package/scripts/verify/learning.test.js +122 -0
- package/scripts/verify/metadata-checks.js +57 -4
- package/scripts/verify/skill-invocation.test.js +6 -1
- package/scripts/verify/skill-manifest-checks.js +7 -4
- package/scripts/verify/workflow-checks.js +0 -1
- package/skills/README.md +1 -1
- package/skills/code-review/SKILL.md +7 -2
- package/skills/code-review/references/spec-reviewer-prompt.md +7 -4
- package/skills/continuous-learning-v2/SKILL.md +1 -0
- package/skills/continuous-learning-v2/config.json +1 -1
- package/skills/continuous-learning-v2/hooks/observe-v2.js +2 -9
- package/skills/feature-acceptance/SKILL.md +13 -5
- package/skills/feature-acceptance/references/project-verification.md +55 -0
- package/skills/implement/SKILL.md +3 -1
- package/skills/implement/agents/openai.yaml +2 -0
- package/skills/spec-gate/SKILL.md +9 -21
- package/skills/spec-gate/references/spec-template.md +23 -0
- package/skills/systematic-debugging/SKILL.md +6 -6
- package/skills/systematic-debugging/references/debugging-methods.md +30 -0
- package/skills/systematic-debugging/references/diagnostic-scenarios.md +1 -1
- package/skills/using-superpowers/SKILL.md +9 -1
- package/rules/02-code-size.md +0 -7
- package/rules/03-architecture.md +0 -12
- package/rules/04-error-handling.md +0 -5
- package/rules/06-comments.md +0 -4
package/skills/README.md
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
- `systematic-debugging`:区分普通明确失败与疑难故障;预期 TDD RED 留在实现循环。
|
|
35
35
|
- `resolving-merge-conflicts`:按双方原始意图逐 hunk 解决 merge/rebase 冲突。
|
|
36
36
|
- `e2e-testing`:Playwright E2E 模式、CI、制品和 flaky 处理。
|
|
37
|
-
- `feature-acceptance
|
|
37
|
+
- `feature-acceptance`:建立/维护项目验收工具与功能地图;按用户或项目验收合同执行真实流程并复核证据。
|
|
38
38
|
|
|
39
39
|
## Harness / 上下文与编排
|
|
40
40
|
|
|
@@ -17,13 +17,18 @@ Review depth belongs here; callers supply the scope, base, risk and available ev
|
|
|
17
17
|
- active worktree: `git diff <base>` includes committed changes and tracked staged and unstaged edits;
|
|
18
18
|
- staged-only: `git diff --cached`.
|
|
19
19
|
3. Include task-owned untracked files in full; exclude unrelated dirty files explicitly.
|
|
20
|
-
4. Use
|
|
21
|
-
|
|
20
|
+
4. Use the original user request, including user-approved Spec/ticket and scope changes, as the scope
|
|
21
|
+
authority. An implementer's plan or summary cannot broaden it. Only then inspect tracker references
|
|
22
|
+
or matching durable documents if needed.
|
|
22
23
|
Do not ask again for a base or scope the caller already supplied. Never infer requirements from the diff.
|
|
23
24
|
5. Missing base or required acceptance evidence is `BLOCKED`. An intentionally empty package is `NO CHANGES`.
|
|
24
25
|
For a standalone review with no confirmed requirements, report the Spec axis as `NOT RUN` without
|
|
25
26
|
requiring an extra user confirmation; implementation completion still requires its acceptance criteria.
|
|
26
27
|
|
|
28
|
+
For local fixes touching shared logic, apply the preservation requirements in `rules/02-implementation.md`.
|
|
29
|
+
Unrequested behavior changes fail the Spec axis even if all tests pass; missing required preservation
|
|
30
|
+
evidence is `BLOCKED`, not `PASS`.
|
|
31
|
+
|
|
27
32
|
## Select review depth
|
|
28
33
|
|
|
29
34
|
`--mode auto` is the default. Select by risk and verification evidence, not file count, model generation
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
# Spec reviewer
|
|
2
2
|
|
|
3
|
-
Review only the supplied fixed review package against the
|
|
4
|
-
|
|
3
|
+
Review only the supplied fixed review package against the original user request, including user-approved
|
|
4
|
+
Spec/ticket and scope changes. Do not report general style opinions.
|
|
5
5
|
|
|
6
6
|
Find:
|
|
7
7
|
|
|
8
8
|
1. requirements that are missing or partial;
|
|
9
|
-
2. behavior
|
|
9
|
+
2. scope creep through unrequested behavior changes, especially in non-target callers of shared code;
|
|
10
10
|
3. behavior that looks implemented but is wrong;
|
|
11
|
-
4. acceptance checks that cannot be established
|
|
11
|
+
4. acceptance checks, including required non-target preservation checks, that cannot be established
|
|
12
|
+
from the supplied evidence.
|
|
13
|
+
|
|
14
|
+
Apply the [Code Review](../SKILL.md) Spec failure/blocking rules and the supplied compatibility requirements.
|
|
12
15
|
|
|
13
16
|
Quote or cite the exact requirement and implementation location for every finding. If no confirmed
|
|
14
17
|
Spec source exists, return `NOT RUN`; do not reconstruct requirements from the diff.
|
|
@@ -62,6 +62,7 @@ ${XDG_DATA_HOME:-~/.local/share}/ecc-homunculus/
|
|
|
62
62
|
## 安全边界
|
|
63
63
|
|
|
64
64
|
- 默认不启用后台 observer;`observer.enabled` 保持 `false`,避免额外 token 和误学习。
|
|
65
|
+
- 工具观察记录也默认关闭。仅当 `observation.enabled` 明确设为 `true` 且 Hook 在启用的档位中运行时才采集。
|
|
65
66
|
- 不自动导入、导出、推广或删除 instinct。
|
|
66
67
|
- 不把 raw observations 当作可共享知识;共享前只处理 instinct。
|
|
67
68
|
- 不把 project instinct 自动提升为 global。
|
|
@@ -21,14 +21,7 @@ function getConfig() {
|
|
|
21
21
|
try {
|
|
22
22
|
return JSON.parse(fs.readFileSync(configPath, 'utf8'))
|
|
23
23
|
} catch {
|
|
24
|
-
return
|
|
25
|
-
observation: {
|
|
26
|
-
enabled: true,
|
|
27
|
-
store_path: path.join(os.homedir(), '.claude', 'homunculus', 'observations.jsonl'),
|
|
28
|
-
capture_tools: ['Edit', 'Write', 'Bash', 'Read', 'Grep', 'Glob'],
|
|
29
|
-
ignore_tools: ['TodoWrite']
|
|
30
|
-
}
|
|
31
|
-
}
|
|
24
|
+
return null
|
|
32
25
|
}
|
|
33
26
|
}
|
|
34
27
|
|
|
@@ -76,7 +69,7 @@ async function main() {
|
|
|
76
69
|
const phase = process.argv[2] // 'pre' or 'post'
|
|
77
70
|
const config = getConfig()
|
|
78
71
|
|
|
79
|
-
if (
|
|
72
|
+
if (config?.observation?.enabled !== true) {
|
|
80
73
|
process.exit(0)
|
|
81
74
|
}
|
|
82
75
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: feature-acceptance
|
|
3
|
-
description: "
|
|
3
|
+
description: "建立或维护项目验收工具与功能地图;按用户或项目验收合同执行真实流程,产出可复核证据。"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# 功能验收
|
|
@@ -9,7 +9,14 @@ description: "用于用户明确要求真实流程验收、截图或日志证据
|
|
|
9
9
|
|
|
10
10
|
## 何时使用
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
在用户明确要求真实流程验收、截图/视频/日志证据、建立或维护项目验收能力,或项目验收合同要求真实流程时使用。普通修复、一般“测一下”及完成前的常规验证按 `rules/common/testing.md` 执行,不自动生成工具或功能地图。
|
|
13
|
+
|
|
14
|
+
## 项目验收能力
|
|
15
|
+
|
|
16
|
+
- **建立 / 维护**:读取 [项目验收能力](references/project-verification.md),复用目标项目的驱动与测试入口,生成或更新项目本地操作说明和功能地图,并实际跑通。
|
|
17
|
+
- **执行**:先查项目指令指定的验收入口和功能地图,复用已验证命令,按本次改动选择受影响用例;没有地图时仍可完成一次性验收,不强制脚手架。工具失效时保留失败证据;只在授权范围内修复,不通过删用例或改成功标准取得通过。
|
|
18
|
+
|
|
19
|
+
CEW 维护通用方法;平台命令、选择器、账号前置条件和功能地图由目标项目维护。
|
|
13
20
|
|
|
14
21
|
## 输出协议
|
|
15
22
|
|
|
@@ -33,7 +40,7 @@ description: "用于用户明确要求真实流程验收、截图或日志证据
|
|
|
33
40
|
|
|
34
41
|
### 1. 定义目标
|
|
35
42
|
|
|
36
|
-
|
|
43
|
+
记录被测功能、真实用户入口、核心成功标准、环境前置条件和不可执行的高风险动作。记录被测代码版本及工作区差异、工具/用例版本;有比较基线时同时记录基线版本,相关输入变化后重跑受影响用例。没有测试前置条件时先标记 `BLOCKED`,不要通过注入凭据、篡改本地状态或破坏共享数据绕过。
|
|
37
44
|
|
|
38
45
|
### 2. 写用例矩阵
|
|
39
46
|
|
|
@@ -47,8 +54,8 @@ description: "用于用户明确要求真实流程验收、截图或日志证据
|
|
|
47
54
|
|
|
48
55
|
- 至少覆盖主成功路径;按风险补充错误、空状态、权限或关键分支。
|
|
49
56
|
- `keyNodes` 写明名称、重要性、预期观察和证据角色。
|
|
50
|
-
- `evidenceMedium` 只能是 `image`、`video` 或 `log
|
|
51
|
-
- 真实产品流程的 `image` 或 `video`
|
|
57
|
+
- `evidenceMedium` 只能是 `image`、`video` 或 `log`。UI 流程关键节点超过 10 个或需要表达过程时用 `video`;非 UI 流程保留顺序日志与关键断言。
|
|
58
|
+
- 真实产品流程的 `image` 或 `video` 必须来自真实产品页面或应用界面;对于 UI 流程,API、数据库或脚本输出只作为辅助 `log` 证据。CLI、服务/API、库项目可使用真实公开入口的调用、退出码和可观察结果作为主 `log` 证据,不强制截图。
|
|
52
59
|
|
|
53
60
|
### 3. 采集证据
|
|
54
61
|
|
|
@@ -91,3 +98,4 @@ description: "用于用户明确要求真实流程验收、截图或日志证据
|
|
|
91
98
|
- 不把 mock 页面、Storybook、历史截图、终端截图或伪造数据当作真实产品验收证据。
|
|
92
99
|
- 不为验收执行用户未授权的写操作、支付、删除或生产数据变更。
|
|
93
100
|
- 不把一次性验收替代应提交的单元测试、类型检查或 E2E 测试;它们互为补充。
|
|
101
|
+
- 验收通过不授予提交、合并或发布权限,也不替代项目要求的独立审核。
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# 项目验收能力
|
|
2
|
+
|
|
3
|
+
用于明确授权的建立或维护请求。
|
|
4
|
+
|
|
5
|
+
## 1. 从项目事实确定入口
|
|
6
|
+
|
|
7
|
+
读取目标项目指令、启动配置、现有测试和自动化辅助代码,确认:
|
|
8
|
+
|
|
9
|
+
- 用户实际使用的界面:Web、Electron、移动端、CLI、服务/API 或库;多个界面分别列明。
|
|
10
|
+
- 启动与就绪信号、测试账号/数据、依赖服务,以及可观察结果。
|
|
11
|
+
- 可复用的驱动、选择器、日志和截图入口;先运行已有命令,不另造同功能 CLI。
|
|
12
|
+
- 端口、数据目录、账号和进程的隔离能力。不能隔离时串行,不共用用户正在使用的实例。
|
|
13
|
+
|
|
14
|
+
只询问项目中无法查明且影响结果的用户决策。缺环境或权限时标记 `BLOCKED`;产品行为不符合预期则 `FAIL`。不擅自安装系统工具、修改生产配置或扩大为产品修复;可记录草稿和缺口,但不能宣称验收能力已可用。
|
|
15
|
+
|
|
16
|
+
## 2. 保存项目本地操作契约
|
|
17
|
+
|
|
18
|
+
优先更新项目已有验收文档/Skill,并沿用其路径;没有入口时,在项目使用的 Skill 目录创建 `verify-<project>/SKILL.md`(含 name、description)及 `references/features.md`。宿主未使用项目 Skill 时放入项目约定的文档目录,并从已有项目入口链接。不要写进 CEW 的通用规则或用户全局 Skill。维护时保留人工内容,先核对差异,避免全量覆盖。
|
|
19
|
+
|
|
20
|
+
操作契约须让没有上下文的 Agent 直接使用,包含实际验证过的命令和工作目录,不留假命令:
|
|
21
|
+
|
|
22
|
+
| 内容 | 最低要求 |
|
|
23
|
+
| --- | --- |
|
|
24
|
+
| 启动 / 健康检查 | 构建和启动入口、就绪条件、目标版本、所属实例、账号是否可用;短命令程序可用一次真实调用确认健康 |
|
|
25
|
+
| 操作 | 真实用户入口和稳定定位方式;CLI/API/库使用公开接口,UI 不用内部状态注入代替操作 |
|
|
26
|
+
| 观察 | 等待真实完成信号,核对用户可见结果及必要的文件/数据副作用;相关错误不能被忽略 |
|
|
27
|
+
| 证据 | 基线、动作、结果、命令退出码、代码及用例版本;脱敏后保存至忽略目录,报告引用可回读的路径 |
|
|
28
|
+
| 清理 | 只关闭本次拥有的进程,移除本次创建的临时状态;保留证据,不按进程名批量终止 |
|
|
29
|
+
|
|
30
|
+
仅当缺少可复用入口且重复操作确有收益时,增加最小项目本地 helper。使用项目已有语言/依赖;复杂或多平台需求才扩展。必须实际运行 helper,验证失败退出码及清理路径;`--dry-run` 也要观察其副作用,不能凭名字认定安全。
|
|
31
|
+
|
|
32
|
+
## 3. 建立功能地图
|
|
33
|
+
|
|
34
|
+
先覆盖最主要的 3~5 个用户流程;项目更小则覆盖实际存在的流程,不凑数。地图不是测试通过清单,明确标注已验证与未验证部分。每个功能记录:
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
功能 / 用户目标:
|
|
38
|
+
入口与子流程:列出需要覆盖的不同入口,不只列最方便的一个
|
|
39
|
+
前置条件:平台、服务、账号、数据及隔离要求
|
|
40
|
+
驱动步骤:引用实际命令/定位方式;写明输入与完成信号
|
|
41
|
+
成功断言:用户能观察到的结果及必要副作用
|
|
42
|
+
风险边界:错误、权限、空状态、恢复等与功能相关的用例
|
|
43
|
+
最近验证:代码/工具/用例版本、环境、日期、结果及证据位置
|
|
44
|
+
未覆盖项:具体入口或场景,以及原因
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
选择用例时结合改动、调用方和用户目标;地图是导航,不是范围上限。新功能或遗漏的关键入口必须补充。维护请求只检查相关条目与当前实现的漂移,不默认重写整份地图。
|
|
48
|
+
|
|
49
|
+
## 4. 实际执行后交付
|
|
50
|
+
|
|
51
|
+
按生成或修改后的说明完成一次闭环:启动 → 健康检查 → 一个真实核心流程 → 核对断言和证据 → 清理 → 再次打开证据。失败运行也执行所属资源的清理,保留失败证据;修正工具后重跑受影响步骤。维护时重跑受影响流程,不能用历史证据覆盖本次变化。
|
|
52
|
+
|
|
53
|
+
沿用主 Skill 的 `PASS / FAIL / BLOCKED / NOT RUN` 与二次审核要求。区分“验收入口已通过所列流程验证”和“整个产品通过验收”:一个流程跑通不代表整张地图通过。报告生成/更新的入口、已执行流程、证据、未覆盖项和后续调用方式;未执行的草稿不得作为已验证能力交付。
|
|
54
|
+
|
|
55
|
+
只有用户或项目合同要求时才接入日常开发验收;不自动新增 CI、定时任务、自动合并或发布权限。
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: implement
|
|
3
|
-
description:
|
|
3
|
+
description: Internal delivery procedure selected by using-superpowers for one authorized scope.
|
|
4
|
+
disable-model-invocation: true
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Implement
|
|
7
8
|
|
|
8
9
|
执行 router 选定的一个连贯交付范围。Origin: `mattpocock/skills@2ab9580`,适配本项目授权与审查边界。
|
|
10
|
+
如果用户直接进入此 Skill,先由 `using-superpowers` 判断是否适用,再按选定路径执行。
|
|
9
11
|
|
|
10
12
|
## 入口
|
|
11
13
|
|
|
@@ -62,27 +62,15 @@ Save to `docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md` unless the user pr
|
|
|
62
62
|
|
|
63
63
|
## Spec Schema
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
8. `Implementation Decisions` — modules, interfaces, public contracts, schemas, interactions, and migration decisions.
|
|
75
|
-
9. `架构设计`.
|
|
76
|
-
10. `组件与文件`.
|
|
77
|
-
11. `数据流 / 接口`.
|
|
78
|
-
12. `错误处理`.
|
|
79
|
-
13. `测试策略` — testing decisions, highest available seam, precedents, normal and adversarial cases.
|
|
80
|
-
14. `验收标准`.
|
|
81
|
-
15. `风险与取舍`.
|
|
82
|
-
16. `回滚`.
|
|
83
|
-
17. `开放问题` — only non-blocking questions; write `无` when empty.
|
|
84
|
-
|
|
85
|
-
Do not include implementation snippets that will become stale. Do not present an unresolved branch as a settled decision.
|
|
65
|
+
Keep the document proportional to the decisions needed for implementation and review. Always cover the
|
|
66
|
+
problem, intended behavior and scope, constraints, resolved implementation decisions, test seams and
|
|
67
|
+
repeatable acceptance checks, and relevant risks or recovery. Combine related sections and omit sections
|
|
68
|
+
that add no decision or evidence; do not fill a fixed set of empty headings.
|
|
69
|
+
|
|
70
|
+
For complex or high-risk designs, read [references/spec-template.md](references/spec-template.md).
|
|
71
|
+
Public-contract, authorization or persistent-data changes must cover compatibility, failure behavior,
|
|
72
|
+
migration and rollback where relevant, even when headings are combined. Keep user approval and the
|
|
73
|
+
outcome contract below. Do not include stale implementation snippets or present an unresolved choice as settled.
|
|
86
74
|
|
|
87
75
|
## Self-Review
|
|
88
76
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Detailed Spec Reference
|
|
2
|
+
|
|
3
|
+
Read for complex or high-risk designs. This is a section menu, not a requirement to generate every
|
|
4
|
+
heading. Keep material decisions and evidence together; combine or omit sections that do not affect
|
|
5
|
+
implementation or review. The main Skill owns applicability, unresolved decisions, approval and outcomes.
|
|
6
|
+
|
|
7
|
+
Useful sections:
|
|
8
|
+
|
|
9
|
+
- `背景`、`目标`、`非目标`:problem, intended result and scope boundaries.
|
|
10
|
+
- `需求`:observable behavior, constraints, compatibility and useful User Stories.
|
|
11
|
+
- `现有上下文`:verified code facts, domain terms, ADRs, patterns and test precedents.
|
|
12
|
+
- `方案对比`、`推荐方案`:real alternatives, trade-offs and the resolved choice.
|
|
13
|
+
- `Implementation Decisions`:modules, interfaces, public contracts, schemas and migration decisions.
|
|
14
|
+
- `架构设计`、`组件与文件`、`数据流 / 接口`:boundaries and interactions that affect the implementation.
|
|
15
|
+
- `错误处理`:normal and adversarial behavior, retries, partial failure and recovery where relevant.
|
|
16
|
+
- `测试策略`、`验收标准`:highest available test seams and repeatable automated or manual checks.
|
|
17
|
+
- `风险与取舍`、`回滚`:impact, compatibility, migration, rollout and recovery.
|
|
18
|
+
- `开放问题`:only non-blocking questions; omit when none remain.
|
|
19
|
+
|
|
20
|
+
For public contracts, retain compatibility and consumer impact. For authentication or authorization,
|
|
21
|
+
retain trust boundaries, permissions and denial behavior. For persistent data or schemas, retain
|
|
22
|
+
migration ordering, partial failure, backup/recovery and rollback limits. A shorter document must still
|
|
23
|
+
make these consequential decisions explicit; user-owned decisions must already be resolved or delegated.
|
|
@@ -10,7 +10,7 @@ description: Diagnose bugs, recurring or flaky failures, slowness, and performan
|
|
|
10
10
|
- 已确认失败原因正确的预期 TDD RED:回到实现的 GREEN,不加载完整诊断参考。
|
|
11
11
|
- 原因已由错误信息和调用链证实的普通失败:最小修复并重跑对应验证,不制造多个假设。
|
|
12
12
|
- 根因不明、修复后仍重复失败、flaky 或性能回归:进入下方证据闭环,同时读取
|
|
13
|
-
|
|
13
|
+
[调试方法参考](references/debugging-methods.md),按当前证据选择复现、最小化和回归方法;执行流程与退出条件由本文定义。
|
|
14
14
|
|
|
15
15
|
所有路径都保留原始症状和修复后的验证证据。不能把非目标错误当作预期 RED,也不能跳过真实失败。
|
|
16
16
|
|
|
@@ -23,13 +23,13 @@ description: Diagnose bugs, recurring or flaky failures, slowness, and performan
|
|
|
23
23
|
区分报错位置、直接原因和上游触发条件,不能仅凭错误名称认定根因。
|
|
24
24
|
3. **选择取证路径。** 可复现时建立命中原症状的反馈并缩小场景;偶发问题记录样本数、失败率和条件,
|
|
25
25
|
不以一次成功认定修复,也不强求秒级运行或固定复现率。无法重现时,继续关联已有 trace、日志、请求、
|
|
26
|
-
|
|
26
|
+
时间线及代码路径,并用局部实验或定向观测检验解释;局部实验不冒充原场景复现。
|
|
27
27
|
4. **提出并检验假设。** 按现有证据选择有区分价值的假设,不凑固定数量。每个待检验假设写清依据、
|
|
28
28
|
可推翻它的预测和最小实验;一次改变一个变量。执行后记录实际结果,标记支持、排除或仍未确定。
|
|
29
29
|
展示假设是进度更新,不能在仍有可执行调查时以“可能原因”列表结束。
|
|
30
30
|
5. **确认后修复。** 进入根因修复前,说明触发条件如何沿调用链造成原症状,并提供能区分主要竞争解释的
|
|
31
31
|
运行证据或对照实验。只有代码猜测、错误消失或重试成功不足以确认。证据不足时继续取证;用户要求先止损时,
|
|
32
|
-
|
|
32
|
+
将措施标为缓解,不宣称根因已修复。确认后执行最小修复和原始场景回归,方法见调试方法参考。
|
|
33
33
|
尚未找到合适测试入口时,记录验证缺口并检查更完整的调用场景;缺少测试入口本身不能证明架构有错。
|
|
34
34
|
6. **失败后重新调查。** 假设被否定或修复无效时,记录反证,回到现场与调用链,不在未证实的改动上叠加补丁。
|
|
35
35
|
连续三次修复无效,或修复不断引出不同组件的异常时,重新检查问题模型、环境和共享状态/耦合;
|
|
@@ -48,6 +48,6 @@ description: Diagnose bugs, recurring or flaky failures, slowness, and performan
|
|
|
48
48
|
|
|
49
49
|
## 项目运行适配
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
`scripts/hitl-loop.template.js`。它是 HITL 的唯一运行入口;不要执行留档的 Bash 模板。
|
|
51
|
+
`references/diagnosing-bugs.upstream.md` 作为上游六阶段原文留档,`scripts/hitl-loop.template.sh` 作为上游原始 Bash 模板留档,均保持原样;
|
|
52
|
+
只有核对上游来源或差异时才读取,不作为排障执行参考。
|
|
53
|
+
需要人工操作才能复现时,使用 `scripts/hitl-loop.template.js`。它是 HITL 的唯一运行入口;不要执行留档的 Bash 模板。
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# 调试方法参考
|
|
2
|
+
|
|
3
|
+
疑难排障时按已有证据选用相关方法,不要求逐项执行。流程、修复门槛和退出条件由 `../SKILL.md` 定义。
|
|
4
|
+
|
|
5
|
+
## 捕捉原症状
|
|
6
|
+
|
|
7
|
+
- 可重现时,优先复用能触达真实故障路径的测试、CLI、HTTP 请求或浏览器操作;断言用户报告的症状,不能只检查“没有报错”。
|
|
8
|
+
- 有留存请求或事件时,可用脱敏夹具重放,核对版本、输入和依赖是否对应原现场;隔离后的结果不能冒充原场景复现。
|
|
9
|
+
- 无法重现时,关联现有日志、trace、请求标识、时间线和代码路径;对照正常请求或版本,用局部实验检验解释。
|
|
10
|
+
- 偶发问题记录样本数、失败率和触发条件。固定时间、随机种子或隔离状态可以减少噪音;是否增加压力或样本由证据需要决定,不设固定复现率或秒级要求。
|
|
11
|
+
|
|
12
|
+
## 缩小异常边界
|
|
13
|
+
|
|
14
|
+
- 比较最后正常边界与最早异常边界的输入、输出和状态,沿调用链找到首次偏离预期的位置。
|
|
15
|
+
- 有复现场景时,每次减少一个输入、调用者、配置或步骤,保留仍能触发原症状的部分;记录哪些条件影响结果。
|
|
16
|
+
- 怀疑版本或配置变化时,用相同输入作前后对照;只有两端结果可比较时才使用二分定位。
|
|
17
|
+
- 缩小运行范围、缓存无关初始化等方式可加快反馈,不能以牺牲症状覆盖换取速度。
|
|
18
|
+
|
|
19
|
+
## 区分解释
|
|
20
|
+
|
|
21
|
+
- 每个假设写清现有依据、可推翻它的预测和能区分竞争解释的最小实验;选择有信息价值的假设,不凑固定数量。
|
|
22
|
+
- 用断点、局部观测或带唯一标记的临时日志捕捉异常边界,一次改变一个变量,记录实际结果与反证。
|
|
23
|
+
- 性能问题先取得可比较的耗时、资源或调用测量,再对照版本、配置或输入;普通日志不能代替性能测量。
|
|
24
|
+
|
|
25
|
+
## 回归与清理
|
|
26
|
+
|
|
27
|
+
- 有能覆盖真实故障模式的测试入口时,把复现场景转成失败回归测试,再修复并验证;入口不足时记录验证缺口,继续检查实际调用场景。
|
|
28
|
+
- 检查原始场景与关键触发条件,避免仅凭缩小后的单一路径通过就宣称修复;偶发问题报告实际样本和残留不确定性。
|
|
29
|
+
- 清理本次临时观测和一次性夹具,保留长期回归测试及必要证据;不要删除用户已有文件。
|
|
30
|
+
- 需要人工操作时,按 `../scripts/hitl-loop.template.js` 记录步骤与结果。生产访问或观测需要单独授权,不能因缺少复现而自行扩大权限。
|
|
@@ -24,6 +24,12 @@ below and read only its Skill. Briefly announce the selection, then act. Do not
|
|
|
24
24
|
in anticipation of later stages. Reuse a Skill already read in this task unless it changed or context
|
|
25
25
|
was lost; returning here means applying the routing decision, not reading this file again.
|
|
26
26
|
|
|
27
|
+
For delivery, infer the requested action, outcome, scope and acceptance evidence from the request and
|
|
28
|
+
project. Inspect discoverable details and ask only for unresolved decisions that would change the result.
|
|
29
|
+
`read-reference` means read the target as a file relative to the same distribution, without invoking it
|
|
30
|
+
through a host Skill tool or asking the user to type its name. For `implement`, read
|
|
31
|
+
[the delivery procedure](../implement/SKILL.md) after selecting it.
|
|
32
|
+
|
|
27
33
|
Expected TDD RED stays in the current implementation loop. Do not reroute it as a reported bug.
|
|
28
34
|
An explicit request may use ordinary language or a native `/name` or `$name` invocation.
|
|
29
35
|
For handoff, triage and improve-codebase-architecture,
|
|
@@ -50,6 +56,8 @@ Task arrives
|
|
|
50
56
|
-> skills/handoff/SKILL.md
|
|
51
57
|
-> explicit triage request? -> skills/triage/SKILL.md
|
|
52
58
|
-> explicit TDD request? -> skills/test-driven-development/SKILL.md
|
|
59
|
+
-> explicit project verification setup/maintenance or real-flow acceptance request?
|
|
60
|
+
-> skills/feature-acceptance/SKILL.md
|
|
53
61
|
-> explicit E2E or Playwright request? -> skills/e2e-testing/SKILL.md + agents/e2e-runner.md
|
|
54
62
|
-> explicit harness audit? -> agents/harness-optimizer.md
|
|
55
63
|
-> explicit architecture-health audit? -> skills/improve-codebase-architecture/SKILL.md
|
|
@@ -65,7 +73,7 @@ Task arrives
|
|
|
65
73
|
-> durable multi-session/tracker graph? -> skills/to-tickets/SKILL.md
|
|
66
74
|
-> independent frontier tickets with no overlapping write surface?
|
|
67
75
|
-> skills/subagent-driven-development/SKILL.md
|
|
68
|
-
-> otherwise -> skills/implement/SKILL.md
|
|
76
|
+
-> otherwise -> read-reference skills/implement/SKILL.md
|
|
69
77
|
-> behavior change with a test path? -> test-driven-development
|
|
70
78
|
-> new feature or other Git-rule isolation need? -> rules/05-git-workflow.md
|
|
71
79
|
-> completion, fixed, or ready claim? -> rules/common/testing.md
|
package/rules/02-code-size.md
DELETED
package/rules/03-architecture.md
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# 架构与兼容
|
|
2
|
-
|
|
3
|
-
- 遵循目标项目的目录、分层和依赖方向;仅调整影响当前需求的职责与耦合。
|
|
4
|
-
- 优先现有实现、标准库和已安装依赖。抽象应隐藏细节、减少调用方复杂度;不为假设的复用增加接口或透传层。
|
|
5
|
-
- 实现、测试和类型保持局部性;跨域共用目录只承接已出现的稳定复用。
|
|
6
|
-
- 状态变化显式,遵循项目更新惯例;保留公共接口和既有工作流,破坏性变更需用户批准。
|
|
7
|
-
- 重构增量、可验证、可回退,正常与边界路径有相称验证。
|
|
8
|
-
|
|
9
|
-
## 跨平台脚本
|
|
10
|
-
|
|
11
|
-
优先复用项目脚本运行时;本项目使用 Node.js。必须兼容 Windows/macOS/Linux 的路径和进程调用,
|
|
12
|
-
按目标项目锁文件或配置选择 npm、pnpm、yarn 或 bun,不硬编码开发机路径。
|
package/rules/06-comments.md
DELETED