comment-checker
Use when Codex needs to understand or respond to automatic comment-checker feedback emitted after an edit-like PostToolUse hook.
Guides a refactor, cleanup, or restructure with the right decomposition. Use when the user asks to refactor, simplify, extract, or modernize code.
Claude Code
$ npx -y skills add code-yeongyu/oh-my-openagent --skill refactor --agent claude-code
Codex
$ npx skills add code-yeongyu/oh-my-openagent --skill refactor -a codex -y
Cursor
$ npx skills add code-yeongyu/oh-my-openagent --skill refactor -a cursor -y
Gemini CLI
$ npx skills add code-yeongyu/oh-my-openagent --skill refactor -a gemini-cli -y
GitHub Copilot
$ npx skills add code-yeongyu/oh-my-openagent --skill refactor -a github-copilot -y
OpenCode
$ npx skills add code-yeongyu/oh-my-openagent --skill refactor -a opencode -y
Windsurf
$ npx skills add code-yeongyu/oh-my-openagent --skill refactor -a windsurf -y
name: refactor description: "Guides a refactor, cleanup, or restructure with the right decomposition. Use when the user asks to refactor, simplify, extract, or modernize code." argument-hint: "<refactoring-target> [--scope=<file|module|project>] [--strategy=<safe|aggressive>]"
export const REFACTOR_TEMPLATE = `# Intelligent Refactor Command
\`\`\` /refactor <refactoring-target> [--scope=<file|module|project>] [--strategy=<safe|aggressive>]
Arguments: refactoring-target: What to refactor. Can be:
Options: --scope: Refactoring scope (default: module)
--strategy: Risk tolerance (default: safe)
\`\`\`
Performs intelligent, deterministic refactoring with full codebase awareness. Unlike blind search-and-replace, this command:
1. **Understands your intent** - Analyzes what you actually want to achieve 2. **Maps the codebase** - Builds a definitive codemap before touching anything 3. **Assesses risk** - Evaluates test coverage and determines verification strategy 4. **Plans meticulously** - Creates a detailed plan with Plan agent 5. **Executes precisely** - Step-by-step refactoring with LSP and AST-grep 6. **Verifies constantly** - Runs tests after each change to ensure zero regression
---
**BEFORE ANY ACTION, classify and validate the request.**
| Signal | Classification | Action | |--------|----------------|--------| | Specific file/symbol | Explicit | Proceed to codebase analysis | | "Refactor X to Y" | Clear transformation | Proceed to codebase analysis | | "Improve", "Clean up" | Open-ended | **MUST ask**: "What specific improvement?" | | Ambiguous scope | Uncertain | **MUST ask**: "Which modules/files?" | | Missing context | Incomplete | **MUST ask**: "What's the desired outcome?" |
Before proceeding, confirm:
**If ANY of above is unclear, ASK CLARIFYING QUESTION:**
\`\`\` I want to make sure I understand the refactoring goal correctly.
**What I understood**: [interpretation] **What I'm unsure about**: [specific ambiguity]
Options I see: 1. [Option A] - [implications] 2. [Option B] - [implications]
**My recommendation**: [suggestion with reasoning]
Should I proceed with [recommendation], or would you prefer differently? \`\`\`
**IMMEDIATELY after understanding the request, create these todos with the session's todo tool (all pending):**
\`\`\`
\`\`\`
---
**Mark phase-1 as in_progress.**
Fire ALL of these simultaneously using \`call_omo_agent\`:
\`\`\` // Agent 1: Find the refactoring target call_omo_agent( subagent_type="explore", run_in_background=true, prompt="Find all occurrences and definitions of [TARGET]. Report: file paths, line numbers, usage patterns." )
// Agent 2: Find related code call_omo_agent( subagent_type="explore", run_in_background=true, prompt="Find all code that imports, uses, or depends on [TARGET]. Report: dependency chains, import graphs." )
// Agent 3: Find similar patterns call_omo_agent( subagent_type="explore", run_in_background=true, prompt="Find similar code patterns to [TARGET] in the codebase. Report: analogous implementations, established conventions." )
// Agent 4: Find tests call_omo_agent( subagent_type="explore", run_in_background=true, prompt="Find all test files related to [TARGET]. Report: test file paths, test case names, coverage indicators." )
// Agent 5: Architecture context call_omo_agent( subagent_type="explore", run_in_background=true, prompt="Find architectural patterns and module organization around [TARGET]. Report: module boundaries, layer structure, design patterns in use." ) \`\`\`
While background agents are running, use direct tools:
\`\`\`typescript // Find definition(s) lsp_goto_definition(filePath, line, character) // Where is it defined?
// Find ALL usages across workspace lsp_find_references(filePath, line, character, includeDeclaration=true)
// Get file structure lsp_symbols(filePath, scope="document") // Hierarchical outline lsp_symbols(filePath, scope="workspace", query="[target_symbol]") // Search by name
// Get current diagnostics lsp_diagnostics(filePath) // Errors, warnings before we start \`\`\`
\`\`\`bash // Find structural patterns — run this from the ast-grep skill's directory; this skill ships no scripts/ python3 scripts/ast_grep_helper.py search 'function $NAME($$$) { $$$ }' src/ --lang ts
sg --pattern '[old_pattern]' --rewrite '[new_pattern]' --lang ts src/ \`\`\`
\`\`\` grep(pattern="[search_term]", path="src/") // narrow to *
Your tool for real work. But it's an agent. OmO is one omo command that turns your tokens into finished work: research across ten thousand sources, a deck people actually get, backends, frontends, code.
Use when Codex needs to understand or respond to automatic comment-checker feedback emitted after an edit-like PostToolUse hook.
Contribute a verified bug fix for LazyCodex, lazycodex-ai, omo-codex, bundled Codex skills, or upstream Codex CLI bugs.…
Diagnose LazyCodex and Codex CLI installation health against the latest sources. Use whenever the user asks for a doctor or…
Create a high-signal bug issue or PR in the repo that owns the defect. Use this whenever the user asks to report, file, open, or…
Use when Codex needs language-server diagnostics, definitions, references, symbols, or rename safety checks in the current…
Use when the user asks about Codex Rules behavior, injected project rules, supported rule file locations, matching, or…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.