Optimize logo

Optimize

Community
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.

Overview

Publisherhegemonart
Repositoryget-design-done
Skill nameoptimize
Stars
3
Forks
1
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by hegemonart on GitHub. Read the source before you install it.

Installation

Install the Optimize AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/hegemonart/get-design-done/tree/main/scripts/skill-templates/optimize
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

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
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Optimize in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Optimize on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Optimize is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

{{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.

Frequently asked questions

What does the Optimize AI skill do?

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.

Why use Optimize on TypingMind?

Because you install it once and use it with any model. Optimize is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Optimize in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/hegemonart/get-design-done/tree/main/scripts/skill-templates/optimize. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Optimize?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Optimize?

As many as you like. As long as a model supports skills, you can use Optimize with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Optimize AI skill free?

Yes. It is published on GitHub by hegemonart under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇