{
  "markdown": "# prompt-brain\n\nA Claude Code plugin for working with prompts. **optimize-prompt** analyzes weaknesses, applies best practices, and reconstructs a prompt from scratch with a detailed changelog. **migrate-prompt** takes a prompt tuned for one model and re-tunes it for another, using per-model guides, and explains every change as a model-A → model-B changelog.\n\n## Installation\n\n```bash\n# Recommended: add the marketplace, then install\nclaude plugin marketplace add tarekst/prompt-brain\nclaude plugin install prompt-brain@tarek-plugins\n```\n\nOr from inside Claude Code:\n\n```\n/plugin marketplace add tarekst/prompt-brain\n/plugin install prompt-brain@tarek-plugins\n```\n\nFor local development:\n\n```bash\n# Load from a local checkout (run from the repo root)\nclaude --plugin-dir .\n```\n\n## Usage\n\n```\n/prompt-brain:optimize-prompt [your prompt to optimize]\n```\n\nPaste your prompt after the command. The plugin will:\n1. Parse the prompt's intent and structure\n2. Analyze it against 7 weakness categories\n3. Match best practices for the prompt type\n4. Reconstruct it from scratch\n5. Generate a changelog explaining every change\n\n### Example\n\n```\n/prompt-brain:optimize-prompt Analyze the codebase and create a migration plan for the new API\n```\n\nOutput: An optimized prompt with proper phases, output specifications, constraints, and success criteria -- plus a changelog explaining what was improved and why.\n\n### Migrating a prompt between models\n\n```\n/prompt-brain:migrate-prompt [current-model] [target-model] [prompt to migrate]\n```\n\nThe first two tokens are the source and target models; everything after is the prompt. The\nplugin resolves each model against its registry (canonical id or alias), reads **only** the\ntwo matching model guides, then rewrites the prompt so it is idiomatic for the target model --\nremoving source-specific accommodations (e.g. `budget_tokens`, forced step-by-step, model\ncontrol tokens) and applying the target's conventions. Output: the migrated prompt plus a\nmigration changelog.\n\n```\n/prompt-brain:migrate-prompt deepseek-r1 claude-opus-4-8 <your R1-tuned prompt>\n```\n\nSupported models (29 guides) include Claude (Opus 5, Sonnet 5, Fable 5, Haiku 4.5, Opus 4.8,\nSonnet 4.6), OpenAI (GPT-5.6 Sol/Terra, GPT-5, GPT-5 mini, o3, GPT-4.1), Google (Gemini 3.7\nFlash, Gemini 3.1 Pro, Gemini 2.5 Pro/Flash, Gemma 3), xAI (Grok 4.6, 4.3, 4), Mistral (Large\n3, Large 2), DeepSeek (V4-Flash, V4-Pro, R1, V3), and Meta (Muse Glimmer 30B, Llama 4\nMaverick/Scout). Each lives as a guide in\n[`skills/migrate-prompt/model-guides/`](skills/migrate-prompt/model-guides/); pass an unknown\nmodel and the command lists what is available instead of guessing. Guide bodies are in German\nand cite official vendor docs.\n\nBare family aliases (`opus`, `sonnet`, `mistral-large`) always resolve to the newest guide of\nthat family; version-pinned aliases (`opus-4.8`, `grok-4-latest`) stay on their own. Superseded\nmodels carry `status: legacy` — plus a `successor` wherever the vendor documents one — and the\nmigration changelog ends with a `Guide-Stand`\nfooter listing both guides' `last_verified` dates — with a staleness warning when a guide is\nolder than six months, and a successor hint when you migrate *to* a legacy model.\n\n## How It Works\n\nThe optimization follows a 5-step algorithm:\n\n| Step | What happens |\n|------|-------------|\n| 1. Parse & Intent Extraction | Decomposes the prompt into 6 dimensions: goal, phases, scope, agent pattern, expected outputs, implicit assumptions |\n| 2. Weakness Analysis | Checks against 7 categories: context, output spec, sequencing, guardrails, success criteria, efficiency, subagent instructions |\n| 3. Best-Practice Matching | Classifies prompt type and selects applicable patterns |\n| 4. Prompt Reconstruction | Rebuilds from scratch with top-down structure and measurable criteria |\n| 5. Changelog Generation | Explains every change as a what->why pair |\n\nBoth skills run on Claude Opus 5 and adapt their depth to the session's effort level\n(`low`/`medium` run a condensed pass; `high`+ runs the full algorithm). See\n[`skills/optimize-prompt/examples.md`](skills/optimize-prompt/examples.md) and\n[`skills/migrate-prompt/examples.md`](skills/migrate-prompt/examples.md) for worked examples,\nand [`evals/`](evals/) for the test scenarios of both skills.\n\n## Compatibility\n\nBoth skills use the [Agent Skills open standard](https://agentskills.io) fields `name`,\n`description`, `license` and `compatibility`, alongside five Claude Code keys that sit outside\nthe spec. Hosts that ignore unknown frontmatter keys (OpenCode, Grok Build) therefore load the\n`SKILL.md` files as-is; hosts that reject them (claude.ai upload, the Skills API) do not take\nthem without a stripped copy. Two Claude Code features the skills build on are specific to it:\nthe `$ARGUMENTS` and `${CLAUDE_EFFORT}`\n[string substitutions](https://code.claude.com/docs/en/skills#available-string-substitutions).\n\n| Host | How to install | What works | What does not |\n|------|----------------|------------|---------------|\n| Claude Code | `/plugin marketplace add tarekst/prompt-brain` | Everything | -- |\n| [OpenCode](https://opencode.ai/docs/skills/) | Copy or symlink `skills/optimize-prompt/` and `skills/migrate-prompt/` into `.claude/skills/` or `.opencode/skills/` -- it reads both | Skill body and lazy guide loading; unknown frontmatter keys are ignored, not errors | Does not install the plugin (no `.claude-plugin/` marketplace support); does not substitute `$ARGUMENTS` or `${CLAUDE_EFFORT}` |\n| [Grok Build](https://docs.x.ai/build/features/skills-plugins-marketplaces) | Copy the skill directories into `.grok/skills/` or `~/.grok/skills/` | Honors `when-to-use`, `argument-hint`, `user-invocable`, `disable-model-invocation` | Accepts but ignores `model`, `effort`, `license`, `compatibility` |\n| claude.ai upload / Skills API | Not shipped -- would need a stripped copy of each skill | Only the six [spec fields](https://agentskills.io/specification) are accepted | The Claude Code-only keys are a [hard error](https://code.claude.com/docs/en/skills#using-skill-frontmatter-outside-claude-code), not ignored, so the skills do not upload as-is |\n\n**Known limitation:** OpenCode documents no argument substitution for skills, so there you state\nthe two models and the prompt in your message instead of as slash-command arguments. Grok Build\ndocuments `argument-hint` support but says nothing about substitution either way, so treat that\nas untested. Wherever `${CLAUDE_EFFORT}` is not substituted, the skills detect this and fall back\nto full depth, which is built in.\n\nNote that adding an `AGENTS.md` to a project makes OpenCode stop reading `CLAUDE.md` -- only the\n[first match per category](https://opencode.ai/docs/rules/) wins -- so this repo deliberately\nships no `AGENTS.md`.\n\n## License\n\nMIT\n",
  "bytes": 6827,
  "sha": "2e12e14e1c8d7b3e5a80786cd8e0039f44efc587d885429c81184f8769df2675",
  "repo_slug": "tarekst/prompt-brain",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_tarekst_prompt_brain_prompt_brain_704fd368/readme"
}