@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.
- package/.claude/always/phase-guard.md +1 -1
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/.cursor-plugin/marketplace.json +1 -1
- package/.cursor-plugin/plugin.json +1 -1
- package/.github/plugin/marketplace.json +2 -2
- package/AGENTS.md +3 -2
- package/CHANGELOG.md +103 -0
- package/GEMINI.md +1 -1
- package/HANDOFF.md +123 -98
- package/INSTALL.md +1 -1
- package/README.md +1 -1
- package/docs/README_en.md +1 -1
- package/docs/solutions/INDEX.md +5 -0
- package/docs/solutions/cross-phase/2026-07-28-no-summary.md +17 -0
- package/gemini-extension.json +1 -1
- package/hooks/pre-tool-use-guard +9 -9
- package/hooks/session-start +2 -2
- package/llms.txt +1 -1
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/scripts/guard/checks/arch-design.mjs +79 -0
- package/scripts/guard/checks/compound-captured.mjs +70 -0
- package/scripts/guard/guard.mjs +6 -2
- package/scripts/lib/arch-merge.mjs +459 -0
- package/scripts/lib/cmd-state.mjs +5 -0
- package/scripts/lib/hash.mjs +18 -0
- package/scripts/lib/solutions-promote.mjs +1 -1
- package/scripts/lib/state-loader.mjs +16 -0
- package/scripts/team-flow.mjs +3 -0
- package/skills/architecture-design/SKILL.md +42 -3
- package/skills/architecture-design/templates/api.md +71 -0
- package/skills/architecture-design/templates/architecture.md +82 -0
- package/skills/architecture-design/templates/change-brief.md +29 -0
- package/skills/architecture-design/templates/database.md +69 -0
- package/skills/architecture-design/templates/index.md +33 -0
- package/skills/architecture-design/templates/physical-model.md +93 -0
- package/skills/bug-investigator/SKILL.md +1 -1
- package/skills/build-executor/SKILL.md +23 -19
- package/skills/build-executor/implementer-prompt.md +1 -1
- package/skills/build-executor/references/execution-modes.md +6 -6
- package/skills/build-executor/task-reviewer-prompt.md +1 -1
- package/skills/ce-brainstorm/SKILL.md +6 -0
- package/skills/code-reviewer/SKILL.md +6 -2
- package/skills/code-reviewer/code-reviewer-prompt.md +1 -1
- package/skills/contract-builder/SKILL.md +6 -6
- package/skills/need-explorer/SKILL.md +2 -2
- package/skills/release-archivist/SKILL.md +25 -12
- package/skills/release-archivist/references/closing-procedures.md +8 -8
- package/skills/spec-merger/SKILL.md +2 -2
- package/skills/spec-writer/SKILL.md +11 -9
- package/skills/workflow-bootstrap/SKILL.md +39 -5
- package/skills/workflow-bootstrap/references/b1-reconnaissance.md +22 -1
- package/skills/workflow-bootstrap/scripts/recon-probe.sh +122 -1
- package/skills/workflow-orchestrator/references/s2-prd-prototype-loop.md +1 -1
- package/skills/workflow-orchestrator/references/s4-split-validate.md +1 -1
- package/skills/workflow-orchestrator/references/s5-monitoring.md +1 -1
- package/skills/workflow-start/SKILL.md +44 -16
- package/skills/workflow-start/references/routing-rules.md +17 -17
- package/templates/api.md +177 -0
- package/templates/architecture.md +122 -0
- package/templates/change-brief.md +24 -0
- package/templates/database.md +114 -0
- package/tests/lib/guard-compound-captured.test.mjs +92 -0
- package/tests/lib/guard-specs-merged.test.mjs +2 -0
- package/tests/lib/guard-tests-passing.test.mjs +2 -0
- package/tests/lib/guard.test.mjs +2 -0
- package/tests/lib/solutions-capture.test.mjs +108 -0
- package/tests/lib/solutions-index-gen.test.mjs +147 -0
- package/tests/lib/solutions-inject.test.mjs +115 -0
- package/tests/lib/solutions-promote.test.mjs +200 -0
|
@@ -93,7 +93,7 @@ Subagent (general-purpose):
|
|
|
93
93
|
report path. End with the exact receipt command:
|
|
94
94
|
|
|
95
95
|
```bash
|
|
96
|
-
npx --yes --package @xulthekl/team-flow@0.
|
|
96
|
+
npx --yes --package @xulthekl/team-flow@0.24.0 tf execution review <change-dir> --wave [WAVE_ID] --base [BASE_SHA] --head [HEAD_SHA] --report [REVIEW_REPORT_FILE] --verdict <pass|fail>
|
|
97
97
|
```
|
|
98
98
|
|
|
99
99
|
Use `fail` when any Critical or Important finding remains. A repair needs
|
|
@@ -5,9 +5,9 @@ description: Convert approved planning artifacts into an execution contract. Inv
|
|
|
5
5
|
|
|
6
6
|
# Contract Builder
|
|
7
7
|
|
|
8
|
-
Converts planning artifacts into a single execution handshake: `execution-contract.md`. Load the baseline with `npx --yes --package @xulthekl/team-flow@0.
|
|
8
|
+
Converts planning artifacts into a single execution handshake: `execution-contract.md`. Load the baseline with `npx --yes --package @xulthekl/team-flow@0.24.0 tf runtime asset read templates/execution-contract.md`.
|
|
9
9
|
|
|
10
|
-
Read before generating: `proposal.md`, `specs/`, `design.md`, `tasks.md`, then load `docs/artifact-contract.md` with `npx --yes --package @xulthekl/team-flow@0.
|
|
10
|
+
Read before generating: `proposal.md`, `specs/`, `design.md`, `tasks.md`, then load `docs/artifact-contract.md` with `npx --yes --package @xulthekl/team-flow@0.24.0 tf runtime asset read docs/artifact-contract.md`.
|
|
11
11
|
|
|
12
12
|
**Architecture Design Outputs (v0.9 §26)**: 若 `architecture/` 目录存在,同时读取 `architecture/architecture.md` / `database.md` / `api.md`,作为执行契约的架构约束补充输入——确保 execution-contract.md 的 Implementation Constraints 段包含架构设计的关键约束(聚合边界/CQRS 分流/API 契约/schema 变更)。`architecture/` 不存在时跳过。
|
|
13
13
|
|
|
@@ -38,8 +38,8 @@ Must make obvious: approved behavior, out-of-scope, constraints, batches, test o
|
|
|
38
38
|
|
|
39
39
|
After drafting: summarize handoff rules, identify ambiguity, flag unmapped requirements, ask user to approve explicitly. After approval:
|
|
40
40
|
```bash
|
|
41
|
-
npx --yes --package @xulthekl/team-flow@0.
|
|
42
|
-
npx --yes --package @xulthekl/team-flow@0.
|
|
41
|
+
npx --yes --package @xulthekl/team-flow@0.24.0 tf state set <change-dir> dp_3_result "approved: <summary>"
|
|
42
|
+
npx --yes --package @xulthekl/team-flow@0.24.0 tf state set <change-dir> dp_3_timestamp $(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
43
43
|
```
|
|
44
44
|
DP-3 is a hard gate — no implementation without this record.
|
|
45
45
|
|
|
@@ -60,9 +60,9 @@ Generate minimal contract: Intent Lock (one sentence), Task List (numbered), App
|
|
|
60
60
|
|
|
61
61
|
## Post-Generation
|
|
62
62
|
|
|
63
|
-
Run `npx --yes --package @xulthekl/team-flow@0.
|
|
63
|
+
Run `npx --yes --package @xulthekl/team-flow@0.24.0 tf state init <change-dir>` to create `.team-flow.yaml` with hashes.
|
|
64
64
|
|
|
65
|
-
For hotfix, after writing the minimal contract, run `npx --yes --package @xulthekl/team-flow@0.
|
|
65
|
+
For hotfix, after writing the minimal contract, run `npx --yes --package @xulthekl/team-flow@0.24.0 tf state init <change-dir>` or `npx --yes --package @xulthekl/team-flow@0.24.0 tf state rebuild <change-dir>` so `contract_hash` is recorded. DP-3 remains mandatory before build.
|
|
66
66
|
|
|
67
67
|
## Exception Handling
|
|
68
68
|
|
|
@@ -41,8 +41,8 @@ Restate what you heard: "Here's what I'm hearing: [problem, scope, non-goals, su
|
|
|
41
41
|
|
|
42
42
|
After user confirms the summary:
|
|
43
43
|
```bash
|
|
44
|
-
npx --yes --package @xulthekl/team-flow@0.
|
|
45
|
-
npx --yes --package @xulthekl/team-flow@0.
|
|
44
|
+
npx --yes --package @xulthekl/team-flow@0.24.0 tf state set <change-dir> dp_1_result "confirmed: <one-line summary>"
|
|
45
|
+
npx --yes --package @xulthekl/team-flow@0.24.0 tf state set <change-dir> dp_1_timestamp $(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
46
46
|
```
|
|
47
47
|
DP-1 confirms scope, non-goals, and success criteria before artifact creation.
|
|
48
48
|
|
|
@@ -48,6 +48,7 @@ Check for files modified outside scope fence, new dependencies not in design. Un
|
|
|
48
48
|
| Correctness | PASS/FAIL/WARN | [list] |
|
|
49
49
|
| Coherence | PASS/FAIL/WARN | [list] |
|
|
50
50
|
|
|
51
|
+
- **Architecture merge**: <merged architecture.md + database.md + api.md + N SQL scripts to docs/architecture/ | architecture/ absent — skipped>
|
|
51
52
|
- **Prototype sync**: <synced N pages / N components / design-system updated | no UX delta | conflicts: N>
|
|
52
53
|
- **Compound promotion**: <promoted N learnings / updated N confirmed patterns | no learnings>
|
|
53
54
|
|
|
@@ -71,12 +72,12 @@ If an `e2e/` suite exists for the change, fold its report into verification (see
|
|
|
71
72
|
- Scope added without artifact updates?
|
|
72
73
|
- Unresolved blockers or known risks?
|
|
73
74
|
- Delta specs exist that need merging?
|
|
74
|
-
- Run `npx --yes --package @xulthekl/team-flow@0.
|
|
75
|
+
- Run `npx --yes --package @xulthekl/team-flow@0.24.0 tf audit <change-dir>` — include `decision-point-audit.md` in archive
|
|
75
76
|
|
|
76
77
|
### DP-6 (Verification Outcome)
|
|
77
78
|
```bash
|
|
78
|
-
npx --yes --package @xulthekl/team-flow@0.
|
|
79
|
-
npx --yes --package @xulthekl/team-flow@0.
|
|
79
|
+
npx --yes --package @xulthekl/team-flow@0.24.0 tf state set <change-dir> dp_6_result "<pass|conditional|fail>: <summary>"
|
|
80
|
+
npx --yes --package @xulthekl/team-flow@0.24.0 tf state set <change-dir> dp_6_timestamp $(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
80
81
|
```
|
|
81
82
|
If FAIL, do NOT proceed to DP-7. Route back or ask about abandonment.
|
|
82
83
|
|
|
@@ -84,13 +85,13 @@ After recording a PASS outcome, also record it as the verification gate so the
|
|
|
84
85
|
`executing → closing` transition is allowed (the guard accepts either
|
|
85
86
|
`test_result: pass` or a `dp_6_result` starting with `pass`):
|
|
86
87
|
```bash
|
|
87
|
-
npx --yes --package @xulthekl/team-flow@0.
|
|
88
|
+
npx --yes --package @xulthekl/team-flow@0.24.0 tf state set <change-dir> test_result pass
|
|
88
89
|
```
|
|
89
90
|
|
|
90
91
|
### DP-7 (Archive Confirmation)
|
|
91
92
|
```bash
|
|
92
|
-
npx --yes --package @xulthekl/team-flow@0.
|
|
93
|
-
npx --yes --package @xulthekl/team-flow@0.
|
|
93
|
+
npx --yes --package @xulthekl/team-flow@0.24.0 tf state set <change-dir> dp_7_result "confirmed: <archive summary>"
|
|
94
|
+
npx --yes --package @xulthekl/team-flow@0.24.0 tf state set <change-dir> dp_7_timestamp $(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
94
95
|
```
|
|
95
96
|
Verify DP-0 through DP-6 are recorded before DP-7.
|
|
96
97
|
|
|
@@ -100,17 +101,29 @@ If implementation diverged from the contract, return to `bridging` before closur
|
|
|
100
101
|
|
|
101
102
|
## Post-Verification
|
|
102
103
|
|
|
103
|
-
Run `npx --yes --package @xulthekl/team-flow@0.
|
|
104
|
+
Run `npx --yes --package @xulthekl/team-flow@0.24.0 tf state transition <change-dir> closing`. If delta specs exist, route to `spec-merger`.
|
|
105
|
+
|
|
106
|
+
### Architecture Merge (v0.10 §28-§31) — MUST run first
|
|
107
|
+
|
|
108
|
+
Merge change-level architecture artifacts to the global `docs/architecture/` baseline **before** any other post-verification step:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
npx --yes --package @xulthekl/team-flow@0.24.0 tf arch-merge <change-dir>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
This merges `architecture/{architecture,database,api}.md` and `architecture/sql/` into the global architecture docs. Skip silently when `architecture/` does not exist (architecture-design was `skipped`).
|
|
115
|
+
|
|
116
|
+
**Execution order (mandatory)**: `arch-merge` → `prototype-sync` → `compound promotion`. Do not parallelise — global docs must not be in a half-updated state.
|
|
104
117
|
|
|
105
118
|
### Prototype Sync (v0.5)
|
|
106
119
|
|
|
107
120
|
After `arch-merge` completes, run prototype-sync to merge UX deltas back to the global prototype:
|
|
108
121
|
|
|
109
122
|
```bash
|
|
110
|
-
npx --yes --package @xulthekl/team-flow@0.
|
|
123
|
+
npx --yes --package @xulthekl/team-flow@0.24.0 tf prototype-sync <change-dir>
|
|
111
124
|
```
|
|
112
125
|
|
|
113
|
-
**Write-back order (mandatory)**: `arch-merge` → `prototype-sync` must be executed **sequentially** within the same change closing. Do not run them in parallel — the global `docs/architecture/` and `prototype/` must not be in a half-updated state when the next change grounds on them.
|
|
126
|
+
**Write-back order (mandatory)**: `arch-merge` → `prototype-sync` → `compound promotion` must be executed **sequentially** within the same change closing. Do not run them in parallel — the global `docs/architecture/` and `prototype/` must not be in a half-updated state when the next change grounds on them.
|
|
114
127
|
|
|
115
128
|
If `prototype-sync` reports conflicts, list them in the closing summary and flag for manual resolution. Do not block closing on prototype-sync conflicts (advisory level).
|
|
116
129
|
|
|
@@ -119,7 +132,7 @@ If `prototype-sync` reports conflicts, list them in the closing summary and flag
|
|
|
119
132
|
During closing, promote change-level learnings to the global solutions library:
|
|
120
133
|
|
|
121
134
|
```bash
|
|
122
|
-
npx --yes --package @xulthekl/team-flow@0.
|
|
135
|
+
npx --yes --package @xulthekl/team-flow@0.24.0 tf solutions promote <change-dir>
|
|
123
136
|
```
|
|
124
137
|
|
|
125
138
|
This checks `specs/<cap>/learnings.md` for entries meeting promotion criteria:
|
|
@@ -139,7 +152,7 @@ Before finalizing the closing, check if this change produced any learnable momen
|
|
|
139
152
|
|
|
140
153
|
If any of the above occurred, capture the learning:
|
|
141
154
|
```bash
|
|
142
|
-
npx --yes --package @xulthekl/team-flow@0.
|
|
155
|
+
npx --yes --package @xulthekl/team-flow@0.24.0 tf solutions capture \
|
|
143
156
|
--phase cross-phase --domain <domain> --type pitfall \
|
|
144
157
|
--severity medium --summary "<what happened and how to prevent it>"
|
|
145
158
|
```
|
|
@@ -161,6 +174,6 @@ Verify files exist and are non-empty, run `node --check` on code files, skip 5-s
|
|
|
161
174
|
## Exception Handling
|
|
162
175
|
|
|
163
176
|
- **Parse failures**: Report exact file and section
|
|
164
|
-
- **Missing files**: If audit can't generate, run `npx --yes --package @xulthekl/team-flow@0.
|
|
177
|
+
- **Missing files**: If audit can't generate, run `npx --yes --package @xulthekl/team-flow@0.24.0 tf audit` manually
|
|
165
178
|
- **User interruption**: Re-run verification from the beginning on resume
|
|
166
179
|
- **DP gaps**: Flag missing DPs during DP-6; ask user whether to proceed or return
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
After `arch-merge` completes, run prototype-sync to merge UX deltas back to the global prototype:
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npx --yes --package @xulthekl/team-flow@0.
|
|
10
|
+
npx --yes --package @xulthekl/team-flow@0.24.0 tf prototype-sync <change-dir>
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
**Write-back order (mandatory)**: `arch-merge` → `prototype-sync` must be executed **sequentially** within the same change closing. Do not run them in parallel.
|
|
@@ -19,7 +19,7 @@ If `prototype-sync` reports conflicts, list them in the closing summary and flag
|
|
|
19
19
|
During closing, promote change-level learnings to the global solutions library:
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
npx --yes --package @xulthekl/team-flow@0.
|
|
22
|
+
npx --yes --package @xulthekl/team-flow@0.24.0 tf solutions promote <change-dir>
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
Promotion criteria:
|
|
@@ -39,7 +39,7 @@ Before finalizing the closing, check if this change produced any learnable momen
|
|
|
39
39
|
|
|
40
40
|
If any occurred, capture the learning:
|
|
41
41
|
```bash
|
|
42
|
-
npx --yes --package @xulthekl/team-flow@0.
|
|
42
|
+
npx --yes --package @xulthekl/team-flow@0.24.0 tf solutions capture \
|
|
43
43
|
--phase cross-phase --domain <domain> --type pitfall \
|
|
44
44
|
--severity medium --summary "<what happened and how to prevent it>"
|
|
45
45
|
```
|
|
@@ -49,22 +49,22 @@ Advisory — skip silently if no learnable moments detected.
|
|
|
49
49
|
## DP-6 (Verification Outcome)
|
|
50
50
|
|
|
51
51
|
```bash
|
|
52
|
-
npx --yes --package @xulthekl/team-flow@0.
|
|
53
|
-
npx --yes --package @xulthekl/team-flow@0.
|
|
52
|
+
npx --yes --package @xulthekl/team-flow@0.24.0 tf state set <change-dir> dp_6_result "<pass|conditional|fail>: <summary>"
|
|
53
|
+
npx --yes --package @xulthekl/team-flow@0.24.0 tf state set <change-dir> dp_6_timestamp $(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
If FAIL, do NOT proceed to DP-7. Route back or ask about abandonment.
|
|
57
57
|
|
|
58
58
|
After PASS, also record the verification gate:
|
|
59
59
|
```bash
|
|
60
|
-
npx --yes --package @xulthekl/team-flow@0.
|
|
60
|
+
npx --yes --package @xulthekl/team-flow@0.24.0 tf state set <change-dir> test_result pass
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
## DP-7 (Archive Confirmation)
|
|
64
64
|
|
|
65
65
|
```bash
|
|
66
|
-
npx --yes --package @xulthekl/team-flow@0.
|
|
67
|
-
npx --yes --package @xulthekl/team-flow@0.
|
|
66
|
+
npx --yes --package @xulthekl/team-flow@0.24.0 tf state set <change-dir> dp_7_result "confirmed: <archive summary>"
|
|
67
|
+
npx --yes --package @xulthekl/team-flow@0.24.0 tf state set <change-dir> dp_7_timestamp $(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
68
68
|
```
|
|
69
69
|
|
|
70
70
|
Verify DP-0 through DP-6 are recorded before DP-7.
|
|
@@ -10,7 +10,7 @@ After a change completes, delta specs (ADDED/MODIFIED/REMOVED/RENAMED) must be m
|
|
|
10
10
|
## Pre-Flight Checks
|
|
11
11
|
|
|
12
12
|
### Conflict Detection
|
|
13
|
-
Run `npx --yes --package @xulthekl/team-flow@0.
|
|
13
|
+
Run `npx --yes --package @xulthekl/team-flow@0.24.0 tf sync <change-dir>`. If conflicts are detected (same requirement modified by multiple changes), present the conflict list to the user for resolution order.
|
|
14
14
|
|
|
15
15
|
### Abandoned Change Guard
|
|
16
16
|
Check if the change is `abandoned`. If so → STOP: "Abandoned changes cannot be synced. Delta specs are preserved for reference but must not be merged."
|
|
@@ -55,7 +55,7 @@ Output sync report table: Capability, ADDED/MODIFIED/REMOVED/RENAMED counts, Sta
|
|
|
55
55
|
2. Change folder (including deltas) remains for traceability.
|
|
56
56
|
3. Record that merging is complete so the `executing → closing` guard allows closure:
|
|
57
57
|
```bash
|
|
58
|
-
npx --yes --package @xulthekl/team-flow@0.
|
|
58
|
+
npx --yes --package @xulthekl/team-flow@0.24.0 tf state set <change-dir> spec_merged true
|
|
59
59
|
```
|
|
60
60
|
(If the change had no delta sections, still set `spec_merged true` — there was nothing to merge.)
|
|
61
61
|
|
|
@@ -41,19 +41,21 @@ Read `docs/solutions/INDEX.md` if it exists. Filter entries where `phase = spec
|
|
|
41
41
|
若 `architecture/` 目录存在(本 change 经 workflow-start 的 architecture-design 判断门判定为 `required` 并产出了架构设计),读取以下文件作为 design.md / tasks.md 的架构约束输入:
|
|
42
42
|
|
|
43
43
|
- `architecture/architecture.md` → design.md `## Decisions` 的架构约束(聚合/限界上下文/CQRS 决策)
|
|
44
|
-
- `architecture/database.md` → design.md + tasks.md 的数据层约束(实体/读写模型/schema
|
|
45
|
-
- `architecture/api.md` → tasks.md
|
|
44
|
+
- `architecture/database.md` → design.md + tasks.md 的数据层约束(实体/读写模型/schema 变更);注意 database.md 引用 `architecture/sql/` 路径而非内嵌 DDL
|
|
45
|
+
- `architecture/api.md` → tasks.md 的接口路由约束(**架构路由表**:Command/Read/Query 分类,非详细 API 规格——详细规格由 Swagger 管理)
|
|
46
|
+
- `architecture/sql/ddl/*.sql` → tasks.md 数据层任务的 DDL 脚本约束(可执行建表/改表脚本)
|
|
47
|
+
- `architecture/sql/migration/*.sql` → tasks.md 数据层任务的数据迁移约束
|
|
46
48
|
|
|
47
49
|
**约束传递规则**:
|
|
48
50
|
- design.md 的 `## Decisions` 段必须**引用** architecture/ 中的架构决策,不得与之矛盾
|
|
49
|
-
- tasks.md 的接口定义(Interfaces 段)必须与 `architecture/api.md`
|
|
50
|
-
- tasks.md 的数据层任务必须与 `architecture/database.md` 的 schema
|
|
51
|
+
- tasks.md 的接口定义(Interfaces 段)必须与 `architecture/api.md` 的架构路由表(Command/Read/Query 分类)对齐——详细 API 规格由 Swagger 管理,api.md 不含
|
|
52
|
+
- tasks.md 的数据层任务必须与 `architecture/database.md` 的 schema 变更对齐,并引用 `architecture/sql/ddl/*.sql` 和 `architecture/sql/migration/*.sql` 作为可执行脚本路径
|
|
51
53
|
|
|
52
54
|
`architecture/` 目录不存在时(判定为 `skipped`)跳过本段。
|
|
53
55
|
|
|
54
56
|
## Config Check
|
|
55
57
|
|
|
56
|
-
Run: `npx --yes --package @xulthekl/team-flow@0.
|
|
58
|
+
Run: `npx --yes --package @xulthekl/team-flow@0.24.0 tf runtime config --get artifacts.order` — generate in configured order (default: proposal → specs → design → tasks). Run with `artifacts.skip` — skip any listed artifacts.
|
|
57
59
|
|
|
58
60
|
## Artifact Roles
|
|
59
61
|
|
|
@@ -69,7 +71,7 @@ Run: `npx --yes --package @xulthekl/team-flow@0.22.4 tf runtime config --get art
|
|
|
69
71
|
|
|
70
72
|
**Honor Brief (v0.9)**: 若 `change-brief.md` 存在,尊重其 scope 边界与 AC 列表(见 Required Inputs「Change Brief」)——不静默丢弃 brief AC、不静默超出 brief scope;与 plan.md 冲突时以 plan.md 为准并注明。
|
|
71
73
|
|
|
72
|
-
**Honor Architecture (v0.9 §26)**: 若 `architecture/` 目录存在,design.md 的 Decisions 段必须引用其架构决策(聚合/限界上下文/CQRS/API/DB),tasks.md
|
|
74
|
+
**Honor Architecture (v0.9 §26, v0.10 §28-§31)**: 若 `architecture/` 目录存在,design.md 的 Decisions 段必须引用其架构决策(聚合/限界上下文/CQRS/API/DB),tasks.md 的接口定义(对齐 api.md 架构路由表)和数据层任务(引用 sql/ddl/ + sql/migration/ 脚本路径)必须与 architecture/ 产出对齐——不得静默忽略或矛盾架构设计产出。
|
|
73
75
|
|
|
74
76
|
### proposal.md
|
|
75
77
|
Must state: problem, what changes, capabilities affected, impact areas.
|
|
@@ -122,7 +124,7 @@ Generate one at a time. Confirm each before next. This prevents scope drift —
|
|
|
122
124
|
|
|
123
125
|
### design.md
|
|
124
126
|
- `## Context`, `## Goals`, `## Decisions` (≥1, with Choice+Rationale+Alternatives), `## Risks And Trade-Offs`
|
|
125
|
-
- **Architecture alignment (v0.9 §26)**: 若 `architecture/` 存在,`## Decisions` 必须引用架构设计产出中的关键决策(聚合/限界上下文/CQRS/API/DB
|
|
127
|
+
- **Architecture alignment (v0.9 §26, v0.10 §28-§31)**: 若 `architecture/` 存在,`## Decisions` 必须引用架构设计产出中的关键决策(聚合/限界上下文/CQRS/API/DB);tasks.md 数据层任务须引用 `architecture/sql/` 脚本路径,接口定义须对齐 api.md 架构路由表
|
|
126
128
|
|
|
127
129
|
### tasks.md
|
|
128
130
|
- `## File Structure`, `## Interfaces`, numbered tasks, exact file paths, TDD phases, ≤5 min steps, no placeholders, every requirement mapped, explicit dependencies
|
|
@@ -133,8 +135,8 @@ Generate one at a time. Confirm each before next. This prevents scope drift —
|
|
|
133
135
|
|
|
134
136
|
Present summary of all 4 artifacts (2-3 sentences each). Ask user for adjustments. After approval:
|
|
135
137
|
```bash
|
|
136
|
-
npx --yes --package @xulthekl/team-flow@0.
|
|
137
|
-
npx --yes --package @xulthekl/team-flow@0.
|
|
138
|
+
npx --yes --package @xulthekl/team-flow@0.24.0 tf state set <change-dir> dp_2_result "approved: <summary>"
|
|
139
|
+
npx --yes --package @xulthekl/team-flow@0.24.0 tf state set <change-dir> dp_2_timestamp $(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
138
140
|
```
|
|
139
141
|
|
|
140
142
|
## Handoff Rule
|
|
@@ -66,9 +66,41 @@ Do NOT invoke for:
|
|
|
66
66
|
|
|
67
67
|
**条件**:如果 B1 侦察发现项目有一定复杂度(≥5 个模块或 ≥10 个源文件),执行此阶段。否则跳过。
|
|
68
68
|
|
|
69
|
+
**B2 成果物导入(v0.23.0 新增,v0.24.0 模板初始化补强)**:
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
Step 0: 目录+模板初始化(v0.24.0 新增)
|
|
73
|
+
├── mkdir -p docs/architecture/
|
|
74
|
+
├── 从 ${CLAUDE_PLUGIN_ROOT}/skills/architecture-design/templates/ 复制模板:
|
|
75
|
+
│ architecture.md → docs/architecture/ARCHITECTURE.md
|
|
76
|
+
│ database.md → docs/architecture/DATABASE.md
|
|
77
|
+
│ physical-model.md → docs/architecture/PHYSICAL-MODEL.md
|
|
78
|
+
│ api.md → docs/architecture/API-INDEX.md
|
|
79
|
+
│ index.md → docs/architecture/INDEX.md
|
|
80
|
+
└── 已存在的文件不覆盖(只补缺失)
|
|
81
|
+
|
|
82
|
+
Step 1: 询问用户是否有既有成果物
|
|
83
|
+
├── 有 SQL DDL 脚本 → 导入到 docs/architecture/schema-baseline.sql
|
|
84
|
+
├── 有物理模型文档 → 转换为 docs/architecture/PHYSICAL-MODEL.md(对齐标准格式)
|
|
85
|
+
├── 有 API 文档/Swagger 导出 → 提取端点生成 docs/architecture/API-INDEX.md
|
|
86
|
+
└── 无既有成果物 → Step 2 兜底
|
|
87
|
+
|
|
88
|
+
Step 2: 确定性提取(兜底)
|
|
89
|
+
├── recon-probe.sh DDL 提取能力(v0.24.0 已实现:SQL 文件 / Java Entity / 占位)
|
|
90
|
+
│ bash scripts/recon-probe.sh --root <根> --ddl-out docs/architecture/schema-baseline.sql
|
|
91
|
+
├── 从 schema-baseline.sql 反向生成 PHYSICAL-MODEL.md
|
|
92
|
+
└── 扫描 Controller/Router 类 → 生成 API-INDEX.md
|
|
93
|
+
|
|
94
|
+
优先级原则:用户既有成果物 > 确定性提取 > LLM 推断
|
|
95
|
+
```
|
|
96
|
+
|
|
69
97
|
产出:
|
|
70
98
|
- `docs/architecture/ARCHITECTURE.md` — 分层、模块边界、技术选型(瘦锚点格式)
|
|
71
99
|
- `docs/architecture/DATABASE.md` — 数据模型(如适用)
|
|
100
|
+
- `docs/architecture/PHYSICAL-MODEL.md` — 物理模型(v0.23.0 新增)
|
|
101
|
+
- `docs/architecture/schema-baseline.sql` — DDL 基线脚本(v0.23.0 新增)
|
|
102
|
+
- `docs/architecture/API-INDEX.md` — API 端点索引(v0.23.0 新增)
|
|
103
|
+
- `docs/architecture/INDEX.md` — 架构文档索引(v0.23.0 新增)
|
|
72
104
|
- `docs/architecture/<bc>/` — 每个有界上下文的目录(如能识别)
|
|
73
105
|
|
|
74
106
|
**轻量 vs 完整**:
|
|
@@ -82,7 +114,9 @@ Do NOT invoke for:
|
|
|
82
114
|
|
|
83
115
|
### B3: Domain Vocabulary Bootstrap(领域词汇种子)
|
|
84
116
|
|
|
85
|
-
从代码命名中提取领域词汇,创建或更新 `CONCEPTS.md`。
|
|
117
|
+
从代码命名中提取领域词汇,创建或更新 `docs/architecture/CONCEPTS.md`。
|
|
118
|
+
|
|
119
|
+
> **v0.23.0 变更**:`CONCEPTS.md` 已迁移至 `docs/architecture/CONCEPTS.md`(原根目录位置已弃用)。如根目录存在旧文件,应迁移至新路径。
|
|
86
120
|
|
|
87
121
|
**提取策略**:
|
|
88
122
|
1. 扫描实体类名、服务类名、模块名
|
|
@@ -104,7 +138,7 @@ Do NOT invoke for:
|
|
|
104
138
|
```
|
|
105
139
|
|
|
106
140
|
**已有 CONCEPTS.md 处理**:
|
|
107
|
-
- 如果 `CONCEPTS.md` 已存在(由之前的 ce-compound 运行创建)→ **合并**而非覆盖
|
|
141
|
+
- 如果 `docs/architecture/CONCEPTS.md` 已存在(由之前的 ce-compound 运行创建)→ **合并**而非覆盖
|
|
108
142
|
- 读取已有词汇,补充从代码中新发现的术语
|
|
109
143
|
- 标注来源:"workflow-bootstrap B3 补充"
|
|
110
144
|
|
|
@@ -124,7 +158,7 @@ Do NOT invoke for:
|
|
|
124
158
|
> - C) 我只是想建立架构基线,暂不开发新需求(→ 结束)
|
|
125
159
|
|
|
126
160
|
**上下文传递**:
|
|
127
|
-
- 将 `docs/architecture/baseline.md` 和 `CONCEPTS.md` 的路径传递给 workflow-orchestrator S1
|
|
161
|
+
- 将 `docs/architecture/baseline.md` 和 `docs/architecture/CONCEPTS.md` 的路径传递给 workflow-orchestrator S1
|
|
128
162
|
- 作为后续流程的架构上下文
|
|
129
163
|
|
|
130
164
|
## Guardrails
|
|
@@ -140,9 +174,9 @@ Do NOT invoke for:
|
|
|
140
174
|
|
|
141
175
|
每次交互结束时说明:
|
|
142
176
|
1. 已完成的阶段(B1-B5)
|
|
143
|
-
2. 已产出的制品(baseline.md / ARCHITECTURE.md / CONCEPTS.md / 目录结构)
|
|
177
|
+
2. 已产出的制品(baseline.md / ARCHITECTURE.md / PHYSICAL-MODEL.md / schema-baseline.sql / API-INDEX.md / INDEX.md / CONCEPTS.md / 目录结构)
|
|
144
178
|
3. 下一步建议(调用哪个 skill)
|
|
145
179
|
|
|
146
180
|
## Success Output
|
|
147
181
|
|
|
148
|
-
接入结束时输出:侦察模式、产出清单(baseline.md / ARCHITECTURE.md / DATABASE.md / CONCEPTS.md / 目录结构)、关键发现(技术栈/模块数/架构模式/测试覆盖)、下一步建议。完整模板见 `references/b1-reconnaissance.md`「Success Output 模板」。
|
|
182
|
+
接入结束时输出:侦察模式、产出清单(baseline.md / ARCHITECTURE.md / DATABASE.md / PHYSICAL-MODEL.md / schema-baseline.sql / API-INDEX.md / INDEX.md / docs/architecture/CONCEPTS.md / 目录结构)、关键发现(技术栈/模块数/架构模式/测试覆盖)、下一步建议。完整模板见 `references/b1-reconnaissance.md`「Success Output 模板」。
|
|
@@ -15,6 +15,23 @@ bash scripts/recon-probe.sh --root <项目根> --out /tmp/recon-<slug>.json
|
|
|
15
15
|
|
|
16
16
|
固定采集(不依赖 LLM,两次接入结果一致):目录树(限深 4 层)、依赖清单(pom/package.json/requirements/go.mod/build.gradle)、LOC 与文件类型分布、测试文件计数(含 `.test.mjs`/`.spec.mjs`)、DB 迁移文件清单、README/docs 探测。输出结构化 JSON 供子代理消费。脚本只做确定性机械采集(§17.8 第四类载体),语义判断交给子代理 LLM。
|
|
17
17
|
|
|
18
|
+
## B1.1a DDL 提取能力(v0.23.0 设计,v0.24.0 已实现)
|
|
19
|
+
|
|
20
|
+
`recon-probe.sh` 已实现 DDL 提取能力(v0.24.0),用于 B2 成果物导入阶段的兜底提取:
|
|
21
|
+
|
|
22
|
+
- **策略 1:SQL 文件提取**(优先级最高):扫描 `*.sql` 文件中的 `CREATE TABLE` 语句,直接提取完整 DDL
|
|
23
|
+
- **策略 2:Java Entity 类解析**:扫描 `@Entity`、`@Table` 注解的 Java 类,提取表名、字段名、字段类型(正则映射:String→varchar(255)、Long/int→bigint、Boolean→tinyint(1)、LocalDateTime→datetime、BigDecimal→decimal(15,4))
|
|
24
|
+
- **策略 3:占位兜底**:以上均无时生成带注释的空 `schema-baseline.sql`,提示用户手动补充
|
|
25
|
+
|
|
26
|
+
**用法**:
|
|
27
|
+
```bash
|
|
28
|
+
bash scripts/recon-probe.sh --root <根> --ddl-out docs/architecture/schema-baseline.sql --out /tmp/recon-<slug>.json
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**JSON 输出字段**:`ddl_extraction.source`(sql_files / java_entity / none)、`ddl_extraction.table_count`、`ddl_extraction.tables[]`、`ddl_extraction.ddl_statements`
|
|
32
|
+
|
|
33
|
+
**未实现**:SHOW CREATE TABLE(需数据库连接,留待用户手动配置)、Flyway/Liquibase 迁移脚本解析(需语义判断,由侦察子代理处理)。
|
|
34
|
+
|
|
18
35
|
## B1.2 并行派发侦察子代理(语义增强)
|
|
19
36
|
|
|
20
37
|
读 `references/agents/codebase-recon-analyst.md`,把 B1.1 的 JSON 路径作为 `recon_json` 入参,按维度**并行派发**子代理(每个子代理消费 JSON 基底 + 按需补读源码,按 §18.1 返回结构化摘要):
|
|
@@ -65,7 +82,11 @@ bash scripts/recon-probe.sh --root <项目根> --out /tmp/recon-<slug>.json
|
|
|
65
82
|
- docs/architecture/baseline.md(项目基线画像)
|
|
66
83
|
- docs/architecture/ARCHITECTURE.md(架构锚点,如适用)
|
|
67
84
|
- docs/architecture/DATABASE.md(数据模型,如适用)
|
|
68
|
-
-
|
|
85
|
+
- docs/architecture/PHYSICAL-MODEL.md(物理模型,v0.23.0)
|
|
86
|
+
- docs/architecture/schema-baseline.sql(DDL 基线脚本,v0.23.0)
|
|
87
|
+
- docs/architecture/API-INDEX.md(API 端点索引,v0.23.0)
|
|
88
|
+
- docs/architecture/INDEX.md(架构文档索引,v0.23.0)
|
|
89
|
+
- docs/architecture/CONCEPTS.md(领域词汇,N 个术语)
|
|
69
90
|
- 目录结构:prd/ prototype/ docs/ changes/
|
|
70
91
|
|
|
71
92
|
关键发现:
|
|
@@ -36,6 +36,7 @@ set -u # 未定义变量报错;不用 -e(单条采集失败不应中断整
|
|
|
36
36
|
# ----------------------------------------------------------------------------
|
|
37
37
|
ROOT="."
|
|
38
38
|
OUT=""
|
|
39
|
+
DDL_OUT="" # v0.24.0: DDL 输出文件路径(默认不写,仅含在 JSON 中)
|
|
39
40
|
MAX_FILES=50000 # LOC 统计文件数上限(保护超大仓库)
|
|
40
41
|
TREE_DEPTH=4 # 目录树限深
|
|
41
42
|
|
|
@@ -51,6 +52,8 @@ while [ $# -gt 0 ]; do
|
|
|
51
52
|
--root=*) ROOT="${1#*=}"; shift ;;
|
|
52
53
|
--out) OUT="${2:-}"; shift 2 ;;
|
|
53
54
|
--out=*) OUT="${1#*=}"; shift ;;
|
|
55
|
+
--ddl-out) DDL_OUT="${2:-}"; shift 2 ;;
|
|
56
|
+
--ddl-out=*) DDL_OUT="${1#*=}"; shift ;;
|
|
54
57
|
-h|--help) print_help; exit 0 ;;
|
|
55
58
|
*) echo "[recon-probe] warn: unknown arg '$1' (ignored)" >&2; shift ;;
|
|
56
59
|
esac
|
|
@@ -260,6 +263,111 @@ pruned_find -maxdepth 2 -type f \
|
|
|
260
263
|
-print 2>/dev/null | sed "s#^$ROOT_ABS/##" | sort > "$TMP/doc_files.txt"
|
|
261
264
|
if [ -d "$ROOT_ABS/docs" ]; then DOCS_DIR=true; else DOCS_DIR=false; fi
|
|
262
265
|
|
|
266
|
+
# ============================================================================
|
|
267
|
+
# ⑦ DDL 提取(v0.24.0:schema-baseline 兜底采集)
|
|
268
|
+
# ----------------------------------------------------------------------------
|
|
269
|
+
# 策略(优先级):
|
|
270
|
+
# 1. 既有 .sql 中的 CREATE TABLE 语句 → 直接提取
|
|
271
|
+
# 2. Java Entity 类(@Entity / @Table 注解)→ 正则提取表名+字段
|
|
272
|
+
# 3. 以上均无 → 输出空 schema-baseline.sql + 提示手动补充
|
|
273
|
+
# 设计契约:只做确定性机械采集(regex),语义推断交给侦察子代理。
|
|
274
|
+
# ============================================================================
|
|
275
|
+
|
|
276
|
+
: > "$TMP/ddl_statements.sql"
|
|
277
|
+
: > "$TMP/ddl_tables.txt"
|
|
278
|
+
DDL_SOURCE="none"
|
|
279
|
+
DDL_TABLE_COUNT=0
|
|
280
|
+
|
|
281
|
+
# --- 策略 1:从既有 .sql 文件提取 CREATE TABLE ----------------------------------
|
|
282
|
+
if [ -s "$TMP/sql_files.txt" ]; then
|
|
283
|
+
while IFS= read -r sql_rel; do
|
|
284
|
+
sql_abs="$ROOT_ABS/$sql_rel"
|
|
285
|
+
[ -f "$sql_abs" ] || continue
|
|
286
|
+
# 提取 CREATE TABLE 语句(多行匹配,到第一个 ; 结束)
|
|
287
|
+
# 兼容:CREATE TABLE / CREATE TABLE IF NOT EXISTS / 大小写不敏感
|
|
288
|
+
awk '
|
|
289
|
+
BEGIN { IGNORECASE=1; in_stmt=0; stmt="" }
|
|
290
|
+
/CREATE[[:space:]]+TABLE/ { in_stmt=1; stmt="" }
|
|
291
|
+
in_stmt {
|
|
292
|
+
stmt = stmt $0 "\n"
|
|
293
|
+
if (/;/) {
|
|
294
|
+
printf "%s-- Source: %s\n\n", stmt, sql_file
|
|
295
|
+
in_stmt=0; stmt=""
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
' sql_file="$sql_rel" "$sql_abs" 2>/dev/null >> "$TMP/ddl_statements.sql" || true
|
|
299
|
+
done < "$TMP/sql_files.txt"
|
|
300
|
+
if [ -s "$TMP/ddl_statements.sql" ]; then
|
|
301
|
+
DDL_SOURCE="sql_files"
|
|
302
|
+
# 提取表名(用于计数和 JSON)
|
|
303
|
+
grep -ioE 'CREATE[[:space:]]+TABLE[[:space:]]+(IF[[:space:]]+NOT[[:space:]]+EXISTS[[:space:]]+)?[`"]?([a-zA-Z_][a-zA-Z0-9_.]*)[`"]?' \
|
|
304
|
+
"$TMP/ddl_statements.sql" 2>/dev/null \
|
|
305
|
+
| grep -ioE '[`"]?[a-zA-Z_][a-zA-Z0-9_]*\.[a-zA-Z_][a-zA-Z0-9_]*[`"]?|[a-zA-Z_][a-zA-Z0-9_]*[`"]?$' \
|
|
306
|
+
| sed -E 's/[`"]//g' | sort -u > "$TMP/ddl_tables.txt" || true
|
|
307
|
+
DDL_TABLE_COUNT=$(wc -l < "$TMP/ddl_tables.txt" | tr -d ' ')
|
|
308
|
+
fi
|
|
309
|
+
fi
|
|
310
|
+
|
|
311
|
+
# --- 策略 2:从 Java Entity 类提取(@Entity / @Table 注解)-----------------------
|
|
312
|
+
if [ "$DDL_TABLE_COUNT" -eq 0 ]; then
|
|
313
|
+
: > "$TMP/entity_files.txt"
|
|
314
|
+
pruned_find -type f -name '*.java' -print 2>/dev/null \
|
|
315
|
+
| while IFS= read -r jf; do
|
|
316
|
+
if grep -qlE '@(Entity|Table|Document|TableName)' "$jf" 2>/dev/null; then
|
|
317
|
+
echo "$jf"
|
|
318
|
+
fi
|
|
319
|
+
done | sort > "$TMP/entity_files.txt"
|
|
320
|
+
|
|
321
|
+
ENTITY_COUNT=$(wc -l < "$TMP/entity_files.txt" | tr -d ' ')
|
|
322
|
+
if [ "$ENTITY_COUNT" -gt 0 ]; then
|
|
323
|
+
DDL_SOURCE="java_entity"
|
|
324
|
+
while IFS= read -r ef; do
|
|
325
|
+
ef_rel="${ef#"$ROOT_ABS"/}"
|
|
326
|
+
# 提取 @Table(name="xxx") 或类名作为表名
|
|
327
|
+
table_name=""
|
|
328
|
+
tn="$(grep -oE '@Table\([^)]*name[[:space:]]*=[[:space:]]*"[^"]+"' "$ef" 2>/dev/null | head -1 \
|
|
329
|
+
| grep -oE '"[^"]+"' | tr -d '"')" || true
|
|
330
|
+
if [ -n "$tn" ]; then
|
|
331
|
+
table_name="$tn"
|
|
332
|
+
else
|
|
333
|
+
# 降级:用类名转 snake_case 作为表名
|
|
334
|
+
table_name="$(grep -oE 'class[[:space:]]+[A-Z][a-zA-Z0-9]*' "$ef" 2>/dev/null | head -1 \
|
|
335
|
+
| sed -E 's/class[[:space:]]+//' \
|
|
336
|
+
| sed -E 's/([A-Z])/_\1/g' | tr '[:upper:]' '[:lower:]' | sed 's/^_//')" || true
|
|
337
|
+
fi
|
|
338
|
+
[ -z "$table_name" ] && continue
|
|
339
|
+
|
|
340
|
+
# 攒完整 DDL 到临时文件再一次性追加(避免多次 >> 缓冲问题)
|
|
341
|
+
: > "$TMP/_entity_ddl.tmp"
|
|
342
|
+
echo "-- Entity: $ef_rel" >> "$TMP/_entity_ddl.tmp"
|
|
343
|
+
echo "CREATE TABLE $table_name (" >> "$TMP/_entity_ddl.tmp"
|
|
344
|
+
# 机械提取 private 字段声明:private Type fieldName;
|
|
345
|
+
grep -E '^[[:space:]]*private[[:space:]]+' "$ef" 2>/dev/null \
|
|
346
|
+
| grep -vE 'static[[:space:]]|final[[:space:]]|Logger|log|serialVersionUID' \
|
|
347
|
+
| sed -E 's/^[[:space:]]*private[[:space:]]+([A-Za-z0-9_<>, ]+)[[:space:]]+([a-zA-Z_][a-zA-Z0-9_]*)[[:space:]]*(=|;).*/ \2 \1,/' \
|
|
348
|
+
| sed -E 's/String|varchar|text/varchar(255)/g; s/Long|Integer|int|long/bigint/g; s/Boolean|boolean/tinyint(1)/g; s/Date|LocalDateTime|Timestamp/datetime/g; s/BigDecimal|Double|Float/decimal(15,4)/g' \
|
|
349
|
+
>> "$TMP/_entity_ddl.tmp" 2>/dev/null || true
|
|
350
|
+
echo " create_time datetime," >> "$TMP/_entity_ddl.tmp"
|
|
351
|
+
echo " update_time datetime," >> "$TMP/_entity_ddl.tmp"
|
|
352
|
+
echo " del_flag tinyint(1) DEFAULT 0" >> "$TMP/_entity_ddl.tmp"
|
|
353
|
+
echo ");" >> "$TMP/_entity_ddl.tmp"
|
|
354
|
+
echo "" >> "$TMP/_entity_ddl.tmp"
|
|
355
|
+
cat "$TMP/_entity_ddl.tmp" >> "$TMP/ddl_statements.sql"
|
|
356
|
+
echo "$table_name" >> "$TMP/ddl_tables.txt"
|
|
357
|
+
done < "$TMP/entity_files.txt"
|
|
358
|
+
sort -u "$TMP/ddl_tables.txt" -o "$TMP/ddl_tables.txt"
|
|
359
|
+
DDL_TABLE_COUNT=$(wc -l < "$TMP/ddl_tables.txt" | tr -d ' ')
|
|
360
|
+
fi
|
|
361
|
+
fi
|
|
362
|
+
|
|
363
|
+
# --- 策略 3:生成占位 schema-baseline.sql ---------------------------------------
|
|
364
|
+
if [ "$DDL_TABLE_COUNT" -eq 0 ]; then
|
|
365
|
+
DDL_SOURCE="none"
|
|
366
|
+
printf -- '-- schema-baseline.sql (auto-generated placeholder)\n' > "$TMP/ddl_statements.sql"
|
|
367
|
+
printf -- '-- No CREATE TABLE statements or Java Entity classes detected.\n' >> "$TMP/ddl_statements.sql"
|
|
368
|
+
printf -- '-- Please populate manually with your database schema.\n\n' >> "$TMP/ddl_statements.sql"
|
|
369
|
+
fi
|
|
370
|
+
|
|
263
371
|
# ============================================================================
|
|
264
372
|
# 组装 JSON
|
|
265
373
|
# ============================================================================
|
|
@@ -288,8 +396,13 @@ if [ -d "$ROOT_ABS/docs" ]; then DOCS_DIR=true; else DOCS_DIR=false; fi
|
|
|
288
396
|
"$(json_array_from_file "$TMP/migration_dirs.txt")" \
|
|
289
397
|
"$(json_array_from_file "$TMP/sql_samples.txt")"
|
|
290
398
|
# ⑥ docs
|
|
291
|
-
printf ' "docs": {"docs_dir": %s, "doc_files": %s}
|
|
399
|
+
printf ' "docs": {"docs_dir": %s, "doc_files": %s},\n' \
|
|
292
400
|
"$DOCS_DIR" "$(json_array_from_file "$TMP/doc_files.txt")"
|
|
401
|
+
# ⑦ DDL 提取(v0.24.0)
|
|
402
|
+
printf ' "ddl_extraction": {"source": "%s", "table_count": %s, "tables": %s, "ddl_statements": "%s"}\n' \
|
|
403
|
+
"$(json_escape "$DDL_SOURCE")" "$DDL_TABLE_COUNT" \
|
|
404
|
+
"$(json_array_from_file "$TMP/ddl_tables.txt")" \
|
|
405
|
+
"$(json_escape "$(cat "$TMP/ddl_statements.sql" 2>/dev/null)")"
|
|
293
406
|
printf '}\n'
|
|
294
407
|
} > "$TMP/out.json"
|
|
295
408
|
|
|
@@ -311,6 +424,13 @@ else
|
|
|
311
424
|
emit_json
|
|
312
425
|
fi
|
|
313
426
|
|
|
427
|
+
# v0.24.0: DDL 独立输出文件(--ddl-out)
|
|
428
|
+
if [ -n "$DDL_OUT" ] && [ -s "$TMP/ddl_statements.sql" ]; then
|
|
429
|
+
mkdir -p "$(dirname "$DDL_OUT")" 2>/dev/null || true
|
|
430
|
+
cp "$TMP/ddl_statements.sql" "$DDL_OUT" 2>/dev/null || true
|
|
431
|
+
echo "[recon-probe] DDL baseline written to: $DDL_OUT" >&2
|
|
432
|
+
fi
|
|
433
|
+
|
|
314
434
|
# 人类可读摘要 → stderr
|
|
315
435
|
{
|
|
316
436
|
echo "================ recon-probe 摘要 ================"
|
|
@@ -322,6 +442,7 @@ fi
|
|
|
322
442
|
echo "SQL 迁移 : $SQL_COUNT 个"
|
|
323
443
|
echo "docs/ 目录 : $DOCS_DIR"
|
|
324
444
|
echo "README 等 : $(wc -l < "$TMP/doc_files.txt" | tr -d ' ') 个"
|
|
445
|
+
echo "DDL 提取 : source=$DDL_SOURCE, tables=$DDL_TABLE_COUNT"
|
|
325
446
|
echo "================================================="
|
|
326
447
|
} >&2
|
|
327
448
|
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
检测可复利时刻(需求矛盾、原型返工、自动评审发现不一致并修正等)。每次自动评审发现不一致并修正后触发:
|
|
55
55
|
|
|
56
56
|
```bash
|
|
57
|
-
npx --yes --package @xulthekl/team-flow@0.
|
|
57
|
+
npx --yes --package @xulthekl/team-flow@0.24.0 tf solutions capture --phase prd --domain <domain> --type pitfall --severity <sev> --summary "<summary>"
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
### 6. 反馈环路检查点
|
|
@@ -38,7 +38,7 @@ verdict = FAIL → 必须回退 S3 调整拆分后重新审计,不可绕过直
|
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
40
|
mkdir -p changes/<change-name>
|
|
41
|
-
npx --yes --package @xulthekl/team-flow@0.
|
|
41
|
+
npx --yes --package @xulthekl/team-flow@0.24.0 tf state init changes/<change-name>
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
> ⚠️ **路径约束**:change 脚手架目录固定为项目根 `changes/<change-name>/`。
|