claude-everything-workflow 0.2.7 → 0.2.9
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 +11 -18
- package/agents/e2e-runner.md +1 -1
- package/commands/pr.md +3 -1
- package/evals/routing-scenarios.json +253 -0
- package/harness/manifest.json +2 -28
- package/hooks/check-console-log.js +2 -2
- package/package.json +4 -2
- package/rules/01-base.md +2 -2
- package/rules/02-implementation.md +7 -6
- package/rules/05-git-workflow.md +4 -6
- package/rules/common/agent-orchestration.md +1 -1
- package/rules/common/pr-automation.md +1 -1
- package/rules/common/testing.md +2 -2
- package/scripts/eval-scenarios.js +106 -0
- package/scripts/install-rules.js +186 -17
- package/scripts/install.ps1 +42 -15
- package/scripts/install.sh +31 -12
- package/scripts/legacy-common-rule-hashes.json +4 -0
- package/scripts/retired-skill-files.json +7 -0
- package/scripts/verify/install-rules.test.js +80 -24
- package/scripts/verify/metadata-checks.js +7 -8
- package/scripts/verify/repository-checks.js +44 -368
- package/scripts/verify/scenario-checks.js +108 -0
- package/scripts/verify/scenario-checks.test.js +84 -0
- package/scripts/verify/workflow-checks.js +85 -586
- package/scripts/verify-harness.js +2 -0
- package/skills/README.md +2 -4
- package/skills/feature-acceptance/SKILL.md +8 -8
- package/skills/{e2e-testing/SKILL.md → feature-acceptance/references/e2e-testing.md} +3 -9
- package/skills/implement/SKILL.md +2 -0
- package/skills/{subagent-driven-development/SKILL.md → implement/references/parallel-delivery.md} +7 -9
- package/skills/implement/references/ticket-delivery.md +1 -1
- package/skills/using-superpowers/SKILL.md +24 -103
- package/rules/07-forbidden.md +0 -20
- package/rules/08-specialty-rules-index.md +0 -18
- package/rules/09-first-principles-adversarial-testing.md +0 -30
- package/scripts/verify/continuation-checks.test.js +0 -101
- package/scripts/verify/grilling-spec-gate-checks.js +0 -297
- package/scripts/verify/workflow-ownership-fixtures.js +0 -371
- package/scripts/verify/workflow-ownership.js +0 -780
- /package/skills/{e2e-testing → feature-acceptance}/references/playwright-patterns.md +0 -0
|
@@ -7,6 +7,7 @@ const { runMetadataChecks } = require("./verify/metadata-checks");
|
|
|
7
7
|
const { runSkillManifestChecks } = require("./verify/skill-manifest-checks");
|
|
8
8
|
const { runRepositoryChecks } = require("./verify/repository-checks");
|
|
9
9
|
const { runWorkflowChecks } = require("./verify/workflow-checks");
|
|
10
|
+
const { runScenarioChecks } = require("./verify/scenario-checks");
|
|
10
11
|
const { runRuntimeChecks } = require("./verify/runtime-checks");
|
|
11
12
|
|
|
12
13
|
function main() {
|
|
@@ -17,6 +18,7 @@ function main() {
|
|
|
17
18
|
runSkillManifestChecks(context);
|
|
18
19
|
runRepositoryChecks(context);
|
|
19
20
|
runWorkflowChecks(context);
|
|
21
|
+
runScenarioChecks(context);
|
|
20
22
|
runRuntimeChecks(context);
|
|
21
23
|
|
|
22
24
|
if (context.warnings.length > 0) {
|
package/skills/README.md
CHANGED
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
- `grilling`:对计划、设计或重大用户决策进行单问式压力测试。
|
|
15
15
|
- `spec-gate`:显式 formal spec 或高风险任务的零访谈成稿、自审和用户批准门。
|
|
16
16
|
- `to-tickets`:把已批准工作拆成 tracer-bullet tickets 和 blocking graph。
|
|
17
|
-
- `implement`:执行用户授权的低风险 direct scope、已批准 Spec scope 或 frontier ticket
|
|
18
|
-
- `subagent-driven-development`:router 对已授权范围发现多个相互独立的 frontier tickets 时,分派到隔离 worktree 的 fresh subagent。
|
|
17
|
+
- `implement`:执行用户授权的低风险 direct scope、已批准 Spec scope 或 frontier ticket;支持串行交付与安全并行多票(`references/parallel-delivery.md`)。
|
|
19
18
|
- `triage`:对 Issue/外部 PR 分类、验证并形成 agent-ready brief。
|
|
20
19
|
- `handoff`:将当前上下文脱敏压缩到临时 Markdown,供全新 session 接续。
|
|
21
20
|
|
|
@@ -33,8 +32,7 @@
|
|
|
33
32
|
- `test-driven-development`:行为变化的 Red Test Gate。
|
|
34
33
|
- `systematic-debugging`:区分普通明确失败与疑难故障;预期 TDD RED 留在实现循环。
|
|
35
34
|
- `resolving-merge-conflicts`:按双方原始意图逐 hunk 解决 merge/rebase 冲突。
|
|
36
|
-
- `
|
|
37
|
-
- `feature-acceptance`:建立/维护项目验收工具与功能地图;按用户或项目验收合同执行真实流程并复核证据。
|
|
35
|
+
- `feature-acceptance`:建立/维护项目验收工具、功能地图与可重跑 Playwright E2E(`references/e2e-testing.md`);按用户或项目验收合同执行真实流程并复核证据。
|
|
38
36
|
|
|
39
37
|
## Harness / 上下文与编排
|
|
40
38
|
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: feature-acceptance
|
|
3
|
-
description: "
|
|
3
|
+
description: "建立或维护项目验收与 Playwright E2E,执行真实流程并产出可复核证据。"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# 功能验收与 E2E 测试
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
把验收或 E2E 请求转成可复现、可复核的结论。优先验证用户可观察的行为,不用代码阅读、模拟页面或单个 API 响应替代真实流程。
|
|
9
9
|
|
|
10
10
|
## 何时使用
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
在用户明确要求真实流程验收、Playwright/E2E 测试、截图/视频/日志证据、建立或维护项目验收能力,或项目验收合同要求真实流程时使用。普通修复、一般“测一下”及完成前的常规验证按 `rules/common/testing.md` 执行,不自动生成工具或功能地图。
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## 项目验收与 E2E 能力
|
|
15
15
|
|
|
16
|
-
- **建立 /
|
|
17
|
-
-
|
|
16
|
+
- **建立 / 维护验收能力**:读取 [项目验收能力](references/project-verification.md),复用目标项目的驱动与测试入口,生成或更新项目本地操作说明和功能地图,并实际跑通。
|
|
17
|
+
- **可重跑 E2E / Playwright**:需要新增、维护可提交并在 CI 重跑的浏览器测试或排查 flaky 时,读取 [可重跑 E2E 测试](references/e2e-testing.md)(按需再读 [playwright-patterns.md](references/playwright-patterns.md)),必要时委派 `agents/e2e-runner.md`。
|
|
18
|
+
- **执行验收**:先查项目指令指定的验收入口和功能地图,复用已验证命令,按本次改动选择受影响用例;没有地图时仍可完成一次性验收,不强制脚手架。工具失效时保留失败证据;只在授权范围内修复,不通过删用例或改成功标准取得通过。
|
|
18
19
|
|
|
19
20
|
CEW 维护通用方法;平台命令、选择器、账号前置条件和功能地图由目标项目维护。
|
|
20
21
|
|
|
@@ -31,7 +32,6 @@ CEW 维护通用方法;平台命令、选择器、账号前置条件和功能
|
|
|
31
32
|
|
|
32
33
|
## 路由
|
|
33
34
|
|
|
34
|
-
- 需要新增或维护可提交、可在 CI 重跑的浏览器测试时,读取 `skills/e2e-testing/SKILL.md`,必要时委派 `agents/e2e-runner.md`。
|
|
35
35
|
- 需要定位失败根因时,先读取 `skills/systematic-debugging/SKILL.md`,不要在验收报告中猜测修复方案。
|
|
36
36
|
- 完成声明仍须遵守 `rules/common/testing.md` 的新鲜验证证据要求。
|
|
37
37
|
- 仅在用例相互独立、运行环境允许且任务授权并行时并发执行;共享状态、顺序依赖或无并发授权时串行执行,并说明原因。
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
name: e2e-testing
|
|
3
|
-
description: Use for explicit Playwright or E2E work; keep tests repeatable and load detailed patterns on demand.
|
|
4
|
-
origin: ECC
|
|
5
|
-
---
|
|
1
|
+
# 可重跑 E2E 测试
|
|
6
2
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
只在用户明确要求 E2E、Playwright、端到端回归或测试不稳定性处理时加载。这里负责把需求落到项目已有的可重复测试入口;通用示例和配置细节见 `references/playwright-patterns.md`,命中具体问题时再读取。
|
|
3
|
+
仅在需要新增或维护可提交、可在 CI 重跑的 E2E / Playwright 测试,或处理 E2E 不稳定性时读取。这里负责把需求落到项目已有的可重复测试入口;通用示例和配置细节见 [playwright-patterns.md](playwright-patterns.md),命中具体问题时再读取。
|
|
10
4
|
|
|
11
5
|
## 先发现项目现状
|
|
12
6
|
|
|
@@ -33,4 +27,4 @@ origin: ECC
|
|
|
33
27
|
|
|
34
28
|
## 参考
|
|
35
29
|
|
|
36
|
-
需要 POM、配置模板、flaky 隔离、重试和制品示例时,按需读取
|
|
30
|
+
需要 POM、配置模板、flaky 隔离、重试和制品示例时,按需读取 [playwright-patterns.md](playwright-patterns.md)。
|
|
@@ -16,6 +16,8 @@ disable-model-invocation: true
|
|
|
16
16
|
- approved Spec scope:已获用户批准的 Spec 是范围与验收来源。
|
|
17
17
|
- ticket:仅此路径先读取 [references/ticket-delivery.md](references/ticket-delivery.md),核实 frontier,
|
|
18
18
|
再按该引用与下方共用步骤交付。无 ticket 范围不得 claim 或写入任何 tracker。
|
|
19
|
+
- 并行多票:仅当 router 确认存在至少两张已批准、无 blocker、写入面不重叠的 frontier tickets 时,
|
|
20
|
+
读取 [references/parallel-delivery.md](references/parallel-delivery.md) 在隔离 worktree 中分派并集成。
|
|
19
21
|
|
|
20
22
|
缺少可复核验收、存在实质用户决策或命中尚未批准的 formal Spec/高风险边界时,返回 router,不能猜测或实施。
|
|
21
23
|
普通范围使用当前会话,不为满足流程创建新的上下文或 tracker。
|
package/skills/{subagent-driven-development/SKILL.md → implement/references/parallel-delivery.md}
RENAMED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
name: subagent-driven-development
|
|
3
|
-
description: Dispatch approved independent frontier tickets in isolated worktrees; use only when router selects SDD.
|
|
4
|
-
---
|
|
1
|
+
# Parallel Delivery
|
|
5
2
|
|
|
6
|
-
|
|
3
|
+
仅当 router 为已授权范围选择 `implement` 的并行模式时读取;单张 ticket 的交付步骤见
|
|
4
|
+
[ticket-delivery.md](ticket-delivery.md),共用的隔离、审查和验证见 `skills/implement/SKILL.md`。
|
|
7
5
|
|
|
8
6
|
Run several independent frontier tickets in parallel without reintroducing a long implementation plan.
|
|
9
7
|
Each fresh subagent receives one approved ticket, discovers current code details itself, and returns evidence
|
|
@@ -15,13 +13,13 @@ communication.
|
|
|
15
13
|
Use only when all of the following are true:
|
|
16
14
|
|
|
17
15
|
- the router is executing a user-authorized delivery scope and records why SDD is safer or faster than
|
|
18
|
-
serial
|
|
16
|
+
serial delivery;
|
|
19
17
|
- at least two selected tickets are `ready-for-agent`, unclaimed and have no unresolved blocker;
|
|
20
18
|
- the tickets do not modify the same files, shared migration, release boundary or external state;
|
|
21
19
|
- each ticket can finish in one fresh subagent context.
|
|
22
20
|
|
|
23
|
-
Announce the selected topology and its reason in one line, then continue. Otherwise
|
|
24
|
-
|
|
21
|
+
Announce the selected topology and its reason in one line, then continue. Otherwise deliver one ticket
|
|
22
|
+
serially with `implement`. Do not manufacture extra tickets merely to justify parallelism.
|
|
25
23
|
|
|
26
24
|
## Prepare
|
|
27
25
|
|
|
@@ -100,7 +98,7 @@ let a parallel worker decide it unilaterally.
|
|
|
100
98
|
|
|
101
99
|
## Example
|
|
102
100
|
|
|
103
|
-
Tickets `01` and `02` are both unblocked and modify different packages. The router selects
|
|
101
|
+
Tickets `01` and `02` are both unblocked and modify different packages. The router selects parallel mode, creates one
|
|
104
102
|
integration worktree plus two worker worktrees, then dispatches two fresh subagents. Each implements and
|
|
105
103
|
verifies only its own ticket. Review both worker diffs, apply passing diffs to the integration worktree, and
|
|
106
104
|
run the combined gate before resolving either ticket or returning the unlocked frontier to the router.
|
|
@@ -30,7 +30,7 @@ ticket as the Spec source:`/code-review --worktree <pre-ticket-base> --spec <t
|
|
|
30
30
|
外部评论或关闭需要相应明确授权。不得自动关闭外部 Issue 或 parent issue。
|
|
31
31
|
|
|
32
32
|
resolve 后重查依赖图并返回 router。newly unlocked tickets 仍在已授权范围内时,router
|
|
33
|
-
可重新选择串行 `implement`
|
|
33
|
+
可重新选择串行 `implement` 或安全并行模式(见 [parallel-delivery.md](parallel-delivery.md));超出范围则报告 frontier 并停止。
|
|
34
34
|
|
|
35
35
|
## FINISH_DELIVERY
|
|
36
36
|
|
|
@@ -5,116 +5,37 @@ description: Route engineering delivery and explicitly requested engineering wor
|
|
|
5
5
|
|
|
6
6
|
# Using Superpowers
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
仅用于工程交付(实现、调试、测试、审查)及显式工程工作流;普通问答、翻译、总结和资料检索直接处理。
|
|
9
|
+
优先级:用户指令 / `AGENTS.md` / `CLAUDE.md` / 项目 Rules > Skills / Commands / Agents / Hooks > 默认行为。
|
|
9
10
|
|
|
10
|
-
##
|
|
11
|
+
## 选路原则
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
- 选最短适用路径,只读当前阶段需要的 Skill,不预加载整条链路;简短说明选择后即执行。
|
|
14
|
+
- 显式请求某一专职能力(如 `grilling`、`feature-acceptance`、`handoff`、`triage`、`prototype`、`improve-codebase-architecture`、`resolving-merge-conflicts`、`test-driven-development`、`code-review`)时,宿主按各 Skill 的 `description` 直接匹配,不再逐条在路由表重复列出。
|
|
15
|
+
- 复杂度本身不触发额外门禁;`handoff`、`triage`、`improve-codebase-architecture` 仅在用户明确请求时使用。
|
|
14
16
|
|
|
15
|
-
##
|
|
17
|
+
## 三条交付通道
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
1. **direct**:需求明确、低风险 → `read-reference skills/implement/SKILL.md`(有测试路径的行为变化结合 `test-driven-development`)。
|
|
20
|
+
2. **needs-decision**:存在会实质改变结果且工具查不到的用户决策 → `skills/grilling/SKILL.md`(高风险或显式 Spec 场景记录 `resume_target: spec-gate`)。
|
|
21
|
+
3. **formal-spec**:用户要求 formal Spec(含旧称 `brainstorming`,引导至 `/to-spec`)或命中高风险边界(难逆架构/服务边界、公共契约兼容、认证授权、持久化 schema 迁移、不可逆外部副作用)→ `skills/spec-gate/SKILL.md`。
|
|
19
22
|
|
|
20
|
-
##
|
|
21
|
-
|
|
22
|
-
Classify intent, discoverable facts, user-owned decisions, and risk; select the shortest applicable path
|
|
23
|
-
below and read only its Skill. Briefly announce the selection, then act. Do not load a chain of Skills
|
|
24
|
-
in anticipation of later stages. Reuse a Skill already read in this task unless it changed or context
|
|
25
|
-
was lost; returning here means applying the routing decision, not reading this file again.
|
|
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
|
-
|
|
33
|
-
Expected TDD RED stays in the current implementation loop. Do not reroute it as a reported bug.
|
|
34
|
-
An explicit request may use ordinary language or a native `/name` or `$name` invocation.
|
|
35
|
-
For handoff, triage and improve-codebase-architecture,
|
|
36
|
-
require the corresponding user request; complexity or a router match alone is insufficient.
|
|
37
|
-
Do not ask users to repeat an already clear request using command syntax. Skill selection never
|
|
38
|
-
expands authorization for publishing, external writes, or other consequential actions.
|
|
39
|
-
|
|
40
|
-
## Three Lanes
|
|
41
|
-
|
|
42
|
-
The three lanes are: direct (clear low-risk task), needs-decision (grilling inline), and formal-spec
|
|
43
|
-
(explicit formal Spec or high-risk boundary). File count, new features, and ordinary complexity affect
|
|
44
|
-
verification intensity, not the lane. Resolve only consequential user decisions that tools cannot discover.
|
|
45
|
-
|
|
46
|
-
## Routing
|
|
47
|
-
|
|
48
|
-
Use process skills before implementation skills:
|
|
23
|
+
## 核心路由
|
|
49
24
|
|
|
50
25
|
```text
|
|
51
|
-
|
|
52
|
-
->
|
|
53
|
-
->
|
|
54
|
-
->
|
|
55
|
-
->
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
->
|
|
60
|
-
-> skills/feature-acceptance/SKILL.md
|
|
61
|
-
-> explicit E2E or Playwright request? -> skills/e2e-testing/SKILL.md + agents/e2e-runner.md
|
|
62
|
-
-> explicit harness audit? -> agents/harness-optimizer.md
|
|
63
|
-
-> explicit architecture-health audit? -> skills/improve-codebase-architecture/SKILL.md
|
|
64
|
-
-> merge or rebase conflict? -> skills/resolving-merge-conflicts/SKILL.md
|
|
65
|
-
-> reported bug or unexplained/repeated failure? -> skills/systematic-debugging/SKILL.md
|
|
66
|
-
-> discoverable fact? -> inspect it; do not ask
|
|
67
|
-
-> external engineering fact or documentation question? -> inspect primary sources directly; cite the answer
|
|
68
|
-
-> explicit prototype or runnable design question? -> skills/prototype/SKILL.md
|
|
69
|
-
-> unresolved user-owned decision? -> skills/grilling/SKILL.md (grilling inline)
|
|
70
|
-
high-risk or explicit formal Spec context? -> resume_target: spec-gate
|
|
71
|
-
-> explicit formal Spec or high-risk boundary? -> spec-gate
|
|
72
|
-
-> delivery request in defined scope? -> select delivery topology
|
|
73
|
-
-> durable multi-session/tracker graph? -> skills/to-tickets/SKILL.md
|
|
74
|
-
-> independent frontier tickets with no overlapping write surface?
|
|
75
|
-
-> skills/subagent-driven-development/SKILL.md
|
|
76
|
-
-> otherwise -> read-reference skills/implement/SKILL.md
|
|
77
|
-
-> behavior change with a test path? -> test-driven-development
|
|
78
|
-
-> new feature or other Git-rule isolation need? -> rules/05-git-workflow.md
|
|
79
|
-
-> completion, fixed, or ready claim? -> rules/common/testing.md
|
|
80
|
-
-> skill discovery or install request? -> use available host tooling for the explicit request
|
|
81
|
-
-> external skill learning or edit? -> rules/common/skills-learning.md
|
|
82
|
-
-> otherwise -> shortest applicable loop
|
|
26
|
+
工程任务到达
|
|
27
|
+
-> 询问工作流建议? -> 只返回推荐路径、前置条件和闭环,不写文件
|
|
28
|
+
-> 故障 / 偶发失败 / 性能回退? -> skills/systematic-debugging/SKILL.md(预期 TDD RED 留在实现循环)
|
|
29
|
+
-> 未决关键用户决策? -> skills/grilling/SKILL.md
|
|
30
|
+
-> 显式 formal Spec 或高风险边界? -> skills/spec-gate/SKILL.md
|
|
31
|
+
-> 明确范围的交付请求? -> 选择交付拓扑(一行说明理由):
|
|
32
|
+
需要跨会话 / tracker 依赖图 -> skills/to-tickets/SKILL.md
|
|
33
|
+
其余(含已批准多票安全并行) -> read-reference skills/implement/SKILL.md
|
|
34
|
+
-> 声明完成 / 修复 / ready? -> rules/common/testing.md
|
|
83
35
|
```
|
|
84
36
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
### Workflow advice mode
|
|
88
|
-
|
|
89
|
-
只返回推荐入口与原因、前置条件、需要补齐的用户决策或 Spec/tickets/map/handoff,以及直到
|
|
90
|
-
审查和验证的闭环路径。不要调用下一 Skill、写文件或修改 tracker。
|
|
91
|
-
|
|
92
|
-
### Agent-selected Delivery Topology
|
|
93
|
-
|
|
94
|
-
用户要求完成一个定义明确的交付范围后,router 自行选择 `implement`、`to-tickets` 或
|
|
95
|
-
`subagent-driven-development`;选择依据是持续性、依赖图、写入面和验证成本,而不是用户是否记得某个
|
|
96
|
-
Skill 名称。开始时用一行说明所选拓扑及理由,然后继续执行。
|
|
97
|
-
|
|
98
|
-
- 一个可在当前上下文完成的连贯范围,使用 `implement`。
|
|
99
|
-
- 需要跨会话、tracker 或可恢复依赖图时,使用 `to-tickets`。这仍必须展示 ticket 的行为、验收标准与
|
|
100
|
-
blocker,并在发布前获得用户对 ticket contract 的批准。
|
|
101
|
-
- 只有至少两张已批准、无 blocker、写入面不重叠的 frontier tickets,才使用 SDD。不能安全并行时选择
|
|
102
|
-
串行 `implement`,不要为了使用 subagent 人为拆票。
|
|
103
|
-
|
|
104
|
-
用户的交付授权覆盖已批准范围内的本地实现与拓扑选择,不覆盖新的产品范围、未决用户决策、外部 tracker
|
|
105
|
-
mutation、commit、push、PR 或不可逆副作用。新的 frontier 只有仍在该授权范围内时才能由 router 再次选择
|
|
106
|
-
执行拓扑。
|
|
107
|
-
|
|
108
|
-
## Process Outcomes
|
|
109
|
-
|
|
110
|
-
Only when processing a grilling/Spec outcome or preparing a cross-session handoff, read
|
|
111
|
-
[references/process-outcomes.md](references/process-outcomes.md). Follow the matching outcome before
|
|
112
|
-
continuing; a self-reviewed Spec is not user approval. Ordinary direct delivery does not load this reference.
|
|
113
|
-
|
|
114
|
-
## Compatibility Alias
|
|
115
|
-
|
|
116
|
-
For one release cycle, interpret a user explicitly asking for the old name `brainstorming` as a formal Spec request. Explain that the entry moved to `/to-spec`; route through the same optional grilling and `spec-gate` path. Do not expose an old Skill shim or a second protocol source.
|
|
117
|
-
|
|
118
|
-
## Completion
|
|
37
|
+
## 交付拓扑与收尾
|
|
119
38
|
|
|
120
|
-
|
|
39
|
+
- 单次会话可完成的范围用 `implement`;仅当存在 ≥2 张已批准、无 blocker、写入面不重叠的 frontier tickets 时,按 `skills/implement/references/parallel-delivery.md` 并行分派。
|
|
40
|
+
- 处理 `grilling` / `spec-gate` 返回结果或跨会话交接时,按需读取 [references/process-outcomes.md](references/process-outcomes.md)。
|
|
41
|
+
- 交付授权不扩大产品范围,也不覆盖 commit、push、PR 或外部写入;声明完成前按 `rules/common/testing.md` 报告本轮新鲜验证证据、未运行项和剩余风险。
|
package/rules/07-forbidden.md
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# 禁止事项 (CRITICAL)
|
|
2
|
-
|
|
3
|
-
## 代码检查
|
|
4
|
-
|
|
5
|
-
- 调试残留、类型抑制和耦合问题按目标项目标准检查;不得为掩盖真实错误添加抑制或绕过检查。
|
|
6
|
-
- `hooks/check-console-log.js` 提示 `console.log`、`debugger`、`@ts-ignore`、`@ts-nocheck` 和 `any`。
|
|
7
|
-
这是兼容性警告,需结合真实用途判断;项目正常 CLI 输出或边界类型不因字符串命中而被禁止。
|
|
8
|
-
|
|
9
|
-
## 安全禁止
|
|
10
|
-
|
|
11
|
-
- 硬编码密钥、API key、token、secret 或密码(改用环境变量)、SQL 字符串拼接(改用参数化)、未校验任何外部输入、明文密码(改用 hash)、绕过验证或质量门 Hook,以及提交调试代码。
|
|
12
|
-
- 危险操作必须在沙箱或等价隔离环境中执行;安全敏感改动提交前按风险检查 SQL 注入、XSS、敏感信息泄露和依赖漏洞。
|
|
13
|
-
|
|
14
|
-
## 提交禁止
|
|
15
|
-
|
|
16
|
-
- `node_modules` 等依赖目录、`.env` 等敏感配置、`dist`/`build` 等应由 CI 生成的产物,以及无提交信息的提交。
|
|
17
|
-
|
|
18
|
-
## 违规检查
|
|
19
|
-
|
|
20
|
-
发现违规时立即指出问题,解释原因并提供修复方案。
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# 专项规则索引
|
|
2
|
-
|
|
3
|
-
命中场景时读取对应规则;不得因为“可能有用”而一次性读取完整 `rules/` 或 `rules/common/`。加载层级和路径解析见 `AGENTS.md` 规则加载策略。
|
|
4
|
-
|
|
5
|
-
## 触发矩阵
|
|
6
|
-
|
|
7
|
-
| 场景 | 读取 |
|
|
8
|
-
| ---------------------------------------- | ----------------------------------------------------------------------- |
|
|
9
|
-
| Harness 审计、命令/agent/skill/hook 调整 | `common/harness-engineering.md`、必要时读取 `common/context-hygiene.md` |
|
|
10
|
-
| Ticket/SDD 编排、并行探索 | `common/agent-orchestration.md` |
|
|
11
|
-
| Fresh/Fork、Subagent 回传、上下文隔离 | `common/context-hygiene.md` |
|
|
12
|
-
| Hook 行为、退出码、Profile、权限 | `common/hooks.md` |
|
|
13
|
-
| Token、MCP、模型和上下文成本 | `common/performance.md` |
|
|
14
|
-
| 外部 skill 学习、模式保存、演化评估 | `common/skills-learning.md` |
|
|
15
|
-
| 测试策略、TDD、E2E、浏览器验证、验证范围 | `common/testing.md` |
|
|
16
|
-
| 提交、推送、PR、CI 质量门 | `05-git-workflow.md`、`common/pr-automation.md` |
|
|
17
|
-
| 安全敏感实现或安全审查 | `07-forbidden.md` |
|
|
18
|
-
| 架构与兼容、错误处理、代码规模、注释 | `02-implementation.md` |
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
# 第一性原则与对抗性测试
|
|
2
|
-
|
|
3
|
-
把抽象原则转成可执行约束。涉及架构调整、复杂实现、重构、测试策略、质量门或高风险修改时按需读取;简单文案、格式或低风险配置改动无需加载。
|
|
4
|
-
|
|
5
|
-
## 第一性原则
|
|
6
|
-
|
|
7
|
-
开始设计或实现前,先把任务拆到不可再压缩的判断依据:
|
|
8
|
-
|
|
9
|
-
1. 明确核心目标:这次改动真正要保护或达成什么。
|
|
10
|
-
2. 明确不可变约束:兼容性、数据格式、公共接口、用户工作流、安全边界和运行环境中哪些不能破坏。
|
|
11
|
-
3. 明确优先级:正确性、可维护性、兼容性、性能、开发速度发生冲突时按什么顺序取舍。
|
|
12
|
-
4. 明确失败代价:最坏情况下会影响哪些用户、数据、命令、自动化或发布流程。
|
|
13
|
-
5. 明确成功标准:用测试、构建、类型检查、复现用例或人工验收描述可验证结果。
|
|
14
|
-
|
|
15
|
-
每条原则都必须约束具体决策,例如“保持现有命令参数兼容”优先于“接口更优雅”。
|
|
16
|
-
|
|
17
|
-
## 对抗性测试
|
|
18
|
-
|
|
19
|
-
设计验证主动寻找能打破实现的输入、状态和环境,而不是只覆盖 happy path:空输入、缺失字段、损坏配置和未知枚举;重复或并发执行、部分成功后重试;含空格、中文、特殊字符、相对路径或跨平台分隔符的路径;权限、占用、目录、磁盘和网络失败;依赖缺失、版本不匹配、外部超时或异常结构;历史数据、旧配置、用户已有改动;以及大输入、边界数值、极端长度和顺序变化。
|
|
20
|
-
|
|
21
|
-
## 工作方式
|
|
22
|
-
|
|
23
|
-
- 复杂任务在计划或实现前列出 3-7 条第一性原则,并逐条映射到实现约束或验证项。
|
|
24
|
-
- 行为变化优先添加能失败的对抗性用例;无法自动化时记录手工步骤和剩余风险。审查检查默认值、顺序依赖、全局状态、环境变量、缓存、时间、路径和外部服务。
|
|
25
|
-
- 对抗性测试暴露设计问题时先修正设计边界,再补实现;验证总结说明已覆盖的正常路径、对抗路径和未覆盖风险。
|
|
26
|
-
|
|
27
|
-
## 与其他规则的关系
|
|
28
|
-
|
|
29
|
-
- 具体测试分层和命令选择见 `rules/common/testing.md`。
|
|
30
|
-
- 架构与兼容、错误处理和代码规模约束见 `rules/02-implementation.md`。
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const assert = require("node:assert/strict");
|
|
4
|
-
const fs = require("node:fs");
|
|
5
|
-
const path = require("node:path");
|
|
6
|
-
const { createHarnessContext } = require("./core");
|
|
7
|
-
const { runGrillingSpecGateChecks } = require("./grilling-spec-gate-checks");
|
|
8
|
-
|
|
9
|
-
const root = path.resolve(__dirname, "../..");
|
|
10
|
-
const domain = "skills/domain-modeling/SKILL.md";
|
|
11
|
-
const outcomes = "skills/using-superpowers/references/process-outcomes.md";
|
|
12
|
-
const spec = "skills/spec-gate/SKILL.md";
|
|
13
|
-
const read = (file) => fs.readFileSync(path.join(root, file), "utf8");
|
|
14
|
-
|
|
15
|
-
// Inject regressions in memory so tests exercise the real gates without changing the working tree.
|
|
16
|
-
function verify(overrides = {}) {
|
|
17
|
-
const context = createHarnessContext(root);
|
|
18
|
-
context.read = (file) => overrides[file] ?? read(file);
|
|
19
|
-
context.requireTokens = (file, tokens) => {
|
|
20
|
-
if (!context.exists(file)) return context.fail(`${file} is missing`);
|
|
21
|
-
for (const token of tokens) {
|
|
22
|
-
if (!context.read(file).includes(token)) context.fail(`${file} should include ${token}`);
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
runGrillingSpecGateChecks(context);
|
|
26
|
-
return context.errors;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
assert.deepEqual(verify(), []);
|
|
30
|
-
|
|
31
|
-
const regressions = [
|
|
32
|
-
{
|
|
33
|
-
name: "maintenance changes a confirmed decision without approval",
|
|
34
|
-
file: domain,
|
|
35
|
-
body: read(domain).replace(/changes to\s+confirmed decisions, and\s*/, ""),
|
|
36
|
-
error: /should include changes to/,
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
name: "per-term approval despite maintenance authorization",
|
|
40
|
-
file: domain,
|
|
41
|
-
body: read(domain) + "\nWhen a term becomes stable, show the exact glossary change and obtain write approval before\nupdating it inline.\n",
|
|
42
|
-
error: /not require per-term approval/,
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
name: "maintenance without initial authorization",
|
|
46
|
-
file: domain,
|
|
47
|
-
body: read(domain).replace("If maintenance is not yet authorized, obtain approval before writing", "Write immediately"),
|
|
48
|
-
error: /should include If maintenance is not yet authorized/,
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
name: "maintenance expands into new scope",
|
|
52
|
-
file: domain,
|
|
53
|
-
body: read(domain).replace("New paths or scope", "Any document"),
|
|
54
|
-
error: /should include New paths or scope/,
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
name: "permission required just to clarify",
|
|
58
|
-
file: outcomes,
|
|
59
|
-
body: read(outcomes) + "\nOnly an explicit choice to continue starts a new grilling session.\n",
|
|
60
|
-
error: /not request permission to clarify/,
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
name: "clarification continues without an answer",
|
|
64
|
-
file: outcomes,
|
|
65
|
-
body: read(outcomes).replace("Wait for the user's answer", "Continue without the user's answer"),
|
|
66
|
-
error: /should include Wait for the user's answer/,
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
name: "blocked Spec stops the router's clarification",
|
|
70
|
-
file: outcomes,
|
|
71
|
-
body: read(outcomes).replace(
|
|
72
|
-
"Preserve the confirmed decisions and evidence; do not draft through an unresolved decision.",
|
|
73
|
-
"Stop without drafting, guessing, or invoking another Skill.",
|
|
74
|
-
),
|
|
75
|
-
error: /not request permission to clarify/,
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
name: "clarification ignores the user's stop request",
|
|
79
|
-
file: outcomes,
|
|
80
|
-
body: read(outcomes).replace("If the user pauses or ends the task, stop.", ""),
|
|
81
|
-
error: /should include If the user pauses or ends the task, stop/,
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
name: "clarification expands authorization to external actions",
|
|
85
|
-
file: outcomes,
|
|
86
|
-
body: read(outcomes).replace(/A new scope or external action still requires its own\s+authorization;/, ""),
|
|
87
|
-
error: /should include A new scope or external action still requires its own/,
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
name: "implementation without Spec approval",
|
|
91
|
-
file: spec,
|
|
92
|
-
body: read(spec).replace("the user has explicitly approved it", "the agent considers it ready"),
|
|
93
|
-
error: /should include the user has explicitly approved it/,
|
|
94
|
-
},
|
|
95
|
-
];
|
|
96
|
-
|
|
97
|
-
for (const scenario of regressions) {
|
|
98
|
-
assert.match(verify({ [scenario.file]: scenario.body }).join("\n"), scenario.error, scenario.name);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
console.log(`Continuation contract tests passed (current documents and ${regressions.length} regressions).`);
|