仓库代码实现与修改
code-implementation
在规定的范围、无回归、验证和评审关卡下实现、修复、重构或删除仓库代码。当任务可能改动生产代码、测试、脚本或其他实现产物(包括构建逻辑、生成的源代码以及影响行为的配置)时使用。也可与专门的代码修改 Skill 配合使用。不要用于只读分析或评审、纯诊断工作或纯文字改动。
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-13
- Stars
- ★ 2.1w
- Forks
- 6.9k
01 前言 Front Matter
- name
- code-implementation
- description
- Implement, fix, refactor, or remove repository code under required scope, non-regression, verification, and review gates. Use whenever a task may change a production, test, script, or other implementation artifact, including build logic, generated source, and behavior-affecting configuration. Also use it alongside a specialized code-changing Skill. Do not use for read-only analysis or review, diagnosis-only work, or prose-only changes.
02 资源文件 6
- 参考文档agents/openai.yaml1.1 KB
- 参考文档references/rules/artifact-removal-and-contract-impact.md5.5 KB
- 参考文档references/rules/implementation.md9.7 KB
- 参考文档references/rules/non-regression.md6.3 KB
- 参考文档references/rules/testing.md4.9 KB
- 参考文档references/verification.md6.5 KB
03 SKILL.md 正文
Code Implementation
AGENTS.md remains authoritative for scope, permission, safety, architecture, and task lifecycle. Reading this Skill does not grant write, Git, remote, file-type, or scope authority.
Required References
Read every selected reference through EOF before relying on it. Do not substitute catalog metadata, a summary, another Skill, or ordinary coding judgment for a required repository source.
- For every code-affecting write, read
.codex/skills/code-implementation/references/rules/implementation.md. - Before loading the testing rules, use these routing facts: for Maven source trees only
src/main/**may be the subject of added or updated tests; a change confined tosrc/test/**requires no additional coverage; and a script, configuration, policy, or harness change needs tests only when an existing focused test mechanism protects its behavior. Read.codex/skills/code-implementation/references/rules/testing.mdbefore assessing test scenarios for changedsrc/main/**behavior, satisfying requested test or coverage work, or creating or changing a test. - Read
.codex/skills/code-implementation/references/rules/artifact-removal-and-contract-impact.mdbefore removing or replacing an owner, classifying an artifact as unused or removable, changing a public or externally visible contract, or modifying an affected snapshot, golden file, registration, loading path, or workflow filter. - Read
.codex/skills/code-implementation/references/rules/non-regression.mdwhen a change affects a public or shared contract, crosses behavior owners, or has credible functional or performance risk. Otherwise preserve supported behavior through the implementation rules and focused owner checks without loading the full reference. - Read
.codex/skills/code-implementation/references/verification.mdbefore the first repository check and reuse it while the task state is unchanged. - For production or test Java and Maven POM changes, read
.codex/skills/coding-standards/SKILL.mdthrough EOF and use its Implementation Guidance Mode. For other artifacts, inspect only written standards that govern the changed files. Do not run the standalone inventory or physical-line audit unless the user requests that audit.
Specialized repository Skills compose with this Skill when they write code. Their narrower rules add to these rules and do not replace them.
Workflow
- Apply the pre-write gates in
AGENTS.mdand freezefile -> allowed change intent -> unmet acceptance criterion. Infer clearly authorized paths without asking the user to repeat the request; expand only with exact additional path and intent authorization. Before selecting an implementation, distinguish original user requirements, maintained project contracts, author design choices and unverified assumptions in the existing task record, and trace every hard constraint to its original source. Approval to implement a proposal preserves the approved choice but does not establish that its version pin was an original requirement or that the pin is necessary; retain the constraints and tradeoffs the user actually confirmed with their sources. For a new local override, compatibility exception or parallel mechanism, record the verified reason direct reuse cannot meet the accepted requirements. - Map every planned production and test change to one unsatisfied acceptance criterion and identify the supported existing paths that the change can affect.
- Classify functional and performance risk before the first relevant write. Preserve supported behavior outside the exact requested change; when the full non-regression reference is triggered, capture its required baseline before editing.
- Implement the smallest clear change under the implementation rules, and apply the testing rules when their trigger above matches.
- After each coherent edit batch, inspect every changed path and hunk. Inspect immediately after a formatter, generator, bulk replacement, or another action whose write set is not exact. Stop at the existing scope or authority gate when a required change lies outside the frozen boundary.
- Complete this step when Coding Standards applies. After the last implementation write, reapply the Coding Standards Implementation Guidance Mode to affected files and complete its final manual checklist recheck before final verification. Any later write returns the affected files and rules to this step.
- Run the narrowest meaningful checks under the verification rules. Reuse a passing result while its task state and evidence remain unchanged; rerun only checks invalidated by a relevant write, failure, scope change, or new evidence.
- After verification, follow
.codex/context/change-completion.mdas the sole completion-loop orchestration owner.
Do not treat a passing build, test, formatter, benchmark, or review tool as proof by itself. Judge the requested behavior, supported existing behavior, contracts, architecture, and affected performance paths directly.
04 同仓库更多 Skills
PR 代码评审
review-pr
基于公开或经授权的仓库证据,审查 Apache ShardingSphere 或用户授权的下游拉取请求(PR)及 PR 讨论。用于代码正确性或可合并性决策、以 CI 为重点的评审、根因与回归分析、完整汇总的发现结论、可直接复制使用的提交者反馈、受到质疑的发现、多轮评审,以及在仓库完成循环中对本地实现候选方案进行的正式评审。
ShardingSphere 单元测试生成
gen-ut
为 Apache ShardingSphere 中的一个或多个目标类生成标准单元测试;覆盖所要求的行为以及每个受影响的 SUT 自有分支,强制达成明确要求的数值覆盖率目标,并通过质量门禁;对参数化测试执行显式的合并分析、适用性筛选和重构优化。
ShardingSphere 编码规范审查
coding-standards
当用户明确要求,或 code-implementation 将任务改动的生产、测试、脚本、构建、生成的产物或 Maven POM 产物交由仓库规范处理时,应用 Apache ShardingSphere 的成文编码规范。也可对用户指定范围执行独立的只读合规审查。使用 CODE_OF_CONDUCT.md、适用的 AGENTS.md 规则、Checkstyle、Spotless 以及仓库定义的其他标准,包括命名规则和基于证据的防御性编码规则。对于已由 code-implementation 管辖的普通实现,不要单独调用;也不要单独审查架构、运行时归属、缓存或生命周期。
ShardingSphere 社区问题分析
analyze-issue
用于分析 Apache ShardingSphere 社区工单。强调在得出结论之前先进行根因优先和证据优先的分类,并以 Apache ShardingSphere 社区维护者的口吻生成可直接复制使用的 GitHub 工单回复。