srgn-cli

Apply regex-driven code transformations within tree-sitter language scopes.

15|2|Updated Nov 17, 2025
One-click install
npx skills add https://github.com/OutlineDriven/odin-codex-plugin --skill srgn-cli-outlinedriven
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: srgn-cli
Source: https://github.com/OutlineDriven/odin-codex-plugin/tree/main/skills/srgn-cli
Command: npx skills add https://github.com/OutlineDriven/odin-codex-plugin --skill srgn-cli-outlinedriven

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

srgn-cli translates user intent into precise, safe, syntax-aware code transformations using language scopes and tree-sitter queries, reducing manual refactoring toil. This approach helps teams perform accurate edits across diverse codebases with confidence.

Core Features & Use Cases

  • Syntax-aware scoping across languages via tree-sitter queries to confine edits to valid code regions.
  • Safe, preview-first transformations with dry-run, globbing, and explicit scope controls to reduce risk in large repos.
  • Use cases include updating imports, cleaning up comments/docstrings, and bulk repository migrations with guardrails for CI.

Quick Start

Provide a precise srgn command for the requested code transformation.

Frequently Asked Questions about srgn-cli

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

FAQPage Schema
How do I perform syntax-aware code refactoring across a multi-language repository?

Syntax-aware code refactoring uses tree-sitter queries to confine edits to valid code regions, ensuring transformations only apply to intended language structures. This prevents accidental modifications to strings or comments during repository-wide migrations.

What is the safest way to preview repository-wide code migrations before applying changes?

The safest way to preview repository-wide code migrations is using a dry-run mode. This outputs the planned transformations without modifying files, allowing you to verify scope and regex accuracy before execution.

Can I scope regex edits to specific code structures like imports and docstrings?

Yes, you can scope regex edits to specific code structures like imports and docstrings. Tree-sitter-based parsing and anchored-scope refinement confine deterministic edits to valid language regions for targeted cleanup and updates.

Does tree-sitter scoping work with languages like Python, Rust, and TypeScript for bulk code transformations?

Tree-sitter scoping works with Python, Rust, Go, TypeScript, C#, HCL, and C for bulk code transformations. It applies language-aware scopes to confine regex-driven edits to valid syntax regions across diverse codebases.

How do I control CI pipeline failures when no files match a code transformation glob?

You can control CI pipeline failures during code transformations using explicit failure controls like --fail-no-files, --fail-any, and --fail-none. These flags determine pipeline behavior when globbing matches unexpected results.

What are the limitations of using regex for language-aware code transformations?

Regex-driven code transformations require precise tree-sitter scoping to avoid unintended edits, and complex transformations may need explicit scope controls and dry-run previews. Without anchored-scope refinement, regex alone cannot safely parse nested language syntax.