Borrowing it
Nothing to install: this file belongs to u9401066/med-paper-assistant. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/u9401066/med-paper-assistant/master/.claude/skills/code-refactor/SKILL.mdgit clone --depth 1 https://github.com/u9401066/med-paper-assistantWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/u9401066/med-paper-assistant/code-refactor)<a href="https://agentmods.dev/skills/u9401066/med-paper-assistant/code-refactor"><img src="https://agentmods.dev/badge/skills/u9401066/med-paper-assistant/code-refactor/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/u9401066/med-paper-assistant/code-refactor"><img src="https://agentmods.dev/badge/skills/u9401066/med-paper-assistant/code-refactor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00036 | $0.00718 |
| Opus 5.5 | $0.00014 | $0.00287 |
| Sonnet 5.5 | $0.00007 | $0.00144 |
| Haiku 4.5 | $0.00004 | $0.00072 |
Grade A, and why
code-refactor scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
程式碼重構技能
主動偵測並執行程式碼重構,維持 DDD 架構和程式碼品質。
觸發:「重構」「refactor」「太長了」「模組化」「拆分」,或偵測到超過閾值時主動觸發。
閾值設定
| 類型 | 警告 | 強制重構 |
|---|---|---|
| 檔案 | > 200 行 | > 400 行 |
| 類別 | > 150 行 | > 300 行 |
| 函數 | > 30 行 | > 50 行 |
| 目錄檔案數 | > 10 | > 15 |
| 圈複雜度 | > 10 | > 15 |
| 巢狀深度 | > 3 層 | > 4 層 |
| 參數數量 | > 4 | > 6 |
| 依賴數量 | > 5 | > 8 |
重構模式庫
| # | 模式 | 觸發條件 |
|---|---|---|
| 1 | Extract Method | 函數過長、重複邏輯 |
| 2 | Extract Class | 類別職責過多、>150 行 |
| 3 | Replace Conditional with Polymorphism | 大量 if-elif-else |
| 4 | Introduce Parameter Object | 參數 >4 個 |
| 5 | Split Module | 目錄 >10 檔案 → 按子領域拆分 |
DDD 架構守護
依賴方向:Presentation → Application → Domain ← Infrastructure
禁止:Domain 依賴 Infrastructure、Presentation 直接存取 Domain、Entity 包含持久化邏輯。
重構流程
- 偵測:報告檔案/函數/複雜度超標情況
- 分析:識別重複邏輯、隱藏 Value Object、職責分離點
- 規劃:列出重構步驟(新檔案、遷移、測試)
- 執行:逐步重構,每步確認測試通過
- 驗證:全部測試通過、覆蓋率、複雜度、DDD 合規
與其他 Skills 整合
| Skill | 整合 |
|---|---|
| code-reviewer | 審查時觸發重構建議 |
| test-generator | 重構前先生成測試 |
| ddd-architect | 確保重構符合 DDD |
| memory-updater | 記錄重構決策 |
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 67 lines · 36 tokens per session scan A 4f6a2343949d
code-refactor is a skill published in the GitHub repository u9401066/med-paper-assistant (12 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 36 tokens to every session and 718 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
systemic-issue-triage
Trigger: new issue, bug report, triage, backlog, issue flood, community report, root cause, dead-end, blocked user. Attack issues by root class, never one-by-one; fixes must shrink the system, not grow it.
issue-root-resolution
Trigger: root audit, atacar la raíz, issue roots, backlog roots, mechanism map, deletion-driven fix, resolver issues de raíz, close outdated issues. Audit and resolve issue clusters by verified root cause.
rdd-defect-workflow
Trigger: RDD, receipt-driven development, review authority, receipt/lineage, correction/recovery, delivery gate/kill switch, bounded review defects. Guide work.
nightly-audit-engineer-getting-started
A first-conversation guide for setting up a code-audit assistant. A code audit is a focused review of source code for defects or risky behavior, with the needed repository, scope, concerns, permissions, and schedule clarified first.
nightly-audit-engineer-ops
A workflow for reviewing code for reproducible quality problems and recording the evidence behind each finding. It follows data through inputs, permissions, storage, asynchronous work, and recovery, then suggests the smallest authorized fix.
nightly-audit-engineer-evidence
A small local checker that creates stable identifiers for code-audit findings and marks duplicates within the current batch or among previously seen findings. It processes supplied JSON with Python and does not infer whether a problem was fixed.