EngramGraph: Skill for Claude Code

.agents/skills/refactoring-assistant/SKILL.md

refactor is a skill for Claude Code from AsiaOstrich/EngramGraph. It costs 108 tokens per session (1,127 once invoked), scanned A, original, MIT.

A guide for changing existing code without changing its intended behavior. It helps choose between refactoring and rewriting, then provides step-by-step approaches for everyday, architectural, legacy-code, and technical-debt work.

In plain words
What is it for?
Use it to assess technical debt, plan tactical or architectural refactors, work safely in legacy code, or apply patterns such as gradually replacing an old system.
Why use it?
It gives structure to risky code changes and helps teams choose a safer approach instead of making broad changes without a plan.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: installed under .agents/ (shared by several agents).

This is AsiaOstrich/EngramGraph's own configuration. It tells Claude Code how to work on EngramGraph itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything EngramGraph configures →

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is 完整的 AI 行為定義請參閱對應的命令文件:[`/refactor`](../commands/refactor.md#ai-agent-behavior--ai-代理行為).

Reuse

Borrowing it

Nothing to install: this file belongs to AsiaOstrich/EngramGraph. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/AsiaOstrich/EngramGraph/main/.agents/skills/refactoring-assistant/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/AsiaOstrich/EngramGraph

Made for: Claude Code.

Wrote 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.

agentmods badge for refactor

README.md
[![agentmods](https://agentmods.dev/badge/skills/asiaostrich/engramgraph/refactoring-assistant/github.svg)](https://agentmods.dev/skills/asiaostrich/engramgraph/refactoring-assistant)
Your own site
<a href="https://agentmods.dev/skills/asiaostrich/engramgraph/refactoring-assistant"><img src="https://agentmods.dev/badge/skills/asiaostrich/engramgraph/refactoring-assistant/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.

agentmods 80×15 button for refactor

Your own site · 80×15
<a href="https://agentmods.dev/skills/asiaostrich/engramgraph/refactoring-assistant"><img src="https://agentmods.dev/badge/skills/asiaostrich/engramgraph/refactoring-assistant.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 108 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,127 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00108 $0.01127
Opus 5.5 $0.00043 $0.00451
Sonnet 5.5 $0.00022 $0.00225
Haiku 4.5 $0.00011 $0.00113

Measured 14d ago against content hash 813ccbd7be26, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

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 14d 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.

.agents/skills/refactoring-assistant/SKILL.md · 99 lines

How it starts

The opening of the file, as written. The whole thing — 99 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Refactoring Assistant | 重構助手

Guide refactoring decisions, recommend strategies, and provide step-by-step execution workflows.

引導重構決策、推薦策略,並提供逐步執行工作流程。

Usage | 使用方式

Command Purpose 用途
/refactor Start interactive refactoring guide 啟動互動式重構引導
/refactor decide Run refactor vs. rewrite decision tree 執行重構 vs 重寫決策樹
/refactor tactical Suggest tactical (daily) strategies 建議戰術性(日常)策略
/refactor strategic Guide strategic/architectural refactoring 引導戰略性/架構重構
/refactor legacy Legacy code safety strategies 遺留程式碼安全策略
/refactor debt Technical debt assessment 技術債評估

Strategy Quick Reference | 策略快速參考

Tactical Strategies (Daily) | 戰術性策略

Strategy When to Use 使用時機
Preparatory Refactoring Before adding a blocked feature 新增被阻擋的功能之前
Boy Scout Rule During any maintenance work 任何維護工作中
Red-Green-Refactor TDD development cycle TDD 開發循環

Strategic Strategies (Architectural) | 戰略性策略

Strategy When to Use 使用時機
Strangler Fig Replacing entire system gradually 逐步替換整個系統
Anti-Corruption Layer Integrating with legacy system 與遺留系統整合
Branch by Abstraction Shared code refactoring on trunk 在主幹上重構共享程式碼

Safety Strategies (Legacy) | 安全防護策略

Strategy When to Use 使用時機
Characterization Tests Before any legacy refactoring 任何遺留程式碼重構之前
Scratch Refactoring Understanding black-box code 理解黑盒程式碼
Finding Seams Injecting test doubles into legacy 在遺留程式碼中注入測試替身

Workflow | 工作流程

  1. Assess - Identify code to refactor, evaluate test coverage
  2. Decide - Run decision tree (refactor vs. rewrite) if needed
  3. Select strategy - Choose appropriate strategy based on scope and risk
  4. Execute - Follow step-by-step workflow with safety checks
  5. Verify - Run tests to confirm behavior is preserved

Read the full file on GitHub · 99 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

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.

  1. 14d ago First seen · 99 lines · 108 tokens per session scan A 813ccbd7be26

Subscribe to this mod's changes

refactor is a skill published in the GitHub repository AsiaOstrich/EngramGraph (3 stars, last pushed today), licensed MIT. It adds 108 tokens to every session and 1,127 once invoked, about $0.0004 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-10-16.

Related

Other skills, from other repositories

code-graph

This skill should be used when understanding code structure, finding dependencies between functions/classes, tracing call graphs, or exploring code relationships. Trigger phrases include 'code graph', 'call graph', 'who calls', 'what calls', 'find dependencies', 'code structure', 'inheritance', 'find paths'.

FalkorDB/code-graph · 64 tokens

usage

Query LeanKG knowledge graph for code understanding. Use when exploring a codebase, finding functions, tracing dependencies, or calculating impact radius.

FreePeak/LeanKG · 27 tokens

kivgraph

Use Kivgraph's local MCP server to search symbols, read their source, and follow references, dependencies, cross-repository consumers and graph status in the indexed code graph.

Luqueee/kivgraph · 39 tokens

mushroom

Live graph memory for agents — query and create entities, derive relationships by rule, explain why two things are associated, read the graph at a past commit, ask what a change would do, and answer as one role. Trigger on: memory, remember, recall, relationship, entity, association, why are X and Y related, as of…

MatthewSherlin/mushroomdb · 0 tokens

potpie-cli

Use when the task is centered on running, explaining, configuring, or troubleshooting the potpie command: doctor, login, pot management, source registration, resolve/search/record, graph workbench reads/writes, resource (document payload) commands, and pot scope behavior.

potpie-ai/potpie · 60 tokens

potpie-debug-memory

Use while debugging or troubleshooting failures, flaky tests, incidents, production alerts, CI failures, local dev setup issues, repeated bugs, prior fixes, failed attempts, and verification history.

potpie-ai/potpie · 41 tokens