@xulthekl/team-flow 0.39.1 → 0.41.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.
Files changed (41) hide show
  1. package/.claude/always/phase-guard.md +1 -1
  2. package/.claude-plugin/marketplace.json +1 -1
  3. package/.claude-plugin/plugin.json +1 -1
  4. package/.codex-plugin/plugin.json +1 -1
  5. package/.cursor-plugin/marketplace.json +1 -1
  6. package/.cursor-plugin/plugin.json +1 -1
  7. package/.github/plugin/marketplace.json +2 -2
  8. package/AGENTS.md +2 -2
  9. package/CHANGELOG.md +9 -0
  10. package/GEMINI.md +1 -1
  11. package/INSTALL.md +1 -1
  12. package/README.md +1 -1
  13. package/docs/README_en.md +1 -1
  14. package/docs/solutions/INDEX.md +1 -0
  15. package/docs/solutions/cross-phase/2026-08-07-no-summary.md +17 -0
  16. package/gemini-extension.json +1 -1
  17. package/hooks/session-start +2 -2
  18. package/llms.txt +1 -1
  19. package/package.json +1 -1
  20. package/plugin.json +1 -1
  21. package/scripts/ensure-branch.mjs +2 -8
  22. package/scripts/lib/arch-merge.mjs +11 -10
  23. package/scripts/lib/cmd-deisolate.mjs +1 -5
  24. package/scripts/lib/cmd-execution.mjs +3 -2
  25. package/scripts/lib/cmd-prototype.mjs +30 -13
  26. package/scripts/lib/cmd-publish.mjs +16 -4
  27. package/scripts/lib/execution-plan.mjs +78 -18
  28. package/scripts/lib/git-utils.mjs +90 -0
  29. package/skills/ce-brainstorm/SKILL.md +65 -2
  30. package/skills/ce-brainstorm/references/brainstorm-sections.md +53 -9
  31. package/skills/ce-brainstorm/references/business-processes.md +140 -0
  32. package/skills/ce-brainstorm/references/business-scenarios.md +122 -0
  33. package/skills/ce-brainstorm/references/evidence-chain-validation.md +114 -0
  34. package/skills/ce-brainstorm/references/phase0-routing.md +7 -1
  35. package/skills/ce-brainstorm/references/prd-mapping.md +36 -8
  36. package/skills/ce-brainstorm/references/synthesis-summary.md +21 -0
  37. package/skills/workflow-bootstrap/SKILL.md +29 -5
  38. package/skills/workflow-bootstrap/references/agents/codebase-recon-analyst.md +13 -3
  39. package/skills/workflow-bootstrap/references/b1-reconnaissance.md +18 -2
  40. package/skills/workflow-bootstrap/scripts/recon-probe.sh +79 -2
  41. package/skills/workflow-bootstrap/templates/claude-md-team-flow.md +60 -0
@@ -4,7 +4,7 @@
4
4
  #
5
5
  # 用途
6
6
  # 对既有代码库做"固定化、可复现"的机械采集:目录树 / 依赖清单 / LOC 与文件
7
- # 类型分布 / 测试文件计数 / DB 迁移清单 / README-docs 探测。
7
+ # 类型分布 / 测试文件计数 / DB 迁移清单 / README-docs 探测 / Git 子仓库结构。
8
8
  # 本脚本只做**确定性机械采集**(设计文档 v0.8 §17.8 第四类载体)——同项目两次
9
9
  # 运行结果一致,可横展对比。语义判断(架构模式 / 聚合根推断 / 框架定性)交给
10
10
  # 消费本脚本 JSON 输出的侦察子代理(codebase-recon-analyst)完成。
@@ -368,6 +368,75 @@ if [ "$DDL_TABLE_COUNT" -eq 0 ]; then
368
368
  printf -- '-- Please populate manually with your database schema.\n\n' >> "$TMP/ddl_statements.sql"
369
369
  fi
370
370
 
371
+ # ============================================================================
372
+ # ⑧ Git 子仓库扫描(v0.41.0:git-structure 维度)
373
+ # ----------------------------------------------------------------------------
374
+ # 识别 root 自身 git 仓库状态 + 嵌套 git 仓库(排除 root 自身)+ git submodule
375
+ # + .gitignore 忽略子仓库规则。设计契约:只做确定性机械采集(目录/文件探测),
376
+ # 每个子仓库的用途/提交顺序约束等语义判断交给侦察子代理。
377
+ # ============================================================================
378
+
379
+ # 判断 root 自身是否为 git 仓库(.git 目录或 git rev-parse 兜底)
380
+ IS_GIT_REPO=false
381
+ if [ -d "$ROOT_ABS/.git" ] || git -C "$ROOT_ABS" rev-parse --git-dir >/dev/null 2>&1; then
382
+ IS_GIT_REPO=true
383
+ fi
384
+
385
+ # 查找嵌套 git 仓库(.git 目录或文件——submodule/worktree 可能是文件),排除 root 自身
386
+ : > "$TMP/sub_repos.txt"
387
+ if [ "$IS_GIT_REPO" = true ]; then
388
+ find "$ROOT_ABS" -maxdepth 3 \
389
+ \( -type d -name .git -o -type f -name .git \) \
390
+ -print 2>/dev/null \
391
+ | grep -v "^$ROOT_ABS/.git$" \
392
+ | while IFS= read -r _g; do
393
+ rel="$(dirname "${_g#"$ROOT_ABS"/}")"
394
+ echo "$rel"
395
+ done | sort -u > "$TMP/sub_repos.txt"
396
+ fi
397
+ SUB_REPO_COUNT=$(wc -l < "$TMP/sub_repos.txt" | tr -d ' ')
398
+
399
+ # git submodule 列表(.gitmodules 存在时)
400
+ : > "$TMP/submodules.txt"
401
+ if [ -f "$ROOT_ABS/.gitmodules" ]; then
402
+ grep -oE 'path[[:space:]]*=[[:space:]]*[^[:space:]]+' "$ROOT_ABS/.gitmodules" 2>/dev/null \
403
+ | sed -E 's/path[[:space:]]*=[[:space:]]*//' | sort -u > "$TMP/submodules.txt"
404
+ fi
405
+ SUBMODULE_COUNT=$(wc -l < "$TMP/submodules.txt" | tr -d ' ')
406
+
407
+ # 构建 sub_repos JSON 数组(含 type / has_remote)
408
+ : > "$TMP/sub_repos.json"
409
+ if [ "$IS_GIT_REPO" = true ]; then
410
+ while IFS= read -r _sr; do
411
+ [ -z "$_sr" ] && continue
412
+ _type="nested"
413
+ if [ -f "$ROOT_ABS/.gitmodules" ] \
414
+ && grep -qE "^[[:space:]]*path[[:space:]]*=[[:space:]]*${_sr}[[:space:]]*$" "$ROOT_ABS/.gitmodules" 2>/dev/null; then
415
+ _type="submodule"
416
+ fi
417
+ _has_remote="false"
418
+ if git -C "$ROOT_ABS/$_sr" remote 2>/dev/null | grep -q .; then
419
+ _has_remote="true"
420
+ fi
421
+ printf '{"path":"%s","type":"%s","has_remote":%s},' \
422
+ "$(json_escape "$_sr")" "$_type" "$_has_remote" >> "$TMP/sub_repos.json"
423
+ done < "$TMP/sub_repos.txt"
424
+ fi
425
+ SUB_REPOS_JSON="$(sed 's/,$//' "$TMP/sub_repos.json" 2>/dev/null)"
426
+
427
+ # .gitignore 中是否忽略了任一子仓库
428
+ GITIGNORE_IGNORES_SUBREPOS=false
429
+ if [ -f "$ROOT_ABS/.gitignore" ] && [ "$SUB_REPO_COUNT" -gt 0 ]; then
430
+ while IFS= read -r _sr; do
431
+ [ -z "$_sr" ] && continue
432
+ # 匹配:整行 / 目录行(斜杠结尾)/ 项目名
433
+ if grep -qE "(^|/)[[:space:]]*${_sr}(/|$)" "$ROOT_ABS/.gitignore" 2>/dev/null; then
434
+ GITIGNORE_IGNORES_SUBREPOS=true
435
+ break
436
+ fi
437
+ done < "$TMP/sub_repos.txt"
438
+ fi
439
+
371
440
  # ============================================================================
372
441
  # 组装 JSON
373
442
  # ============================================================================
@@ -399,10 +468,17 @@ fi
399
468
  printf ' "docs": {"docs_dir": %s, "doc_files": %s},\n' \
400
469
  "$DOCS_DIR" "$(json_array_from_file "$TMP/doc_files.txt")"
401
470
  # ⑦ DDL 提取(v0.24.0)
402
- printf ' "ddl_extraction": {"source": "%s", "table_count": %s, "tables": %s, "ddl_statements": "%s"}\n' \
471
+ printf ' "ddl_extraction": {"source": "%s", "table_count": %s, "tables": %s, "ddl_statements": "%s"},\n' \
403
472
  "$(json_escape "$DDL_SOURCE")" "$DDL_TABLE_COUNT" \
404
473
  "$(json_array_from_file "$TMP/ddl_tables.txt")" \
405
474
  "$(json_escape "$(cat "$TMP/ddl_statements.sql" 2>/dev/null)")"
475
+ # ⑧ Git 子仓库结构(v0.41.0)
476
+ printf ' "git_structure": {"is_git_repo": %s, "sub_repo_count": %s, "sub_repos": [%s], "submodule_count": %s, "submodules": %s, "gitignore_ignores_subrepos": %s}\n' \
477
+ "$IS_GIT_REPO" "$SUB_REPO_COUNT" \
478
+ "$SUB_REPOS_JSON" \
479
+ "$SUBMODULE_COUNT" \
480
+ "$(json_array_from_file "$TMP/submodules.txt")" \
481
+ "$GITIGNORE_IGNORES_SUBREPOS"
406
482
  printf '}\n'
407
483
  } > "$TMP/out.json"
408
484
 
@@ -443,6 +519,7 @@ fi
443
519
  echo "docs/ 目录 : $DOCS_DIR"
444
520
  echo "README 等 : $(wc -l < "$TMP/doc_files.txt" | tr -d ' ') 个"
445
521
  echo "DDL 提取 : source=$DDL_SOURCE, tables=$DDL_TABLE_COUNT"
522
+ echo "git 仓库 : is_repo=$IS_GIT_REPO, 子仓库=$SUB_REPO_COUNT, submodule=$SUBMODULE_COUNT"
446
523
  echo "================================================="
447
524
  } >&2
448
525
 
@@ -0,0 +1,60 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ > 本文件由 team-flow `workflow-bootstrap` B4.5 阶段生成(参考 Claude Code /init)。
6
+ > 维护原则:索引级 + 结构级,简明扼要——删除某条后 Claude 是否会犯错?不会就删掉。
7
+
8
+ ## 项目概况
9
+
10
+ {{PROJECT_SUMMARY}}
11
+ <!-- 语言 / 框架 / 构建工具 / 数据库,2-3 行。来源:B1 technology 维度 -->
12
+
13
+ ## 开发命令
14
+
15
+ {{DEV_COMMANDS}}
16
+ <!-- 构建/测试/lint 命令,只列非标准的(如 mvn 单测、特殊 env)。来源:B1 侦察 + README -->
17
+
18
+ ## 工作区结构
19
+
20
+ {{WORKSPACE_TREE}}
21
+ <!-- 简化目录树(≤3 层),只标注关键目录用途。来源:B1 directory_tree -->
22
+
23
+ ## Git 仓库结构
24
+
25
+ {{GIT_STRUCTURE}}
26
+ <!-- 子仓库清单 + 类型(nested/submodule) + 用途 + 提交/推送顺序约束。来源:B1 git-structure 维度 -->
27
+
28
+ ## 产物结构(team-flow)
29
+
30
+ team-flow 工作流在 `changes/<name>/` 下通过状态机驱动变更,核心制品如下:
31
+
32
+ ### 代码强制执行的制品(state-loader.mjs + hash.mjs 校验)
33
+
34
+ | 产物 | 路径 | 校验机制 |
35
+ |------|------|---------|
36
+ | 状态文件 | `changes/<name>/.team-flow.yaml` | state-loader 硬编码 `STATE_FILE` |
37
+ | 提案 | `changes/<name>/proposal.md` | hash.mjs → `artifacts_hash` |
38
+ | 规格 | `changes/<name>/specs/*.md` | hash.mjs → `artifacts_hash` |
39
+ | 设计 | `changes/<name>/design.md` | hash.mjs → `artifacts_hash` |
40
+ | 任务 | `changes/<name>/tasks.md` | hash.mjs → `artifacts_hash` |
41
+ | 执行契约 | `changes/<name>/execution-contract.md` | hash.mjs → `contract_hash` |
42
+
43
+ ### 设计层面约定的制品(SKILL.md 文档引用,无代码强制校验)
44
+
45
+ | 产物 | 路径 | 状态 |
46
+ |------|------|------|
47
+ | 产品级 PRD | `prd/vN/prd.md` | ce-brainstorm 引用 |
48
+ | 产品级计划 | `prd/vN/plan.md` | ce-plan 引用 |
49
+ | 变更简报 | `changes/<name>/change-brief.md` | orchestrator S4 产出,hash 显式排除 |
50
+ | 架构设计 | `changes/<name>/architecture/{architecture,database,api}.md` | hash 纳入 artifacts_hash |
51
+ | 需求注册表 | `.team-flow/registry.yaml` | workflow-orchestrator 引用 |
52
+ | 全局架构基线 | `docs/architecture/baseline.md` | workflow-bootstrap 引用 |
53
+ | 项目架构基线标记 | `.team-flow/arch-state.json` | `tf arch init` 打戳 |
54
+
55
+ > 架构文档详细内容见 `@docs/architecture/baseline.md`(全局基线)和 `@docs/architecture/`(ARCHITECTURE.md / DATABASE.md / API-INDEX.md / INDEX.md)。
56
+
57
+ ## Git 管理规则
58
+
59
+ {{GIT_MANAGEMENT_RULES}}
60
+ <!-- 提交/推送顺序约束 + 子仓库操作规则。来源:B1 git-structure 维度 + 项目约定 -->