agentleFS
morodomimorodomi/dev-crew/skills/refactor/SKILL.md

refactor

Skill1 starsChanged 27 days agoMITView on GitHub

refactorフェーズを実行し、チェックリスト駆動でコード品質改善を行う。Verification Gateで品質確認。GREENの次フェーズ。「リファクタして」「refactor」で起動。

196 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use ascii-diagram, debug-fix and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • SethGammonSkill

    ascii-diagram

    Generate perfectly aligned ASCII diagrams — architecture, flow, sequence, box-and-arrow. Uses a programmatic character-grid approach so alignment is guaranteed by math, not token prediction. Includes post-render verification.

    Also in 4 projects that use this

  • zebbernSkill

    debug-fix

    Find and fix a bug or issue — from any source (GitHub issue, error message, user report, or observed behavior)

    Also in 4 projects that use this

  • parcadeiSkill

    agent-context-isolation

    Agent Context Isolation

    Also in 3 projects that use this

  • parcadeiSkill

    agentica-infrastructure

    Reference guide for Agentica multi-agent infrastructure APIs

    Also in 3 projects that use this

  • +8 more from parcadei

The file

Files
SKILL.md

Naming

  • Skill: refactor (lowercase)
  • Phase: REFACTOR (uppercase)

禁止事項

  • テストを壊す変更
  • 新機能の追加(次のサイクルで)
  • テストの削除・変更

Workflow

Cycle Doc Gate

for f in docs/cycles/*.md; do [ -f "$f" ] || continue; fm=$(awk '/^---$/{c++;next} c==1{print}' "$f"); echo "$fm" | grep -q '^phase:' || continue; echo "$fm" | grep -q 'phase: DONE' && continue; printf '%s\t%s\n' "$(echo "$fm" | awk 'sub(/^updated: */,""){gsub(/T/," ");print;exit}')" "$f"; done | sort | tail -1 | cut -f2 → found: continue / not found: BLOCK(run spec)

Cycle doc を読み、これまでの成果を把握する。

Step 2: テスト確認

全テストがPASSすることを確認してから開始。

Step 3: チェックリスト駆動リファクタリング

今回のサイクルで変更・作成したファイルを対象に、以下のチェックリストを順に確認する。 1改善→テスト実行→次改善 のインクリメンタルアプローチで進める。

#項目確認観点
1重複コード同一・類似ロジックの共通化 (DRY)
2定数化マジックナンバー・マジックストリングの定数抽出
3未使用import不要なimport/require/useの削除
4let→const再代入のないletをconstに変更
5メソッド分割長いメソッドの責務分割
6N+1クエリループ内のDB/APIクエリを一括取得に変換
7命名一貫性プロジェクト規約に沿った命名統一

各項目で改善が不要なら次へ進む。全項目確認後、Verification Gate に進むこと。

Verification Gate

Tests PASS + lint 0 + format OK → PASS(→REVIEW) | fail → fix & retry

Cycle doc更新

Progress Log追記(### {date} - REFACTOR\n- {summary}\n- Phase completed) + frontmatter更新(phase/updated)

完了

Output: REFACTOR完了。次: orchestrate→自動REVIEW / 手動→ /review

Codex Execution

チェックリスト駆動のため Claude/Codex どちらでも実行可能(cross-tool compatible)。

Reference

  • 詳細: reference.md

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.