teamsmith 0.2.0 → 0.3.1

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 (163) hide show
  1. package/README.md +4 -4
  2. package/package.json +1 -1
  3. package/skills/teamsmith/CHANGELOG.md +69 -0
  4. package/skills/teamsmith/SKILL.md +20 -13
  5. package/skills/teamsmith/extension/team-inbox-watch.ts +5 -3
  6. package/skills/teamsmith/extension/team-notify.ts +37 -6
  7. package/skills/teamsmith/extension/team.ts +438 -0
  8. package/skills/teamsmith/references/config.md +39 -6
  9. package/skills/teamsmith/references/migration.md +197 -47
  10. package/skills/teamsmith/references/protocol.md +201 -30
  11. package/skills/teamsmith/references/troubleshooting.md +130 -10
  12. package/skills/teamsmith/references/workflows.md +36 -2
  13. package/skills/teamsmith/scripts/lib/cmd-agents.sh +318 -23
  14. package/skills/teamsmith/scripts/lib/cmd-bootstrap.sh +2 -2
  15. package/skills/teamsmith/scripts/lib/cmd-config.sh +349 -67
  16. package/skills/teamsmith/scripts/lib/cmd-draft.sh +4 -4
  17. package/skills/teamsmith/scripts/lib/cmd-help.sh +677 -0
  18. package/skills/teamsmith/scripts/lib/cmd-init.sh +157 -5
  19. package/skills/teamsmith/scripts/lib/cmd-interrupt.sh +461 -0
  20. package/skills/teamsmith/scripts/lib/cmd-meeting.sh +2 -25
  21. package/skills/teamsmith/scripts/lib/cmd-project.sh +30 -103
  22. package/skills/teamsmith/scripts/lib/cmd-reap.sh +277 -0
  23. package/skills/teamsmith/scripts/lib/cmd-reply.sh +3 -3
  24. package/skills/teamsmith/scripts/lib/cmd-review.sh +182 -32
  25. package/skills/teamsmith/scripts/lib/cmd-status.sh +234 -21
  26. package/skills/teamsmith/scripts/lib/cmd-update.sh +36 -7
  27. package/skills/teamsmith/scripts/lib/cmd-watch.sh +564 -46
  28. package/skills/teamsmith/scripts/lib/common.sh +1004 -245
  29. package/skills/teamsmith/scripts/lib/gate-lock.sh +582 -0
  30. package/skills/teamsmith/scripts/panel/draft-send.sh +11 -1
  31. package/skills/teamsmith/scripts/panel/panel.js +211 -211
  32. package/skills/teamsmith/scripts/panel/src/App.tsx +58 -21
  33. package/skills/teamsmith/scripts/panel/src/clipboard.ts +12 -5
  34. package/skills/teamsmith/scripts/panel/src/compose.ts +6 -3
  35. package/skills/teamsmith/scripts/panel/src/data.ts +51 -5
  36. package/skills/teamsmith/scripts/panel/src/layout.ts +209 -69
  37. package/skills/teamsmith/scripts/panel/src/main.tsx +37 -8
  38. package/skills/teamsmith/scripts/panel/src/strings/en.ts +39 -29
  39. package/skills/teamsmith/scripts/panel/src/strings/zh.ts +41 -31
  40. package/skills/teamsmith/scripts/panel/src/types.ts +28 -3
  41. package/skills/teamsmith/scripts/replies.mjs +4 -1
  42. package/skills/teamsmith/scripts/shim/killall +10 -0
  43. package/skills/teamsmith/scripts/shim/pgrep +10 -0
  44. package/skills/teamsmith/scripts/shim/pidof +10 -0
  45. package/skills/teamsmith/scripts/shim/pkill +10 -0
  46. package/skills/teamsmith/scripts/shim/signal-gate +108 -31
  47. package/skills/teamsmith/scripts/shim/tmux +18 -0
  48. package/skills/teamsmith/scripts/strings/commands.tsv +86 -0
  49. package/skills/teamsmith/scripts/strings/help.en.tsv +503 -0
  50. package/skills/teamsmith/scripts/strings/help.zh.tsv +489 -0
  51. package/skills/teamsmith/scripts/team +19 -6
  52. package/skills/teamsmith/templates/AGENTS.section.md.tmpl +8 -1
  53. package/skills/teamsmith/templates/config.sh.tmpl +20 -1
  54. package/skills/teamsmith/templates/pm-prompt.md.tmpl +21 -0
  55. package/skills/teamsmith/tests/README.md +31 -0
  56. package/skills/teamsmith/tests/bg-ledger-harness.mjs +464 -40
  57. package/skills/teamsmith/tests/bg-ledger.sh +168 -10
  58. package/skills/teamsmith/tests/checkout-shape-probe.sh +83 -54
  59. package/skills/teamsmith/tests/config-cli.sh +184 -32
  60. package/skills/teamsmith/tests/fixtures/delivery-truth-real/scenario.sh +7 -1
  61. package/skills/teamsmith/tests/fixtures/p287/lint-good.sh.in +3 -0
  62. package/skills/teamsmith/tests/fixtures/p287/lint-hardcoded.sh.in +3 -0
  63. package/skills/teamsmith/tests/fixtures/p287/lint-no-ns.sh.in +3 -0
  64. package/skills/teamsmith/tests/fixtures/p55/flip-p49.sh +18 -6
  65. package/skills/teamsmith/tests/flip-m33.sh +5 -3
  66. package/skills/teamsmith/tests/flip-p158.sh +2 -1
  67. package/skills/teamsmith/tests/flip-p308-skip-not-pass.sh +151 -0
  68. package/skills/teamsmith/tests/flip-p310-lock.sh +210 -0
  69. package/skills/teamsmith/tests/flip-p310-socket.sh +125 -0
  70. package/skills/teamsmith/tests/gate-guard.sh +52 -79
  71. package/skills/teamsmith/tests/help-surface.sh +1664 -0
  72. package/skills/teamsmith/tests/install-shape.sh +359 -22
  73. package/skills/teamsmith/tests/key-replies-pty.sh +9 -10
  74. package/skills/teamsmith/tests/key-replies-ui.sh +2 -8
  75. package/skills/teamsmith/tests/key-replies.sh +281 -28
  76. package/skills/teamsmith/tests/ledger-ban.sh +5 -4
  77. package/skills/teamsmith/tests/ledger-claim.sh +2 -1
  78. package/skills/teamsmith/tests/lib/bounded-spin.sh +90 -0
  79. package/skills/teamsmith/tests/lib/model-policy.sh +4 -0
  80. package/skills/teamsmith/tests/lib/model-routing-flips.py +51 -0
  81. package/skills/teamsmith/tests/lib/pty-wait.sh +21 -111
  82. package/skills/teamsmith/tests/lib/reply-fixture.sh +4 -9
  83. package/skills/teamsmith/tests/lib/section-guard.sh +316 -164
  84. package/skills/teamsmith/tests/lib/tmp-root.sh +139 -27
  85. package/skills/teamsmith/tests/lib/tmux-cap.sh +10 -1
  86. package/skills/teamsmith/tests/lib/tmux-iso.sh +31 -13
  87. package/skills/teamsmith/tests/loop-inventory.tsv +83 -77
  88. package/skills/teamsmith/tests/panel-b2.sh +430 -352
  89. package/skills/teamsmith/tests/panel-b3-stub.sh +112 -4
  90. package/skills/teamsmith/tests/panel-b3.sh +314 -62
  91. package/skills/teamsmith/tests/panel-choices.sh +11 -6
  92. package/skills/teamsmith/tests/panel-cpu.sh +43 -130
  93. package/skills/teamsmith/tests/panel-p21.sh +251 -265
  94. package/skills/teamsmith/tests/panel-snapshots.sh +41 -225
  95. package/skills/teamsmith/tests/panel-strings.mjs +33 -18
  96. package/skills/teamsmith/tests/perf.sh +187 -396
  97. package/skills/teamsmith/tests/routes.sh +440 -117
  98. package/skills/teamsmith/tests/seat-interrupt.sh +1012 -0
  99. package/skills/teamsmith/tests/seat-visibility.sh +675 -0
  100. package/skills/teamsmith/tests/section-guard.sh +13 -102
  101. package/skills/teamsmith/tests/section-needs-audit.sh +24 -7
  102. package/skills/teamsmith/tests/section-paths.tsv +32 -18
  103. package/skills/teamsmith/tests/section-select.sh +371 -19
  104. package/skills/teamsmith/tests/signal-gate.sh +249 -27
  105. package/skills/teamsmith/tests/signal-lint-legacy.txt +4 -1
  106. package/skills/teamsmith/tests/slash-team-e2e.sh +323 -0
  107. package/skills/teamsmith/tests/slash-team.sh +617 -0
  108. package/skills/teamsmith/tests/slice-coverage.sh +206 -0
  109. package/skills/teamsmith/tests/smoke.sh +3595 -788
  110. package/skills/teamsmith/tests/task-model-routing.sh +530 -15
  111. package/skills/teamsmith/tests/team-bg-stop.sh +18 -10
  112. package/skills/teamsmith/tests/tmp-hygiene.sh +782 -45
  113. package/skills/teamsmith/tests/tmux-identity-leak.sh +773 -0
  114. package/skills/teamsmith/tests/tmux-lint-legacy.txt +12 -18
  115. package/skills/teamsmith/tests/upgrade-recipe.sh +537 -0
  116. package/skills/teamsmith/tests/workflow-entry.sh +207 -0
  117. package/skills/teamsmith-init/SKILL.md +12 -12
  118. package/skills/teamsmith-init/references/bootstrap.md +3 -3
  119. package/skills/teamsmith/tests/flip-glue.sh +0 -162
  120. package/skills/teamsmith/tests/flip-m12-26c.sh +0 -129
  121. package/skills/teamsmith/tests/flip-m12.sh +0 -185
  122. package/skills/teamsmith/tests/flip-m16.sh +0 -166
  123. package/skills/teamsmith/tests/flip-m17.sh +0 -204
  124. package/skills/teamsmith/tests/flip-m34.sh +0 -96
  125. package/skills/teamsmith/tests/flip-m37.sh +0 -185
  126. package/skills/teamsmith/tests/flip-m4.3.sh +0 -375
  127. package/skills/teamsmith/tests/flip-m43.sh +0 -128
  128. package/skills/teamsmith/tests/flip-m45.sh +0 -244
  129. package/skills/teamsmith/tests/flip-m46.sh +0 -238
  130. package/skills/teamsmith/tests/flip-m48.sh +0 -304
  131. package/skills/teamsmith/tests/flip-m6.2.sh +0 -205
  132. package/skills/teamsmith/tests/flip-m6.3.sh +0 -283
  133. package/skills/teamsmith/tests/flip-m6.4.sh +0 -267
  134. package/skills/teamsmith/tests/flip-m6.5.sh +0 -113
  135. package/skills/teamsmith/tests/flip-m7.1.sh +0 -135
  136. package/skills/teamsmith/tests/flip-m7.2.sh +0 -321
  137. package/skills/teamsmith/tests/flip-p144.sh +0 -112
  138. package/skills/teamsmith/tests/flip-p156.sh +0 -133
  139. package/skills/teamsmith/tests/flip-p160.sh +0 -182
  140. package/skills/teamsmith/tests/flip-p171.sh +0 -249
  141. package/skills/teamsmith/tests/flip-p18.1.sh +0 -95
  142. package/skills/teamsmith/tests/flip-p20.sh +0 -286
  143. package/skills/teamsmith/tests/flip-p201.sh +0 -249
  144. package/skills/teamsmith/tests/flip-p210.sh +0 -239
  145. package/skills/teamsmith/tests/flip-p211.sh +0 -152
  146. package/skills/teamsmith/tests/flip-p217.sh +0 -288
  147. package/skills/teamsmith/tests/flip-p22.sh +0 -123
  148. package/skills/teamsmith/tests/flip-p23.sh +0 -239
  149. package/skills/teamsmith/tests/flip-p25.sh +0 -165
  150. package/skills/teamsmith/tests/flip-p71.sh +0 -184
  151. package/skills/teamsmith/tests/flip-p72.sh +0 -202
  152. package/skills/teamsmith/tests/load-experiment.sh +0 -290
  153. package/skills/teamsmith/tests/panel-cpu-premise.sh +0 -173
  154. package/skills/teamsmith/tests/panel-flip-m54.sh +0 -207
  155. package/skills/teamsmith/tests/panel-flip-p123.sh +0 -278
  156. package/skills/teamsmith/tests/panel-flip-p125.sh +0 -318
  157. package/skills/teamsmith/tests/panel-flip-p128.sh +0 -259
  158. package/skills/teamsmith/tests/panel-keyprobe-stub.sh +0 -41
  159. package/skills/teamsmith/tests/panel-keyprobe.sh +0 -82
  160. package/skills/teamsmith/tests/panel-knobs.sh +0 -83
  161. package/skills/teamsmith/tests/section-budgets.tsv +0 -154
  162. package/skills/teamsmith/tests/team-bg-flip.sh +0 -239
  163. package/skills/teamsmith/tests/team-inbox-watch-flip.sh +0 -191
@@ -17,10 +17,12 @@ block=""
17
17
  prev=""
18
18
  detail_id=""
19
19
  detail_file=""
20
+ detail_source=""
20
21
  for a in "$@"; do
21
22
  [ "$prev" = "--block" ] && block="$a"
22
23
  [ "$prev" = "--id" ] && detail_id="$a"
23
24
  [ "$prev" = "--file" ] && detail_file="$a"
25
+ [ "$prev" = "--source" ] && detail_source="$a"
24
26
  prev="$a"
25
27
  done
26
28
 
@@ -81,6 +83,11 @@ recent_json() { # B3_STUB_RECENT lines, deterministic timestamps; unset = the or
81
83
  }
82
84
 
83
85
  board_json() {
86
+ # B3_STUB_BOARD_EMPTY=1: no rows, so the work page's preview blocks are the only possible rows.
87
+ if [ "${B3_STUB_BOARD_EMPTY:-0}" = "1" ]; then
88
+ printf '%s\n' '{"rows": [], "counts": {"todo": 0, "wip": 0, "review": 0, "done": 0, "blocked": 0, "dropped": 0}, "total": 0, "deliveries": []}'
89
+ return 0
90
+ fi
84
91
  # B3_STUB_BOARD_FILE=<path>: serve that file verbatim — the board-page fixtures rewrite it between
85
92
  # refreshes to prove the focus survives a reorder and falls back when the entry leaves the board.
86
93
  if [ -n "${B3_STUB_BOARD_FILE:-}" ] && [ -r "${B3_STUB_BOARD_FILE}" ]; then
@@ -126,7 +133,102 @@ JSON
126
133
  printf '],\n "counts": {"todo": 1, "wip": 1, "review": 0, "done": %s, "blocked": 1, "dropped": 1},\n "total": %s,\n "deliveries": [\n {"id": "P14", "agent": "dev", "at": "2026-09-16T09:30:00Z"}\n ]}\n' "$n" "$((n + 4))"
127
134
  }
128
135
 
129
- changes_json() { cat <<'JSON'
136
+ # P249: the preview sources' stand-in (`--source spec|change|decision`). One fixed capability
137
+ # `demo`, one fixed change `demo` (its three artifacts) and one fixed decision `D7`; any other id
138
+ # answers the real reader's empty file list + reason, and `--file` must be one of the discovered
139
+ # paths (anything else exits non-zero). `B3_STUB_PREVIEWS=empty` empties the three preview blocks
140
+ # themselves, for the work page's no-dead-item fixture.
141
+ preview_json() { # <source> <id> [file]
142
+ local source="$1" id="$2" want="${3:-}"
143
+ local file="" text="" files="" reason=""
144
+ case "$source" in
145
+ spec)
146
+ if [ "$id" = "demo" ] || [ "$id" = "panel" ]; then
147
+ file="openspec/specs/$id/spec.md"
148
+ files="$(printf '[{"tab": "spec", "name": "spec.md", "path": "openspec/specs/%s/spec.md", "size": 64, "truncated": false}]' "$id")"
149
+ if [ "${B3_STUB_PREVIEW_LONG:-0}" -gt 0 ] 2>/dev/null; then
150
+ local i
151
+ text="# $id spec
152
+
153
+ ### Requirement: One
154
+
155
+ body"
156
+ for ((i = 1; i <= B3_STUB_PREVIEW_LONG; i++)); do printf -v line 'spec line %02d with a few words to read' "$i"; text="$text
157
+ $line"; done
158
+ else
159
+ text="# $id spec
160
+
161
+ ### Requirement: One
162
+
163
+ body"
164
+ fi
165
+ else
166
+ reason="openspec/specs/$id/spec.md 不存在"
167
+ fi
168
+ ;;
169
+ change)
170
+ if [ "$id" = "demo" ] || [ "$id" = "pulse-console" ]; then
171
+ files="$(printf '[{"tab": "proposal", "name": "proposal.md", "path": "openspec/changes/%s/proposal.md", "size": 30, "truncated": false}, {"tab": "design", "name": "design.md", "path": "openspec/changes/%s/design.md", "size": 30, "truncated": false}, {"tab": "tasks", "name": "tasks.md", "path": "openspec/changes/%s/tasks.md", "size": 30, "truncated": false}]' "$id" "$id" "$id")"
172
+ case "$want" in
173
+ ''|"openspec/changes/$id/proposal.md") file="openspec/changes/$id/proposal.md"; text="# $id proposal
174
+
175
+ the proposal body" ;;
176
+ "openspec/changes/$id/design.md") file="$want"; text="# $id design
177
+
178
+ the design body" ;;
179
+ "openspec/changes/$id/tasks.md") file="$want"; text="# $id tasks
180
+
181
+ - [ ] 1.1 the task body" ;;
182
+ *) printf 'panel-b3-stub: --file not in the discovered set: %s\n' "$want" >&2; return 1 ;;
183
+ esac
184
+ else
185
+ reason="openspec/changes/$id/ 下没有 proposal/design/tasks"
186
+ fi
187
+ ;;
188
+ decision)
189
+ case "$id" in
190
+ D40|D39|D38)
191
+ file="docs/team/DECISIONS.md"
192
+ files="$(printf '[{"tab": "%s", "name": "DECISIONS.md", "path": "docs/team/DECISIONS.md", "size": 40, "truncated": false}]' "$id")"
193
+ text="## $id · fixture decision
194
+
195
+ $id body
196
+
197
+ ### $id 补记
198
+
199
+ deeper addendum"
200
+ ;;
201
+ *) reason="DECISIONS.md 里没有 $id" ;;
202
+ esac
203
+ ;;
204
+ *)
205
+ printf 'panel-b3-stub: unknown --source %s\n' "$source" >&2
206
+ return 2
207
+ ;;
208
+ esac
209
+ # The single-file sources serve exactly their discovered path.
210
+ case "$source" in
211
+ spec|decision)
212
+ if [ -n "$want" ] && [ "$want" != "$file" ]; then
213
+ printf 'panel-b3-stub: --file not in the discovered set: %s\n' "$want" >&2
214
+ return 1
215
+ fi
216
+ ;;
217
+ esac
218
+ if [ -z "$file" ]; then
219
+ printf '{"id": %s, "count": 0, "file": "", "text": "", "truncated": false, "files": [], "reason": %s}\n' \
220
+ "$(json_str "$id")" "$(json_str "$reason")"
221
+ return 0
222
+ fi
223
+ printf '{"id": %s, "count": 1, "file": %s, "text": %s, "truncated": false, "files": %s}\n' \
224
+ "$(json_str "$id")" "$(json_str "$file")" "$(json_str_ml "$text")" "$files"
225
+ }
226
+
227
+ changes_json() {
228
+ case "${B3_STUB_PREVIEWS:-}" in
229
+ empty|specs-only) printf '%s\n' '{"available": true, "source": "dir", "count": 0, "changes": []}'; return 0 ;;
230
+ esac
231
+ cat <<'JSON'
130
232
  {"available": true, "source": "openspec", "count": 2, "changes": [
131
233
  {"id": "pulse-console", "done": 8, "total": 28, "age": "44m ago", "phase": "apply"},
132
234
  {"id": "rename-watchdog", "done": 12, "total": 12, "age": "2d ago", "phase": "verify"}
@@ -134,7 +236,9 @@ changes_json() { cat <<'JSON'
134
236
  JSON
135
237
  }
136
238
 
137
- specs_json() { cat <<'JSON'
239
+ specs_json() {
240
+ if [ "${B3_STUB_PREVIEWS:-}" = "empty" ]; then printf '%s\n' '{"available": true, "count": 0, "requirements": 0, "specs": []}'; return 0; fi
241
+ cat <<'JSON'
138
242
  {"available": true, "count": 12, "requirements": 45, "specs": [
139
243
  {"name": "panel", "requirements": 12},
140
244
  {"name": "watchdog", "requirements": 10},
@@ -144,7 +248,11 @@ specs_json() { cat <<'JSON'
144
248
  JSON
145
249
  }
146
250
 
147
- decisions_json() { cat <<'JSON'
251
+ decisions_json() {
252
+ case "${B3_STUB_PREVIEWS:-}" in
253
+ empty|specs-only) printf '%s\n' '{"count": 0, "recent": []}'; return 0 ;;
254
+ esac
255
+ cat <<'JSON'
148
256
  {"count": 40, "recent": ["D40 · 2026-09-16 · 决定 — 控制台分三批", "D39 · 2026-09-16 · 决定 — i18n 进 B3", "D38 · 2026-09-15 · 决定 — q 收起不清巡检"]}
149
257
  JSON
150
258
  }
@@ -290,7 +398,7 @@ case "$block" in
290
398
  outbox_list) outbox_list_json ;;
291
399
  inbox) inbox_json ;;
292
400
  patrol) patrol_json ;;
293
- detail) detail_json "$detail_id" "$detail_file" ;;
401
+ detail) if [ -n "$detail_source" ]; then preview_json "$detail_source" "$detail_id" "$detail_file"; else detail_json "$detail_id" "$detail_file"; fi ;;
294
402
  # pulse-key-replies:三个回复块也是固定数据(默认「显式空」,B3_STUB_REPLY=1 → 一条 1 号回复,
295
403
  # =corrupt → 最新槽位不可用),这样第 5 页与总览的摘要行在快照里逐字节可复现。
296
404
  reply_summary) reply_summary_json ;;