refactoring-packages

refactoring-packages is a skill for Claude Code, Codex from j5ik2o/okite-ai. It costs 156 tokens per session (1,133 once invoked), scanned A, original, MIT.

A refactoring workflow for reorganizing a codebase's packages and modules, which are folders or code units grouped by responsibility.

In plain words
What is it for?
Use it to analyze dependencies, propose a cleaner structure, split large modules, and plan a staged migration with tests and build checks.
Why use it?
It helps expose circular dependencies, oversized modules, mixed responsibilities, scattered features, and deeply nested structures that make changes harder.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to analyze dependencies, propose a cleaner structure, split large modules, and plan a staged migration with tests and build checks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/j5ik2o/okite-ai/refactoring-packages
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add j5ik2o/okite-ai --skill refactoring-packages
Clone the repo
git clone --depth 1 https://github.com/j5ik2o/okite-ai

Made for: Claude Code, Codex.

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 refactoring-packages

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/j5ik2o/okite-ai/refactoring-packages"><img src="https://agentmods.dev/badge/skills/j5ik2o/okite-ai/refactoring-packages.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 156 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,133 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.00156 $0.01133
Opus 5 $0.00078 $0.00566
Sonnet 5 $0.00031 $0.00227
Haiku 4.5 $0.00016 $0.00113

Measured 7d ago against content hash 3d0f495ce234, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

refactoring-packages 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 7d 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.

skills/refactoring-packages/SKILL.md · 120 lines

What it actually says

パッケージリファクタリング

既存コードのパッケージ/モジュール構造を分析し、改善提案と移行計画を作成・実行する。

ワークフロー

1. 現状分析 → 2. 問題特定 → 3. 改善提案 → 4. 移行計画

1. 現状分析

対象ディレクトリの構造を把握する。

使用ツール:

  • mcp__serena__list_dir: ディレクトリ構造の把握(recursive: true
  • mcp__serena__get_symbols_overview: ファイル内のシンボル把握
  • mcp__serena__find_referencing_symbols: 依存関係の検出

確認ポイント:

  • ディレクトリ深度(4階層以下が理想)
  • ファイル数/ディレクトリ(10以下が理想)
  • 命名規則の一貫性

2. 問題特定

references/analysis-patterns.mdを参照し問題を検出。

優先順位(高→低):

  1. 循環依存(ビルド不可の原因)
  2. 神モジュール(変更影響が大きい)
  3. 散在機能(開発効率低下)
  4. 過度なネスト(可読性低下)

3. 改善提案

問題ごとの解決策はreferences/analysis-patterns.mdを参照。

4. 移行計画

段階的な移行計画を作成:

### Phase 1: 準備
- [ ] テストカバレッジ確認
- [ ] 依存関係マップ作成

### Phase 2: 構造変更
- [ ] 新ディレクトリ作成
- [ ] ファイル移動
- [ ] インポートパス更新

### Phase 3: 検証
- [ ] テスト実行
- [ ] ビルド確認

具体例

入力

ユーザー: 「auth/モジュールが肥大化している」

分析

auth/
├── mod.rs (800行) ← 神モジュール検出
├── jwt.rs
├── oauth.rs
└── session.rs

問題: mod.rsに認証ロジック、ミドルウェア、エラー型が混在

出力

# パッケージ構造分析レポート

## 検出された問題
1. **神モジュール**: auth/mod.rs (800行、3責務)

## 改善提案
### 提案1: 責務分離
- Before: auth/mod.rs に全ロジック
- After:
  - auth/core.rs (認証ロジック)
  - auth/middleware.rs (ミドルウェア)
  - auth/error.rs (エラー型)
- 理由: 単一責任の原則適用、変更影響範囲の限定

## 移行計画
### Phase 1: 準備
- [ ] 既存テストの確認
### Phase 2: 分割
- [ ] auth/core.rs 作成、ロジック移動
- [ ] auth/middleware.rs 作成
- [ ] auth/error.rs 作成
- [ ] mod.rs を再エクスポートのみに
### Phase 3: 検証
- [ ] cargo test
- [ ] cargo clippy

関連スキル(併読推奨)

このスキルを使用する際は、以下のスキルも併せて参照すること:

  • package-design: リファクタリングの目標となるパッケージ設計原則
  • ddd-module-pattern: DDD文脈でのリファクタリング目標構造
  • intent-based-dedup: リファクタリング時の重複コード共通化判断
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. 7d ago First seen · 120 lines · 156 tokens per session scan A 3d0f495ce234

Subscribe to this mod's changes

refactoring-packages is a skill published in the GitHub repository j5ik2o/okite-ai (81 stars, last pushed 4mo ago), licensed MIT. It adds 156 tokens to every session and 1,133 once invoked, about $0.0008 per session on Opus 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-09-03.