safe-code-change

Identify tests affected by code changes and update them to match new behavior.

71|88|Updated Nov 8, 2023
One-click install
npx skills add https://github.com/openshift/lightspeed-service --skill safe-code-change
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: safe-code-change
Source: https://github.com/openshift/lightspeed-service/tree/main/.cursor/skills/safe-code-change
Command: npx skills add https://github.com/openshift/lightspeed-service --skill safe-code-change

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

After a code change is made, identify affected tests, update them to reflect new behavior, and run the full validation pipeline to ensure nothing is broken.

Core Features & Use Cases

  • Identify changed production files and locate corresponding tests that are impacted.
  • Update tests to align with the new behavior without modifying production code.
  • Run the full validation pipeline to verify tests pass and regressions are caught.
  • Do not reformat or lint-fix during test updates; reserve that for the validation step.
  • If changes are ambiguous, prompt the user for clarification before applying updates.

Quick Start

After modifying production code, run this skill to locate affected tests, update them to reflect the new behavior, and trigger the full validation pipeline.

Frequently Asked Questions about safe-code-change

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I update tests to match modified production code without breaking existing functionality?

To update tests after modifying production code, use a workflow that identifies affected tests via git diff and applies minimal test updates to align with new behavior. This ensures test synchronization without editing production code, keeping your validation pipeline intact.

What is the best way to find and update tests affected by a code change?

The best way to find affected tests is using git diff to locate changed production files and searching test files for relevant imports. Once located, apply minimal updates to reflect the new behavior without reformatting or lint-fixing during the update step.

How do I synchronize tests with production behavior after a git diff shows code changes?

Test synchronization involves analyzing the git diff of production files, searching for tests with relevant imports, and applying minimal updates to match the new behavior. If changes are ambiguous, the workflow prompts for clarification before applying updates.

Can I automatically run the full validation pipeline after updating tests for a code change?

Yes, after updating tests to align with the new behavior, you can run the full validation pipeline to verify tests pass and catch regressions. This ensures your code changes don't break tests and maintains production stability.

Does updating tests after a code change require modifying the production code further?

No, test synchronization after a code change applies minimal updates only to test files without modifying production code. The workflow reserves reformatting and lint-fixing for the validation step, ensuring clean separation between test updates and production behavior.

When should I prompt for clarification during test updates after a code change?

You should prompt for clarification when code changes are ambiguous and the required test updates cannot be determined automatically. This prevents incorrect test modifications and ensures the updated tests accurately reflect the intended new production behavior.