一键导入
reflect
Extract one durable lesson from a session into AGENTS.md. Invoke with a session ID to review a past session.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Extract one durable lesson from a session into AGENTS.md. Invoke with a session ID to review a past session.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | reflect |
| description | Extract one durable lesson from a session into AGENTS.md. Invoke with a session ID to review a past session. |
| allowed-tools | ["Read","Edit","Glob","Bash(python3:*)"] |
You are a ruthless editor. Your job is to decide whether a session produced one durable, generalizable lesson about working in this codebase, and if so, append it to AGENTS.md.
/reflect — scan the current conversation/reflect <session-id> — load and scan a past session by UUIDIf an argument matching a UUID pattern (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) is provided, use Historical Session Loading below. Otherwise, skip straight to the Process section using the current conversation.
When a session ID is provided, load the transcript before proceeding to Process.
Find the JSONL file across all project directories:
python3 -c "
import glob, sys
sid = sys.argv[1]
matches = glob.glob(f'{__import__(\"os\").path.expanduser(\"~\")}/.claude/projects/*/{sid}.jsonl')
if matches:
print(matches[0])
else:
print('NOT_FOUND')
" SESSION_ID
If NOT_FOUND, report "Session SESSION_ID not found." and stop.
Extract only user text and assistant text blocks (skip thinking, tool_use, tool_result, progress, file-history-snapshot, and queue-operation entries):
python3 -c "
import json, sys, os
path = sys.argv[1]
texts = []
with open(path) as f:
for line in f:
entry = json.loads(line)
t = entry.get('type')
if t not in ('user', 'assistant'):
continue
msg = entry.get('message', {})
if not isinstance(msg, dict):
continue
content = msg.get('content', [])
if isinstance(content, str):
texts.append(content)
elif isinstance(content, list):
for block in content:
if isinstance(block, dict) and block.get('type') == 'text':
texts.append(block['text'])
combined = '\n---\n'.join(texts)
# Cap at 50K chars (keep tail — recent conversation is more relevant)
if len(combined) > 50000:
combined = combined[-50000:]
print(combined)
" SESSION_FILE_PATH
If the output is empty, report "No text content in session SESSION_ID." and stop.
The session's cwd field tells you the project directory. Extract it:
python3 -c "
import json, sys
with open(sys.argv[1]) as f:
for line in f:
entry = json.loads(line)
if entry.get('type') in ('user', 'assistant') and 'cwd' in entry:
print(entry['cwd'])
break
" SESSION_FILE_PATH
Use this path as the root for finding AGENTS.md in step 2 of Process (instead of the current working directory).
Use the extracted text as the "conversation" to scan in Process step 1.
Scan the conversation (current session or loaded transcript) for lessons that are:
Find AGENTS.md using Glob (**/AGENTS.md) starting from the project directory (current working directory, or the cwd from a historical session). Read it. If no AGENTS.md exists, stop — do not create one just to write a lesson.
Check line count. If AGENTS.md exceeds 200 lines, you may only add a bullet if you also merge or delete an existing bullet in the same section (net line count non-increasing). State what you removed and why.
Decide: write or skip.
Format the bullet:
Either:
No other output.
The skill for "is this AI-written?" or "make this sound more human." Use whenever a specific text sample is in question and the core concern is AI authenticity — student submissions suspected of AI authorship, blog/wiki drafts that feel off, PR commit messages that smell like boilerplate, cover letters that sound robotic, paragraphs an editor flagged. Detects copula avoidance, ChatGPT vocabulary, significance inflation, and 30+ other documented AI tells. Also rewrites flagged sections. Not for grammar checks, summarization, or style edits where AI detection is not the concern.
Chain extract-research-questions into objective-codebase-research. Convenience wrapper for the Q+R phases of QRSPI.
Draft a structured design discussion from research findings. Interactive — presents understanding for corrections before finalizing.
Create a structure outline with vertical slices from a design discussion document. Enforces vertical decomposition over horizontal layers.
Extract 5-10 codebase research questions from a ticket or description. Questions only — no answers or opinions.
Conduct problem-aware, solution-blind codebase research. Outputs factual findings only — no opinions or suggestions.