[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6BYW6G1E2SRXER3TF0EAWXM":3,"skill-same:01M6BYW6G1E2SRXER3TF0EAWXM":143},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":40,"linkOnly":41,"markdownContent":42,"markdownBody":43,"frontMatter":44,"refName":45,"commitSha":46,"skillDirectory":47,"forksCount":48,"repositoryHtmlUrl":49,"repositoryHomepageUrl":17,"ownerHtmlUrl":50,"ownerBlogUrl":17,"ownerDescription":51,"updatedAt":52,"install":53,"resources":66},"01M6BYW6G1E2SRXER3TF0EAWXM","oma-refactor","行为保持式代码重构","Behavior-preserving refactoring specialist - plans and executes safe incremental restructuring with code smell \u002F SATD \u002F hotspot targeting, characterization-test safety nets, metric and coverage gates, and refactor-only commits. Use for refactor, refactoring, code smell, technical debt, legacy code modernization, extract method, hotspot, and characterization test work.","保持行为的重构专家——规划并执行安全的增量式重构，针对代码异味 \u002F SATD \u002F 热点，配备特征测试（characterization test）安全网、指标与覆盖率门禁，以及仅用于重构的提交。用于重构、代码异味、技术债务、遗留代码现代化、提取方法、热点和特征测试工作。","mrmarbury\u002FPalmSync4Mac","mrmarbury","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F114311?v=4","01M6BYSN920J8AMQ0W6HGSBH60","Stefan Marbury","01M6BYSNDEACDBNBPNRNCVYAPJ",2,"Apache-2.0",null,"https:\u002F\u002Fgithub.com\u002Fmrmarbury\u002FPalmSync4Mac\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Foma-refactor\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BT7QVANT4709358VEJK53E","代码实现","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39],"refactor","oma refactor","safe","test","modernization","code","Safety","commits","refactoring","2026-11-10 10:12:30",false,"---\nname: oma-refactor\ndescription: Behavior-preserving refactoring specialist - plans and executes safe incremental restructuring with code smell \u002F SATD \u002F hotspot targeting, characterization-test safety nets, metric and coverage gates, and refactor-only commits. Use for refactor, refactoring, code smell, technical debt, legacy code modernization, extract method, hotspot, and characterization test work.\n---\n\n# Refactor Agent - Behavior-Preserving Restructuring Specialist\n\n## Scheduling\n\n### Goal\nImprove internal code structure - readability first - without changing observable behavior, through small verified transformations, each gated by a safety net (tests \u002F tooling \u002F types) and committed separately from any behavior change.\n\n### Intent signature\n- User asks to refactor, clean up, restructure, modernize, de-duplicate, or \"make this code maintainable\u002Freadable\".\n- User mentions code smells, technical debt, legacy code, long methods\u002Ffiles, god classes, hotspots, characterization tests, or extract\u002Fmove\u002Frename transformations.\n- User asks \"where should we refactor first?\" or wants a refactoring plan\u002Fpriority for a codebase.\n\n### When to use\n- Executing a refactoring on specific files\u002Fmodules (extract, move, rename, decompose, pattern\u002Fidiom alignment)\n- Preparatory refactoring before a feature (\"make the change easy, then make the easy change\")\n- Legacy (brownfield) rescue: seam discovery + characterization tests, then restructuring\n- Refactoring target selection and prioritization (smells + SATD + hotspot = churn x complexity)\n- Auditing whether code is safe to refactor now (coverage breadth x mutation strength x flakiness)\n\n### When NOT to use\n- Fixing a reported bug or failing behavior -> use `oma-debug` (refactoring must not change behavior)\n- Security\u002Fperformance\u002Faccessibility review or quality audit -> use `oma-qa`\n- System design, module boundary decisions, ADRs, convention changes -> use `oma-architecture` (a convention\u002Fpattern change is an architecture decision, not a local refactoring)\n- DB schema design or migration mechanics -> use `oma-db` (this skill only plans the expand-contract sequence)\n- Commit splitting \u002F staging mechanics -> use `oma-scm`\n- Performance optimization as a goal -> out of scope by definition (tuning is a side effect, never the objective)\n\n### Expected inputs\n- `target`: file\u002Fmodule\u002Fpath, smell report, SATD marker, or the feature request motivating preparatory refactoring\n- `verification`: project test command(s) per the tool registry; coverage\u002Fmutation tooling if available\n- `constraints`: coding guide \u002F conventions, regulated-environment flags, merge-window concerns\n- Optional: prior metric reports, hotspot data, ADRs touching the target area\n\n### Expected outputs\n- Refactored code as a sequence of atomic, refactor-only commits (no test changes mixed in)\n- Safety-net additions when missing (characterization \u002F golden-master tests) as separate commits\n- Before\u002Fafter report: metric delta (cyclomatic\u002Fcognitive complexity, size, coupling) + readability verdict\n\n```yaml\noutputs:\n  - name: report\n    description: refactoring plan or before\u002Fafter report\n    artifact: \".agents\u002Fresults\u002Frefactor\u002F*.md\"\n    required: false\n```\n\nStandalone runs write plan \u002F before-after reports under `.agents\u002Fresults\u002Frefactor\u002F`; orchestrated runs (via the `refactor-engineer` agent) write `.agents\u002Fresults\u002Fresult-refactor[-{sessionId}].md` per the agent execution protocol.\n\n### Dependencies\n- `resources\u002Fdefinition.md` (invariant definition: 5 properties, boundaries, destination principle, naming roles, inline evidence)\n- `resources\u002Fmeasurement.md` (4-layer measurement + git forensics commands)\n- `resources\u002Fgovernance.md` (org parameters: budget floor, 500-line gate, tool registry)\n- Serena MCP symbol\u002Freference tools; project test runners per registry (vitest \u002F pytest \u002F flutter_test)\n- Git history for churn\u002Fownership\u002Fhotspot analysis\n\n### Control-flow features\n- Branches by safety-net state (greenfield vs brownfield), statefulness (code-only vs expand-contract), and verification outcome (pass vs Mikado revert)\n- Reads code\u002Fhistory\u002Fmetrics; writes code, tests (in separate commits), and reports\n- Stops and routes to `oma-architecture` when the change requires a convention\u002Fboundary decision\n\n## Structural Flow\n\n### Entry\n1. Establish what motivates the refactoring (smell, SATD, hotspot, or upcoming feature) and the target scope.\n2. Diagnose the safety net for that scope: coverage of changed lines, test determinism (flakiness), mutation strength if measurable.\n3. Identify the destination form: the language idiom and codebase convention the result must match.\n\n### Scenes\n1. **PREPARE**: Classify greenfield (safety net exists) vs brownfield (build net first); check size gates and hotspot rank; confirm two-hats scope (no feature\u002Fbug work mixed in).\n2. **ACQUIRE**: Read target code via symbol tools; collect metrics (complexity, size, coupling) and git signals (churn, ownership); read the coding guide for conventions.\n3. **REASON**: Decompose the goal into a sequence of named atomic transformations; for stateful targets plan expand-contract; verify each step is independently verifiable and revertible.\n4. **ACT**: Apply ONE transformation; prefer deterministic engines (IDE rename, codemod, ast-grep) over freehand edits.\n5. **VERIFY**: Re-run existing tests unchanged. Pass -> commit (refactor-only) -> next transformation. Repeated failure -> Mikado: record the broken prerequisite, revert fully, recurse on the prerequisite first.\n6. **FINALIZE**: Before\u002Fafter metric delta + readability judgment (metric improvement alone is not success); report follow-ups discovered but deliberately not done.\n\n### Transitions\n- If the safety net is missing or weak (low diff coverage, flaky, no assertions), write characterization \u002F golden-master tests FIRST, committed separately, before touching production code.\n- If verification fails repeatedly, switch to the Mikado method: never carry a half-broken tree forward.\n- If the right fix is a convention or pattern change (new dialect), stop and route to `oma-architecture` for an ADR + ratchet plan.\n- If the target involves persisted state or external consumers, plan expand-contract (parallel change) with feature flags; deployment, not commit, becomes the unit of incrementality.\n- If a behavior bug is discovered mid-refactoring, record it and route to `oma-debug`; do not fix it in the refactor commit.\n- If the work is large enough to collide with teammates' branches, recommend announcement + short merge window; register bulk mechanical commits in `.git-blame-ignore-revs`.\n\n### Failure and recovery\n| Failure | Recovery |\n|---------|----------|\n| Tests fail after a transformation | Mikado: record prerequisite, revert all, attack prerequisite first |\n| No tests and code is untestable | Find a seam; apply only minimal mechanical changes to inject test access, then characterize |\n| Tests are flaky | Fix or quarantine flaky tests before refactoring - an unreliable net is no net |\n| Metric improves but readability worsens | Reject the transformation; readability is the success criterion, metrics are proxies |\n| Scope keeps growing | Stop; report the boundary issue and split into a Mikado graph or route to architecture |\n| Refactoring engine\u002Fcodemod produces wrong output | Engines are not infallible - tests re-run is mandatory; fall back to manual atomic edits |\n\n### Exit\n- Success: behavior verified unchanged, structure measurably improved, readability confirmed, refactor-only commits, follow-ups reported.\n- Partial success: safety net built but restructuring deferred; or prerequisites mapped (Mikado graph) with explicit blockers.\n- Failure: blocking ambiguity (no verification path, regulated freeze, convention decision needed) reported with the recommended route.\n\n## Logical Operations\n\n### Actions\n| Action | SSL primitive | Evidence |\n|--------|---------------|----------|\n| Diagnose safety net | `VALIDATE` | Coverage\u002Fflakiness\u002Fmutation state of target scope |\n| Collect signals | `READ` | Metrics, git churn\u002Fownership, smells, SATD |\n| Rank targets | `COMPARE` | Hotspot = complexity x churn |\n| Plan atomic sequence | `INFER` | Named transformations, Mikado graph |\n| Write characterization tests | `WRITE` | Golden-master\u002Fsnapshot tests (separate commit) |\n| Apply transformation | `WRITE` \u002F `CALL_TOOL` | One atomic refactor, engine-first |\n| Verify preservation | `VALIDATE` | Existing tests re-run unchanged |\n| Commit separately | `UPDATE_STATE` | `refactor:`-typed commits only |\n| Report delta | `NOTIFY` | Metric + readability before\u002Fafter |\n\n### Tools and instruments\n- Serena MCP: `find_symbol`, `find_referencing_symbols`, `search_for_pattern` for impact analysis; `rename_symbol` for engine-executed renames\n- Deterministic transformers: IDE refactoring actions, codemods (jscodeshift \u002F OpenRewrite \u002F ast-grep \u002F comby)\n- Metrics: lizard \u002F radon (complexity) — both are PyPI packages, run via `uvx lizard` \u002F `uvx radon` so no pre-install is required; per-language linters with `max-lines` gates\n- Test stack per registry: vitest + StrykerJS \u002F pytest + mutmut \u002F flutter_test (see `resources\u002Fgovernance.md`)\n- Git forensics one-liners (see `resources\u002Fmeasurement.md`)\n\n### Canonical workflow path\n1. Diagnose: run coverage on the target scope and check test determinism; classify green\u002Fbrownfield.\n2. If brownfield: find a seam, write characterization (golden-master) tests for CURRENT behavior, commit.\n3. Select targets by hotspot rank (complexity x churn), not by smell aesthetics alone.\n4. Plan a sequence of named atomic transformations toward the language-idiomatic, convention-conforming form.\n5. Loop per transformation: apply (engine-first) -> re-run tests UNCHANGED -> commit `refactor:` only.\n   On repeated failure: record prerequisite, revert fully, recurse (Mikado).\n6. Finish: metric delta + readability verdict; list discovered-but-deferred work; never mix in behavior changes.\n\n### Resource scope\n| Scope | Resource target |\n|-------|-----------------|\n| `CODEBASE` | Target source, tests, coding guide, lint configs |\n| `LOCAL_FS` | Reports under `.agents\u002Fresults\u002Frefactor\u002F`, `.git-blame-ignore-revs` |\n| `PROCESS` | Test runners, coverage\u002Fmutation tools, codemod engines, git log analysis |\n| `MEMORY` | Mikado prerequisite graph, deferred follow-ups, metric baselines |\n\n### Preconditions\n- A verification path exists or can be built (tests\u002Ftypes\u002Ftooling); otherwise the first deliverable is the safety net, not restructuring.\n- The target's conventions are known (coding guide read) or explicitly absent.\n\n### Effects and side effects\n- Mutates production code (structure only) and adds tests in separate commits.\n- Runs test\u002Fcoverage\u002Fmutation commands; reads git history.\n- May write reports under `.agents\u002Fresults\u002Frefactor\u002F` and entries to `.git-blame-ignore-revs`.\n- Never alters observable behavior, public contracts, or persisted data without an expand-contract plan.\n\n### Guardrails\n1. **Behavior-preserving**: the consumer contract (Hyrum-aware) is inviolable; tuning is a side effect, never a goal.\n2. **Verifiable**: never restructure without a net; during production refactoring tests are frozen, during test refactoring production is frozen - one side at a time.\n3. **Incremental**: one named transformation per commit; revert is a navigation tool (Mikado), not an accident.\n4. **Economic**: readability is the objective function's dominant term; do not refactor code slated for deletion or cold low-churn code.\n5. **Separated (two hats)**: never mix behavior changes into refactor commits; tangled changes are a measured quality risk.\n6. Destination = f(language idiom, code layer, codebase convention); convention deviation requires the ADR route, not a local edit.\n7. Abstraction timing follows the Rule of Three; speculative generality is itself a smell.\n8. All metrics are proxies (Goodhart): a 499-line mechanical split, assertion-free coverage, or pattern-count gains are failures, not wins.\n\n## References\n- Invariant definition (5 properties, boundaries, destination, naming roles, contexts, D&C, inline evidence): `resources\u002Fdefinition.md`\n- Measurement: 4 layers + git forensics commands: `resources\u002Fmeasurement.md`\n- Org parameters: budget floor, 500-line gate, tool registry: `resources\u002Fgovernance.md`\n- Context loading: `..\u002F_shared\u002Fcore\u002Fcontext-loading.md`\n- Quality principles: `..\u002F_shared\u002Fcore\u002Fquality-principles.md`\n- Adjacent skills: `oma-debug` (bugs), `oma-qa` (audits), `oma-architecture` (boundaries\u002FADR), `oma-db` (schema), `oma-scm` (commits)\n","# Refactor Agent - Behavior-Preserving Restructuring Specialist\n\n## Scheduling\n\n### Goal\nImprove internal code structure - readability first - without changing observable behavior, through small verified transformations, each gated by a safety net (tests \u002F tooling \u002F types) and committed separately from any behavior change.\n\n### Intent signature\n- User asks to refactor, clean up, restructure, modernize, de-duplicate, or \"make this code maintainable\u002Freadable\".\n- User mentions code smells, technical debt, legacy code, long methods\u002Ffiles, god classes, hotspots, characterization tests, or extract\u002Fmove\u002Frename transformations.\n- User asks \"where should we refactor first?\" or wants a refactoring plan\u002Fpriority for a codebase.\n\n### When to use\n- Executing a refactoring on specific files\u002Fmodules (extract, move, rename, decompose, pattern\u002Fidiom alignment)\n- Preparatory refactoring before a feature (\"make the change easy, then make the easy change\")\n- Legacy (brownfield) rescue: seam discovery + characterization tests, then restructuring\n- Refactoring target selection and prioritization (smells + SATD + hotspot = churn x complexity)\n- Auditing whether code is safe to refactor now (coverage breadth x mutation strength x flakiness)\n\n### When NOT to use\n- Fixing a reported bug or failing behavior -> use `oma-debug` (refactoring must not change behavior)\n- Security\u002Fperformance\u002Faccessibility review or quality audit -> use `oma-qa`\n- System design, module boundary decisions, ADRs, convention changes -> use `oma-architecture` (a convention\u002Fpattern change is an architecture decision, not a local refactoring)\n- DB schema design or migration mechanics -> use `oma-db` (this skill only plans the expand-contract sequence)\n- Commit splitting \u002F staging mechanics -> use `oma-scm`\n- Performance optimization as a goal -> out of scope by definition (tuning is a side effect, never the objective)\n\n### Expected inputs\n- `target`: file\u002Fmodule\u002Fpath, smell report, SATD marker, or the feature request motivating preparatory refactoring\n- `verification`: project test command(s) per the tool registry; coverage\u002Fmutation tooling if available\n- `constraints`: coding guide \u002F conventions, regulated-environment flags, merge-window concerns\n- Optional: prior metric reports, hotspot data, ADRs touching the target area\n\n### Expected outputs\n- Refactored code as a sequence of atomic, refactor-only commits (no test changes mixed in)\n- Safety-net additions when missing (characterization \u002F golden-master tests) as separate commits\n- Before\u002Fafter report: metric delta (cyclomatic\u002Fcognitive complexity, size, coupling) + readability verdict\n\n```yaml\noutputs:\n  - name: report\n    description: refactoring plan or before\u002Fafter report\n    artifact: \".agents\u002Fresults\u002Frefactor\u002F*.md\"\n    required: false\n```\n\nStandalone runs write plan \u002F before-after reports under `.agents\u002Fresults\u002Frefactor\u002F`; orchestrated runs (via the `refactor-engineer` agent) write `.agents\u002Fresults\u002Fresult-refactor[-{sessionId}].md` per the agent execution protocol.\n\n### Dependencies\n- `resources\u002Fdefinition.md` (invariant definition: 5 properties, boundaries, destination principle, naming roles, inline evidence)\n- `resources\u002Fmeasurement.md` (4-layer measurement + git forensics commands)\n- `resources\u002Fgovernance.md` (org parameters: budget floor, 500-line gate, tool registry)\n- Serena MCP symbol\u002Freference tools; project test runners per registry (vitest \u002F pytest \u002F flutter_test)\n- Git history for churn\u002Fownership\u002Fhotspot analysis\n\n### Control-flow features\n- Branches by safety-net state (greenfield vs brownfield), statefulness (code-only vs expand-contract), and verification outcome (pass vs Mikado revert)\n- Reads code\u002Fhistory\u002Fmetrics; writes code, tests (in separate commits), and reports\n- Stops and routes to `oma-architecture` when the change requires a convention\u002Fboundary decision\n\n## Structural Flow\n\n### Entry\n1. Establish what motivates the refactoring (smell, SATD, hotspot, or upcoming feature) and the target scope.\n2. Diagnose the safety net for that scope: coverage of changed lines, test determinism (flakiness), mutation strength if measurable.\n3. Identify the destination form: the language idiom and codebase convention the result must match.\n\n### Scenes\n1. **PREPARE**: Classify greenfield (safety net exists) vs brownfield (build net first); check size gates and hotspot rank; confirm two-hats scope (no feature\u002Fbug work mixed in).\n2. **ACQUIRE**: Read target code via symbol tools; collect metrics (complexity, size, coupling) and git signals (churn, ownership); read the coding guide for conventions.\n3. **REASON**: Decompose the goal into a sequence of named atomic transformations; for stateful targets plan expand-contract; verify each step is independently verifiable and revertible.\n4. **ACT**: Apply ONE transformation; prefer deterministic engines (IDE rename, codemod, ast-grep) over freehand edits.\n5. **VERIFY**: Re-run existing tests unchanged. Pass -> commit (refactor-only) -> next transformation. Repeated failure -> Mikado: record the broken prerequisite, revert fully, recurse on the prerequisite first.\n6. **FINALIZE**: Before\u002Fafter metric delta + readability judgment (metric improvement alone is not success); report follow-ups discovered but deliberately not done.\n\n### Transitions\n- If the safety net is missing or weak (low diff coverage, flaky, no assertions), write characterization \u002F golden-master tests FIRST, committed separately, before touching production code.\n- If verification fails repeatedly, switch to the Mikado method: never carry a half-broken tree forward.\n- If the right fix is a convention or pattern change (new dialect), stop and route to `oma-architecture` for an ADR + ratchet plan.\n- If the target involves persisted state or external consumers, plan expand-contract (parallel change) with feature flags; deployment, not commit, becomes the unit of incrementality.\n- If a behavior bug is discovered mid-refactoring, record it and route to `oma-debug`; do not fix it in the refactor commit.\n- If the work is large enough to collide with teammates' branches, recommend announcement + short merge window; register bulk mechanical commits in `.git-blame-ignore-revs`.\n\n### Failure and recovery\n| Failure | Recovery |\n|---------|----------|\n| Tests fail after a transformation | Mikado: record prerequisite, revert all, attack prerequisite first |\n| No tests and code is untestable | Find a seam; apply only minimal mechanical changes to inject test access, then characterize |\n| Tests are flaky | Fix or quarantine flaky tests before refactoring - an unreliable net is no net |\n| Metric improves but readability worsens | Reject the transformation; readability is the success criterion, metrics are proxies |\n| Scope keeps growing | Stop; report the boundary issue and split into a Mikado graph or route to architecture |\n| Refactoring engine\u002Fcodemod produces wrong output | Engines are not infallible - tests re-run is mandatory; fall back to manual atomic edits |\n\n### Exit\n- Success: behavior verified unchanged, structure measurably improved, readability confirmed, refactor-only commits, follow-ups reported.\n- Partial success: safety net built but restructuring deferred; or prerequisites mapped (Mikado graph) with explicit blockers.\n- Failure: blocking ambiguity (no verification path, regulated freeze, convention decision needed) reported with the recommended route.\n\n## Logical Operations\n\n### Actions\n| Action | SSL primitive | Evidence |\n|--------|---------------|----------|\n| Diagnose safety net | `VALIDATE` | Coverage\u002Fflakiness\u002Fmutation state of target scope |\n| Collect signals | `READ` | Metrics, git churn\u002Fownership, smells, SATD |\n| Rank targets | `COMPARE` | Hotspot = complexity x churn |\n| Plan atomic sequence | `INFER` | Named transformations, Mikado graph |\n| Write characterization tests | `WRITE` | Golden-master\u002Fsnapshot tests (separate commit) |\n| Apply transformation | `WRITE` \u002F `CALL_TOOL` | One atomic refactor, engine-first |\n| Verify preservation | `VALIDATE` | Existing tests re-run unchanged |\n| Commit separately | `UPDATE_STATE` | `refactor:`-typed commits only |\n| Report delta | `NOTIFY` | Metric + readability before\u002Fafter |\n\n### Tools and instruments\n- Serena MCP: `find_symbol`, `find_referencing_symbols`, `search_for_pattern` for impact analysis; `rename_symbol` for engine-executed renames\n- Deterministic transformers: IDE refactoring actions, codemods (jscodeshift \u002F OpenRewrite \u002F ast-grep \u002F comby)\n- Metrics: lizard \u002F radon (complexity) — both are PyPI packages, run via `uvx lizard` \u002F `uvx radon` so no pre-install is required; per-language linters with `max-lines` gates\n- Test stack per registry: vitest + StrykerJS \u002F pytest + mutmut \u002F flutter_test (see `resources\u002Fgovernance.md`)\n- Git forensics one-liners (see `resources\u002Fmeasurement.md`)\n\n### Canonical workflow path\n1. Diagnose: run coverage on the target scope and check test determinism; classify green\u002Fbrownfield.\n2. If brownfield: find a seam, write characterization (golden-master) tests for CURRENT behavior, commit.\n3. Select targets by hotspot rank (complexity x churn), not by smell aesthetics alone.\n4. Plan a sequence of named atomic transformations toward the language-idiomatic, convention-conforming form.\n5. Loop per transformation: apply (engine-first) -> re-run tests UNCHANGED -> commit `refactor:` only.\n   On repeated failure: record prerequisite, revert fully, recurse (Mikado).\n6. Finish: metric delta + readability verdict; list discovered-but-deferred work; never mix in behavior changes.\n\n### Resource scope\n| Scope | Resource target |\n|-------|-----------------|\n| `CODEBASE` | Target source, tests, coding guide, lint configs |\n| `LOCAL_FS` | Reports under `.agents\u002Fresults\u002Frefactor\u002F`, `.git-blame-ignore-revs` |\n| `PROCESS` | Test runners, coverage\u002Fmutation tools, codemod engines, git log analysis |\n| `MEMORY` | Mikado prerequisite graph, deferred follow-ups, metric baselines |\n\n### Preconditions\n- A verification path exists or can be built (tests\u002Ftypes\u002Ftooling); otherwise the first deliverable is the safety net, not restructuring.\n- The target's conventions are known (coding guide read) or explicitly absent.\n\n### Effects and side effects\n- Mutates production code (structure only) and adds tests in separate commits.\n- Runs test\u002Fcoverage\u002Fmutation commands; reads git history.\n- May write reports under `.agents\u002Fresults\u002Frefactor\u002F` and entries to `.git-blame-ignore-revs`.\n- Never alters observable behavior, public contracts, or persisted data without an expand-contract plan.\n\n### Guardrails\n1. **Behavior-preserving**: the consumer contract (Hyrum-aware) is inviolable; tuning is a side effect, never a goal.\n2. **Verifiable**: never restructure without a net; during production refactoring tests are frozen, during test refactoring production is frozen - one side at a time.\n3. **Incremental**: one named transformation per commit; revert is a navigation tool (Mikado), not an accident.\n4. **Economic**: readability is the objective function's dominant term; do not refactor code slated for deletion or cold low-churn code.\n5. **Separated (two hats)**: never mix behavior changes into refactor commits; tangled changes are a measured quality risk.\n6. Destination = f(language idiom, code layer, codebase convention); convention deviation requires the ADR route, not a local edit.\n7. Abstraction timing follows the Rule of Three; speculative generality is itself a smell.\n8. All metrics are proxies (Goodhart): a 499-line mechanical split, assertion-free coverage, or pattern-count gains are failures, not wins.\n\n## References\n- Invariant definition (5 properties, boundaries, destination, naming roles, contexts, D&C, inline evidence): `resources\u002Fdefinition.md`\n- Measurement: 4 layers + git forensics commands: `resources\u002Fmeasurement.md`\n- Org parameters: budget floor, 500-line gate, tool registry: `resources\u002Fgovernance.md`\n- Context loading: `..\u002F_shared\u002Fcore\u002Fcontext-loading.md`\n- Quality principles: `..\u002F_shared\u002Fcore\u002Fquality-principles.md`\n- Adjacent skills: `oma-debug` (bugs), `oma-qa` (audits), `oma-architecture` (boundaries\u002FADR), `oma-db` (schema), `oma-scm` (commits)\n",{"name":5,"description":7},"main","0debaec9469b8a9289d77b8ce5c3143c4a656b16",".agents\u002Fskills\u002Foma-refactor",0,"https:\u002F\u002Fgithub.com\u002Fmrmarbury\u002FPalmSync4Mac","https:\u002F\u002Fgithub.com\u002Fmrmarbury","FreeBSD admin, Elixir & Erlang Dev, Rubyist, Skateboarder, Musician","2026-11-07 06:23:43",{"source":9,"skillName":5,"commands":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add mrmarbury\u002FPalmSync4Mac --skill oma-refactor",{"tool":59,"command":60},"bunx","bunx skills add mrmarbury\u002FPalmSync4Mac --skill oma-refactor",{"tool":62,"command":63},"pnpm","pnpm dlx skills add mrmarbury\u002FPalmSync4Mac --skill oma-refactor","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmrmarbury\u002FPalmSync4Mac\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Foma-refactor\u002FSKILL.md",true,[67,73,77,81,87,91,95,99,103,107,111,115,119,123,127,131,135,139],{"path":68,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":72},"assets\u002Ftemplates\u002Fcwv-audit-report.md","ASSET","资产文件",1587,"https:\u002F\u002Fgithub.com\u002Fshenxingy\u002FClade\u002Fblob\u002Fmain\u002Fconfigs\u002Fskills\u002Fseo-google\u002Fassets\u002Ftemplates\u002Fcwv-audit-report.md",{"path":74,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":75,"sourceHtmlUrl":76},"assets\u002Ftemplates\u002Fgsc-performance-report.md",1216,"https:\u002F\u002Fgithub.com\u002Fshenxingy\u002FClade\u002Fblob\u002Fmain\u002Fconfigs\u002Fskills\u002Fseo-google\u002Fassets\u002Ftemplates\u002Fgsc-performance-report.md",{"path":78,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":79,"sourceHtmlUrl":80},"assets\u002Ftemplates\u002Findexation-status-report.md",1126,"https:\u002F\u002Fgithub.com\u002Fshenxingy\u002FClade\u002Fblob\u002Fmain\u002Fconfigs\u002Fskills\u002Fseo-google\u002Fassets\u002Ftemplates\u002Findexation-status-report.md",{"path":82,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":85,"sourceHtmlUrl":86},"prompt.md","REFERENCE","参考文档",12715,"https:\u002F\u002Fgithub.com\u002Fshenxingy\u002FClade\u002Fblob\u002Fmain\u002Fconfigs\u002Fskills\u002Fseo-google\u002Fprompt.md",{"path":88,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":89,"sourceHtmlUrl":90},"references\u002Fauth-setup.md",5323,"https:\u002F\u002Fgithub.com\u002Fshenxingy\u002FClade\u002Fblob\u002Fmain\u002Fconfigs\u002Fskills\u002Fseo-google\u002Freferences\u002Fauth-setup.md",{"path":92,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":93,"sourceHtmlUrl":94},"references\u002Fdma-consent-mode-v2.md",2664,"https:\u002F\u002Fgithub.com\u002Fshenxingy\u002FClade\u002Fblob\u002Fmain\u002Fconfigs\u002Fskills\u002Fseo-google\u002Freferences\u002Fdma-consent-mode-v2.md",{"path":96,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":97,"sourceHtmlUrl":98},"references\u002Fga4-data-api.md",5364,"https:\u002F\u002Fgithub.com\u002Fshenxingy\u002FClade\u002Fblob\u002Fmain\u002Fconfigs\u002Fskills\u002Fseo-google\u002Freferences\u002Fga4-data-api.md",{"path":100,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":101,"sourceHtmlUrl":102},"references\u002Findexing-api.md",3163,"https:\u002F\u002Fgithub.com\u002Fshenxingy\u002FClade\u002Fblob\u002Fmain\u002Fconfigs\u002Fskills\u002Fseo-google\u002Freferences\u002Findexing-api.md",{"path":104,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":105,"sourceHtmlUrl":106},"references\u002Fkeyword-planner-api.md",2398,"https:\u002F\u002Fgithub.com\u002Fshenxingy\u002FClade\u002Fblob\u002Fmain\u002Fconfigs\u002Fskills\u002Fseo-google\u002Freferences\u002Fkeyword-planner-api.md",{"path":108,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":109,"sourceHtmlUrl":110},"references\u002Fnlp-api.md",2081,"https:\u002F\u002Fgithub.com\u002Fshenxingy\u002FClade\u002Fblob\u002Fmain\u002Fconfigs\u002Fskills\u002Fseo-google\u002Freferences\u002Fnlp-api.md",{"path":112,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":113,"sourceHtmlUrl":114},"references\u002Fpagespeed-crux-api.md",6300,"https:\u002F\u002Fgithub.com\u002Fshenxingy\u002FClade\u002Fblob\u002Fmain\u002Fconfigs\u002Fskills\u002Fseo-google\u002Freferences\u002Fpagespeed-crux-api.md",{"path":116,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":117,"sourceHtmlUrl":118},"references\u002Frate-limits-quotas.md",3379,"https:\u002F\u002Fgithub.com\u002Fshenxingy\u002FClade\u002Fblob\u002Fmain\u002Fconfigs\u002Fskills\u002Fseo-google\u002Freferences\u002Frate-limits-quotas.md",{"path":120,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":121,"sourceHtmlUrl":122},"references\u002Fsearch-console-api.md",4691,"https:\u002F\u002Fgithub.com\u002Fshenxingy\u002FClade\u002Fblob\u002Fmain\u002Fconfigs\u002Fskills\u002Fseo-google\u002Freferences\u002Fsearch-console-api.md",{"path":124,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":125,"sourceHtmlUrl":126},"references\u002Fsupplementary-apis.md",2812,"https:\u002F\u002Fgithub.com\u002Fshenxingy\u002FClade\u002Fblob\u002Fmain\u002Fconfigs\u002Fskills\u002Fseo-google\u002Freferences\u002Fsupplementary-apis.md",{"path":128,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":129,"sourceHtmlUrl":130},"references\u002Fyoutube-api.md",1523,"https:\u002F\u002Fgithub.com\u002Fshenxingy\u002FClade\u002Fblob\u002Fmain\u002Fconfigs\u002Fskills\u002Fseo-google\u002Freferences\u002Fyoutube-api.md",{"path":132,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":133,"sourceHtmlUrl":134},"resources\u002Fdefinition.md",12799,"https:\u002F\u002Fgithub.com\u002Fmrmarbury\u002FPalmSync4Mac\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Foma-refactor\u002Fresources\u002Fdefinition.md",{"path":136,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":137,"sourceHtmlUrl":138},"resources\u002Fgovernance.md",4833,"https:\u002F\u002Fgithub.com\u002Fmrmarbury\u002FPalmSync4Mac\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Foma-refactor\u002Fresources\u002Fgovernance.md",{"path":140,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":141,"sourceHtmlUrl":142},"resources\u002Fmeasurement.md",4457,"https:\u002F\u002Fgithub.com\u002Fmrmarbury\u002FPalmSync4Mac\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Foma-refactor\u002Fresources\u002Fmeasurement.md",[144,171,195,220,244,270],{"skillNo":145,"name":146,"nameZh":17,"description":147,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":148,"categories":149,"keywords":150,"publishedAt":40},"01M6WJZMN4HV76T0Y2PYDAAD7Q","oma-translator","Context-aware translation that preserves tone, style, and natural word order. Use when translating UI strings, documentation, marketing copy, or any multilingual content. Infers register, domain, and style from the source text and surrounding codebase context.","https:\u002F\u002Fgithub.com\u002Fmrmarbury\u002FPalmSync4Mac\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Foma-translation\u002FSKILL.md",[],[151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170],"translator","oma translator","documentation","ui","marketing","Word","text","context","use","multilingual","translation","domain","tone","style","register","copy","strings","source","codebase","when",{"skillNo":172,"name":173,"nameZh":17,"description":174,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":175,"categories":176,"keywords":177,"publishedAt":40},"01M6WJZ5W60XSDDE72AW5E85GT","oma-skill-creator","Create or update OMA skills in the SSL-lite human-readable format. Use when adding a new `.agents\u002Fskills\u002F{skill-name}\u002FSKILL.md`, converting an existing skill to the standardized Scheduling \u002F Structural Flow \u002F Logical Operations \u002F References structure, or validating whether a skill has enough routing, execution, resource, and safety detail.","https:\u002F\u002Fgithub.com\u002Fmrmarbury\u002FPalmSync4Mac\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Foma-skill-creation\u002FSKILL.md",[],[178,179,180,181,182,183,184,185,186,37,159,187,188,189,190,191,192,193,194,170],"skill creator","oma skill creator","creator","create","update","routing","ssl","flow","execution","scheduling","references","existing skill","structure","human","structural","detail","Existing",{"skillNo":196,"name":197,"nameZh":17,"description":198,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":199,"categories":200,"keywords":201,"publishedAt":40},"01M6WJYHKKTDG9RT9A6ZWCT29A","oma-orchestrator","Automated multi-agent orchestrator that spawns CLI subagents in parallel, coordinates via MCP Memory, and monitors progress. Use for orchestration, parallel execution, and automated multi-agent workflows.","https:\u002F\u002Fgithub.com\u002Fmrmarbury\u002FPalmSync4Mac\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Foma-orchestration\u002FSKILL.md",[],[202,203,204,205,206,207,208,186,209,210,211,159,212,213,214,215,216,217,218,219],"oma orchestrator","orchestrator","MCP","cli","memory","orchestration","workflows","multi-agent","parallel","subagents","agent orchestrator","parallel execution","coordinates","agent workflows","progress","via","multi","for",{"skillNo":221,"name":222,"nameZh":17,"description":223,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":224,"categories":225,"keywords":226,"publishedAt":40},"01M6WJXXDQ99RCQ3S4GW5D42Q4","oma-explainer","Turn a code change (diff, PR, branch, commit range) into a rich, self-contained interactive HTML explainer with Background \u002F Intuition \u002F Code \u002F Quiz sections. Use for explain, walkthrough, code-change explanation, diff\u002FPR\u002Fbranch explainer requests — 설명서, 해설, コード解説, 代码讲解. Produces a single offline-capable HTML file with diagrams, callouts, and an accessible quiz.","https:\u002F\u002Fgithub.com\u002Fmrmarbury\u002FPalmSync4Mac\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Foma-explanation\u002FSKILL.md",[],[227,228,229,230,231,36,232,233,234,235,236,159,237,238,239,240,241,219,242,243],"explainer","oma explainer","change","commit","pr","offline","file","walkthrough","branch","interactive","html","diff","diagrams","self","quiz","rich","single",{"skillNo":245,"name":246,"nameZh":17,"description":247,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":248,"categories":249,"keywords":250,"publishedAt":40},"01M6WJWQC0CTFQWQKQ2EZYXVGJ","oma-academic-writer","Academic writing specialist for publication-grade English prose. Drafts, revises, and audits essays, reports, analysis sections, executive summaries, conclusions, and literature reviews while enforcing sentence-structure variation, high-frequency academic verbs, calibrated hedging, and anti-AI stylistic compliance. USE for academic writing, essay polish, paragraph rewrite, prose revision against any rubric tier (HD\u002FD\u002FC, A\u002FB\u002FC, top-band\u002Fmid-band, etc.), anti-AI audit, reverse outlining, claim-evidence mapping, and rubric enforcement on assignments.","https:\u002F\u002Fgithub.com\u002Fmrmarbury\u002FPalmSync4Mac\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Foma-academic-writing\u002FSKILL.md",[],[251,252,253,254,255,256,257,258,259,260,261,190,262,263,264,265,266,267,268,269],"oma academic writer","writer","Academic","academic writer","writing","audit","analysis","polish","reports","ai audit","claim","Anti-AI","english","literature","essays","essay","reviews","drafts","top",{"skillNo":271,"name":272,"nameZh":273,"description":17,"descriptionZh":274,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":275,"categories":276,"keywords":283,"publishedAt":40},"01M6BYY6K38NQSE2BXHWM0ZGRC","work","工作任务处理","","https:\u002F\u002Fgithub.com\u002Fmrmarbury\u002FPalmSync4Mac\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fwork\u002FSKILL.md",[277,280],{"categoryNo":278,"categoryName":279,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BS5011KJDVSRXG1DC4P666","普通用户",{"categoryNo":281,"categoryName":282,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BTBRTQXJ9T5TABNS7XP1A0","任务规划与分解",[272]]