Skip to content
Development
Command

/memory-optimize

Choose the cheapest context path across direct read, markdown conversion, graph build, graph update, or graph query.

From plugin
agent-powerups
854 skills46 agents54 commands
> /plugin marketplace add yeaight7/agent-powerups

Command definition

memory-optimize.md
name: memory-optimize
description: Choose the cheapest context path across direct read, markdown conversion, graph build, graph update, or graph query.
argument-hint: "[path-or-url] [question]"
allowed-tools:
  - Read
  - Bash
  - Glob
  - Grep

Objective

Recommend the cheapest memory workflow that preserves answer quality and future reuse.

Context

Inputs:

  • optional path or URL
  • optional question or task goal

Optimization targets:

  • lower token cost now
  • lower reread cost later
  • better persistence when repeated queries are likely

Process

1. Inspect input shape and reuse horizon:

  • plain text or small local file
  • noisy web page
  • PDF/Office doc or other hard-to-read binary-ish source
  • mixed corpus
  • existing graph with new question
  • existing graph with changed sources

2. Check requirements:

  • `apx check graphify`
  • `apx check markitdown-file-intake`
  • `apx check defuddle`

3. Recommend exactly one primary path:

  • direct read for small, simple, one-shot text
  • `defuddle` -> Markdown -> read or build when web chrome is the main problem
  • `markitdown-file-intake` -> Markdown -> read or build when document format is the main problem
  • `graphify` full build when repeated questions or relationship navigation justify persistent memory
  • `graphify --update` when a graph already exists and sources changed
  • graph query against existing graph when the graph exists and the task is retrieval, tracing, or explanation

4. State why that path is cheapest:

  • lower immediate token cost
  • lower repeated reread cost
  • better persistence across future sessions

5. Include exact next command(s) for the recommended path. 6. If a required tool for the best path is missing, either:

  • recommend the next-best lower-capability path that still preserves answer quality, or
  • stop and say the missing requirement makes the cheap path unavailable

Stop Conditions

  • input is too ambiguous to choose between direct read, helper conversion, build, update, or query
  • the recommended path depends on a missing tool and no credible fallback preserves answer quality
  • user asks for persistent graph advice but the target path or URL is unavailable

Rules

  • optimization target = lower token cost, lower reread cost, better persistence
  • `graphify` is long-lived memory path
  • helpers are normalization tools only
  • keep `graphify` primary for persistent memory, helpers secondary, Obsidian optional
  • do not recommend a graph build for trivial one-shot text when direct read is cheaper
  • do not claim a helper or graph path is available before requirement checks pass
  • do not claim bundled upstream code
Read more
@yeaight7
Ships withagent-powerups

Curated power-ups for coding agents: skills, slash commands, MCP configs, hooks, AGENTS.md templates, and workflows for serious software engineering. Claude Code, Codex, Antigravity CLI, Cursor and more

8114 skills46 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
8
Star history of yeaight7/agent-powerups on GitHub, a chart by star-history.com

Other commands on agent-powerups.

bug-check

bug-check

Command

Run automated tests and build checks first, then agent code review. For each bug found, propose or document a regression test.

build-fix

build-fix

Command

Use when a build, type check, or test suite is failing and needs to be unblocked with a minimal change.

More commands from other plugins.

build
Auto-invoked

build

Command

Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.

@addyosmani@addyosmaniInstall Command