@elvis1513/auto-coding-skill 0.3.0 → 1.0.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.
@@ -1,11 +1,15 @@
1
1
  ---
2
2
  name: auto-coding-skill
3
- description: Use for strict Go fullstack monorepo engineering workflow in Claude/Codex. Initialize docs, fill docs/ENGINEERING.md frontmatter once, then execute design->implement->local-docker-gates->jenkins-trigger->verify.
3
+ description: Use for a lightweight Jenkins-first engineering workflow in Claude/Codex. Initialize docs, fill docs/ENGINEERING.md once, then execute task->minimal-design->light-gate->push->jenkins->target-env->closure.
4
4
  ---
5
5
 
6
6
  # Auto Coding Skill (Claude + Codex)
7
7
 
8
- This branch specializes the skill for Go backend + frontend monorepo projects that build Docker images locally and use Jenkins pipelines to auto-deploy after push. It supports both Claude and Codex. During design, research, implementation, verification, and delivery, prefer already available MCP servers, installed skills, plugins, and app connectors over ad-hoc manual work whenever they can complete the task reliably.
8
+ This skill is for Go backend + frontend monorepo projects that rely on Jenkins to build and deploy after push. It supports both Claude and Codex. The default workflow is lightweight locally, then uses Jenkins and the real target environment as the authoritative verification path.
9
+
10
+ `docs/ENGINEERING.md` is intentionally Git-tracked in this workflow. The remaining environment fields in that file are mandatory, must be filled with real values, and are committed as part of the project baseline. Unused environment keys should be removed from the template instead of being left as placeholders.
11
+
12
+ Prefer already available MCP servers, installed skills, plugins, and app connectors over ad-hoc manual work whenever they can complete the task reliably.
9
13
 
10
14
  Default to multi-agent execution when the client supports it. Break work into independent design, research, implementation, validation, and documentation subtasks so Claude/Codex can run them in parallel whenever that reduces cycle time without weakening control of the main task.
11
15
 
@@ -23,21 +27,15 @@ Use available platform capabilities first:
23
27
  3) Prefer supported plugins/apps/connectors when they provide authoritative project context or can write back records.
24
28
  4) Fall back to manual shell/code workflows only when the above are unavailable, insufficient, or slower than direct execution.
25
29
 
26
- Typical examples:
27
- - Design/UI work: prefer Figma MCP and related design skills.
28
- - Documentation/library lookup: prefer official docs and MCP-backed doc tools.
29
- - Project management or knowledge base updates: prefer Linear/Notion connectors if available.
30
- - Browser/runtime verification: prefer Playwright/browser tools if available.
31
- - Pipeline and deployment verification: prefer Jenkins-capable connectors, browser automation, or project-integrated tools if available.
32
-
33
30
  ## Collaboration policy
34
31
 
35
32
  Prefer multi-agent mode across the workflow:
36
33
 
37
34
  1) Split independent subtasks early when they can run in parallel.
38
- 2) Keep the main agent on the critical path: task framing, design decisions, integration, and final quality gates.
39
- 3) Use side agents for bounded work such as research, code slices, documentation updates, regression checks, or review passes.
35
+ 2) Keep the main agent on the critical path: task framing, design decisions, integration, Jenkins / target-env verification, and final closure.
36
+ 3) Use side agents for bounded work such as research, code slices, documentation updates, targeted regression checks, or review passes.
40
37
  4) Do not delegate a blocking architectural decision without keeping one agent responsible for final integration and correctness.
38
+ 5) A practical default split for Go fullstack work is: design/research, backend implementation, frontend implementation, validation/documentation.
41
39
 
42
40
  ## Entry
43
41
 
@@ -69,72 +67,93 @@ Fill only:
69
67
 
70
68
  This contains all manual fields:
71
69
  - `commands.*`
72
- - `runtime.*`
70
+ - `runtime.*` (only for optional local diagnostics)
71
+ - `target_env.*`
73
72
  - `jenkins.*`
74
73
  - `docs.*`
75
74
 
76
75
  Do not duplicate config in other md/yaml files.
76
+ Do not hide `docs/ENGINEERING.md` in `.gitignore`.
77
+
78
+ Minimum required config for the default flow:
79
+ - `project.name`
80
+ - `commands.build`
81
+ - `commands.quick_test` or `commands.test`
82
+ - `commands.lint` or `commands.typecheck`
83
+ - `target_env.name`
84
+ - `target_env.frontend_base_url`
85
+ - `target_env.frontend_username`
86
+ - `target_env.frontend_password`
87
+ - `target_env.backend_base_url`
88
+ - `target_env.backend_username`
89
+ - `target_env.backend_password`
90
+ - `target_env.health_base_url`
91
+ - `target_env.health_path`
92
+ - `jenkins.base_url`
93
+ - `jenkins.ui_username`
94
+ - `jenkins.ui_password`
95
+ - `jenkins.api_user`
96
+ - `jenkins.api_password`
97
+ - `jenkins.trigger_branch`
98
+ - `jenkins.image_repository`
99
+ - `jenkins.image_tag_strategy`
100
+ - `jenkins.deploy_env`
101
+ - `jenkins.job_url`
77
102
 
78
103
  ## Branch policy
79
104
 
80
- - `dev` remains the only long-lived integration branch.
81
- - Default behavior stays `dev`-first when there is no parallel work conflict.
82
- - If Claude or Codex is operating in a derived worktree, detached HEAD, or any parallel task context where another thread is already changing `dev`, prefer creating a temporary branch from the latest `dev` before editing.
83
- - Name temporary branches after the task, preferably `codex/<task-id>-<slug>` such as `codex/t0005-domestic-payment-site`.
84
- - Keep the temporary branch scoped to one task, complete design/implementation/verification there, then merge or rebase it back onto `dev` only after local gates pass.
85
- - Do not treat temporary branches as release branches; the final integration target is still `dev`.
86
- - In temporary-branch mode, work in small, closed-loop slices. Each slice should have a clear scope, synchronized docs, the relevant local validation, and a commit that can stand on its own.
87
- - Rebase temporary branches frequently against the latest `dev` to keep merge surfaces small.
88
-
89
- ## CI trigger strategy
90
-
91
- - Prefer a split Jenkins model when parallel worktrees are active:
92
- - MR or branch validation job: build/test/lint/typecheck and optional non-deploy runtime checks on temporary branches or merge requests.
93
- - `dev` integration/deploy job: trigger only from pushes that land on `dev`.
94
- - Do not rely on merge-request acceptance events to drive production deployment when a `dev` push event already exists; that commonly creates duplicate builds around merge time.
105
+ - `dev` is the long-lived integration branch.
106
+ - Use a temporary task branch only when parallel work would otherwise collide on `dev`.
107
+ - Keep temporary branches task-scoped and merge/rebase back into `dev` after closure.
95
108
 
96
109
  ## Execution order
97
110
 
98
- 1) choose branch mode (`dev` directly, or temporary branch if parallel worktree rules apply)
99
- 2) `docs/ENGINEERING.md`
100
- 3) `docs/tasks/taskbook.md`
101
- 4) `docs/design/**`
102
- 5) implementation
103
- 6) local build/test/lint gates
104
- 7) start and validate local Docker Compose runtime
105
- 8) update API docs + regression matrix + bug list + summary
106
- 9) verify Jenkins config / Jenkinsfile readiness
107
- 10) if temporary-branch mode is used, close one small slice at a time with reviewable commits and rebase regularly onto `dev`
108
- 11) merge/rebase temporary branch back to latest `dev` when temporary-branch mode was used
109
- 12) commit/push to trigger Jenkins
110
- 13) verify Jenkins pipeline + target environment health, preferably with `verify-jenkins-build --git-ref HEAD` (strict deploy check by default; use `--allow-no-deploy` only for docs-only sync verification)
111
+ 1) read `docs/ENGINEERING.md`
112
+ 2) read / update `docs/tasks/taskbook.md`
113
+ 3) write minimal design notes; create a DD only when the change is cross-module, API, DB, deployment, Jenkins, or key-page-flow related
114
+ 4) implement only the necessary changes
115
+ 5) run the default local lightweight gate
116
+ 6) commit + push
117
+ 7) verify Jenkins build / deployment result
118
+ 8) verify the real target environment
119
+ 9) append `docs/tasks/closure-log.md`
120
+ 10) use summary / deployment record / regression matrix only when the task actually requires them
111
121
 
112
122
  ## Commands
113
123
 
124
+ Default commands:
125
+
126
+ ```bash
127
+ python3 docs/tools/autopipeline/ap.py doctor
128
+ python3 docs/tools/autopipeline/ap.py light-gate
129
+ python3 docs/tools/autopipeline/ap.py commit-push <TASK_ID> --msg "<TASK_ID>: <summary>" --require-light-gate --require-jenkins
130
+ python3 docs/tools/autopipeline/ap.py verify-jenkins-build --git-ref HEAD
131
+ python3 docs/tools/autopipeline/ap.py wait-health --scope target
132
+ python3 docs/tools/autopipeline/ap.py verify-target --backend-path /health --frontend-path /
133
+ python3 docs/tools/autopipeline/ap.py record-closure <TASK_ID> --commit HEAD --jenkins <build-url> --result PASS --verification "health check" --verification "key api"
134
+ ```
135
+
136
+ On-demand commands:
137
+
114
138
  ```bash
115
- python3 docs/tools/autopipeline/ap.py run build
116
- python3 docs/tools/autopipeline/ap.py run test
117
- python3 docs/tools/autopipeline/ap.py run lint
118
- python3 docs/tools/autopipeline/ap.py run typecheck
119
- python3 docs/tools/autopipeline/ap.py run docker_build
120
139
  python3 docs/tools/autopipeline/ap.py runtime-up
121
- python3 docs/tools/autopipeline/ap.py wait-health
140
+ python3 docs/tools/autopipeline/ap.py wait-health --scope runtime
122
141
  python3 docs/tools/autopipeline/ap.py run smoke
123
142
  python3 docs/tools/autopipeline/ap.py run regression
124
143
  python3 docs/tools/autopipeline/ap.py runtime-down
125
- python3 docs/tools/autopipeline/ap.py verify-jenkins
126
- python3 docs/tools/autopipeline/ap.py verify-jenkins-build --git-ref HEAD
127
- python3 docs/tools/autopipeline/ap.py wait-health --scope prod
128
- python3 docs/tools/autopipeline/ap.py verify-api-docs
129
144
  python3 docs/tools/autopipeline/ap.py check-matrix
130
- python3 docs/tools/autopipeline/ap.py gen-summary T0001-1
131
- python3 docs/tools/autopipeline/ap.py commit-push T0001-1 --msg "T0001-1: <summary>" --require-runtime-health --require-jenkins --require-matrix
145
+ python3 docs/tools/autopipeline/ap.py gen-summary <TASK_ID>
132
146
  ```
133
147
 
134
- ## Quality gate expectations
135
-
136
- - Gate-4: backend must pass `commands.test`; frontend must at least pass `commands.build`, `commands.lint`, and `commands.typecheck`. Frontend automated tests are added incrementally when the repo gains them.
137
- - Gate-9: `docs/testing/regression-matrix.md` rows must start as `TODO` until they are actually executed.
138
- - A matrix row can be marked `PASS` only after real execution, and `Evidence` must contain non-placeholder logs, screenshots, or report paths.
139
- - `python3 docs/tools/autopipeline/ap.py check-matrix` should be treated as a hard gate; placeholder evidence is equivalent to incomplete regression.
140
- - Before the final commit/push, clean temporary files, logs, screenshots, generated verification artifacts, cache directories, and similar by-products created during the task. The only persistent local runtime data that may remain is `.local/`.
148
+ ## Quality policy
149
+
150
+ - Default local gate is lightweight only: build, unit/quick test, lint, typecheck, API docs, Jenkinsfile / script syntax, `git diff --check`.
151
+ - `doctor` should be used early to catch missing or invalid config before the first implementation loop.
152
+ - `light-gate` now fails if the required default commands are not configured.
153
+ - `doctor`, `light-gate`, and `commit-push` all fail when required environment fields are missing, placeholder-like, or syntactically invalid.
154
+ - Do not require local Docker Compose or full local regression for every small change.
155
+ - Jenkins and target environment verification are more valuable than repeated local simulation of deploy-only problems.
156
+ - `verify-target` should be used for real target-environment API/page checks when the task touches user-visible or deploy-sensitive behavior.
157
+ - `commit-push --record-closure` can close the loop in one command when Jenkins build URL and verification results are already known.
158
+ - `regression-matrix.md` can mark `PASS` only after real execution with evidence.
159
+ - High-risk changes must include target environment verification and usually a DD.
@@ -12,9 +12,12 @@ project:
12
12
  commands:
13
13
  build: ""
14
14
  test: ""
15
+ quick_test: ""
15
16
  lint: ""
16
17
  typecheck: ""
17
18
  format: ""
19
+ script_syntax: ""
20
+ diff_check: ""
18
21
  docker_build: ""
19
22
  compose_up: ""
20
23
  compose_down: ""
@@ -32,23 +35,33 @@ runtime:
32
35
  env_file: ""
33
36
  startup_timeout_sec: 120
34
37
 
38
+ target_env:
39
+ name: ""
40
+ frontend_base_url: ""
41
+ frontend_username: ""
42
+ frontend_password: ""
43
+ backend_base_url: ""
44
+ backend_username: ""
45
+ backend_password: ""
46
+ health_base_url: ""
47
+ health_path: ""
48
+
35
49
  jenkins:
36
- job_name: ""
50
+ base_url: ""
51
+ ui_username: ""
52
+ ui_password: ""
37
53
  job_url: ""
38
54
  trigger_branch: ""
39
55
  image_repository: ""
40
56
  image_tag_strategy: ""
41
57
  deploy_env: ""
42
58
  deploy_timeout_sec: 1800
43
- prod_health_base_url: ""
44
- prod_health_path: ""
45
59
  api_user: ""
46
- api_token: ""
47
- api_user_env: "JENKINS_USER"
48
- api_token_env: "JENKINS_TOKEN"
60
+ api_password: ""
49
61
 
50
62
  docs:
51
63
  taskbook: "docs/tasks/taskbook.md"
64
+ closure_log: "docs/tasks/closure-log.md"
52
65
  design_dir: "docs/design"
53
66
  review_dir: "docs/reviews"
54
67
  api_doc: "docs/interfaces/api.md"
@@ -58,40 +71,90 @@ docs:
58
71
  summary_dir: "docs/tasks/summaries"
59
72
  ---
60
73
 
61
- # docs/ENGINEERING.md — AutoPipeline Gates (Source of Truth)
74
+ # docs/ENGINEERING.md — Lightweight Default Workflow (Source of Truth)
62
75
 
63
- 目标:把一次任务固化为不可跳过的流水线:
64
- 读任务写DD实现本地构建/测试通过静态分析+Review落盘更新 API Markdown+接口变更清单
65
- 本地 Docker Compose 启动验证 → 本地健康检查 → 对本地环境全量回归 + 回归矩阵 0 fail →
66
- 记录 Bug 并新增自动化回归 → 任务总结落盘 → commit → push 触发 Jenkins → Jenkins 构建镜像并更新目标环境 →
67
- 生产健康检查通过
76
+ 目标:默认采用高效率开发闭环:
77
+ 需求/任务记录最小设计开发实现本地轻量校验commit/pushJenkins 构建部署 目标环境验证 闭环记录
68
78
 
69
- 规则:任一步骤失败或缺产物,禁止进入下一步;本地 compose 验证未通过禁止 commit;Jenkins 未成功或生产健康检查未通过,任务不视为完成。
79
+ 默认原则:
80
+ - 默认不要求本地 Docker Compose 启动。
81
+ - 默认不要求本地 Docker build。
82
+ - 默认不要求本地完整 smoke / regression。
83
+ - 默认不要求每个小改动生成长 summary。
84
+ - 默认不要求 regression matrix 全 PASS。
85
+ - 默认不要求 deployment record。
86
+ - Jenkins 构建结果和目标环境真实验证,比本地模拟更重要。
70
87
 
71
88
  补充规则:
72
- - 每次任务闭环后,必须清理临时文件、临时目录、日志、截图、回归中间产物、构建缓存等非必要产物;仅 `.local/` 下的本地运行数据允许保留。
89
+ - 每次任务闭环后,必须清理临时文件、临时目录、日志、截图、构建缓存等非必要产物;仅明确需要保留的本地诊断目录允许保留。
90
+ - 所有手工填写信息,只维护在本文件 frontmatter 中,其他文档不得重复配置。
91
+ - `docs/ENGINEERING.md` 必须提交到 Git 管理,不允许写入 `.gitignore`。
92
+ - 本 workflow 明确允许在 `docs/ENGINEERING.md` 中明文维护平台账号、密码,并随 Git 一起版本化。
93
+ - 未参与默认流程的环境项不要保留占位;模板中未保留的字段视为已清理,不再额外配置。
73
94
 
74
95
  ---
75
96
 
76
97
  ## 0. 配置填写(必须)
77
98
 
78
- 先填写 `docs/ENGINEERING.md` frontmatter 中的所有空值(例如 Go/前端目录、Docker 文件、Compose 服务、Jenkins Job、健康检查地址、命令)。
79
- 禁止在其他 md/yaml 重复维护这些配置。
99
+ 先填写 `docs/ENGINEERING.md` frontmatter 中的所有空值。重点包括:
100
+ - `commands.*`:本地轻量校验命令
101
+ - `target_env.*`:目标环境前端 / 后端地址、用户名、密码,必须全部填写且真实可用
102
+ - `jenkins.*`:Jenkins UI/API 用户名、密码、Job、分支、镜像、部署环境,必须全部填写且真实可用
103
+
104
+ 字段说明:
105
+ - `target_env.backend_username` / `target_env.backend_password`:目标环境后台账号
106
+ - `target_env.frontend_username` / `target_env.frontend_password`:目标环境前端登录账号
107
+ - `jenkins.ui_username` / `jenkins.ui_password`:Jenkins 页面登录账号
108
+ - `jenkins.api_user` / `jenkins.api_password`:Jenkins API 用户名 / 密码
109
+
110
+ 默认必填:
111
+ - `project.name`
112
+ - `commands.build`
113
+ - `commands.quick_test` 或 `commands.test`
114
+ - `commands.lint` 或 `commands.typecheck`
115
+ - `target_env.name`
116
+ - `target_env.frontend_base_url`
117
+ - `target_env.frontend_username`
118
+ - `target_env.frontend_password`
119
+ - `target_env.backend_base_url`
120
+ - `target_env.backend_username`
121
+ - `target_env.backend_password`
122
+ - `target_env.health_base_url`
123
+ - `target_env.health_path`
124
+ - `jenkins.ui_username`
125
+ - `jenkins.ui_password`
126
+ - `jenkins.api_user`
127
+ - `jenkins.api_password`
128
+ - `jenkins.trigger_branch`
129
+ - `jenkins.image_repository`
130
+ - `jenkins.image_tag_strategy`
131
+ - `jenkins.deploy_env`
132
+ - `jenkins.job_url`
133
+
134
+ 按需填写:
135
+ - `runtime.*`:仅在本地运行诊断时使用
136
+ - `commands.compose_up` / `commands.compose_down` / `commands.smoke` / `commands.regression`
80
137
 
81
138
  ---
82
139
 
83
140
  ## 1. 权威输入与冲突裁决(优先级)
84
141
 
85
- 1) docs/ENGINEERING.md(本文件)
86
- 2) docs/tasks/taskbook.md
87
- 3) docs/design/**
88
- 4) docs/interfaces/api.md
89
- 5) docs/interfaces/api-change-log.md
90
- 6) docs/testing/regression-matrix.md(必须 0 FAIL)
91
- 7) docs/bugs/bug-list.md(长期积累,回归必测)
92
- 8) docs/tasks/summaries/**(每任务一份,强制产物)
93
- 9) docs/deployment/**
94
- 10) 代码实现(不得反向覆盖 1~9)
142
+ 1) `docs/ENGINEERING.md`
143
+ 2) `docs/tasks/taskbook.md`
144
+ 3) `docs/design/**`
145
+ 4) `docs/interfaces/api.md`
146
+ 5) `docs/interfaces/api-change-log.md`
147
+ 6) `docs/testing/regression-matrix.md`
148
+ 7) `docs/bugs/bug-list.md`
149
+ 8) `docs/tasks/closure-log.md`
150
+ 9) `docs/tasks/summaries/**`
151
+ 10) `docs/deployment/**`
152
+ 11) 代码实现
153
+
154
+ 说明:
155
+ - `closure-log.md` 是每个任务默认必须留下的轻量闭环记录。
156
+ - `summaries/**` 只用于跨模块、高风险、阶段性里程碑、需要完整复盘的任务。
157
+ - `deployment/**` 只用于真实部署记录、手工发布或高风险发布场景。
95
158
 
96
159
  ---
97
160
 
@@ -99,56 +162,116 @@ docs:
99
162
 
100
163
  优先使用当前环境已安装、已授权、已可访问的工具能力:
101
164
 
102
- 1) MCP servers
103
- 2) 已安装 skills
104
- 3) plugins / apps / connectors
165
+ 1) MCP servers
166
+ 2) 已安装 skills
167
+ 3) plugins / apps / connectors
105
168
  4) shell / 手工实现
106
169
 
107
170
  规则:
108
- - 做设计、查资料、看文档、看页面、查知识库、写回外部系统时,优先调用现有 MCP / skills / plugins / apps。
109
- - 能用权威工具直接完成时,不重复手写中间数据。
110
- - 工具不可用、无权限、结果不可靠时,才回退到本地命令或手工处理。
111
- - 选择工具时优先“已安装且当前项目可直接使用”的能力,而不是重新造流程。
112
- - 查看 Jenkins、知识库、设计稿、页面、缺陷系统时,优先使用现成的连接器或 MCP,而不是手工拼接上下文。
171
+ - 做设计、查资料、查文档、查 Jenkins、查页面、写回外部系统时,优先调用现成能力。
172
+ - 工具不可用、权限不足、结果不可靠时,才回退到 shell 或手工流程。
173
+ - 不重复手写工具已经能直接读取或写回的权威数据。
113
174
 
114
175
  ---
115
176
 
116
177
  ## 1.6 多 Agent 协作策略(Claude / Codex 专属)
117
178
 
118
- 整个流程尽可能使用多 agent 模式并行推进。
179
+ 整个流程尽可能使用多 agent 并行推进。
119
180
 
120
181
  规则:
121
- - 任务开始后,优先拆分为可并行的子任务:设计补充、资料检索、实现分块、测试验证、文档回写、review。
122
- - agent 负责关键路径:任务定义、方案裁决、代码集成、质量门禁、最终交付。
123
- - agent 负责边界清晰、可独立推进的工作,完成后回收结果给主 agent 集成。
124
- - 如果某项工作会直接阻塞主路径且难以独立定义,不要机械拆分;由主 agent 保持控制。
125
- - 能并行就不要串行;能拆独立 write scope 就不要让多个 agent 写同一块内容。
182
+ - 主 agent 负责任务定义、方案裁决、代码集成、轻量门禁、Jenkins/目标环境闭环、最终交付。
183
+ - agent 优先拆为:设计/调研、后端实现、前端实现、验证/文档。
184
+ - 任务边界不清或需要强一致裁决时,由主 agent 保持控制,不机械拆分。
185
+
186
+ ---
187
+
188
+ ## 2. 标准流程(默认)
189
+
190
+ 1. 需求确认
191
+ 明确任务范围、影响服务、是否涉及 API/数据库/部署/Jenkins/前端页面。
192
+
193
+ 2. 最小设计记录
194
+ 普通小改动只更新 `taskbook` 或设计文档中的最小必要段落;跨模块、接口、数据库、部署、Jenkins、关键页面流程变更才补 DD。
195
+
196
+ 3. 开发实现
197
+ 只修改本次任务必要文件,不做无关重构。
198
+
199
+ 4. 本地轻量校验
200
+ 默认只跑:
201
+ - 编译 / build
202
+ - 单元测试或关键快速测试
203
+ - lint / typecheck
204
+ - API 文档检查
205
+ - Jenkinsfile / 脚本语法检查
206
+ - `git diff --check`
207
+
208
+ 5. 立即提交推送
209
+ 轻量校验通过后,commit + push,触发 Jenkins。
210
+
211
+ 6. Jenkins 验证
212
+ 查看 Jenkins 构建、镜像、部署结果;失败则根据 Jenkins 日志修复,再次提交推送。
213
+
214
+ 7. 目标环境验证
215
+ 在真实目标环境做健康检查、关键接口、关键页面或业务路径验证。
216
+
217
+ 8. 回归与证据记录
218
+ 只有真实执行过 Jenkins / 目标环境验证,或显式要求本地运行验证时,才允许把 `regression-matrix.md` 标为 `PASS`。
219
+
220
+ 9. 闭环记录
221
+ 每个任务必须留下轻量闭环记录:任务 ID、提交号、Jenkins Build URL、目标环境验证结果、是否通过、遗留问题。
222
+
223
+ 10. 配置入库
224
+ `docs/ENGINEERING.md` 中保留下来的环境信息、前端/后端账号、Jenkins 账号与密码必须 100% 填写、正确填写,并提交 Git 作为项目权威配置持续维护。
126
225
 
127
226
  ---
128
227
 
129
- ## 2. Gate 流水线(强制、不可跳过)
130
-
131
- Gate-1 读任务:只从 taskbook 取范围与验收;缺信息先补 taskbook
132
- Gate-2 写DD:无DD禁止写代码;DD必须含 时序图/ER图/接口时序(Mermaid)
133
- Gate-3 实现:严格按DD;接口变更必须同步 API Markdown
134
- Gate-4 本地CI:后端必须通过 `commands.test`;前端至少通过 `commands.build`、`commands.lint`、`commands.typecheck`;前端自动化测试能力逐步补齐
135
- Gate-5 静态分析+Review:静态分析通过;docs/reviews/ 生成记录
136
- Gate-6 文档:更新 api.md + 追加 api-change-log.md
137
- Gate-7 本地运行:必须用项目 Compose 启动本地 Docker 环境;失败先修复再继续
138
- Gate-8 健康检查:本地容器启动后必须健康检查通过
139
- Gate-9 全量回归:按 API Markdown 对本地 Compose 环境全量回归;回归矩阵仅可在真实执行后标记 PASS,且必须附证据;发现问题必须写 bug-list 并新增自动化回归用例
140
- Gate-10 Jenkins 准备:Jenkinsfile、Job 配置、镜像仓库策略必须可用
141
- Gate-11 任务总结:必须生成 docs/tasks/summaries/<TASK_ID>.md
142
- Gate-12 提交触发:本地门禁全过且临时产物已清理后,才允许 commit+push
143
- Gate-13 流水线验证:push 后必须确认 Jenkins 自动构建、镜像发布、目标环境更新成功
144
- Gate-14 完成:生产健康检查通过并补齐部署记录后,任务才完成
228
+ ## 3. 高风险变更(必须补强验证)
229
+
230
+ 以下类型默认视为高风险变更:
231
+ - 数据库迁移
232
+ - 鉴权 / 权限
233
+ - 支付 / 订单
234
+ - 部署 / Jenkins
235
+ - Nginx / 网关
236
+ - 文件上传 / 下载
237
+ - 生产配置
238
+
239
+ 高风险变更至少额外要求:
240
+ - 明确 DD
241
+ - 目标环境真实验证
242
+ - 闭环记录写清楚验证路径和结果
243
+ - 必要时补 summary / deployment record / regression matrix
244
+
245
+ ---
246
+
247
+ ## 4. 本地 Docker 与完整回归(按需,不默认)
248
+
249
+ 以下能力保留,但仅用于显式要求、问题复现、Jenkins/目标环境问题前置诊断:
250
+ - `runtime-up`
251
+ - `runtime-down`
252
+ - 本地 health check
253
+ - 本地 `smoke`
254
+ - 本地 `regression`
255
+ - `check-matrix`
256
+ - `gen-summary`
257
+
258
+ 默认情况下,不把它们作为每个小改动的固定门禁。
145
259
 
146
260
  ---
147
261
 
148
- ## 3. Repo 工具入口
262
+ ## 5. Repo 工具入口
149
263
 
150
- 统一用 `python3 docs/tools/autopipeline/ap.py <command>` 执行。
264
+ 统一使用:
265
+ - `python3 docs/tools/autopipeline/ap.py doctor`
266
+ - `python3 docs/tools/autopipeline/ap.py light-gate`
267
+ - `python3 docs/tools/autopipeline/ap.py verify-jenkins-build ...`
268
+ - `python3 docs/tools/autopipeline/ap.py wait-health --scope target`
269
+ - `python3 docs/tools/autopipeline/ap.py verify-target ...`
270
+ - `python3 docs/tools/autopipeline/ap.py record-closure <TASK_ID> ...`
151
271
 
152
- 补充:
153
- - `commands.smoke` / `commands.regression` 可以封装 repo 脚本,但必须真正在本地运行目标系统。
154
- - `docs/testing/regression-matrix.md` 中的 `PASS` 只在真实执行并填入证据后允许保留;占位符证据会被视为未完成。
272
+ 说明:
273
+ - `doctor`:检查默认流程必填项和常见配置错误。
274
+ - `light-gate`:默认轻量门禁。
275
+ - `verify-target`:目标环境健康检查 + 按需关键 API / 页面验证。
276
+ - `record-closure`:默认轻量闭环记录。
277
+ - `check-matrix`、`gen-summary`、`runtime-up/down`:保留为按需工具。
@@ -1,4 +1,5 @@
1
- Follow docs/ENGINEERING.md strictly. Source of truth: docs/ENGINEERING.md.
1
+ Follow `docs/ENGINEERING.md` strictly. Source of truth: `docs/ENGINEERING.md`.
2
2
  Prefer already available MCP servers, installed skills, plugins, and app connectors during design, research, verification, and documentation workflows.
3
3
  Prefer multi-agent mode whenever the task can be split into independent parallel subtasks without weakening integration control.
4
- For Go monorepo + Jenkins projects, local Docker Compose validation must pass before commit, and push is expected to trigger Jenkins pipeline verification.
4
+ Default to the lightweight local gate first, then use Jenkins build verification and real target-environment verification as the primary completion gate.
5
+ Local Docker Compose and full local regression are on-demand diagnostic tools, not the default gate for every small change.
@@ -1,4 +1,5 @@
1
- Follow docs/ENGINEERING.md strictly. Source of truth: docs/ENGINEERING.md.
1
+ Follow `docs/ENGINEERING.md` strictly. Source of truth: `docs/ENGINEERING.md`.
2
2
  Prefer already available MCP servers, installed skills, plugins, and app connectors during design, research, verification, and documentation workflows.
3
3
  Prefer multi-agent mode whenever the task can be split into independent parallel subtasks without weakening integration control.
4
- For Go monorepo + Jenkins projects, local Docker Compose validation must pass before commit, and push is expected to trigger Jenkins pipeline verification.
4
+ Default to the lightweight local gate first, then use Jenkins build verification and real target-environment verification as the primary completion gate.
5
+ Local Docker Compose and full local regression are on-demand diagnostic tools, not the default gate for every small change.
@@ -1,28 +1,19 @@
1
1
  # Deploy Record — <Task ID> — YYYY-MM-DD
2
2
 
3
- ## 1. Local Compose Validation
4
- - Docker compose file:
5
- - Docker service:
6
- - Container name:
7
- - Image/tag:
8
- - Exposed port:
9
- - Env file:
10
- - Local health URL:
3
+ > 仅在真实需要独立部署审计记录时使用。
11
4
 
12
- ## 2. Jenkins Pipeline
13
- - Jenkins job name:
14
- - Jenkins build number:
15
- - Jenkins build URL:
16
- - Trigger branch:
17
- - Trigger commit:
18
- - Image repository:
19
- - Published image tag:
20
- - Deploy environment:
5
+ ## 1. Deployment Context
6
+ - Task ID:
7
+ - Commit:
8
+ - Jenkins Build:
9
+ - Target Env:
21
10
 
22
- ## 3. Evidence
23
- - docker ps / compose ps:
24
- - local_health_check:
25
- - smoke_test:
26
- - api_regression:
27
- - jenkins_result:
28
- - production_health_check:
11
+ ## 2. Verification
12
+ - Health check:
13
+ - Key API:
14
+ - Key page / business path:
15
+
16
+ ## 3. Notes
17
+ - Risk:
18
+ - Rollback:
19
+ - Follow-up:
@@ -1,19 +1,11 @@
1
- # Deployment Runbook(本地 Compose 验证 + Jenkins 自动部署)
1
+ # Deployment Runbook(按需使用,不是默认小改动产物)
2
2
 
3
- 统一读取:`docs/ENGINEERING.md` frontmatter
4
- - `runtime.*`:本地 Compose 启动与健康检查
5
- - `jenkins.*`:Jenkins Job、镜像仓库、目标环境、生产健康检查
3
+ 用途:
4
+ - 手工部署
5
+ - 高风险发布
6
+ - 需要额外审计证据的发布
6
7
 
7
- 执行顺序:
8
- 1. 本地构建、测试、lint、typecheck 通过
9
- 2. 本地 `docker compose` 启动目标服务
10
- 3. 本地 health / smoke / regression 全部通过
11
- 4. `commit + push`
12
- 5. Jenkins 自动触发,完成镜像构建、镜像推送、目标环境更新
13
- 6. 检查 Jenkins 结果与目标环境健康状态
14
-
15
- 完成条件:
16
- - 本地 Compose 验证通过
17
- - Jenkins Pipeline 成功
18
- - 目标环境健康检查通过
19
- - `docs/deployment/deploy-records/<TASK_ID>-YYYYMMDD.md` 证据补齐
8
+ 默认情况下:
9
+ - 小改动直接走 Jenkins 自动构建与自动部署
10
+ - 主要闭环证据写入 `docs/tasks/closure-log.md`
11
+ - 只有需要更重的发布审计时,才补本目录文档
@@ -1,16 +1,25 @@
1
1
  # Review — <Task ID> — YYYY-MM-DD HH:MM
2
2
 
3
- ## 1. 静态分析结果(必须)
4
- - Command:lint + typecheck(来自 docs/ENGINEERING.md frontmatter)
3
+ > 仅在任务需要独立 review 记录时使用;不是每个小改动的默认强制文档。
4
+
5
+ ## 1. 静态分析结果
6
+ - Command:lint / typecheck / script_syntax / diff_check
5
7
  - Summary:
6
8
  - Issues:
7
- - Resolved/Deferred(deferred 必须给出后续任务):
8
9
 
9
- ## 2. 代码质量
10
- ## 3. 本地构建与测试质量(后端 test + 前端 build/lint/typecheck)
11
- ## 4. 本地 Compose 验证(health / smoke / regression)
12
- ## 5. 接口契约(API Markdown + change-log)
13
- ## 6. Jenkins 准备度(Jenkinsfile / job config / image strategy)
14
- ## 7. 安全与性能
15
- ## 8. 风险与回滚
16
- ## 9. 结论(Pass / Blocked)
10
+ ## 2. 本地轻量校验
11
+ - build
12
+ - test or quick_test:
13
+ - api docs:
14
+ - jenkinsfile / scripts:
15
+
16
+ ## 3. 按需本地运行验证(如果有)
17
+ - runtime-up / health / smoke / regression:
18
+
19
+ ## 4. Jenkins 与目标环境
20
+ - Jenkins readiness:
21
+ - Target env verification:
22
+
23
+ ## 5. 风险与结论
24
+ - Risk:
25
+ - Conclusion:Pass / Blocked