harnessed 1.0.0
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/LICENSE +201 -0
- package/NOTICE +20 -0
- package/README.md +178 -0
- package/config-templates/README.md +21 -0
- package/config-templates/hooks/.gitkeep +0 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.mjs +4653 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.mjs +10 -0
- package/dist/index.mjs.map +1 -0
- package/dist/schemas/index.d.ts +47 -0
- package/dist/schemas/index.mjs +384 -0
- package/dist/schemas/index.mjs.map +1 -0
- package/manifests/README.md +23 -0
- package/manifests/SCHEMA.md +180 -0
- package/manifests/aliases.yaml +14 -0
- package/manifests/cc-hooks/dashboard-autospawn.yaml +45 -0
- package/manifests/skill-packs/.gitkeep +0 -0
- package/manifests/skill-packs/anthropics-skills-pptx.yaml +46 -0
- package/manifests/skill-packs/anthropics-skills-slide-deck.yaml +46 -0
- package/manifests/skill-packs/frontend-design.yaml +63 -0
- package/manifests/skill-packs/gsd.yaml +43 -0
- package/manifests/skill-packs/gstack.yaml +40 -0
- package/manifests/skill-packs/karpathy-skills.yaml +64 -0
- package/manifests/skill-packs/mattpocock-skills.yaml +40 -0
- package/manifests/skill-packs/planning-with-files.yaml +45 -0
- package/manifests/skill-packs/ui-ux-pro-max.yaml +61 -0
- package/manifests/tools/.gitkeep +0 -0
- package/manifests/tools/chrome-devtools-mcp.yaml +44 -0
- package/manifests/tools/ctx7.yaml +39 -0
- package/manifests/tools/exa-mcp.yaml +39 -0
- package/manifests/tools/playwright-test.yaml +47 -0
- package/manifests/tools/ralph-loop.yaml +46 -0
- package/manifests/tools/superpowers.yaml +42 -0
- package/manifests/tools/tavily-mcp.yaml +39 -0
- package/package.json +96 -0
- package/routing/.gitkeep +0 -0
- package/routing/README.md +22 -0
- package/routing/SCHEMA.md +199 -0
- package/routing/decision_rules.yaml +387 -0
- package/routing/plan-review-schema.yaml +50 -0
- package/schemas/.gitkeep +0 -0
- package/schemas/README.md +33 -0
- package/schemas/manifest.v1.schema.json +1107 -0
- package/workflows/.gitkeep +0 -0
- package/workflows/README.md +23 -0
- package/workflows/SCHEMA.md +157 -0
- package/workflows/execute-task/SKILL.md +70 -0
- package/workflows/execute-task/phases.yaml +27 -0
- package/workflows/plan-feature/workflow.yaml +40 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# routing/ — B+C Routing Frontmatter SSOT (v0.1 placeholder spec)
|
|
2
|
+
|
|
3
|
+
> **决策来源**:[`PROJECT-SPEC.md` § 9](../PROJECT-SPEC.md)
|
|
4
|
+
> **机器消费 artifact**:**未实现**(v0.1 phase 1.1 仅文档化字段;JSON Schema artifact + 真实 routing/*.md 由 v0.1 phase 1.4 落地)
|
|
5
|
+
> **本文件定位**:B+C 混合路由方案的 yaml frontmatter 标准定义。B 层(skill description)与 C 层(hook script)共享**同一份 frontmatter** —— 改一处两层同步生效。
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. SSOT 模式(为什么 B 层 + C 层共享同一 frontmatter)
|
|
10
|
+
|
|
11
|
+
`routing/<topic>.md` 是一份普通 markdown,但 frontmatter 同时被两层消费:
|
|
12
|
+
|
|
13
|
+
| 层 | 读 frontmatter 哪块 | 干什么 |
|
|
14
|
+
|---|---|---|
|
|
15
|
+
| **B 层(skill description)** | `soft_hint.description_template` | 生成 skill 的 1 行描述,让 LLM 在 skill 路由时能读到"标准化、数据驱动的 UI 设计;优先于 frontend-design"这种 hint |
|
|
16
|
+
| **C 层(hook script)** | `trigger.keywords` + `trigger.file_globs` + `hard_route.*` | hook 在用户输入触发关键词或匹配文件 glob 时强制路由到 `hard_route.primary` skill;override 条件支持差异化 |
|
|
17
|
+
|
|
18
|
+
**好处**:
|
|
19
|
+
1. 改一处两层同步生效(避免双轨维护腐烂)
|
|
20
|
+
2. CI 校验 routing schema 合法性(v0.1 phase 1.4 起)
|
|
21
|
+
3. 用户读 markdown 部分学习路由逻辑;引擎读 frontmatter 自动决策
|
|
22
|
+
4. 跨 harness 时砍 `hard_route` 块即可,`soft_hint` 跨平台通用
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## 2. 顶层结构
|
|
27
|
+
|
|
28
|
+
```yaml
|
|
29
|
+
---
|
|
30
|
+
trigger: # 触发条件
|
|
31
|
+
keywords: [...]
|
|
32
|
+
file_globs: [...]?
|
|
33
|
+
contexts: [...]?
|
|
34
|
+
|
|
35
|
+
hard_route: # C 层 hook 读这块
|
|
36
|
+
primary: <skill-name>
|
|
37
|
+
secondary: <skill-name>?
|
|
38
|
+
default: <skill-name>?
|
|
39
|
+
override: # 条件覆盖
|
|
40
|
+
condition: "<自然语言描述触发条件>"
|
|
41
|
+
primary: <skill-name>
|
|
42
|
+
secondary: <skill-name>?
|
|
43
|
+
branches: # 多分支(mutex 决策)
|
|
44
|
+
- condition: ...
|
|
45
|
+
route: <skill-name>
|
|
46
|
+
members: [...]?
|
|
47
|
+
|
|
48
|
+
soft_hint: # B 层 skill description 自动生成
|
|
49
|
+
description_template: "<1-line hint, ≤ 500 char>"
|
|
50
|
+
|
|
51
|
+
fallback:
|
|
52
|
+
on_hook_fail: <degrade_to_soft_hint|prompt_user>
|
|
53
|
+
on_both_fail: <prompt_user|halt>
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
# 人类可读的路由说明(markdown 部分)
|
|
57
|
+
(详细规则、边界场景、历史决策……)
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
`additionalProperties: false`(v0.1 phase 1.4 落地)— 未声明字段被 reject。
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## 3. trigger 字段表
|
|
65
|
+
|
|
66
|
+
| 字段 | 必填 | 类型 | 说明 |
|
|
67
|
+
|------|------|------|------|
|
|
68
|
+
| `keywords` | ✅ | string[] | 至少 1 个;C 层 hook 在用户输入子串匹配时触发;中英文混合(`[ui, ux, frontend, layout, design, 前端, 界面, 设计稿]`) |
|
|
69
|
+
| `file_globs` | optional | string[] | 仅当用户当前打开 / 修改这些 glob 文件时触发(`["**/*.tsx", "**/*.css"]`) |
|
|
70
|
+
| `contexts` | optional | string[] | 上下文标签(`design-review` / `pr-review` / `bug-fix` 等),由 workflow phase 写入 `.harnessed/context.json` |
|
|
71
|
+
|
|
72
|
+
至少要有 `keywords`;其他字段任选。所有 `keywords` / `file_globs` / `contexts` **OR** 关系(任一命中即触发)。
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## 4. hard_route 字段表(C 层 hook 决策)
|
|
77
|
+
|
|
78
|
+
| 字段 | 必填 | 类型 | 说明 |
|
|
79
|
+
|---|---|---|---|
|
|
80
|
+
| `primary` | optional | string | 默认主路由 skill name |
|
|
81
|
+
| `secondary` | optional | string | 默认次路由(cooperative)skill name |
|
|
82
|
+
| `default` | optional | string | 无 override / branches 命中时的兜底(兼容性) |
|
|
83
|
+
| `override` | optional | object | 单一覆盖规则(见下) |
|
|
84
|
+
| `override.condition` | required if override | string | 自然语言条件(如 `"用户明确说'做出风格'/'独特设计'"`),hook 用 LLM 子调用判定 |
|
|
85
|
+
| `override.primary` | required if override | string | 覆盖后的主路由 |
|
|
86
|
+
| `override.secondary` | optional | string | 覆盖后的次路由 |
|
|
87
|
+
| `branches` | optional | object[] | 多分支决策(互斥,按顺序首个命中生效) |
|
|
88
|
+
| `branches[].condition` | required if branches | string | 分支条件 |
|
|
89
|
+
| `branches[].route` | required if branches | string | 该分支的 skill name |
|
|
90
|
+
| `branches[].members` | optional | string[] | 群体路由成员(如 code-review-team) |
|
|
91
|
+
|
|
92
|
+
**至少**要有 `primary` 或 `default` 或 `branches[0].route` 之一(保证至少有一个 fallback path)。
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## 5. soft_hint 字段表(B 层 skill description 模板)
|
|
97
|
+
|
|
98
|
+
| 字段 | 必填 | 类型 | 说明 |
|
|
99
|
+
|---|---|---|---|
|
|
100
|
+
| `description_template` | ✅ | string | 1 行 hint,≤ 500 char;写入 skill 的 description metadata,让 LLM 在 skill 路由时读到 |
|
|
101
|
+
|
|
102
|
+
**好的 description 示例**:
|
|
103
|
+
- `"标准化、数据驱动的 UI 设计;优先于 frontend-design 用于布局/规范类任务"`
|
|
104
|
+
- `"通用 web 搜索(关键词、库文档、新闻);性能、过滤器最丰富;默认选 Tavily"`
|
|
105
|
+
|
|
106
|
+
**不好的示例**:
|
|
107
|
+
- `"useful for UI"`(太泛)
|
|
108
|
+
- `"description here"`(占位)
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## 6. fallback 字段表
|
|
113
|
+
|
|
114
|
+
| 字段 | 必填 | 类型 | 说明 |
|
|
115
|
+
|---|---|---|---|
|
|
116
|
+
| `on_hook_fail` | ✅ | enum | hook 异常 / 超时时行为:`degrade_to_soft_hint`(降级到 B 层)/ `prompt_user`(直接问用户) |
|
|
117
|
+
| `on_both_fail` | ✅ | enum | B+C 双双失败时行为:`prompt_user` / `halt`(中止当前任务) |
|
|
118
|
+
|
|
119
|
+
`degrade_to_soft_hint` 是默认推荐 — hook 失败时不卡用户;`halt` 仅用于安全敏感场景。
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## 7. 完整示例(PROJECT-SPEC § 9 摘录)
|
|
124
|
+
|
|
125
|
+
```yaml
|
|
126
|
+
# routing/ui.md
|
|
127
|
+
---
|
|
128
|
+
trigger:
|
|
129
|
+
keywords: [ui, ux, frontend, layout, design, 前端, 界面, 设计稿]
|
|
130
|
+
file_globs: ["**/*.tsx", "**/*.vue", "**/*.css", "**/*.scss"]
|
|
131
|
+
|
|
132
|
+
hard_route: # C 层 hook 读这块
|
|
133
|
+
primary: ui-ux-pro-max
|
|
134
|
+
secondary: frontend-design
|
|
135
|
+
override:
|
|
136
|
+
condition: "用户明确说'做出风格'/'要风格'/'独特设计'"
|
|
137
|
+
primary: frontend-design
|
|
138
|
+
secondary: ui-ux-pro-max
|
|
139
|
+
|
|
140
|
+
soft_hint: # B 层 skill description 自动生成
|
|
141
|
+
description_template: "标准化、数据驱动的 UI 设计;优先于 frontend-design 用于布局/规范类任务"
|
|
142
|
+
|
|
143
|
+
fallback:
|
|
144
|
+
on_hook_fail: degrade_to_soft_hint # hook 失败时降级回 B 层
|
|
145
|
+
on_both_fail: prompt_user # 都失败时直接问用户
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
# 路由说明
|
|
149
|
+
ui-ux-pro-max 主导(数据驱动、可解释),frontend-design 在剩余维度补充。冲突时 ui-ux-pro-max 优先。
|
|
150
|
+
**除非用户明确要求"做出风格"** —— 此时 frontend-design 主导。
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## 8. v0.1 落地预告:routing/search.md(web 搜索路由)
|
|
156
|
+
|
|
157
|
+
依据用户全局 `CLAUDE.md` § "Web 搜索路由规则",phase 1.4 将落地(示意,按 routing schema CI 校验):
|
|
158
|
+
|
|
159
|
+
```yaml
|
|
160
|
+
# routing/search.md
|
|
161
|
+
---
|
|
162
|
+
trigger:
|
|
163
|
+
keywords: [search, 搜索, 查文档, find, "网络上"]
|
|
164
|
+
contexts: [research]
|
|
165
|
+
|
|
166
|
+
hard_route:
|
|
167
|
+
primary: tavily-mcp # 默认 Tavily(关键词查询、库文档、新闻)
|
|
168
|
+
branches:
|
|
169
|
+
- condition: "描述式查询 / 学术论文 / 批量抓取多个 URL / 用户明说'研究'"
|
|
170
|
+
route: exa-mcp # 神经搜索
|
|
171
|
+
- condition: "抓整站 / 站点结构(crawl/map)"
|
|
172
|
+
route: tavily-mcp
|
|
173
|
+
override:
|
|
174
|
+
condition: "用户拿不准时"
|
|
175
|
+
primary: tavily-mcp
|
|
176
|
+
secondary: exa-mcp # 并行打两边对比
|
|
177
|
+
|
|
178
|
+
soft_hint:
|
|
179
|
+
description_template: "通用 web 搜索;关键词查询 / 站点抓取走 Tavily,描述式 / 学术 / 批量 URL 走 Exa"
|
|
180
|
+
|
|
181
|
+
fallback:
|
|
182
|
+
on_hook_fail: degrade_to_soft_hint
|
|
183
|
+
on_both_fail: prompt_user
|
|
184
|
+
---
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## 9. 当前 status & 关联(v0.1 phase 1.1)
|
|
190
|
+
|
|
191
|
+
- ✅ 字段定义已锁定(本文件 + SPEC § 9)
|
|
192
|
+
- ❌ JSON Schema artifact / routing/*.md / validator 由 v0.1 phase 1.4 落地(TypeBox + Ajv 同 `src/manifest/schema/` 模式);v0.3 验证 B+C 命中率 ≥ 85%
|
|
193
|
+
|
|
194
|
+
**关联**:
|
|
195
|
+
- 决策:`PROJECT-SPEC.md` § 9(B+C 混合方案 R4.1)
|
|
196
|
+
- B+C 角色映射:用户全局 `CLAUDE.md` § "Web 搜索路由规则" + § "UI/UX / 前端相关子任务"
|
|
197
|
+
- workflow 触发引用:`workflows/SCHEMA.md` § plan-feature reference(`02-brainstorm.conditional.if` 即来自 `routing/ui.md`)
|
|
198
|
+
- manifest 上游引用目标:`manifests/SCHEMA.md`(路由结果是 manifest name)
|
|
199
|
+
- ROADMAP 落地节奏:v0.1 phase 1.4 → routing schema + ≥ 1 份真实 routing/*.md
|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
# yaml-language-server: $schema=../schemas/decision-rules.v1.schema.json
|
|
2
|
+
#
|
|
3
|
+
# decision_rules.yaml v2 — phase 1.5 T4.1 升级 (v1 frozen at phase 1.3 ship)
|
|
4
|
+
#
|
|
5
|
+
# IMPL NOTE (KICKOFF B1 + ASSUMPTIONS § C P0-1 + GRAY-AREA-1 § 2 真理 source):
|
|
6
|
+
# - 全局 rule-set (DMN Priority Hit Policy 风格) — phase 1.4+ routing engine 优先 load 本文件
|
|
7
|
+
# - 与 manifest.spec.decision_rules (per-manifest hint, ADR 0007 errata T2.1 加) schema 完全独立
|
|
8
|
+
# - W-6 v2 演化路径: 任何 v1 字段改动必走 ADR 0009 errata + scripts/migrate-decision-rules-v1-to-v2.mjs
|
|
9
|
+
# - B1 security: 本文件 string fields 不允许 shell metacharacters ($(...) / ${...} / backtick) —
|
|
10
|
+
# loadDecisionRules() 内 checkCmdString 二次过滤 (沿袭 phase 1.1.1 H7 mitigation pattern)
|
|
11
|
+
#
|
|
12
|
+
# IMPL NOTE — v1 → v2 升级 (phase 1.5 T4.1, ADR 0009 § Decision):
|
|
13
|
+
# - version bump 1 → 2; v1 的 12 rules 全部保留 byte-identical (additive-only — D1.5-10)
|
|
14
|
+
# - 新增 engineering category 5 specific rules (engineering-discuss-feature /
|
|
15
|
+
# -plan-architecture / -execute-tdd / -execute-debug / -verify-pr) — D1.5-3
|
|
16
|
+
# - 新增 mattpocock_phases: 段 — 4 phase (discuss/plan/execute/verify) × 21 unique
|
|
17
|
+
# skills × 23 trigger entries; 真理 source = 用户笔记 ~/.claude/CLAUDE.md 行 8 /
|
|
18
|
+
# 38-39 / 148 (1:1 提取, 不创新 — D1.5-3)
|
|
19
|
+
# - engineering sub-rules 用 skills_overlay: { ref: mattpocock_phases.<phase>.skills }
|
|
20
|
+
# cross-link 而非内联 duplicate (D1.5-3 — 避免 skill list 漂移)
|
|
21
|
+
# - W-6 migration: scripts/migrate-decision-rules-v1-to-v2.mjs idempotent 升级 path
|
|
22
|
+
|
|
23
|
+
version: 2
|
|
24
|
+
hit_policy: P # Priority — 多规则命中时按 priority 字段排序取最高
|
|
25
|
+
|
|
26
|
+
# === L1 路由:关键词 + 优先级 ===
|
|
27
|
+
rules:
|
|
28
|
+
# ─── design (2 rules) ────────────────────────────────────────
|
|
29
|
+
- id: ui-task-bold-style-override
|
|
30
|
+
priority: 100
|
|
31
|
+
domain: design
|
|
32
|
+
when:
|
|
33
|
+
task_type: ui-design
|
|
34
|
+
# Phase 2.3 W2 T2.1 — 9 keywords 词集校准 (RESEARCH § 3.3 D2.3-4):
|
|
35
|
+
# ADD: signature style / art direction / bold style (high-signal anchors)
|
|
36
|
+
# KEEP: 做出风格 / 独创 / 风格化 / 品牌调性 / design-led / distinctive / creative / experimental
|
|
37
|
+
# REMOVED: 独特 (false-pos "独特的搜索方案" 太高 — RESEARCH § 3.3)
|
|
38
|
+
override_keywords:
|
|
39
|
+
- 做出风格
|
|
40
|
+
- 独创
|
|
41
|
+
- 风格化
|
|
42
|
+
- 品牌调性
|
|
43
|
+
- design-led
|
|
44
|
+
- distinctive
|
|
45
|
+
- signature style
|
|
46
|
+
- art direction
|
|
47
|
+
- bold style
|
|
48
|
+
- creative
|
|
49
|
+
- experimental
|
|
50
|
+
decision:
|
|
51
|
+
primary_expert: frontend-design
|
|
52
|
+
secondary_expert: ui-ux-pro-max
|
|
53
|
+
conflict_policy: primary_wins
|
|
54
|
+
rationale: 用户明示 style-driven, 由 frontend-design 主导剩余维度
|
|
55
|
+
|
|
56
|
+
- id: ui-task-default
|
|
57
|
+
priority: 50
|
|
58
|
+
domain: design
|
|
59
|
+
when:
|
|
60
|
+
task_type: ui-design
|
|
61
|
+
decision:
|
|
62
|
+
primary_expert: ui-ux-pro-max
|
|
63
|
+
secondary_expert: frontend-design
|
|
64
|
+
conflict_policy: primary_wins
|
|
65
|
+
rationale: 数据驱动 + 标准化 + 可解释 优先 (CLAUDE.md UI 路由默认)
|
|
66
|
+
# Phase 2.3 W2 T2.1 — D-04 CD-3 negative-space + redirect (NEW optional fields).
|
|
67
|
+
# 若 task 含 style-led 信号则 reject 本规则,redirect 到 frontend-design (D-08 双向 redirect 一致性).
|
|
68
|
+
do_not_use_when:
|
|
69
|
+
- 做出风格
|
|
70
|
+
- 独创
|
|
71
|
+
- 风格化
|
|
72
|
+
- design-led
|
|
73
|
+
if_rejected_use: frontend-design
|
|
74
|
+
|
|
75
|
+
# ─── content (2 rules) ───────────────────────────────────────
|
|
76
|
+
- id: pptx-file-task
|
|
77
|
+
priority: 80
|
|
78
|
+
domain: content
|
|
79
|
+
when:
|
|
80
|
+
task_type: pptx-file-operation
|
|
81
|
+
decision:
|
|
82
|
+
primary_expert: anthropics-skills-pptx
|
|
83
|
+
rationale: PowerPoint 文件操作 — anthropics 官方 skill
|
|
84
|
+
|
|
85
|
+
- id: chinese-content-deck
|
|
86
|
+
priority: 70
|
|
87
|
+
domain: content
|
|
88
|
+
when:
|
|
89
|
+
task_type: slide-deck
|
|
90
|
+
language: zh
|
|
91
|
+
decision:
|
|
92
|
+
primary_expert: jimliu-baoyu-skills-baoyu-slide-deck
|
|
93
|
+
rationale: 中文 deck 场景, baoyu-skills license resolved 为 MIT-0 (D-05 / ADR 0010)
|
|
94
|
+
# Phase 2.3 W2 T2.1 — CD-3 negative-space: 通用 markdown 文档不走 deck-pack.
|
|
95
|
+
# (no if_rejected_use — content 段 default fallback 到 supervisor 而非定向 redirect)
|
|
96
|
+
do_not_use_when:
|
|
97
|
+
- 通用 markdown 文档
|
|
98
|
+
- generic markdown
|
|
99
|
+
- plain doc
|
|
100
|
+
|
|
101
|
+
# ─── testing (4 rules) ───────────────────────────────────────
|
|
102
|
+
- id: perf-a11y-memory
|
|
103
|
+
priority: 100
|
|
104
|
+
domain: testing
|
|
105
|
+
when:
|
|
106
|
+
task_type:
|
|
107
|
+
- performance
|
|
108
|
+
- a11y
|
|
109
|
+
- memory-leak
|
|
110
|
+
- Core Web Vitals
|
|
111
|
+
- LCP
|
|
112
|
+
decision:
|
|
113
|
+
primary_expert: chrome-devtools-mcp
|
|
114
|
+
forbidden_experts:
|
|
115
|
+
- playwright-cli
|
|
116
|
+
- playwright-test
|
|
117
|
+
- webapp-testing
|
|
118
|
+
rationale: 笔记硬规则 — perf/a11y/memory 不允许 playwright 系列做诊断
|
|
119
|
+
|
|
120
|
+
- id: e2e-with-python-backend
|
|
121
|
+
priority: 70
|
|
122
|
+
domain: testing
|
|
123
|
+
when:
|
|
124
|
+
task_type: e2e-test
|
|
125
|
+
backend_language: python
|
|
126
|
+
decision:
|
|
127
|
+
primary_expert: webapp-testing
|
|
128
|
+
rationale: setup 需调 Python 后端 (Tortoise ORM / pandas / backend utils)
|
|
129
|
+
# Phase 2.3 W2 T2.1 — CD-3 negative-space: 若 task 明示无 Python backend → redirect 到 playwright-test 默认。
|
|
130
|
+
do_not_use_when:
|
|
131
|
+
- pure-frontend
|
|
132
|
+
- no-Python-backend
|
|
133
|
+
- no python backend
|
|
134
|
+
if_rejected_use: playwright-test
|
|
135
|
+
|
|
136
|
+
- id: e2e-default
|
|
137
|
+
priority: 50
|
|
138
|
+
domain: testing
|
|
139
|
+
when:
|
|
140
|
+
task_type: e2e-test
|
|
141
|
+
decision:
|
|
142
|
+
primary_expert: playwright-test
|
|
143
|
+
rationale: 默认 E2E TS — frontend 是 TS/React/Vue, setup 仅浏览器 + HTTP API
|
|
144
|
+
|
|
145
|
+
- id: ai-explore-debug
|
|
146
|
+
priority: 50
|
|
147
|
+
domain: testing
|
|
148
|
+
when:
|
|
149
|
+
task_type:
|
|
150
|
+
- ai-explore
|
|
151
|
+
- interaction-debug
|
|
152
|
+
- element-ref
|
|
153
|
+
decision:
|
|
154
|
+
primary_expert: playwright-cli
|
|
155
|
+
rationale: Bash 一行命令 + token 最省 — 探查页面结构/调试一次性交互
|
|
156
|
+
|
|
157
|
+
# ─── search (2 rules) ────────────────────────────────────────
|
|
158
|
+
- id: search-academic-or-batch-or-token-sensitive
|
|
159
|
+
priority: 80
|
|
160
|
+
domain: search
|
|
161
|
+
when:
|
|
162
|
+
task_type: search
|
|
163
|
+
signals:
|
|
164
|
+
- 学术
|
|
165
|
+
- 论文
|
|
166
|
+
- describe
|
|
167
|
+
- 批量 URL
|
|
168
|
+
- token-sensitive
|
|
169
|
+
decision:
|
|
170
|
+
primary_expert: exa-mcp
|
|
171
|
+
rationale: 描述式查询/学术/批量抓取/token 敏感 — Exa highlights 密度高
|
|
172
|
+
|
|
173
|
+
- id: search-default
|
|
174
|
+
priority: 50
|
|
175
|
+
domain: search
|
|
176
|
+
when:
|
|
177
|
+
task_type: search
|
|
178
|
+
decision:
|
|
179
|
+
primary_expert: tavily-mcp
|
|
180
|
+
rationale: 默认 — 关键词查询/库 API 文档/新闻时效信息/生产 RAG
|
|
181
|
+
|
|
182
|
+
# ─── meta (2 rules) ──────────────────────────────────────────
|
|
183
|
+
- id: meta-create-skill
|
|
184
|
+
priority: 50
|
|
185
|
+
domain: meta
|
|
186
|
+
when:
|
|
187
|
+
task_type: skill-creation
|
|
188
|
+
decision:
|
|
189
|
+
primary_expert: anthropics-skills-skill-creator
|
|
190
|
+
rationale: meta 创建 skill — anthropics 官方 skill-creator
|
|
191
|
+
|
|
192
|
+
- id: meta-find-skill
|
|
193
|
+
priority: 50
|
|
194
|
+
domain: meta
|
|
195
|
+
when:
|
|
196
|
+
task_type: skill-discovery
|
|
197
|
+
decision:
|
|
198
|
+
primary_expert: vercel-labs-skills-find-skills
|
|
199
|
+
rationale: meta 搜索 skill — vercel-labs 生态发现入口
|
|
200
|
+
|
|
201
|
+
# ─── engineering (phase 1.5 T4.1 — 5 specific rules) ─────────
|
|
202
|
+
# NOTE: engineering category base layer 已装 (gstack/GSD/superpowers/karpathy/
|
|
203
|
+
# mattpocock/ralph-loop/planning-with-files), 不需 install routing;
|
|
204
|
+
# 下列 5 rules 按 discuss/plan/execute/verify 分阶段调度 mattpocock 23 招式
|
|
205
|
+
# (skills_overlay ref → mattpocock_phases 段, 见文件末). D1.5-3 真理 source:
|
|
206
|
+
# 用户笔记 ~/.claude/CLAUDE.md 工作流 4 阶段映射.
|
|
207
|
+
- id: engineering-discuss-feature
|
|
208
|
+
priority: 60
|
|
209
|
+
domain: engineering
|
|
210
|
+
when:
|
|
211
|
+
task_type: engineering
|
|
212
|
+
keywords:
|
|
213
|
+
- 新功能
|
|
214
|
+
- feature 启动
|
|
215
|
+
- discuss feature
|
|
216
|
+
decision:
|
|
217
|
+
workflow: gstack-decision-gate
|
|
218
|
+
skills_overlay:
|
|
219
|
+
ref: mattpocock_phases.discuss.skills
|
|
220
|
+
gstack_gates:
|
|
221
|
+
- office-hours
|
|
222
|
+
- plan-ceo-review
|
|
223
|
+
rationale: 新功能启动 — gstack 决策关卡先行 + discuss 阶段招式 overlay
|
|
224
|
+
|
|
225
|
+
- id: engineering-plan-architecture
|
|
226
|
+
priority: 60
|
|
227
|
+
domain: engineering
|
|
228
|
+
when:
|
|
229
|
+
task_type: engineering
|
|
230
|
+
keywords:
|
|
231
|
+
- 架构 plan
|
|
232
|
+
- architecture plan
|
|
233
|
+
- design
|
|
234
|
+
decision:
|
|
235
|
+
workflow: gsd-plan-phase
|
|
236
|
+
skills_overlay:
|
|
237
|
+
ref: mattpocock_phases.plan.skills
|
|
238
|
+
gstack_gates:
|
|
239
|
+
- plan-eng-review
|
|
240
|
+
rationale: 架构 plan — gsd plan-phase + 复杂架构 gstack eng review
|
|
241
|
+
|
|
242
|
+
- id: engineering-execute-tdd
|
|
243
|
+
priority: 60
|
|
244
|
+
domain: engineering
|
|
245
|
+
when:
|
|
246
|
+
task_type: engineering
|
|
247
|
+
keywords:
|
|
248
|
+
- TDD
|
|
249
|
+
- test first
|
|
250
|
+
- core logic
|
|
251
|
+
- algorithm
|
|
252
|
+
decision:
|
|
253
|
+
workflow: gsd-execute-task
|
|
254
|
+
skills_overlay:
|
|
255
|
+
ref: mattpocock_phases.execute.skills
|
|
256
|
+
triggers:
|
|
257
|
+
complexity_threshold: 5
|
|
258
|
+
category_match:
|
|
259
|
+
- core_business_logic
|
|
260
|
+
- algorithm
|
|
261
|
+
- high_reliability
|
|
262
|
+
tdd_required: true
|
|
263
|
+
rationale: 核心逻辑/算法 — gsd execute-task + TDD red-green-refactor 强制
|
|
264
|
+
|
|
265
|
+
- id: engineering-execute-debug
|
|
266
|
+
priority: 60
|
|
267
|
+
domain: engineering
|
|
268
|
+
when:
|
|
269
|
+
task_type: engineering
|
|
270
|
+
keywords:
|
|
271
|
+
- debug
|
|
272
|
+
- bug
|
|
273
|
+
- diagnose
|
|
274
|
+
- 排错
|
|
275
|
+
decision:
|
|
276
|
+
workflow: gsd-execute-task
|
|
277
|
+
skills_overlay:
|
|
278
|
+
ref: mattpocock_phases.execute.skills
|
|
279
|
+
primary_skills:
|
|
280
|
+
- diagnose
|
|
281
|
+
- zoom-out
|
|
282
|
+
rationale: 系统化排错 — gsd execute-task + diagnose/zoom-out 招式主导
|
|
283
|
+
|
|
284
|
+
- id: engineering-verify-pr
|
|
285
|
+
priority: 60
|
|
286
|
+
domain: engineering
|
|
287
|
+
when:
|
|
288
|
+
task_type: engineering
|
|
289
|
+
keywords:
|
|
290
|
+
- PR review
|
|
291
|
+
- code review
|
|
292
|
+
- ship
|
|
293
|
+
- release
|
|
294
|
+
decision:
|
|
295
|
+
workflow: gsd-verify-work
|
|
296
|
+
skills_overlay:
|
|
297
|
+
ref: mattpocock_phases.verify.skills
|
|
298
|
+
gstack_gates:
|
|
299
|
+
- review
|
|
300
|
+
- code-review
|
|
301
|
+
rationale: PR 审查/ship — gsd verify-work + gstack Paranoid Staff Engineer review
|
|
302
|
+
|
|
303
|
+
# === mattpocock_phases — 23 招式 phase routing schema (phase 1.5 T4.1 / D4) ===
|
|
304
|
+
# 4 phase × 21 unique skills × 23 trigger entries; 真理 source = 用户笔记
|
|
305
|
+
# ~/.claude/CLAUDE.md 行 8 (招式定位) + 38-39 (Discuss/Plan/Execute/Verify 工作流) +
|
|
306
|
+
# 148 (UI 路由). engineering category sub-rules skills_overlay.ref 指向本段.
|
|
307
|
+
mattpocock_phases:
|
|
308
|
+
discuss:
|
|
309
|
+
skills:
|
|
310
|
+
- grill-with-docs
|
|
311
|
+
- to-prd
|
|
312
|
+
- grill-me
|
|
313
|
+
- explore
|
|
314
|
+
triggers:
|
|
315
|
+
- /grill-with-docs
|
|
316
|
+
- /to-prd
|
|
317
|
+
- /grill-me
|
|
318
|
+
- /explore
|
|
319
|
+
- 澄清规格
|
|
320
|
+
- 沉淀 PRD
|
|
321
|
+
- 拷问我
|
|
322
|
+
- 探索方案
|
|
323
|
+
plan:
|
|
324
|
+
skills:
|
|
325
|
+
- to-issues
|
|
326
|
+
- grill-me
|
|
327
|
+
- design-review
|
|
328
|
+
triggers:
|
|
329
|
+
- /to-issues
|
|
330
|
+
- /grill-me
|
|
331
|
+
- /design-review
|
|
332
|
+
- 拆任务
|
|
333
|
+
- design review
|
|
334
|
+
execute:
|
|
335
|
+
skills:
|
|
336
|
+
- tdd
|
|
337
|
+
- diagnose
|
|
338
|
+
- zoom-out
|
|
339
|
+
- caveman
|
|
340
|
+
- grill-with-docs
|
|
341
|
+
- playwright-cli
|
|
342
|
+
- improve-codebase-architecture
|
|
343
|
+
triggers:
|
|
344
|
+
- /tdd
|
|
345
|
+
- /diagnose
|
|
346
|
+
- /zoom-out
|
|
347
|
+
- /caveman
|
|
348
|
+
- /grill-with-docs
|
|
349
|
+
- /playwright-cli
|
|
350
|
+
- /improve-codebase-architecture
|
|
351
|
+
- TDD
|
|
352
|
+
- 诊断
|
|
353
|
+
- 陌生模块
|
|
354
|
+
- 架构健康
|
|
355
|
+
verify:
|
|
356
|
+
skills:
|
|
357
|
+
- qa
|
|
358
|
+
- review
|
|
359
|
+
- code-review
|
|
360
|
+
- cso
|
|
361
|
+
- security-review
|
|
362
|
+
- retro
|
|
363
|
+
- ship
|
|
364
|
+
triggers:
|
|
365
|
+
- /qa
|
|
366
|
+
- /review
|
|
367
|
+
- /code-review
|
|
368
|
+
- /cso
|
|
369
|
+
- /security-review
|
|
370
|
+
- /retro
|
|
371
|
+
- /ship
|
|
372
|
+
- QA
|
|
373
|
+
- Paranoid Staff Engineer
|
|
374
|
+
- code review
|
|
375
|
+
- 安全审查
|
|
376
|
+
- ship
|
|
377
|
+
|
|
378
|
+
# === L2 路由:LLM Supervisor (复杂仲裁仅 fallback) ===
|
|
379
|
+
fallback_supervisor:
|
|
380
|
+
trigger: L1 无 rule 命中 OR 多 rule 同 priority 冲突 OR 用户 prompt 含未列在 override_keywords 的语义
|
|
381
|
+
llm: claude-opus-4-7
|
|
382
|
+
|
|
383
|
+
# === Deprecation 提示 ===
|
|
384
|
+
deprecated:
|
|
385
|
+
- id: brave-search-mcp
|
|
386
|
+
reason: API 改 5 USD 月度信用 + 强制信用卡
|
|
387
|
+
fallback: tavily-mcp + exa-mcp
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# routing/plan-review-schema.yaml (Phase 2.4 W2 D-02 ABSORB)
|
|
2
|
+
# NEW SSOT for EE-4 plan-checker quantitative rubric.
|
|
3
|
+
# Source: .planning/intel/omc-comparison.md L74-82 (omo 4 维原型 formalize; 含 detection / verification dimensions).
|
|
4
|
+
# NOT vendor: 不复刻 vendor prompt 字眼 (含希腊神话 character naming), 仅借 4 维 schema 形态 (B-09 + intel L80).
|
|
5
|
+
# Schema location: yaml-only SSOT (D-WP-2 (a)), NOT TypeBox regen (Karpathy YAGNI per B-10).
|
|
6
|
+
# Thresholds: T2.0 baseline spike outcome RELAX (c8e4147) -- intel defaults
|
|
7
|
+
# (1.0/0.8/0.9/0) score 健康 ship phase-2.2 + phase-2.3 task_plan = 3/4 WARNING
|
|
8
|
+
# -> RELAX fr 1.0->0.80 (NEW-file 容忍) + ac 0.9->0.80 (heuristic 覆盖盲点).
|
|
9
|
+
schemaVersion: 1
|
|
10
|
+
apiVersion: harnessed/v1
|
|
11
|
+
kind: PlanReview
|
|
12
|
+
metadata:
|
|
13
|
+
name: ee-4-plan-review-schema
|
|
14
|
+
version: 1
|
|
15
|
+
source: intel/omc-comparison.md L74-82
|
|
16
|
+
baseline_spike: phase-2.4 T2.0 (commit c8e4147, 2026-05-16)
|
|
17
|
+
spec:
|
|
18
|
+
dimensions:
|
|
19
|
+
file_references_verified:
|
|
20
|
+
description: "plan 提及的 file path 存在比 >= threshold (NEW file 容忍)"
|
|
21
|
+
threshold: 0.80
|
|
22
|
+
measurement: "regex files?(_modified|_created): -> token split -> fs.existsSync ratio"
|
|
23
|
+
rationale: "T2.0 spike: phase-2.2 fr=0.833, phase-2.3 fr=0.893; intel 1.0 过严"
|
|
24
|
+
reference_sources_real:
|
|
25
|
+
description: "plan 引用 .md/.yaml 路径存在比 >= threshold (anchor refs B-NN / ADR N / Phase X.Y 不参与 -- 按 structural assumed valid)"
|
|
26
|
+
threshold: 0.80
|
|
27
|
+
measurement: "regex (decision_source|see|ref): -> .md/.yaml token -> fs.existsSync ratio; no md ref -> 1.0"
|
|
28
|
+
rationale: "intel L74-82 默认, T2.0 confirm both plans sr=1.000"
|
|
29
|
+
concrete_acceptance:
|
|
30
|
+
description: "acceptance_criteria 子 bullet 含可量化 signal 比 >= threshold"
|
|
31
|
+
threshold: 0.80
|
|
32
|
+
measurement: "regex acceptance_criteria:\\n + indented sub-bullets; quant heuristic grep -c|wc -l|exit \\d+|<=N|>=N|==N|命中|absent|present|! grep|0 (增|副|残) etc."
|
|
33
|
+
rationale: "T2.0 spike: phase-2.2 ac=0.921, phase-2.3 ac=0.948; intel 0.9 紧贴, 留 false-neg 余地"
|
|
34
|
+
business_logic_assumptions:
|
|
35
|
+
description: "weasel words (presumably|likely|probably|maybe|should be|assumed) 计数 <= threshold; 白名单 (per D-NN) / (locked) / assumption (名词) 不计"
|
|
36
|
+
threshold: 0
|
|
37
|
+
measurement: "regex weasel words count; whitelist context window 80 chars"
|
|
38
|
+
rationale: "intel 0 默认, T2.0 confirm both plans weasel=0"
|
|
39
|
+
scoring:
|
|
40
|
+
pass_threshold: 4 # 4/4 -> PASS (APPROVED)
|
|
41
|
+
warning_threshold: 3 # 3/4 -> WARNING (APPROVED WITH CONDITIONS)
|
|
42
|
+
blocker_threshold: 2 # <=2/4 -> BLOCKER (REJECTED, manual rerun)
|
|
43
|
+
verdict_mapping:
|
|
44
|
+
pass: "APPROVED -- 4/4 dimensions met"
|
|
45
|
+
warning: "APPROVED WITH CONDITIONS -- 3/4 dimensions met, see warnings"
|
|
46
|
+
blocker: "REJECTED -- <=2/4 dimensions met, plan-phase rerun required (manual per B-12)"
|
|
47
|
+
enforcement:
|
|
48
|
+
ci_step: ".github/workflows/ci.yml step EE-4 plan-checker (Phase 2.4 W2 D-02 / T2.4)"
|
|
49
|
+
auto_spawn: false # B-12: manual /gsd-plan-phase rerun; v0.3.0 absorbs auto-spawn
|
|
50
|
+
walker: "scripts/run-plan-checker.mjs (T2.2 ship)"
|
package/schemas/.gitkeep
ADDED
|
File without changes
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# schemas/ — 可独立 publish 的 JSON Schema artifact
|
|
2
|
+
|
|
3
|
+
`schemas/` 包含 harnessed 编译输出的**标准 JSON Schema 文件**,与 npm 包一起 publish 让社区在 IDE 中直接校验自己的 manifest / workflow / routing 文件。
|
|
4
|
+
|
|
5
|
+
## 文件(v0.1 phase 1.1 起)
|
|
6
|
+
|
|
7
|
+
- `manifest.v1.schema.json` — manifest schema(编译自 `src/manifest/schema/index.ts` TypeBox 定义)
|
|
8
|
+
- `workflows.v1.schema.json` — phases schema(v0.3)
|
|
9
|
+
- `routing.v1.schema.json` — B+C routing schema(v0.1 phase 1.4)
|
|
10
|
+
|
|
11
|
+
## 使用(社区作者)
|
|
12
|
+
|
|
13
|
+
在自己的 manifest yaml 文件顶部加一行:
|
|
14
|
+
|
|
15
|
+
```yaml
|
|
16
|
+
# yaml-language-server: $schema=https://harnessed.dev/schemas/manifest.v1.schema.json
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
VS Code redhat.vscode-yaml 插件会自动启用补全 + 实时校验。
|
|
20
|
+
|
|
21
|
+
## 编译
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pnpm run build:schema # 调用 scripts/build-schema.ts
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
输出 `schemas/manifest.v1.schema.json`,由 CI 跑 `npx ajv compile -s schemas/manifest.v1.schema.json --strict=true` 验证产物自身合规。
|
|
28
|
+
|
|
29
|
+
## 关联
|
|
30
|
+
|
|
31
|
+
- 源 schema:`src/manifest/schema/`(TypeBox 定义)
|
|
32
|
+
- 决策依据:`docs/adr/0001-manifest-schema-v1.md`
|
|
33
|
+
- 校验器:Ajv 8.17 + TypeBox 0.34 LTS(见 GA-1)
|