universal-dev-standards 5.14.0 → 5.16.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/bin/uds.js +2 -0
- package/bundled/ai/standards/acceptance-criteria-traceability.ai.yaml +31 -0
- package/bundled/ai/standards/ai-instruction-standards.ai.yaml +190 -3
- package/bundled/ai/standards/forward-derivation-standards.ai.yaml +23 -0
- package/bundled/ai/standards/knowledge-graph-memory.ai.yaml +83 -0
- package/bundled/core/acceptance-criteria-traceability.md +46 -0
- package/bundled/core/ai-instruction-standards.md +136 -11
- package/bundled/core/forward-derivation-standards.md +19 -0
- package/bundled/core/knowledge-graph-memory.md +119 -0
- package/bundled/locales/COVERAGE.md +226 -0
- package/bundled/locales/zh-CN/CHANGELOG.md +42 -3
- package/bundled/locales/zh-CN/README.md +1 -1
- package/bundled/locales/zh-CN/SECURITY.md +1 -1
- package/bundled/locales/zh-CN/core/acceptance-criteria-traceability.md +46 -0
- package/bundled/locales/zh-CN/core/ai-instruction-standards.md +111 -5
- package/bundled/locales/zh-CN/core/forward-derivation-standards.md +19 -0
- package/bundled/locales/zh-CN/skills/ac-coverage/SKILL.md +194 -0
- package/bundled/locales/zh-CN/skills/adr-assistant/SKILL.md +135 -40
- package/bundled/locales/zh-CN/skills/brainstorm-assistant/SKILL.md +217 -63
- package/bundled/locales/zh-CN/skills/brainstorm-assistant/guide.md +599 -0
- package/bundled/locales/zh-CN/skills/commands/brainstorm.md +92 -25
- package/bundled/locales/zh-CN/skills/commit-standards/SKILL.md +78 -16
- package/bundled/locales/zh-CN/skills/contract-test-assistant/SKILL.md +85 -26
- package/bundled/locales/zh-CN/skills/deploy-assistant/SKILL.md +189 -0
- package/bundled/locales/zh-CN/skills/dev-methodology/SKILL.md +110 -0
- package/bundled/locales/zh-CN/skills/dev-methodology/guide.md +255 -0
- package/bundled/locales/zh-CN/skills/dev-workflow-guide/SKILL.md +70 -11
- package/bundled/locales/zh-CN/skills/journey-test-assistant/SKILL.md +209 -0
- package/bundled/locales/zh-CN/skills/knowledge-graph/SKILL.md +58 -0
- package/bundled/locales/zh-CN/skills/knowledge-graph/guide.md +74 -0
- package/bundled/locales/zh-CN/skills/migration-assistant/SKILL.md +125 -8
- package/bundled/locales/zh-CN/skills/observability-assistant/guide.md +188 -0
- package/bundled/locales/zh-CN/skills/orchestrate/SKILL.md +173 -0
- package/bundled/locales/zh-CN/skills/plan/SKILL.md +240 -0
- package/bundled/locales/zh-CN/skills/push/SKILL.md +242 -0
- package/bundled/locales/zh-CN/skills/retrospective-assistant/SKILL.md +104 -36
- package/bundled/locales/zh-CN/skills/reverse-engineer/SKILL.md +88 -32
- package/bundled/locales/zh-CN/skills/runbook-assistant/guide.md +216 -0
- package/bundled/locales/zh-CN/skills/skill-builder/SKILL.md +149 -0
- package/bundled/locales/zh-CN/skills/slo-assistant/guide.md +188 -0
- package/bundled/locales/zh-CN/skills/spec-derivation/SKILL.md +86 -0
- package/bundled/locales/zh-CN/skills/spec-derivation/guide.md +476 -0
- package/bundled/locales/zh-CN/skills/spec-driven-dev/SKILL.md +155 -81
- package/bundled/locales/zh-CN/skills/sweep/SKILL.md +151 -0
- package/bundled/locales/zh-CN/skills/testing-guide/SKILL.md +207 -110
- package/bundled/locales/zh-TW/CHANGELOG.md +46 -3
- package/bundled/locales/zh-TW/README.md +1 -1
- package/bundled/locales/zh-TW/SECURITY.md +1 -1
- package/bundled/locales/zh-TW/core/acceptance-criteria-traceability.md +46 -0
- package/bundled/locales/zh-TW/core/ai-instruction-standards.md +130 -5
- package/bundled/locales/zh-TW/core/browser-compatibility-standards.md +222 -5
- package/bundled/locales/zh-TW/core/contract-testing-standards.md +184 -5
- package/bundled/locales/zh-TW/core/cross-flow-regression.md +192 -5
- package/bundled/locales/zh-TW/core/forward-derivation-standards.md +19 -0
- package/bundled/locales/zh-TW/core/knowledge-graph-memory.md +127 -0
- package/bundled/locales/zh-TW/core/release-readiness-gate.md +186 -5
- package/bundled/locales/zh-TW/core/self-review-protocol.md +9 -1
- package/bundled/locales/zh-TW/skills/ac-coverage/SKILL.md +192 -0
- package/bundled/locales/zh-TW/skills/adr-assistant/SKILL.md +21 -42
- package/bundled/locales/zh-TW/skills/ai-collaboration-standards/SKILL.md +5 -1
- package/bundled/locales/zh-TW/skills/brainstorm-assistant/SKILL.md +212 -59
- package/bundled/locales/zh-TW/skills/brainstorm-assistant/guide.md +266 -579
- package/bundled/locales/zh-TW/skills/commands/brainstorm.md +91 -26
- package/bundled/locales/zh-TW/skills/commit-standards/SKILL.md +77 -15
- package/bundled/locales/zh-TW/skills/contract-test-assistant/SKILL.md +75 -16
- package/bundled/locales/zh-TW/skills/deploy-assistant/SKILL.md +187 -0
- package/bundled/locales/zh-TW/skills/dev-methodology/SKILL.md +108 -0
- package/bundled/locales/zh-TW/skills/dev-methodology/guide.md +255 -0
- package/bundled/locales/zh-TW/skills/dev-workflow-guide/SKILL.md +125 -64
- package/bundled/locales/zh-TW/skills/journey-test-assistant/SKILL.md +222 -0
- package/bundled/locales/zh-TW/skills/knowledge-graph/SKILL.md +56 -0
- package/bundled/locales/zh-TW/skills/knowledge-graph/guide.md +74 -0
- package/bundled/locales/zh-TW/skills/migration-assistant/SKILL.md +128 -11
- package/bundled/locales/zh-TW/skills/observability-assistant/guide.md +188 -0
- package/bundled/locales/zh-TW/skills/orchestrate/SKILL.md +173 -0
- package/bundled/locales/zh-TW/skills/plan/SKILL.md +240 -0
- package/bundled/locales/zh-TW/skills/project-structure-guide/SKILL.md +5 -1
- package/bundled/locales/zh-TW/skills/push/SKILL.md +242 -0
- package/bundled/locales/zh-TW/skills/retrospective-assistant/SKILL.md +94 -28
- package/bundled/locales/zh-TW/skills/reverse-engineer/SKILL.md +84 -28
- package/bundled/locales/zh-TW/skills/runbook-assistant/guide.md +216 -0
- package/bundled/locales/zh-TW/skills/skill-builder/SKILL.md +165 -0
- package/bundled/locales/zh-TW/skills/slo-assistant/guide.md +188 -0
- package/bundled/locales/zh-TW/skills/spec-derivation/SKILL.md +83 -0
- package/bundled/locales/zh-TW/skills/spec-derivation/guide.md +476 -0
- package/bundled/locales/zh-TW/skills/spec-driven-dev/SKILL.md +148 -77
- package/bundled/locales/zh-TW/skills/sweep/SKILL.md +149 -0
- package/bundled/locales/zh-TW/skills/testing-guide/SKILL.md +141 -44
- package/bundled/skills/adr-assistant/SKILL.md +1 -1
- package/bundled/skills/ai-collaboration-standards/SKILL.md +1 -1
- package/bundled/skills/ai-friendly-architecture/SKILL.md +1 -1
- package/bundled/skills/ai-instruction-standards/SKILL.md +1 -1
- package/bundled/skills/api-design-assistant/SKILL.md +1 -1
- package/bundled/skills/audit-assistant/SKILL.md +1 -1
- package/bundled/skills/brainstorm-assistant/SKILL.md +142 -106
- package/bundled/skills/brainstorm-assistant/guide.md +256 -661
- package/bundled/skills/ci-cd-assistant/SKILL.md +1 -1
- package/bundled/skills/commands/brainstorm.md +51 -30
- package/bundled/skills/contract-test-assistant/SKILL.md +1 -1
- package/bundled/skills/database-assistant/SKILL.md +1 -1
- package/bundled/skills/deploy-assistant/SKILL.md +1 -1
- package/bundled/skills/documentation-guide/SKILL.md +1 -1
- package/bundled/skills/error-code-guide/SKILL.md +1 -1
- package/bundled/skills/git-workflow-guide/SKILL.md +1 -1
- package/bundled/skills/incident-response-assistant/SKILL.md +1 -1
- package/bundled/skills/journey-test-assistant/SKILL.md +1 -1
- package/bundled/skills/knowledge-graph/SKILL.md +58 -0
- package/bundled/skills/knowledge-graph/guide.md +69 -0
- package/bundled/skills/logging-guide/SKILL.md +1 -1
- package/bundled/skills/observability-assistant/SKILL.md +1 -1
- package/bundled/skills/orchestrate/SKILL.md +1 -1
- package/bundled/skills/plan/SKILL.md +1 -1
- package/bundled/skills/pr-automation-assistant/SKILL.md +1 -1
- package/bundled/skills/project-structure-guide/SKILL.md +1 -1
- package/bundled/skills/push/SKILL.md +1 -1
- package/bundled/skills/retrospective-assistant/SKILL.md +1 -1
- package/bundled/skills/reverse-engineer/SKILL.md +1 -1
- package/bundled/skills/runbook-assistant/SKILL.md +1 -1
- package/bundled/skills/security-assistant/SKILL.md +1 -1
- package/bundled/skills/security-scan-assistant/SKILL.md +1 -1
- package/bundled/skills/slo-assistant/SKILL.md +1 -1
- package/bundled/skills/sweep/SKILL.md +1 -1
- package/bundled/skills/testing-guide/SKILL.md +1 -1
- package/package.json +2 -2
- package/src/commands/check.js +80 -0
- package/src/commands/init.js +8 -1
- package/src/commands/update.js +49 -14
- package/src/i18n/messages.js +32 -5
- package/src/installers/skills-installer.js +49 -0
- package/src/lint/i18n.js +424 -0
- package/src/utils/config-manager.js +39 -0
- package/src/utils/skills-installer.js +39 -7
- package/standards-registry.json +16 -4
- package/bundled/locales/zh-TW/docs/SKILL-FALLBACK-GUIDE.md +0 -407
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: push
|
|
3
|
+
source: ../../../../skills/push/SKILL.md
|
|
4
|
+
source_version: 2.0.0
|
|
5
|
+
translation_version: 2.0.0
|
|
6
|
+
last_synced: 2026-06-02
|
|
7
|
+
source_hash: b7812535483c
|
|
8
|
+
scope: universal
|
|
9
|
+
description: |
|
|
10
|
+
[UDS] AI 辅助 git push 安全层:质量门禁 + 协作护栏。
|
|
11
|
+
Use when: pushing commits, force pushing, pushing to protected branches, pushing feature branches.
|
|
12
|
+
Keywords: git push, force push, protected branch, quality gate, push receipt, PR automation, 推送, 保护分支, 质量门禁.
|
|
13
|
+
allowed-tools: Read, Bash(git:*), Bash(npm:*), Bash(pnpm:*), Bash(yarn:*), Bash(bun:*)
|
|
14
|
+
argument-hint: "[--force] [--target <branch>] [--skip-gates] [--no-pr]"
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# 推送助手
|
|
18
|
+
|
|
19
|
+
> **语言**: [English](../../../../skills/push/SKILL.md) | 简体中文
|
|
20
|
+
|
|
21
|
+
**版本**:2.0.0
|
|
22
|
+
**创建日期**:2026-04-23
|
|
23
|
+
**适用范围**:Claude Code Skills
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
`git push` 的 AI 辅助安全层。检测保护分支、强制 force-push 护栏、执行 pre-push 质量门禁、输出结构化推送收据,并集成 PR 自动化。
|
|
28
|
+
|
|
29
|
+
## 核心标准
|
|
30
|
+
|
|
31
|
+
本 Skill 实现 [`.standards/push-standards.ai.yaml`](../../../../.standards/push-standards.ai.yaml)。
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 执行工作流程
|
|
36
|
+
|
|
37
|
+
调用 `/push` 后,Claude 原生依序执行以下步骤:
|
|
38
|
+
|
|
39
|
+
### Step 1:检测保护分支
|
|
40
|
+
执行 `git rev-parse --abbrev-ref HEAD` 获取当前分支。
|
|
41
|
+
比对 `protected_branches` 列表(默认:main、master、release/*、hotfix/*)。
|
|
42
|
+
若为保护分支:显示警告 + 待推送的 commit 列表,需用户明确确认才能继续。
|
|
43
|
+
|
|
44
|
+
### Step 2:检测 Force Push
|
|
45
|
+
若检测到 `--force` 或 `--force-with-lease`:
|
|
46
|
+
执行 `git log origin/<branch>..HEAD --oneline` 找出将被覆盖的 commits。
|
|
47
|
+
显示数量与作者列表。需要用户输入 `yes, force push` 才能继续。
|
|
48
|
+
|
|
49
|
+
### Step 3:执行 Pre-Push 质量门禁
|
|
50
|
+
依序使用 Bash tool 执行每个已设置的门禁:
|
|
51
|
+
- `lint`:检测并执行项目 lint 命令
|
|
52
|
+
- `test`:检测并执行项目测试命令
|
|
53
|
+
- `type-check`(可选):TypeScript 类型检查
|
|
54
|
+
- `ac-coverage`(可选):验收条件覆盖率
|
|
55
|
+
- `security-scan`(可选):安全漏洞扫描
|
|
56
|
+
|
|
57
|
+
若任何必需门禁失败:中止并显示错误信息。
|
|
58
|
+
|
|
59
|
+
### Step 4:执行推送
|
|
60
|
+
执行 `git push <remote> <branch> [--force]`。
|
|
61
|
+
若推送失败:显示 git 错误并建议修正方式。
|
|
62
|
+
|
|
63
|
+
### Step 5:发出推送收据
|
|
64
|
+
将结构化收据输出到 console(可选择写入 `~/.uds/push-history.jsonl`):
|
|
65
|
+
```json
|
|
66
|
+
{
|
|
67
|
+
"branch": "<branch>",
|
|
68
|
+
"commit_sha": "<sha>",
|
|
69
|
+
"gates_passed": ["lint", "test"],
|
|
70
|
+
"force_push": false,
|
|
71
|
+
"timestamp": "<ISO8601>",
|
|
72
|
+
"target_remote": "origin"
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Step 6:PR 集成
|
|
77
|
+
若 `auto_pr=true` **且** `repo_mode=team` **且**该分支无 open PR:
|
|
78
|
+
建议用户执行 `/pr-automation-assistant` 创建 Pull Request。
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## 功能说明
|
|
83
|
+
|
|
84
|
+
### 1. 推送目标风险检测
|
|
85
|
+
|
|
86
|
+
推送前检测目标分支是否为保护分支(例如 `main`、`master`、`release/*`、`hotfix/*`)。
|
|
87
|
+
|
|
88
|
+
- 显示**警告**,列出分支名称与 commit 列表
|
|
89
|
+
- 需要用户明确确认才能继续
|
|
90
|
+
- 用户未确认则中止推送
|
|
91
|
+
|
|
92
|
+
### 2. Force-Push 护栏
|
|
93
|
+
|
|
94
|
+
检测到 `--force` 时,推送前显示影响范围。
|
|
95
|
+
|
|
96
|
+
- 计算远端将被覆盖的 commits
|
|
97
|
+
- 显示被覆盖 commits 的数量与作者
|
|
98
|
+
- 要求用户输入确认字符串(`yes, force push`)
|
|
99
|
+
- 在推送收据中记录 `force_push: true`
|
|
100
|
+
|
|
101
|
+
### 3. Pre-Push 质量门禁
|
|
102
|
+
|
|
103
|
+
推送前依序执行已设置的质量门禁。
|
|
104
|
+
|
|
105
|
+
| 门禁 | 说明 |
|
|
106
|
+
|------|------|
|
|
107
|
+
| `lint` | 执行 lint 检查 |
|
|
108
|
+
| `test` | 执行测试 |
|
|
109
|
+
| `type-check` | TypeScript 类型检查(可选) |
|
|
110
|
+
| `ac-coverage` | AC 覆盖率检查(可选) |
|
|
111
|
+
| `security-scan` | 安全扫描(可选) |
|
|
112
|
+
|
|
113
|
+
### 4. 推送收据
|
|
114
|
+
|
|
115
|
+
推送成功后输出结构化收据,供审计追踪使用。
|
|
116
|
+
|
|
117
|
+
```json
|
|
118
|
+
{
|
|
119
|
+
"branch": "feature/my-feature",
|
|
120
|
+
"commit_sha": "a1b2c3d",
|
|
121
|
+
"gates_passed": ["lint", "test"],
|
|
122
|
+
"gates_skipped": false,
|
|
123
|
+
"force_push": false,
|
|
124
|
+
"timestamp": "2026-04-23T10:00:00Z",
|
|
125
|
+
"target_remote": "origin"
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
可选择追加到 `~/.uds/push-history.jsonl` 以持久化审计追踪。
|
|
130
|
+
|
|
131
|
+
### 5. PR 自动化集成入口
|
|
132
|
+
|
|
133
|
+
推送 feature branch 后,若尚无 PR,提示用户创建 Pull Request。
|
|
134
|
+
|
|
135
|
+
- 检查该分支是否已有 open PR
|
|
136
|
+
- 提示用户执行 `pr-automation-assistant`
|
|
137
|
+
- 在 `single-owner` repo 模式或使用 `--no-pr` 旗标时跳过
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## 使用方式
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
# 标准推送(自动执行质量门禁)
|
|
145
|
+
/push
|
|
146
|
+
|
|
147
|
+
# Force push(显示被覆盖 commits,需要确认)
|
|
148
|
+
/push --force
|
|
149
|
+
|
|
150
|
+
# 推送到指定的远端分支
|
|
151
|
+
/push --target main
|
|
152
|
+
|
|
153
|
+
# 跳过质量门禁(紧急情况)
|
|
154
|
+
/push --skip-gates
|
|
155
|
+
|
|
156
|
+
# 推送但不提示创建 PR
|
|
157
|
+
/push --no-pr
|
|
158
|
+
|
|
159
|
+
# Force push 且不提示创建 PR(例如更新个人分支)
|
|
160
|
+
/push --force --no-pr
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## 参数说明
|
|
164
|
+
|
|
165
|
+
| 参数 | 说明 |
|
|
166
|
+
|------|------|
|
|
167
|
+
| `--force` | 启用 force push,含护栏确认 |
|
|
168
|
+
| `--target <branch>` | 明确指定目标远端分支 |
|
|
169
|
+
| `--skip-gates` | 跳过质量门禁(仅紧急情况) |
|
|
170
|
+
| `--no-pr` | 推送后不提示创建 PR |
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## 设置
|
|
175
|
+
|
|
176
|
+
通过 `uds.project.yaml` 设置:
|
|
177
|
+
|
|
178
|
+
```yaml
|
|
179
|
+
push:
|
|
180
|
+
repo_mode: team # "team" | "single-owner"
|
|
181
|
+
protected_branches:
|
|
182
|
+
- main
|
|
183
|
+
- master
|
|
184
|
+
- "release/*"
|
|
185
|
+
- "hotfix/*"
|
|
186
|
+
push_gates:
|
|
187
|
+
default:
|
|
188
|
+
- lint
|
|
189
|
+
- test
|
|
190
|
+
optional:
|
|
191
|
+
- type-check
|
|
192
|
+
- ac-coverage
|
|
193
|
+
- security-scan
|
|
194
|
+
receipt:
|
|
195
|
+
output: console # "console" | "file" | "both"
|
|
196
|
+
file_path: "~/.uds/push-history.jsonl"
|
|
197
|
+
auto_pr: true # 推送到非保护分支后是否提示创建 PR
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### 选项模式
|
|
201
|
+
|
|
202
|
+
| Option 文件 | 模式 | 说明 |
|
|
203
|
+
|-------------|------|------|
|
|
204
|
+
| [`options/push/team-mode.md`](../../../../options/push/team-mode.md) | `team` | 完整协作护栏(默认) |
|
|
205
|
+
| [`options/push/single-owner-mode.md`](../../../../options/push/single-owner-mode.md) | `single-owner` | 个人 repo 低摩擦模式 |
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## 下一步引导
|
|
210
|
+
|
|
211
|
+
`/push` 完成后,AI 助手应建议:
|
|
212
|
+
|
|
213
|
+
> **推送完成。建议下一步:**
|
|
214
|
+
> - 执行 `/pr-automation-assistant` 创建或更新 Pull Request ⭐ **推荐** — 确保协作流程完整
|
|
215
|
+
> - 执行 `/checkin` 确认代码签入质量 — 下次提交前的质量确认
|
|
216
|
+
> - 查看 `~/.uds/push-history.jsonl` 确认推送记录 — 审计追踪
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## 相关标准
|
|
221
|
+
|
|
222
|
+
- [Push Standards](../../../../.standards/push-standards.ai.yaml) — 核心推送安全规则
|
|
223
|
+
- [Git Workflow](../../../../.standards/git-workflow.ai.yaml) — 分支策略
|
|
224
|
+
- [Commit Message](../../../../.standards/commit-message.ai.yaml) — Commit 约定
|
|
225
|
+
- [PR Automation](../pr-automation-assistant/SKILL.md) — Pull Request 自动化
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## 版本历程
|
|
230
|
+
|
|
231
|
+
| 版本 | 日期 | 变更 |
|
|
232
|
+
|------|------|------|
|
|
233
|
+
| 2.0.0 | 2026-04-28 | 还原 workflow 执行步骤(XSPEC-097 采用层解耦);移除弃用通知 |
|
|
234
|
+
| 1.0.0 | 2026-04-23 | 初始版本 — XSPEC-081 Phase 1 |
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## 授权
|
|
239
|
+
|
|
240
|
+
本 Skill 采用 [MIT License](https://opensource.org/licenses/MIT) 与 [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) 双重授权发布。
|
|
241
|
+
|
|
242
|
+
**来源**:[universal-dev-standards](https://github.com/AsiaOstrich/universal-dev-standards)
|
|
@@ -1,68 +1,136 @@
|
|
|
1
1
|
---
|
|
2
2
|
source: ../../../../skills/retrospective-assistant/SKILL.md
|
|
3
3
|
source_version: 1.0.0
|
|
4
|
+
source_hash: 9c883f05ad7b
|
|
4
5
|
translation_version: 1.0.0
|
|
5
|
-
last_synced: 2026-
|
|
6
|
+
last_synced: 2026-06-01
|
|
6
7
|
status: current
|
|
7
8
|
description: |
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
关键字:retrospective, retro, 回顾,
|
|
9
|
+
[UDS] 引导 Sprint 与 Release 周期的结构化团队回顾。
|
|
10
|
+
使用时机:迭代结束、发布复盘、流程改善。
|
|
11
|
+
关键字:retrospective, retro, 回顾, 复盘, 持续改善。
|
|
11
12
|
---
|
|
12
13
|
|
|
13
14
|
# 回顾助手
|
|
14
15
|
|
|
15
16
|
> **语言**: [English](../../../../skills/retrospective-assistant/SKILL.md) | 简体中文
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
引导结构化的团队回顾,识别改善机会并追踪行动项目。支持 Sprint 和 Release 回顾类型,提供多种引导技法。
|
|
19
|
+
|
|
20
|
+
## 工作流程
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
PREPARE ──► GATHER ──► ANALYZE ──► DECIDE ──► TRACK
|
|
24
|
+
准备数据 搜集意见 分析归纳 决定行动 追踪落实
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### 阶段 1:PREPARE(准备)
|
|
28
|
+
|
|
29
|
+
从 git log、指标和 issue tracker 搜集数据作为讨论基础。
|
|
30
|
+
|
|
31
|
+
### 阶段 2:GATHER(搜集)
|
|
32
|
+
|
|
33
|
+
使用结构化技法搜集团队观点。
|
|
34
|
+
|
|
35
|
+
### 阶段 3:ANALYZE(分析)
|
|
36
|
+
|
|
37
|
+
分组归纳并识别模式。
|
|
38
|
+
|
|
39
|
+
### 阶段 4:DECIDE(决定)
|
|
40
|
+
|
|
41
|
+
选出前 1-3 项改善作为行动项目。
|
|
42
|
+
|
|
43
|
+
### 阶段 5:TRACK(追踪)
|
|
44
|
+
|
|
45
|
+
回顾过去的行动项目并追踪新项目。
|
|
46
|
+
|
|
47
|
+
## 回顾类型
|
|
48
|
+
|
|
49
|
+
| 类型 | 时机 | 时长 | 焦点 |
|
|
50
|
+
|------|------|------|------|
|
|
51
|
+
| **Sprint** | 迭代结束 | 30-60 分钟 | 流程、协作、工具 |
|
|
52
|
+
| **Release** | 发布之后 | 60-90 分钟 | 质量、指标、跨团队 |
|
|
53
|
+
|
|
54
|
+
## 引导技法
|
|
55
|
+
|
|
56
|
+
| 技法 | 适用场景 | 结构 |
|
|
57
|
+
|------|---------|------|
|
|
58
|
+
| **Start-Stop-Continue** | 快速、默认 | 开始 / 停止 / 继续 |
|
|
59
|
+
| **Starfish** | 细致分析 | 更多 / 保持 / 减少 / 开始 / 停止 |
|
|
60
|
+
| **4Ls** | 团队建设 | 喜欢 / 学到 / 缺少 / 渴望 |
|
|
61
|
+
| **Sailboat** | 可视化、创意 | 风 / 锚 / 礁石 / 岛屿 |
|
|
18
62
|
|
|
19
63
|
## 指令
|
|
20
64
|
|
|
21
65
|
| 指令 | 说明 |
|
|
22
66
|
|------|------|
|
|
23
|
-
| `/retrospective` | 交互式 Sprint
|
|
67
|
+
| `/retrospective` | 交互式 Sprint 回顾(默认) |
|
|
68
|
+
| `/retrospective sprint` | Sprint 回顾 |
|
|
24
69
|
| `/retrospective release` | Release 回顾(含指标) |
|
|
25
70
|
| `/retrospective actions` | 列出未完成行动项目 |
|
|
71
|
+
| `/retrospective --technique starfish` | 使用指定技法 |
|
|
26
72
|
|
|
27
|
-
##
|
|
73
|
+
## 行动项目格式
|
|
28
74
|
|
|
29
|
-
|
|
30
|
-
|
|
75
|
+
| 字段 | 说明 |
|
|
76
|
+
|------|------|
|
|
77
|
+
| **Action** | 具体描述 |
|
|
78
|
+
| **Owner** | 单一负责人 |
|
|
79
|
+
| **Due Date** | 预计完成日 |
|
|
80
|
+
| **Status** | Open → In Progress → Done |
|
|
31
81
|
|
|
82
|
+
### 追踪规则
|
|
32
83
|
|
|
33
|
-
|
|
84
|
+
1. 每次回顾**开始**先查看未完成项目
|
|
85
|
+
2. 每次回顾最多 **3 项**行动项目
|
|
86
|
+
3. 陈旧项目(超过 2 个周期未完成)须重新评估
|
|
87
|
+
4. 每项须有**单一负责人**
|
|
34
88
|
|
|
35
|
-
|
|
89
|
+
## 存放
|
|
36
90
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
91
|
+
```
|
|
92
|
+
docs/retrospectives/
|
|
93
|
+
├── RETRO-2026-03-15-sprint-12.md
|
|
94
|
+
├── RETRO-2026-03-26-release-v5.1.0.md
|
|
95
|
+
└── README.md # 索引(可选)
|
|
96
|
+
```
|
|
42
97
|
|
|
43
|
-
|
|
44
|
-
> - 提交回顧報告:`/commit`
|
|
45
|
-
> - 為識別的架構決策建立 ADR:`/adr`
|
|
46
|
-
> - 在 issue tracker 中追蹤行動項目
|
|
47
|
-
> - 排定下次回顧
|
|
98
|
+
## 与其他技能的集成
|
|
48
99
|
|
|
49
|
-
|
|
100
|
+
| 技能 | 集成方式 |
|
|
101
|
+
|------|---------|
|
|
102
|
+
| `/metrics` | 将指标数据引入 Release 回顾 |
|
|
103
|
+
| `/incident` | 事故后建议进行团队回顾 |
|
|
104
|
+
| `/adr` | 识别架构问题时建议建立 ADR |
|
|
105
|
+
| `/commit` | 以 `docs(retro):` 提交回顾报告 |
|
|
50
106
|
|
|
51
|
-
|
|
107
|
+
## 下一步引导
|
|
52
108
|
|
|
53
|
-
|
|
54
|
-
2. **Gather data** — Scan git log, check `docs/retrospectives/` for previous actions
|
|
55
|
-
3. **Guide technique** — Use Start-Stop-Continue by default, or specified technique
|
|
56
|
-
4. **Generate report** — Write to `docs/retrospectives/RETRO-YYYY-MM-DD-[type].md`
|
|
57
|
-
5. **Review past actions** — Check previous retro for open action items
|
|
58
|
-
6. **Offer next steps** — Show guidance above
|
|
109
|
+
`/retrospective` 完成后:
|
|
59
110
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
111
|
+
> **回顾完成。建议下一步:**
|
|
112
|
+
> - 提交回顾报告:`/commit`
|
|
113
|
+
> - 为识别的架构决策建立 ADR:`/adr`
|
|
114
|
+
> - 在 issue tracker 中追踪行动项目
|
|
115
|
+
> - 排定下次回顾
|
|
64
116
|
|
|
65
|
-
##
|
|
117
|
+
## AI 代理行为
|
|
66
118
|
|
|
67
|
-
|
|
68
|
-
|
|
119
|
+
当调用 `/retrospective` 时:
|
|
120
|
+
|
|
121
|
+
1. **确认类型** — Sprint(默认)或 Release
|
|
122
|
+
2. **搜集数据** — 扫描 git log,检查 `docs/retrospectives/` 中过去的行动项目
|
|
123
|
+
3. **引导技法** — 默认使用 Start-Stop-Continue,或使用指定技法
|
|
124
|
+
4. **生成报告** — 写入 `docs/retrospectives/RETRO-YYYY-MM-DD-[type].md`
|
|
125
|
+
5. **查看过去项目** — 检查先前回顾中未完成的行动项目
|
|
126
|
+
6. **提供下一步** — 显示上方引导
|
|
127
|
+
|
|
128
|
+
当调用 `/retrospective actions` 时:
|
|
129
|
+
1. 扫描 `docs/retrospectives/` 中所有回顾文件
|
|
130
|
+
2. 解析各文件中的行动项目
|
|
131
|
+
3. 以表格显示未完成/进行中的项目
|
|
132
|
+
|
|
133
|
+
## 参考
|
|
134
|
+
|
|
135
|
+
- 核心规范:[retrospective-standards.md](../../core/retrospective-standards.md)
|
|
136
|
+
- 详细指南:[guide.md](./guide.md)
|
|
@@ -1,76 +1,132 @@
|
|
|
1
1
|
---
|
|
2
2
|
source: ../../../../skills/reverse-engineer/SKILL.md
|
|
3
3
|
source_version: 1.2.0
|
|
4
|
+
source_hash: d543b24b2422
|
|
4
5
|
translation_version: 1.2.0
|
|
5
|
-
last_synced: 2026-
|
|
6
|
+
last_synced: 2026-06-01
|
|
6
7
|
status: current
|
|
7
8
|
description: |
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
关键字:reverse engineering, spec, bdd, tdd,
|
|
9
|
+
系统考古——跨逻辑、数据、运行时三维度逆向工程代码。
|
|
10
|
+
使用时机:从代码提取规格、分析数据模型、分析运行时基准、生成 Gherkin 场景、分析测试覆盖率。
|
|
11
|
+
关键字:reverse engineering, spec, data, runtime, bdd, tdd, 逆向工程, 规格, 覆盖率。
|
|
11
12
|
---
|
|
12
13
|
|
|
13
|
-
#
|
|
14
|
+
# 逆向工程助手
|
|
14
15
|
|
|
15
16
|
> **语言**: [English](../../../../skills/reverse-engineer/SKILL.md) | 简体中文
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
系统考古框架:从三个维度逆向工程既有系统——**逻辑**、**数据**、**运行时**。
|
|
19
|
+
|
|
20
|
+
## 三大维度
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
┌─────────────────────────────────────────────────────────┐
|
|
24
|
+
│ System Archeology Framework │
|
|
25
|
+
├──────────┬──────────────┬────────────────────────────────┤
|
|
26
|
+
│ Logic │ Data │ Runtime │
|
|
27
|
+
│ (spec) │ (data) │ (runtime) │
|
|
28
|
+
├──────────┼──────────────┼────────────────────────────────┤
|
|
29
|
+
│ APIs │ DB Schemas │ Logs & Error Patterns │
|
|
30
|
+
│ Modules │ ORMs/Models │ Config & Environment │
|
|
31
|
+
│ Flows │ Migrations │ Metrics & Performance │
|
|
32
|
+
│ Tests │ Seed Data │ Infra & Deployment │
|
|
33
|
+
└──────────┴──────────────┴────────────────────────────────┘
|
|
34
|
+
```
|
|
18
35
|
|
|
19
36
|
## 子命令
|
|
20
37
|
|
|
21
|
-
| 子命令 | 输入 | 输出 | 说明 |
|
|
22
|
-
|
|
23
|
-
|
|
|
24
|
-
| `
|
|
25
|
-
| `
|
|
38
|
+
| 子命令 | 维度 | 输入 | 输出 | 说明 |
|
|
39
|
+
|--------|------|------|------|------|
|
|
40
|
+
| *(无)* | 全部 | 项目根目录 | 完整考古报告 | 三维度全面分析 |
|
|
41
|
+
| `spec` | 逻辑 | 代码文件/目录 | `SPEC-XXX.md` | 从代码提取规格 |
|
|
42
|
+
| `data` | 数据 | DB 结构、ORM、迁移文件 | 数据模型规格 | 分析数据模型与结构 |
|
|
43
|
+
| `runtime` | 运行时 | 日志、配置、指标 | 运行时基准 | 分析运行时基准 |
|
|
44
|
+
| `bdd` | — | `SPEC-XXX.md` | `.feature` | 将 AC 转为 Gherkin |
|
|
45
|
+
| `tdd` | — | `.feature` | 覆盖率报告 | 分析测试覆盖率 |
|
|
46
|
+
|
|
47
|
+
## 全面分析模式
|
|
48
|
+
|
|
49
|
+
当 `/reverse` 在未带子命令的情况下被调用时,依序执行全部三个维度:
|
|
50
|
+
|
|
51
|
+
1. **数据(Data)** → 扫描结构、ORM、迁移文件
|
|
52
|
+
2. **运行时(Runtime)** → 分析日志、配置、部署
|
|
53
|
+
3. **逻辑(Logic / spec)** → 提取 API、流程、测试 → 生成 SPEC
|
|
54
|
+
|
|
55
|
+
输出:整合三个维度的 **系统考古报告(System Archeology Report)**。
|
|
26
56
|
|
|
27
|
-
##
|
|
57
|
+
## 维度详情
|
|
28
58
|
|
|
29
|
-
### spec
|
|
59
|
+
### spec:逻辑维度(既有)
|
|
30
60
|
|
|
31
|
-
1. **扫描** - 读取源代码文件,识别公开 API
|
|
61
|
+
1. **扫描** - 读取源代码文件,识别公开 API、数据流与业务逻辑
|
|
32
62
|
2. **分类** - 将每个发现标记为 `[Confirmed]`、`[Inferred]` 或 `[Unknown]`
|
|
33
63
|
3. **结构化** - 整理为 SDD 规格格式,包含验收条件
|
|
34
|
-
4. **引用来源** -
|
|
64
|
+
4. **引用来源** - 每项逆向结果皆以 `file:line` 引用来源
|
|
35
65
|
|
|
36
|
-
###
|
|
66
|
+
### data:数据维度(新增)
|
|
37
67
|
|
|
38
|
-
1.
|
|
39
|
-
2.
|
|
40
|
-
3.
|
|
41
|
-
4.
|
|
68
|
+
1. **探索** - 找出数据库结构、ORM 模型、迁移文件、种子数据
|
|
69
|
+
2. **映射** - 从代码证据建立实体关联模型
|
|
70
|
+
3. **分类** - 将关联标记为 `[Confirmed]`(FK 约束)或 `[Inferred]`(代码模式)
|
|
71
|
+
4. **报告** - 输出数据模型规格,包含:
|
|
72
|
+
- 含字段与类型的实体清单
|
|
73
|
+
- 关联映射(1:1、1:N、M:N)
|
|
74
|
+
- 索引与约束清单
|
|
75
|
+
- 迁移历史摘要
|
|
76
|
+
- 数据流路径(写入 → 读取)
|
|
42
77
|
|
|
43
|
-
|
|
78
|
+
**证据来源**:`schema.prisma`、`*.migration.*`、`models/`、`entities/`、`knexfile.*`、`sequelize`、`typeorm`、SQL 文件、`docker-compose.yml`(DB 服务)
|
|
44
79
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
80
|
+
### runtime:运行时维度(新增)
|
|
81
|
+
|
|
82
|
+
1. **扫描配置** - 环境变量、配置文件、功能开关
|
|
83
|
+
2. **分析日志** - 日志模式、错误频率、日志级别
|
|
84
|
+
3. **检查基础设施** - Docker 配置、CI/CD 流水线、部署清单
|
|
85
|
+
4. **建立基准** - 输出运行时基准,包含:
|
|
86
|
+
- 环境变量清单(仅名称,**绝不含值/密钥**)
|
|
87
|
+
- 配置文件映射与层级
|
|
88
|
+
- 外部服务依赖(API、队列、缓存)
|
|
89
|
+
- 部署拓扑(容器、服务)
|
|
90
|
+
- 健康检查与监控端点
|
|
91
|
+
|
|
92
|
+
**证据来源**:`.env.example`、`docker-compose.yml`、`Dockerfile`、`*.config.*`、CI/CD 文件、`k8s/`、日志文件(仅模式)
|
|
93
|
+
|
|
94
|
+
**安全性**:绝不输出实际密钥值。仅列出变量名称并描述其用途。
|
|
49
95
|
|
|
50
96
|
## 防幻觉规则
|
|
51
97
|
|
|
52
98
|
| 规则 | 要求 |
|
|
53
99
|
|------|------|
|
|
54
100
|
| **确定性标签** | 所有发现须使用 `[Confirmed]`、`[Inferred]`、`[Unknown]` 标注 |
|
|
55
|
-
| **来源引用** |
|
|
101
|
+
| **来源引用** | 每项逆向结果须引用 `file:line` 来源 |
|
|
56
102
|
| **禁止捏造** | 不得捏造代码中不存在的 API 或行为 |
|
|
103
|
+
| **禁止密钥** | 不得输出配置文件或环境变量的密钥值 |
|
|
57
104
|
|
|
58
105
|
## 使用方式
|
|
59
106
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
107
|
+
```
|
|
108
|
+
/reverse - 三维度全面分析
|
|
109
|
+
/reverse spec src/auth/ - 逻辑:提取规格
|
|
110
|
+
/reverse data - 数据:分析结构与模型
|
|
111
|
+
/reverse runtime - 运行时:分析配置与基础设施
|
|
112
|
+
/reverse bdd specs/SPEC-AUTH.md - 将规格 AC 转为 Gherkin
|
|
113
|
+
/reverse tdd features/auth.feature - 分析测试覆盖率
|
|
114
|
+
```
|
|
63
115
|
|
|
64
116
|
## 下一步引导
|
|
65
117
|
|
|
66
118
|
`/reverse`(完整或 `spec`)完成后,AI 助手应建议:
|
|
67
119
|
|
|
68
120
|
> **系统考古完成。建议下一步:**
|
|
69
|
-
> - 执行 `/sdd` 审查并核准此规格
|
|
70
|
-
> - 执行 `/derive` 从规格推导测试
|
|
71
|
-
> - 审查规格中的 `[Inferred]` 和 `[Unknown]` 标记
|
|
121
|
+
> - 执行 `/sdd` 审查并核准此规格 ⭐ **推荐** — 审查并核准生成的规格
|
|
122
|
+
> - 执行 `/derive` 从规格推导测试 — 从规格推导测试(须先核准)
|
|
123
|
+
> - 审查规格中的 `[Inferred]` 和 `[Unknown]` 标记 — 手动审查不确定性标签
|
|
72
124
|
|
|
73
125
|
## 参考
|
|
74
126
|
|
|
75
127
|
- 详细指南:[guide.md](./guide.md)
|
|
76
128
|
- 核心规范:[reverse-engineering-standards.md](../../../../core/reverse-engineering-standards.md)
|
|
129
|
+
|
|
130
|
+
## AI 代理行为
|
|
131
|
+
|
|
132
|
+
> 完整的 AI 行为定义请参阅对应的命令文件:[`/reverse`](../commands/reverse.md#ai-agent-behavior--ai-代理行为)
|