---
model_tier: medium
name: optimize
disable-model-invocation: true
pack: meta
intent: "Optimization dispatcher — skills, rtk, augmentignore, agents-dir"
routes_to: [optimize-skills, optimize-rtk, optimize-augmentignore, optimize-agents-dir]
replaces: []
tier: 1
description: Optimize orchestrator — routes to skills, agents-dir, augmentignore, rtk-filters
cluster: optimize
type: orchestrator
suggestion:
  eligible: true
  trigger_description: "optimize my skills, manage agents directory, tune augmentignore, optimize rtk filters"
  trigger_context: "maintainer auditing or trimming the agent layer (NOT AGENTS.md — that's /agents)"
workspaces:
  - agent-config-maintainer
packs:
  - meta
---

# /optimize

Top-level orchestrator for the `/optimize` family.

> Looking for `AGENTS.md` operations (init, refactor, audit)? Those
> live under [`/agents`](agents.md) (`init / optimize / audit`).

## Sub-commands

| Sub-command | Routes to | Purpose |
|---|---|---|
| `/optimize skills` | `commands/optimize/skills.md` | Audit skills — measure baseline, find duplicates, run linter |
| `/optimize agents-dir` | `commands/optimize/agents-dir.md` | Manage the `agents/` directory — `--scaffold` / `--audit` / `--fix` (interactive wizard if no flag) |
| `/optimize augmentignore` | `commands/optimize/augmentignore.md` | Create or refine `.augmentignore` based on actual stack |
| `/optimize rtk` | `commands/optimize/rtk.md` | Create or refine project-local rtk filters |

Sub-command names match the locked contract in
[`docs/contracts/command-clusters.md`](../../docs/contracts/command-clusters.md).

## Dispatch

1. Parse the user's argument: `/optimize <sub-command> [args]`.
2. Look up the sub-command in the table above.
3. Load the body of the corresponding `commands/optimize/<sub>.md` file and
   follow its `## Steps` (or `## Instructions`) section verbatim.
4. If the sub-command is unknown or missing, print the menu and ask:

   > 1. skills — audit skills (find duplicates, run linter)
   > 2. agents-dir — scaffold / audit / fix the `agents/` tree
   > 3. augmentignore — create or refine `.augmentignore`
   > 4. rtk — create or refine project-local rtk filters

## Rules

- **Suggest only — never auto-apply.** All `/optimize` sub-commands are
  audit-grade: they report and propose, but the user approves every change.
- **Do NOT chain sub-commands.** One `/optimize <sub>` per turn.
- If the user invokes `/optimize` with no argument, **show the menu** — do
  not guess which sub-command they meant.
