skills/rubysmithing-refactor/SKILL.md
--- name: rubysmithing-refactor description: Convention-targeted Ruby refactoring sub-skill. Activates on any mention of: refactor, clean up, fix conventions, this code is messy, help me improve this, anti-patterns, rubocop violations, Zeitwerk compliance, autoload issue, make this idiomatic, extend self, frozen string literal missing, thread usage, hardcoded config, silent rescue, or missing namespace. Accepts pasted code snippets, uploaded files, or filesystem paths. Detects convention target
npx skillsauth add b08x/rubysmithing skills/rubysmithing-refactorInstall 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.
Targeted refactoring of existing Ruby code toward project-detected conventions. Always audits before rewriting. Never silently drops functionality.
/mnt/user-data/uploads/Compound prompts (e.g., "refactor this RAG pipeline AND build a TUI for it"): Handle the refactoring component here. State: "Handling refactor. TUI scaffolding should be addressed with rubysmithing-tui."
Priority order:
.rubocop.yml → RuboCop (parse enabled cops, target Ruby version)standard in Gemfile → StandardRB.rubysmith / rubysmith gem → Rubysmith defaultsreferences/refactor-patterns.mdApply when: file is ≤ ~50 lines, or request is clearly a simple utility script.
Lite Mode refactor scope:
Apply for all other inputs. Full pattern catalog from references/refactor-patterns.md.
Before rewriting, output a brief audit:
FILE: lib/my_app/processor.rb
Convention target: RuboCop (.rubocop.yml detected)
Mode: Standard
CRITICAL
[line 3] Thread.new usage — use Async fiber [thread_to_async]
[line 1] No frozen_string_literal [missing_frozen_string_literal]
WARNING
[line 8] extend self — use module_function [extend_self_to_module_function]
[line 22] Nested conditionals depth 3 — guard clauses [nested_conditionals]
INFO
[line 1] No namespace wrapper [missing_namespace]
Pattern names in brackets map to references/refactor-patterns.md.
Apply changes. For each non-trivial transformation:
Confirm post-refactor:
require for Zeitwerk-managed filesloader.collapse / loader.push_dir used correctly for non-standard pathsdevelopment
--- name: rubysmithing description: Convention-aware Ruby code generator for the terminal-native AI orchestration stack (dotenv, tty-config, zeitwerk, async, dry-schema, sequel, journald-logger, circuit_breaker, parallel, concurrent-ruby). Use for generating Ruby classes, modules, Rake tasks, config wiring, boot layer code, data pipelines, POROs, error class hierarchies, parallel processing workers, content parsers, and Gemfile decisions. Applies project-detected conventions (RuboCop, StandardRB
development
YARD documentation generator with semantic analysis for Ruby files. Automatically activates on requests to generate, add, or improve YARD documentation. Uses AST parsing and type inference to generate comprehensive @param, @return, @example, and @raise tags. Maintains consistency with existing project documentation patterns and YARD configuration. Generates production-grade documentation that eliminates usage pitfalls and accelerates correct method implementation. Requires rubysmithing-context when the target file uses non-stdlib gems, to ensure type annotations reflect verified API shapes.
data-ai
--- name: rubysmithing-tui description: Terminal UI scaffolder and advisor for Ruby projects using the Charm/Bubble ecosystem. Activates on any mention of: TUI, terminal UI, terminal interface, terminal app, BubbleTea, bubbletea, Lipgloss, lipgloss, Bubbles, bubbles (UI components), Huh, huh form, form validation, Gum, gum prompts, NTCharts, charts, data visualization, Bubblezone, Glamour, glamour rendering, markdown display, Harmonica, harmonica animations, spring physics, smooth transitions, a
tools
--- name: rubysmithing-scaffold description: Ruby project scaffolder using rubysmith (apps, tools, scripts) or gemsmith (publishable gems). Activates on any mention of: scaffold a project, scaffold a gem, new ruby project, new gem, create gem, bootstrap project, rubysmith, gemsmith, generate project skeleton, project template, set up a new ruby app, start a ruby tool, start a ruby script, create a new gem for rubygems, initialize ruby project, rubysmith build, gemsmith build, new ruby