code-to-rollback-sql

Generate rollback SQL for INSERT, UPDATE, and DELETE operations.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/octkp/dotfiles --skill code-to-rollback-sql
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-to-rollback-sql
Source: https://github.com/octkp/dotfiles/tree/main/claude/skills/code-to-rollback-sql
Command: npx skills add https://github.com/octkp/dotfiles --skill code-to-rollback-sql

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Analyzes source code to identify data-changing operations (INSERT/UPDATE/DELETE) and generates corresponding rollback SQL, while recording changes for auditable memory.

Core Features & Use Cases

  • Phase-based orchestration: code analysis (Phase 1) via a specialized db-change-analyzer, memory persistence (Phase 2) via agent-memory, and SQL generation (Phase 3) via a SQL generator.
  • Flexible targeting: accept file path with line ranges or method/function names to scope the analysis.
  • Safe rollback output: produce ordered SQL that respects foreign-key constraints and provides optional verification queries.

Quick Start

Provide the target file path and line range or the target method name to begin generating rollback SQL.

Frequently Asked Questions about code-to-rollback-sql

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

FAQPage Schema
How do I generate rollback SQL from code changes automatically?

To generate rollback SQL from code changes, you provide a file path with line ranges or specific method names to scope the analysis. The tool then identifies data-changing operations like INSERT, UPDATE, and DELETE to produce executable SQL.

Can I generate rollback SQL for specific methods instead of entire files?

Yes, you can target specific methods or functions to scope rollback SQL generation. By providing function names or file paths with line ranges, the analysis focuses only on the data-changing operations within those defined boundaries.

Does the generated rollback SQL handle foreign-key constraints?

The generated rollback SQL respects foreign-key constraints to ensure safe execution. It produces ordered SQL statements that account for dependencies, alongside optional verification queries to validate the rollback process.

How does code analysis for database changes work with FuelPHP?

Code analysis for database changes works by identifying mutations in specific files or methods within frameworks like FuelPHP. It orchestrates analysis, memory persistence, and SQL generation to output executable rollback scripts.

What is the best way to track database changes for auditable rollback memory?

Tracking database changes for auditable rollback memory involves orchestrating code analysis with memory persistence. This process records identified data-changing operations and generates corresponding rollback SQL to maintain an auditable history.

Are there limitations when analyzing code to generate rollback scripts?

Limitations include relying on accurate file paths, line ranges, or method names to scope the analysis. The tool targets codebases where mutations occur in specific locations and requires proper configuration to output executable SQL safely.