reflect
它能做什么
这个技能回顾过去的工作会话,找出你重复进行的任务,然后提出最小但有用的改进。适合希望通过真实使用让 AI 设置不断改进的人员。
适用场景
- ✓你想从过去的会话中学习,找出你手动重复做的工作的时候。
- ✓某个工作流不断重复,可能值得做成可复用技能或操作手册的时候。
- ✓你想根据你的实际工作方式,获得配置或提示词修改建议的时候。
技能链接
https://github.com/alvinunreal/oh-my-opencode-slim/blob/master/src/skills/reflect/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请回顾我最近的会话,告诉我哪些重复任务应该做成可复用的技能。”
每周 5 个新技能,1 分钟读完。
工作原理
这个技能审阅近期的会话和笔记,寻找重复出现的摩擦,并推荐合适的改进。它也可能建议完全不做改动。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Reflect
Reflect is an orchestrator-only workflow for learning from repeated work. It looks back over recent sessions, project notes, and existing agent assets, then recommends the smallest useful improvement: a skill, custom agent, command, configuration change, prompt rule, documentation playbook, or no change.
The goal is to identify real repeated friction and suggest practical improvements with evidence.
Branch: lines marked [branch: --sessions] run only with that flag; plain /reflect skips Session Mode.
When to Use
Use Reflect when the user asks to:
- run
/reflector/reflect <focus>; - run
/reflect --sessionsfor session archaeology; - learn from recent sessions or repeated workflows;
- find work they keep doing manually;
- improve their oh-my-opencode-slim setup based on actual usage using oh-my-opencode-slim skill;
- review whether a recurring process should become a reusable playbook;
- turn repeated workflow friction into a safer future default.
Do not use Reflect for ordinary implementation work, one-off debugging, broad architecture review, or speculative agent creation without workflow evidence.
Session Mode [branch: --sessions]
When the user includes --sessions in their reflect command, shift to session
archaeology: analyze historical OpenCode sessions across all repos to find
repeated patterns, friction, and improvement opportunities.
Session Discovery
Detect the schema, then load recent sessions. OpenCode v2 keeps live data in
session_v2+session_message; legacy v1 databases keepsessionmessage(on v2 hosts those may still exist but are empty leftovers). Detect by probingsession_v2insqlite_masterand select the pair together — never per-table:session_messagecan exist on v1 hosts holding only metadata rows.
Write the probe below to a temp file (for example
/tmp/reflect-sessions.mjs) and runbun /tmp/reflect-sessions.mjs. Do not inline it withbun -e "…": nested quotes get mangled by PowerShell on Windows; a temp script sidesteps shell quoting entirely.import Database from 'bun:sqlite'; import { homedir } from 'os'; const db = new Database(`${homedir()}/.local/share/opencode/opencode.db`, { readonly: true }); const isV2 = !!db.query("SELECT 1 FROM sqlite_master WHERE type='table' AND name='session_v2'").get(); const LIMIT = 50; // set to the --last N value when specified const sessions = isV2 ? db.query( `SELECT s.id, p.worktree AS project, s.title, s.agent, s.model, s.time_created, s.cost, s.tokens_input, s.tokens_output, s.time_archived FROM session_v2 s LEFT JOIN project p ON p.id = s.project_id ORDER BY s.time_created DESC LIMIT ${LIMIT}` ).all() : db.query( `SELECT id, directory AS project, title, agent, model, time_created, cost, tokens_input, tokens_output FROM session ORDER BY time_created DESC LIMIT ${LIMIT}` ).all(); console.log(sessions);Both branches emit a
projectpath for the Per-Session Analysis. Timestamps are epoch milliseconds. On v2, a non-nulltime_archivedmeans the session was archived inside OpenCode.Load session messages - for each session ID, query the matching message table and parse
data:const rows = isV2 ? db.prepare('SELECT type, seq, data FROM session_message WHERE session_id = ? ORDER BY seq').all('<session_id>') : db.prepare('SELECT data FROM message WHERE session_id = ?').all('<session_id>');v2 rows carry a
typecolumn — parsedataJSON by it:user→data.textassistant→ joindata.content[]entries whereentry.type === 'text'(use.text)summary→data.summary(compaction summaries; useful for reconstructing goals)- tool types → keep the tool name for
tools_used(plus any error/failure signal), skip the output payload; reasoning types → skip entirely
v1 rows have no
typecolumn —datais JSON withrole,agent,model,summary, etc.
Per-Session Analysis
For each session, analyze and produce a structured summary:
{
"session": "ses_14de9c68effegtZtlATm42wnz7",
"project": "/home/user/Projects/oh-my-opencode-slim",
"timestamp": "2026-06-10T15:08:45.427Z",
"goal": "Fix CI failure",
"success": true,
"frictions": [
"Repeated grep to find test file",
"Three failed test runs before passing"
],
"recommendations": [
"Create /test-ci comm
常见问题
什么样的建议算好?
有重复工作证据支持的改进,而不是对未来需求的猜测。
它总会建议修改吗?
不会。当证据不支持时,这个技能可以建议不做任何更改。
什么时候不应使用它?
用于普通的实施工作、一次性调试,或在没有任何工作流证据的情况下建议新智能体的时候。
详情
作者的原始描述
Review recent work, find repeated workflow patterns, and suggest reusable skills, agents, commands, config changes, or playbooks. Use when the user asks to learn from past sessions, improve recurring workflows, or identify what should be turned into reusable agent instructions.
热度
- GitHub 星标
- 10k
- 排名
- #12016
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …