@xulthekl/team-flow 0.22.4 → 0.24.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 (72) 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 +3 -2
  9. package/CHANGELOG.md +103 -0
  10. package/GEMINI.md +1 -1
  11. package/HANDOFF.md +123 -98
  12. package/INSTALL.md +1 -1
  13. package/README.md +1 -1
  14. package/docs/README_en.md +1 -1
  15. package/docs/solutions/INDEX.md +5 -0
  16. package/docs/solutions/cross-phase/2026-07-28-no-summary.md +17 -0
  17. package/gemini-extension.json +1 -1
  18. package/hooks/pre-tool-use-guard +9 -9
  19. package/hooks/session-start +2 -2
  20. package/llms.txt +1 -1
  21. package/package.json +1 -1
  22. package/plugin.json +1 -1
  23. package/scripts/guard/checks/arch-design.mjs +79 -0
  24. package/scripts/guard/checks/compound-captured.mjs +70 -0
  25. package/scripts/guard/guard.mjs +6 -2
  26. package/scripts/lib/arch-merge.mjs +459 -0
  27. package/scripts/lib/cmd-state.mjs +5 -0
  28. package/scripts/lib/hash.mjs +18 -0
  29. package/scripts/lib/solutions-promote.mjs +1 -1
  30. package/scripts/lib/state-loader.mjs +16 -0
  31. package/scripts/team-flow.mjs +3 -0
  32. package/skills/architecture-design/SKILL.md +42 -3
  33. package/skills/architecture-design/templates/api.md +71 -0
  34. package/skills/architecture-design/templates/architecture.md +82 -0
  35. package/skills/architecture-design/templates/change-brief.md +29 -0
  36. package/skills/architecture-design/templates/database.md +69 -0
  37. package/skills/architecture-design/templates/index.md +33 -0
  38. package/skills/architecture-design/templates/physical-model.md +93 -0
  39. package/skills/bug-investigator/SKILL.md +1 -1
  40. package/skills/build-executor/SKILL.md +23 -19
  41. package/skills/build-executor/implementer-prompt.md +1 -1
  42. package/skills/build-executor/references/execution-modes.md +6 -6
  43. package/skills/build-executor/task-reviewer-prompt.md +1 -1
  44. package/skills/ce-brainstorm/SKILL.md +6 -0
  45. package/skills/code-reviewer/SKILL.md +6 -2
  46. package/skills/code-reviewer/code-reviewer-prompt.md +1 -1
  47. package/skills/contract-builder/SKILL.md +6 -6
  48. package/skills/need-explorer/SKILL.md +2 -2
  49. package/skills/release-archivist/SKILL.md +25 -12
  50. package/skills/release-archivist/references/closing-procedures.md +8 -8
  51. package/skills/spec-merger/SKILL.md +2 -2
  52. package/skills/spec-writer/SKILL.md +11 -9
  53. package/skills/workflow-bootstrap/SKILL.md +39 -5
  54. package/skills/workflow-bootstrap/references/b1-reconnaissance.md +22 -1
  55. package/skills/workflow-bootstrap/scripts/recon-probe.sh +122 -1
  56. package/skills/workflow-orchestrator/references/s2-prd-prototype-loop.md +1 -1
  57. package/skills/workflow-orchestrator/references/s4-split-validate.md +1 -1
  58. package/skills/workflow-orchestrator/references/s5-monitoring.md +1 -1
  59. package/skills/workflow-start/SKILL.md +44 -16
  60. package/skills/workflow-start/references/routing-rules.md +17 -17
  61. package/templates/api.md +177 -0
  62. package/templates/architecture.md +122 -0
  63. package/templates/change-brief.md +24 -0
  64. package/templates/database.md +114 -0
  65. package/tests/lib/guard-compound-captured.test.mjs +92 -0
  66. package/tests/lib/guard-specs-merged.test.mjs +2 -0
  67. package/tests/lib/guard-tests-passing.test.mjs +2 -0
  68. package/tests/lib/guard.test.mjs +2 -0
  69. package/tests/lib/solutions-capture.test.mjs +108 -0
  70. package/tests/lib/solutions-index-gen.test.mjs +147 -0
  71. package/tests/lib/solutions-inject.test.mjs +115 -0
  72. package/tests/lib/solutions-promote.test.mjs +200 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "team-flow",
3
3
  "description": "Unified workflow plugin: team-flow (spec-driven dev) + compound-engineering core subset + architecture-design (4A/DDD) + prototype (local HTML). 17 skills, one install.",
4
- "version": "0.22.4",
4
+ "version": "0.24.0",
5
5
  "contextFileName": "GEMINI.md"
6
6
  }
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env bash
2
2
  #
3
- # pre-tool-use-guard — spec-superflow implementation-edit state guard (PreToolUse)
3
+ # pre-tool-use-guard — team-flow implementation-edit state guard (PreToolUse)
4
4
  #
5
5
  # ----------------------------------------------------------------------------
6
6
  # Purpose
7
7
  # ----------------------------------------------------------------------------
8
8
  # Blocks Write/Edit/MultiEdit implementation edits unless the active
9
- # spec-superflow change is in a state that permits building. This enforces the
9
+ # team-flow change is in a state that permits building. This enforces the
10
10
  # state-machine rule that "no implementation is allowed" outside the
11
11
  # build-permitted states (exploring / specifying / bridging must finish and be
12
12
  # approved before any code is written).
@@ -15,8 +15,8 @@
15
15
  # Guard logic
16
16
  # ----------------------------------------------------------------------------
17
17
  # 1. Walk up from $PWD (current dir + max 3 parent levels) looking for
18
- # `.spec-superflow.yaml`.
19
- # - Not found -> ALLOW (no active spec-superflow change in scope).
18
+ # `.team-flow.yaml`.
19
+ # - Not found -> ALLOW (no active team-flow change in scope).
20
20
  # 2. Read the current workflow state from the `state:` line of the yaml.
21
21
  # 3. For Write/Edit/MultiEdit only:
22
22
  # - state in {approved-for-build, executing, debugging} -> ALLOW
@@ -73,13 +73,13 @@ case "$TOOL_NAME" in
73
73
  *) allow ;; # anything else — allow
74
74
  esac
75
75
 
76
- # --- locate .spec-superflow.yaml (cwd + max 3 parent levels) ---------------
76
+ # --- locate .team-flow.yaml (cwd + max 3 parent levels) ---------------
77
77
  dir="$PWD"
78
78
  yaml=""
79
79
  i=0
80
80
  while [ "$i" -le 3 ]; do
81
- if [ -f "$dir/.spec-superflow.yaml" ]; then
82
- yaml="$dir/.spec-superflow.yaml"
81
+ if [ -f "$dir/.team-flow.yaml" ]; then
82
+ yaml="$dir/.team-flow.yaml"
83
83
  break
84
84
  fi
85
85
  [ "$dir" = "/" ] && break # reached filesystem root
@@ -87,7 +87,7 @@ while [ "$i" -le 3 ]; do
87
87
  i=$((i + 1))
88
88
  done
89
89
 
90
- # No active spec-superflow change in scope -> allow.
90
+ # No active team-flow change in scope -> allow.
91
91
  [ -n "$yaml" ] || allow
92
92
  [ -r "$yaml" ] || allow
93
93
 
@@ -107,7 +107,7 @@ case "$state" in
107
107
  allow
108
108
  ;;
109
109
  *)
110
- reason="spec-superflow guard: implementation edits (Write/Edit/MultiEdit) are blocked while the change is in state '$state'. Edits are only allowed in states: approved-for-build, executing, debugging. Advance the workflow to an approved build state first (see docs/state-machine.md or /spec-superflow:workflow-start). If no change is actually active, remove or fix the stray .spec-superflow.yaml."
110
+ reason="team-flow guard: implementation edits (Write/Edit/MultiEdit) are blocked while the change is in state '$state'. Edits are only allowed in states: approved-for-build, executing, debugging. Advance the workflow to an approved build state first (see docs/state-machine.md or /team-flow:workflow-start). If no change is actually active, remove or fix the stray .team-flow.yaml."
111
111
  # Escape backslashes and double quotes for safe JSON string embedding.
112
112
  reason_esc="$(printf '%s' "$reason" | sed 's/\\/\\\\/g; s/"/\\"/g')"
113
113
  printf '{"decision":"block","reason":"%s"}\n' "$reason_esc"
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bash
2
- # v0.22.4: conditional injection — detects artifacts, injects workflow-start pointer
3
- msg="<EXTREMELY_IMPORTANT>\nYou have spec-superflow installed. Use /spec-superflow:workflow-start ONLY when you detect an active spec-superflow change in the workspace (look for \`.spec-superflow.yaml\`, \`proposal.md\`, \`execution-contract.md\`, or \`specs/\` directories), OR when the user explicitly invokes it by name. For ordinary coding tasks without spec-superflow artifacts, do NOT invoke workflow-start — just handle the request directly.\n</EXTREMELY_IMPORTANT>"
2
+ # v0.24.0: conditional injection — detects artifacts, injects workflow-start pointer
3
+ msg="<EXTREMELY_IMPORTANT>\nYou have team-flow installed. Use /team-flow:workflow-start ONLY when you detect an active team-flow change in the workspace (look for \`.team-flow.yaml\`, \`proposal.md\`, \`execution-contract.md\`, or \`specs/\` directories), OR when the user explicitly invokes it by name. For ordinary coding tasks without team-flow artifacts, do NOT invoke workflow-start — just handle the request directly.\n</EXTREMELY_IMPORTANT>"
4
4
 
5
5
  # Three platforms share the same message, only output format differs.
6
6
  if [ -n "${CURSOR_PLUGIN_ROOT:-}" ]; then
package/llms.txt CHANGED
@@ -3,7 +3,7 @@
3
3
  ## Overview
4
4
  spec-superflow is a self-contained workflow integration plugin for Claude Code, Cursor, OpenAI Codex CLI/App, GitHub Copilot CLI, Gemini CLI, OpenCode, WorkBuddy, and Trae. It merges spec-driven planning artifacts (proposal, specs, design, tasks) with disciplined execution guardrails (TDD, review gates, controlled handoff) into one unified workflow.
5
5
 
6
- Current version: v0.22.4.
6
+ Current version: v0.24.0.
7
7
 
8
8
  ## Key Documents
9
9
  - README.md: Chinese homepage with full usage guide and FAQ
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xulthekl/team-flow",
3
- "version": "0.22.4",
3
+ "version": "0.24.0",
4
4
  "description": "Unified plugin (23 skills + 8 agents) integrating team-flow, compound-engineering, architecture-design, prototype, design-system, workflow-orchestrator, workflow-bootstrap, e2e, session-handoff, workflow-feedback for multi-agent coding tools.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "team-flow",
3
- "version": "0.22.4",
3
+ "version": "0.24.0",
4
4
  "description": "Unified workflow plugin: team-flow (spec-driven dev: TDD/SDD/code-review/debugging) + compound-engineering core subset (brainstorm/plan/compound/strategy/ideate/proof, global compounding) + architecture-design (4A+DDD incremental design & global compounding) + prototype (local HTML prototype, zero external deps) + e2e (Playwright E2E, AC-driven) + workflow-orchestrator (product-level workflow orchestration) + workflow-bootstrap (existing project onboarding) + session-handoff (context transfer) + workflow-feedback (issue tracking). 23 skills + 8 agents, one install.",
5
5
  "author": {
6
6
  "name": "LT"
@@ -0,0 +1,79 @@
1
+ // scripts/guard/checks/arch-design.mjs — architecture-design artifacts guard
2
+ // v0.23.0 §30: 架构设计门控——exploring:specifying 增加 arch 维度
3
+ //
4
+ // 规则:
5
+ // - arch_design_decision == "required" → architecture/*.md 必须存在且非空
6
+ // - arch_design_decision == "skipped" → arch_design_reason 非空(advisory,不阻断)
7
+ // - arch_design_decision == null → 未执行 architecture-design,不阻断(向后兼容)
8
+
9
+ import fs from 'node:fs';
10
+ import path from 'node:path';
11
+
12
+ /**
13
+ * 从 .team-flow.yaml 提取顶层字段值(简单正则,与 state-loader 兼容)
14
+ */
15
+ function extractYamlField(content, field) {
16
+ for (const line of content.split('\n')) {
17
+ const match = line.match(new RegExp(`^${field}:\\s*(.*)`));
18
+ if (match) {
19
+ const val = match[1].trim();
20
+ return val === 'null' || val === '' ? null : val;
21
+ }
22
+ }
23
+ return null;
24
+ }
25
+
26
+ /**
27
+ * Check architecture-design artifacts for the exploring:specifying transition.
28
+ *
29
+ * @param {string} changeDir - change directory path
30
+ * @returns {{ pass: boolean, failures: string[] }}
31
+ */
32
+ export function checkArchDesign(changeDir) {
33
+ const failures = [];
34
+ const stateFile = path.join(changeDir, '.team-flow.yaml');
35
+
36
+ // 无状态文件 → 不阻断(向后兼容存量 change)
37
+ if (!fs.existsSync(stateFile)) {
38
+ return { pass: true, failures: [] };
39
+ }
40
+
41
+ const raw = fs.readFileSync(stateFile, 'utf-8');
42
+ const decision = extractYamlField(raw, 'arch_design_decision');
43
+
44
+ // 未执行 architecture-design(null)→ 不阻断,向后兼容
45
+ if (!decision) {
46
+ return { pass: true, failures: [] };
47
+ }
48
+
49
+ // skipped → 检查 reason 非空(advisory,不阻断)
50
+ if (decision === 'skipped') {
51
+ const reason = extractYamlField(raw, 'arch_design_reason');
52
+ if (!reason) {
53
+ // advisory: 输出 warning 但不加入 failures
54
+ console.warn(' [WARN] arch-design: arch_design_decision=skipped but arch_design_reason is empty');
55
+ }
56
+ return { pass: true, failures: [] };
57
+ }
58
+
59
+ // required → 检查 architecture/*.md 存在且非空
60
+ if (decision === 'required') {
61
+ const archDir = path.join(changeDir, 'architecture');
62
+ if (!fs.existsSync(archDir)) {
63
+ failures.push('architecture/: directory missing (arch_design_decision=required)');
64
+ return { pass: false, failures };
65
+ }
66
+
67
+ const requiredFiles = ['architecture.md', 'database.md', 'api.md'];
68
+ for (const f of requiredFiles) {
69
+ const fp = path.join(archDir, f);
70
+ if (!fs.existsSync(fp)) {
71
+ failures.push(`architecture/${f}: missing (arch_design_decision=required)`);
72
+ } else if (fs.readFileSync(fp, 'utf-8').trim().length === 0) {
73
+ failures.push(`architecture/${f}: empty (arch_design_decision=required)`);
74
+ }
75
+ }
76
+ }
77
+
78
+ return { pass: failures.length === 0, failures };
79
+ }
@@ -0,0 +1,70 @@
1
+ // scripts/guard/checks/compound-captured.mjs — compound engineering capture guard
2
+ // v0.24.0: 复利贯穿强制化——executing:closing 增加 compound-captured 维度
3
+ //
4
+ // 规则:
5
+ // - learnings.md 存在且非空 → pass(已记录经验)
6
+ // - compound_skipped === true → pass(显式豁免,用户主动跳过)
7
+ // - workflow === 'tweak' → 不进入本检查器(由 WORKFLOW_TRANSITION_CHECKS 豁免)
8
+ // - 其他情况 → fail(提示用户执行 tf solutions capture 或显式 skip)
9
+ //
10
+ // 设计原则:
11
+ // - 与 arch-design 检查器同属"产物存在性"维度,不涉及内容质量评审
12
+ // - 只检查 learnings.md 存在,不验证 frontmatter 格式(advisory 由 ce-compound 保证)
13
+ // - 显式 skip 必须通过 state 字段(`tf state set compound_skipped true`),防止遗忘
14
+
15
+ import fs from 'node:fs';
16
+ import path from 'node:path';
17
+
18
+ /**
19
+ * 从 .team-flow.yaml 提取顶层字段值(与 arch-design.mjs 同源模式)
20
+ */
21
+ function extractYamlField(content, field) {
22
+ for (const line of content.split('\n')) {
23
+ const match = line.match(new RegExp(`^${field}:\\s*(.*)`));
24
+ if (match) {
25
+ const val = match[1].trim();
26
+ return val === 'null' || val === '' ? null : val;
27
+ }
28
+ }
29
+ return null;
30
+ }
31
+
32
+ /**
33
+ * Check compound engineering capture for the executing:closing transition.
34
+ *
35
+ * @param {string} changeDir - change directory path
36
+ * @returns {{ pass: boolean, failures: string[] }}
37
+ */
38
+ export function checkCompoundCaptured(changeDir) {
39
+ const failures = [];
40
+
41
+ // 1. 检查 learnings.md 存在且非空
42
+ const learningsPath = path.join(changeDir, 'learnings.md');
43
+ if (fs.existsSync(learningsPath)) {
44
+ const content = fs.readFileSync(learningsPath, 'utf-8').trim();
45
+ if (content.length > 0) {
46
+ return { pass: true, failures: [] };
47
+ }
48
+ // 文件存在但为空,视为未捕获
49
+ failures.push('learnings.md exists but is empty — run `tf solutions capture` or populate with session learnings');
50
+ return { pass: false, failures };
51
+ }
52
+
53
+ // 2. 检查显式豁免(compound_skipped === true)
54
+ const stateFile = path.join(changeDir, '.team-flow.yaml');
55
+ if (fs.existsSync(stateFile)) {
56
+ const raw = fs.readFileSync(stateFile, 'utf-8');
57
+ const skipped = extractYamlField(raw, 'compound_skipped');
58
+ if (skipped === 'true') {
59
+ return { pass: true, failures: [] };
60
+ }
61
+ }
62
+
63
+ // 3. 未捕获且未豁免 → fail
64
+ failures.push(
65
+ 'Compound capture missing: no learnings.md found in change directory. ' +
66
+ 'Run `tf solutions capture --phase review --domain <d> --type insight --severity medium --summary "..."` ' +
67
+ 'to document session learnings, or `tf state set compound_skipped true` to explicitly skip.'
68
+ );
69
+ return { pass: false, failures };
70
+ }
@@ -8,19 +8,21 @@ import { checkTestsPassing } from './checks/tests-passing.mjs';
8
8
  import { checkContractFresh } from './checks/contract-fresh.mjs';
9
9
  import { check as checkDpGate } from './checks/dp-gate-passed.mjs';
10
10
  import { checkSpecsMerged } from './checks/specs-merged.mjs';
11
+ import { checkArchDesign } from './checks/arch-design.mjs';
11
12
  import { checkContractCurrent } from './checks/contract-current.mjs';
12
13
  import { checkDp3Approved } from './checks/dp3-approved.mjs';
13
14
  import { checkExecutionPlanReady } from './checks/execution-plan-ready.mjs';
14
15
  import { checkExecutionReviewsPassed } from './checks/execution-reviews-passed.mjs';
16
+ import { checkCompoundCaptured } from './checks/compound-captured.mjs';
15
17
 
16
18
  // Transition matrix: <from>:<to> → required check dimensions
17
19
  const TRANSITION_CHECKS = {
18
20
  // Forward transitions
19
- 'exploring:specifying': ['artifacts-exist'],
21
+ 'exploring:specifying': ['artifacts-exist', 'arch-design'],
20
22
  'specifying:bridging': ['artifacts-exist', 'schema-valid'],
21
23
  'bridging:approved-for-build': ['artifacts-exist', 'schema-valid', 'contract-fresh', 'dp-gate-passed'],
22
24
  'approved-for-build:executing': ['artifacts-exist', 'contract-fresh', 'dp-gate-passed', 'execution-plan-ready'],
23
- 'executing:closing': ['tasks-complete', 'tests-passing', 'specs-merged', 'execution-plan-ready', 'execution-reviews-passed'],
25
+ 'executing:closing': ['tasks-complete', 'tests-passing', 'specs-merged', 'execution-plan-ready', 'execution-reviews-passed', 'compound-captured'],
24
26
 
25
27
  // Debugging side-path
26
28
  'executing:debugging': [],
@@ -163,6 +165,8 @@ async function main() {
163
165
  'dp3-approved': (dir) => checkDp3Approved(dir),
164
166
  'execution-plan-ready': (dir) => checkExecutionPlanReady(dir),
165
167
  'execution-reviews-passed': (dir) => checkExecutionReviewsPassed(dir),
168
+ 'arch-design': (dir) => checkArchDesign(dir),
169
+ 'compound-captured': (dir) => checkCompoundCaptured(dir),
166
170
  };
167
171
 
168
172
  const checks = [];