Kilocode - Cheatsheet
Overview
Quick reference: Kilocode 2025 is focused on safe, scalable multi-file transformations, pattern matching, and semantically-aware refactors.
Core Operations
Large-Scale Features
- Multi-file code generation with change sets and previews
- Pattern-based transformations using AST-aware matchers
- Safe dry-run mode that emits machine-readable diffs
- Integration with CI for automated bulk refactors and rollbacks
Usage Patterns
- Start with a targeted unit of work and run in dry-run mode to inspect diffs.
- Pin a ruleset and run tests in a sandbox before applying changes to main branches.
- Prefer AST patterns over regex to avoid unsafe replacements.
Example: Bulk rename with AST-aware matcher
# Kilocode CLI (dry-run)
kilocode transform --match "FunctionDeclaration[name='oldName']" --replace "newName" --dry-run --output=changes.json
Safety & Rollback
- Always run full test-suite in sandboxed execution before applying bulk patches.
- Keep backups (VCS branches) and use generated rollback diffs for quick reversal.
- Use code ownership rules to gate automated changes in protected modules.