safe-refactor
Refactor Code with Tests and Small Changes
Code cleanup can introduce behavior changes that are difficult to detect. This skill guides small refactoring steps with baseline tests, dependency checks, and repeated verification.
Установить с помощью моего Агента
Скопируйте этот запрос в своего Агента. Он содержит каноническую страницу Skill и манифест.
Review the Skillstore skill "safe-refactor" from https://skillstore.io/skills/agentkitco-safe-refactor.md and its manifest at https://skillstore.io/api/skills/agentkitco-safe-refactor/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.Ваш Агент по-прежнему должен показать план и запросить все подтверждения, требуемые политикой безопасности.
Ресурсы для AI-агентов
Используйте эти ссылки, когда AI-агенту, crawler или script нужен чистый контекст вместо полной страницы.
Протестировать
Использование «safe-refactor». Extract duplicated validation from two functions without changing their behavior.
Ожидаемый результат:
- Boundary: preserve validation order, error messages, and return values.
- Baseline: relevant tests passed before editing.
- Change: extracted the shared validation logic in one reviewable step.
- Verification: relevant tests and lint passed after extraction.
- Left unchanged: an unrelated naming inconsistency.
Использование «safe-refactor». Restructure a legacy parser that has no tests.
Ожидаемый результат:
- Characterization tests added for representative valid and invalid inputs.
- Baseline behavior recorded, including existing error messages.
- Restructuring completed in separate, verified steps.
- Uncertainty: large input performance was not exercised.
- Observed bug reported separately and left unchanged.
Аудит безопасности
БезопасноAll three static findings are false positives: Markdown command references are not Ruby execution, and the completion report is not system reconnaissance. No evidence found of prompt injection, data exfiltration, or malicious intent in SKILL.md.
Факторы риска
⚙️ Внешние команды (2)
Поделиться и цитировать этот отчет
Делитесь версионным отчетом об оценке, нейтральным значком, встраиваемой карточкой и цитатами. Skillstore публикует доказательства, не решая, безопасен ли этот Skill.
Копировать ссылку на отчёт
https://skillstore.io/skills/agentkitco-safe-refactor/audits/2?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportЗначок Markdown
[](https://skillstore.io/skills/agentkitco-safe-refactor?utm_source=security_passport_badge)Значок HTML
<a href="https://skillstore.io/skills/agentkitco-safe-refactor?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/agentkitco-safe-refactor/security.svg" alt="Skillstore security assessment" loading="lazy"></a>Встраиваемая карточка
<iframe src="https://skillstore.io/embed/skills/agentkitco-safe-refactor.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>Академические ссылки (APA · BibTeX · CFF)
Цитата APA
agentkitco. (2026). safe-refactor security audit report (audit version 2) [Author version 1.0]. Skillstore. https://skillstore.io/skills/agentkitco-safe-refactor/audits/2Цитата BibTeX
@techreport{agentkitco-agentkitco-safe-refactor-2026,
author = {agentkitco},
title = {safe-refactor security audit report (audit version 2)},
institution = {Skillstore},
year = {2026},
number = {2},
url = {https://skillstore.io/skills/agentkitco-safe-refactor/audits/2},
note = {Author version 1.0}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "safe-refactor security audit report (audit version 2)"
version: "1.0"
type: report
authors:
- name: "agentkitco"
date-released: "2026-10-22"
url: "https://skillstore.io/skills/agentkitco-safe-refactor/audits/2"
identifiers:
- type: other
value: "skillstore:agentkitco-safe-refactor:audit:2"
description: "Skillstore immutable audit report identifier"
Сравнить варианты
2 устанавливаемых вариантовНавык каждого автора остаётся отдельным устанавливаемым вариантом. Рекомендуемый вариант ранжируется по данным Skillstore.
Почему этот вариант первый
juliusbrussee-safe-refactor
2026-09-09
agentkitco-safe-refactor
2026-10-22
Оценка Skillstore
Почему такая оценка Достоверность доказательств: СреднийЧто вы можете построить
Clean Up a Working Module
Extract duplicated logic while preserving outputs, error messages, logging, and edge cases through small, verified edits.
Protect Legacy Behavior
Add characterization tests before restructuring code that lacks coverage, and document behavior that remains unverified.
Review a Shared API Rename
Identify callers and dependents before renaming exported symbols, and request approval when compatibility requires a breaking change.
Попробуйте эти промпты
Use safe-refactor to assess [module]. State the goal, behavior boundaries, existing tests, and baseline results before proposing any edits.
Use safe-refactor to extract repeated logic in [file]. Preserve behavior, make one change per step, and run relevant tests after each step.
Use safe-refactor on [legacy module]. Add characterization tests for realistic inputs before restructuring. Preserve current errors and ordering, and report coverage gaps.
Use safe-refactor to rename [exported symbol]. Check all callers and dependents, propose a deprecation path, and request approval before any API break.
Лучшие практики
- Define behavior boundaries and record baseline failures before editing.
- Add characterization tests before restructuring untested behavior.
- Review each small diff and verify that rollback preserves pre-existing user edits.
Избегать
- Mixing refactoring with bug fixes, features, or dependency upgrades.
- Continuing through failing tests instead of undoing the last step and reducing its scope.
- Changing public APIs without approval or a deprecation path.
Часто задаваемые вопросы
What does this skill provide?
What happens when the code has no tests?
Does it guarantee identical behavior?
Can it fix bugs during a refactor?
When does it ask for user input?
Does it require a specific programming language?
Сведения для разработчиков
Автор
agentkitcoЛицензия
MIT
Версия автора
v1.0
Ревизия Skillstore
r1
Примечание о версии
Заявленная автором версия не соответствует SemVer.
Ссылка
18efac79a818d7e997295839638fdd21906cfd1c
Актуальность поддержки
22.10.2026
Использование
5 загрузок · 0 просмотров
Структура файлов
📄 SKILL.md