Skip to main content

safe-code-change

After a code change, find affected tests, update them to match new behavior, then run the full validation pipeline once. Use when the user has made or asked for a code change and wants to make sure nothing is broken.

来源信息

仓库
openshift/lightspeed-agentic-sandbox
最近来源活动
2026年5月19日 11:24
检测到的 SKILL.md 语言
英语
星标
5
分支
23

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
safe-code-change
description
After a code change, find affected tests, update them to match new behavior, then run the full validation pipeline once. Use when the user has made or asked for a code change and wants to make sure nothing is broken.
disable-model-invocation
true
# Safe Code Change After a code change is made, find and fix affected tests before running validation. ## Rules - The code change is already done. Do not modify production code. - Only update tests to match the new behavior, not the other way around. - Do not reformat or lint-fix during test updates. Save that for validation. - If a test change is ambiguous (unclear what the new expected behavior is), ask the user. ## Step 1: Identify What Changed ```bash git diff --name-only git diff --stat ``` List the modified production files (ignore test files, configs, docs). ## Step 2: Find Affected Tests Search for imports of changed modules across test files: ```bash rg "from lightspeed_agentic\.<changed_module> import" tests/ rg "import lightspeed_agentic\.<changed_module>" tests/ ``` ## Step 3: Analyze Impact on Tests For each affected test file, check whether the change breaks existing tests: 1. **Signature changes** — function renamed, parameters added/removed/reordered. 2. **Behavior changes** — return value, side effects, exceptions differ. 3. **Removed code** — tests for deleted functions/classes need removal. 4. **New code** — consider whether new tests are needed (ask user if unclear). ## Step 4: Update Tests Apply minimal fixes to each affected test: - Update function names, parameters, expected values. - Add `async`/`await` and `@pytest.mark.asyncio` if sync changed to async. - Remove tests for deleted functionality. - Do not add new tests unless the user asks. ## Step 5: Done Report what was updated. The user can invoke **validate-and-fix** when ready.
在 GitHub 查看