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

refactor

Skill1 starsChanged 55 days agoMITView on GitHub

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

111 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use modern-go, to-design 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.
  • jidechaoSkill

    modern-go

    Modernize Go code by applying version-appropriate idioms and APIs (gofix-style transformations). Scans go.mod for the Go version, then transforms Go source files to use modern patterns—from Go 1.0 through 1.26+. Use when the user says "现代化","现代Go语言", "地道的", "idiomatic", "modernize", "modern-go", "update Go code", "gofix", or wants to upgrade Go idioms.

    Also in 3 projects that use this

  • jidechaoSkill

    to-design

    Generate a design document (design proposal) from a PRD, in the style of Go's official design proposals — Abstract / Background / Design / Rationale / Compatibility / Implementation, heavy on the 'why' and tradeoffs. Triggers on: to-design, prd-to-design, prd转设计文档, 生成设计文档, 写设计文档, design doc, design proposal, 设计提案, 技术设计文档.

    Also in 3 projects that use this

  • chidekinaSkill

    test-gen

    Generate test cases from type constraints and specs. Creates boundary tests, edge cases, and fixtures automatically. Pact-lang inspired. Triggers on: generate tests, test from spec, create fixtures, boundary tests.

    Also in 5 projects that use this

  • pvnarpSkill

    incident

    Guides incident response and post-mortem analysis. Covers triage, mitigation, root cause analysis, and prevention. Use when responding to active incidents, writing post-mortems, or improving incident processes.

    Also in 6 projects that use this

  • platformplatformSkill

    db-query

    Query the local Postgres database of the active Aspire worktree via psql.

    Also in 3 projects that use this

  • JetBrainsSkill

    fix-bug

    End-to-end bug fix workflow for the Exposed project. Accepts a GitHub issue (#NUMBER), YouTrack issue (EXPOSED-NUMBER), or YouTrack URL (https://youtrack.jetbrains.com/issue/EXPOSED-NUMBER). Fetches the issue, creates a failing reproducer test, commits on a new branch, implements the fix, validates, and opens a PR. Use this skill whenever the user wants to fix a bug from an issue tracker, mentions a EXPOSED issue number, or references a GitHub issue to fix.

    Also in 6 projects that use this

  • +2 more from jidechao

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.