project-tiny-context-harness 0.2.70 → 0.2.72
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 +31 -21
- package/assets/README.md +26 -18
- package/assets/README.zh-CN.md +9 -3
- package/assets/agents/AGENTS_CORE.md +37 -30
- package/assets/skills/context_development_engineer/SKILL.md +14 -9
- package/assets/skills/context_product_plan/SKILL.md +13 -8
- package/assets/skills/context_surface_contract/SKILL.md +27 -19
- package/assets/skills/context_uiux_design/SKILL.md +13 -8
- package/assets/skills/superpowers-long-task/SKILL.md +113 -25
- package/dist/commands/index.js +9 -3
- package/dist/commands/validate.js +1 -1
- package/dist/lib/plan-acceptance-evidence.d.ts +1 -0
- package/dist/lib/plan-acceptance-evidence.js +68 -0
- package/dist/lib/plan-acceptance-json.d.ts +15 -0
- package/dist/lib/plan-acceptance-json.js +129 -0
- package/dist/lib/plan-acceptance-validator.d.ts +2 -0
- package/dist/lib/plan-acceptance-validator.js +190 -0
- package/dist/lib/plan-contract-validator.d.ts +2 -0
- package/dist/lib/plan-contract-validator.js +127 -0
- package/dist/lib/plan-validator-common.d.ts +24 -0
- package/dist/lib/plan-validator-common.js +196 -0
- package/dist/lib/validators.d.ts +1 -1
- package/dist/lib/validators.js +8 -4
- package/package.json +1 -1
|
@@ -20,7 +20,7 @@ Project-specific engineering rules belong in a separate project-local Skill unde
|
|
|
20
20
|
1. 先读取 `project_context/global.md`、`project_context/architecture.md` 和 `project_context/context.toml`,按 default area、triggers、read_when 选择相关 context。
|
|
21
21
|
2. 先确认用户目标、约束、成功标准、影响产品域、现有验证 / 部署关键路径和风险;能从代码或 Context 发现的事实不要反复询问用户。
|
|
22
22
|
3. `project_context/**` 决定“应该是什么”:模块职责、归属、架构边界、接口方向、契约语义和禁止依赖;代码决定“现在实现到了哪里”。代码不能静默重定义 Context。
|
|
23
|
-
4. 第一处代码编辑前,若任务影响 durable architecture boundary、module ownership、API / Schema / data contract、state / runtime semantics、dependency direction、verification / deployment semantics 或 durable rationale / tradeoff,先编译当前任务契约;契约第一段用 `Context Delta: none|required` 完成唯一正式长期事实判断,再写本次 `Task Contract`,并显式写 `Architecture Context Hit` 和 `Decision Rationale Hit: existing|required|none
|
|
23
|
+
4. 第一处代码编辑前,若任务影响 durable architecture boundary、module ownership、API / Schema / data contract、state / runtime semantics、dependency direction、verification / deployment semantics 或 durable rationale / tradeoff,先编译当前任务契约;契约第一段用 `Context Delta: none|required` 完成唯一正式长期事实判断,再写本次 `Task Contract`,并显式写 `Architecture Context Hit` 和 `Decision Rationale Hit: existing|required|none`。如果输入包含产品方案、架构方案、技术方案、实现方案或验收方案,先在 `plan.md` 或等价临时计划面做 Source-to-Context Coverage,确认方案中的 durable architecture / ownership / API / runtime / verification constraints 已被现有 Context 覆盖、需要更新、仅属 task-local、显式 out-of-scope、需要用户决策或仍 under-scoped。
|
|
24
24
|
5. 普通 bug fix、局部样式、局部实现漂移修复、小重构、package/release 处理、测试修复或探索性 spike 不强制编译架构 / rationale 任务契约,也不更新 Context;一旦形成长期工程结论,继续对齐或交付前必须回写 Context。不要把 Context 机械补成代码改动摘要。
|
|
25
25
|
6. 如果代码、搜索结果或相邻实现与 Context 冲突,显式标记为实现漂移、缺失工作或 Context 过期,不要用当前代码形态反推模块归属。
|
|
26
26
|
7. 涉及已有 Context 的实现判断,先做轻量对齐:
|
|
@@ -45,13 +45,13 @@ Project-specific engineering rules belong in a separate project-local Skill unde
|
|
|
45
45
|
- 默认只实施高收益、低风险、语义稳定的候选项。
|
|
46
46
|
- 不为一次性代码、不稳定语义或纯粹好看的架构做抽象。
|
|
47
47
|
13. 当人工流程呈现重复、确定性、容易漏步骤或顺序影响正确性时,主动评估是否应沉淀为 repo-local tool/script。脚本应放在 owning module 的工具目录并配测试;可恢复的执行入口、参数约束和适用边界写入对应 verification / deployment Context。Skill 只记录这类脚本化机会识别原则,不承载具体模块命令、provider id、artifact 路径或一次性运行结果。
|
|
48
|
-
14. 需要沉淀长期事实时,只更新 `project_context/**`:
|
|
48
|
+
14. 需要沉淀长期事实时,只更新 `project_context/**`:
|
|
49
49
|
- 全局工程取舍、跨产品域索引或当前状态写入 `global.md`。
|
|
50
50
|
- 产品域 API、数据契约、关键约束、入口和风险写入对应 area / subdomain Context。
|
|
51
51
|
- 跨域接口语义写入 `context_role: contract` 或 manifest role 为 `contract` 的 Context;关键重复验证路径写入 `verification`;关键部署、运行拓扑或云端初始化路径写入 `deployment`;代码入口索引用 `implementation-index`;底层理论源用 `foundation`;历史归档索引用 `archive`。
|
|
52
52
|
- 新 context unit 可新增 `project_context/areas/<unit>.md`,并更新 `global.md#Context Index`;复杂项目同时更新 `project_context/context.toml`。
|
|
53
53
|
- 如果 `upgrade` 自动把深层 `.md` 注册成 area,但语义上更像 foundation / contract / archive,后续应显式调整 manifest role;不要依赖自动迁移判断语义。
|
|
54
|
-
15. 实现收尾时做 `Contract Conformance` 和 Context drift check:确认代码没有引入未沉淀的长期事实,且 Context
|
|
54
|
+
15. 实现收尾时做 `Contract Conformance` 和 Context drift check:确认代码没有引入未沉淀的长期事实,且 Context 没有退化成普通实现摘要;若存在 `plan.md` / 等价临时计划面,必须反查 Source-to-Context Coverage、Context-to-Implementation Binding 和 Task Contract,确认没有未处理的 `under_scoped` / `new_context_required` / `needs_user_decision`,也没有 non-bound implementation rows。交付说明只报告轻量状态:`Context: 已更新 ...` 或 `Context: 本次无长期事实变化`。Conformance 说明本次契约满足情况、未满足或延期项和验证入口;一次性证据、截图结果、测试日志、任务契约和实现摘要不写入 Context。
|
|
55
55
|
16. Context 只能声明验证 / 部署关键路径或验收信号,不能伪造“测试已通过”或“部署已成功”。
|
|
56
56
|
17. Verification / Deployment Role Context 只记录长期可复用的重复执行路径事实:特殊准备、最短命令或路径、预期阶段 / 信号、可接受 warning、已排除的重复探索点。不要记录一次性测试日志、完整输出、临时 JSON、CI artifact、测试报告、release ledger、secret、token、cookie、device id 或 raw payload。
|
|
57
57
|
|
|
@@ -76,13 +76,18 @@ Project-specific engineering rules belong in a separate project-local Skill unde
|
|
|
76
76
|
- `none`:没有超限计划 / touched 手写源码文件,或本次没有向超限文件增加新职责。
|
|
77
77
|
- `required`:拆分是本次验收条件,应按 abstraction / decomposition scan 的职责边界完成。
|
|
78
78
|
- `exception`:本次触碰超限文件但暂不拆;只有默认 `modularity.policy: scoped_waivers` 允许此路径,且必须已有或同步新增 `<harnessRoot>/config.yaml` `modularity.waivers` 记录文件、收窄分类、原因和后续拆分边界。若项目设置 `modularity.policy: strict_except_generated`,不得用 legacy waiver 绕过超限手写源码,交付说明只记录本次是否新增职责以及为什么没有拆。
|
|
79
|
-
- `Applicable Module Design` 是高风险任务的前置字段:列出命中的 Context / Skill 来源、适用的 Principles、Design Logic 和 Design Rationale,以及它们控制的当前实现或验证选择。
|
|
79
|
+
- `Applicable Module Design` 是高风险任务的前置字段:列出命中的 Context / Skill 来源、适用的 Principles、Design Logic 和 Design Rationale,以及它们控制的当前实现或验证选择。
|
|
80
80
|
- `Principle Decision Gate` 要写明首选执行路径、fallback / degraded path 的进入条件,以及什么证据不能证明本次目标。涉及 capability、metric 或 acceptance claim 时,先声明要证明的 claim,再选择命令或 probe。
|
|
81
|
-
- 对长任务、多模块、多 agent
|
|
82
|
-
- `plan.md
|
|
83
|
-
- `Context
|
|
84
|
-
- `
|
|
85
|
-
-
|
|
81
|
+
- 对长任务、多模块、多 agent、外部产品/架构/技术/实现/验收方案输入、容易发生 `Context Delta` 调头或多轮验证的任务,使用 `plan.md` 或等价临时计划面暂存 `Source-to-Context Coverage`、`Context-to-Implementation Binding`、`Context Delta`、`Task Contract`、`Implementation Steps` 和 `Contract Conformance`;它只是临时执行缓存。
|
|
82
|
+
- small code task 指现有 Context 已足够、且不改变 durable product / architecture / API-schema / runtime-state / verification-deployment / security-redaction / surface ownership 事实的局部实现任务;它按语义风险判断,不按代码行数判断,不应创建 `plan.md`、完整 trace tables、Source-to-Context Coverage 或 Context-to-Implementation Binding,除非它发现长期事实变化或扩展成高风险工作。
|
|
83
|
+
- `Source-to-Context Coverage` 表使用字段:`Source item | Durable constraint | Type | Existing Context Hit | Context action | Owning Context | Coverage status`。这张表只回答 source 约束是否进入或命中 Context,不写实现路径。
|
|
84
|
+
- `Coverage status` 取值:`covered`、`new_context_required`、`context_updated`、`task_local_only`、`out_of_scope_explicit`、`needs_user_decision`、`under_scoped`。存在 `under_scoped` 或未处理的 `new_context_required` / `needs_user_decision` 时,不能声称已按方案完整实现。
|
|
85
|
+
- `Context-to-Implementation Binding` 表使用字段:`Context fact | Implementation obligation | Expected surfaces | Implemented paths | Forbidden shortcuts | Verification path | Binding status`。
|
|
86
|
+
- `Binding status` 取值:`bound`、`partial`、`missing`、`blocked`、`out_of_scope_explicit`、`needs_user_decision`、`contradicted_by_current_state`。runtime/API/worker 项不能只用测试名或 browser checked path 冒充 `bound`。
|
|
87
|
+
- `plan.md` 中出现的长期工程事实必须提炼回 `project_context/**`;否则不要把临时计划当作事实源、交付产物或后续引用依据。
|
|
88
|
+
- `Context Delta: required` 时先更新 `project_context/**`,再继续实现;`none` 时直接按 Task Contract 实现。
|
|
89
|
+
- `Contract Conformance` 是交付前的软检查:实现偏差修实现,契约遗漏回 Task Contract,长期事实缺失或 source coverage under-scoped 回 `Context Delta` 并先更新 Context。
|
|
90
|
+
- 不为 small code task、普通代码修改、bug fix、小重构、package/release 处理、测试修复、探索性 spike 或仅因 touched file 过大强制编译架构 / rationale 任务契约;大文件只走 `Modularity Check` 的拆分 / exception 判断。
|
|
86
91
|
|
|
87
92
|
## 模块设计上下文写法
|
|
88
93
|
|
|
@@ -25,7 +25,7 @@ Project-specific product planning rules belong in a separate project-local Skill
|
|
|
25
25
|
4. 涉及输入、选择、搜索、筛选、表单/配置、调度/时间窗口、预算/配额/限流或加载/空态/错误态等 UI 控件时,用“控件任务框架”重新理解用户任务和产品反馈;这只是通用判断框架,不是业务处方库。
|
|
26
26
|
5. 当一个产品对象、能力或接口的增删改需要跨多个页面、模块、Context 或产品域同步调整时,将该影响范围视为产品边界复核信号;先判断它是否应沉淀为独立能力、subdomain 或 area,并明确对外契约、所有权和消费方边界,避免通过手工清单长期维护各消费面的重复映射。
|
|
27
27
|
6. 产品意图、模块职责、边界和验收口径以 `project_context/**` 为准;代码和搜索结果只说明当前实现状态。Context 决定“应该是什么”,代码揭示“现在是什么”,代码不能静默重定义 Context。
|
|
28
|
-
7. 输出产品判断或第一处实现编辑前,若任务涉及产品方案、页面/模块边界、信息架构、API / Schema、验收口径、跨域契约、状态或调度语义,先编译当前任务契约;契约第一段用 `Context Delta: none|required` 完成唯一正式长期事实判断,再写本次 `Task Contract
|
|
28
|
+
7. 输出产品判断或第一处实现编辑前,若任务涉及产品方案、页面/模块边界、信息架构、API / Schema、验收口径、跨域契约、状态或调度语义,先编译当前任务契约;契约第一段用 `Context Delta: none|required` 完成唯一正式长期事实判断,再写本次 `Task Contract`。如果输入包含产品方案、架构方案、技术方案或验收方案,先在 `plan.md` 或等价临时计划面做 Source-to-Context Coverage,确认方案中的 durable product / surface / IA / acceptance constraints 已被现有 Context 覆盖、需要更新、仅属 task-local、显式 out-of-scope、需要用户决策或仍 under-scoped。
|
|
29
29
|
8. 普通 bug fix、局部样式、局部实现漂移、测试修复或探索性 spike 不更新 Context;如果过程中形成长期产品结论,应在继续对齐或交付前回写 Context。不要把 Context 机械补成代码改动摘要。
|
|
30
30
|
9. 如果代码与 Context 冲突,显式标记为实现漂移、缺失工作或 Context 过期。
|
|
31
31
|
10. 输出产品判断时保持短而具体,避免长篇 PRD 模板。
|
|
@@ -45,13 +45,18 @@ Project-specific product planning rules belong in a separate project-local Skill
|
|
|
45
45
|
- `Context Delta` 必须先出现,取值为 `none` 或 `required`:
|
|
46
46
|
- `none`:本次只是按既有 Context / 原则落地,不新增长期事实。
|
|
47
47
|
- `required`:说明长期事实类型、应写入的 Context / role、需要沉淀的事实,以及明确不写入 Context 的一次性内容。
|
|
48
|
-
- `Task Contract` 用短列表说明本次产品实现必须满足的目标、用户任务、信息 / 动作 / 状态 / 反馈、边界、非目标和验收信号。
|
|
49
|
-
- 触及 Product Surface 时,`Task Contract` 同时说明 surface platform、primary user question、main allows/forbids、drilldown ownership、long-task state requirement 和 verification;业务特定答案进入项目 Context 或项目本地 Skill,不写进 package-managed Skill。
|
|
50
|
-
- 对长任务、多模块、多 agent
|
|
51
|
-
- `plan.md
|
|
52
|
-
- `Context
|
|
53
|
-
- `
|
|
54
|
-
-
|
|
48
|
+
- `Task Contract` 用短列表说明本次产品实现必须满足的目标、用户任务、信息 / 动作 / 状态 / 反馈、边界、非目标和验收信号。
|
|
49
|
+
- 触及 Product Surface 时,`Task Contract` 同时说明 surface platform、primary user question、main allows/forbids、drilldown ownership、long-task state requirement 和 verification;业务特定答案进入项目 Context 或项目本地 Skill,不写进 package-managed Skill。
|
|
50
|
+
- 对长任务、多模块、多 agent、外部产品/架构/技术/验收方案输入、容易发生 `Context Delta` 调头或多轮验证的任务,使用 `plan.md` 或等价临时计划面暂存 `Source-to-Context Coverage`、`Context-to-Implementation Binding`、`Context Delta`、`Task Contract`、`Implementation Steps` 和 `Contract Conformance`;它只是临时执行缓存。
|
|
51
|
+
- small code task 指现有 Context 已足够、且不改变 durable product / architecture / API-schema / runtime-state / verification-deployment / security-redaction / surface ownership 事实的局部实现任务;它按语义风险判断,不按代码行数判断,不应创建 `plan.md`、完整 trace tables、Source-to-Context Coverage 或 Context-to-Implementation Binding,除非它发现长期事实变化或扩展成高风险工作。
|
|
52
|
+
- `Source-to-Context Coverage` 表使用字段:`Source item | Durable constraint | Type | Existing Context Hit | Context action | Owning Context | Coverage status`。这张表只回答 source 约束是否进入或命中 Context,不写实现路径。
|
|
53
|
+
- `Coverage status` 取值:`covered`、`new_context_required`、`context_updated`、`task_local_only`、`out_of_scope_explicit`、`needs_user_decision`、`under_scoped`。存在 `under_scoped` 或未处理的 `new_context_required` / `needs_user_decision` 时,不能声称已按方案完整实现。
|
|
54
|
+
- `Context-to-Implementation Binding` 表使用字段:`Context fact | Implementation obligation | Expected surfaces | Implemented paths | Forbidden shortcuts | Verification path | Binding status`。
|
|
55
|
+
- `Binding status` 取值:`bound`、`partial`、`missing`、`blocked`、`out_of_scope_explicit`、`needs_user_decision`、`contradicted_by_current_state`。存在 non-bound 项时,不能声称已按 Context 完整落地。
|
|
56
|
+
- `plan.md` 中出现的长期事实必须提炼回 `project_context/**`;否则不要把临时计划当作事实源、交付产物或后续引用依据。
|
|
57
|
+
- `Context Delta: required` 时先更新 `project_context/**`,再继续实现;`none` 时直接按 Task Contract 实现。
|
|
58
|
+
- `Contract Conformance` 是交付前的软检查:实现偏差修实现,契约遗漏回 Task Contract,长期事实缺失或 source coverage under-scoped 回 `Context Delta` 并先更新 Context。
|
|
59
|
+
- 不为 small code task、普通 bug fix、局部样式、小重构、局部实现漂移、测试修复或探索性 spike 强制编译任务契约。
|
|
55
60
|
|
|
56
61
|
## 产品体验校准
|
|
57
62
|
|
|
@@ -67,12 +67,13 @@ Use when turning audit findings or user decisions into Context candidates.
|
|
|
67
67
|
|
|
68
68
|
Output:
|
|
69
69
|
|
|
70
|
-
- Project-level Product Surface Contract candidate when responsibilities cross surfaces or areas.
|
|
71
|
-
- Area-level Screen Contract candidate when ownership belongs inside one domain.
|
|
72
|
-
- `context.toml` candidate registration with `role = "contract"` when durable registration is needed.
|
|
73
|
-
- `global.md#Context Index` candidate entry when a new Context file is added.
|
|
74
|
-
- Verification candidate for repeatable surface checks.
|
|
75
|
-
-
|
|
70
|
+
- Project-level Product Surface Contract candidate when responsibilities cross surfaces or areas.
|
|
71
|
+
- Area-level Screen Contract candidate when ownership belongs inside one domain.
|
|
72
|
+
- `context.toml` candidate registration with `role = "contract"` when durable registration is needed.
|
|
73
|
+
- `global.md#Context Index` candidate entry when a new Context file is added.
|
|
74
|
+
- Verification candidate for repeatable surface checks.
|
|
75
|
+
- Source-to-Context Coverage candidate when an external product, architecture, technical or acceptance source changes durable surface responsibility.
|
|
76
|
+
- Repo-local Skill task-block candidate when the user wants project-specific enforcement.
|
|
76
77
|
|
|
77
78
|
Do not assume business responsibilities from current code shape alone. Ask for confirmation if the candidate would silently choose between competing product or information-architecture meanings.
|
|
78
79
|
|
|
@@ -104,11 +105,13 @@ Use after implementation or during review.
|
|
|
104
105
|
|
|
105
106
|
Output:
|
|
106
107
|
|
|
107
|
-
- Surface Contract Conformance.
|
|
108
|
-
-
|
|
109
|
-
-
|
|
110
|
-
-
|
|
111
|
-
-
|
|
108
|
+
- Surface Contract Conformance.
|
|
109
|
+
- Source-to-Context Coverage status when a plan surface exists.
|
|
110
|
+
- Context-to-Implementation Binding status when a plan surface exists.
|
|
111
|
+
- Remaining Drift.
|
|
112
|
+
- Missing Context.
|
|
113
|
+
- Implementation Drift.
|
|
114
|
+
- Verification run / not_run / failed.
|
|
112
115
|
|
|
113
116
|
Do not store one-off evidence, screenshots, logs, raw outputs or implementation summaries in Context.
|
|
114
117
|
|
|
@@ -123,7 +126,8 @@ For each touched surface, answer only what is relevant:
|
|
|
123
126
|
- What must move to drilldown, diagnostics, operations, evidence or technical detail?
|
|
124
127
|
- Which long-running or mutating actions require task id, progress, retry, import, recovery or history?
|
|
125
128
|
- Which empty, loading, stale, unavailable, fixture or fallback states matter?
|
|
126
|
-
- What validation path can prove conformance?
|
|
129
|
+
- What validation path can prove conformance?
|
|
130
|
+
- If this came from an external plan/source, which source constraints are covered by existing Context, require new Context, are task-local only, are explicitly out of scope, need user decision or remain under-scoped?
|
|
127
131
|
|
|
128
132
|
## Repo-Local Task Block Candidate
|
|
129
133
|
|
|
@@ -143,11 +147,13 @@ For any task touching user-facing surfaces, information placement, forms, filter
|
|
|
143
147
|
- Main Surface Forbids: `<backend fields, raw payloads, diagnostics, debug ids, fake states, etc.>`
|
|
144
148
|
- Drilldown Ownership: `<details / evidence / operations / diagnostics / technical details>`
|
|
145
149
|
- Long Task State Requirement: `<run id, progress, retry, recovery, import, history, or none>`
|
|
146
|
-
- Context Delta: `<none | required>`
|
|
147
|
-
- Verification: `<view-model test / component test / browser smoke / CLI smoke / manual check>`
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
150
|
+
- Context Delta: `<none | required>`
|
|
151
|
+
- Verification: `<view-model test / component test / browser smoke / CLI smoke / manual check>`
|
|
152
|
+
- Source-to-Context Coverage: `<covered | new_context_required | context_updated | task_local_only | out_of_scope_explicit | needs_user_decision | under_scoped>`
|
|
153
|
+
- Context-to-Implementation Binding: `<bound | partial | missing | blocked | out_of_scope_explicit | needs_user_decision | contradicted_by_current_state>`
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Do not add this task block to package-managed default Skills as a universal gate. Projects opt in through separate project-local Skills.
|
|
151
157
|
|
|
152
158
|
## Implementation Alignment
|
|
153
159
|
|
|
@@ -159,7 +165,9 @@ When implementation is also requested, align code with the Product Surface Contr
|
|
|
159
165
|
- Tests should assert user-facing state semantics, not only backend field plumbing.
|
|
160
166
|
- Browser, app, CLI or game smoke checks should validate actual surface behavior when feasible.
|
|
161
167
|
|
|
162
|
-
Final handoff should include concise `Surface Contract Conformance`: contract source, implementation alignment, remaining drift and verification status.
|
|
168
|
+
Final handoff should include concise `Surface Contract Conformance`: contract source, implementation alignment, remaining drift and verification status.
|
|
169
|
+
|
|
170
|
+
If a `plan.md` or equivalent temporary plan surface exists, conformance must also check its Source-to-Context Coverage and Context-to-Implementation Binding. Remaining `under_scoped` or unresolved `new_context_required` rows mean the implementation cannot be described as fully aligned to the source surface responsibilities. Non-bound surface implementation rows mean it cannot be described as fully aligned to Context; component, modal, viewmodel or unit evidence alone cannot prove main-surface ownership.
|
|
163
171
|
|
|
164
172
|
## Output Boundaries
|
|
165
173
|
|
|
@@ -167,5 +175,5 @@ Final handoff should include concise `Surface Contract Conformance`: contract so
|
|
|
167
175
|
- Do not update Context for ordinary CSS tweaks, copy edits or one-off UI bug fixes unless durable surface responsibility changes.
|
|
168
176
|
- Do not treat current backend fields, enums, JSON, screenshots or terminal output as product intent.
|
|
169
177
|
- Do not invent rationale; rejected alternatives or tradeoffs belong in Context only when they are stable enough to affect future surface decisions.
|
|
170
|
-
- Do not add a validator, edit-order gate or package-level mandatory Surface Contract gate.
|
|
178
|
+
- Do not add a surface-specific validator, edit-order gate or package-level mandatory Surface Contract gate. The generic plan-contract validator may check declared surface binding consistency when a temporary plan surface exists.
|
|
171
179
|
- Do not include business-domain examples in this package-managed Skill.
|
|
@@ -25,7 +25,7 @@ Project-specific UI/UX and visual design rules belong in a separate project-loca
|
|
|
25
25
|
- 若缺失且本任务改变 durable surface responsibility,输出 `Surface Contract Delta: required`,把界面职责写入 `project_context/**`;视觉 token、颜色、字体、间距、圆角和视觉 rationale 仍写入 `DESIGN.md`。
|
|
26
26
|
5. 涉及输入、选择、搜索、筛选、表单/配置、调度/时间窗口、预算/配额/限流或加载/空态/错误态等 UI 控件时,用“控件交互框架”检查控件语义、反馈状态、校验、错误预防、可供性和信息密度;这只是通用判断框架,不是固定控件处方。
|
|
27
27
|
6. 界面职责、流程归属和长期交互契约以 `project_context/**` 为准;`DESIGN.md` 负责视觉 token 和视觉 rationale;代码、截图和搜索结果只说明当前实现状态。Context 决定“应该是什么”,代码和截图揭示“现在是什么”,代码不能静默重定义 Context。
|
|
28
|
-
7. 设计判断或第一处实现编辑前,若任务涉及页面职责、流程边界、信息架构、交互契约、状态或调度语义、可访问性约束、设计验证关键路径或部署关键路径,先编译当前任务契约;契约第一段用 `Context Delta: none|required` 完成唯一正式长期事实判断,再写本次 `Task Contract
|
|
28
|
+
7. 设计判断或第一处实现编辑前,若任务涉及页面职责、流程边界、信息架构、交互契约、状态或调度语义、可访问性约束、设计验证关键路径或部署关键路径,先编译当前任务契约;契约第一段用 `Context Delta: none|required` 完成唯一正式长期事实判断,再写本次 `Task Contract`。如果输入包含产品方案、架构方案、技术方案、界面方案或验收方案,先在 `plan.md` 或等价临时计划面做 Source-to-Context Coverage,确认方案中的 durable surface / IA / interaction / verification constraints 已被现有 Context 或 `DESIGN.md` 覆盖、需要更新、仅属 task-local、显式 out-of-scope、需要用户决策或仍 under-scoped。
|
|
29
29
|
8. 普通 UI bug、局部样式或 CSS 修复、测试修复或探索性 spike 不更新 Context,可先改代码;一旦形成长期交互或视觉结论,继续对齐或交付前必须回写 Context 或 `DESIGN.md`。不要把 Context 机械补成代码改动摘要。
|
|
30
30
|
9. 如果二者冲突,显式标记为实现漂移、缺失工作或 Context 过期。
|
|
31
31
|
10. 如果涉及已有 UI,优先结合代码入口、运行截图或用户提供的参考图来描述差异。
|
|
@@ -46,13 +46,18 @@ Project-specific UI/UX and visual design rules belong in a separate project-loca
|
|
|
46
46
|
- `Context Delta` 必须先出现,取值为 `none` 或 `required`:
|
|
47
47
|
- `none`:本次只是按既有 Context / `DESIGN.md` / 设计原则落地,不新增长期事实。
|
|
48
48
|
- `required`:说明长期事实类型、应写入的 Context / role 或 `DESIGN.md` 位置、需要沉淀的事实,以及明确不写入 Context 的一次性内容。
|
|
49
|
-
- `Task Contract` 用短列表说明页面 / 组件任务、用户判断、主信息和辅助信息归属、动作层级、输入语义、loading / empty / no results / stale / error / degraded / success 状态、布局稳定性、非目标和验收入口。
|
|
50
|
-
- 触及 Product Surface 时,`Task Contract` 同时说明 surface platform、primary user question、main allows/forbids、drilldown ownership、long-task state requirement 和 verification;代码字段、枚举、JSON 或截图只是实现证据,不是产品职责来源。
|
|
51
|
-
- 对长任务、多页面/组件、多 agent
|
|
52
|
-
- `
|
|
53
|
-
- `Context
|
|
54
|
-
- `
|
|
55
|
-
-
|
|
49
|
+
- `Task Contract` 用短列表说明页面 / 组件任务、用户判断、主信息和辅助信息归属、动作层级、输入语义、loading / empty / no results / stale / error / degraded / success 状态、布局稳定性、非目标和验收入口。
|
|
50
|
+
- 触及 Product Surface 时,`Task Contract` 同时说明 surface platform、primary user question、main allows/forbids、drilldown ownership、long-task state requirement 和 verification;代码字段、枚举、JSON 或截图只是实现证据,不是产品职责来源。
|
|
51
|
+
- 对长任务、多页面/组件、多 agent、外部产品/架构/技术/界面/验收方案输入、容易发生 `Context Delta` 调头或多轮截图 / 手动验证的任务,使用 `plan.md` 或等价临时计划面暂存 `Source-to-Context Coverage`、`Context-to-Implementation Binding`、`Context Delta`、`Task Contract`、`Implementation Steps` 和 `Contract Conformance`;它只是临时执行缓存。
|
|
52
|
+
- small code task 指现有 Context / `DESIGN.md` 已足够、且不改变 durable product / architecture / API-schema / runtime-state / verification-deployment / security-redaction / surface ownership 事实的局部实现任务;它按语义风险判断,不按代码行数判断,不应创建 `plan.md`、完整 trace tables、Source-to-Context Coverage 或 Context-to-Implementation Binding,除非它发现长期事实变化或扩展成高风险工作。
|
|
53
|
+
- `Source-to-Context Coverage` 表使用字段:`Source item | Durable constraint | Type | Existing Context Hit | Context action | Owning Context | Coverage status`。这张表只回答 source 约束是否进入或命中 Context / `DESIGN.md`,不写实现路径。
|
|
54
|
+
- `Coverage status` 取值:`covered`、`new_context_required`、`context_updated`、`task_local_only`、`out_of_scope_explicit`、`needs_user_decision`、`under_scoped`。存在 `under_scoped` 或未处理的 `new_context_required` / `needs_user_decision` 时,不能声称已按方案完整实现。
|
|
55
|
+
- `Context-to-Implementation Binding` 表使用字段:`Context fact | Implementation obligation | Expected surfaces | Implemented paths | Forbidden shortcuts | Verification path | Binding status`。
|
|
56
|
+
- `Binding status` 取值:`bound`、`partial`、`missing`、`blocked`、`out_of_scope_explicit`、`needs_user_decision`、`contradicted_by_current_state`。UI/surface 项不能只用 component / viewmodel / mock / unit evidence 冒充 `bound`。
|
|
57
|
+
- `plan.md` 中出现的长期界面、交互或视觉事实必须提炼回 `project_context/**` 或 `DESIGN.md`;否则不要把临时计划当作事实源、交付产物或后续引用依据。
|
|
58
|
+
- `Context Delta: required` 时先更新 `project_context/**` 或 `DESIGN.md`,再继续实现;`none` 时直接按 Task Contract 实现。
|
|
59
|
+
- `Contract Conformance` 是交付前的软检查:实现偏差修实现,契约遗漏回 Task Contract,长期事实缺失或 source coverage under-scoped 回 `Context Delta` 并先更新 Context / `DESIGN.md`。
|
|
60
|
+
- 不为 small code task、普通 UI bug、局部 CSS 修复、小重构、测试修复或探索性 spike 强制编译任务契约。
|
|
56
61
|
|
|
57
62
|
## 信息呈现校准
|
|
58
63
|
|
|
@@ -21,6 +21,8 @@ Consumes three existing upstream inputs and emits a paste-ready Superpowers targ
|
|
|
21
21
|
|
|
22
22
|
Use this Skill only after all three inputs already exist or are pasted in full. Two-document compatibility is allowed only when the first document explicitly contains both Product / Architecture Source and Technical Realization Plan sections; otherwise stop for a missing Technical Realization Plan. Do not generate, derive, or infer the Technical Realization Plan. Do not generate, derive, rewrite, strengthen, or repair the full checklist in this Skill. If plan items or ACs are too vague to trace, stop and ask for the missing fields. If only generic conformance or verdict rules are missing, inject this Skill's default rules into the generated prompt.
|
|
23
23
|
|
|
24
|
+
This Skill does not perform task-complexity routing. Direct invocation means the user or upstream process has already selected Superpowers long-task execution. Ordinary checklist preparation, non-Superpowers target prompts or incomplete upstream packets should be handled before this Skill, normally with `/normal-long-task` or a revised upstream packet.
|
|
25
|
+
|
|
24
26
|
## Direct Invocation
|
|
25
27
|
|
|
26
28
|
Use this Skill through explicit invocation:
|
|
@@ -68,6 +70,17 @@ The input must fully expose these fields:
|
|
|
68
70
|
|
|
69
71
|
If any of these are missing required fields, stop. Do not generate the Superpowers target-mode prompt. Report whether each missing field belongs in Product / Architecture Source, Technical Realization Plan, Acceptance Checklist, blocker section or Context reference. If the user supplied only a product/architecture source plus checklist, report missing Technical Realization Plan.
|
|
70
72
|
|
|
73
|
+
When blocked by missing input, return a structured Missing Fields Report with:
|
|
74
|
+
|
|
75
|
+
- `missing_section`.
|
|
76
|
+
- `missing_required_fields`.
|
|
77
|
+
- `why_blocking`.
|
|
78
|
+
- `cannot_infer_policy`.
|
|
79
|
+
- `required_next_input`.
|
|
80
|
+
- `suggested_upstream_action`.
|
|
81
|
+
|
|
82
|
+
The report must state that this Skill cannot infer the execution blueprint from Product / Architecture Source and cannot repair the checklist. It may recommend supplying the missing Technical Realization Plan or using `/normal-long-task` before Superpowers execution when the upstream packet is not ready.
|
|
83
|
+
|
|
71
84
|
## Source Roles
|
|
72
85
|
|
|
73
86
|
- Product / Architecture Source prevents scope shrinkage and drives Product Context Delta / architecture-intent checks; it is not the code construction plan.
|
|
@@ -79,6 +92,14 @@ If any of these are missing required fields, stop. Do not generate the Superpowe
|
|
|
79
92
|
|
|
80
93
|
Do not let a compact target prompt override the product/architecture source, technical realization plan or full checklist. The compact prompt is direction, priority and recovery navigation only. The technical realization plan controls plan conformance; the product/architecture source prevents scope shrinkage; the full checklist controls acceptance.
|
|
81
94
|
|
|
95
|
+
## Authority Model
|
|
96
|
+
|
|
97
|
+
- Product / Architecture Source owns intent, scope, non-goals, product/architecture boundaries and acceptance semantics.
|
|
98
|
+
- Technical Realization Plan owns plan items, execution blueprint, owner/forbidden surfaces, implementation paths and plan-conformance expectations.
|
|
99
|
+
- Acceptance Checklist owns ACs, completion semantics, required proof layers, invalid evidence rules and final acceptance state.
|
|
100
|
+
- local audit, plan-conformance matrix, final acceptance verdict, validator output, optional proof index and auditor report are execution/evidence artifacts. They cannot narrow, rewrite or replace the upstream sources.
|
|
101
|
+
- When sources conflict, stop or report the conflict instead of letting a downstream artifact silently change scope, plan or acceptance.
|
|
102
|
+
|
|
82
103
|
## Context Delta Assessment
|
|
83
104
|
|
|
84
105
|
The prompt must require the future executor to evaluate Context before implementation using:
|
|
@@ -97,6 +118,13 @@ Any required sub-delta makes overall Context Delta required. This is prompt-leve
|
|
|
97
118
|
|
|
98
119
|
When overall `Context Delta: required`, the executor must update the smallest owning `project_context/**` or `DESIGN.md` fact before implementation continues. Use existing roles only: `area`, `subdomain`, `contract`, `foundation`, `verification`, `deployment`, `implementation-index` and `decision-rationale`. Do not write local audit, plan-conformance matrix, final acceptance verdict, temporary plan, sampled evidence, one-off logs, raw outputs, screenshots or PR notes into Context.
|
|
99
120
|
|
|
121
|
+
For Superpowers execution, the generated prompt should use a parent/slice pattern:
|
|
122
|
+
|
|
123
|
+
- Parent Context Delta: evaluate Product Context Delta, Technical Context Delta, overall Context Delta, owning Context files and whether required Context was updated before implementation.
|
|
124
|
+
- Slice Context Delta: each implementation slice inherits the parent decision and only records whether it discovered a new durable fact.
|
|
125
|
+
- If a slice discovers a new durable product or technical fact, it must identify the owning Context and update it before continuing.
|
|
126
|
+
- Slice-level `none` cannot override a parent-level `required` decision.
|
|
127
|
+
|
|
100
128
|
## Plan Conformance Gate
|
|
101
129
|
|
|
102
130
|
The prompt must require the future executor to create or initialize `tmp/ty-context/plan-acceptance/<plan-slug>-plan-conformance-matrix.md` and `.json` before substantial implementation, then update it after each meaningful implementation slice.
|
|
@@ -104,6 +132,7 @@ The prompt must require the future executor to create or initialize `tmp/ty-cont
|
|
|
104
132
|
Each behavior-affecting Technical Realization Plan item must have a trace entry with:
|
|
105
133
|
|
|
106
134
|
- plan item id and plan requirement.
|
|
135
|
+
- acceptance ids covered by the plan item when applicable.
|
|
107
136
|
- expected surfaces.
|
|
108
137
|
- implemented paths.
|
|
109
138
|
- missing paths.
|
|
@@ -112,6 +141,10 @@ Each behavior-affecting Technical Realization Plan item must have a trace entry
|
|
|
112
141
|
- scope assessment.
|
|
113
142
|
- status.
|
|
114
143
|
- drift.
|
|
144
|
+
- required proof layers, satisfied proof layers and missing required layers when the plan/checklist requires layered evidence.
|
|
145
|
+
- substitute or sibling evidence use when any similar execution path, negative case, screenshot or artifact could be confused with the required evidence.
|
|
146
|
+
- Context fact refs when Context Delta is required.
|
|
147
|
+
- For Product Surface, IA or architecture-migration items: conformance type, owner surface, required user paths, forbidden primary surfaces, real page evidence, negative surface checks and default visibility requirement.
|
|
115
148
|
|
|
116
149
|
Allowed plan-conformance statuses:
|
|
117
150
|
|
|
@@ -122,6 +155,7 @@ Allowed plan-conformance statuses:
|
|
|
122
155
|
- `blocked`
|
|
123
156
|
- `scope_changed_requires_user_approval`
|
|
124
157
|
- `contradicted_by_current_state`
|
|
158
|
+
- `out_of_scope_NA`
|
|
125
159
|
|
|
126
160
|
Hard rules:
|
|
127
161
|
|
|
@@ -130,6 +164,8 @@ Hard rules:
|
|
|
130
164
|
- A local audit cannot narrow plan scope or mark completion.
|
|
131
165
|
- Scope correction requires explicit user approval or a revised product/architecture source, Technical Realization Plan and checklist.
|
|
132
166
|
- Every behavior-affecting plan section must have an implementation trace entry.
|
|
167
|
+
- Product Surface, IA or architecture-migration rows cannot be complete without owner surface, required user paths, real page evidence, negative surface checks for forbidden primary surfaces and Context fact refs when Context Delta is required.
|
|
168
|
+
- A complete row cannot have unresolved `missing_required_layers`, material or critical `drift_severity`, unapproved `sibling_substitution_used`, summary-only evidence or blocking auditor findings.
|
|
133
169
|
- Any `partial`, `sampled_only`, `not_implemented`, unresolved blocker, unapproved scope change or current contradiction prevents overall done.
|
|
134
170
|
|
|
135
171
|
## Acceptance Evidence Gate
|
|
@@ -139,10 +175,16 @@ The prompt must require the future executor to generate `tmp/ty-context/plan-acc
|
|
|
139
175
|
Each AC verdict entry must include:
|
|
140
176
|
|
|
141
177
|
- AC id or acceptance item.
|
|
178
|
+
- related plan item ids when applicable.
|
|
142
179
|
- status.
|
|
143
180
|
- required evidence.
|
|
181
|
+
- required proof chain when the checklist or plan requires multiple evidence layers.
|
|
144
182
|
- fresh evidence.
|
|
145
183
|
- missing evidence.
|
|
184
|
+
- missing required layers.
|
|
185
|
+
- drift severity.
|
|
186
|
+
- sibling substitution used / approval source.
|
|
187
|
+
- auditor status and findings when an auditor subagent was available.
|
|
146
188
|
- contradictions.
|
|
147
189
|
- decision.
|
|
148
190
|
|
|
@@ -153,14 +195,49 @@ Allowed AC statuses:
|
|
|
153
195
|
- `blocked`
|
|
154
196
|
- `not_run`
|
|
155
197
|
- `invalidated`
|
|
198
|
+
- `out_of_scope_NA`
|
|
156
199
|
|
|
157
200
|
Hard rules:
|
|
158
201
|
|
|
159
202
|
- Final completion requires an AC-by-AC final acceptance verdict.
|
|
203
|
+
- Before any completion claim, run `ty-context validate-plan-acceptance tmp/ty-context/plan-acceptance/<plan-slug>`; failure prevents final complete and must produce partial / blocker / missing-evidence output.
|
|
204
|
+
- `validate-plan-acceptance` rejects contradictory matrix/verdict JSON, weak-proof complete rows, missing cross-references and declared surface/architecture binding gaps; it checks artifact consistency and references, not product quality.
|
|
160
205
|
- Current API/UI/runtime/data/test contradictions override historical passing evidence.
|
|
161
206
|
- local audit, subagent summaries, final result card text, passing test logs, stale artifacts, partial smoke, dry-run or sampled paths cannot prove completion by themselves.
|
|
162
207
|
- Any current contradiction downgrades the affected AC and overall status.
|
|
163
208
|
- Scope narrowing in audit does not modify acceptance unless the user approved a revised source/plan/checklist.
|
|
209
|
+
- `out_of_scope_NA` requires explicit reason and source reference; arbitrary prose cannot waive missing evidence.
|
|
210
|
+
- Complete AC rows cannot have unresolved `missing_required_layers`, material or critical `drift_severity`, unapproved `sibling_substitution_used`, blocking `auditor_status` or only self-certifying evidence such as local audit, matrix/verdict text, subagent summary, final card or validator pass.
|
|
211
|
+
|
|
212
|
+
## External Reviewer Evidence Gate
|
|
213
|
+
|
|
214
|
+
The final verdict is not completion proof unless every complete AC can be independently reviewed from fresh command, API, UI, runtime, artifact, browser or test evidence. Evidence index, matrix rows, local audit, validator pass and summaries can point to evidence, but cannot replace evidence.
|
|
215
|
+
|
|
216
|
+
For every AC whose checklist implies multiple required layers, the final verdict must record `required_proof_chain`, `fresh_evidence`, `missing_required_layers`, `drift_severity`, `sibling_substitution_used`, `auditor_status` and `auditor_findings` when applicable. These are generic evidence protocol fields; concrete business layers must come from the Acceptance Checklist, Product / Architecture Source, Technical Realization Plan or project-local Context/Skills.
|
|
217
|
+
|
|
218
|
+
Evidence Ledger / proof index is optional execution indexing, not a fourth input, not durable Context and not required as a separate file. Complete plan-conformance rows and complete AC verdicts must still be evidence-traceable: cite fresh, reviewable evidence directly in the row or through an optional `evidence_id` that points to command, API, UI, runtime, artifact, browser or test evidence with enough freshness context for a reviewer to reconstruct the proof chain.
|
|
219
|
+
|
|
220
|
+
## Drift-to-Status
|
|
221
|
+
|
|
222
|
+
Any plan item or AC with unresolved missing required layers, material / critical drift or a current API / UI / runtime / data / test contradiction cannot be `complete`. It must be `partial`, `blocked`, `invalidated` or `out_of_scope_NA` with explicit source reference.
|
|
223
|
+
|
|
224
|
+
## No Sibling Substitution
|
|
225
|
+
|
|
226
|
+
The same execution path, negative case, screenshot or artifact class cannot substitute for the required one unless the checklist explicitly allows that substitution or marks the required layer `out_of_scope_NA`. Similar evidence is auxiliary only.
|
|
227
|
+
|
|
228
|
+
## Independent Reviewer Gate
|
|
229
|
+
|
|
230
|
+
When subagents are available, add a read-only auditor after executor self-evidence and `validate-plan-acceptance`. The auditor is a gap detector, not a proof source: it must not edit code, repair artifacts or treat local audit, subagent summary, matrix/verdict text, validator pass or final card as proof. It reconstructs each AC proof chain from source/plan/checklist, checks freshness and raw evidence, rejects sibling substitution and returns `auditor_status` plus findings. Any `partial`, `blocked` or `invalidated` auditor result downgrades the affected AC unless fresh evidence closes the gap.
|
|
231
|
+
|
|
232
|
+
Final gate order is fixed:
|
|
233
|
+
|
|
234
|
+
1. executor self-evidence.
|
|
235
|
+
2. update plan-conformance matrix.
|
|
236
|
+
3. update final-acceptance verdict.
|
|
237
|
+
4. run `ty-context validate-plan-acceptance`.
|
|
238
|
+
5. run read-only auditor gap review when subagents are available.
|
|
239
|
+
6. if auditor findings change matrix, verdict or evidence, fix the gap and rerun `ty-context validate-plan-acceptance`.
|
|
240
|
+
7. make a final completion claim only when self-evidence, validator consistency and auditor review have no blocking conflict.
|
|
164
241
|
|
|
165
242
|
## Evidence Layer Separation
|
|
166
243
|
|
|
@@ -220,7 +297,7 @@ Bind the target prompt to the official Skill names and their documented roles:
|
|
|
220
297
|
- Prefer `superpowers:subagent-driven-development` when subagents are available.
|
|
221
298
|
- Use `superpowers:executing-plans` when executing a written plan without the same-session subagent workflow.
|
|
222
299
|
- Plan or AC behavior gap -> TDD: each behavior gap uses `superpowers:test-driven-development` to write a failing test, observe failure, then implement minimally.
|
|
223
|
-
- Before any completion claim, use `superpowers:verification-before-completion` against both `plan-conformance-matrix.*` and `final-acceptance-verdict.*` with fresh evidence
|
|
300
|
+
- Before any completion claim, use `superpowers:verification-before-completion` against both `plan-conformance-matrix.*` and `final-acceptance-verdict.*` with fresh evidence, then run `ty-context validate-plan-acceptance tmp/ty-context/plan-acceptance/<plan-slug>`.
|
|
224
301
|
- review / finish cannot override the plan-conformance matrix or full checklist; if either gate is unsatisfied, continue implementation or report blockers.
|
|
225
302
|
|
|
226
303
|
If Superpowers is missing, install it through the current platform's official Superpowers installation path. If installation is blocked by permissions, network or platform limits, record the blocker in local audit and do not count it as complete.
|
|
@@ -242,13 +319,19 @@ The Superpowers target prompt must require the future executor to update local a
|
|
|
242
319
|
|
|
243
320
|
The local audit is not Context, not proof, not a global task manager, and not a replacement for project tests, CI, review, human acceptance, Task Contract or workflow-contract `plan.md`. It must not contain `overall_status: done`, `status: done` or `final_gate: passed`; use `candidate_status: claims_done_but_unverified` when needed.
|
|
244
321
|
|
|
322
|
+
The local audit is process recovery only. It must not contain completion judgment such as accepted, complete, done, final passed or product verified except as invalid evidence being rejected.
|
|
323
|
+
|
|
245
324
|
## Prompt Generation Rules
|
|
246
325
|
|
|
247
326
|
- The prompt must visibly output `Superpowers 输入包` for Chinese prompts or `Superpowers input packet` for English prompts.
|
|
248
327
|
- The prompt must visibly output `Superpowers 执行绑定` for Chinese prompts or `Superpowers execution binding` for English prompts.
|
|
249
328
|
- The prompt must identify Product / Architecture Source, Technical Realization Plan, Acceptance Checklist, local audit, plan-conformance matrix and final verdict paths at the top.
|
|
250
329
|
- The prompt must state that the Technical Realization Plan controls plan conformance, the Product / Architecture Source prevents scope shrinkage and the full checklist controls acceptance.
|
|
330
|
+
- The prompt must state the Authority Model and that audit/matrix/verdict/validator/auditor artifacts cannot rewrite source, plan or checklist authority.
|
|
251
331
|
- The prompt must require Product Context Delta and Technical Context Delta evaluation before implementation.
|
|
332
|
+
- The prompt must use parent-level Context Delta plus slice-level new durable fact checks.
|
|
333
|
+
- The prompt must state that Evidence Ledger / proof index is optional, but complete rows and ACs require evidence traceability to fresh evidence directly or through optional `evidence_id`.
|
|
334
|
+
- The prompt must require the fixed final gate order and rerun `validate-plan-acceptance` if auditor-driven fixes change artifacts.
|
|
252
335
|
- The prompt must preserve hard-blocker semantics: if only locally unsatisfiable hard blockers remain, pause for the user or external owner instead of marking complete.
|
|
253
336
|
- The prompt must require maximum safe autonomous progress within current platform, repository, tool and user-authorized permission boundaries and must include the minimum user action list for locally unsatisfiable hard blockers.
|
|
254
337
|
- The prompt must inherit current repository/global `AGENTS.md` or agent-instruction permission policy. Authorized `sudo` / `gsudo` / administrator elevation is not a user blocker; the executor must try it before pausing. Pause only if elevation is unavailable, fails, or requires user/system authorization.
|
|
@@ -273,55 +356,55 @@ Superpowers 输入包:
|
|
|
273
356
|
- Acceptance Checklist:最高验收标准;每个 AC 都要进 final verdict
|
|
274
357
|
- local audit:只记 progress/candidate status/evidence/blocker/invalidating evidence,不能裁判完成
|
|
275
358
|
- Context/tests/core paths:执行前读取,把 plan/AC gap 绑定到测试、API/UI/runtime/browser 证据
|
|
359
|
+
权威:source 管 scope,plan 管施工,checklist 管验收;audit/matrix/verdict/validator/auditor 不能改写它们。Proof index/evidence ledger 文件可选,但 complete 行必须能直接或经 evidence_id 追溯 fresh evidence。
|
|
276
360
|
|
|
277
361
|
执行顺序:
|
|
278
362
|
1. 读三份输入和 Context。先写 Task Contract:Product Context Delta none|required;Technical Context Delta none|required;任一 required -> Context Delta required。这不是 validator gate。
|
|
279
|
-
2. Context Delta required
|
|
363
|
+
2. 用 Parent Context Delta 统一判断;每个 slice 继承它,只记录 new durable fact yes/no。Context Delta required 时先最小更新 owning project_context/** 或 DESIGN.md;不要把 audit/matrix/verdict/日志/截图/sample evidence 写进 Context。
|
|
280
364
|
3. 检查技术实现方案覆盖产品/架构源关键要求;若只有产品方案没有技术实现方案,停止报告 missing Technical Realization Plan,不现场生成。
|
|
281
365
|
4. 初始化 plan-conformance matrix;计划不够 bite-sized 时用 superpowers:writing-plans。
|
|
282
366
|
5. 有 subagent 支持时优先 superpowers:subagent-driven-development,否则 superpowers:executing-plans。
|
|
283
367
|
6. Plan/AC behavior gap -> superpowers:test-driven-development:先写 failing test 并 observe failure,再最小实现。
|
|
284
368
|
7. 每个实现 slice 后更新 matrix 和 audit。
|
|
285
369
|
8. Candidate done 前跑 Plan Conformance Gate:测试通过不等于按图纸完成;sampled path 不等于 full implementation;每个行为 plan item 必须有 code/API/UI/runtime/test/evidence trace。
|
|
286
|
-
9. 再跑 Acceptance Evidence Gate:按验收清单生成 final verdict
|
|
287
|
-
10.
|
|
370
|
+
9. 再跑 Acceptance Evidence Gate:按验收清单生成 final verdict;每 AC 写 required proof chain/fresh evidence/missing layers/drift/substitution。current contradiction 高于历史通过记录。
|
|
371
|
+
10. Final gate 固定为 self-evidence -> matrix -> verdict -> validator -> read-only auditor;auditor summary 不是 proof。若审计后改 artifact/evidence,重跑 validator;完成前用 superpowers:verification-before-completion 检查 matrix/verdict,并运行 ty-context validate-plan-acceptance tmp/ty-context/plan-acceptance/<plan-slug>。
|
|
288
372
|
|
|
289
373
|
权限/卡点:在当前平台/仓库/工具/用户已授权权限内最大自主推进;已授权 sudo/gsudo/admin elevation 先尝试,不算用户阻塞。只有本地无法解决的账号/凭证/真实环境/人工审批/敏感字段等才暂停,并给最小用户执行清单(具体页面/系统、字段位置、脱敏/勿发值、拿到后下一步)。
|
|
290
|
-
禁止完成于:local audit、subagent summary、final card
|
|
374
|
+
禁止完成于:local audit、subagent summary、final card、只改代码/计划、只跑部分测试、旧/部分/抽样证据、缺 required layer、material drift、未批准 sibling substitution、runtime 未演练、artifact 未 accepted、API/UI 未 reflected、未批准 scope narrowing、任何 API/UI/data/runtime/test 矛盾。
|
|
291
375
|
```
|
|
292
376
|
|
|
293
377
|
Recommended compact English prompt shape:
|
|
294
378
|
|
|
295
379
|
```text
|
|
296
|
-
Product / Architecture Source: tmp/ty-context/plan-acceptance/<plan-slug>-product-architecture-source.md (
|
|
297
|
-
Technical Realization Plan: tmp/ty-context/plan-acceptance/<plan-slug>-technical-realization-plan.md (blueprint
|
|
298
|
-
Acceptance Checklist: tmp/ty-context/plan-acceptance/<plan-slug>-acceptance-checklist.md (acceptance authority
|
|
299
|
-
Local audit: tmp/ty-context/plan-acceptance/<plan-slug>-local-audit.md (process log, not proof
|
|
300
|
-
Plan matrix: tmp/ty-context/plan-acceptance/<plan-slug>-plan-conformance-matrix.md/json (
|
|
301
|
-
Final verdict: tmp/ty-context/plan-acceptance/<plan-slug>-final-acceptance-verdict.md/json (
|
|
380
|
+
Product / Architecture Source: tmp/ty-context/plan-acceptance/<plan-slug>-product-architecture-source.md (scope guard)
|
|
381
|
+
Technical Realization Plan: tmp/ty-context/plan-acceptance/<plan-slug>-technical-realization-plan.md (blueprint)
|
|
382
|
+
Acceptance Checklist: tmp/ty-context/plan-acceptance/<plan-slug>-acceptance-checklist.md (acceptance authority)
|
|
383
|
+
Local audit: tmp/ty-context/plan-acceptance/<plan-slug>-local-audit.md (process log, not proof)
|
|
384
|
+
Plan matrix: tmp/ty-context/plan-acceptance/<plan-slug>-plan-conformance-matrix.md/json (update during work)
|
|
385
|
+
Final verdict: tmp/ty-context/plan-acceptance/<plan-slug>-final-acceptance-verdict.md/json (final AC gate)
|
|
302
386
|
You may use multiple agents; if agent slots run low, close idle or unnecessary agents.
|
|
303
387
|
This is not a Superpowers official schema / 不是 Superpowers 官方 schema.
|
|
304
388
|
Superpowers input packet:
|
|
305
|
-
-
|
|
306
|
-
-
|
|
307
|
-
-
|
|
308
|
-
|
|
309
|
-
- Context/tests/core paths: read before execution; map plan/AC gaps to test/API/UI/runtime/browser evidence.
|
|
389
|
+
- Source guards scope; plan controls matrix; checklist controls verdict.
|
|
390
|
+
- Local audit is only progress/candidate status/evidence/blockers/invalidating evidence.
|
|
391
|
+
- Read Context/tests/core paths first; map gaps to test/API/UI/runtime/browser evidence.
|
|
392
|
+
Authority: source owns scope, plan owns construction, checklist owns acceptance; audit/matrix/verdict/validator/auditor cannot rewrite them. Proof index file optional; complete rows need fresh evidence or evidence_id.
|
|
310
393
|
|
|
311
394
|
Execution order:
|
|
312
|
-
1. Read
|
|
313
|
-
2.
|
|
314
|
-
3. Check
|
|
395
|
+
1. Read inputs and Context. Write Task Contract: Product Context Delta none|required; Technical Context Delta none|required; any required -> Context Delta required. Not a validator gate.
|
|
396
|
+
2. Use Parent Context Delta once; slices inherit it and record only new durable fact yes/no. If required, update owning project_context/** or DESIGN.md; never store audit/matrix/verdict/logs/screenshots/sample evidence as Context.
|
|
397
|
+
3. Check Technical Realization Plan covers Product / Architecture Source; if only product plan exists, stop with missing Technical Realization Plan, do not generate it.
|
|
315
398
|
4. Initialize plan-conformance matrix; use superpowers:writing-plans if the plan is not bite-sized.
|
|
316
399
|
5. Prefer superpowers:subagent-driven-development with subagents; otherwise use superpowers:executing-plans.
|
|
317
400
|
6. Plan/AC behavior gap -> superpowers:test-driven-development: write a failing test, observe failure, then implement minimally.
|
|
318
401
|
7. After each slice, update matrix and audit.
|
|
319
|
-
8.
|
|
320
|
-
9.
|
|
321
|
-
10. Before completion
|
|
402
|
+
8. Plan Conformance Gate: tests do not prove conformance; sampled path is not full implementation; each behavior item needs code/API/UI/runtime/test/evidence trace.
|
|
403
|
+
9. Acceptance Evidence Gate: verdict from checklist; each AC records proof chain, fresh evidence, missing layers, drift, substitution. Current contradictions override old passes.
|
|
404
|
+
10. Final gate: self-evidence -> matrix -> verdict -> validator -> read-only auditor. Auditor summary is not proof. If audit changes artifact/evidence, rerun validator. Before completion run superpowers:verification-before-completion on matrix/verdict and ty-context validate-plan-acceptance tmp/ty-context/plan-acceptance/<plan-slug>.
|
|
322
405
|
|
|
323
406
|
Autonomy/blockers: within current platform/repo/tool/user-authorized permissions, do all safe self-service discovery/execution/verification. Authorized sudo/gsudo/admin elevation is not a user blocker; try it first. Pause only for locally unsatisfiable account/credential/real-env/human-approval/sensitive-field needs; give exact page/system, field location, redaction/do-not-send values and next agent step.
|
|
324
|
-
Never complete on: local audit, subagent summary, final card, code
|
|
407
|
+
Never complete on: local audit, subagent summary, final card, code/plan-only work, partial tests, stale/partial/sampled evidence, missing required layer, material drift, unapproved sibling substitution, unexercised runtime, artifact not accepted, API/UI not reflected, missing validate-plan-acceptance pass, unapproved scope narrowing or any API/UI/data/runtime/test contradiction.
|
|
325
408
|
```
|
|
326
409
|
|
|
327
410
|
Before final response, check the prompt length. If it exceeds 3850 characters, tighten wording while preserving paths, input roles, official Superpowers skill names, Product Context Delta, Technical Context Delta, plan-conformance matrix, final verdict, state machine, UI gate, blockers and invalid evidence.
|
|
@@ -341,8 +424,13 @@ When successful, return:
|
|
|
341
424
|
|
|
342
425
|
When blocked, return:
|
|
343
426
|
|
|
344
|
-
- Missing
|
|
345
|
-
-
|
|
427
|
+
- Missing Fields Report.
|
|
428
|
+
- `missing_section`.
|
|
429
|
+
- `missing_required_fields`.
|
|
430
|
+
- `why_blocking`.
|
|
431
|
+
- `cannot_infer_policy`.
|
|
432
|
+
- `required_next_input`.
|
|
433
|
+
- `suggested_upstream_action`.
|
|
346
434
|
- A clear statement that no Superpowers target-mode prompt was generated.
|
|
347
435
|
|
|
348
436
|
Do not claim any plan item or AC has passed unless the user explicitly asked for current completion audit and current evidence was inspected.
|
package/dist/commands/index.js
CHANGED
|
@@ -18,6 +18,8 @@ export const commands = {
|
|
|
18
18
|
"validate-context": (args) => validate(["validate-context", ...args]),
|
|
19
19
|
"validate-code-modularity": (args) => validate(["validate-code-modularity", ...args]),
|
|
20
20
|
"validate-harness": (args) => validate(["validate-harness", ...args]),
|
|
21
|
+
"validate-plan-contract": (args) => validate(["validate-plan-contract", ...args]),
|
|
22
|
+
"validate-plan-acceptance": (args) => validate(["validate-plan-acceptance", ...args]),
|
|
21
23
|
package: packageSource
|
|
22
24
|
};
|
|
23
25
|
export function help() {
|
|
@@ -34,8 +36,12 @@ export function help() {
|
|
|
34
36
|
Export temporary Context, code snapshot or bounded Source Pack artifacts
|
|
35
37
|
validate <gate> Run a Harness validation gate
|
|
36
38
|
validate-context Validate Minimal Context fact-source recoverability
|
|
37
|
-
validate-code-modularity
|
|
38
|
-
Enforce touched handwritten source file modularity
|
|
39
|
-
validate-harness Run validate-context and validate-code-modularity
|
|
39
|
+
validate-code-modularity
|
|
40
|
+
Enforce touched handwritten source file modularity
|
|
41
|
+
validate-harness Run validate-context and validate-code-modularity
|
|
42
|
+
validate-plan-contract <plan.md|dir>
|
|
43
|
+
Validate workflow-contract plan surface consistency
|
|
44
|
+
validate-plan-acceptance <dir>
|
|
45
|
+
Validate plan-conformance matrix and final verdict consistency
|
|
40
46
|
package <subcommand> Maintain package canonical source`);
|
|
41
47
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { runValidator } from "../lib/validators.js";
|
|
2
2
|
export async function validate(args) {
|
|
3
3
|
const gate = args[0] ?? "validate-harness";
|
|
4
|
-
const report = await runValidator(process.cwd(), gate);
|
|
4
|
+
const report = await runValidator(process.cwd(), gate, args.slice(1));
|
|
5
5
|
for (const line of report.info) {
|
|
6
6
|
console.log(line);
|
|
7
7
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function assertExternalReviewerFields(label: string, row: Record<string, unknown>, evidenceText: string, errors: string[]): void;
|