[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78GSBYDQQP2ZH4PK77FGGJ8":3,"skill-same:01M78GSBYDQQP2ZH4PK77FGGJ8":52},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M78GSBYDQQP2ZH4PK77FGGJ8","refactor",null,"Intelligent refactor command. Triggers: refactor, refactoring, cleanup, restructure, extract, simplify, modernize.","younghai\u002Flazyz","younghai","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F10753869?v=4","01M78GJ5KADQ959GDR0ZM7DDNF","young kwon","01M78GJ5M3F6D2YKVXCNX3WMR9",0,"MIT","https:\u002F\u002Fgithub.com\u002Fyounghai\u002Flazyz\u002Fblob\u002Fmain\u002Frelease\u002Flazyz-0.11.0-20261007\u002Fskills\u002Frefactor\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: refactor\ndescription: \"Intelligent refactor command. Triggers: refactor, refactoring, cleanup, restructure, extract, simplify, modernize.\"\n---\n\n## ZCode Harness Tool Compatibility\n\nThis skill was ported from the Codex\u002FOpenCode OmO harness. ZCode does not provide `call_omo_agent`, `task`, `background_output`, `team_*`, `multi_agent_v1.spawn_agent`, or any Codex-only multi-agent tools. Translate every such example to ZCode's native tools:\n\n| Codex\u002FOpenCode example | ZCode tool to use |\n| --- | --- |\n| `call_omo_agent(subagent_type=\"explore\", ...)` | `Agent` tool with `subagent_type=\"Explore\"` and a self-contained `prompt` |\n| `call_omo_agent(subagent_type=\"librarian\", ...)` | `Agent` tool with `subagent_type=\"Explore\"` (research-focused prompt) |\n| `task(subagent_type=\"plan\", ...)` | `Agent` tool with `subagent_type=\"general-purpose\"` (planning-focused prompt) |\n| `task(subagent_type=\"oracle\", ...)` for final verification | `Agent` tool with `subagent_type=\"general-purpose\"` (rigorous-review prompt) |\n| `task(category=\"...\", ...)` for implementation or QA | `Agent` tool with `subagent_type=\"general-purpose\"` |\n| `multi_agent_v1.spawn_agent(...)` \u002F `spawn_agent(...)` | `Agent` tool with `subagent_type` and a self-contained `prompt` |\n| `background_output(task_id=\"...\")` | Only unstructured read-only research may use background mode; its completion arrives as a parent task notification, not a plugin hook |\n| `multi_agent_v1.wait_agent(...)` mailbox signals | No equivalent plugin tool; use returned foreground Agent results or the host's background research notifications |\n| `team_*(...)` | ZCode has no native team-of-threads API. Approximate with multiple parallel `Agent` calls (one per member) coordinated by the parent, or fall back to sequential subagents when isolation is unclear |\n\nZCode v3.14.3 loads enabled plugin agents from `agents\u002F`. Prefer namespaced roles such as `lazyz:explorer` and `lazyz:lazycodex-executor`; unambiguous bare names also work. Include all task context and ownership in the self-contained `prompt`. Roles inherit the user's active model; do not force an obsolete provider ID or copy Codex model\u002Feffort fields. If an older host lacks a role, describe it inline using the appropriate built-in agent.\n\nBefore every governed Agent or Task call, read the Dispatch schema in the installed [start-work skill](..\u002Fstart-work\u002FSKILL.md) and prepend exactly one LAZYCODEX_DISPATCH_V1 JSON line. General-purpose and known executor calls require this envelope; read-only Explore calls may remain unstructured. Use the same taskId across retries with a fresh runId, unchanged criteria, role, phase and budget. Planning\u002Fdocument work uses writer, code work implementer, review reviewer, and testing qa. Never rename a task to bypass its exhausted budget.\n\nGoverned calls must use `run_in_background: false` (or omit it). A background launch is not a completed result and has no matching plugin completion hook. Multiple independent foreground calls may be requested together; do not assume the host executes them concurrently. Read-only background research without a dispatch contract remains available.\n\nRequire each governed child to write the matching ReceiptV1 with current source identity, criterion invocations, zero exit codes and hashed regular artifacts, then return EVIDENCE_RECORDED; final-phase work requires FINAL_EVIDENCE_RECORDED. PostToolUse records failed evidence; Stop prevents unresolved completion while budget remains. An exhausted budget requires a blocker handoff, not an unsupported completion claim.\n\nUser authorization and verification policy take precedence over generic workflow instructions below. Do not auto-commit, push, merge, delete, deploy, install tools, call paid services, or run checks prohibited by the user. Record skipped checks honestly; do not fabricate a passing receipt. A task requiring a verified receipt remains unverified if the necessary checks are prohibited. ZCode Stop can continue at most three consecutive times, not indefinitely. Native Goal Mode, Memory and Wiki are host features; no callable API is assumed.\n\nFor work likely to take long, prefer multiple concurrent `Agent` calls in a single message over one giant blocking call. Treat each child's final message as the deliverable: if it lacks the required output, ack-only, or stops without producing evidence, fall back to a smaller re-scoped `Agent` call with the missing deliverable made explicit in the `prompt`.\n\nexport const REFACTOR_TEMPLATE = `# Intelligent Refactor Command\n\n## Usage\n\\`\\`\\`\n\u002Frefactor \u003Crefactoring-target> [--scope=\u003Cfile|module|project>] [--strategy=\u003Csafe|aggressive>]\n\nArguments:\n  refactoring-target: What to refactor. Can be:\n    - File path: src\u002Fauth\u002Fhandler.ts\n    - Symbol name: \"AuthService class\"\n    - Pattern: \"all functions using deprecated API\"\n    - Description: \"extract validation logic into separate module\"\n\nOptions:\n  --scope: Refactoring scope (default: module)\n    - file: Single file only\n    - module: Module\u002Fdirectory scope\n    - project: Entire codebase\n\n  --strategy: Risk tolerance (default: safe)\n    - safe: Conservative, maximum test coverage required\n    - aggressive: Allow broader changes with adequate coverage\n\\`\\`\\`\n\n## What This Command Does\n\nPerforms intelligent, deterministic refactoring with full codebase awareness. Unlike blind search-and-replace, this command:\n\n1. **Understands your intent** - Analyzes what you actually want to achieve\n2. **Maps the codebase** - Builds a definitive codemap before touching anything\n3. **Assesses risk** - Evaluates test coverage and determines verification strategy\n4. **Plans meticulously** - Creates a detailed plan with Plan agent\n5. **Executes precisely** - Step-by-step refactoring with LSP and AST-grep\n6. **Verifies constantly** - Runs tests after each change to ensure zero regression\n\n---\n\n# PHASE 0: INTENT GATE (MANDATORY FIRST STEP)\n\n**BEFORE ANY ACTION, classify and validate the request.**\n\n## Step 0.1: Parse Request Type\n\n| Signal | Classification | Action |\n|--------|----------------|--------|\n| Specific file\u002Fsymbol | Explicit | Proceed to codebase analysis |\n| \"Refactor X to Y\" | Clear transformation | Proceed to codebase analysis |\n| \"Improve\", \"Clean up\" | Open-ended | **MUST ask**: \"What specific improvement?\" |\n| Ambiguous scope | Uncertain | **MUST ask**: \"Which modules\u002Ffiles?\" |\n| Missing context | Incomplete | **MUST ask**: \"What's the desired outcome?\" |\n\n## Step 0.2: Validate Understanding\n\nBefore proceeding, confirm:\n- [ ] Target is clearly identified\n- [ ] Desired outcome is understood\n- [ ] Scope is defined (file\u002Fmodule\u002Fproject)\n- [ ] Success criteria can be articulated\n\n**If ANY of above is unclear, ASK CLARIFYING QUESTION:**\n\n\\`\\`\\`\nI want to make sure I understand the refactoring goal correctly.\n\n**What I understood**: [interpretation]\n**What I'm unsure about**: [specific ambiguity]\n\nOptions I see:\n1. [Option A] - [implications]\n2. [Option B] - [implications]\n\n**My recommendation**: [suggestion with reasoning]\n\nShould I proceed with [recommendation], or would you prefer differently?\n\\`\\`\\`\n\n## Step 0.3: Create Initial Todos\n\n**IMMEDIATELY after understanding the request, create todos:**\n\n\\`\\`\\`\nTodoWrite([\n  {\"id\": \"phase-1\", \"content\": \"PHASE 1: Codebase Analysis - launch parallel explore agents\", \"status\": \"pending\", \"priority\": \"high\"},\n  {\"id\": \"phase-2\", \"content\": \"PHASE 2: Build Codemap - map dependencies and impact zones\", \"status\": \"pending\", \"priority\": \"high\"},\n  {\"id\": \"phase-3\", \"content\": \"PHASE 3: Test Assessment - analyze test coverage and verification strategy\", \"status\": \"pending\", \"priority\": \"high\"},\n  {\"id\": \"phase-4\", \"content\": \"PHASE 4: Plan Generation - invoke Plan agent for detailed refactoring plan\", \"status\": \"pending\", \"priority\": \"high\"},\n  {\"id\": \"phase-5\", \"content\": \"PHASE 5: Execute Refactoring - step-by-step with continuous verification\", \"status\": \"pending\", \"priority\": \"high\"},\n  {\"id\": \"phase-6\", \"content\": \"PHASE 6: Final Verification - full test suite and regression check\", \"status\": \"pending\", \"priority\": \"high\"}\n])\n\\`\\`\\`\n\n---\n\n# PHASE 1: CODEBASE ANALYSIS (PARALLEL EXPLORATION)\n\n**Mark phase-1 as in_progress.**\n\n## 1.1: Launch Parallel Explore Agents (BACKGROUND)\n\nFire ALL of these simultaneously using \\`call_omo_agent\\`:\n\n\\`\\`\\`\n\u002F\u002F Agent 1: Find the refactoring target\ncall_omo_agent(\n  subagent_type=\"explore\",\n  run_in_background=true,\n  prompt=\"Find all occurrences and definitions of [TARGET].\n  Report: file paths, line numbers, usage patterns.\"\n)\n\n\u002F\u002F Agent 2: Find related code\ncall_omo_agent(\n  subagent_type=\"explore\",\n  run_in_background=true,\n  prompt=\"Find all code that imports, uses, or depends on [TARGET].\n  Report: dependency chains, import graphs.\"\n)\n\n\u002F\u002F Agent 3: Find similar patterns\ncall_omo_agent(\n  subagent_type=\"explore\",\n  run_in_background=true,\n  prompt=\"Find similar code patterns to [TARGET] in the codebase.\n  Report: analogous implementations, established conventions.\"\n)\n\n\u002F\u002F Agent 4: Find tests\ncall_omo_agent(\n  subagent_type=\"explore\",\n  run_in_background=true,\n  prompt=\"Find all test files related to [TARGET].\n  Report: test file paths, test case names, coverage indicators.\"\n)\n\n\u002F\u002F Agent 5: Architecture context\ncall_omo_agent(\n  subagent_type=\"explore\",\n  run_in_background=true,\n  prompt=\"Find architectural patterns and module organization around [TARGET].\n  Report: module boundaries, layer structure, design patterns in use.\"\n)\n\\`\\`\\`\n\n## 1.2: Direct Tool Exploration (WHILE AGENTS RUN)\n\nWhile background agents are running, use direct tools:\n\n### LSP Tools for Precise Analysis:\n\n\\`\\`\\`typescript\n\u002F\u002F Find definition(s)\nLspGotoDefinition(filePath, line, character)  \u002F\u002F Where is it defined?\n\n\u002F\u002F Find ALL usages across workspace\nLspFindReferences(filePath, line, character, includeDeclaration=true)\n\n\u002F\u002F Get file structure\nLspDocumentSymbols(filePath)  \u002F\u002F Hierarchical outline\nLspWorkspaceSymbols(filePath, query=\"[target_symbol]\")  \u002F\u002F Search by name\n\n\u002F\u002F Get current diagnostics\nlsp_diagnostics(filePath)  \u002F\u002F Errors, warnings before we start\n\\`\\`\\`\n\n### AST-Grep for Pattern Analysis:\n\n\\`\\`\\`typescript\n\u002F\u002F Find structural patterns\nast_grep_search(\n  pattern=\"function $NAME($$$) { $$$ }\",  \u002F\u002F or relevant pattern\n  lang=\"typescript\",  \u002F\u002F or relevant language\n  paths=[\"src\u002F\"]\n)\n\n\u002F\u002F Preview refactoring (DRY RUN)\nast_grep_replace(\n  pattern=\"[old_pattern]\",\n  rewrite=\"[new_pattern]\",\n  lang=\"[language]\",\n  dryRun=true  \u002F\u002F ALWAYS preview first\n)\n\\`\\`\\`\n\n### Grep for Text Patterns:\n\n\\`\\`\\`\ngrep(pattern=\"[search_term]\", path=\"src\u002F\", include=\"*.ts\")\n\\`\\`\\`\n\n## 1.3: Collect Background Results\n\n\\`\\`\\`\nbackground_output(task_id=\"[agent_1_id]\")\nbackground_output(task_id=\"[agent_2_id]\")\n...\n\\`\\`\\`\n\n**Mark phase-1 as completed after all results collected.**\n\n---\n\n# PHASE 2: BUILD CODEMAP (DEPENDENCY MAPPING)\n\n**Mark phase-2 as in_progress.**\n\n## 2.1: Construct Definitive Codemap\n\nBased on Phase 1 results, build:\n\n\\`\\`\\`\n## CODEMAP: [TARGET]\n\n### Core Files (Direct Impact)\n- \\`path\u002Fto\u002Ffile.ts:L10-L50\\` - Primary definition\n- \\`path\u002Fto\u002Ffile2.ts:L25\\` - Key usage\n\n### Dependency Graph\n\\`\\`\\`\n[TARGET]\n├── imports from:\n│   ├── module-a (types)\n│   └── module-b (utils)\n├── imported by:\n│   ├── consumer-1.ts\n│   ├── consumer-2.ts\n│   └── consumer-3.ts\n└── used by:\n    ├── handler.ts (direct call)\n    └── service.ts (dependency injection)\n\\`\\`\\`\n\n### Impact Zones\n| Zone | Risk Level | Files Affected | Test Coverage |\n|------|------------|----------------|---------------|\n| Core | HIGH | 3 files | 85% covered |\n| Consumers | MEDIUM | 8 files | 70% covered |\n| Edge | LOW | 2 files | 50% covered |\n\n### Established Patterns\n- Pattern A: [description] - used in N places\n- Pattern B: [description] - established convention\n\\`\\`\\`\n\n## 2.2: Identify Refactoring Constraints\n\nBased on codemap:\n- **MUST follow**: [existing patterns identified]\n- **MUST NOT break**: [critical dependencies]\n- **Safe to change**: [isolated code zones]\n- **Requires migration**: [breaking changes impact]\n\n**Mark phase-2 as completed.**\n\n---\n\n# PHASE 3: TEST ASSESSMENT (VERIFICATION STRATEGY)\n\n**Mark phase-3 as in_progress.**\n\n## 3.1: Detect Test Infrastructure\n\n\\`\\`\\`bash\n# Check for test commands\ncat package.json | jq '.scripts | keys[] | select(test(\"test\"))'\n\n# Or for Python\nls -la pytest.ini pyproject.toml setup.cfg\n\n# Or for Go\nls -la *_test.go\n\\`\\`\\`\n\n## 3.2: Analyze Test Coverage\n\n\\`\\`\\`\n\u002F\u002F Find all tests related to target\ncall_omo_agent(\n  subagent_type=\"explore\",\n  run_in_background=false,  \u002F\u002F Need this synchronously\n  prompt=\"Analyze test coverage for [TARGET]:\n  1. Which test files cover this code?\n  2. What test cases exist?\n  3. Are there integration tests?\n  4. What edge cases are tested?\n  5. Estimated coverage percentage?\"\n)\n\\`\\`\\`\n\n## 3.3: Determine Verification Strategy\n\nBased on test analysis:\n\n| Coverage Level | Strategy |\n|----------------|----------|\n| HIGH (>80%) | Run existing tests after each step |\n| MEDIUM (50-80%) | Run tests + add safety assertions |\n| LOW (\u003C50%) | **PAUSE**: Propose adding tests first |\n| NONE | **BLOCK**: Refuse aggressive refactoring |\n\n**If coverage is LOW or NONE, ask user:**\n\n\\`\\`\\`\nTest coverage for [TARGET] is [LEVEL].\n\n**Risk Assessment**: Refactoring without adequate tests is dangerous.\n\nOptions:\n1. Add tests first, then refactor (RECOMMENDED)\n2. Proceed with extra caution, manual verification required\n3. Abort refactoring\n\nWhich approach do you prefer?\n\\`\\`\\`\n\n## 3.4: Document Verification Plan\n\n\\`\\`\\`\n## VERIFICATION PLAN\n\n### Test Commands\n- Unit: \\`bun test\\` \u002F \\`npm test\\` \u002F \\`pytest\\` \u002F etc.\n- Integration: [command if exists]\n- Type check: \\`tsc --noEmit\\` \u002F \\`pyright\\` \u002F etc.\n\n### Verification Checkpoints\nAfter each refactoring step:\n1. lsp_diagnostics → zero new errors\n2. Run test command → all pass\n3. Type check → clean\n\n### Regression Indicators\n- [Specific test that must pass]\n- [Behavior that must be preserved]\n- [API contract that must not change]\n\\`\\`\\`\n\n**Mark phase-3 as completed.**\n\n---\n\n# PHASE 4: PLAN GENERATION (PLAN AGENT)\n\n**Mark phase-4 as in_progress.**\n\n## 4.1: Invoke Plan Agent\n\n\\`\\`\\`\nTask(\n  subagent_type=\"plan\",\n  prompt=\"Create a detailed refactoring plan:\n\n  ## Refactoring Goal\n  [User's original request]\n\n  ## Codemap (from Phase 2)\n  [Insert codemap here]\n\n  ## Test Coverage (from Phase 3)\n  [Insert verification plan here]\n\n  ## Constraints\n  - MUST follow existing patterns: [list]\n  - MUST NOT break: [critical paths]\n  - MUST run tests after each step\n\n  ## Requirements\n  1. Break down into atomic refactoring steps\n  2. Each step must be independently verifiable\n  3. Order steps by dependency (what must happen first)\n  4. Specify exact files and line ranges for each step\n  5. Include rollback strategy for each step\n  6. Define commit checkpoints\"\n)\n\\`\\`\\`\n\n## 4.2: Review and Validate Plan\n\nAfter receiving plan from Plan agent:\n\n1. **Verify completeness**: All identified files addressed?\n2. **Verify safety**: Each step reversible?\n3. **Verify order**: Dependencies respected?\n4. **Verify verification**: Test commands specified?\n\n## 4.3: Register Detailed Todos\n\nConvert Plan agent output into granular todos:\n\n\\`\\`\\`\nTodoWrite([\n  \u002F\u002F Each step from the plan becomes a todo\n  {\"id\": \"refactor-1\", \"content\": \"Step 1: [description]\", \"status\": \"pending\", \"priority\": \"high\"},\n  {\"id\": \"verify-1\", \"content\": \"Verify Step 1: run tests\", \"status\": \"pending\", \"priority\": \"high\"},\n  {\"id\": \"refactor-2\", \"content\": \"Step 2: [description]\", \"status\": \"pending\", \"priority\": \"medium\"},\n  {\"id\": \"verify-2\", \"content\": \"Verify Step 2: run tests\", \"status\": \"pending\", \"priority\": \"medium\"},\n  \u002F\u002F ... continue for all steps\n])\n\\`\\`\\`\n\n**Mark phase-4 as completed.**\n\n---\n\n# PHASE 5: EXECUTE REFACTORING (DETERMINISTIC EXECUTION)\n\n**Mark phase-5 as in_progress.**\n\n## 5.1: Execution Protocol\n\nFor EACH refactoring step:\n\n### Pre-Step\n1. Mark step todo as \\`in_progress\\`\n2. Read current file state\n3. Verify lsp_diagnostics is baseline\n\n### Execute Step\nUse appropriate tool:\n\n**For Symbol Renames:**\n\\`\\`\\`typescript\nlsp_prepare_rename(filePath, line, character)  \u002F\u002F Validate rename is possible\nlsp_rename(filePath, line, character, newName)  \u002F\u002F Execute rename\n\\`\\`\\`\n\n**For Pattern Transformations:**\n\\`\\`\\`typescript\n\u002F\u002F Preview first\nast_grep_replace(pattern, rewrite, lang, dryRun=true)\n\n\u002F\u002F If preview looks good, execute\nast_grep_replace(pattern, rewrite, lang, dryRun=false)\n\\`\\`\\`\n\n**For Structural Changes:**\n\\`\\`\\`typescript\n\u002F\u002F Use Edit tool for precise changes\nedit(filePath, oldString, newString)\n\\`\\`\\`\n\n### Post-Step Verification (MANDATORY)\n\n\\`\\`\\`typescript\n\u002F\u002F 1. Check diagnostics\nlsp_diagnostics(filePath)  \u002F\u002F Must be clean or same as baseline\n\n\u002F\u002F 2. Run tests\nbash(\"bun test\")  \u002F\u002F Or appropriate test command\n\n\u002F\u002F 3. Type check\nbash(\"tsc --noEmit\")  \u002F\u002F Or appropriate type check\n\\`\\`\\`\n\n### Step Completion\n1. If verification passes → Mark step todo as \\`completed\\`\n2. If verification fails → **STOP AND FIX**\n\n## 5.2: Failure Recovery Protocol\n\nIf ANY verification fails:\n\n1. **STOP** immediately\n2. **REVERT** the failed change\n3. **DIAGNOSE** what went wrong\n4. **OPTIONS**:\n   - Fix the issue and retry\n   - Skip this step (if optional)\n   - Consult oracle agent for help\n   - Ask user for guidance\n\n**NEVER proceed to next step with broken tests.**\n\n## 5.3: Commit Checkpoints\n\nAfter each logical group of changes:\n\n\\`\\`\\`bash\ngit add [changed-files]\ngit commit -m \"refactor(scope): description\n\n[details of what was changed and why]\"\n\\`\\`\\`\n\n**Mark phase-5 as completed when all refactoring steps done.**\n\n---\n\n# PHASE 6: FINAL VERIFICATION (REGRESSION CHECK)\n\n**Mark phase-6 as in_progress.**\n\n## 6.1: Full Test Suite\n\n\\`\\`\\`bash\n# Run complete test suite\nbun test  # or npm test, pytest, go test, etc.\n\\`\\`\\`\n\n## 6.2: Type Check\n\n\\`\\`\\`bash\n# Full type check\ntsc --noEmit  # or equivalent\n\\`\\`\\`\n\n## 6.3: Lint Check\n\n\\`\\`\\`bash\n# Run linter\neslint .  # or equivalent\n\\`\\`\\`\n\n## 6.4: Build Verification (if applicable)\n\n\\`\\`\\`bash\n# Ensure build still works\nbun run build  # or npm run build, etc.\n\\`\\`\\`\n\n## 6.5: Final Diagnostics\n\n\\`\\`\\`typescript\n\u002F\u002F Check all changed files\nfor (file of changedFiles) {\n  lsp_diagnostics(file)  \u002F\u002F Must all be clean\n}\n\\`\\`\\`\n\n## 6.6: Generate Summary\n\n\\`\\`\\`markdown\n## Refactoring Complete\n\n### What Changed\n- [List of changes made]\n\n### Files Modified\n- \\`path\u002Fto\u002Ffile.ts\\` - [what changed]\n- \\`path\u002Fto\u002Ffile2.ts\\` - [what changed]\n\n### Verification Results\n- Tests: PASSED (X\u002FY passing)\n- Type Check: CLEAN\n- Lint: CLEAN\n- Build: SUCCESS\n\n### No Regressions Detected\nAll existing tests pass. No new errors introduced.\n\\`\\`\\`\n\n**Mark phase-6 as completed.**\n\n---\n\n# CRITICAL RULES\n\n## NEVER DO\n- Skip lsp_diagnostics check after changes\n- Proceed with failing tests\n- Make changes without understanding impact\n- Use \\`as any\\`, \\`@ts-ignore\\`, \\`@ts-expect-error\\`\n- Delete tests to make them pass\n- Commit broken code\n- Refactor without understanding existing patterns\n\n## ALWAYS DO\n- Understand before changing\n- Preview before applying (ast_grep dryRun=true)\n- Verify after every change\n- Follow existing codebase patterns\n- Keep todos updated in real-time\n- Commit at logical checkpoints\n- Report issues immediately\n\n## ABORT CONDITIONS\nIf any of these occur, **STOP and consult user**:\n- Test coverage is zero for target code\n- Changes would break public API\n- Refactoring scope is unclear\n- 3 consecutive verification failures\n- User-defined constraints violated\n\n---\n\n# Tool Usage Philosophy\n\nYou already know these tools. Use them intelligently:\n\n## LSP Tools\nLeverage LSP tools for precision analysis. Key patterns:\n- **Understand before changing**: \\`LspGotoDefinition\\` to grasp context\n- **Impact analysis**: \\`LspFindReferences\\` to map all usages before modification\n- **Safe refactoring**: \\`lsp_prepare_rename\\` → \\`lsp_rename\\` for symbol renames\n- **Continuous verification**: \\`lsp_diagnostics\\` after every change\n\n## AST-Grep\nUse \\`ast_grep_search\\` and \\`ast_grep_replace\\` for structural transformations.\n**Critical**: Always \\`dryRun=true\\` first, review, then execute.\n\n## Agents\n- \\`explore\\`: Parallel codebase pattern discovery\n- \\`plan\\`: Detailed refactoring plan generation\n- \\`oracle\\`: Read-only consultation for complex architectural decisions and debugging\n- \\`librarian\\`: **Use proactively** when encountering deprecated methods or library migration tasks. Query official docs and OSS examples for modern replacements.\n\n## Deprecated Code & Library Migration\nWhen you encounter deprecated methods\u002FAPIs during refactoring:\n1. Fire \\`librarian\\` to find the recommended modern alternative\n2. **DO NOT auto-upgrade to latest version** unless user explicitly requests migration\n3. If user requests library migration, use \\`librarian\\` to fetch latest API docs before making changes\n\n---\n\n**Remember: Refactoring without tests is reckless. Refactoring without understanding is destructive. This command ensures you do neither.**\n\n\u003Cuser-request>\n$ARGUMENTS\n\u003C\u002Fuser-request>\n`\n\nexport const REFACTOR_TEAM_MODE_ADDENDUM = `\n---\n\n# Team Mode Protocol (active when team_* tools are present)\n\nTeam mode is enabled for this session. The rules below **override Phase 4-6** above. Follow this protocol instead of the in-session step-by-step execution.\n\n## Phase 4 override: Plan agent staffing requirement\n\nWhen invoking the Plan agent in Phase 4.1, append this additional requirement to the prompt:\n\n\\`\\`\\`\n7. (REQUIRED when team mode is active) Output a Team Staffing Recommendation section with these fields — missing fields fail Phase 5.0:\n   - total_atomic_steps: integer\n   - file_independent_steps: integer (parallelizable, no cross-file blocker)\n   - cross_file_dependent_steps: integer (has blockers)\n   - per_step_assignment: [{step_id, assigned_to: 'quick' | 'unspecified-low', blockedBy: [step_ids], rationale}]\n   - dispatch_path_recommendation: 'team' | 'legacy' with reason\n   - rationale for the composition\n\\`\\`\\`\n\n**Classification rules** the plan agent must apply to each step:\n- \\`quick\\`: mechanical edits — LSP rename, extract variable, inline, simple move, signature change without call-site logic.\n- \\`unspecified-low\\`: logic-preserving refactors that need reasoning — extract function, restructure conditional, pattern transformation, cross-file API change.\n- Recommend \\`team\\` path when \\`file_independent_steps >= 3\\`; recommend \\`legacy\\` otherwise.\n\n## Phase 5 override: Dispatch path selection\n\nRead the Team Staffing Recommendation from Phase 4. If any required field is missing, fail here and re-request the plan with the exact missing field names. Do not proceed with a partial plan.\n\nThen choose the path:\n\n- **Team path (5.1-T)**: when the plan recommends \\`team\\` AND \\`file_independent_steps >= 3\\`. Members execute in parallel, Lead orchestrates, a \\`deep\\` verifier lives outside the team.\n- **Legacy path (5.1-L)**: otherwise. Use the original 5.1 \u002F 5.2 \u002F 5.3 flow from above.\n\nRecord the chosen path in the TodoWrite list.\n\n## Phase 5.1-T: \\`refactor-squad\\` team execution\n\n**Precondition checks** (fail hard if any step fails):\n\n1. Load the \\`team-mode\\` skill via the \\`skill\\` tool for lifecycle, message protocol, and limits.\n2. Call \\`team_list\\` and verify no active \\`refactor-squad\\` run exists; if one does, shutdown + delete the orphan before proceeding.\n3. If \\`~\u002F.omo\u002Fteams\u002Frefactor-squad\u002Fconfig.json\\` is missing, write it using the spec below.\n\n**Team spec** (\\`~\u002F.omo\u002Fteams\u002Frefactor-squad\u002Fconfig.json\\`):\n\n\\`\\`\\`json\n{\n  \"name\": \"refactor-squad\",\n  \"lead\": { \"kind\": \"subagent_type\", \"subagent_type\": \"sisyphus\" },\n  \"members\": [\n    {\n      \"kind\": \"category\",\n      \"category\": \"quick\",\n      \"prompt\": \"You handle mechanical refactoring steps (LSP rename, extract variable, inline, simple move, signature change). Use LSP tools for correctness. Apply the task description's per-step instructions verbatim — no scope expansion. After edits, run lsp_diagnostics on touched files. Report via team_send_message(teamRunId=\u003Cid>, to=\\\"lead\\\", summary=\u003Cfiles touched>, body=\u003Clsp status + diff summary>) + team_task_update(status=completed). Never run tests — the external verifier handles that. Never git add, never --continue.\"\n    },\n    { \"kind\": \"category\", \"category\": \"quick\", \"prompt\": \"Same contract as peer quick worker.\" },\n    {\n      \"kind\": \"category\",\n      \"category\": \"unspecified-low\",\n      \"prompt\": \"You handle logic-preserving refactors that need reasoning (extract function, restructure conditional, pattern transformation, cross-file API change). Read the task description's plan step carefully. Use ast_grep_replace with dryRun=true first, review the preview, then execute. If the step is ambiguous or would require out-of-scope changes, STOP and send team_send_message(teamRunId=\u003Cid>, to=\\\"lead\\\", summary=\\\"UNCLEAR\\\", body=\u003Creason>) + team_task_update(status=pending). Same reporting contract as peer quick workers. Never run tests.\"\n    },\n    { \"kind\": \"category\", \"category\": \"unspecified-low\", \"prompt\": \"Same contract as peer unspecified-low worker.\" }\n  ]\n}\n\\`\\`\\`\n\nRationale for this composition:\n- **4 workers = team mode's parallel cap.** 5+ just queues.\n- **No verifier team member.** Verification needs \\`deep\\` reasoning (or \\`unspecified-high\\` fallback). In-team category routing downcasts to sisyphus-junior, which is weaker than required — the verifier runs OUTSIDE the team as a \\`task(category=\"deep\")\\`.\n- **quick × 2** for mechanical edits, **unspecified-low × 2** for reasoning edits — mirrors the plan's split.\n\n**Team lifecycle** (one team, reused until Phase 6 cleanup):\n\n1. \\`team_create(teamName=\"refactor-squad\")\\`. Record \\`teamRunId\\`.\n2. Broadcast the refactor Intent Card ONCE (keep task descriptions slim):\n   \\`\\`\\`\n   team_send_message(\n     teamRunId=\u003Cid>, to=\"*\", kind=\"announcement\",\n     summary=\"refactor-intent\",\n     body=\u003Ccodemap summary + constraints + established patterns from Phase 2>\n   )\n   \\`\\`\\`\n3. Broadcast the verification spec ONCE:\n   \\`\\`\\`\n   team_send_message(\n     teamRunId=\u003Cid>, to=\"*\", kind=\"announcement\",\n     summary=\"verify-spec\",\n     body=\u003Cexact test\u002Ftypecheck\u002Flint commands + expected pass counts + regression indicators from Phase 3.4>\n   )\n   \\`\\`\\`\n4. For each plan step, \\`team_task_create(teamRunId=\u003Cid>, subject=\"refactor step \u003CN>: \u003Cshort>\", description=\u003Cper-step instructions from plan, including target files and line ranges, rollback strategy>, blockedBy=\u003Cfrom plan's per_step_assignment>)\\`.\n\n**Lead monitoring loop**:\n\nWhile any team task is \\`pending | claimed | in_progress\\`:\n\n- Wait for \\`\u003Csystem-reminder>\\` or member messages. Avoid tight polling; a single \\`team_status\\` check is acceptable if no notification arrives within roughly 10 seconds of expected completion.\n- On a worker completion report, immediately dispatch an **external verifier** — verification runs OUTSIDE the team because team-member category routing downcasts to sisyphus-junior:\n  \\`\\`\\`\n  task(\n    category=\"deep\",\n    load_skills=[],\n    run_in_background=true,\n    description=\"verify step \u003CN>\",\n    prompt=\u003Cfiles touched + verify-spec commands + instruction to return \"PASS\" or \"FAIL:\u003Cfailing test + specific error + suggested revert hunks>\">\n  )\n  \\`\\`\\`\n  If \\`deep\\` is unavailable, fall back to \\`category=\"unspecified-high\"\\`. Do not create a commit checkpoint until the verifier returns PASS.\n- On a verifier PASS: make the commit checkpoint for that step (see original 5.3). Proceed.\n- On a verifier FAIL: Lead decides:\n  - **Retry with fix hint**: \\`team_task_update(status=pending)\\` on the original step + \\`team_send_message(teamRunId=\u003Cid>, to=\u003Coriginal member>, summary=\"retry\", body=\u003Cspecific failure from verifier>)\\`. Runtime reassigns.\n  - **Escalate**: after three FAIL cycles on the same step, STOP and consult the user with full evidence.\n- On a member UNCLEAR message: re-harvest context via a targeted \\`task()\\` outside the team, broadcast an updated Intent Card fragment, then reassign.\n\nProceed to Phase 6 only when every team task is \\`completed\\` AND every paired verifier task returned PASS.\n\n## Phase 6 override: Team cleanup before summary\n\nIf Phase 5 used the team path, dismantle \\`refactor-squad\\` BEFORE producing the 6.6 summary. Every exit path — success, escalation, abort — must cleanup; orphan teams poison the next session's precondition check.\n\n1. \\`team_shutdown_request\\` for each member, then \\`team_approve_shutdown\\` if members do not self-approve within a reasonable window.\n2. \\`team_delete(teamRunId=\u003Cid>)\\`.\n3. \\`team_list\\` to confirm no residual \\`refactor-squad\\` run.\n\nThe \\`~\u002F.omo\u002Fteams\u002Frefactor-squad\u002Fconfig.json\\` declaration stays on disk; next session reuses it.\n\nAppend to the 6.6 summary a \"Dispatch path\" line and, when team path was used, team metrics (teamRunId, tasks created, verifier runs, team lifetime).\n\n## MUST NOT (team mode)\n\n- Lead never edits files directly — orchestrate only.\n- Do not inline the Intent Card or verify-spec into task descriptions — rely on the broadcasts.\n- Do not recreate the team mid-session.\n- Do not run tests from Lead — the external verifier owns that lane.\n- Do not put \\`oracle\\` \u002F \\`librarian\\` \u002F \\`deep\\` into the team spec — oracle\u002Flibrarian are team-ineligible, and \\`deep\\` under category routing downcasts to sisyphus-junior. Use them via \\`task()\\` outside the team when needed.\n`\n","## ZCode Harness Tool Compatibility\n\nThis skill was ported from the Codex\u002FOpenCode OmO harness. ZCode does not provide `call_omo_agent`, `task`, `background_output`, `team_*`, `multi_agent_v1.spawn_agent`, or any Codex-only multi-agent tools. Translate every such example to ZCode's native tools:\n\n| Codex\u002FOpenCode example | ZCode tool to use |\n| --- | --- |\n| `call_omo_agent(subagent_type=\"explore\", ...)` | `Agent` tool with `subagent_type=\"Explore\"` and a self-contained `prompt` |\n| `call_omo_agent(subagent_type=\"librarian\", ...)` | `Agent` tool with `subagent_type=\"Explore\"` (research-focused prompt) |\n| `task(subagent_type=\"plan\", ...)` | `Agent` tool with `subagent_type=\"general-purpose\"` (planning-focused prompt) |\n| `task(subagent_type=\"oracle\", ...)` for final verification | `Agent` tool with `subagent_type=\"general-purpose\"` (rigorous-review prompt) |\n| `task(category=\"...\", ...)` for implementation or QA | `Agent` tool with `subagent_type=\"general-purpose\"` |\n| `multi_agent_v1.spawn_agent(...)` \u002F `spawn_agent(...)` | `Agent` tool with `subagent_type` and a self-contained `prompt` |\n| `background_output(task_id=\"...\")` | Only unstructured read-only research may use background mode; its completion arrives as a parent task notification, not a plugin hook |\n| `multi_agent_v1.wait_agent(...)` mailbox signals | No equivalent plugin tool; use returned foreground Agent results or the host's background research notifications |\n| `team_*(...)` | ZCode has no native team-of-threads API. Approximate with multiple parallel `Agent` calls (one per member) coordinated by the parent, or fall back to sequential subagents when isolation is unclear |\n\nZCode v3.14.3 loads enabled plugin agents from `agents\u002F`. Prefer namespaced roles such as `lazyz:explorer` and `lazyz:lazycodex-executor`; unambiguous bare names also work. Include all task context and ownership in the self-contained `prompt`. Roles inherit the user's active model; do not force an obsolete provider ID or copy Codex model\u002Feffort fields. If an older host lacks a role, describe it inline using the appropriate built-in agent.\n\nBefore every governed Agent or Task call, read the Dispatch schema in the installed [start-work skill](..\u002Fstart-work\u002FSKILL.md) and prepend exactly one LAZYCODEX_DISPATCH_V1 JSON line. General-purpose and known executor calls require this envelope; read-only Explore calls may remain unstructured. Use the same taskId across retries with a fresh runId, unchanged criteria, role, phase and budget. Planning\u002Fdocument work uses writer, code work implementer, review reviewer, and testing qa. Never rename a task to bypass its exhausted budget.\n\nGoverned calls must use `run_in_background: false` (or omit it). A background launch is not a completed result and has no matching plugin completion hook. Multiple independent foreground calls may be requested together; do not assume the host executes them concurrently. Read-only background research without a dispatch contract remains available.\n\nRequire each governed child to write the matching ReceiptV1 with current source identity, criterion invocations, zero exit codes and hashed regular artifacts, then return EVIDENCE_RECORDED; final-phase work requires FINAL_EVIDENCE_RECORDED. PostToolUse records failed evidence; Stop prevents unresolved completion while budget remains. An exhausted budget requires a blocker handoff, not an unsupported completion claim.\n\nUser authorization and verification policy take precedence over generic workflow instructions below. Do not auto-commit, push, merge, delete, deploy, install tools, call paid services, or run checks prohibited by the user. Record skipped checks honestly; do not fabricate a passing receipt. A task requiring a verified receipt remains unverified if the necessary checks are prohibited. ZCode Stop can continue at most three consecutive times, not indefinitely. Native Goal Mode, Memory and Wiki are host features; no callable API is assumed.\n\nFor work likely to take long, prefer multiple concurrent `Agent` calls in a single message over one giant blocking call. Treat each child's final message as the deliverable: if it lacks the required output, ack-only, or stops without producing evidence, fall back to a smaller re-scoped `Agent` call with the missing deliverable made explicit in the `prompt`.\n\nexport const REFACTOR_TEMPLATE = `# Intelligent Refactor Command\n\n## Usage\n\\`\\`\\`\n\u002Frefactor \u003Crefactoring-target> [--scope=\u003Cfile|module|project>] [--strategy=\u003Csafe|aggressive>]\n\nArguments:\n  refactoring-target: What to refactor. Can be:\n    - File path: src\u002Fauth\u002Fhandler.ts\n    - Symbol name: \"AuthService class\"\n    - Pattern: \"all functions using deprecated API\"\n    - Description: \"extract validation logic into separate module\"\n\nOptions:\n  --scope: Refactoring scope (default: module)\n    - file: Single file only\n    - module: Module\u002Fdirectory scope\n    - project: Entire codebase\n\n  --strategy: Risk tolerance (default: safe)\n    - safe: Conservative, maximum test coverage required\n    - aggressive: Allow broader changes with adequate coverage\n\\`\\`\\`\n\n## What This Command Does\n\nPerforms intelligent, deterministic refactoring with full codebase awareness. Unlike blind search-and-replace, this command:\n\n1. **Understands your intent** - Analyzes what you actually want to achieve\n2. **Maps the codebase** - Builds a definitive codemap before touching anything\n3. **Assesses risk** - Evaluates test coverage and determines verification strategy\n4. **Plans meticulously** - Creates a detailed plan with Plan agent\n5. **Executes precisely** - Step-by-step refactoring with LSP and AST-grep\n6. **Verifies constantly** - Runs tests after each change to ensure zero regression\n\n---\n\n# PHASE 0: INTENT GATE (MANDATORY FIRST STEP)\n\n**BEFORE ANY ACTION, classify and validate the request.**\n\n## Step 0.1: Parse Request Type\n\n| Signal | Classification | Action |\n|--------|----------------|--------|\n| Specific file\u002Fsymbol | Explicit | Proceed to codebase analysis |\n| \"Refactor X to Y\" | Clear transformation | Proceed to codebase analysis |\n| \"Improve\", \"Clean up\" | Open-ended | **MUST ask**: \"What specific improvement?\" |\n| Ambiguous scope | Uncertain | **MUST ask**: \"Which modules\u002Ffiles?\" |\n| Missing context | Incomplete | **MUST ask**: \"What's the desired outcome?\" |\n\n## Step 0.2: Validate Understanding\n\nBefore proceeding, confirm:\n- [ ] Target is clearly identified\n- [ ] Desired outcome is understood\n- [ ] Scope is defined (file\u002Fmodule\u002Fproject)\n- [ ] Success criteria can be articulated\n\n**If ANY of above is unclear, ASK CLARIFYING QUESTION:**\n\n\\`\\`\\`\nI want to make sure I understand the refactoring goal correctly.\n\n**What I understood**: [interpretation]\n**What I'm unsure about**: [specific ambiguity]\n\nOptions I see:\n1. [Option A] - [implications]\n2. [Option B] - [implications]\n\n**My recommendation**: [suggestion with reasoning]\n\nShould I proceed with [recommendation], or would you prefer differently?\n\\`\\`\\`\n\n## Step 0.3: Create Initial Todos\n\n**IMMEDIATELY after understanding the request, create todos:**\n\n\\`\\`\\`\nTodoWrite([\n  {\"id\": \"phase-1\", \"content\": \"PHASE 1: Codebase Analysis - launch parallel explore agents\", \"status\": \"pending\", \"priority\": \"high\"},\n  {\"id\": \"phase-2\", \"content\": \"PHASE 2: Build Codemap - map dependencies and impact zones\", \"status\": \"pending\", \"priority\": \"high\"},\n  {\"id\": \"phase-3\", \"content\": \"PHASE 3: Test Assessment - analyze test coverage and verification strategy\", \"status\": \"pending\", \"priority\": \"high\"},\n  {\"id\": \"phase-4\", \"content\": \"PHASE 4: Plan Generation - invoke Plan agent for detailed refactoring plan\", \"status\": \"pending\", \"priority\": \"high\"},\n  {\"id\": \"phase-5\", \"content\": \"PHASE 5: Execute Refactoring - step-by-step with continuous verification\", \"status\": \"pending\", \"priority\": \"high\"},\n  {\"id\": \"phase-6\", \"content\": \"PHASE 6: Final Verification - full test suite and regression check\", \"status\": \"pending\", \"priority\": \"high\"}\n])\n\\`\\`\\`\n\n---\n\n# PHASE 1: CODEBASE ANALYSIS (PARALLEL EXPLORATION)\n\n**Mark phase-1 as in_progress.**\n\n## 1.1: Launch Parallel Explore Agents (BACKGROUND)\n\nFire ALL of these simultaneously using \\`call_omo_agent\\`:\n\n\\`\\`\\`\n\u002F\u002F Agent 1: Find the refactoring target\ncall_omo_agent(\n  subagent_type=\"explore\",\n  run_in_background=true,\n  prompt=\"Find all occurrences and definitions of [TARGET].\n  Report: file paths, line numbers, usage patterns.\"\n)\n\n\u002F\u002F Agent 2: Find related code\ncall_omo_agent(\n  subagent_type=\"explore\",\n  run_in_background=true,\n  prompt=\"Find all code that imports, uses, or depends on [TARGET].\n  Report: dependency chains, import graphs.\"\n)\n\n\u002F\u002F Agent 3: Find similar patterns\ncall_omo_agent(\n  subagent_type=\"explore\",\n  run_in_background=true,\n  prompt=\"Find similar code patterns to [TARGET] in the codebase.\n  Report: analogous implementations, established conventions.\"\n)\n\n\u002F\u002F Agent 4: Find tests\ncall_omo_agent(\n  subagent_type=\"explore\",\n  run_in_background=true,\n  prompt=\"Find all test files related to [TARGET].\n  Report: test file paths, test case names, coverage indicators.\"\n)\n\n\u002F\u002F Agent 5: Architecture context\ncall_omo_agent(\n  subagent_type=\"explore\",\n  run_in_background=true,\n  prompt=\"Find architectural patterns and module organization around [TARGET].\n  Report: module boundaries, layer structure, design patterns in use.\"\n)\n\\`\\`\\`\n\n## 1.2: Direct Tool Exploration (WHILE AGENTS RUN)\n\nWhile background agents are running, use direct tools:\n\n### LSP Tools for Precise Analysis:\n\n\\`\\`\\`typescript\n\u002F\u002F Find definition(s)\nLspGotoDefinition(filePath, line, character)  \u002F\u002F Where is it defined?\n\n\u002F\u002F Find ALL usages across workspace\nLspFindReferences(filePath, line, character, includeDeclaration=true)\n\n\u002F\u002F Get file structure\nLspDocumentSymbols(filePath)  \u002F\u002F Hierarchical outline\nLspWorkspaceSymbols(filePath, query=\"[target_symbol]\")  \u002F\u002F Search by name\n\n\u002F\u002F Get current diagnostics\nlsp_diagnostics(filePath)  \u002F\u002F Errors, warnings before we start\n\\`\\`\\`\n\n### AST-Grep for Pattern Analysis:\n\n\\`\\`\\`typescript\n\u002F\u002F Find structural patterns\nast_grep_search(\n  pattern=\"function $NAME($$$) { $$$ }\",  \u002F\u002F or relevant pattern\n  lang=\"typescript\",  \u002F\u002F or relevant language\n  paths=[\"src\u002F\"]\n)\n\n\u002F\u002F Preview refactoring (DRY RUN)\nast_grep_replace(\n  pattern=\"[old_pattern]\",\n  rewrite=\"[new_pattern]\",\n  lang=\"[language]\",\n  dryRun=true  \u002F\u002F ALWAYS preview first\n)\n\\`\\`\\`\n\n### Grep for Text Patterns:\n\n\\`\\`\\`\ngrep(pattern=\"[search_term]\", path=\"src\u002F\", include=\"*.ts\")\n\\`\\`\\`\n\n## 1.3: Collect Background Results\n\n\\`\\`\\`\nbackground_output(task_id=\"[agent_1_id]\")\nbackground_output(task_id=\"[agent_2_id]\")\n...\n\\`\\`\\`\n\n**Mark phase-1 as completed after all results collected.**\n\n---\n\n# PHASE 2: BUILD CODEMAP (DEPENDENCY MAPPING)\n\n**Mark phase-2 as in_progress.**\n\n## 2.1: Construct Definitive Codemap\n\nBased on Phase 1 results, build:\n\n\\`\\`\\`\n## CODEMAP: [TARGET]\n\n### Core Files (Direct Impact)\n- \\`path\u002Fto\u002Ffile.ts:L10-L50\\` - Primary definition\n- \\`path\u002Fto\u002Ffile2.ts:L25\\` - Key usage\n\n### Dependency Graph\n\\`\\`\\`\n[TARGET]\n├── imports from:\n│   ├── module-a (types)\n│   └── module-b (utils)\n├── imported by:\n│   ├── consumer-1.ts\n│   ├── consumer-2.ts\n│   └── consumer-3.ts\n└── used by:\n    ├── handler.ts (direct call)\n    └── service.ts (dependency injection)\n\\`\\`\\`\n\n### Impact Zones\n| Zone | Risk Level | Files Affected | Test Coverage |\n|------|------------|----------------|---------------|\n| Core | HIGH | 3 files | 85% covered |\n| Consumers | MEDIUM | 8 files | 70% covered |\n| Edge | LOW | 2 files | 50% covered |\n\n### Established Patterns\n- Pattern A: [description] - used in N places\n- Pattern B: [description] - established convention\n\\`\\`\\`\n\n## 2.2: Identify Refactoring Constraints\n\nBased on codemap:\n- **MUST follow**: [existing patterns identified]\n- **MUST NOT break**: [critical dependencies]\n- **Safe to change**: [isolated code zones]\n- **Requires migration**: [breaking changes impact]\n\n**Mark phase-2 as completed.**\n\n---\n\n# PHASE 3: TEST ASSESSMENT (VERIFICATION STRATEGY)\n\n**Mark phase-3 as in_progress.**\n\n## 3.1: Detect Test Infrastructure\n\n\\`\\`\\`bash\n# Check for test commands\ncat package.json | jq '.scripts | keys[] | select(test(\"test\"))'\n\n# Or for Python\nls -la pytest.ini pyproject.toml setup.cfg\n\n# Or for Go\nls -la *_test.go\n\\`\\`\\`\n\n## 3.2: Analyze Test Coverage\n\n\\`\\`\\`\n\u002F\u002F Find all tests related to target\ncall_omo_agent(\n  subagent_type=\"explore\",\n  run_in_background=false,  \u002F\u002F Need this synchronously\n  prompt=\"Analyze test coverage for [TARGET]:\n  1. Which test files cover this code?\n  2. What test cases exist?\n  3. Are there integration tests?\n  4. What edge cases are tested?\n  5. Estimated coverage percentage?\"\n)\n\\`\\`\\`\n\n## 3.3: Determine Verification Strategy\n\nBased on test analysis:\n\n| Coverage Level | Strategy |\n|----------------|----------|\n| HIGH (>80%) | Run existing tests after each step |\n| MEDIUM (50-80%) | Run tests + add safety assertions |\n| LOW (\u003C50%) | **PAUSE**: Propose adding tests first |\n| NONE | **BLOCK**: Refuse aggressive refactoring |\n\n**If coverage is LOW or NONE, ask user:**\n\n\\`\\`\\`\nTest coverage for [TARGET] is [LEVEL].\n\n**Risk Assessment**: Refactoring without adequate tests is dangerous.\n\nOptions:\n1. Add tests first, then refactor (RECOMMENDED)\n2. Proceed with extra caution, manual verification required\n3. Abort refactoring\n\nWhich approach do you prefer?\n\\`\\`\\`\n\n## 3.4: Document Verification Plan\n\n\\`\\`\\`\n## VERIFICATION PLAN\n\n### Test Commands\n- Unit: \\`bun test\\` \u002F \\`npm test\\` \u002F \\`pytest\\` \u002F etc.\n- Integration: [command if exists]\n- Type check: \\`tsc --noEmit\\` \u002F \\`pyright\\` \u002F etc.\n\n### Verification Checkpoints\nAfter each refactoring step:\n1. lsp_diagnostics → zero new errors\n2. Run test command → all pass\n3. Type check → clean\n\n### Regression Indicators\n- [Specific test that must pass]\n- [Behavior that must be preserved]\n- [API contract that must not change]\n\\`\\`\\`\n\n**Mark phase-3 as completed.**\n\n---\n\n# PHASE 4: PLAN GENERATION (PLAN AGENT)\n\n**Mark phase-4 as in_progress.**\n\n## 4.1: Invoke Plan Agent\n\n\\`\\`\\`\nTask(\n  subagent_type=\"plan\",\n  prompt=\"Create a detailed refactoring plan:\n\n  ## Refactoring Goal\n  [User's original request]\n\n  ## Codemap (from Phase 2)\n  [Insert codemap here]\n\n  ## Test Coverage (from Phase 3)\n  [Insert verification plan here]\n\n  ## Constraints\n  - MUST follow existing patterns: [list]\n  - MUST NOT break: [critical paths]\n  - MUST run tests after each step\n\n  ## Requirements\n  1. Break down into atomic refactoring steps\n  2. Each step must be independently verifiable\n  3. Order steps by dependency (what must happen first)\n  4. Specify exact files and line ranges for each step\n  5. Include rollback strategy for each step\n  6. Define commit checkpoints\"\n)\n\\`\\`\\`\n\n## 4.2: Review and Validate Plan\n\nAfter receiving plan from Plan agent:\n\n1. **Verify completeness**: All identified files addressed?\n2. **Verify safety**: Each step reversible?\n3. **Verify order**: Dependencies respected?\n4. **Verify verification**: Test commands specified?\n\n## 4.3: Register Detailed Todos\n\nConvert Plan agent output into granular todos:\n\n\\`\\`\\`\nTodoWrite([\n  \u002F\u002F Each step from the plan becomes a todo\n  {\"id\": \"refactor-1\", \"content\": \"Step 1: [description]\", \"status\": \"pending\", \"priority\": \"high\"},\n  {\"id\": \"verify-1\", \"content\": \"Verify Step 1: run tests\", \"status\": \"pending\", \"priority\": \"high\"},\n  {\"id\": \"refactor-2\", \"content\": \"Step 2: [description]\", \"status\": \"pending\", \"priority\": \"medium\"},\n  {\"id\": \"verify-2\", \"content\": \"Verify Step 2: run tests\", \"status\": \"pending\", \"priority\": \"medium\"},\n  \u002F\u002F ... continue for all steps\n])\n\\`\\`\\`\n\n**Mark phase-4 as completed.**\n\n---\n\n# PHASE 5: EXECUTE REFACTORING (DETERMINISTIC EXECUTION)\n\n**Mark phase-5 as in_progress.**\n\n## 5.1: Execution Protocol\n\nFor EACH refactoring step:\n\n### Pre-Step\n1. Mark step todo as \\`in_progress\\`\n2. Read current file state\n3. Verify lsp_diagnostics is baseline\n\n### Execute Step\nUse appropriate tool:\n\n**For Symbol Renames:**\n\\`\\`\\`typescript\nlsp_prepare_rename(filePath, line, character)  \u002F\u002F Validate rename is possible\nlsp_rename(filePath, line, character, newName)  \u002F\u002F Execute rename\n\\`\\`\\`\n\n**For Pattern Transformations:**\n\\`\\`\\`typescript\n\u002F\u002F Preview first\nast_grep_replace(pattern, rewrite, lang, dryRun=true)\n\n\u002F\u002F If preview looks good, execute\nast_grep_replace(pattern, rewrite, lang, dryRun=false)\n\\`\\`\\`\n\n**For Structural Changes:**\n\\`\\`\\`typescript\n\u002F\u002F Use Edit tool for precise changes\nedit(filePath, oldString, newString)\n\\`\\`\\`\n\n### Post-Step Verification (MANDATORY)\n\n\\`\\`\\`typescript\n\u002F\u002F 1. Check diagnostics\nlsp_diagnostics(filePath)  \u002F\u002F Must be clean or same as baseline\n\n\u002F\u002F 2. Run tests\nbash(\"bun test\")  \u002F\u002F Or appropriate test command\n\n\u002F\u002F 3. Type check\nbash(\"tsc --noEmit\")  \u002F\u002F Or appropriate type check\n\\`\\`\\`\n\n### Step Completion\n1. If verification passes → Mark step todo as \\`completed\\`\n2. If verification fails → **STOP AND FIX**\n\n## 5.2: Failure Recovery Protocol\n\nIf ANY verification fails:\n\n1. **STOP** immediately\n2. **REVERT** the failed change\n3. **DIAGNOSE** what went wrong\n4. **OPTIONS**:\n   - Fix the issue and retry\n   - Skip this step (if optional)\n   - Consult oracle agent for help\n   - Ask user for guidance\n\n**NEVER proceed to next step with broken tests.**\n\n## 5.3: Commit Checkpoints\n\nAfter each logical group of changes:\n\n\\`\\`\\`bash\ngit add [changed-files]\ngit commit -m \"refactor(scope): description\n\n[details of what was changed and why]\"\n\\`\\`\\`\n\n**Mark phase-5 as completed when all refactoring steps done.**\n\n---\n\n# PHASE 6: FINAL VERIFICATION (REGRESSION CHECK)\n\n**Mark phase-6 as in_progress.**\n\n## 6.1: Full Test Suite\n\n\\`\\`\\`bash\n# Run complete test suite\nbun test  # or npm test, pytest, go test, etc.\n\\`\\`\\`\n\n## 6.2: Type Check\n\n\\`\\`\\`bash\n# Full type check\ntsc --noEmit  # or equivalent\n\\`\\`\\`\n\n## 6.3: Lint Check\n\n\\`\\`\\`bash\n# Run linter\neslint .  # or equivalent\n\\`\\`\\`\n\n## 6.4: Build Verification (if applicable)\n\n\\`\\`\\`bash\n# Ensure build still works\nbun run build  # or npm run build, etc.\n\\`\\`\\`\n\n## 6.5: Final Diagnostics\n\n\\`\\`\\`typescript\n\u002F\u002F Check all changed files\nfor (file of changedFiles) {\n  lsp_diagnostics(file)  \u002F\u002F Must all be clean\n}\n\\`\\`\\`\n\n## 6.6: Generate Summary\n\n\\`\\`\\`markdown\n## Refactoring Complete\n\n### What Changed\n- [List of changes made]\n\n### Files Modified\n- \\`path\u002Fto\u002Ffile.ts\\` - [what changed]\n- \\`path\u002Fto\u002Ffile2.ts\\` - [what changed]\n\n### Verification Results\n- Tests: PASSED (X\u002FY passing)\n- Type Check: CLEAN\n- Lint: CLEAN\n- Build: SUCCESS\n\n### No Regressions Detected\nAll existing tests pass. No new errors introduced.\n\\`\\`\\`\n\n**Mark phase-6 as completed.**\n\n---\n\n# CRITICAL RULES\n\n## NEVER DO\n- Skip lsp_diagnostics check after changes\n- Proceed with failing tests\n- Make changes without understanding impact\n- Use \\`as any\\`, \\`@ts-ignore\\`, \\`@ts-expect-error\\`\n- Delete tests to make them pass\n- Commit broken code\n- Refactor without understanding existing patterns\n\n## ALWAYS DO\n- Understand before changing\n- Preview before applying (ast_grep dryRun=true)\n- Verify after every change\n- Follow existing codebase patterns\n- Keep todos updated in real-time\n- Commit at logical checkpoints\n- Report issues immediately\n\n## ABORT CONDITIONS\nIf any of these occur, **STOP and consult user**:\n- Test coverage is zero for target code\n- Changes would break public API\n- Refactoring scope is unclear\n- 3 consecutive verification failures\n- User-defined constraints violated\n\n---\n\n# Tool Usage Philosophy\n\nYou already know these tools. Use them intelligently:\n\n## LSP Tools\nLeverage LSP tools for precision analysis. Key patterns:\n- **Understand before changing**: \\`LspGotoDefinition\\` to grasp context\n- **Impact analysis**: \\`LspFindReferences\\` to map all usages before modification\n- **Safe refactoring**: \\`lsp_prepare_rename\\` → \\`lsp_rename\\` for symbol renames\n- **Continuous verification**: \\`lsp_diagnostics\\` after every change\n\n## AST-Grep\nUse \\`ast_grep_search\\` and \\`ast_grep_replace\\` for structural transformations.\n**Critical**: Always \\`dryRun=true\\` first, review, then execute.\n\n## Agents\n- \\`explore\\`: Parallel codebase pattern discovery\n- \\`plan\\`: Detailed refactoring plan generation\n- \\`oracle\\`: Read-only consultation for complex architectural decisions and debugging\n- \\`librarian\\`: **Use proactively** when encountering deprecated methods or library migration tasks. Query official docs and OSS examples for modern replacements.\n\n## Deprecated Code & Library Migration\nWhen you encounter deprecated methods\u002FAPIs during refactoring:\n1. Fire \\`librarian\\` to find the recommended modern alternative\n2. **DO NOT auto-upgrade to latest version** unless user explicitly requests migration\n3. If user requests library migration, use \\`librarian\\` to fetch latest API docs before making changes\n\n---\n\n**Remember: Refactoring without tests is reckless. Refactoring without understanding is destructive. This command ensures you do neither.**\n\n\u003Cuser-request>\n$ARGUMENTS\n\u003C\u002Fuser-request>\n`\n\nexport const REFACTOR_TEAM_MODE_ADDENDUM = `\n---\n\n# Team Mode Protocol (active when team_* tools are present)\n\nTeam mode is enabled for this session. The rules below **override Phase 4-6** above. Follow this protocol instead of the in-session step-by-step execution.\n\n## Phase 4 override: Plan agent staffing requirement\n\nWhen invoking the Plan agent in Phase 4.1, append this additional requirement to the prompt:\n\n\\`\\`\\`\n7. (REQUIRED when team mode is active) Output a Team Staffing Recommendation section with these fields — missing fields fail Phase 5.0:\n   - total_atomic_steps: integer\n   - file_independent_steps: integer (parallelizable, no cross-file blocker)\n   - cross_file_dependent_steps: integer (has blockers)\n   - per_step_assignment: [{step_id, assigned_to: 'quick' | 'unspecified-low', blockedBy: [step_ids], rationale}]\n   - dispatch_path_recommendation: 'team' | 'legacy' with reason\n   - rationale for the composition\n\\`\\`\\`\n\n**Classification rules** the plan agent must apply to each step:\n- \\`quick\\`: mechanical edits — LSP rename, extract variable, inline, simple move, signature change without call-site logic.\n- \\`unspecified-low\\`: logic-preserving refactors that need reasoning — extract function, restructure conditional, pattern transformation, cross-file API change.\n- Recommend \\`team\\` path when \\`file_independent_steps >= 3\\`; recommend \\`legacy\\` otherwise.\n\n## Phase 5 override: Dispatch path selection\n\nRead the Team Staffing Recommendation from Phase 4. If any required field is missing, fail here and re-request the plan with the exact missing field names. Do not proceed with a partial plan.\n\nThen choose the path:\n\n- **Team path (5.1-T)**: when the plan recommends \\`team\\` AND \\`file_independent_steps >= 3\\`. Members execute in parallel, Lead orchestrates, a \\`deep\\` verifier lives outside the team.\n- **Legacy path (5.1-L)**: otherwise. Use the original 5.1 \u002F 5.2 \u002F 5.3 flow from above.\n\nRecord the chosen path in the TodoWrite list.\n\n## Phase 5.1-T: \\`refactor-squad\\` team execution\n\n**Precondition checks** (fail hard if any step fails):\n\n1. Load the \\`team-mode\\` skill via the \\`skill\\` tool for lifecycle, message protocol, and limits.\n2. Call \\`team_list\\` and verify no active \\`refactor-squad\\` run exists; if one does, shutdown + delete the orphan before proceeding.\n3. If \\`~\u002F.omo\u002Fteams\u002Frefactor-squad\u002Fconfig.json\\` is missing, write it using the spec below.\n\n**Team spec** (\\`~\u002F.omo\u002Fteams\u002Frefactor-squad\u002Fconfig.json\\`):\n\n\\`\\`\\`json\n{\n  \"name\": \"refactor-squad\",\n  \"lead\": { \"kind\": \"subagent_type\", \"subagent_type\": \"sisyphus\" },\n  \"members\": [\n    {\n      \"kind\": \"category\",\n      \"category\": \"quick\",\n      \"prompt\": \"You handle mechanical refactoring steps (LSP rename, extract variable, inline, simple move, signature change). Use LSP tools for correctness. Apply the task description's per-step instructions verbatim — no scope expansion. After edits, run lsp_diagnostics on touched files. Report via team_send_message(teamRunId=\u003Cid>, to=\\\"lead\\\", summary=\u003Cfiles touched>, body=\u003Clsp status + diff summary>) + team_task_update(status=completed). Never run tests — the external verifier handles that. Never git add, never --continue.\"\n    },\n    { \"kind\": \"category\", \"category\": \"quick\", \"prompt\": \"Same contract as peer quick worker.\" },\n    {\n      \"kind\": \"category\",\n      \"category\": \"unspecified-low\",\n      \"prompt\": \"You handle logic-preserving refactors that need reasoning (extract function, restructure conditional, pattern transformation, cross-file API change). Read the task description's plan step carefully. Use ast_grep_replace with dryRun=true first, review the preview, then execute. If the step is ambiguous or would require out-of-scope changes, STOP and send team_send_message(teamRunId=\u003Cid>, to=\\\"lead\\\", summary=\\\"UNCLEAR\\\", body=\u003Creason>) + team_task_update(status=pending). Same reporting contract as peer quick workers. Never run tests.\"\n    },\n    { \"kind\": \"category\", \"category\": \"unspecified-low\", \"prompt\": \"Same contract as peer unspecified-low worker.\" }\n  ]\n}\n\\`\\`\\`\n\nRationale for this composition:\n- **4 workers = team mode's parallel cap.** 5+ just queues.\n- **No verifier team member.** Verification needs \\`deep\\` reasoning (or \\`unspecified-high\\` fallback). In-team category routing downcasts to sisyphus-junior, which is weaker than required — the verifier runs OUTSIDE the team as a \\`task(category=\"deep\")\\`.\n- **quick × 2** for mechanical edits, **unspecified-low × 2** for reasoning edits — mirrors the plan's split.\n\n**Team lifecycle** (one team, reused until Phase 6 cleanup):\n\n1. \\`team_create(teamName=\"refactor-squad\")\\`. Record \\`teamRunId\\`.\n2. Broadcast the refactor Intent Card ONCE (keep task descriptions slim):\n   \\`\\`\\`\n   team_send_message(\n     teamRunId=\u003Cid>, to=\"*\", kind=\"announcement\",\n     summary=\"refactor-intent\",\n     body=\u003Ccodemap summary + constraints + established patterns from Phase 2>\n   )\n   \\`\\`\\`\n3. Broadcast the verification spec ONCE:\n   \\`\\`\\`\n   team_send_message(\n     teamRunId=\u003Cid>, to=\"*\", kind=\"announcement\",\n     summary=\"verify-spec\",\n     body=\u003Cexact test\u002Ftypecheck\u002Flint commands + expected pass counts + regression indicators from Phase 3.4>\n   )\n   \\`\\`\\`\n4. For each plan step, \\`team_task_create(teamRunId=\u003Cid>, subject=\"refactor step \u003CN>: \u003Cshort>\", description=\u003Cper-step instructions from plan, including target files and line ranges, rollback strategy>, blockedBy=\u003Cfrom plan's per_step_assignment>)\\`.\n\n**Lead monitoring loop**:\n\nWhile any team task is \\`pending | claimed | in_progress\\`:\n\n- Wait for \\`\u003Csystem-reminder>\\` or member messages. Avoid tight polling; a single \\`team_status\\` check is acceptable if no notification arrives within roughly 10 seconds of expected completion.\n- On a worker completion report, immediately dispatch an **external verifier** — verification runs OUTSIDE the team because team-member category routing downcasts to sisyphus-junior:\n  \\`\\`\\`\n  task(\n    category=\"deep\",\n    load_skills=[],\n    run_in_background=true,\n    description=\"verify step \u003CN>\",\n    prompt=\u003Cfiles touched + verify-spec commands + instruction to return \"PASS\" or \"FAIL:\u003Cfailing test + specific error + suggested revert hunks>\">\n  )\n  \\`\\`\\`\n  If \\`deep\\` is unavailable, fall back to \\`category=\"unspecified-high\"\\`. Do not create a commit checkpoint until the verifier returns PASS.\n- On a verifier PASS: make the commit checkpoint for that step (see original 5.3). Proceed.\n- On a verifier FAIL: Lead decides:\n  - **Retry with fix hint**: \\`team_task_update(status=pending)\\` on the original step + \\`team_send_message(teamRunId=\u003Cid>, to=\u003Coriginal member>, summary=\"retry\", body=\u003Cspecific failure from verifier>)\\`. Runtime reassigns.\n  - **Escalate**: after three FAIL cycles on the same step, STOP and consult the user with full evidence.\n- On a member UNCLEAR message: re-harvest context via a targeted \\`task()\\` outside the team, broadcast an updated Intent Card fragment, then reassign.\n\nProceed to Phase 6 only when every team task is \\`completed\\` AND every paired verifier task returned PASS.\n\n## Phase 6 override: Team cleanup before summary\n\nIf Phase 5 used the team path, dismantle \\`refactor-squad\\` BEFORE producing the 6.6 summary. Every exit path — success, escalation, abort — must cleanup; orphan teams poison the next session's precondition check.\n\n1. \\`team_shutdown_request\\` for each member, then \\`team_approve_shutdown\\` if members do not self-approve within a reasonable window.\n2. \\`team_delete(teamRunId=\u003Cid>)\\`.\n3. \\`team_list\\` to confirm no residual \\`refactor-squad\\` run.\n\nThe \\`~\u002F.omo\u002Fteams\u002Frefactor-squad\u002Fconfig.json\\` declaration stays on disk; next session reuses it.\n\nAppend to the 6.6 summary a \"Dispatch path\" line and, when team path was used, team metrics (teamRunId, tasks created, verifier runs, team lifetime).\n\n## MUST NOT (team mode)\n\n- Lead never edits files directly — orchestrate only.\n- Do not inline the Intent Card or verify-spec into task descriptions — rely on the broadcasts.\n- Do not recreate the team mid-session.\n- Do not run tests from Lead — the external verifier owns that lane.\n- Do not put \\`oracle\\` \u002F \\`librarian\\` \u002F \\`deep\\` into the team spec — oracle\u002Flibrarian are team-ineligible, and \\`deep\\` under category routing downcasts to sisyphus-junior. Use them via \\`task()\\` outside the team when needed.\n`\n",{"name":5,"description":7},"main","0a99b5b62ebd3726d465f7e319e2b8ec84c8aa6e","release\u002Flazyz-0.11.0-20261007\u002Fskills\u002Frefactor","https:\u002F\u002Fgithub.com\u002Fyounghai\u002Flazyz","https:\u002F\u002Fgithub.com\u002Fyounghai","http:\u002Fbzengage.co","Bizmatrixx co-founder & CEO \r\n","2026-11-01 13:58:56",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add younghai\u002Flazyz --skill refactor",{"tool":38,"command":39},"bunx","bunx skills add younghai\u002Flazyz --skill refactor",{"tool":41,"command":42},"pnpm","pnpm dlx skills add younghai\u002Flazyz --skill refactor","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fyounghai\u002Flazyz\u002Fblob\u002Fmain\u002Frelease\u002Flazyz-0.11.0-20261007\u002Fskills\u002Frefactor\u002FSKILL.md",true,[46],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"agents\u002Fopenai.yaml","REFERENCE","参考文档",46,"https:\u002F\u002Fgithub.com\u002Fyounghai\u002Flazyz\u002Fblob\u002Fmain\u002Frelease\u002Flazyz-0.11.0-20261007\u002Fskills\u002Frefactor\u002Fagents\u002Fopenai.yaml",[53,60,67,74,81,87],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M78GVSC3PZBHQQ5HPRNQ3AMN","valid-skill","A valid skill for testing purposes.","https:\u002F\u002Fgithub.com\u002Fyounghai\u002Flazyz\u002Fblob\u002Fmain\u002Fxcode\u002Fagent\u002Fpackages\u002Fcoding-agent\u002Ftest\u002Ffixtures\u002Fskills\u002Fvalid-skill\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M78GVRB79BN9BQ5MAZ43XJWX","unknown-field","A skill with an unknown frontmatter field.","https:\u002F\u002Fgithub.com\u002Fyounghai\u002Flazyz\u002Fblob\u002Fmain\u002Fxcode\u002Fagent\u002Fpackages\u002Fcoding-agent\u002Ftest\u002Ffixtures\u002Fskills\u002Funknown-field\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M78GVQ2319BDGJA2QXMM2DM3","nested-child","Nested skill should be ignored.","https:\u002F\u002Fgithub.com\u002Fyounghai\u002Flazyz\u002Fblob\u002Fmain\u002Fxcode\u002Fagent\u002Fpackages\u002Fcoding-agent\u002Ftest\u002Ffixtures\u002Fskills\u002Froot-skill-preferred\u002Fnested-child\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M78GVP5HC2C9B3VN8D8QWEFG","root-skill-preferred","Root skill should win.","https:\u002F\u002Fgithub.com\u002Fyounghai\u002Flazyz\u002Fblob\u002Fmain\u002Fxcode\u002Fagent\u002Fpackages\u002Fcoding-agent\u002Ftest\u002Ffixtures\u002Fskills\u002Froot-skill-preferred\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M78GVNAR8R5XF3W00182ZWZH","no-frontmatter","https:\u002F\u002Fgithub.com\u002Fyounghai\u002Flazyz\u002Fblob\u002Fmain\u002Fxcode\u002Fagent\u002Fpackages\u002Fcoding-agent\u002Ftest\u002Ffixtures\u002Fskills\u002Fno-frontmatter\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M78GVK58G788T2TRHPCA8Y64","child-skill","A nested skill in a subdirectory.","https:\u002F\u002Fgithub.com\u002Fyounghai\u002Flazyz\u002Fblob\u002Fmain\u002Fxcode\u002Fagent\u002Fpackages\u002Fcoding-agent\u002Ftest\u002Ffixtures\u002Fskills\u002Fnested\u002Fchild-skill\u002FSKILL.md",[],[]]