Agent Optimizer logo

Agent Optimizer

Community
chujianyun
agent-optimizer

Agent 设计顾问与审查工具。基于 12-Factor AgentOps 最佳实践,用于:(1) 探讨 Agent 架构设计方案;(2) 审查现有 Agent/Skill/工作流的设计,发现问题,给出改进建议。触发词:审查我的 agent、帮我分析这个 skill、agent 设计、agent 优化、帮我 review 这个工作流、这个 agent 有什么问题、怎么设计 agent、agent 架构咨询。

Overview

Publisherchujianyun
Repositoryskills
Skill nameagent-optimizer
Stars
743
Forks
103
Bundled files
10
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.

  • 10 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

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

Installation

Install the Agent Optimizer 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/chujianyun/skills/tree/main/skills/agent-optimizer
  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/chujianyun/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/agent-optimizer .claude/skills/agent-optimizer
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Agent Optimizer 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 Agent Optimizer 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 Agent Optimizer 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.

Agent Optimizer

基于 12-Factor AgentOps 框架,提供 Agent 设计咨询和现有 Agent/Skill 的问题审查与优化建议。

核心框架:12-Factor AgentOps

原文来源:https://www.12factoragentops.com
中文翻译参考:~/Documents/working/translations/12-factor-agentops/

12 个因素分三层:

基础层(I–III):单 Agent 可靠性

  • I. 上下文即一切 — 精确管理 context window,按阶段加载,主动压缩
  • II. 用 Git 追踪一切 — issues/learnings/handoffs 全部放 Git,不依赖外部平台
  • III. 一个 Agent 一个任务 — 每次任务用全新 context,禁止复用饱和窗口

质量层(IV–VI):确保工作质量

  • IV. 构建前先调研 — 任何实现前必须有独立调研阶段,产出调研文档
  • V. 外部验证 — Agent 不给自己打分,验证必须来自外部(不同 Agent/模型/测试/人工)
  • VI. 锁定前进的进度 — 通过验证的工作不可回退,形成棘轮效应

学习层(VII–IX):从经验复利

  • VII. 提取经验教训 — 每次会话产出两个成果:工作产物 + 经验教训文档
  • VIII. 知识复利 — 知识必须自动回流:提取→过滤→存储→注入→引用→衰减
  • IX. 衡量重要的事 — 追踪目标达成度,而非活动指标;休眠即成功

规模层(X–XII):多 Agent 工作流

  • X. 隔离工作单元 — 每个 Worker 独立 worktree + 独立 context,零共享可变状态
  • XI. 层级化监督 — 升级流向上传递,不横向流转;工作节点快速失败
  • XII. 从失败中收获智慧 — 失败尝试与成功同等严格地提取和索引

详细说明见 references/ 目录下各因素的参考文档。


工作模式

模式一:设计咨询

用户提出 Agent 设计问题时:

  1. 弄清楚用户的目标和约束(单 Agent 还是多 Agent?是否已有工作流?)
  2. 对照 12 个因素,给出具体设计建议
  3. 按层次推进:先基础层够用再考虑规模层
  4. 提供具体的结构示例(文件结构、Prompt 设计、交接格式等)

常见设计问题清单(引导对话用):

  • context 是一直堆还是按阶段清理?
  • 有没有独立的调研阶段产出调研文档?
  • 验证是由执行者本身完成的吗?
  • 知识/教训有没有写回去并能被下次会话检索到?
  • 多 Agent 时有没有共享目录或共享 context?

模式二:设计审查

用户提交现有 Agent/Skill/工作流时:

  1. 先让用户描述(或直接读取)设计内容
  2. 按 12 因素逐条扫描,标注违反的因素
  3. 输出审查报告(格式见下)
  4. 按严重程度排序,优先指出影响最大的问题

审查报告格式:

## Agent 审查报告

### 总体评分
[对照 12 因素的覆盖情况,给出健康度评估]

### 发现的问题

#### 🔴 严重问题(会直接导致失败或错误)
- [问题描述] → 违反因素:[X]
  改进建议:[具体怎么做]

#### 🟡 改进项(影响质量或效率)
- [问题描述] → 违反因素:[X]
  改进建议:[具体怎么做]

#### 🟢 做得好的地方
- [值得保留的设计]

### 优先改进计划
1. [最重要的改进,一句话]
2. [次重要的改进,一句话]
3. [...]

常见反模式速查

遇到以下关键词,直接联想对应因素:

关键词可能违反的因素快速诊断问题
"一个会话做了很多事"IIIcontext 饱和,任务边界不清
"让 Agent 自己检查自己"V自我验证 = 确认偏误
"所有东西都塞进 system prompt"Icontext 预算失控
"没有调研直接写代码"IV缺少调研阶段
"用了 Notion/Confluence 存经验"II、VIII知识孤岛,Agent 无法检索
"多个 Agent 共享一个目录"X竞态条件风险
"Agent 一直重试不升级"XI缺少监督层级
"只统计 token 用量/会话数"IX虚荣指标,没看结果
"失败就丢弃,下次重来"XII没有提取失败智慧
"用完的知识不更新不删"VIII知识衰减导致误导

参考文档

详细的因素说明存放在 references/ 目录,按需加载:

  • references/factor-1-context.md — 上下文管理详解
  • references/factor-2-git.md — Git 追踪模式
  • references/factor-3-one-task.md — 任务隔离与交接
  • references/factor-4-research.md — 调研阶段设计
  • references/factor-5-validation.md — 外部验证体系
  • references/factor-6-ratchet.md — 棘轮进度锁定
  • references/factor-7-learnings.md — 经验提取格式
  • references/factor-8-compound.md — 知识复利飞轮
  • references/factor-9-metrics.md — 适应性指标
  • references/factor-10-isolation.md — 工作单元隔离
  • references/factor-11-supervision.md — 层级化监督
  • references/factor-12-failures.md — 失败智慧收获

遇到用户提到某具体因素相关的问题时,读对应的 reference 文件以获取详细内容。

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Agent Optimizer AI skill do?

Agent 设计顾问与审查工具。基于 12-Factor AgentOps 最佳实践,用于:(1) 探讨 Agent 架构设计方案;(2) 审查现有 Agent/Skill/工作流的设计,发现问题,给出改进建议。触发词:审查我的 agent、帮我分析这个 skill、agent 设计、agent 优化、帮我 review 这个工作流、这个 agent 有什么问题、怎么设计 agent、agent 架构咨询。

Why use Agent Optimizer on TypingMind?

Because you install it once and use it with any model. Agent Optimizer 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 Agent Optimizer in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/chujianyun/skills/tree/main/skills/agent-optimizer. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Agent Optimizer?

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 Agent Optimizer?

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

Is the Agent Optimizer AI skill free?

It is published on GitHub by chujianyun. Check the repository for licensing terms. 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 👇