Optimizeのロゴ

Optimize

コミュニティ
hegemonart
optimize

Reads .design/telemetry/costs.jsonl + .design/agent-metrics.json, runs rule-based analysis, writes .design/OPTIMIZE-RECOMMENDATIONS.md. Pure advisory - no auto-apply. User reviews + decides.

概要

公開者hegemonart
リポジトリget-design-done
スキル名optimize
スター
3
フォーク
1
同梱ファイル
指示のみ
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    hegemonartがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Optimize」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/hegemonart/get-design-done/tree/main/scripts/skill-templates/optimize
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/hegemonart/get-design-done.git /tmp/get-design-done
mkdir -p .claude/skills
cp -r /tmp/get-design-done/scripts/skill-templates/optimize .claude/skills/optimize
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでOptimizeを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にOptimizeを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Optimizeは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

{{command_prefix}}optimize - Optimization Advisor

Role

Read the telemetry ledger (.design/telemetry/costs.jsonl) and per-agent aggregate (.design/agent-metrics.json), apply a fixed set of rule-based heuristics, and emit recommendations to .design/OPTIMIZE-RECOMMENDATIONS.md. Never modify agent files, budget config, or cache state. Output is a markdown table of proposals the user reviews manually, mirroring Phase 11 {{command_prefix}}apply-reflections. Advisory only: never edits agents/*.md, .design/budget.json, .design/cache-manifest.json. Never makes model calls - every rule is deterministic. See ./reference/heuristics.md §"Optimization rules" for the full rule catalog.

Refresh Step

Before analysis, invoke the aggregator:

bash
node --experimental-strip-types scripts/aggregate-agent-metrics.ts

Idempotent. If --refresh absent and .design/agent-metrics.json generated within 60s, skip.

Inputs

  • .design/telemetry/costs.jsonl - append-only; tolerant of malformed lines.
  • .design/agent-metrics.json - per-agent aggregate; source of truth for cache_hit_rate, lazy_skip_rate, total_cost_usd, total_spawns.
  • agents/*.md - frontmatter cross-reference for tier override churn + typical-duration drift.
  • .design/budget.json - tier_overrides table (optional).

Optional Arguments

  • --refresh - force aggregator refresh even if metrics file is fresh.
  • --min-spawns=N - only emit recommendations for agents with ≥ N spawns (default 5).

Rules

Rule-based analysis. Full thresholds + emission templates in ./reference/heuristics.md §"Optimization rules"; here, the short rule catalog:

  • R1 - Low cache hit rate. IF total_spawns >= --min-spawns AND cache_hit_rate < 0.20 → propose batching + investigate shared-preamble ordering.
  • R2 - Expensive + rarely lazy-skipped. IF total_cost_usd > 0.50 AND lazy_skip_rate < 0.10 → propose adding a lazy gate at agents/{agent}-gate.md (Plan 10.1-04 pattern).
  • R3 - Tier override churn. IF measured tier differs from frontmatter default-tier for multiple rows → propose updating frontmatter or removing budget.json override.
  • R4 - Typical duration drift. IF measured typical_duration_seconds differs from frontmatter by > 50% → propose frontmatter update. (v1 only computes wall-clock duration if both spawn + complete rows have matching correlation IDs; otherwise flag "insufficient data".)

Output Format

Write .design/OPTIMIZE-RECOMMENDATIONS.md:

markdown
# Optimization Recommendations

**Generated:** {ISO-8601 timestamp}
**Telemetry rows analyzed:** {N}
**Agents analyzed:** {M}
**Min spawns threshold:** {--min-spawns value}

> Advisory only. No changes have been applied. Review each proposal and apply manually via the suggested action.

## Proposals

| Rule | Agent | Current | Proposed | Rationale |
|------|-------|---------|----------|-----------|
| R1 | ... | ... | ... | ... |

## Summary

- R1 matches: {count}
- R2 matches: {count}
- R3 matches: {count}
- R4 matches: {count}

## OPTIMIZE COMPLETE

The ## OPTIMIZE COMPLETE marker is the completion sentinel.

No Auto-Apply

This skill never modifies agents/*.md, .design/budget.json, .design/cache-manifest.json, or any other configuration. Never auto-applies proposals. If the user wants to act, they do so manually. Discipline mirrors {{command_prefix}}apply-reflections from Phase 11.

Integration with Phase 11 Reflector

The Phase 11 reflector (agents/design-reflector.md) reads both costs.jsonl and agent-metrics.json on its own cadence. {{command_prefix}}optimize is user-facing; the reflector is automation-facing. Outputs land in different files (.design/OPTIMIZE-RECOMMENDATIONS.md vs .design/reflections/*.md) and never collide.

Non-Goals

  • Does not make model calls (rule-based, deterministic).
  • Does not modify config.
  • Does not propose changes outside the four rules - future rules added by future phases.
  • Does not learn from history - Phase 11 reflector territory.

Failure Modes

  • Missing .design/telemetry/costs.jsonl → emit No telemetry data yet — run {{command_prefix}}* commands to accumulate data, then retry. + ## OPTIMIZE COMPLETE.
  • Missing .design/agent-metrics.json after refresh → emit Aggregator failed — check node --experimental-strip-types scripts/aggregate-agent-metrics.ts output manually.
  • Zero rules matched → write No recommendations — all agents within healthy thresholds. + ## OPTIMIZE COMPLETE.

よくある質問

AIスキル「Optimize」では何ができますか?

Reads .design/telemetry/costs.jsonl + .design/agent-metrics.json, runs rule-based analysis, writes .design/OPTIMIZE-RECOMMENDATIONS.md. Pure advisory - no auto-apply. User reviews + decides.

TypingMindでOptimizeを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Optimizeはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにOptimizeをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/hegemonart/get-design-done/tree/main/scripts/skill-templates/optimizeを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Optimizeを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Optimizeで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもOptimizeを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Optimize」は無料ですか?

はい。hegemonartがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇