| name | implement-backend-change |
| description | Implement approved backend code changes in existing Spring Boot modules with minimal safe edits. Use only after task scope and acceptance criteria are clear. Reuse current controller/service/repository/dto/mapper/config patterns, preserve API contracts unless explicitly approved, run relevant backend verification commands, and report evidence, risks, and unresolved items. |
implement-backend-change
Role
Act as a backend implementation executor.
This skill is for writing and updating backend code only. It is not a scan/discovery skill, architecture redesign skill, or generic review-only skill.
Purpose
Deliver the approved backend change with the smallest safe patch that:
- follows existing project patterns,
- avoids silent behavior drift,
- includes executable verification evidence,
- is ready for PR/review handoff.
When to Use
Use this skill only when all are true:
- Task plan is already approved.
- Scope and acceptance criteria are explicit.
- Main work is backend code change under
backend/.
- Required module boundaries are known (controller/service/repository/dto/mapper/config/test/docs).
When Not to Use
Do not use this skill when any is true:
- Requirements are ambiguous or still being shaped.
- Work is mainly discovery, planning, or architecture evaluation.
- Change requires unapproved DB schema/migration/auth/dependency/framework redesign.
- Requested work is mostly broad refactor/cleanup/renaming unrelated to the task.
If these conditions appear, stop and mark REQUIRES CONFIRMATION.
Trigger Conditions
Trigger when user intent matches phrases such as:
- "implement backend change"
- "apply approved backend task"
- "code the backend plan"
- "make minimal backend patch with tests"
Do not trigger for scan-only, PRD-only, or review-only requests.
Required Inputs
Confirm or derive these before editing:
- Approved task context: ticket/PR/issue link or accepted plan summary.
- Exact scope: affected module(s), endpoint(s), and package/file targets.
- Acceptance criteria: expected behavior and non-goals.
- Constraints: forbidden changes (schema/auth/dependency/architecture), compatibility requirements.
- Verification target: which tests/commands prove completion.
- Reference locations: related tests/docs/message files.
If any required input is missing, do not guess. Mark REQUIRES CONFIRMATION with the missing item.
Preconditions
Before implementation:
- Read
AGENTS.md and backend/AGENTS.md.
- Inspect nearby code in affected module to identify established patterns.
- Confirm this is an implementation task, not redesign.
- Confirm no blocked high-risk category is implicitly required.
Implementation Rules
A. Minimal Safe Change Rules (Mandatory)
- Change only files directly required by accepted scope.
- Reuse existing service/util/mapper/validator/exception/message patterns first.
- Do not add new abstraction/class/helper when an existing one can be extended safely.
- Do not perform unrelated cleanup, renaming, formatting sweeps, or opportunistic refactors.
- Split broad edits into small, traceable commits/patch segments when risk grows.
B. Layering and Structure Rules
- Keep Controller thin; place business logic in Service.
- Keep persistence behavior in Repository.
- Keep DTO mapping in existing mapper/location pattern.
- Follow current package naming and annotation conventions.
C. API Contract and Behavior Safety Rules
Treat these as contract-sensitive and never change silently:
- Endpoint paths/methods/request fields/response fields.
- Validation rules and error payload semantics.
- HTTP status codes and exception mapping behavior.
- Security annotations/rules and auth-required behavior.
- User-visible message codes/keys/localized text paths.
If change to any contract-sensitive item is required:
- mark
REQUIRES CONFIRMATION,
- describe old vs new behavior,
- list impacted clients/tests/docs.
D. Restricted Change Categories
Without explicit approval, do not change:
- DB schema/migrations/entity persistence contract,
- auth/token/permission/security flow,
- dependency versions or new production dependencies,
- major architecture/module boundaries.
Steps (Execute in Order)
-
Confirm Scope and Guardrails
- Restate task scope, non-goals, and blocked categories.
- Mark
REQUIRES CONFIRMATION if scope conflicts with boundaries.
-
Locate Impacted Files
- Identify concrete files for controller/service/repository/dto/mapper/config/test/docs.
- Include message/i18n/exception files when behavior or messages change.
-
Match Existing Patterns
- Inspect nearest similar implementation.
- Reuse same response/error/validation/annotation style.
-
Implement Smallest Correct Patch
- Apply only required logic updates.
- Keep signatures/contracts stable unless explicitly approved.
-
Update Dependent Artifacts Required by Behavior Change
- Update tests, API annotations, message keys, docs only where behavior changed.
- Do not add speculative updates.
-
Run Verification
- Run smallest relevant command first.
- Escalate only if needed for confidence or task requirement.
-
Report Results for Handoff
- Provide output contract exactly (see below).
- Explicitly list unverified areas and reasons.
Verification Rules
What counts as relevant validation
Choose the smallest command that directly validates changed behavior, in this order:
- Targeted test(s) for touched package/class (if available).
./mvnw test (or mvn test fallback) when code behavior changed.
./mvnw clean install (or mvn clean install) for higher-risk/shared/build-impact changes.
Minimum requirement
- Run at least one executable backend validation command for backend code changes, unless blocked by environment.
If validation cannot run
Report explicitly:
- command not run,
- blocker reason,
- exactly what remains unverified.
Never claim pass without command output.
Output Contract (Required)
Return a structured handoff containing:
- Change Summary: what changed and why.
- Files Changed: explicit path list by layer.
- Behavior/Contract Impact:
- unchanged, or
- changed with approved confirmation reference and impact list.
- Verification Evidence:
- exact command,
- pass/fail/blocked,
- key result.
- Risks and Follow-ups:
- known risks,
- deferred checks,
- required next actions.
- Assumptions / Unresolved Items:
- include
REQUIRES CONFIRMATION, BLOCKED, or OUT OF SCOPE tags where applicable.
Failure / Uncertainty Handling
Use these exact tags:
REQUIRES CONFIRMATION: missing input, contract-impacting decision, or restricted category change needed.
BLOCKED: cannot proceed due to environment/tool/access/runtime blocker.
OUT OF SCOPE: request exceeds approved plan or this skill boundary.
When tagged, include:
- reason,
- impact,
- minimal next action needed to unblock.
Boundaries
- Do not turn implementation into redesign.
- Do not introduce new patterns without evidence existing patterns are insufficient.
- Do not apply unrelated code cleanup.
- Do not hide behavior changes behind “minor refactor”.
- Do not expand scope beyond approved task plan.
What Not to Do
- Do not start with broad scan/planning workflows.
- Do not silently change API contract, validation behavior, or status codes.
- Do not modify schema/auth/dependencies without explicit approval.
- Do not claim tests passed without execution evidence.
- Do not leave uncertainty implicit; tag it explicitly.