trae-coding-engine 0.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.
Files changed (57) hide show
  1. package/README.md +91 -0
  2. package/bin/coding-engine.js +16 -0
  3. package/lib/cli.js +86 -0
  4. package/lib/index.js +6 -0
  5. package/lib/setup.js +290 -0
  6. package/package.json +32 -0
  7. package/templates/.agents/skills/coding-architecture/SKILL.md +347 -0
  8. package/templates/.agents/skills/coding-code-review/SKILL.md +95 -0
  9. package/templates/.agents/skills/coding-cve-remediation/SKILL.md +163 -0
  10. package/templates/.agents/skills/coding-db-schema/SKILL.md +273 -0
  11. package/templates/.agents/skills/coding-deploy-config/SKILL.md +129 -0
  12. package/templates/.agents/skills/coding-docs-audit/SKILL.md +285 -0
  13. package/templates/.agents/skills/coding-docs-audit-autofix/SKILL.md +33 -0
  14. package/templates/.agents/skills/coding-http-api/SKILL.md +269 -0
  15. package/templates/.agents/skills/coding-issue-autodev/SKILL.md +172 -0
  16. package/templates/.agents/skills/coding-merge-request/SKILL.md +199 -0
  17. package/templates/.agents/skills/coding-observability/SKILL.md +193 -0
  18. package/templates/.agents/skills/coding-refactor-insight/SKILL.md +89 -0
  19. package/templates/.agents/skills/coding-release-merge/SKILL.md +224 -0
  20. package/templates/.agents/skills/coding-runtime-adapter/SKILL.md +115 -0
  21. package/templates/.agents/skills/coding-testing/SKILL.md +169 -0
  22. package/templates/AGENTS.md +179 -0
  23. package/templates/MR-Template-Default.md +33 -0
  24. package/templates/Makefile +370 -0
  25. package/templates/REGISTRY.md +53 -0
  26. package/templates/scripts/check-adr.sh +283 -0
  27. package/templates/scripts/check-comment-i18n.py +209 -0
  28. package/templates/scripts/check-comment-i18n.sh +38 -0
  29. package/templates/scripts/check-doc-refs.sh +40 -0
  30. package/templates/scripts/check-docs.sh +103 -0
  31. package/templates/scripts/check-go-names.sh +59 -0
  32. package/templates/scripts/check-iam-actions.py +126 -0
  33. package/templates/scripts/check-migration-sql-immutability.sh +232 -0
  34. package/templates/scripts/check-mr-desc.sh +165 -0
  35. package/templates/scripts/check-mr-size.sh +128 -0
  36. package/templates/scripts/check-mr-title.sh +123 -0
  37. package/templates/scripts/check-openapi.py +221 -0
  38. package/templates/scripts/check-rdb-structured-queries.sh +98 -0
  39. package/templates/scripts/check-repository-transactions.sh +100 -0
  40. package/templates/scripts/check-runbooks.sh +229 -0
  41. package/templates/scripts/check-skill-router-sync.py +331 -0
  42. package/templates/scripts/check-skills.sh +243 -0
  43. package/templates/scripts/docs-audit-to-issues.py +373 -0
  44. package/templates/scripts/docs-verification-reminder.sh +63 -0
  45. package/templates/scripts/find-ci-failures.sh +133 -0
  46. package/templates/scripts/find-stale-mrs.sh +72 -0
  47. package/templates/scripts/gen-adr-index.sh +122 -0
  48. package/templates/scripts/open-mr.sh +536 -0
  49. package/templates/scripts/regen-agent-md.sh +149 -0
  50. package/templates/scripts/run-mr-hygiene.sh +140 -0
  51. package/templates/scripts/runbook.sh +91 -0
  52. package/templates/scripts/self-maintenance-digest.py +125 -0
  53. package/templates/scripts/send-self-maintenance-lark-card.py +116 -0
  54. package/templates/scripts/skill-graph.sh +114 -0
  55. package/templates/scripts/skill-impact.sh +134 -0
  56. package/templates/scripts/skill-propose.sh +302 -0
  57. package/templates/scripts/skill-router-hook.sh +152 -0
@@ -0,0 +1,179 @@
1
+ # Coding Engine — AI Agent Guidelines
2
+
3
+ Enterprise multi-tenant distributed digital-employee agent platform. Go. Hexagonal architecture (Ports & Adapters).
4
+
5
+ > This file is the **routing layer** — what gates apply, which skill owns each path. Procedural detail lives in skills; load the matching skill **before** editing its paths.
6
+
7
+ ## See also
8
+
9
+ - Dev SOP (humans) → `vibe-coding.html` · Onboarding → `onboarding.html` · Claude Code entry map → `CLAUDE.md`
10
+
11
+ ## Architecture
12
+
13
+ ```
14
+ cmd/ binary entrypoints (thin; coding-engine dispatches components)
15
+ internal/
16
+ domain/ core models & interfaces (zero production external deps)
17
+ application/ use cases & orchestration
18
+ adapters/{in,out}bound/ HTTP/gRPC inbound; DB/runtime/eventbus outbound
19
+ components/ in-process component runtimes (e.g. gateway/)
20
+ platform/ component-private infra (no business semantics)
21
+ bootstrap/ fx wiring per component
22
+ api/ deployments/ configs/ contracts · unified Helm + helmfile · local *.yaml(.example)
23
+ docs/ pkg/ tests/ component docs/ADRs · exported helpers (pkg/platform) · build-tagged integration
24
+ ```
25
+
26
+ Dependency rule: `domain` ← `application` ← `adapters` ← `bootstrap`.
27
+ Imports point inward only; never import outward to adapters/bootstrap or concrete implementations.
28
+
29
+ ## Done Gates
30
+
31
+ A task is **not** done until every applicable gate runs. Gates are independent and non-substitutable.
32
+
33
+ | # | Gate | Triggers on | See |
34
+ |---|---|---|---|
35
+ | 1 | Docs Verification (incl. OpenAPI HTML sync) | API / IDL / env / resource naming / lifecycle changes; any `api/idl/*.thrift` surface change (TOP Action add/remove/rename, request/response struct, field) additionally requires `make check-openapi` | §Docs Verification Gate |
36
+ | 2 | Deployment Config Sync | YAML key add/remove/rename, default change, image repo/tag, probe/service port, DSN, credential / Secret field, runtime adapter config struct | skill `coding-deploy-config` |
37
+ | 3 | Testing Done Checklist | Any code change | skill `coding-testing` |
38
+ | 4 | Redis Deployment Compatibility | Any Redis command/key/Lua/Streams change | §Redis Deployment Compatibility Gate |
39
+
40
+ ## Docs Verification Gate
41
+
42
+ If the change touches API endpoints, TOP Action IAM registration, IDL/protobuf/thrift, config keys, K8s resource naming, or important lifecycle (startup/shutdown/error flow):
43
+
44
+ ```bash
45
+ grep -r "<changed identifier / interface / resource name>" docs/
46
+ ```
47
+
48
+ 1. For each hit: update outdated doc; add it if missing.
49
+ 2. No hits: decide whether the change *should* appear in docs (new features usually should).
50
+ 3. Significant architectural decision → check whether `docs/adr/` needs a new ADR.
51
+ 4. TOP Action: verify IAM registration lives in `deployments/coding-engine/templates/server/iam-register-codingserver.yaml`; `Proxy`/`Action`/`Version`/resource/roles/audit must match the endpoint. Gateway-served actions are still registered in the server IAM template, with `Proxy` pointing at the rendered gateway Service.
52
+
53
+ Doc conventions: `docs/CONVENTIONS.md` (status markers `[已实现]` / `[部分实现]` / `[规划中]` required on every `docs/NN-*.md`), `docs/adr/CONVENTIONS.md` (ADR format / numbering / immutability). Markdown only, UTF-8/LF, one language per file, code blocks specify language. Minor refactors, test additions, internal renames → no doc update required.
54
+
55
+ Before final commit, re-check whether staged code/config/API/deploy changes conflict with stable docs. The pre-commit `docs-verification-reminder` is a non-blocking nudge only; if docs are not updated, be ready to explain why the change is internal-only or otherwise does not affect documented behavior.
56
+
57
+ **OpenAPI HTML sync (mandatory):** any change to the `api/idl/*.thrift` TOP Action surface (method, request/response struct, field name/type/requiredness, description) must keep both `docs/openapi/openapi.yaml` and the Redocly-rendered `docs/openapi/coding-engine-api.html` (the shipped human-readable page) in lockstep. `make check-openapi` regenerates both from the IDL, overwriting the committed files; commit the output. CI re-runs the same pinned `@redocly/cli@2.31.6` and fails the pipeline if anything changed (`git status` must be clean). Procedure → skill `coding-http-api`.
58
+
59
+ ## Deployment Config Sync Gate
60
+
61
+ **Load skill `coding-deploy-config` before touching deploy/config.** It owns the 5-surface table, the verification grep template, image/DSN patterns, and TOP Action IAM rules.
62
+
63
+ **Load-bearing rule (never delegate):** Credentials live in Secret, never ConfigMap. Any field matching `password`, `secret_key`, `access_key`, `ak`, `sk`, `token`, `apikey`, `api_key` **must** come from a K8s `Secret` (Secret-mounted config file, `envFrom`, or `valueFrom.secretKeyRef`). Rendered ConfigMaps carry references/placeholders only — plaintext credentials in ConfigMap fail the gate.
64
+
65
+ **Narrow exception (do not generalize):** existing platform-owned `platform-info` env credentials may be read from the `platform-info` ConfigMap only for the established contracts — `AIGW_AK`/`AIGW_SK` on coding components, `UP_AK`/`UP_SK` on inner MCP / workspace init / workspace hot-sync / MCP config sync paths, and `IAM_AK`/`IAM_SK`/`iamEndpoint` for IAM UserResolver display-name lookup — per ADR 0022 and ADR 0048. SK values are encrypted whether from `platform-info` env or Secret-backed YAML; the exception exists because IAM Server owns the automatic `platform-info` ConfigMap update path. Do not extend it to new credentials or application config.
66
+
67
+ ## Redis Deployment Compatibility Gate
68
+
69
+ All Redis-backed code must work with `redis.mode` = `single`, `sentinel`, and `cluster`. Sentinel behaves like a single primary; Cluster adds key-slot constraints. The load-bearing invariant:
70
+
71
+ - Any multi-key command, transaction, or Lua script must keep every key in one hash slot via an explicit hash tag, e.g. `foo:{id}` and `foo:{id}:gen`.
72
+ - Lua scripts pass all keys through `KEYS` — never synthesize undeclared key names inside the script.
73
+ - Pipelines are for independent single-key ops only; Streams ops target one stream key per command.
74
+
75
+ Cluster-safe key-naming assertions → skill `coding-testing` (`strategies/s3-redis.md`).
76
+
77
+ ## Coding Conventions
78
+
79
+ - **Hexagonal boundaries are hard**: production domain code has zero external imports except approved value-type exceptions; `_test.go` and generated mocks may use test infra. Application code depends on domain and ports, not adapters or concrete external clients. Outside production domain, shared value/helper packages such as `pkg/platform/logger`, `pkg/platform/errno`, `pkg/platform/uuid`, `pkg/platform/retry`, and `pkg/platform/validate` are not hexagonal-boundary violations by themselves. Concrete infrastructure packages such as `pkg/platform/redis`, `pkg/platform/gormdb`, `pkg/platform/telemetrydb`, SDKs, DB, Redis, Kubernetes, and HTTP clients must still be hidden behind domain repositories or `application/port` interfaces. Adapters implement domain/port interfaces and own framework, SDK, DB, Redis, and HTTP client details.
80
+ - **Immutability**: return new values, never mutate in-place.
81
+ - **Errors**: always explicit; never swallow silently.
82
+ - **File size**: 200–400 lines typical, 800 max.
83
+ - **No hardcoded config**: constants or env-driven.
84
+ - **Schema**: coding-engine main DB schema is owned by explicit SQL migrations under top-level `migration/`; server startup must not run GORM `AutoMigrate` or hand-written DDL. Keep GORM PO definitions and migration SQL in sync. Published source SQL files are immutable, including comment-only edits; same-version changes append the next `NNN.sql`, and new-version changes create a new `vX.Y.Z/` directory starting at `001.sql`.
85
+ - **Tests**: table-driven, next to code under test (`_test.go`).
86
+
87
+ ### Comment Conventions
88
+
89
+ - **Go source** comments are **English** — no CJK in `.go` comments, enforced by `make check-comment-i18n`. External-facing API contracts stay Chinese (out of scope): IDL `.thrift` comments, generated OpenAPI (`docs/openapi/*`), and `pkg/errors/*.json` `Comment` fields.
90
+ - Be **concise**: delete comments restating self-evident code; keep "why", design rationale, pitfalls, and boundary conditions.
91
+ - Reference ADRs by **topic or number**, not by quoting Chinese section titles: `ADR-0018 (local-mode behavior)`; use `ADR-00XX §N` only when the ADR has genuinely numbered sections (verify `§N` resolves).
92
+
93
+ ## Layer File Conventions
94
+
95
+ ```
96
+ internal/
97
+ domain/<agg>/ entity.go · repository.go (no aggregate-local errors.go)
98
+ application/<agg>/ service.go · dto.go · mapper.go
99
+ application/port/ <capability>.go (//go:generate mockgen) · mocks/ — infra capability ports only
100
+ application/<ctx>/{port,acl}/ consumer-owned cross-context ports + ACL adapters (ADR 0058)
101
+ adapters/outbound/persistence/rdb/repository/<agg>_repository.go
102
+ adapters/outbound/<runtime>/ executor.go · controller.go
103
+ bootstrap/<binary>/ module.go (fx.Module for server, manual for worker)
104
+ ```
105
+
106
+ Service constructor — always `ServiceDeps`-style:
107
+ ```go
108
+ type ServiceDeps struct {
109
+ Repo domain.Repository
110
+ SomePt port.SomePort
111
+ }
112
+ func NewService(deps ServiceDeps) Service { ... }
113
+ ```
114
+
115
+ Detailed checklists: adding aggregates/ports lives in `coding-architecture`; adding runtime providers lives in `coding-runtime-adapter`.
116
+
117
+ ## Testing
118
+
119
+ **No QA team.** Every feature, fix, and refactor ships with tests. Load skill `coding-testing` for the 5 strategies, layer→strategy mapping, race rules, and common mistakes.
120
+
121
+ Commands: `make test` (always, `-race`, unless only web folder changed), `make generate` (when mocks need refresh), `make gen-thrift` (when IDL changed).
122
+
123
+ ## Code Review (cross-CLI)
124
+
125
+ **Mandatory before creating or updating an MR.** After committing the intended changes, use the `coding-code-review` skill with a clean worktree; it reviews the committed branch delta, not uncommitted edits. Coding agents must invoke `coding-code-review` through their current tool's native skill/subagent mechanism, not by shelling out to `make cr`, `scripts/cr.sh`, or `coco -p`. `make cr` remains only as a human / legacy compatibility wrapper for invoking `/coding-code-review` from compatible CLIs (installs+retries if missing). Times out after 8 minutes by default; override via `CODING_CR_TIMEOUT_SECONDS=<seconds>`.
126
+
127
+ The review skill owns report generation; `coding-merge-request` owns what happens after review: `cr-fix-loop` or `cr-to-issues`.
128
+
129
+ **Manual-trigger only.** Each run is expensive: do **not** add `coding-code-review` to §Skill Router; do **not** wire it into PostToolUse / commit / pre-commit / pre-push hooks.
130
+
131
+ ## Commit Scope Whitelist
132
+
133
+ ```
134
+ # Cross-cutting / infra
135
+ deploy | config | env | ci | scripts | docs
136
+ # Binaries / components
137
+ server | gateway | worker | daemon | aigw | mcp
138
+ # Adapters / contracts
139
+ hermes | runtime | http-api | idl | web
140
+ # Domain features
141
+ agent | session | model | skill | channel | chat
142
+ ```
143
+
144
+ `fix:` without a scope is allowed only for cross-cutting fixes touching ≥3 scopes. Typo'd or unlisted scopes should be questioned in review; expand the whitelist deliberately, not silently.
145
+
146
+ ## MR description
147
+
148
+ **Load skill `coding-merge-request` before creating, updating, validating, or preparing an MR.** It owns `make open-mr`, `mr-hygiene`, issue trailers, issue-driven delivery, and review disposition after `coding-code-review`.
149
+
150
+ Fast path: target `release`, commit intended changes, run `coding-code-review`, generate an MR description from the actual diff and validation evidence using `.gitlab/merge_request_templates/Default.md`, then `make open-mr TITLE="<conventional-commit title>" ARGS="--body-file /tmp/mr-desc.md"`. Never inline an MR body with `bytedcli` / `codebase mr create --body`; the shared path creates with title only so the template loads before `scripts/open-mr.sh` applies the model-written description.
151
+
152
+ ## Skill Router
153
+
154
+ Consult this table **before** editing files in the listed paths and load the matching skill. How each CLI reaches this table (and how to bridge a new tool) → `.agents/skills/REGISTRY.md` §Tool bridges.
155
+
156
+ Some skills are path-triggered; others are task-triggered or gates. When
157
+ multiple skills apply, load only the relevant combination. Cross-layer
158
+ checklists do not replace the owning surface's skill: persisted API fields
159
+ still use `coding-db-schema`; runtime/collector config changes still use
160
+ `coding-deploy-config`.
161
+
162
+ | If you're about to edit | Load skill | Why |
163
+ |---|---|---|
164
+ | `internal/domain/**`, `internal/application/port/**`, `internal/application/*/service.go` | `coding-architecture` | DDD layer map, port/adapter contracts, fx wiring, ServiceDeps shape |
165
+ | `internal/adapters/outbound/{hermes,workspacejob}/**`, `internal/bootstrap/worker/registry.go` | `coding-runtime-adapter` + `coding-deploy-config` | Runtime adapter quad, worker provider wiring, and config sync gate |
166
+ | `internal/adapters/outbound/**/redis*.go`, `internal/adapters/outbound/{eventbus,messagebus,presence,lane/redislane,sessionlease}/**`, `pkg/platform/redis/**` | `coding-architecture` + `coding-testing` | Redis single / sentinel / cluster compatibility, Lua hash tags, miniredis strategy |
167
+ | `**/*_test.go`, `tests/**` | `coding-testing` | 5 test strategies, `t.Parallel`, race rules |
168
+ | `deployments/**`, `configs/engine.yaml*`, `internal/bootstrap/app/engine_config.go`, `internal/adapters/outbound/*/config.go` | `coding-deploy-config` | 5-surface sync gate, image / DSN / Secret patterns |
169
+ | `internal/adapters/outbound/persistence/rdb/po/**`, `migration/**` | `coding-db-schema` | SQL migration ownership for coding-engine main DB, RDB repository behavior, forward-only safety, ADR 0003 trigger |
170
+ | `api/idl/*.thrift`, `internal/adapters/inbound/http/handlers/**`, `docs/openapi/coding-engine-api.html` | `coding-http-api` | IDL field-tag conventions, required↔optional compatibility, cross-layer cleanup, OpenAPI YAML + HTML sync (`make check-openapi`) |
171
+ | `internal/observability/**`, `pkg/platform/telemetrydb/**`, `coding-otelcol/**`, `configs/otel*.yaml*`, `build/docker/otelcol.Dockerfile`, `deployments/coding-engine/templates/collector/**` | `coding-observability` | Metric catalogue + smoke guard, 3-place add rule, `port.Metrics` DI with `NoopMetrics` fallback, ocb collector build pipeline (ADR-0023) |
172
+
173
+ **This table is the source of truth.** Update it first, then mirror into `.cursor/rules/skill-router.mdc` and `scripts/skill-router-hook.sh`; `make check-skill-router-sync` (in `make check` + pre-commit) fails the build if the three drift. The per-tool bridges in `REGISTRY.md` follow. Default for unlisted paths: `coding-architecture`. Task-triggered skills (`coding-code-review`, `coding-cve-remediation`, `coding-docs-audit`, `coding-merge-request`, `coding-refactor-insight`, `coding-release-merge`) are deliberately unrouted — invoke them by intent, not path.
174
+
175
+ **Intent route (not a path→skill row, not a skill).** When you're oncall / debugging a production incident / paged, read `docs/runbooks/README.md` first — the triage front-door for coding-engine oncall. On the way out: if you helped resolve an incident — including an ops-only fix with no code change (quota bump, secret patch, PVC delete, `migrate adopt`, pod restart) that the `fix(*)` commit-msg reminder can never catch — proactively offer to sediment it into `docs/runbooks/` before closing the session, whenever it's a recurring failure class.
176
+
177
+ **ADR trigger.** When an edit introduces an *architectural decision* — a new bounded context, a new `port` interface under `internal/application/port/**`, a new `api/idl/*.thrift` contract, or a reversal of a prior ADR — record it as an ADR under `docs/adr/` (see `docs/adr/CONVENTIONS.md`, Mode A/B). This is a **rule every agent follows**, reinforced by the path-triggered router nudge (mirrored across `scripts/skill-router-hook.sh` and `.cursor/rules/skill-router.mdc`). It is a prompt, not a gate: `coding-code-review` is the human backstop.
178
+
179
+ Per-skill descriptions (auto-generated from each `SKILL.md` frontmatter) and the ~90-day skill-lifecycle cadence (`make check-skills` / `skill-propose` / `skill-impact`) live in **`.agents/skills/REGISTRY.md`**, regenerated by `make regen-agent-md` (enforced by pre-commit `check-agent-md`). Promote a `HOT` skill into this file as a top-level rule; retire `DEAD` ones there.
@@ -0,0 +1,33 @@
1
+ ## 变更说明
2
+
3
+ <!-- 用简洁 bullet 分点说明这个 MR 做了什么,以及为什么;不要写成一整段长段落 -->
4
+
5
+ **类型:** `feat` / `fix` / `refactor` / `docs` / `test` / `chore` / `perf`
6
+
7
+ ---
8
+
9
+ ## Docs as Code
10
+
11
+ - [ ] 无需更新文档(原因:__________)
12
+ - [ ] 已审查文档影响(docs grep / 相关文档检索:__________)
13
+ - [ ] 已更新 `docs/NN-*.md`
14
+ - [ ] 已更新或新增 `docs/adr/`
15
+ - [ ] 已同步 OpenAPI 文档(`make check-openapi`:__________)
16
+ - [ ] 已更新 `AGENTS.md`
17
+
18
+ ---
19
+
20
+ ## 测试
21
+
22
+ - [ ] `make check`:__________
23
+ - [ ] `make test`:__________
24
+ - [ ] `make test-integration` / 受影响集成测试:__________
25
+ - [ ] 代码生成/契约生成(`make generate` / `make gen-thrift`):__________
26
+ - [ ] 其它验证:__________
27
+ - [ ] 未执行测试(原因:__________)
28
+
29
+ ---
30
+
31
+ ## Reviewer 关注点
32
+
33
+ <!-- 可选:指出需要重点 review 的地方,或有意为之的设计取舍 -->
@@ -0,0 +1,370 @@
1
+ DOCKER_COMPOSE ?= docker compose
2
+ GOLANGCI_LINT ?= golangci-lint
3
+ GOLANGCI_CONFIG ?= .golangci.yml
4
+ THRIFTGO ?= thriftgo
5
+ REDOCLY_VERSION ?= 2.31.6
6
+ REDOCLY ?= npx --yes @redocly/cli@$(REDOCLY_VERSION)
7
+ YAMLLINT ?= scripts/yamllint.sh
8
+ BIN_DIR := bin
9
+ VERSION ?= dev
10
+ COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || printf "unknown")
11
+ BUILD_DATE ?= $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
12
+ TOP_VERSION ?= 2026-04-23
13
+ VERSION_PKG := code.byted.org/epscp/coding_engine/pkg/version
14
+ LDFLAGS_COMMON := -X $(VERSION_PKG).version=$(VERSION) -X $(VERSION_PKG).commit=$(COMMIT) -X $(VERSION_PKG).buildDate=$(BUILD_DATE)
15
+ .PHONY: help fmt generate baseline-sql migrate-sql check-migrate-sql check-migration-sql-immutability check-migrate-sql-syntax go-mod-tidy check-context-propagation check-context-nil check-repository-transactions check-rdb-structured-queries check-iam-actions test test-root test-otelcol test-hijackprocessor test-integration test-e2e lint lint-yaml clean \
16
+ gen-thrift gen-thrift-engine gen-thrift-http gen-mocks gen-collector check-openapi helmlint helm-smoke \
17
+ build build-all build-engine build-allinone build-cli build-inner-mcp-sidecar build-artifact-downloader build-collector \
18
+ compose-up compose-down compose-logs local-dev-env-from-container local-dev-up local-dev-down local-dev-reset local-dev-logs local-dev-ps verify-scaffold \
19
+ check-skill check-skill-testing check-skill-all propose-skill skill-impact skill-graph check-skill-router-sync check-adr check-docs \
20
+ regen-adr-index check-adr-index test-adr runbook \
21
+ cr fill-mr-desc open-mr open-issue next-issue cr-to-issues test-scripts check-mr-desc check-mr-title check-mr-size check-mr-target-merged
22
+
23
+ help:
24
+ @printf "可用目标:\n"
25
+ @printf " make lint # 运行 code/yaml/helm/thrift 全部 lint\n"
26
+ @printf " make lint-code # Go fmt/lint\n"
27
+ @printf " make lint-yaml # YAML lint\n"
28
+ @printf " make lint-helm # Helm chart lint\n"
29
+ @printf " make lint-thrift # Thrift IDL parse/check via thriftgo\n"
30
+ @printf " make generate # 运行 go:generate 产物(不含 Thrift)\n"
31
+ @printf " make baseline-sql ARGS=--force # 覆盖生成 v0.2.0 基线 SQL;仅初始基线重建时使用\n"
32
+ @printf " make migrate-sql # 聚合 migration/ 到 deployments/coding-engine/sql\n"
33
+ @printf " make check-migrate-sql # 验证 migration 聚合产物没有漂移\n"
34
+ @printf " make check-migration-sql-immutability # 校验已有 migration SQL 不被修改/删除/重命名(可用 SQL_IMMUTABILITY_BASE=origin/<branch> 指定基线)\n"
35
+ @printf " make check-migrate-sql-syntax # 静态检查 mysql/postgres/dm migration SQL 语法和文件边界\n"
36
+ @printf " make go-mod-tidy # 对 workspace 内 Go modules 执行 go mod tidy\n"
37
+ @printf " make check-context-propagation # 检查生产 Go 代码不要新增未审查的 Background/TODO 根\n"
38
+ @printf " make check-context-nil # 检查 context.Context 参数不要传 nil(含测试)\n"
39
+ @printf " make check-repository-transactions # 检查 repository 层不打开/控制事务\n"
40
+ @printf " make check-rdb-structured-queries # 检查 RDB repository 使用结构化 GORM 查询\n"
41
+ @printf " make gen-thrift # 由 api/idl/*.thrift 生成模型\n"
42
+ @printf " make check-openapi # 从 Thrift 生成 OpenAPI YAML/HTML\n"
43
+ @printf " make check-iam-actions # 校验 Thrift TOP Action 与 IAM 注册双向同步\n"
44
+ @printf " make gen-collector # 生成 OpenTelemetry Collector 二进制\n"
45
+ @printf " make test # 运行全部 Go 测试\n"
46
+ @printf " make test-root # 测试根 Go module\n"
47
+ @printf " make test-otelcol # 测试 coding-otelcol Go module\n"
48
+ @printf " make test-hijackprocessor # 测试 hijackprocessor Go module\n"
49
+ @printf " make test-integration # 运行 tests/integration 下的真实依赖集成测试\n"
50
+ @printf " make test-e2e # 运行 tests/e2e 下的外部 API 端到端测试(需 CODING_E2E_* 环境变量)\n"
51
+ @printf " make test-helm # 测试 helm template 后的关键 RBAC / 配置不回归\n"
52
+ @printf " make check # 运行 docs / skills / Helm 渲染语义检查\n"
53
+ @printf " make check-docs # 检查 docs 编号/标题与 ADR 状态\n"
54
+ @printf " make check-runbooks # 检查 docs/runbooks/ 链接、锚点与源码引用\n"
55
+ @printf " make runbook kw=<keyword> # 按关键字检索 docs/runbooks/(只读 grep)\n"
56
+ @printf " make check-skills # 检查 coding-* skills 结构、引用漂移、测试策略覆盖\n"
57
+ @printf " make check-skill-router-sync # 校验 §Skill Router 在 AGENTS.md / .cursor mirror / hook 三处一致\n"
58
+ @printf " make build # 构建后端入口、allinone 和 CLI\n"
59
+ @printf " make build-engine # 构建统一后端入口 bin/coding-engine\n"
60
+ @printf " make build-allinone # 构建 allinone 独立入口 bin/coding-allinone\n"
61
+ @printf " make build-cli VERSION=v0.1.0 # 覆盖版本信息注入\n"
62
+ @printf " make build-inner-mcp-sidecar # 构建 Hermes Pod 内 MCP sidecar 入口\n"
63
+ @printf " make build-artifact-downloader # 构建 workspace sync artifact 下载入口\n"
64
+ @printf " make build-collector # 构建 OpenTelemetry Collector 二进制\n"
65
+ @printf " make compose-up # 启动本地依赖与占位服务\n"
66
+ @printf " make compose-down # 停止本地依赖与占位服务\n"
67
+ @printf " make compose-logs # 查看 compose 日志\n"
68
+ @printf " make local-dev-env-from-container # 从当前 allinone 容器导出本地联调密钥到 .env.local\n"
69
+ @printf " make local-dev-up # 通过 kubevpn 直连 k8s 服务,启动 allinone + 本地前端 dev stack\n"
70
+ @printf " make local-dev-down # 停止本地 dev stack\n"
71
+ @printf " make local-dev-reset # 停止本地 dev stack 并清理前端依赖卷\n"
72
+ @printf " make local-dev-logs # 查看本地 dev stack 日志\n"
73
+ @printf " make local-dev-ps # 查看本地 dev stack 容器状态\n"
74
+ @printf " make verify-scaffold # 验证脚手架文件与 compose 配置\n"
75
+ @printf " make helmlint # 校验 coding-engine chart\n"
76
+ @printf " make helm-smoke # helm template 渲染并校验关键 RBAC / 配置不回归\n"
77
+ @printf " make check-skill # 运行全部 skill 校验(coding-testing 覆盖率 + 结构完整性)\n"
78
+ @printf " make check-skill-testing # 仅检查 coding-testing Layer→Strategy 覆盖率\n"
79
+ @printf " make check-skill-all # 仅检查全部 skill 的 frontmatter 与引用路径完整性\n"
80
+ @printf " make propose-skill # 生成缺失 skill 条目的草案文件\n"
81
+ @printf " make skill-impact # 统计每个 skill 在提交记录中的引用度,标注 retire / promote 候选\n"
82
+ @printf " make skill-graph # 渲染 skill 互引图到 docs/assets/skill-graph.dot (.png if graphviz present)\n"
83
+ @printf " make check-adr # 检查 docs/adr/ 状态字段(禁止 Proposed 进主干)\n"
84
+ @printf " make regen-adr-index # regenerate docs/adr/INDEX.md from ADR metafields\n"
85
+ @printf " make check-adr-index # verify docs/adr/INDEX.md is in sync (dry-run)\n"
86
+ @printf " make check-comment-i18n # 校验注释为英文(无 CJK)\n"
87
+ @printf " make test-adr # run ADR tooling fixture tests\n"
88
+ @printf " make check-docs # 检查 docs/ 文件名 / 标题 / 编号唯一性\n"
89
+ @printf " make cr # 人类/兼容入口:封装调用 coding-code-review(默认 8min 超时)\n"
90
+ @printf " make open-mr TITLE=\"...\" ARGS=\"--body-file ...\" # 推分支 → 创建/刷新 MR → 应用模型生成的正文\n"
91
+ @printf " make open-issue TITLE=\"...\" [ARGS=...] # 从 .codebase/issue_templates 模板创建 AI 可执行 issue;首选入口\n"
92
+ @printf " make next-issue [ARGS=...] # 列出可认领的 todo issue;ARGS=\"--claim N\" 认领并转 in_progress + 自指派\n"
93
+ @printf " make cr-to-issues [ARGS=...] # 把 make cr 的 deferred findings 去重沉淀成 issue(默认 dry-run;ARGS=--apply 才真建)\n"
94
+ @printf " make test-scripts # 运行全部 scripts/test/*.test.sh 离线 fixture/workflow 回归测试\n"
95
+ @printf " make check-mr-desc FILE=path/to/desc.md # 本地校验一份 MR 描述是否能通过 GitLab CI 的 mr:hygiene\n"
96
+ @printf " make check-mr-title TITLE=\"feat(ci): ...\" # 本地校验 MR 标题(Conventional Commits 中等档)\n"
97
+ @printf " make check-mr-size [BASE=origin/release] # 本地校验 MR diff 行数是否超过 8000 行硬上限\n"
98
+ @printf " make check-mr-target-merged [TARGET=origin/release] # 校验当前分支已合入目标分支最新提交;默认读取 MR_TARGET_REF / CI_MERGE_REQUEST_TARGET_BRANCH\n"
99
+
100
+ lint: lint-code lint-yaml lint-helm lint-thrift
101
+
102
+ lint-code: go-mod-tidy
103
+ ./scripts/check-go-names.sh
104
+ $(GOLANGCI_LINT) fmt --config $(GOLANGCI_CONFIG) ./...
105
+ $(GOLANGCI_LINT) run --config $(GOLANGCI_CONFIG) ./...
106
+
107
+ lint-yaml:
108
+ YAMLLINT_RETRY_HINT="make $(if $(MAKECMDGOALS),$(MAKECMDGOALS),lint-yaml)" $(YAMLLINT) -c .yamllint.yml .
109
+
110
+ lint-helm:
111
+ helm lint deployments/coding-engine
112
+
113
+ lint-thrift:
114
+ @for f in api/idl/*.thrift; do \
115
+ echo "==> thriftgo $$f"; \
116
+ $(THRIFTGO) -i api/idl -g go:skip_go_gen "$$f"; \
117
+ done
118
+
119
+ generate:
120
+ go generate ./...
121
+
122
+ baseline-sql:
123
+ go run scripts/generate-baseline-sql.go $(ARGS)
124
+
125
+ migrate-sql:
126
+ bash scripts/generate-migration-sql.sh
127
+
128
+ check-migrate-sql: migrate-sql
129
+ git diff --exit-code HEAD -- migration deployments/coding-engine/sql
130
+ @test -z "$$(git ls-files --others --exclude-standard -- migration deployments/coding-engine/sql)" || \
131
+ (printf 'untracked generated migration files:\n' >&2; git ls-files --others --exclude-standard -- migration deployments/coding-engine/sql >&2; exit 1)
132
+
133
+ check-migration-sql-immutability:
134
+ bash scripts/check-migration-sql-immutability.sh
135
+
136
+ check-migrate-sql-syntax:
137
+ go run scripts/check-migrate-sql-syntax.go --dialect=mysql
138
+ go run scripts/check-migrate-sql-syntax.go --dialect=postgres
139
+ go run scripts/check-migrate-sql-syntax.go --dialect=dm
140
+
141
+ go-mod-tidy:
142
+ @for dir in $$(go list -m -f '{{.Dir}}'); do \
143
+ echo "==> go mod tidy ($$dir)"; \
144
+ (cd "$$dir" && go mod tidy); \
145
+ done
146
+
147
+ gen-thrift: gen-thrift-engine
148
+
149
+ gen-thrift-engine:
150
+ hz model \
151
+ --rm_tag query \
152
+ --rm_tag form \
153
+ --idl api/idl/server.thrift \
154
+ --model_dir internal/adapters/inbound/http/thrift_gen \
155
+ --thriftgo 'go:package_prefix=code.byted.org/epscp/coding_engine/internal/adapters/inbound/http/thrift_gen,reserve_comments,enable_nested_struct,template=slim,no_default_serdes,no_processor'
156
+
157
+ check-openapi:
158
+ @python3 scripts/check-openapi.py --idl api/idl/server.thrift --yaml docs/openapi/openapi.yaml --html docs/openapi/coding-engine-api.html --top-version "$(TOP_VERSION)" --thriftgo "$(THRIFTGO)" --redocly "$(REDOCLY)"
159
+
160
+ gen-collector:
161
+ # 首次使用需先安装 ocb(OpenTelemetry Collector Builder)
162
+ # 各平台下载地址:https://github.com/open-telemetry/opentelemetry-collector-releases/releases
163
+ # 找到对应版本的 cmd/builder/vX.Y.Z,下载与本机匹配的二进制并放到 PATH 中
164
+ # 例如 macOS arm64:
165
+ # wget -O ocb "https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/cmd%2Fbuilder%2Fv0.152.0/ocb_0.152.0_darwin_arm64"
166
+ @command -v ocb >/dev/null 2>&1 || GO111MODULE=on go install go.opentelemetry.io/collector/cmd/builder@v0.151.0
167
+ @ocb --config ./configs/otelcol-build-config.yaml
168
+
169
+ test:
170
+ @set -e; \
171
+ for dir in $$(go list -m -f '{{.Dir}}'); do \
172
+ echo "==> go test ($$dir)"; \
173
+ (cd "$$dir" && go test -race ./...); \
174
+ done
175
+
176
+ test-root:
177
+ go test -race ./...
178
+
179
+ test-otelcol:
180
+ cd coding-otelcol && go test -race ./...
181
+
182
+ test-hijackprocessor:
183
+ cd coding-otelcol/processor/hijackprocessor && go test -race ./...
184
+
185
+ test-helm:
186
+ @echo "==> Testing Helm rendered RBAC and config invariants..."
187
+ @bash scripts/test-helm.sh
188
+
189
+ test-integration:
190
+ go test --tags=integration ./tests/integration/...
191
+
192
+ test-e2e:
193
+ go test --tags=e2e ./tests/e2e/...
194
+
195
+ clean:
196
+ rm -rf $(BIN_DIR)
197
+
198
+ build: build-engine build-allinone build-cli build-inner-mcp-sidecar build-artifact-downloader
199
+
200
+ # build-all is the alias referenced by onboarding.html / CLAUDE.md;
201
+ # kept as a thin shim so the documented command keeps working.
202
+ build-all: build
203
+
204
+ build-engine:
205
+ @mkdir -p $(BIN_DIR)
206
+ CGO_ENABLED=0 go build -ldflags "$(LDFLAGS_COMMON) -X $(VERSION_PKG).appName=coding-engine" -o $(BIN_DIR)/coding-engine ./cmd/coding-engine
207
+
208
+ build-allinone:
209
+ @mkdir -p $(BIN_DIR)
210
+ CGO_ENABLED=0 go build -ldflags "$(LDFLAGS_COMMON) -X $(VERSION_PKG).appName=coding-allinone" -o $(BIN_DIR)/coding-allinone ./cmd/coding-allinone
211
+
212
+ build-cli:
213
+ @mkdir -p $(BIN_DIR)
214
+ CGO_ENABLED=0 go build -ldflags "$(LDFLAGS_COMMON) -X $(VERSION_PKG).appName=coding-cli" -o $(BIN_DIR)/coding-cli ./cmd/coding-cli
215
+
216
+ build-inner-mcp-sidecar:
217
+ @mkdir -p $(BIN_DIR)
218
+ CGO_ENABLED=0 go build -ldflags "$(LDFLAGS_COMMON) -X $(VERSION_PKG).appName=coding-inner-mcp-sidecar" -o $(BIN_DIR)/coding-inner-mcp-sidecar ./cmd/coding-inner-mcp-sidecar
219
+
220
+ build-artifact-downloader:
221
+ @mkdir -p $(BIN_DIR)
222
+ CGO_ENABLED=0 go build -ldflags "$(LDFLAGS_COMMON) -X $(VERSION_PKG).appName=coding-artifact-downloader" -o $(BIN_DIR)/coding-artifact-downloader ./cmd/coding-artifact-downloader
223
+
224
+ build-collector:
225
+ @mkdir -p $(BIN_DIR)
226
+ cd coding-otelcol && CGO_ENABLED=0 go build -ldflags "$(LDFLAGS_COMMON)" -o ../$(BIN_DIR)/coding-collector .
227
+
228
+ compose-up:
229
+ $(DOCKER_COMPOSE) up -d --build
230
+
231
+ compose-down:
232
+ $(DOCKER_COMPOSE) down
233
+
234
+ compose-logs:
235
+ $(DOCKER_COMPOSE) logs -f coding-gateway coding-server coding-worker coding-daemon
236
+
237
+ local-dev-env-from-container:
238
+ @docker inspect coding-allinone-docker --format '{{range .Config.Env}}{{println .}}{{end}}' \
239
+ | grep -E '^(AIGW_AK|AIGW_SK|AIGW_REGION|IAM_AK|IAM_SK|IAM_REGION|UP_AK|UP_SK|iamEndpoint)=' \
240
+ | perl -pe 's/\x24/\x24\x24/g' > .env.local
241
+ @printf "Wrote .env.local from coding-allinone-docker\n"
242
+
243
+ local-dev-up:
244
+ @test -f .env.local || (printf "Missing .env.local. Run: make local-dev-env-from-container, or copy deployments/local-dev.env.example to .env.local and fill it.\n" && exit 1)
245
+ @docker rm -f coding-allinone-docker coding-web-dev platform-web-dev >/dev/null 2>&1 || true
246
+ $(DOCKER_COMPOSE) -f deployments/docker-compose.local-dev.yml up -d --build
247
+
248
+ local-dev-down:
249
+ $(DOCKER_COMPOSE) -f deployments/docker-compose.local-dev.yml down
250
+
251
+ local-dev-reset:
252
+ $(DOCKER_COMPOSE) -f deployments/docker-compose.local-dev.yml down -v
253
+
254
+ local-dev-logs:
255
+ $(DOCKER_COMPOSE) -f deployments/docker-compose.local-dev.yml logs -f
256
+
257
+ local-dev-ps:
258
+ $(DOCKER_COMPOSE) -f deployments/docker-compose.local-dev.yml ps
259
+
260
+ check: check-docs check-runbooks check-skills check-skill-router-sync check-agent-md check-adr-index check-comment-i18n check-context-propagation check-context-nil check-migrate-sql check-migration-sql-immutability check-migrate-sql-syntax check-repository-transactions check-rdb-structured-queries check-iam-actions test-adr test-scripts test-helm
261
+
262
+ check-docs:
263
+ @echo "==> Checking docs filenames, titles, numbering, and ADR statuses..."
264
+ @bash scripts/check-docs.sh
265
+ @bash scripts/check-adr.sh
266
+ @bash scripts/check-doc-refs.sh
267
+
268
+ check-runbooks:
269
+ @echo "==> Checking docs/runbooks/ links, anchors, and source citations..."
270
+ @bash scripts/check-runbooks.sh
271
+
272
+ runbook:
273
+ @bash scripts/runbook.sh $(if $(strip $(kw)),"$(kw)")
274
+
275
+ check-adr:
276
+ @echo "==> Checking ADR integrity (status, supersede, references, numbering, topic)..."
277
+ @bash scripts/check-adr.sh
278
+
279
+ check-skills:
280
+ @echo "==> Checking coding-* skill structure, references, and strategy coverage..."
281
+ @bash scripts/check-skills.sh
282
+
283
+ check-skill-router-sync:
284
+ @echo "==> Checking §Skill Router consistency across AGENTS.md, .cursor mirror, and hook..."
285
+ @python3 scripts/check-skill-router-sync.py
286
+
287
+ regen-agent-md:
288
+ @echo "==> Regenerating skill registry in AGENTS.md from .agents/skills/coding-*/SKILL.md..."
289
+ @bash scripts/regen-agent-md.sh
290
+
291
+ check-agent-md:
292
+ @echo "==> Checking AGENTS.md skill registry is in sync with .agents/skills/coding-*/SKILL.md..."
293
+ @bash scripts/regen-agent-md.sh --check
294
+
295
+ regen-adr-index:
296
+ @echo "==> Regenerating docs/adr/INDEX.md from ADR metafields..."
297
+ @bash scripts/gen-adr-index.sh
298
+
299
+ check-adr-index:
300
+ @echo "==> Checking docs/adr/INDEX.md is in sync with ADR metafields..."
301
+ @bash scripts/gen-adr-index.sh --check
302
+
303
+ check-comment-i18n:
304
+ @bash scripts/check-comment-i18n.sh .
305
+
306
+ check-context-propagation:
307
+ @python3 scripts/check-context-propagation.py .
308
+
309
+ check-context-nil:
310
+ @go run scripts/check-context-nil.go ./... ./coding-otelcol/... ./coding-otelcol/processor/hijackprocessor/...
311
+
312
+ check-repository-transactions:
313
+ @bash scripts/check-repository-transactions.sh .
314
+
315
+ check-rdb-structured-queries:
316
+ @bash scripts/check-rdb-structured-queries.sh .
317
+
318
+ check-iam-actions:
319
+ @python3 scripts/check-iam-actions.py
320
+
321
+ test-adr:
322
+ @echo "==> Running ADR tooling fixture tests..."
323
+ @bash tests/adr/lib.test.sh
324
+ @bash tests/adr/gen-adr-index.test.sh
325
+ @bash tests/adr/check-adr.test.sh
326
+
327
+ skill-propose:
328
+ @echo "==> Generating skill evolution proposals..."
329
+ @bash scripts/skill-propose.sh
330
+
331
+ skill-impact:
332
+ @bash scripts/skill-impact.sh
333
+
334
+ skill-graph:
335
+ @echo "==> Generating skill cross-reference graph..."
336
+ @bash scripts/skill-graph.sh
337
+
338
+ cr:
339
+ @bash scripts/cr.sh
340
+
341
+ open-mr:
342
+ @bash scripts/open-mr.sh $(if $(TITLE),--title "$(TITLE)") $(ARGS)
343
+
344
+ open-issue:
345
+ @bash scripts/open-issue.sh $(if $(TITLE),--title "$(TITLE)") $(ARGS)
346
+
347
+ next-issue:
348
+ @bash scripts/next-issue.sh $(ARGS)
349
+
350
+ cr-to-issues:
351
+ @bash scripts/cr-to-issues.sh $(ARGS)
352
+
353
+ test-scripts:
354
+ @set -e; \
355
+ for f in $$(find scripts/test -maxdepth 1 -type f -name '*.test.sh' | sort); do \
356
+ printf '==> %s\n' "$$f"; \
357
+ env SHELLOPTS= bash "$$f"; \
358
+ done
359
+
360
+ check-mr-desc:
361
+ @bash scripts/check-mr-desc.sh $(if $(FILE),--description-file "$(FILE)") $(ARGS)
362
+
363
+ check-mr-title:
364
+ @bash scripts/check-mr-title.sh $(if $(TITLE),--title "$(TITLE)") $(ARGS)
365
+
366
+ check-mr-size:
367
+ @bash scripts/check-mr-size.sh $(if $(BASE),--base "$(BASE)") $(ARGS)
368
+
369
+ check-mr-target-merged:
370
+ @bash scripts/check-mr-target-merged.sh $(if $(TARGET),--target "$(TARGET)") $(if $(HEAD),--head "$(HEAD)") $(ARGS)
@@ -0,0 +1,53 @@
1
+ # Skill Registry & Lifecycle
2
+
3
+ Reference index for the coding-* skills. The **path→skill routing table is in `AGENTS.md` §Skill Router** (the source of truth, read inline by every CLI). This file holds the verbose per-skill descriptions and the maintenance cadence — consulted when picking or pruning skills, not on every edit.
4
+
5
+ ## Tool bridges
6
+
7
+ How each CLI reaches the `AGENTS.md` §Skill Router table:
8
+
9
+ | Tool | Entry | Bridge in repo |
10
+ |---|---|---|
11
+ | Codex / Antigravity / Trae | Root `AGENTS.md` (native) | — |
12
+ | Gemini | `GEMINI.md` → `AGENTS.md` | Thin bridge |
13
+ | Claude Code | `CLAUDE.md` → `AGENTS.md` | `.claude/settings.json` PostToolUse hook via `scripts/skill-router-hook.sh` |
14
+ | Cursor | `.cursor/rules/skill-router.mdc` | Mirror of §Skill Router (auto-injected by glob) |
15
+
16
+ Adopting a new tool? Add a row and a bridge (mirror file, hook, or symlink) — do not rely on contributors to manually `@AGENTS.md`.
17
+
18
+ ## Skill Registry
19
+
20
+ Per-skill descriptions sourced from each `.agents/skills/coding-*/SKILL.md` frontmatter. Auto-regenerated by `make regen-agent-md` (enforced by pre-commit `check-agent-md`). **Do not hand-edit between the markers.**
21
+
22
+ <!-- skills:start (auto-generated by make regen-agent-md) -->
23
+
24
+ | Skill | When to use |
25
+ |---|---|
26
+ | `coding-architecture` | Use when adding features, new aggregates, new ports, or architecture-level adapters to coding_engine. |
27
+ | `coding-code-review` | General-purpose diff-based code review orchestration for clean canonical diff generation, reviewer dispatch, and report consolidation without re-reviewing code. |
28
+ | `coding-cve-remediation` | 处理 coding_engine 的 Codebase 镜像漏洞扫描结果。适用于查看 scan-image-* 镜像扫描 job、读取 image-scanner 报告、分类 CVE,并只修复 coding-engine、coding-inner-mcp-sidecar、coding-collector 中可由 Go 依赖升级解决的漏洞;OS/base image 漏洞只报告为范围外。 |
29
+ | `coding-db-schema` | Use when adding, modifying, or removing a database schema element in coding_engine — new column, dropped column, renamed column, new table, new index, type change, or new GORM model under `internal/adapters/outbound/persistence/rdb/` or `mem-svc/internal/adapters/outbound/persistence/rdb/`. Encodes explicit migration SQL ownership for the coding-engine main DB, GORM PO / SQL alignment, mem-svc AutoMigrate ownership, RDB repository behavior checks, soft-delete vs physical-delete rules, forward-only safety rules, and the breaking-change ADR trigger. |
30
+ | `coding-deploy-config` | Use when changing any deployment/runtime/config item in coding_engine — Helm values, vecompass-override, configs/engine.yaml.example, Go config struct, image repo/tag, DSN, K8s probe/service port, Secret/ConfigMap field. |
31
+ | `coding-docs-audit-autofix` | Use after coding-docs-audit has produced docs-audit-report.md to conservatively fix obvious stable-doc drift and write a focused notification report for the findings that still need code/config/implementation follow-up. |
32
+ | `coding-docs-audit` | Use when performing a bounded, read-only audit of stable docs under docs/ plus root README.md, README.zh-CN.md, onboarding.html, and vibe-coding.html against current code implementation, excluding ADRs and OpenAPI/interface docs, and writing docs-audit-report.md with a Chinese discrepancy-only report, Critical/Major/Minor/Suggestion severity, mandatory git blame attribution to specific people, and a final per-person task summary. Enforces fixed phases, budgets, and stop conditions to avoid open-ended scans. |
33
+ | `coding-http-api` | Use when changing any HTTP API surface in coding_engine — adding/modifying/removing a Thrift IDL field or service method under `api/idl/*.thrift`, editing a Hertz handler under `internal/adapters/inbound/http/handlers/`, or aligning generated clients/frontends with backend changes. Encodes the IDL field-tag conventions, required↔optional compatibility rules, the codegen/regen step, the handler→service→domain dispatch shape, the cross-layer cleanup checklist for renames/removals, and the frontend-alignment trigger. |
34
+ | `coding-issue-autodev` | "Use when taking over a specific coding_engine Codebase issue and driving it end-to-end in either human or agent mode: read the issue, claim it for the current bytedcli user or BOT_NAME, optionally force-claim from another assignee, follow the normal coding development flow, run required gates and coding-code-review, commit with an issue-closing trailer, and open or refresh the MR through make open-mr." |
35
+ | `coding-merge-request` | Use when creating, updating, validating, or preparing a coding_engine merge request, including MR title/description hygiene, target branch freshness, diff size limits, code review handoff, issue trailers, and make open-mr workflows. |
36
+ | `coding-observability` | Use when changing any observability surface in coding_engine — adding/removing a metric in `internal/observability/`, emitting via `port.Metrics`, editing the OTel Collector build manifest (`configs/otelcol-build-config.yaml`), the collector runtime config (`configs/otel-config.yaml.example`), the collector Helm templates under `deployments/coding-engine/templates/collector/`, or the telemetry DB clients in `pkg/platform/telemetrydb/`. |
37
+ | `coding-refactor-insight` | 识别 coding_engine 中高收益重构机会,并输出中文 Top 5 架构洞察报告。聚焦 Module 深度、Interface 宽度、Seam、Adapter 泄漏、Locality、重复实现、fan-out 与 Leverage,而不是输出 lint 明细清单。 |
38
+ | `coding-release-merge` | Use when merging the latest release branch into the current coding_engine feature branch, resolving conflicts, and reconciling newly introduced shared conventions such as API contracts, error handling rules, common helpers, config patterns, or cross-cutting refactors across both sides of the merge. |
39
+ | `coding-runtime-adapter` | Use when adding a new runtime provider to coding_engine, modifying runtime adapter code under `internal/adapters/outbound/{hermes,workspacejob}/**`, or changing worker provider registry wiring. |
40
+ | `coding-testing` | Use when writing, reviewing, fixing, or running any test in coding_engine, including unit tests, integration tests, external-service manual checks, and deployed-environment coverage (E2E P0/P1/P2 smoke & regression, DFX stability/load, Eval quality). There is no QA team — Claude owns test correctness. Covers which strategy applies to each layer, required tooling, mandatory test run commands, and what "done" means before marking work complete. |
41
+ <!-- skills:end -->
42
+
43
+ ## Skill lifecycle
44
+
45
+ Skills are not eternal. Periodically (~90d):
46
+
47
+ ```bash
48
+ make check-skills # hard gate: structural integrity + drift + Layer→Strategy coverage
49
+ make skill-propose # soft suggestion: auto-drafts proposals for detected gaps
50
+ make skill-impact # classifies skills NEW / WATCH / DEAD / COLD / WARM / HOT
51
+ ```
52
+
53
+ Retire `DEAD` (≥90d, 0 refs/year). Promote `HOT` (≥20 refs/year) into `AGENTS.md` as a top-level rule. Thresholds tunable in `scripts/skill-impact.sh`.