@elvis1513/auto-coding-skill 0.3.0 → 1.0.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/README.md CHANGED
@@ -5,9 +5,7 @@ Engineering workflow skill for:
5
5
  - Claude Code
6
6
  - Codex CLI
7
7
 
8
- This branch is specialized for Go backend + frontend monorepo projects that build Docker images locally, validate with project `docker compose`, and rely on Jenkins to auto-build and update target environments after push.
9
- It supports both Claude and Codex. During development, it prefers already available MCP servers, installed skills, plugins, and app connectors for design, research, documentation, verification, and external system updates.
10
- It also prefers multi-agent execution whenever the work can be split into parallel subtasks safely.
8
+ This skill targets Go backend + frontend monorepo projects that rely on Jenkins for build and deployment. The optimized default flow is lightweight locally, then Jenkins-first and target-environment-first for real verification.
11
9
 
12
10
  ## Install
13
11
 
@@ -21,6 +19,73 @@ Fallback:
21
19
  npm install -g git+https://github.com/elvis1513/auto-coding-skill.git
22
20
  ```
23
21
 
22
+ ## Release Notes
23
+
24
+ ### v0.3.1
25
+
26
+ - Added Jenkins crumb / CSRF retry support for API verification requests.
27
+ - Added finer-grained Jenkins folder / multibranch pipeline resolution.
28
+ - Added multibranch root job + branch child job support, with current Git branch inference when needed.
29
+ - Kept existing `verify-jenkins-build --git-ref` and direct `--job-url` / `--build-number` flows compatible.
30
+
31
+ ### v0.3.0
32
+
33
+ - Synced reusable workflow improvements from a production project back into this skill.
34
+ - Moved repo-side helper entrypoint to `docs/tools/autopipeline`.
35
+ - Tightened regression matrix rules: rows start as `TODO`, and `PASS` requires real execution evidence.
36
+ - Added Jenkins API verification flow with credentials sourced from `docs/ENGINEERING.md` or environment variables.
37
+
38
+ ## Optimized Standard Flow
39
+
40
+ 默认闭环:
41
+
42
+ `需求/任务记录 -> 最小设计 -> 开发 -> 本地轻量校验 -> commit/push -> Jenkins 构建部署 -> 目标环境验证 -> 闭环记录`
43
+
44
+ 具体执行顺序:
45
+
46
+ 1. 需求确认
47
+ - 明确任务范围、影响服务、是否涉及 API / 数据库 / 部署 / Jenkins / 前端页面。
48
+ 2. 最小设计记录
49
+ - 普通小改动只更新 `taskbook` 或相关设计文档的一小段。
50
+ - 跨模块、接口、数据库、部署、Jenkins、关键页面流程变更才补 DD。
51
+ 3. 开发实现
52
+ - 只修改本次任务必要文件,不做无关重构。
53
+ 4. 本地轻量校验
54
+ - build
55
+ - 单元测试或关键快速测试
56
+ - lint / typecheck
57
+ - API 文档检查
58
+ - Jenkinsfile / 脚本语法检查
59
+ - `git diff --check`
60
+ 5. 立即提交推送
61
+ - 本地轻量校验通过后,commit + push,触发 Jenkins。
62
+ 6. Jenkins 验证
63
+ - 看 Jenkins 构建、镜像、部署结果;失败则基于 Jenkins 日志修复并再次提交。
64
+ 7. 目标环境验证
65
+ - 在真实目标环境做健康检查、关键接口、关键页面或业务路径验证。
66
+ 8. 回归与证据记录
67
+ - 只有真实执行过 Jenkins / 目标环境验证,或明确要求本地运行验证时,才把 regression matrix 写成 `PASS`。
68
+ 9. 闭环记录
69
+ - 每个任务默认必须留下轻量闭环记录。
70
+
71
+ ## Default vs On-demand
72
+
73
+ 默认不做:
74
+ - 本地 Docker Compose 启动
75
+ - 本地 Docker build
76
+ - 本地完整 smoke / regression
77
+ - 每个小改动强制 `check-matrix`
78
+ - 每个小改动强制生成 summary
79
+ - 未真实执行就要求 regression matrix 全 `PASS`
80
+ - 未真实部署目标环境就生成 deployment record
81
+
82
+ 按需保留:
83
+ - `runtime-up` / `runtime-down`
84
+ - 本地 health / smoke / regression
85
+ - `check-matrix`
86
+ - `gen-summary`
87
+ - deployment runbook / deployment record
88
+
24
89
  ## Standard Workflow
25
90
 
26
91
  1. Install skill into project:
@@ -42,42 +107,48 @@ python3 .claude/skills/auto-coding-skill/scripts/ap.py --repo . install
42
107
 
43
108
  - `docs/ENGINEERING.md` frontmatter
44
109
 
45
- This frontmatter is the only manual config source (commands + local Docker runtime + Jenkins + docs paths).
110
+ This frontmatter is the only manual config source.
111
+
112
+ 重点字段:
113
+ - `commands.*`
114
+ - `target_env.*`
115
+ - `jenkins.*`
116
+ - `docs.*`
117
+
118
+ 默认必填:
119
+ - `project.name`
120
+ - `commands.build`
121
+ - `commands.quick_test` 或 `commands.test`
122
+ - `commands.lint` 或 `commands.typecheck`
123
+ - `target_env.name`
124
+ - `target_env.health_base_url`
125
+ - `target_env.health_path`
126
+ - `jenkins.trigger_branch`
127
+ - `jenkins.image_repository`
128
+ - `jenkins.image_tag_strategy`
129
+ - `jenkins.deploy_env`
130
+ - `jenkins.job_url` 或 `jenkins.base_url + jenkins.job_name` 或 `jenkins.base_url + jenkins.multibranch_root_job`
46
131
 
47
132
  4. Start AI development by constraints:
48
133
 
49
134
  - `docs/ENGINEERING.md`
50
135
  - `docs/tasks/taskbook.md`
51
- - `docs/design/**`
136
+ - `docs/tasks/closure-log.md`
52
137
  - `docs/interfaces/**`
53
138
  - `docs/testing/regression-matrix.md`
54
139
  - `docs/bugs/bug-list.md`
55
- - `docs/tasks/summaries/**`
56
140
 
57
141
  5. Tool selection rule during execution:
58
142
 
59
- - Prefer current MCP/skills/plugins/apps first.
60
- - Fall back to shell/manual work only when those capabilities are unavailable or insufficient.
143
+ - Prefer current MCP / skills / plugins / apps first.
144
+ - Fall back to shell / manual work only when those capabilities are unavailable or insufficient.
61
145
 
62
146
  6. Collaboration rule during execution:
63
147
 
64
148
  - Prefer multi-agent mode.
65
- - Split research, design, implementation, validation, and documentation into parallel subtasks whenever the boundaries are clear.
149
+ - Split research, design, implementation, verification, and documentation into parallel subtasks whenever the boundaries are clear.
66
150
  - Keep one main agent responsible for integration and final gates.
67
151
 
68
- 7. Delivery rule during execution:
69
-
70
- - Local `docker compose` validation must pass before commit.
71
- - `git push` is expected to trigger Jenkins automatically.
72
- - Task is not complete until Jenkins succeeds and the target environment health check passes.
73
-
74
- 8. Branch rule during execution:
75
-
76
- - `dev` is the long-lived integration branch.
77
- - If there is no parallel work conflict, prefer `dev`-first.
78
- - If the repo is in detached HEAD, worktree mode, or another task is already mutating `dev`, create a temporary task branch first.
79
- - Temporary branches should stay task-scoped and rebase back to latest `dev` before final integration.
80
-
81
152
  ## AGENTS.md Constraint Example
82
153
 
83
154
  ```md
@@ -86,115 +157,170 @@ This frontmatter is the only manual config source (commands + local Docker runti
86
157
  - Before any code change, read and obey:
87
158
  1) docs/ENGINEERING.md
88
159
  2) docs/tasks/taskbook.md
89
- - Execute gates using `python3 docs/tools/autopipeline/ap.py`.
160
+ - Execute workflow commands using `python3 docs/tools/autopipeline/ap.py`.
90
161
  - If required docs are missing, create/update docs first, then code.
162
+
163
+ ## Tooling Policy
164
+ - Prefer currently available MCP servers, installed skills, plugins, and app connectors before shell/manual work.
165
+ - When a connector or MCP can read or write the authoritative source directly, use it instead of retyping or duplicating state.
166
+
167
+ ## Multi-Agent Policy
168
+ - Default to multi-agent execution.
169
+ - Before substantial work, split into parallel subtasks whenever boundaries are clear:
170
+ 1) design / research
171
+ 2) backend implementation
172
+ 3) frontend implementation
173
+ 4) validation / documentation / review
174
+ - Keep one main agent responsible for task framing, integration, quality gates, and final delivery.
175
+
176
+ ## Default Gate Policy
177
+ - Default local gate is lightweight only.
178
+ - Do not require local Docker Compose or full local regression unless the task explicitly needs local runtime diagnosis.
179
+ - Push is not the finish line: Jenkins success, target environment verification, and closure record are mandatory.
91
180
  ```
92
181
 
93
182
  ## Docs Structure and Recording Rules
94
183
 
95
184
  ### 1) docs/ENGINEERING.md
96
- - Purpose: single source of project config + engineering gate rules.
185
+ - Purpose: single source of project config + workflow rules.
97
186
  - How to record:
98
- - Fill YAML frontmatter once (project/commands/runtime/jenkins/docs fields).
99
- - Keep all local runtime and Jenkins info here only (compose file/service/container/image/health/job/env).
100
- - Do not duplicate config in other docs.
187
+ - Fill YAML frontmatter once.
188
+ - Keep target env accounts, Jenkins UI/API accounts, commands, docs paths here only.
189
+ - Do not duplicate config elsewhere.
101
190
 
102
- ### 2) docs/deployment/
103
- - Files:
104
- - `docs/deployment/deploy-runbook.md`: local Compose validation + Jenkins deployment procedure.
105
- - `docs/deployment/deploy-records/<TASK_ID>-YYYYMMDD.md`: local validation + Jenkins deployment evidence.
191
+ ### 2) docs/tasks/taskbook.md
192
+ - Purpose: master task ledger.
106
193
  - How to record:
107
- - Record both local Compose validation and Jenkins deployment evidence: compose file, service, container, image tag, Jenkins build, deploy env, health checks.
194
+ - Every task writes scope, risk, impact area, minimal design note, acceptance, evidence links.
108
195
 
109
- ### 3) docs/design/
110
- - Files:
111
- - `docs/design/<TASK_ID>-<slug>.md` (from DD template).
112
- - Purpose:
113
- - Detailed design before coding (scope,方案、时序图、ER图、接口编排、测试策略、回滚).
196
+ ### 3) docs/tasks/closure-log.md
197
+ - Purpose: default lightweight closure record.
114
198
  - How to record:
115
- - One task/subtask one DD file.
116
- - Status changes: Draft -> Reviewed -> Approved.
199
+ - Append one record per task.
200
+ - Required fields: task, commit, Jenkins build, target env verification, result, follow-up.
201
+ - If Jenkins failed then was fixed, also record failure reason and fix commit.
117
202
 
118
- ### 4) docs/interfaces/
119
- - Files:
120
- - `docs/interfaces/api.md`: authoritative API documentation (current contract).
121
- - `docs/interfaces/api-change-log.md`: append-only API changes per task.
203
+ ### 4) docs/design/
204
+ - Purpose: DD for cross-module / API / DB / deployment / Jenkins / key-page-flow changes.
122
205
  - How to record:
123
- - API changes must update both files in the same task.
124
- - `api.md` records latest endpoint contract.
125
- - `api-change-log.md` appends task-level delta (新增/修改/废弃/兼容策略/影响面).
206
+ - Small changes do not need a standalone DD file.
207
+ - Higher-risk changes create `docs/design/<TASK_ID>-<slug>.md`.
126
208
 
127
- ### 5) docs/reviews/
209
+ ### 5) docs/interfaces/
128
210
  - Files:
129
- - `docs/reviews/<TASK_ID>-<timestamp>.md` (from review template).
130
- - Purpose:
131
- - Gate review evidence: static checks, Go + frontend quality, local Compose validation, Jenkins readiness, risks.
132
- - How to record:
133
- - Record commands used (lint/typecheck from docs/ENGINEERING.md frontmatter) and conclusion (Pass/Blocked).
134
-
135
- ### 6) docs/tasks/
136
- - Files:
137
- - `docs/tasks/taskbook.md`: master task ledger (all tasks appended here).
138
- - `docs/tasks/summaries/<TASK_ID>.md`: end-of-task summary artifact.
139
- - How to record:
140
- - `taskbook.md` stores task scope/acceptance/subtasks/evidence links.
141
- - `summaries/<TASK_ID>.md` stores final objective result, change overview, gate evidence, risks, follow-ups.
211
+ - `docs/interfaces/api.md`
212
+ - `docs/interfaces/api-change-log.md`
213
+ - Rule:
214
+ - Any API change updates both files in the same task.
215
+
216
+ ### 6) docs/testing/regression-matrix.md
217
+ - Purpose: on-demand regression evidence, not default gate for every small change.
218
+ - Rule:
219
+ - Only real executed items can be marked `PASS`.
220
+ - `check-matrix` is used only when full regression is explicitly required.
221
+
222
+ ### 7) docs/tasks/summaries/
223
+ - Purpose: optional long-form summary.
224
+ - Rule:
225
+ - Only for high-risk changes, milestones, or tasks that need full retrospective.
226
+
227
+ ### 8) docs/deployment/
228
+ - Purpose: optional heavy deployment audit docs.
229
+ - Rule:
230
+ - Only for manual deploys, high-risk releases, or explicit audit requirements.
231
+
232
+ ## High-risk Changes
233
+
234
+ These categories require stronger verification and usually a DD:
235
+ - Database migration
236
+ - Authentication / authorization
237
+ - Payment / order
238
+ - Deployment / Jenkins
239
+ - Nginx / gateway
240
+ - File upload / download
241
+ - Production configuration
242
+
243
+ For these tasks, target environment verification is mandatory.
142
244
 
143
- ### 7) docs/testing/
144
- - Files:
145
- - `docs/testing/regression-matrix.md`
146
- - Purpose:
147
- - Full regression matrix against the local Compose environment; must be 0 FAIL.
148
- - How to record:
149
- - Add rows by regression ID (R-xxx), area, steps/command, expected, status, evidence.
150
- - New or unexecuted rows must stay `TODO`.
151
- - `PASS` is valid only after real execution with non-placeholder evidence.
152
- - If any row is not `PASS`, or evidence is placeholder text, gate fails.
245
+ ## Commands
153
246
 
154
- ## Branch Policy
247
+ Recommended default flow:
155
248
 
156
- - `dev` is the only long-lived integration branch.
157
- - Temporary branches are preferred when parallel worktrees or concurrent tasks would otherwise collide on `dev`.
158
- - Temporary branches should be small, task-scoped, and rebased frequently against latest `dev`.
159
- - Final integration target remains `dev`; temporary branches are not release branches.
249
+ ```bash
250
+ pip install pyyaml requests
251
+ python3 docs/tools/autopipeline/ap.py doctor
252
+ python3 docs/tools/autopipeline/ap.py light-gate
253
+ python3 docs/tools/autopipeline/ap.py commit-push <TASK_ID> --msg "<TASK_ID>: <summary>" --require-light-gate --require-jenkins
254
+ python3 docs/tools/autopipeline/ap.py verify-jenkins-build --git-ref HEAD
255
+ python3 docs/tools/autopipeline/ap.py wait-health --scope target
256
+ python3 docs/tools/autopipeline/ap.py verify-target --backend-path /health --frontend-path /
257
+ python3 docs/tools/autopipeline/ap.py record-closure <TASK_ID> --commit HEAD --jenkins <build-url> --result PASS --verification "health check" --verification "key api" --verification "key page"
258
+ ```
160
259
 
161
- ## CI Trigger Strategy
260
+ Or let `commit-push` append the closure record directly:
162
261
 
163
- - Prefer split Jenkins behavior:
164
- - Branch or MR validation job for build/test/lint/typecheck and optional non-deploy runtime checks.
165
- - `dev` integration/deploy job for actual deployment-triggering pushes.
166
- - Avoid duplicate deploy triggers from both merge acceptance events and `dev` push events.
262
+ ```bash
263
+ python3 docs/tools/autopipeline/ap.py commit-push <TASK_ID> \
264
+ --msg "<TASK_ID>: <summary>" \
265
+ --require-light-gate \
266
+ --require-jenkins \
267
+ --record-closure \
268
+ --jenkins-build <build-url> \
269
+ --result PASS \
270
+ --verification "health check" \
271
+ --verification "key api" \
272
+ --verification "key page"
273
+ ```
167
274
 
168
- ## Commands
275
+ Available on-demand commands:
169
276
 
170
277
  ```bash
171
- pip install pyyaml requests
172
278
  python3 docs/tools/autopipeline/ap.py run build
173
279
  python3 docs/tools/autopipeline/ap.py run test
280
+ python3 docs/tools/autopipeline/ap.py run quick_test
174
281
  python3 docs/tools/autopipeline/ap.py run lint
175
282
  python3 docs/tools/autopipeline/ap.py run typecheck
176
- python3 docs/tools/autopipeline/ap.py run docker_build
283
+ python3 docs/tools/autopipeline/ap.py run script_syntax
284
+ python3 docs/tools/autopipeline/ap.py doctor
285
+ python3 docs/tools/autopipeline/ap.py verify-api-docs
286
+ python3 docs/tools/autopipeline/ap.py verify-jenkins
287
+ python3 docs/tools/autopipeline/ap.py verify-target --backend-path /health --frontend-path /
288
+ python3 docs/tools/autopipeline/ap.py verify-jenkins-build --job-name <job-name> --build-number <number>
289
+ python3 docs/tools/autopipeline/ap.py verify-jenkins-build --job-url <job-url> --build-number <number>
290
+ python3 docs/tools/autopipeline/ap.py verify-jenkins-build --multibranch-root-job <root-job> --branch-name <branch> --build-number <number>
177
291
  python3 docs/tools/autopipeline/ap.py runtime-up
178
- python3 docs/tools/autopipeline/ap.py wait-health
292
+ python3 docs/tools/autopipeline/ap.py wait-health --scope runtime
179
293
  python3 docs/tools/autopipeline/ap.py run smoke
180
294
  python3 docs/tools/autopipeline/ap.py run regression
181
295
  python3 docs/tools/autopipeline/ap.py runtime-down
182
- python3 docs/tools/autopipeline/ap.py verify-jenkins
183
- python3 docs/tools/autopipeline/ap.py verify-jenkins-build --git-ref HEAD
184
- python3 docs/tools/autopipeline/ap.py wait-health --scope prod
185
- python3 docs/tools/autopipeline/ap.py verify-api-docs
186
296
  python3 docs/tools/autopipeline/ap.py check-matrix
187
- python3 docs/tools/autopipeline/ap.py gen-summary T0001-1
188
- python3 docs/tools/autopipeline/ap.py commit-push T0001-1 --msg "T0001-1: <summary>" --require-runtime-health --require-jenkins --require-matrix
297
+ python3 docs/tools/autopipeline/ap.py gen-summary <TASK_ID>
189
298
  ```
190
299
 
191
- ## Quality Gate Expectations
192
-
193
- - Backend quality gate: `commands.test` must pass.
194
- - Frontend quality gate: at minimum `commands.build`, `commands.lint`, and `commands.typecheck` must pass.
195
- - Regression matrix rows must start as `TODO` until actually executed.
196
- - `PASS` requires real evidence, not placeholders.
197
- - Before final commit/push, clean temporary logs, screenshots, generated artifacts, and cache by-products. `.local/` may remain when it is the intended local runtime data directory.
300
+ ## Jenkins Build Tracking
301
+
302
+ - `verify-jenkins-build --git-ref HEAD`
303
+ - Use when Jenkins build descriptions include commit SHA and you want to find the latest build automatically.
304
+ - `verify-jenkins-build --job-name <folder/job> --build-number <N>`
305
+ - Use when you already know the Jenkins job and build number.
306
+ - `verify-jenkins-build --job-url <full-job-url> --build-number <N>`
307
+ - Use when you want to bypass configured job resolution.
308
+ - `verify-jenkins-build --multibranch-root-job <folder/repo> --branch-name <branch> --build-number <N>`
309
+ - Use for multibranch or organization-folder jobs where the branch is a child job.
310
+ - `verify-jenkins-build --multibranch-root-job <folder/repo> --git-ref HEAD`
311
+ - Use when the current Git branch should be inferred automatically.
312
+ - If Jenkins returns `403`, the script retries with crumb / CSRF handling automatically.
313
+
314
+ ## New Safeguards
315
+
316
+ - `doctor`
317
+ - Checks whether the default lightweight workflow is actually configured instead of silently skipping gates.
318
+ - `light-gate`
319
+ - Now fails if required commands are missing instead of returning `OK` after skipping everything.
320
+ - `verify-target`
321
+ - Performs real target-environment verification beyond health checks when you provide key backend/frontend paths.
322
+ - `commit-push --record-closure`
323
+ - Lets you append the closure record as part of the same close loop.
198
324
 
199
325
  ## Publish (NPM)
200
326
 
@@ -205,54 +331,35 @@ npm run sync-assets
205
331
  npm test
206
332
  ```
207
333
 
208
- 2. Bump version (required before every publish):
334
+ 2. Bump version:
209
335
 
210
336
  ```bash
211
337
  npm version patch
212
- # or: npm version minor
213
- # or: npm version major
338
+ # or: npm version minor / major
214
339
  ```
215
340
 
216
- `npm version` will update `package.json` and create a git tag.
217
-
218
- 3. Login and run release check:
341
+ 3. Release check:
219
342
 
220
343
  ```bash
221
- npm login
222
344
  npm whoami
223
345
  npm run release:check
224
346
  ```
225
347
 
226
- 4. Publish package:
348
+ 4. Publish:
227
349
 
228
350
  ```bash
229
351
  npm publish --access public
230
- # if your account requires 2FA OTP:
352
+ # or
231
353
  npm publish --access public --otp <6-digit-otp>
232
354
  ```
233
355
 
234
- 5. Verify and update clients:
356
+ 5. Verify and update:
235
357
 
236
358
  ```bash
237
359
  npm view @elvis1513/auto-coding-skill version
238
360
  npm install -g @elvis1513/auto-coding-skill@latest
239
361
  ```
240
362
 
241
- ### Common Publish Errors
242
-
243
- - `403 You cannot publish over the previously published versions`
244
- - Cause: same version already exists.
245
- - Fix: run `npm version patch` (or `minor`/`major`) then publish again.
246
- - `403 Two-factor authentication ... is required to publish`
247
- - Cause: publish requires 2FA.
248
- - Fix: use `npm publish --access public --otp <6-digit-otp>`.
249
- - `404 Not Found` when install
250
- - Cause: package not published successfully, or scope/name mismatch.
251
- - Fix: verify with `npm view @elvis1513/auto-coding-skill version` first.
252
- - `Access token expired or revoked`
253
- - Cause: npm auth token expired.
254
- - Fix: run `npm login` again and retry publish/install.
255
-
256
363
  ## License
257
364
 
258
365
  MIT
@@ -1,11 +1,13 @@
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
+ Prefer already available MCP servers, installed skills, plugins, and app connectors over ad-hoc manual work whenever they can complete the task reliably.
9
11
 
10
12
  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
13
 
@@ -23,21 +25,15 @@ Use available platform capabilities first:
23
25
  3) Prefer supported plugins/apps/connectors when they provide authoritative project context or can write back records.
24
26
  4) Fall back to manual shell/code workflows only when the above are unavailable, insufficient, or slower than direct execution.
25
27
 
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
28
  ## Collaboration policy
34
29
 
35
30
  Prefer multi-agent mode across the workflow:
36
31
 
37
32
  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.
33
+ 2) Keep the main agent on the critical path: task framing, design decisions, integration, Jenkins / target-env verification, and final closure.
34
+ 3) Use side agents for bounded work such as research, code slices, documentation updates, targeted regression checks, or review passes.
40
35
  4) Do not delegate a blocking architectural decision without keeping one agent responsible for final integration and correctness.
36
+ 5) A practical default split for Go fullstack work is: design/research, backend implementation, frontend implementation, validation/documentation.
41
37
 
42
38
  ## Entry
43
39
 
@@ -69,72 +65,80 @@ Fill only:
69
65
 
70
66
  This contains all manual fields:
71
67
  - `commands.*`
72
- - `runtime.*`
68
+ - `runtime.*` (only for optional local diagnostics)
69
+ - `target_env.*`
73
70
  - `jenkins.*`
74
71
  - `docs.*`
75
72
 
76
73
  Do not duplicate config in other md/yaml files.
77
74
 
78
- ## Branch policy
79
-
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.
75
+ Minimum required config for the default flow:
76
+ - `project.name`
77
+ - `commands.build`
78
+ - `commands.quick_test` or `commands.test`
79
+ - `commands.lint` or `commands.typecheck`
80
+ - `target_env.name`
81
+ - `target_env.health_base_url`
82
+ - `target_env.health_path`
83
+ - `jenkins.trigger_branch`
84
+ - `jenkins.image_repository`
85
+ - `jenkins.image_tag_strategy`
86
+ - `jenkins.deploy_env`
87
+ - `jenkins.job_url` or `jenkins.base_url + jenkins.job_name` or `jenkins.base_url + jenkins.multibranch_root_job`
88
88
 
89
- ## CI trigger strategy
89
+ ## Branch policy
90
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.
91
+ - `dev` is the long-lived integration branch.
92
+ - Use a temporary task branch only when parallel work would otherwise collide on `dev`.
93
+ - Keep temporary branches task-scoped and merge/rebase back into `dev` after closure.
95
94
 
96
95
  ## Execution order
97
96
 
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)
97
+ 1) read `docs/ENGINEERING.md`
98
+ 2) read / update `docs/tasks/taskbook.md`
99
+ 3) write minimal design notes; create a DD only when the change is cross-module, API, DB, deployment, Jenkins, or key-page-flow related
100
+ 4) implement only the necessary changes
101
+ 5) run the default local lightweight gate
102
+ 6) commit + push
103
+ 7) verify Jenkins build / deployment result
104
+ 8) verify the real target environment
105
+ 9) append `docs/tasks/closure-log.md`
106
+ 10) use summary / deployment record / regression matrix only when the task actually requires them
111
107
 
112
108
  ## Commands
113
109
 
110
+ Default commands:
111
+
112
+ ```bash
113
+ python3 docs/tools/autopipeline/ap.py doctor
114
+ python3 docs/tools/autopipeline/ap.py light-gate
115
+ python3 docs/tools/autopipeline/ap.py commit-push <TASK_ID> --msg "<TASK_ID>: <summary>" --require-light-gate --require-jenkins
116
+ python3 docs/tools/autopipeline/ap.py verify-jenkins-build --git-ref HEAD
117
+ python3 docs/tools/autopipeline/ap.py wait-health --scope target
118
+ python3 docs/tools/autopipeline/ap.py verify-target --backend-path /health --frontend-path /
119
+ python3 docs/tools/autopipeline/ap.py record-closure <TASK_ID> --commit HEAD --jenkins <build-url> --result PASS --verification "health check" --verification "key api"
120
+ ```
121
+
122
+ On-demand commands:
123
+
114
124
  ```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
125
  python3 docs/tools/autopipeline/ap.py runtime-up
121
- python3 docs/tools/autopipeline/ap.py wait-health
126
+ python3 docs/tools/autopipeline/ap.py wait-health --scope runtime
122
127
  python3 docs/tools/autopipeline/ap.py run smoke
123
128
  python3 docs/tools/autopipeline/ap.py run regression
124
129
  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
130
  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
131
+ python3 docs/tools/autopipeline/ap.py gen-summary <TASK_ID>
132
132
  ```
133
133
 
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/`.
134
+ ## Quality policy
135
+
136
+ - Default local gate is lightweight only: build, unit/quick test, lint, typecheck, API docs, Jenkinsfile / script syntax, `git diff --check`.
137
+ - `doctor` should be used early to catch missing config before the first implementation loop.
138
+ - `light-gate` now fails if the required default commands are not configured.
139
+ - Do not require local Docker Compose or full local regression for every small change.
140
+ - Jenkins and target environment verification are more valuable than repeated local simulation of deploy-only problems.
141
+ - `verify-target` should be used for real target-environment API/page checks when the task touches user-visible or deploy-sensitive behavior.
142
+ - `commit-push --record-closure` can close the loop in one command when Jenkins build URL and verification results are already known.
143
+ - `regression-matrix.md` can mark `PASS` only after real execution with evidence.
144
+ - High-risk changes must include target environment verification and usually a DD.