@elvis1513/auto-coding-skill 2.0.5 → 2.1.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 +63 -0
- package/cli/assets/agents/explorer.toml +8 -6
- package/cli/assets/agents/fixer.toml +8 -7
- package/cli/assets/agents/reviewer.toml +7 -6
- package/cli/assets/skill/SKILL.md +36 -8
- package/cli/assets/skill/data/templates/ENGINEERING.md +67 -0
- package/cli/assets/skill/data/templates/bridges/CLAUDE.md +3 -0
- package/cli/assets/skill/data/templates/bridges/CODEX.md +3 -0
- package/cli/assets/skill/data/templates/docs/architecture/structure-standard.md +16 -0
- package/cli/assets/skill/data/templates/docs/reviews/_TEMPLATE-REVIEW.md +2 -0
- package/cli/assets/skill/data/templates/docs/tasks/closure-log.md +1 -0
- package/cli/assets/skill/data/templates/docs/tasks/summaries/_TEMPLATE-TASK-SUMMARY.md +2 -0
- package/cli/assets/skill/data/templates/docs/tasks/taskbook.md +1 -0
- package/cli/assets/skill/scripts/ap.py +870 -8
- package/cli/src/index.js +194 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,6 +23,22 @@ npm install -g git+https://github.com/elvis1513/auto-coding-skill.git
|
|
|
23
23
|
|
|
24
24
|
## Release Notes
|
|
25
25
|
|
|
26
|
+
### v2.1.0
|
|
27
|
+
|
|
28
|
+
- Added project upgrade support: `ap.py upgrade --dry-run|--write` safely syncs tooling and merges missing `docs/ENGINEERING.md` keys without overwriting existing values.
|
|
29
|
+
- Added baseline initialization: `ap.py baseline init --write --update-config` scans large files/hotspots, creates health baseline + optimization backlog, and can seed `structure.accepted_debt_paths`.
|
|
30
|
+
- Added configurable structure import-boundary checks through `structure.layer_rules`.
|
|
31
|
+
- Added local gate profiling: configured gate commands write `.local/auto-coding-skill/gate-profile.jsonl`, summarized by `ap.py gate-profile`.
|
|
32
|
+
- Added multi-project npm CLI operations: `autocoding status --projects ...` and `autocoding sync --projects ...`.
|
|
33
|
+
- Added structured evidence logging to `docs/tasks/evidence.jsonl` for classify, doctor, structure-check, gates, verification, and closure.
|
|
34
|
+
- Added task classification: `ap.py classify --scope auto` reports risk, categories, required DD/ADR/browser/Jenkins/target checks, and recommended commands.
|
|
35
|
+
|
|
36
|
+
### v2.0.6
|
|
37
|
+
|
|
38
|
+
- Fixed `structure-check --json` so successful output stays machine-readable JSON without a trailing OK line.
|
|
39
|
+
- Moved CLI error messages to stderr, preserving JSON stdout for failing machine-readable commands.
|
|
40
|
+
- Made `structure.enabled: false` disable structure gate integration even when `commands.structure_check` is still present.
|
|
41
|
+
|
|
26
42
|
### v2.0.5
|
|
27
43
|
|
|
28
44
|
- Added generic engineering-structure governance: `docs/architecture/structure-standard.md`, ADR template, project health baseline, and optimization backlog templates.
|
|
@@ -235,14 +251,60 @@ The default project scaffold includes a generic professional structure standard:
|
|
|
235
251
|
Useful commands:
|
|
236
252
|
|
|
237
253
|
```bash
|
|
254
|
+
python3 docs/tools/autopipeline/ap.py classify --scope auto
|
|
238
255
|
python3 docs/tools/autopipeline/ap.py structure-check --scope auto
|
|
239
256
|
python3 docs/tools/autopipeline/ap.py structure-check --scope full
|
|
240
257
|
python3 docs/tools/autopipeline/ap.py light-gate --scope auto --explain
|
|
258
|
+
python3 docs/tools/autopipeline/ap.py baseline init --write --update-config
|
|
259
|
+
python3 docs/tools/autopipeline/ap.py gate-profile
|
|
260
|
+
python3 docs/tools/autopipeline/ap.py upgrade --dry-run
|
|
241
261
|
```
|
|
242
262
|
|
|
243
263
|
`structure-check` is intentionally generic. Project-specific paths and stricter rules belong in `docs/ENGINEERING.md` under `structure.*`, `optimization.*`, and optional `commands.structure_check`.
|
|
244
264
|
Historical large-file debt can be listed in `structure.accepted_debt_paths` after it is recorded in the health baseline or optimization backlog; continued large additions to those files still fail.
|
|
245
265
|
|
|
266
|
+
## Project Upgrade
|
|
267
|
+
|
|
268
|
+
For existing projects, do not rerun initialization blindly. Use:
|
|
269
|
+
|
|
270
|
+
```bash
|
|
271
|
+
python3 docs/tools/autopipeline/ap.py upgrade --dry-run
|
|
272
|
+
python3 docs/tools/autopipeline/ap.py upgrade --write
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
`upgrade` updates autopipeline scripts, syncs project-local `.agents` skill copies when present, creates missing template docs, and merges only missing frontmatter keys into `docs/ENGINEERING.md`.
|
|
276
|
+
|
|
277
|
+
## Baseline And Evidence
|
|
278
|
+
|
|
279
|
+
Initialize a project health baseline:
|
|
280
|
+
|
|
281
|
+
```bash
|
|
282
|
+
python3 docs/tools/autopipeline/ap.py baseline init --write --update-config
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
This creates:
|
|
286
|
+
|
|
287
|
+
- `docs/reviews/project-health-baseline.md`
|
|
288
|
+
- `docs/reviews/optimization-backlog.md`
|
|
289
|
+
- optional `structure.accepted_debt_paths` entries for existing large files
|
|
290
|
+
|
|
291
|
+
Execution evidence is written as JSONL:
|
|
292
|
+
|
|
293
|
+
- `docs/tasks/evidence.jsonl`
|
|
294
|
+
- `.local/auto-coding-skill/gate-profile.jsonl`
|
|
295
|
+
|
|
296
|
+
Use `python3 docs/tools/autopipeline/ap.py gate-profile` to summarize command duration and failure history.
|
|
297
|
+
|
|
298
|
+
## Multi-project Sync
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
autocoding status --projects /path/to/repo1,/path/to/repo2
|
|
302
|
+
autocoding sync --projects /path/to/repo1,/path/to/repo2 --dry-run
|
|
303
|
+
autocoding sync --projects /path/to/repo1,/path/to/repo2
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
`status` reports drift in `.agents`, Codex agents, autopipeline scripts, missing template docs, and missing config keys. `sync` updates generated assets and creates missing docs, but leaves `docs/ENGINEERING.md` to `ap.py upgrade --write`.
|
|
307
|
+
|
|
246
308
|
## AGENTS.md Constraint Example
|
|
247
309
|
|
|
248
310
|
```md
|
|
@@ -279,6 +341,7 @@ Historical large-file debt can be listed in `structure.accepted_debt_paths` afte
|
|
|
279
341
|
|
|
280
342
|
## Default Gate Policy
|
|
281
343
|
- Default local gate is lightweight only.
|
|
344
|
+
- Use `python3 docs/tools/autopipeline/ap.py classify --scope auto` to classify risk, required docs, verification surfaces, and recommended commands.
|
|
282
345
|
- Use `python3 docs/tools/autopipeline/ap.py impact --scope auto` to inspect changed files, matched project rules, and selected gate scope.
|
|
283
346
|
- Use `python3 docs/tools/autopipeline/ap.py structure-check --scope auto` to catch file growth, large-file extension, and missing structure baseline docs.
|
|
284
347
|
- Use `python3 docs/tools/autopipeline/ap.py light-gate --scope auto --explain` for small-step development after a project declares `gate.default_scope: auto`, `commands.gate_changed`, or matching `gate.rules`.
|
|
@@ -10,21 +10,23 @@ developer_instructions = """
|
|
|
10
10
|
工作要求:
|
|
11
11
|
1. 优先用 rg / git / 项目脚本快速定位真实入口,再向下追踪调用链。
|
|
12
12
|
2. 先读项目已有文档、配置、路由、任务记录;涉及结构/优化时还要读结构标准、健康基线和优化 backlog。
|
|
13
|
-
3.
|
|
14
|
-
4.
|
|
15
|
-
5.
|
|
13
|
+
3. 必要时运行或建议 `ap.py classify --scope auto`,说明风险级别、建议 gate scope、是否需要 DD/ADR/browser/Jenkins/target verify。
|
|
14
|
+
4. 输出根因时说明当前代码应归属的层级、现有同类模块、可复用 helper / 组件 / 脚本,以及是否触及 `structure.layer_rules`。
|
|
15
|
+
5. 如果根因依赖外部库、框架或版本行为,标记需要 docs_researcher / Context7 继续核对,不要凭记忆猜。
|
|
16
|
+
6. 输出内容必须尽量具体到:
|
|
16
17
|
- 文件路径
|
|
17
18
|
- 函数名 / 方法名
|
|
18
19
|
- 关键结构体 / 类 / 接口
|
|
19
20
|
- 关键配置项
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
7. 不要泛泛而谈,不要直接给大段修复方案。
|
|
22
|
+
8. 输出格式:
|
|
22
23
|
- 问题入口
|
|
23
24
|
- 调用链
|
|
24
25
|
- 关键文件
|
|
26
|
+
- 分类 / 风险 / 建议 gate
|
|
25
27
|
- 当前层级 / 归属模块
|
|
26
28
|
- 既有复用点
|
|
27
29
|
- 根因候选
|
|
28
30
|
- 建议交给哪个代理继续处理
|
|
29
|
-
|
|
31
|
+
9. 优先快速精准搜索,避免全仓库无差别扫描。
|
|
30
32
|
"""
|
|
@@ -13,15 +13,16 @@ developer_instructions = """
|
|
|
13
13
|
3. 除非明确要求,否则不要重构、不做大面积改名、不改无关文件。
|
|
14
14
|
4. 先跟随项目现有模式、helper、组件、脚本和文档约束,不新造不必要抽象。
|
|
15
15
|
5. 改代码前先确认业务层、应用层、基础设施层、接口/UI层、shared/tooling 的正确落位;不要把新职责塞进已经偏大的文件。
|
|
16
|
-
6.
|
|
17
|
-
7.
|
|
18
|
-
8.
|
|
19
|
-
9.
|
|
20
|
-
10.
|
|
21
|
-
11.
|
|
16
|
+
6. 遵守 `structure.layer_rules` import 边界;必须越界时先让主代理补 DD/ADR。
|
|
17
|
+
7. 新增工具、并发/缓存/请求封装、格式转换、权限判断、校验逻辑前,先搜索既有 helper、库、组件和脚本。
|
|
18
|
+
8. 如果修改依赖外部 API / 版本行为,先让 docs_researcher / 文档 MCP 兜底确认。
|
|
19
|
+
9. 如果修改影响 UI,交给 browser_debugger 或主代理做真实浏览器验证。
|
|
20
|
+
10. 如果修改涉及鉴权、权限、支付、文件上传下载、部署、依赖或数据边界,交给 reviewer / 安全能力做只读复核。
|
|
21
|
+
11. 修改后运行聚焦门禁:优先项目 light gate,其次 structure-check、相关测试、typecheck、lint、git diff --check,并确保 evidence.jsonl 记录实际执行。
|
|
22
|
+
12. 修改后输出:
|
|
22
23
|
- 修改文件
|
|
23
24
|
- 修改点
|
|
24
25
|
- 修改原因
|
|
25
26
|
- 验证方法
|
|
26
|
-
|
|
27
|
+
13. 如发现问题超出小修范围,要立即停止并上报,不要自行扩大战场。
|
|
27
28
|
"""
|
|
@@ -10,14 +10,15 @@ developer_instructions = """
|
|
|
10
10
|
工作要求:
|
|
11
11
|
1. 优先检查:正确性、安全性、边界条件、异常路径、并发风险、事务一致性、缓存一致性、兼容性。
|
|
12
12
|
2. 结构/优化 review 必须先读 project-health-baseline 和 optimization-backlog;不要把 accepted debt 重新报告为当前 blocker。
|
|
13
|
-
3.
|
|
14
|
-
4.
|
|
15
|
-
5.
|
|
16
|
-
6.
|
|
13
|
+
3. 检查 `docs/tasks/evidence.jsonl`、closure-log 和实际命令输出是否一致;不要把未执行项写成 PASS。
|
|
14
|
+
4. 涉及鉴权、权限、支付、文件上传下载、部署、依赖或数据边界时,优先使用可用的安全扫描 / security review 能力辅助复核。
|
|
15
|
+
5. 以 git diff、相关测试、接口契约、真实运行证据、结构标准为基础,不凭风格偏好输出问题。
|
|
16
|
+
6. 优先输出真实问题,不要输出样式洁癖式意见。
|
|
17
|
+
7. 每条问题尽量包含:
|
|
17
18
|
- 问题点
|
|
18
19
|
- 影响范围
|
|
19
20
|
- 复现条件
|
|
20
21
|
- 建议修法
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
8. 发现测试不足时,指出应补哪些测试或验证路径。
|
|
23
|
+
9. 结论要按严重程度排序:P0 / P1 / P2 / P3,并明确是否影响当前任务完成。
|
|
23
24
|
"""
|
|
@@ -63,6 +63,13 @@ python3 .agents/skills/auto-coding-skill/scripts/ap.py --repo . install
|
|
|
63
63
|
# or .claude path
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
+
Existing projects should use upgrade mode before replacing tracked docs:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
python3 docs/tools/autopipeline/ap.py upgrade --dry-run
|
|
70
|
+
python3 docs/tools/autopipeline/ap.py upgrade --write
|
|
71
|
+
```
|
|
72
|
+
|
|
66
73
|
3) Install runtime deps:
|
|
67
74
|
|
|
68
75
|
```bash
|
|
@@ -128,14 +135,15 @@ Read `workflow.mode` from `docs/ENGINEERING.md` before choosing the path.
|
|
|
128
135
|
`dev` mode:
|
|
129
136
|
|
|
130
137
|
1) read `docs/ENGINEERING.md`
|
|
131
|
-
2)
|
|
132
|
-
3) read
|
|
133
|
-
4)
|
|
134
|
-
5)
|
|
135
|
-
6)
|
|
136
|
-
7)
|
|
137
|
-
8)
|
|
138
|
-
9)
|
|
138
|
+
2) run or reason through `classify --scope auto` for changed work
|
|
139
|
+
3) read `docs/architecture/structure-standard.md` when the change adds or relocates code
|
|
140
|
+
4) read / update `docs/tasks/taskbook.md`
|
|
141
|
+
5) write minimal design notes; create a DD or ADR only when the change is cross-module, API, DB, deployment, Jenkins, key-page-flow, or long-term structure related
|
|
142
|
+
6) implement only the necessary changes
|
|
143
|
+
7) run the default local lightweight gate
|
|
144
|
+
8) append `docs/tasks/closure-log.md` with `Result: DEV-CLOSED`
|
|
145
|
+
9) commit + push
|
|
146
|
+
10) stop and start the next development task
|
|
139
147
|
|
|
140
148
|
`verify` mode:
|
|
141
149
|
|
|
@@ -153,6 +161,7 @@ Default commands:
|
|
|
153
161
|
|
|
154
162
|
```bash
|
|
155
163
|
python3 docs/tools/autopipeline/ap.py doctor
|
|
164
|
+
python3 docs/tools/autopipeline/ap.py classify --scope auto
|
|
156
165
|
python3 docs/tools/autopipeline/ap.py impact --scope auto
|
|
157
166
|
python3 docs/tools/autopipeline/ap.py structure-check --scope auto
|
|
158
167
|
python3 docs/tools/autopipeline/ap.py light-gate --scope auto --explain
|
|
@@ -168,7 +177,10 @@ On-demand commands:
|
|
|
168
177
|
python3 docs/tools/autopipeline/ap.py runtime-up
|
|
169
178
|
python3 docs/tools/autopipeline/ap.py wait-health --scope runtime
|
|
170
179
|
python3 docs/tools/autopipeline/ap.py runtime-down
|
|
180
|
+
python3 docs/tools/autopipeline/ap.py upgrade --dry-run
|
|
181
|
+
python3 docs/tools/autopipeline/ap.py baseline init --write --update-config
|
|
171
182
|
python3 docs/tools/autopipeline/ap.py structure-check --scope full
|
|
183
|
+
python3 docs/tools/autopipeline/ap.py gate-profile
|
|
172
184
|
python3 docs/tools/autopipeline/ap.py check-matrix
|
|
173
185
|
python3 docs/tools/autopipeline/ap.py gen-summary <TASK_ID>
|
|
174
186
|
```
|
|
@@ -180,9 +192,13 @@ python3 docs/tools/autopipeline/ap.py gen-summary <TASK_ID>
|
|
|
180
192
|
- Reuse before building: search existing utilities, components, clients, validation, permissions, caching, retry, formatting, and automation scripts before adding another helper.
|
|
181
193
|
- Do not add new responsibilities to large files. If a file exceeds `structure.max_file_lines_warn`, prefer extracting a focused module or component; if it exceeds `structure.max_file_lines_block`, only small fixes are acceptable unless the path is explicitly allowed.
|
|
182
194
|
- Historical large files can be listed in `structure.accepted_debt_paths` only after they are recorded in the health baseline or optimization backlog; this does not permit large new additions to those files.
|
|
195
|
+
- `structure.layer_rules` enforces configurable import boundaries between domain, application, infrastructure, interface, and shared layers.
|
|
183
196
|
- Self-built algorithms, concurrency controls, caches, protocol clients, or framework-like helpers require a concrete reason such as performance, concurrency, offline/deploy constraints, licensing, security, or compatibility, plus tests or benchmark/runtime evidence.
|
|
184
197
|
- For structural reviews, read `docs/reviews/project-health-baseline.md` and `docs/reviews/optimization-backlog.md` first. Do not re-report accepted debt as a fresh blocker; report only new, worsened, unrecorded P0/P1, or backlog items that now deserve priority upgrade.
|
|
185
198
|
- “Optimization complete” means the scoped P0/P1/P2 work is closed, local gate passes, no new unclassified P0/P1 exists, and remaining P2/P3 work is tracked or accepted debt.
|
|
199
|
+
- `baseline init` creates the first project health baseline and optimization backlog; use `--update-config` to seed `accepted_debt_paths`.
|
|
200
|
+
- `docs/tasks/evidence.jsonl` is the machine-readable execution trail for gates, verification, and closure. Keep it aligned with closure Markdown.
|
|
201
|
+
- `gate-profile` summarizes local gate duration and failure history so small-step development can keep the fast path honest.
|
|
186
202
|
|
|
187
203
|
## Quality policy
|
|
188
204
|
|
|
@@ -202,3 +218,15 @@ python3 docs/tools/autopipeline/ap.py gen-summary <TASK_ID>
|
|
|
202
218
|
- `commit-push` records closure automatically according to `workflow.mode`.
|
|
203
219
|
- `regression-matrix.md` can mark `PASS` only after real execution with evidence.
|
|
204
220
|
- High-risk changes must include target environment verification and usually a DD.
|
|
221
|
+
|
|
222
|
+
## Multi-project operations
|
|
223
|
+
|
|
224
|
+
Use the npm CLI from outside or inside a repo:
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
autocoding status --projects /path/to/repo1,/path/to/repo2
|
|
228
|
+
autocoding sync --projects /path/to/repo1,/path/to/repo2 --dry-run
|
|
229
|
+
autocoding sync --projects /path/to/repo1,/path/to/repo2
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
`status` reports drift in project-local `.agents`, Codex agent templates, autopipeline scripts, missing template docs, and missing config keys. `sync` updates generated skill/tooling assets and only creates missing docs; it does not overwrite project-specific `docs/ENGINEERING.md`, which should be merged through `ap.py upgrade --write`.
|
|
@@ -30,6 +30,7 @@ gate:
|
|
|
30
30
|
fallback_scope: "standard"
|
|
31
31
|
full_on_unknown: true
|
|
32
32
|
no_change_scope: "standard"
|
|
33
|
+
profile_log: ".local/auto-coding-skill/gate-profile.jsonl"
|
|
33
34
|
full_on:
|
|
34
35
|
paths:
|
|
35
36
|
- "Jenkinsfile"
|
|
@@ -81,6 +82,63 @@ structure:
|
|
|
81
82
|
- "**/*.bundle.js"
|
|
82
83
|
- "**/*.map"
|
|
83
84
|
accepted_debt_paths: []
|
|
85
|
+
layer_rules:
|
|
86
|
+
enabled: true
|
|
87
|
+
block: true
|
|
88
|
+
rules:
|
|
89
|
+
- name: "domain"
|
|
90
|
+
paths:
|
|
91
|
+
- "**/domain/**"
|
|
92
|
+
- "**/domains/**"
|
|
93
|
+
- "**/model/**"
|
|
94
|
+
- "**/models/**"
|
|
95
|
+
forbidden_imports:
|
|
96
|
+
- "**/infrastructure/**"
|
|
97
|
+
- "**/infra/**"
|
|
98
|
+
- "**/adapter/**"
|
|
99
|
+
- "**/repository/**"
|
|
100
|
+
- "**/repositories/**"
|
|
101
|
+
- "**/client/**"
|
|
102
|
+
- "**/clients/**"
|
|
103
|
+
- "**/controller/**"
|
|
104
|
+
- "**/handler/**"
|
|
105
|
+
- "**/page/**"
|
|
106
|
+
- "**/pages/**"
|
|
107
|
+
- "**/component/**"
|
|
108
|
+
- "**/components/**"
|
|
109
|
+
- "**/view/**"
|
|
110
|
+
- "**/views/**"
|
|
111
|
+
- name: "application"
|
|
112
|
+
paths:
|
|
113
|
+
- "**/application/**"
|
|
114
|
+
- "**/service/**"
|
|
115
|
+
- "**/services/**"
|
|
116
|
+
- "**/usecase/**"
|
|
117
|
+
- "**/usecases/**"
|
|
118
|
+
forbidden_imports:
|
|
119
|
+
- "**/controller/**"
|
|
120
|
+
- "**/handler/**"
|
|
121
|
+
- "**/page/**"
|
|
122
|
+
- "**/pages/**"
|
|
123
|
+
- "**/component/**"
|
|
124
|
+
- "**/components/**"
|
|
125
|
+
- "**/view/**"
|
|
126
|
+
- "**/views/**"
|
|
127
|
+
- name: "shared"
|
|
128
|
+
paths:
|
|
129
|
+
- "**/shared/**"
|
|
130
|
+
- "**/common/**"
|
|
131
|
+
- "**/utils/**"
|
|
132
|
+
- "**/lib/**"
|
|
133
|
+
forbidden_imports:
|
|
134
|
+
- "**/domain/**"
|
|
135
|
+
- "**/application/**"
|
|
136
|
+
- "**/service/**"
|
|
137
|
+
- "**/services/**"
|
|
138
|
+
- "**/infrastructure/**"
|
|
139
|
+
- "**/controller/**"
|
|
140
|
+
- "**/page/**"
|
|
141
|
+
- "**/pages/**"
|
|
84
142
|
reusable_tool_dirs:
|
|
85
143
|
- "docs/tools/**"
|
|
86
144
|
- "scripts/**"
|
|
@@ -131,6 +189,7 @@ jenkins:
|
|
|
131
189
|
docs:
|
|
132
190
|
taskbook: "docs/tasks/taskbook.md"
|
|
133
191
|
closure_log: "docs/tasks/closure-log.md"
|
|
192
|
+
evidence_log: "docs/tasks/evidence.jsonl"
|
|
134
193
|
design_dir: "docs/design"
|
|
135
194
|
review_dir: "docs/reviews"
|
|
136
195
|
health_baseline: "docs/reviews/project-health-baseline.md"
|
|
@@ -177,7 +236,9 @@ docs:
|
|
|
177
236
|
- `gate.*`:按项目声明路径规则和高风险升级规则;未配置时保持标准门禁行为
|
|
178
237
|
- `commands.structure_check`:可覆盖内置结构检查;留空时使用通用 `ap.py structure-check`
|
|
179
238
|
- `structure.*`:通用工程结构阈值、允许的大文件模式、复用搜索目录
|
|
239
|
+
- `structure.layer_rules`:通用分层 import 边界检查;项目可按技术栈细化路径
|
|
180
240
|
- `optimization.*`:健康基线感知的优化闭环口径,避免重复把已接受债务判定为当前未完成
|
|
241
|
+
- `docs.evidence_log`:结构化证据 JSONL,记录 doctor / gate / verify / closure 等实际执行结果
|
|
181
242
|
- `docs.health_baseline` / `docs.optimization_backlog` / `docs.structure_standard` / `docs.adr_dir`:项目结构治理文档位置
|
|
182
243
|
- `target_env.*`:目标环境前端 / 后端地址、用户名、密码引用,必须全部填写且真实可用
|
|
183
244
|
- `jenkins.*`:Jenkins UI/API 用户名、密码引用、Job、分支、镜像、部署环境,必须全部填写且真实可用
|
|
@@ -217,8 +278,10 @@ docs:
|
|
|
217
278
|
|
|
218
279
|
按需填写:
|
|
219
280
|
- `gate.default_scope`:默认 `standard`;需要小步快跑时设为 `auto` 或 `changed`
|
|
281
|
+
- `gate.profile_log`:本地门禁耗时画像,默认写入 `.local/auto-coding-skill/gate-profile.jsonl`
|
|
220
282
|
- `gate.rules`:项目自定义路径规则。每条规则可包含 `name`、`paths`、`commands`、`scope`
|
|
221
283
|
- `structure.enabled`:是否把结构检查纳入 `light-gate`
|
|
284
|
+
- `structure.layer_rules.enabled` / `block`:是否检查分层 import 边界,以及违规时阻塞还是仅提示
|
|
222
285
|
- `structure.max_file_lines_warn` / `structure.max_file_lines_block`:文件长度预警 / 阻塞阈值
|
|
223
286
|
- `structure.max_added_lines_to_large_file`:禁止在已偏大的文件里继续大块堆职责
|
|
224
287
|
- `structure.allow_large_files`:生成物、供应商代码、构建产物等允许超长或跳过结构检查的路径
|
|
@@ -348,8 +411,12 @@ docs:
|
|
|
348
411
|
- 新会话做整体分析时,必须先读 `docs/reviews/project-health-baseline.md` 和 `docs/reviews/optimization-backlog.md`,只报告新增、恶化、未记录 P0/P1,或已记录但需要升级优先级的问题。
|
|
349
412
|
|
|
350
413
|
5) 本地执行
|
|
414
|
+
- 任务开始分类:`python3 docs/tools/autopipeline/ap.py classify --scope auto`
|
|
351
415
|
- 小步快跑默认执行:`python3 docs/tools/autopipeline/ap.py structure-check --scope auto`
|
|
352
416
|
- 发布、跨模块重构、架构调整默认执行:`python3 docs/tools/autopipeline/ap.py structure-check --scope full`
|
|
417
|
+
- 首次落基线:`python3 docs/tools/autopipeline/ap.py baseline init --write --update-config`
|
|
418
|
+
- 项目升级预检:`python3 docs/tools/autopipeline/ap.py upgrade --dry-run`
|
|
419
|
+
- 门禁耗时画像:`python3 docs/tools/autopipeline/ap.py gate-profile`
|
|
353
420
|
- `light-gate` 在 `structure.enabled: true` 时会自动纳入结构检查;如项目需要更强规则,可配置 `commands.structure_check` 覆盖内置实现。
|
|
354
421
|
|
|
355
422
|
---
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
Follow `docs/ENGINEERING.md` strictly. Source of truth: `docs/ENGINEERING.md`.
|
|
2
|
+
At task start, use `ap.py classify --scope auto` when changed-file impact is not obvious.
|
|
2
3
|
Before code changes, read the configured structure standard and place new code in the correct layer; do not add new responsibilities to already-large files.
|
|
4
|
+
Obey `structure.layer_rules` import boundaries unless a DD/ADR explicitly records the exception.
|
|
3
5
|
Before optimization reviews, read the project health baseline and optimization backlog, and report only new, worsened, unrecorded P0/P1, or upgraded-priority items.
|
|
4
6
|
Route work through already available MCP servers, installed skills, plugins, and app connectors when they provide current docs, design context, browser evidence, GitHub/CI state, security review, or artifact rendering.
|
|
5
7
|
Use the `.agents/agents` role model when available: explorer, docs_researcher, browser_debugger, fixer, reviewer. If the client cannot run subagents, execute the same roles sequentially in the main agent.
|
|
6
8
|
Default to the lightweight local gate first; when `structure.enabled` is true, the gate includes `structure-check`.
|
|
9
|
+
Keep `docs/tasks/evidence.jsonl` and closure Markdown aligned with actual executed checks.
|
|
7
10
|
Use Jenkins build verification and real target-environment verification as the primary completion gate in verify mode.
|
|
8
11
|
Local Docker Compose and full local regression are on-demand diagnostic tools, not the default gate for every small change.
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
Follow `docs/ENGINEERING.md` strictly. Source of truth: `docs/ENGINEERING.md`.
|
|
2
|
+
At task start, use `ap.py classify --scope auto` when changed-file impact is not obvious.
|
|
2
3
|
Before code changes, read the configured structure standard and place new code in the correct layer; do not add new responsibilities to already-large files.
|
|
4
|
+
Obey `structure.layer_rules` import boundaries unless a DD/ADR explicitly records the exception.
|
|
3
5
|
Before optimization reviews, read the project health baseline and optimization backlog, and report only new, worsened, unrecorded P0/P1, or upgraded-priority items.
|
|
4
6
|
Route work through already available MCP servers, installed skills, plugins, and app connectors when they provide current docs, design context, browser evidence, GitHub/CI state, security review, or artifact rendering.
|
|
5
7
|
Use the `.agents/agents` role model when available: explorer, docs_researcher, browser_debugger, fixer, reviewer. If the client cannot run subagents, execute the same roles sequentially in the main agent.
|
|
6
8
|
Default to the lightweight local gate first; when `structure.enabled` is true, the gate includes `structure-check`.
|
|
9
|
+
Keep `docs/tasks/evidence.jsonl` and closure Markdown aligned with actual executed checks.
|
|
7
10
|
Use Jenkins build verification and real target-environment verification as the primary completion gate in verify mode.
|
|
8
11
|
Local Docker Compose and full local regression are on-demand diagnostic tools, not the default gate for every small change.
|
|
@@ -30,6 +30,16 @@
|
|
|
30
30
|
- UI 组件应拆分为容器、状态/数据适配、纯展示组件;不要在单个页面里混合远程请求、权限、复杂计算和大段渲染。
|
|
31
31
|
- 跨模块、跨层、数据库、API、部署、权限、并发、缓存、核心页面流的变更,需要最小设计;影响长期结构的决策需要 ADR。
|
|
32
32
|
|
|
33
|
+
## 3.1 Import Boundary Rules
|
|
34
|
+
|
|
35
|
+
`structure.layer_rules` 会做轻量 import 边界检查。默认规则:
|
|
36
|
+
|
|
37
|
+
- Domain / Model 不依赖 Infrastructure、Repository、Client、Controller、Handler、Page、Component、View。
|
|
38
|
+
- Application / Service / Usecase 不依赖 Controller、Handler、Page、Component、View。
|
|
39
|
+
- Shared / Common / Utils / Lib 不依赖业务层、应用层、基础设施层或 UI 入口。
|
|
40
|
+
|
|
41
|
+
项目可以按技术栈调整路径规则。调整规则时必须保持方向:内层业务规则不反向依赖外层技术细节。
|
|
42
|
+
|
|
33
43
|
## 4. 文件和函数规模
|
|
34
44
|
|
|
35
45
|
默认阈值来自 `docs/ENGINEERING.md`:
|
|
@@ -65,3 +75,9 @@
|
|
|
65
75
|
- P3 可选建议:命名、风格、进一步抽象、审美类优化。
|
|
66
76
|
|
|
67
77
|
“优化完成”只表示当前约定范围闭环,不表示没有任何后续可优化点。新会话必须先读健康基线和 backlog,只报告新增、恶化、未记录 P0/P1,或需要升级优先级的已记录问题。
|
|
78
|
+
|
|
79
|
+
## 7. Evidence And Gate Profile
|
|
80
|
+
|
|
81
|
+
- `docs/tasks/evidence.jsonl` 记录 doctor、classify、structure-check、light-gate、verify、closure 等结构化证据。
|
|
82
|
+
- `.local/auto-coding-skill/gate-profile.jsonl` 记录门禁命令耗时和失败率,用于优化小步快跑的 gate 范围。
|
|
83
|
+
- Markdown 记录面向人读,JSONL 记录面向工具复盘;两者不互相替代。
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
- Target Env: <env name / health url / page path>
|
|
17
17
|
- Verification: <health / key api / key page / business path>
|
|
18
18
|
- Structure Check: <passed / blocked / skipped with reason>
|
|
19
|
+
- Evidence Log: `docs/tasks/evidence.jsonl`
|
|
19
20
|
- Result: DEV-CLOSED / PASS / FAIL / PARTIAL
|
|
20
21
|
- Follow-up: <none or todo>
|
|
21
22
|
- Jenkins Failure: <optional>
|
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
## 3. 质量证据
|
|
22
22
|
- 本地轻量校验:light_gate or quick_test/test/build / api docs / jenkins / diff-check
|
|
23
23
|
- 结构检查:structure-check
|
|
24
|
+
- 结构化证据:`docs/tasks/evidence.jsonl`
|
|
25
|
+
- 门禁画像:`.local/auto-coding-skill/gate-profile.jsonl`
|
|
24
26
|
- Jenkins Build:
|
|
25
27
|
- 目标环境验证:
|
|
26
28
|
- 闭环记录:`docs/tasks/closure-log.md`
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
- 是否高风险(Yes/No):
|
|
16
16
|
- 高风险分类(如有):DB / Auth / Payment / Jenkins / Gateway / Upload / Prod Config
|
|
17
17
|
- 影响面(API / DB / Jenkins / Page / Config / Deploy):
|
|
18
|
+
- 分类结果(`ap.py classify --scope auto`:risk / gate / needs):
|
|
18
19
|
- 结构落位(Domain / Application / Infrastructure / Interface / Shared / Tooling / N/A):
|
|
19
20
|
- 复用检查(已有 helper / 组件 / 脚本 / 库):
|
|
20
21
|
- 是否需要 ADR(Yes/No):
|