@xulthekl/team-flow 0.56.1 → 0.58.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/.claude/always/phase-guard.md +1 -1
- package/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +2 -2
- package/.codex-plugin/plugin.json +2 -2
- package/.cursor-plugin/marketplace.json +2 -2
- package/.cursor-plugin/plugin.json +2 -2
- package/.github/plugin/marketplace.json +2 -2
- package/AGENTS.md +37 -17
- package/CHANGELOG.md +123 -0
- package/GEMINI.md +1 -1
- package/INSTALL.md +1 -1
- package/README.md +8 -7
- package/agents/code-reviewer.md +3 -0
- package/agents/cross-change-consistency-checker.md +34 -6
- package/agents/release-archivist.md +6 -0
- package/docs/README_en.md +1 -1
- package/docs/release-checklist.md +1 -1
- package/docs/solutions/INDEX.md +3 -3
- package/docs/usage-guide.md +2 -2
- package/gemini-extension.json +2 -2
- package/hooks/session-start +2 -2
- package/llms.txt +1 -1
- package/package.json +2 -2
- package/plugin.json +2 -2
- package/scripts/lib/cmd-doctor.mjs +140 -1
- package/scripts/lib/cmd-solutions.mjs +14 -4
- package/scripts/lib/md-normalize.mjs +39 -0
- package/scripts/lib/solutions-backfill.mjs +116 -0
- package/scripts/lib/solutions-capture.mjs +67 -20
- package/scripts/lib/solutions-entry.mjs +185 -0
- package/scripts/lib/solutions-index-gen.mjs +117 -57
- package/scripts/lib/solutions-inject.mjs +102 -24
- package/scripts/lib/solutions-promote.mjs +147 -95
- package/scripts/lib/test-merge.mjs +73 -12
- package/scripts/team-flow.mjs +7 -3
- package/skills/architecture-design/SKILL.md +2 -2
- package/skills/architecture-design/references/s3.5-product-architecture.md +1 -1
- package/skills/architecture-design/templates/conventions/frontend-patterns.md +7 -0
- package/skills/build-executor/SKILL.md +7 -1
- package/skills/build-executor/implementer-prompt.md +19 -0
- package/skills/build-executor/task-reviewer-prompt.md +51 -5
- package/skills/ce-brainstorm/references/grounding.md +2 -2
- package/skills/ce-compound/references/promotion-rules.md +26 -9
- package/skills/ce-compound/references/schema.yaml +4 -2
- package/skills/ce-compound/references/three-tier-index.md +10 -7
- package/skills/ce-compound/references/write-flow.md +22 -10
- package/skills/ce-ideate/references/agents/learnings-researcher.md +9 -2
- package/skills/ce-ideate/references/grounding.md +1 -1
- package/skills/ce-plan/references/agents/learnings-researcher.md +9 -2
- package/skills/ce-plan/references/research-workflow.md +2 -2
- package/skills/clean-code/SKILL.md +116 -0
- package/skills/clean-code/references/judgement-cases.md +83 -0
- package/skills/clean-code/references/shared-layer-rules.md +50 -0
- package/skills/code-reviewer/SKILL.md +17 -0
- package/skills/code-reviewer/code-reviewer-prompt.md +74 -2
- package/skills/contract-builder/SKILL.md +9 -0
- package/skills/release-archivist/SKILL.md +2 -2
- package/skills/release-archivist/references/closing-procedures.md +3 -1
- package/skills/spec-writer/SKILL.md +1 -1
- package/skills/workflow-orchestrator/SKILL.md +2 -2
- package/skills/workflow-orchestrator/references/s1-path-router.md +4 -2
- package/skills/workflow-orchestrator/references/s3-plan-pipeline.md +1 -1
- package/skills/workflow-orchestrator/references/s5-monitoring.md +8 -4
- package/skills/workflow-start/SKILL.md +4 -0
- package/templates/conventions/glaf4-compliant/java-testing.md +3 -3
- package/templates/conventions/js-testing.md +1 -1
- package/templates/conventions/python-testing.md +1 -1
- package/templates/learnings.md +17 -5
|
@@ -36,6 +36,12 @@ Subagent (general-purpose):
|
|
|
36
36
|
|
|
37
37
|
Your review is read-only on this checkout. Do not mutate the working tree, the index, HEAD, or branch state in any way. Use tools like `git show`, `git diff`, and `git log` to inspect history. If you need a working copy of a different revision, check it out into a separate temporary directory (e.g. `git worktree add /tmp/review-[SHA] [SHA]`) — never move HEAD on this checkout.
|
|
38
38
|
|
|
39
|
+
## Solutions Injection
|
|
40
|
+
|
|
41
|
+
Before reviewing, run `tf solutions inject --phase review --limit 15` (never blocks on failure) — it surfaces historical learnings from the `review` and `cross-phase` buckets so this review avoids known pitfalls. Treat the output as **advisory hints, not constraints**; report conflicts with the contract/spec rather than silently following either. If the read fails or nothing matches, the CLI prints one WARN line and returns empty — continue the review.
|
|
42
|
+
|
|
43
|
+
> **Why this is duplicated from the SKILL.md's `Review Process` step 0**: there are two dispatch paths — (a) a `general-purpose` subagent built from *this template*, and (b) the `team-flow:code-reviewer` agent, which preloads the SKILL.md and therefore already carries that step. Path (b) cannot be relied on here because this template is self-contained (it inlines the checks below), so the injection must be stated in the template too. Removing either copy silently drops the learnings on that path — v0.57.0 P4 shipped with only the SKILL.md copy and this path ran with no injection at all.
|
|
44
|
+
|
|
39
45
|
## What to Check
|
|
40
46
|
|
|
41
47
|
**Spec/Contract alignment:**
|
|
@@ -63,6 +69,43 @@ Subagent (general-purpose):
|
|
|
63
69
|
- DRY without premature abstraction?
|
|
64
70
|
- Edge cases handled?
|
|
65
71
|
|
|
72
|
+
**Structural criteria (clean-code) — mechanical thresholds:**
|
|
73
|
+
- **Magic values** (unnamed numeric/string literals) → **Critical**. Front-end code too.
|
|
74
|
+
- Function length >20 lines / nesting depth >2 levels / parameters >3 / naming form
|
|
75
|
+
(constants SCREAMING_SNAKE; booleans `is`/`has`/`can` prefix) → Minor. When counting
|
|
76
|
+
nesting, exclude try/catch's own level and guard-clause `return`/`continue` levels;
|
|
77
|
+
framework-fixed signatures are exempt from the parameter rule.
|
|
78
|
+
These thresholds are **readability advisories**. The "Do not use line count as
|
|
79
|
+
evidence" rule under Minimality And Scope concerns *removing* required code; this
|
|
80
|
+
one NEVER justifies deleting validation, security, or error handling.
|
|
81
|
+
|
|
82
|
+
**Incremental boundary — applies to ALL criteria above and below**: judge only the code
|
|
83
|
+
units this diff adds or modifies. When a hit sits inside a function that already existed
|
|
84
|
+
before this change, downgrade it to **Minor** and register it as `存量待整改` in your
|
|
85
|
+
report — never ask for a rewrite outside the task scope.
|
|
86
|
+
|
|
87
|
+
**Structural criteria — mandatory answers** (no threshold: answer AND justify):
|
|
88
|
+
- **Single responsibility**: can the function name cover ALL steps in the body?
|
|
89
|
+
- **DRY**: is there a structurally equivalent logic block within this diff OR this
|
|
90
|
+
repository (ignore comments, whitespace, identifier names)? Answer "yes" only when
|
|
91
|
+
you cite BOTH `file:line` sides.
|
|
92
|
+
- Disposition: same shared publish unit (same package / module / directory) →
|
|
93
|
+
**Critical**, extract a shared layer. Cross-repo duplication is NOT judgeable
|
|
94
|
+
here (your worktree is single-repo).
|
|
95
|
+
|
|
96
|
+
**Judgement cases** — when a structural hit is genuinely not blocking, cite it as
|
|
97
|
+
`judgement-exception: <id>` **plus the structural similarity** (e.g. "all guard clauses,
|
|
98
|
+
no nesting"). Match by **structural features, not line count** — the numbers below
|
|
99
|
+
illustrate the case, they are not thresholds. Available ids:
|
|
100
|
+
- `P1` — long function (≈37 lines) whose body is all guard clauses, one abstraction level → not blocking
|
|
101
|
+
- `P2` — cross-repo isomorphic fix, no shared publish unit → not blocking
|
|
102
|
+
- `N1` — long function (≈54 lines) that is guard clauses + one switch, no nesting → not blocking
|
|
103
|
+
- `N2` — deep nesting arising from try/catch + guard-clause `continue` → already covered
|
|
104
|
+
by the nesting rule (cite only if that rule's intent is disputed)
|
|
105
|
+
- `N4` — ≈35 lines, single abstraction level (error mapping) → advisory only
|
|
106
|
+
- Magic-value exemptions beyond the criterion's list: no id needed — apply the criterion's
|
|
107
|
+
own test ("does changing this value change behavior?") and state your reasoning.
|
|
108
|
+
|
|
66
109
|
**Architecture:**
|
|
67
110
|
- Sound design decisions?
|
|
68
111
|
- Reasonable scalability and performance?
|
|
@@ -118,6 +161,18 @@ Subagent (general-purpose):
|
|
|
118
161
|
a fresh review and replacement `pass` receipt before any dependent wave or
|
|
119
162
|
closing transition.
|
|
120
163
|
|
|
164
|
+
### Structural Criteria (mandatory answers)
|
|
165
|
+
|
|
166
|
+
Answer both; cite `file:line` for each. If you downgrade by citing a judgement
|
|
167
|
+
case, name it here as `judgement-exception: <id>` plus the structural similarity.
|
|
168
|
+
|
|
169
|
+
- **Single responsibility**: [Yes | No — if No, list the steps the function name
|
|
170
|
+
cannot cover, with file:line]
|
|
171
|
+
- **DRY**: [Yes | No — if Yes, cite BOTH `file:line` sides + shared-layer disposition]
|
|
172
|
+
|
|
173
|
+
**存量待整改** (pre-existing hits downgraded to Minor — one per line, or "none"):
|
|
174
|
+
- [e.g. `src/foo/Bar.java:120` — function length >20 lines, pre-existing]
|
|
175
|
+
|
|
121
176
|
### Strengths
|
|
122
177
|
[What's well done? Be specific.]
|
|
123
178
|
|
|
@@ -182,8 +237,23 @@ Subagent (general-purpose):
|
|
|
182
237
|
- Comprehensive test coverage (18 tests, all edge cases)
|
|
183
238
|
- Good error handling with fallbacks (summarizer.ts:85-92)
|
|
184
239
|
|
|
240
|
+
### Structural Criteria
|
|
241
|
+
|
|
242
|
+
- Single responsibility: Yes — each handler covers one step
|
|
243
|
+
- DRY: No — `search.ts:25-27` duplicates the date-validation block in `parse.ts:88-90`
|
|
244
|
+
(structurally equivalent, comments/identifiers ignored). Same package → shared layer
|
|
245
|
+
recommended (Critical)
|
|
246
|
+
|
|
185
247
|
### Issues
|
|
186
248
|
|
|
249
|
+
#### Critical (Must Fix)
|
|
250
|
+
1. **Structurally duplicated date-validation block**
|
|
251
|
+
- File: `search.ts:25-27` (duplicates `parse.ts:88-90`)
|
|
252
|
+
- Issue: Same package, structurally equivalent — the two copies will drift
|
|
253
|
+
- Fix: Extract to a shared helper in the package's utils
|
|
254
|
+
- Note: A Critical finding forces `--verdict fail`; a repair requires a fresh
|
|
255
|
+
review and a replacement `pass` receipt before any dependent wave
|
|
256
|
+
|
|
187
257
|
#### Important
|
|
188
258
|
1. **Missing help text in CLI wrapper**
|
|
189
259
|
- File: index-conversations:1-31
|
|
@@ -207,7 +277,9 @@ Subagent (general-purpose):
|
|
|
207
277
|
|
|
208
278
|
### Assessment
|
|
209
279
|
|
|
210
|
-
**Ready to merge:
|
|
280
|
+
**Ready to merge: No** — a Critical finding is open
|
|
211
281
|
|
|
212
|
-
**Reasoning:** Core implementation is solid with good architecture and tests
|
|
282
|
+
**Reasoning:** Core implementation is solid with good architecture and tests, but the
|
|
283
|
+
structurally duplicated validation block (Critical) must be extracted into a shared layer
|
|
284
|
+
before merge. The Important issues (help text, date validation) are easily fixed.
|
|
213
285
|
```
|
|
@@ -74,6 +74,15 @@ When the change involves UI (design.md has a `## UI Contract` section), the exec
|
|
|
74
74
|
|
|
75
75
|
### Structure
|
|
76
76
|
|
|
77
|
+
> **模块分段契约(v0.57.0 §4.3)**:`## Cases` 与 `## E2E / AC Verification` 之下的 `### {module}`
|
|
78
|
+
> 才是 `test-merge` 认定的测试模块分段边界(`MODULE_SECTIONS`,**精确段名比较**);其他段下的 `###`
|
|
79
|
+
> 不作为测试模块。E2E case 以 `test_tier=e2e` 的行落在 `## Cases` 内,故默认**不**单独建
|
|
80
|
+
> `## E2E / AC Verification` 段。
|
|
81
|
+
>
|
|
82
|
+
> 注意残留形态:白名单只约束**分段**,不约束**模块名的字符构成** —— 全标点标题会产出
|
|
83
|
+
> `2026-09-12-.md` 这类无信息文件名;且**历史退化 baseline 不会被清理**(既不从索引消失,
|
|
84
|
+
> 也不改名),INDEX 的模块行由文件名反推、与 `MODULE_SECTIONS` 不同源。
|
|
85
|
+
|
|
77
86
|
```markdown
|
|
78
87
|
# Test Matrix — {change-name}
|
|
79
88
|
|
|
@@ -77,7 +77,7 @@ Check for files modified outside scope fence, new dependencies not in design. Un
|
|
|
77
77
|
|
|
78
78
|
- **Architecture merge**: <merged architecture.md + database.md + api.md + N SQL scripts to docs/architecture/ | architecture/ absent — skipped>
|
|
79
79
|
- **Prototype sync**: <synced N pages / N components / design-system updated | no UX delta | conflicts: N>
|
|
80
|
-
- **Compound promotion**: <promoted N
|
|
80
|
+
- **Compound promotion**: <promoted N / confirmed N / unchanged N / skipped N | no learnings>
|
|
81
81
|
|
|
82
82
|
**Verdict**: PASS (all PASS) / CONDITIONAL (WARN only) / FAIL (any FAIL).
|
|
83
83
|
- FAIL → fix issues or route back to build-executor
|
|
@@ -231,7 +231,7 @@ Promote change-level learnings to the global solutions library:
|
|
|
231
231
|
tf solutions promote <change-dir>
|
|
232
232
|
```
|
|
233
233
|
|
|
234
|
-
读取 change 根目录的 `learnings.md`(v0.49.0 §83.3.5 路径统一)——`severity ≥ medium` 且 `type = pitfall|pattern` 者晋升全局 `docs/solutions
|
|
234
|
+
读取 change 根目录的 `learnings.md`(v0.49.0 §83.3.5 路径统一)——`severity ≥ medium` 且 `type = pitfall|pattern` 者晋升全局 `docs/solutions/`;命中既有条目(文件名 + 正文签名**都**相同)则把来源 change 登记进 `confirmations` 并按其升级 severity(新来源才升一档,同 change 重跑不升);同标题但正文不同者是**独立条目**(文件名加 `-2`/`-3` 后缀),正文一律不合并(v0.57.0 废止 `domain+type` 判重合并正文的旧行为)。severity 序 `critical > high > medium > low` 定义在插件内 `scripts/lib/severity.mjs`(引用,非调用)(v0.23 §91,单一来源)。
|
|
235
235
|
|
|
236
236
|
**Compound Capture Check(v0.5)**:closing 前自检本 change 是否产生了可沉淀的经验(强制回退 / 复发根因 / 范围外扩 / 契约漂移);有则写入 change 根的 `learnings.md`,每条 `## <title>` 带 frontmatter(`phase`/`domain`/`type`/`severity`/`date`)。该文件正是 `compound-captured` guard 检查、`tf solutions promote` 读取的对象。
|
|
237
237
|
|
|
@@ -33,7 +33,9 @@ tf solutions promote <change-dir>
|
|
|
33
33
|
|
|
34
34
|
Promotion criteria:
|
|
35
35
|
- severity ≥ medium AND type = pitfall/pattern → promote to global `docs/solutions/`
|
|
36
|
-
-
|
|
36
|
+
- file name AND body signature both match an existing global entry → register the source change in `confirmations` and upgrade severity (low → medium → high → critical); same title but different body is a SEPARATE entry (file suffixed `-2`/`-3`) — bodies are never merged
|
|
37
|
+
- **severity steps up once per NEW source change** — re-running promote for a change already listed in `confirmations` reports `unchanged` and does NOT upgrade (a re-run is not new evidence). Both `severity` and `confirmations` are written to the **entry file's frontmatter**, never to INDEX (INDEX is derived by `refreshIndex`)
|
|
38
|
+
- `tf solutions promote` prints four counts (`promoted` / `confirmed` / `unchanged` / `skipped`) — record them verbatim in the closing summary; `skipped` entries are listed with reasons and are NOT errors (most commonly: `severity` below medium, or a `phase` outside the enum)
|
|
37
39
|
|
|
38
40
|
Report promotion results in the closing summary. Promotion is advisory — failures do not block closing.
|
|
39
41
|
|
|
@@ -27,7 +27,7 @@ If no prototype exists or it is empty, skip silently — not all projects have p
|
|
|
27
27
|
|
|
28
28
|
### Solutions Index (v0.5)
|
|
29
29
|
|
|
30
|
-
Read `docs/solutions/INDEX.md` if it exists. Filter entries where `phase = spec OR phase = cross-phase` and `domain` matches the current change's domain. Inject top
|
|
30
|
+
Read `docs/solutions/INDEX.md` if it exists. Filter entries where `phase = spec OR phase = cross-phase` and `domain` matches the current change's domain. Inject the **top 5** summaries as context constraints for artifact generation, ordered **severity → phase-match → date** (the CLI's ordering); widen with `tf solutions inject --phase spec --limit <n>` when cross-phase entries saturate the window. If INDEX.md does not exist or is empty, skip silently — a missing index makes the CLI print one WARN, which is not an error.
|
|
31
31
|
|
|
32
32
|
### Change Brief (v0.9)
|
|
33
33
|
|
|
@@ -37,7 +37,7 @@ Do NOT invoke for:
|
|
|
37
37
|
## Execution Flow(S1-S5 + ARCH 产品级架构设计)
|
|
38
38
|
|
|
39
39
|
### S1: 路径路由器
|
|
40
|
-
**先做需求选择**(v0.15.0 多需求):读 `.team-flow/registry.yaml`,确定 `active_requirement`(多需求则询问操作哪个/新建)。再判断 7 种入口路径之一;检查 baseline.md / CONCEPTS.md
|
|
40
|
+
**先做需求选择**(v0.15.0 多需求):读 `.team-flow/registry.yaml`,确定 `active_requirement`(多需求则询问操作哪个/新建)。再判断 7 种入口路径之一;检查 baseline.md / CONCEPTS.md(后者在 `docs/architecture/CONCEPTS.md`,根目录为旧位置)并注入;复利注入(INDEX.md 默认 top-5,见 `references/s1-path-router.md` 的窗口与排序口径)。**路由结果必须向用户显式确认**(路由是建议非决定)。详见 `references/s1-path-router.md`。
|
|
41
41
|
|
|
42
42
|
**conventions 注入(v0.11 §33)**:
|
|
43
43
|
- 读取 conventions 配置,注入为需求分析上下文
|
|
@@ -205,7 +205,7 @@ plan_hash: sha256:<plan.md 内容摘要> # 检测产品层改动后变更层
|
|
|
205
205
|
- **架构门禁(v0.36.0)**:ARCH 阶段 skip 必须物化(`iterations/vN/SKIPPED` + 理由);arch-readiness(S4 拆分:快照覆盖 change 触及 BC)与 arch-snapshot(change closing)为 guard 门禁,`arch_baseline` 缺失 → WARN 不 FAIL(存量豁免)
|
|
206
206
|
- **路由是建议非决定**:S1 路由判断必须用户确认;重规划必须 DP-R 阻塞确认
|
|
207
207
|
- **回退必写 replan_log**:active → pending 回退必须记录;受影响制品归档为 .revN,重入不读旧制品
|
|
208
|
-
- **不阻断流程**:所有复利操作为 advisory
|
|
208
|
+
- **不阻断流程**:所有复利操作为 advisory 级——INDEX 缺失/读取失败时 CLI 输出一行 WARN 并返回空结果,**不阻断流程**(v0.57.0 前为完全静默)
|
|
209
209
|
- **Artifact Ownership — 主代理不得直接修改子代理产物** (v0.29.0 §37):子代理是其产物的唯一负责人(architecture-design → `architecture/` 目录,spec-writer → `proposal.md`/`specs/`/`design.md`/`tasks.md`,contract-builder → `execution-contract.md`,prototype-builder → `prototype/` 目录)。主代理(workflow-orchestrator)不得通过 Read + Edit/Write 直接修改子代理的产物文件。修改必须通过 `SendMessage` 恢复原子代理(优先)或启动新子代理执行。例外:仅当子代理无法启动且用户明确授权时,主代理可直接修改,但必须在修改后重新触发对应的 review 验证。编排层自己负责的产物(change-brief.md、orchestrator.yaml、审计报告落盘)不受此限制
|
|
210
210
|
|
|
211
211
|
## Output Standard
|
|
@@ -40,11 +40,13 @@ S1 只做编排动作(需求选择、存在性检查、路径判断、阻塞
|
|
|
40
40
|
- 检查 `docs/architecture/baseline.md`:
|
|
41
41
|
- 存在 → 注入为架构上下文(技术栈/模块/数据模型),替代「从零侦察」
|
|
42
42
|
- 不存在 → advisory 提示「建议先运行 `/workflow-bootstrap` 建立项目基线」(**不阻断**)
|
|
43
|
-
- 检查 `CONCEPTS.md
|
|
43
|
+
- 检查 `CONCEPTS.md`(**位于 `docs/architecture/CONCEPTS.md`**,根目录为 v0.23.0 前的旧位置):存在 → 注入领域词汇表
|
|
44
44
|
|
|
45
45
|
## 复利注入(advisory 级)
|
|
46
46
|
|
|
47
|
-
读取 `docs/solutions/INDEX.md`(如存在),过滤 `phase = prd OR cross-phase` 且 domain 匹配的经验,取 top-5
|
|
47
|
+
读取 `docs/solutions/INDEX.md`(如存在),过滤 `phase = prd OR cross-phase` 且 domain 匹配的经验,取 **默认 top-5** 摘要注入为上下文约束。读取失败时跳过、不阻断(**无索引时 CLI 会输出一行 WARN 并返回空结果,那不是错误**)。
|
|
48
|
+
|
|
49
|
+
> **窗口与排序须与 CLI 同口径(v0.57.0)**:排序为 **severity 降序 → 阶段匹配度(本阶段优先于通配的 cross-phase)→ date 降序**(三级键;旧的"仅 severity 降序"已被取代)。窗口默认 5,用 `tf solutions inject --phase <p> --limit <n>` 放宽——cross-phase 条目满载 5 条时,本阶段新增条目**永不可达**,故凡有 CLI 可用的场合优先用 CLI(`--all` 输出全部,但无上界,慎用)。同 `source` 的条目折叠为 1 条并标注条数。
|
|
48
50
|
|
|
49
51
|
工作流模式复利(L2):S1 路由时额外注入历史 `workflow_pattern` top-3(confidence ≥ 0.5)。详见 state-model.md「工作流模式复利 L2」。
|
|
50
52
|
|
|
@@ -35,7 +35,7 @@ ce-plan 在 orchestrator pipeline 上下文中减少仪式开销,但**保留
|
|
|
35
35
|
|
|
36
36
|
## 复利
|
|
37
37
|
|
|
38
|
-
- **注入**:读取 `docs/solutions/INDEX.md`,过滤 `phase = plan OR cross-phase
|
|
38
|
+
- **注入**:读取 `docs/solutions/INDEX.md`,过滤 `phase = plan OR cross-phase`,取默认 top-5 摘要(窗口与排序口径见 `s1-path-router.md`;有 CLI 时优先 `tf solutions inject --phase plan --limit <n>`)
|
|
39
39
|
- **捕获**:检测可复利时刻(技术方向决策、拆分权衡等)
|
|
40
40
|
|
|
41
41
|
## 反馈环路检查点
|
|
@@ -24,10 +24,14 @@
|
|
|
24
24
|
|
|
25
25
|
### 2. 跨 change 一致性检测
|
|
26
26
|
|
|
27
|
-
调用 `cross-change-consistency-checker` agent(插件 agent,跨 skill
|
|
28
|
-
-
|
|
29
|
-
- API 变更是否影响其他 change
|
|
30
|
-
-
|
|
27
|
+
调用 `cross-change-consistency-checker` agent(插件 agent,跨 skill 复用价值)检测 5 个维度:
|
|
28
|
+
- 共享聚合/实体的变更是否冲突(Dim 1)
|
|
29
|
+
- API 变更是否影响其他 change(Dim 2)
|
|
30
|
+
- 架构锚点漂移(Dim 3)
|
|
31
|
+
- 原型漂移(change 实现与全局 prototype/ 是否一致)(Dim 4)
|
|
32
|
+
- **同构横展完整性(Dim 5,v0.58.0)**:本 change 处置的代码模式,是否在其**全部**出现位置都已处置
|
|
33
|
+
|
|
34
|
+
**Dim 5 传参**:须向 agent 传 `repo_layout`(读 `<项目根>/.team-flow/team-flow.config.json` 的 `repo_layout.repos`);缺失时 agent 跳过 Dim 5 并注明。**触发条件**:change 性质为缺陷修复 / 规则对齐 / 同构同步时启用;纯新功能开发跳过(无既有模式可横展)。**真空对照**:agent 对零命中的模式须显式报告「模式未命中,需人工确认」,不得记为 CLEAN。
|
|
31
35
|
|
|
32
36
|
### 3. 复利晋升
|
|
33
37
|
|
|
@@ -141,6 +141,10 @@ The current planned wave is implemented and ready for spec-compliance + code-qua
|
|
|
141
141
|
### Route to release-archivist (dispatch sub-agent)
|
|
142
142
|
Guard: `... check <dir> executing closing --json` → fail = BLOCK. Implementation complete, verification complete/nearly complete. Include `DP-7: 归档确认`.
|
|
143
143
|
|
|
144
|
+
**Dim 5 横展完整性检查(v0.58.0)**:`executing → closing` 前,若本 change 性质为缺陷修复 / 规则对齐 / 同构同步,调度 `cross-change-consistency-checker` agent 执行 **Dim 5**——传 `change_dirs`(本 change)+ `repo_layout`(读 `.team-flow/team-flow.config.json` 的 `repo_layout.repos`)。agent 以**模式驱动**扫描本 change diff 中被处置的具名结构元素在**全部仓**的出现位置,差异集即遗漏候选(可达 → Important,须先修复或登记;零调用方 → Minor)。**纯新功能开发跳过**(无既有模式可横展)。**零命中时 agent 须显式报告「模式未命中」而非 CLEAN**(防真空断言)。
|
|
145
|
+
|
|
146
|
+
> 为何单 change 也要查:横展缺口发生在**单个 change 内部**(v1 实证:一个 change 修了 2 个同构仓、漏了 2 个),而 `cross-change-consistency-checker` 此前仅在 S5(change ≥ 2)被调度——**该场景下 Dim 5 永不触发**。此处是本检查对单 change 的唯一入口。
|
|
147
|
+
|
|
144
148
|
### Route to spec-merger
|
|
145
149
|
Delta specs exist that need merging, change closing with ADDED/MODIFIED/REMOVED/RENAMED specs.
|
|
146
150
|
|
|
@@ -326,7 +326,7 @@ void testGetUser_InactiveUser() { ... } // status = INACTIVE
|
|
|
326
326
|
|
|
327
327
|
## 8. 测试质量规则
|
|
328
328
|
|
|
329
|
-
参见 `references/test-quality-rules.md`,主要包括:
|
|
329
|
+
参见 team-flow 插件 `skills/test-strategy/references/test-quality-rules.md`,主要包括:
|
|
330
330
|
|
|
331
331
|
1. 断言质量规则(missing-meaningful-assertion、weak-assertion-only、verify-only-without-assertion)
|
|
332
332
|
2. 调试代码残留规则(system-out、print-stack-trace)
|
|
@@ -339,7 +339,7 @@ void testGetUser_InactiveUser() { ... } // status = INACTIVE
|
|
|
339
339
|
|
|
340
340
|
## 9. 测试隔离
|
|
341
341
|
|
|
342
|
-
参见 `references/integration-test-isolation.md`,主要包括:
|
|
342
|
+
参见 team-flow 插件 `skills/test-strategy/references/integration-test-isolation.md`,主要包括:
|
|
343
343
|
|
|
344
344
|
- Repository 层:H2 内存库
|
|
345
345
|
- Service 层(同步):@Transactional
|
|
@@ -350,7 +350,7 @@ void testGetUser_InactiveUser() { ... } // status = INACTIVE
|
|
|
350
350
|
|
|
351
351
|
## 10. 集成测试契约
|
|
352
352
|
|
|
353
|
-
参见 `references/integration-test-contracts.md`,主要包括:
|
|
353
|
+
参见 team-flow 插件 `skills/test-strategy/references/integration-test-contracts.md`,主要包括:
|
|
354
354
|
|
|
355
355
|
- 入口契约:API 端点、消息队列、定时任务
|
|
356
356
|
- 协作者契约:真实/mock/stub 分级
|
|
@@ -244,7 +244,7 @@ describe('UserService', () => {
|
|
|
244
244
|
|
|
245
245
|
## 7. 测试质量规则
|
|
246
246
|
|
|
247
|
-
参见 `references/test-quality-rules.md`,主要包括:
|
|
247
|
+
参见 team-flow 插件 `skills/test-strategy/references/test-quality-rules.md`,主要包括:
|
|
248
248
|
|
|
249
249
|
1. 断言质量规则(missing-meaningful-assertion、weak-assertion-only)
|
|
250
250
|
2. 调试代码残留规则(console.log)
|
|
@@ -316,7 +316,7 @@ def mock_external_api(mocker):
|
|
|
316
316
|
|
|
317
317
|
## 9. 测试质量规则
|
|
318
318
|
|
|
319
|
-
参见 `references/test-quality-rules.md`,主要包括:
|
|
319
|
+
参见 team-flow 插件 `skills/test-strategy/references/test-quality-rules.md`,主要包括:
|
|
320
320
|
|
|
321
321
|
1. 断言质量规则(missing-meaningful-assertion、weak-assertion-only)
|
|
322
322
|
2. 调试代码残留规则(print)
|
package/templates/learnings.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
>
|
|
5
5
|
> **位置权威(v0.49.0 §83.3.5)**:`changes/<name>/learnings.md`。代码(`solutions-promote.mjs`)与 `compound-captured` guard 均只认此路径;文档曾宣称的 `specs/<cap>/learnings.md` 从未落地。
|
|
6
6
|
>
|
|
7
|
-
> **消费链路**:本文件 → `tf solutions promote`(release-archivist closing 调用)→ 全局 `docs/solutions/` → `tf solutions inject
|
|
7
|
+
> **消费链路**:本文件 → `tf solutions promote`(release-archivist closing 调用)→ 全局 `docs/solutions/` → `tf solutions inject --phase <p> --limit <n>`(各阶段入口注入;**须显式传 `--limit`**,默认 top-5)。
|
|
8
8
|
>
|
|
9
9
|
> **晋升前提**:只有带完整 frontmatter 的条目才会被晋升。缺字段时按默认 `severity=low` / `type=insight` 处理,不满足晋升条件即跳过——promote 会在输出中列出跳过原因,不再静默。
|
|
10
10
|
>
|
|
@@ -12,8 +12,12 @@
|
|
|
12
12
|
|
|
13
13
|
## 1. <条目标题:一句话说清问题或模式>
|
|
14
14
|
|
|
15
|
+
> **条目结构**:一个 H2 标题 = 一条经验。正文用下面的 `- **要点**:` 列表写,
|
|
16
|
+
> **不要**在条目内再用 `## 子标题`——H2 是条目分隔符,子标题会被解析成"缺 frontmatter 的条目"
|
|
17
|
+
> 而在 promote 输出中刷出一串 skipped 噪音。
|
|
18
|
+
|
|
15
19
|
---
|
|
16
|
-
phase: cross-phase # 阶段名(prd/plan/architecture/prototype/spec/build/review/cross-phase
|
|
20
|
+
phase: cross-phase # 阶段名(prd/plan/architecture/prototype/spec/build/review/cross-phase)(不在枚举内会被 promote 跳过并给出理由)
|
|
17
21
|
domain: <领域> # 如 jest / sdd / spring-boot;注入时按领域过滤
|
|
18
22
|
type: pitfall # pitfall | pattern | insight
|
|
19
23
|
severity: medium # critical | high | medium | low(小写;critical = 安全/数据/合规级高危经验)
|
|
@@ -44,8 +48,16 @@ date: YYYY-MM-DD
|
|
|
44
48
|
|
|
45
49
|
| 条件 | 行为 |
|
|
46
50
|
|---|---|
|
|
47
|
-
| `severity` ≥ medium 且 `type` = pitfall / pattern | 晋升到全局 `docs/solutions/<phase
|
|
48
|
-
|
|
|
49
|
-
|
|
|
51
|
+
| `severity` ≥ medium 且 `type` = pitfall / pattern | 晋升到全局 `docs/solutions/<phase>/`(INDEX 由脚本内部重建,**勿手工编辑 INDEX**) |
|
|
52
|
+
| 文件名(`<date>-<slug>.md`)与正文**都**与既有条目相同 | 不新建文件:在条目 frontmatter 的 `confirmations` 追加来源 change + 按其升级 severity(同 change 重跑记为 unchanged,**不**升档) |
|
|
53
|
+
| 与既有条目**同标题但正文不同** | 是**另一条**经验:新建条目(文件名加 `-2`/`-3` 后缀)——**不要**为了去重而合并正文 |
|
|
54
|
+
| `phase` 不在枚举内 / `severity` < medium / `type` 非 pitfall·pattern | 保留在本文件;promote 输出中列为 skipped 并附原因 |
|
|
55
|
+
|
|
56
|
+
**每条经验独立成条**:不同经验即使标题相同也各自落盘,正文一律不合并(v0.57.0 起;
|
|
57
|
+
旧实现按 `domain+type` 合并正文,实测丢失 13 条内容)。
|
|
58
|
+
|
|
59
|
+
**幂等的前提是 `date`**:条目文件名是 `<date>-<slug>.md`,故幂等只在**同一 `date` 内**成立。
|
|
60
|
+
条目缺 `date:` 时 promote 按**运行日**计算 —— 跨天重跑会新建条目(而非记 `unchanged`)。
|
|
61
|
+
需要幂等的场景请显式写 `date:`。
|
|
50
62
|
|
|
51
63
|
**条目质量要求**:写「正确做法」前先验证它在系统层面成立——局部观察得出的 workaround 若被沉淀为通则,会被后续 change 当经验复用,反而固化缺陷(v0.49.0 §83.2.2 的实证教训)。
|