Imported from work-w-chrstnrpj/ai-project-structure-template (
.agents/skills/execute-code-change/SKILL.md). Install upstream withnpx skills add work-w-chrstnrpj/ai-project-structure-template --skill execute-code-change. Copyright stays with the author.
Execute Code Change
Purpose
Implement a safe, source-grounded code change with verification and documentation updates when needed.
Execution Modes
Mode A: Plan-first execution
Use when:
- The user provides a plan.
plan-code-changewas already run.- A ticket or implementation plan exists.
Procedure:
- Read the plan.
- Validate the plan against current files.
- Identify any stale assumptions or missing files.
- Execute the smallest safe slice.
- Add/update tests when behavior changes.
- Update docs when behavior, API, database, architecture, deployment, project structure, testing, or AI workflow changes.
- Run the smallest relevant verification.
- Report deviations from the plan.
Mode B: Direct execution
Use when:
- The user directly asks to implement, fix, update, refactor, or clean up.
- No separate plan exists.
- The change is small or medium-risk.
Procedure:
- Do a brief internal planning pass.
- Read
AGENTS.md. - Use
.ai/context-routing.mdif present. - Use maps/indexes/tools only for discovery.
- Read exact source files, nearby tests, contracts, and docs before editing.
- Confirm the smallest safe implementation that follows existing patterns.
- Edit narrowly.
- Add/update tests when behavior changes.
- Update docs when needed.
- Run the smallest relevant verification command.
- Summarize files changed, behavior changed, verification, and remaining risks.
Escalate to plan-code-change first when
- The change spans multiple modules.
- Requirements are unclear.
- Public API behavior changes.
- Auth/security behavior changes.
- Data migrations are involved.
- Deployment/runtime behavior changes.
- The blast radius is unknown.
- The user explicitly asks to plan first.
Boundaries
- Do not bypass project guardrails in
AGENTS.md. - Do not expose secrets or sensitive data.
- Do not run destructive commands, migrations, deployments, force pushes, resets, or cleanups without explicit approval.
- Do not claim verification passed unless it actually ran.
- Do not edit from generated context alone.
Required Output
- Execution mode used.
- Relevant files/docs inspected.
- Files changed.
- Behavior changed or structure changed.
- Tests/verification run, including command and result.
- Docs updated or skipped with reason.
- Deviations from plan, if any.
- Remaining risks, assumptions, and handoffs.
