跳到正文
cccskills
免费在 GitHub 公开

dough-post-change-refactor

Refactors concepts implicated by the current uncommitted change before commit. Includes untouched representations and orchestration needed for coherence, stops before unapproved cross-subsystem refactoring or disputed plan behavior, and tests only after edits. Use after a slice, for post-change refactoring, or to clean up the current change.

中文简介正在准备中。当前显示原文说明。

nerds-odd-e/doughnut星标 50(GitHub 50 + cccskills 0)

实测评分 未实测

查看安装方法

包含的文件(2)

  • SKILL.md8.0 KB
  • references/refactor-checks.md7.0 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Refactor the current change

Preserve observable behavior while making implicated concepts cohesive, clearly named, and justified. Return to the caller without starting another slice, committing, pushing, amending, or triggering CI.

Discover scope

Run git status, git diff, and git diff --cached. If there is no uncommitted change, report empty scope and use the completion handoff below without edits or tests.

For a nonempty change, resolve this project's navigation, domain vocabulary, production subsystem boundaries and applicable architectural decisions, tooling wrapper, whitespace check with generated-artifact exclusions, and focused test commands. Resolve generation triggers and commands only when affected. If necessary context is missing, report it and stop without claiming completion.

Use the caller's active plan and current slice when supplied. Code may be justified by the current change or the immediate next slice in that plan; without a plan, only the current change supplies justification. Later slices cannot justify speculative code. The next slice can justify retaining code but cannot independently trigger refactoring.

Decide before editing

Read refactor checks and make one read-only pass through them. For each candidate, identify:

  1. An issue introduced, exposed, or materially aggravated by the current change.
  2. The smallest complete set of representations, callers, tests, fixtures, and configuration needed to make the concept coherent.
  3. The production subsystems that the refactoring would change.

Trace the concept through its representations and orchestration, including untouched code that repeats its knowledge or must change for coherence. Apply consumer and old-reference tracing to meaningful cross-file changes in both the incoming change and your refactor edits. Apply delivery scope versus implementation reach: story membership cannot exclude a necessary edit. Dependency adjacency alone does not establish scope. Do not initiate unrelated cleanup discovered during tracing.

If a candidate exposes a disputed plan restriction, use the shared plan-conflict handoff before editing that behavior. Preserving it is not a clean review result when its justification is disputed; return a decision stop without disguising a behavior change as refactoring.

Identify real production boundaries from domain responsibilities and this project's architectural decisions; delivery groupings and story-named handlers do not establish separate subsystems. If product organization coincides with story boundaries, require independent domain justification. Whole-concept examination does not authorize overriding an architectural decision; surface any conflict for human resolution before the conflicting edit.

If a candidate needs coordinated production refactoring in more than one production subsystem, stop before editing unless the human has authorized that named concept and those subsystems, or the active plan specifically identifies the cross-subsystem structure as necessary for the current authorized responsibility. The plan must connect the concept, affected boundaries, and current outcome; an inferred benefit, generic cleanup authorization, or a later story is insufficient. Tests, fixtures, generated artifacts, and configuration following one production seam do not alone constitute a crossing; neither does the original behavior change spanning subsystems.

If this crossing becomes apparent during editing, stop before the first cross-subsystem edit and reverse only this agent's edits for that candidate. Preserve others' changes and return the decision handoff below. Do not substitute a partial refactor or proceed with other candidates while the gate is unresolved.

With no candidates, report none — already clean and complete without tests. Otherwise edit in refactor-check order, without repeating broad discovery. Use this project's whitespace check. Regenerate affected artifacts through their source generator and validate consumers; never manually repair generated output.

Verify edits

When the caller supplied accepted proof, compare each refactor edit with its reported boundary, implementation, setup, and observation locations. Identify which accepted proof remains unchanged and which the refactor invalidated; unchanged proof requires no rerun. Rerun only commands whose covered behavior or paths the refactor invalidated. If the covered boundary moved, explain why the original command no longer applies and run a focused replacement. Without supplied proof, run focused tests related to the refactor edits. Use this project's literal commands and the shared behavioral test guidance. Before expensive verification, apply choose expensive proof before launch, confirming or reconsidering the caller's retained decision and known competing owned work on the actual target machine. A separate worktree shares that machine's capacity; coordinate owned heavy work through the existing handoffs. Do not run the full suite. Own any verification command that yields a running command identity through its terminal result under the shared verification ownership rule. Fix failures caused by the refactor and require passing relevant proof before completion. Report other unresolved failures to the caller; do not claim success.

Return control

On completion, return a targeted report with the refactor outcome, every path and conceptual or product boundary changed by refactoring, and checks that changed code. Include the consumer-trace record for your refactor edits, produced by the installed consumer-trace.mjs script, with each listed consumer's disposition and the focused proof selected or reused for their affected behavior; name any uncovered consumers as gaps. For each relevant accepted proof, name whether its boundary and inspected locations stayed unchanged or which edit invalidated them. For invalidated or replacement proof, report the literal command, result, and concrete setup and assertion or signal locations. Also retain the expensive-proof decision and any deferred required observation with its owner and next condition. Report files renamed, extracted, split, or deleted; unresolved gaps or contradictions; consequential learnings; passing test commands or skipped — no refactor edits; and approximate active elapsed time. Do not attach routine raw traces, full command logs, or a duplicate full diff; the caller inspects the reported locations. End with ## REFACTOR COMPLETE.

For a disputed plan restriction, return the shared plan-conflict handoff and end with ## REFACTOR JIDOKA STOP; the caller must resolve it before treating the review as complete or committing.

When the subsystem gate stops work, report the triggering issue, concept, affected subsystems and representative files, why a narrower change would be incomplete, expected risk and focused validation, and elapsed time. Ask the human to authorize the refactoring, defer it, or approve a described narrow exception. End with ## REFACTOR JIDOKA STOP. The caller must resolve this decision before considering refactoring complete or committing.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

backend

免费

Backend Java — Spring Boot controllers/services, JUnit controller tests, MakeMe. Read this first for any backend work. Use when working on the Java Spring backend.

中文简介正在准备中。当前显示原文说明。

nerds-odd-e/doughnut502026年10月26日 更新

Backend Java production code, Spring Boot controllers/services/repositories, controller return values, imports, schema ERD pointer. Use when editing backend production Java.

中文简介正在准备中。当前显示原文说明。

nerds-odd-e/doughnut502026年10月26日 更新

Backend Java tests, controller-level stable-boundary tests, JUnit, @Nested, MakeMe builders, @Transactional, parameterized tests. Use when writing or changing backend JUnit tests.

中文简介正在准备中。当前显示原文说明。

nerds-odd-e/doughnut502026年10月26日 更新

cli

免费

related to donut CLI. Use when working on donut-cli.

中文简介正在准备中。当前显示原文说明。

nerds-odd-e/doughnut502026年10月26日 更新

Set up and run the Donut dev environment on Cursor Cloud VM (no Nix). Use when working on Cloud VM, running tests on Cloud VM, or encountering command errors related to missing nix. Triggers on: cloud VM, cloud agent, no nix available, /workspace path.

中文简介正在准备中。当前显示原文说明。

nerds-odd-e/doughnut502026年10月26日 更新

Regenerate docs/database-erd.md from MySQL information_schema (Mermaid ERD: foreign keys and key columns). Use after Flyway schema changes, new migrations, or when the diagram is stale. Triggers on: database ERD, database-erd.md, export_database_erd, schema diagram, ER diagram after migration.

中文简介正在准备中。当前显示原文说明。

nerds-odd-e/doughnut502026年10月26日 更新

查看 nerds-odd-e 的全部技能

报告此技能的问题