.claude/skills/rule-code-preservation/SKILL.md
Rule mapping for code-preservation
npx skillsauth add carrot-foundation/methodology-rules rule-code-preservationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Apply this rule whenever work touches:
*This rule exists to prevent accidental loss of functionality during development. Code that is already working, tested, and deployed represents invested effort and validated behavior.
Before removing any code, test, or feature, ask the user for explicit confirmation. This includes:
Even if you are confident the code is dead, confirm first. There may be runtime references, dynamic imports, or downstream consumers you are not aware of.
When refactoring:
If you notice unrelated code that could be improved while working on a task, note it but do not modify it. Unrelated changes:
Existing error handling, catch blocks, validation checks, and fallback logic should not be removed or simplified during unrelated work. These guards often exist because of production incidents or edge cases that are not obvious from reading the code alone.
When relocating code (e.g., extracting to a shared library), ensure:
databases
Create and modify Zod schemas for runtime validation with proper type inference.
testing
Write Vitest unit tests following project conventions with proper stubs and assertions.
tools
Autonomously implement a task following project conventions with iterative verification.
testing
Analyze a pull request diff and provide structured feedback on correctness, conventions, and quality.