refine-plan

A planning command for making small, targeted changes to existing code, documentation, or configuration files.

In plain words
What is it for?
Use it to gather requirements, investigate affected files, and create a plan file that the refine-execute command can follow.
Why use it?
It identifies the right files and checks related code, tests, documentation, and settings before any edits are made.

Command

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.

agentmods
npx agentmods add commands/classmethod/tsumiki/refine-plan
Clone the repo
git clone --depth 1 https://github.com/classmethod/tsumiki
Per session 63 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,991 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00063 $0.01991
Opus 5 $0.00032 $0.00996
Sonnet 5 $0.00013 $0.00398
Haiku 4.5 $0.00006 $0.00199

Measured 2d ago against content hash 57e370486f7a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

refine-plan 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 2d 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.

commands/refine-plan.md · 191 lines

How it starts

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

既存の実装・ドキュメントに対する小規模な修正計画を立てます。対象ファイルの調査・影響範囲の確認を行い、refine-executeで参照するplanファイルを出力します。

context

出力ディレクトリ=".dcs" カレントディレクトリ={{プロジェクトルート}} 修正概要="" 修正種別="" 対象ファイルリスト=[] 影響ファイルリスト=[] timestamp=""

steps

  • $1 がある場合、その内容を 修正概要 に設定して簡潔に説明する
  • step1 を実行する

step1: 情報収集

  • AskUserQuestion ツールを使って以下を確認し、context を更新する:
    1. 修正の種別を確認(コード / ドキュメント / 設定ファイル)
    2. 修正内容の詳細を確認(修正概要が空の場合は必ず確認)
    3. 対象ファイルが判明しているかを確認
  • 収集した内容をまとめてユーザーに宣言する
  • step2 を実行する

step2: 対象ファイルの調査

  • 対象ファイルが指定されている場合: Read で内容を確認し、修正箇所・行番号を特定する
  • 対象ファイルが不明の場合: Glob と Grep を使ってキーワード検索で候補を特定する
    • 複数の候補が見つかった場合は AskUserQuestion でユーザーに絞り込みを確認する
  • 対象ファイルリストを確定する
  • step3 を実行する

step3: 影響範囲の調査

  • 対象ファイルリストの各ファイルについて以下を調査する:
    • そのファイルを import / require / 参照しているファイルを Grep で検索
    • 関連するテストファイルを Glob で検索(例: *.test.*, *.spec.*, __tests__/ 等)
    • ドキュメントや設定ファイルへの影響を確認
  • 影響ファイルリストを確定する
  • step4 を実行する

step4: planファイルの作成

  • 出力先ディレクトリを決定する:
    • timestamp を現在時刻(yyyyMMddHHmmss 形式)で生成する
    • 修正内容を簡潔な英語に変換する(スネークケース、最大30文字)
    • ベースディレクトリ = "{{出力ディレクトリ}}/{{timestamp}}refine{{英語化した修正名}}"
    • 例: ".dcs/20260224143022_refine_user_auth_fix"
    • 同じ timestamp と名前のディレクトリが存在する場合は末尾の連番を +1 する
  • <plan_template> の内容を context の情報で埋めて Write ツールでファイルに出力する
    • 出力ファイル: "{{ベースディレクトリ}}/plan.md"
  • 出力したファイルのパスをユーザーに報告する
  • /tsumiki:refine-execute {{ベースディレクトリ}}/plan.md を実行すると修正を開始します」と案内する

rules

情報収集のルール

質問1: 修正種別

  • 質問: 修正の対象は何ですか?
  • header: "修正種別"
  • options:
    • "コード" - ソースコードファイルの修正
    • "ドキュメント" - Markdown、設計書等の修正
    • "設定ファイル" - JSON、YAML、TOML等の設定修正
    • "複合(コード+ドキュメント等)" - 複数種別にまたがる修正

質問2: 修正内容の詳細

  • 質問: どのような修正を行いたいですか?(具体的に教えてください)
  • header: "修正内容"
  • options:
    • "バグ修正" - 既存の動作上の問題を修正
    • "リファクタリング" - 動作は変えずにコード品質を改善
    • "誤字・記述修正" - テキストの誤りを修正
    • "仕様変更への対応" - 要件変更に合わせて既存実装を修正

質問3: 対象ファイルの有無

  • 質問: 修正対象のファイルはわかっていますか?
  • header: "対象ファイル"
  • options:
    • "はい(ファイルパスがわかる)" - ユーザーに具体的なパスを入力してもらう
    • "いいえ(キーワードから調査する)" - キーワードから自動調査する

ファイル名のルール

timestamp の形式

  • yyyyMMddHHmmss 形式(例: 20260224143022)

Read the full file on GitHub · 191 lines

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. 2d ago First seen · 191 lines · 63 tokens per session scan A 57e370486f7a

Subscribe to this mod's changes

refine-plan is a command published in the GitHub repository classmethod/tsumiki (974 stars, last pushed 25d ago), licensed MIT. It adds 63 tokens to every session and 1,991 once invoked, about $0.0003 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-08-30.