一键导入
scaffold-review
Analyze conversation history, find gaps and drift in AGENTS/CLAUDE instructions and skills, propose and apply targeted improvements.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Analyze conversation history, find gaps and drift in AGENTS/CLAUDE instructions and skills, propose and apply targeted improvements.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Run general-review and deep-code-review together as one consolidated review. Use when the user asks for a full code review, a combined general and deep review, or a comprehensive review of code, a diff, branch, or pull request.
Clone/checkout an ai-dynamo/dynamo PR, build it (maturin + editable Python), bring up etcd/NATS, run the end-to-end aggregated server via the repo's examples/backends/sglang/launch/agg.sh, drive load with uvx aiperf, verify the change empirically, then post a scoped evidence-backed GitHub review. Use when asked to test/try/review a Dynamo PR (e.g. "test ai-dynamo/dynamo#10254", "review this dynamo PR").
First-pass workflow for GitHub PR comments and review threads: pull feedback into a simple actionable markdown table before deciding what to fix. Use before github:gh-address-comments when the user asks to review, triage, address, fix, summarize, classify, ledger, or selectively handle PR comments/review feedback.
Check out an SGLang PR in a throwaway worktree, build it in a fresh venv, run it with sglang.launch_server, drive load with uvx aiperf, verify the change empirically, then post a scoped evidence-backed GitHub review. Use when asked to test/try/review an sglang PR (e.g. "test sgl-project/sglang#12345", "review this sglang PR").
Generate a bi-weekly/monthly engineering status update ("T5T") for a date range by mining the ~/memory work-vault and cross-referencing GitHub PR activity via gh. First emit a full evidence-backed mega dump of active work, then a separately labeled recommended T5T for approval. Use when asked to "write my T5T", "status update", "what did I do from X to Y", "biweekly update", "T5T mega dump", or "T5T for approval".
Create or update GitHub pull request descriptions without deleting existing content or adding long narrative slop. Use when the user asks to write, refresh, clean up, standardize, or update a PR body/description for a current branch or GitHub PR.
| name | scaffold-review |
| description | Analyze conversation history, find gaps and drift in AGENTS/CLAUDE instructions and skills, propose and apply targeted improvements. |
Analyze recent agent conversation history to find what's broken, stale, or missing in your scaffolding (AGENTS/CLAUDE instructions, skills, project configs). Propose changes, apply them, and record what you did.
The goal is convergence: each run brings the scaffold closer to how the user actually works.
Resolve the active agent home:
if [ -n "${AGENT_HOME:-}" ]; then
:
elif [ -n "${CODEX_HOME:-}" ] || [ -n "${CODEX_THREAD_ID:-}" ] || [ -n "${CODEX_CI:-}" ]; then
AGENT_HOME="${CODEX_HOME:-$HOME/.codex}"
elif [ -n "${CLAUDE_HOME:-}" ] || [ -n "${CLAUDECODE:-}" ] || [ -n "${CLAUDE_CODE:-}" ]; then
AGENT_HOME="${CLAUDE_HOME:-$HOME/.claude}"
elif [ -d "$HOME/.codex/sessions" ] && [ ! -d "$HOME/.claude/projects" ]; then
AGENT_HOME="$HOME/.codex"
elif [ -d "$HOME/.claude/projects" ] && [ ! -d "$HOME/.codex/sessions" ]; then
AGENT_HOME="$HOME/.claude"
else
echo "Unable to infer AGENT_HOME. Set AGENT_HOME explicitly." >&2
exit 1
fi
Read the review ledger (memory of prior runs):
!cat "$AGENT_HOME/scaffold-review-ledger.json" 2>/dev/null || echo '{"runs": [], "deferred": [], "trends": []}'
Find conversations since last run (or last 14 days if first run), with sizes for budgeting:
!if [ -d "$AGENT_HOME/projects" ]; then find "$AGENT_HOME/projects" -name '*.jsonl' -not -path '*/subagents/*' -mtime -14 -size +10k -exec ls -lh {} \; ; elif [ -d "$AGENT_HOME/sessions" ]; then find "$AGENT_HOME/sessions" -name '*.jsonl' -mtime -14 -size +10k -exec ls -lh {} \; ; fi | awk '{print $5, $9}' | sort -k2
Budget check: If total JSONL exceeds 5MB, do not pass raw logs into model context. Run the bundled extractor first, then pass compact findings to any subagents.
Run the deterministic extractor before interpretation:
SCRIPT="$AGENT_HOME/skills/scaffold-review/scripts/extract_scaffold_signals.py"
if [ ! -f "$SCRIPT" ]; then
SCRIPT="./agents/skills/scaffold-review/scripts/extract_scaffold_signals.py"
fi
SIGNALS="${TMPDIR:-/tmp}/scaffold-review-signals.json"
python3 "$SCRIPT" --agent-home "$AGENT_HOME" --max-sessions 20 --format json --output "$SIGNALS"
Use --format markdown for a quick human-readable view, but keep the JSON file as the source for synthesis and subagents.
The extractor streams JSONL and returns compact evidence:
False-positive guardrails:
AGENTS.md, CLAUDE.md, <skill>, environment, permissions, app/plugin, subagent notification, and developer context blocks.CODEX_THREAD_ID and subagent-created sessions by default. Include them only when intentionally reviewing the current run or subagent behavior.Use the extractor output as the shared source of truth for the analyzers below.
For Codex, use subagents when the corpus is large, when the user asks for meta/parallel/subagent review, or when forward-testing a proposed scaffold change. Give each subagent the compact extractor output, sampled session list, current scaffold excerpt, and one narrow question. Do not send raw JSONL unless a specific evidence gap requires a targeted snippet.
Scan user messages for:
For each correction, answer: Is there scaffold guidance for this? Was it followed? Was it wrong?
Output: list of corrections with root cause (missing guidance / stale guidance / buried guidance / wrong guidance).
From assistant tool-call records, extract:
Output: frequency tables + list of stale/missing references.
Look at multi-step patterns:
Classify patterns by stability:
Output: pattern list with stability ratings + gap analysis.
response_item.payload.payload.phase when you need to separate progress updates from final responses.payload.type == "function_call" with JSON-encoded arguments.write_stdin polling loops are common in remote or long-running jobs; treat them as one workflow, not separate tasks.grep is only for targeted evidence gaps.After all agents report, read the current scaffold:
"$AGENT_HOME/CLAUDE.md" (with AGENTS.md symlink for Codex)"$AGENT_HOME/skills/*/SKILL.md"CLAUDE.md (or AGENTS.md symlink) files (find via conversation paths)Cross-reference agent findings against the scaffold. Classify each finding:
| Status | Meaning | Action |
|---|---|---|
| Conflict | Scaffold says X, user corrects to Y | Fix immediately |
| Stale | Scaffold references dead path/tool | Update or remove |
| Gap | Repeated pattern, scaffold is silent | Add content |
| Buried | Info exists but in wrong place | Reorganize |
| Dead | Skill/section never used | Remove |
Also compare against ledger trends:
Organize proposals by type:
Things the user explicitly corrected. Highest confidence -- apply unless vetoed.
Reorganizations: sections that should be split into skills, skills that overlap and should merge, info in the wrong file.
Workflows, paths, patterns that belong in the scaffold but aren't there yet. Apply the necessity test: would this have prevented a specific observed failure? If the assistant would get it right without the guidance, don't add it.
Stale content, unused skills, dead references. Show evidence of staleness.
Only if a crystallized workflow (5+ conversations) would clearly benefit from being a dedicated skill. Don't create skills speculatively.
For each proposal, include:
Present all proposals to the user before applying.
For approved changes:
{
"timestamp": "<now>",
"conversations_analyzed": "<count>",
"proposals": [
{
"description": "...",
"tier": "<1-5>",
"status": "applied|deferred|rejected",
"confidence": "high|medium|low"
}
],
"trends_updated": ["..."]
}
Write ledger:
cat > "$AGENT_HOME/scaffold-review-ledger.json" << 'EOF'
<updated ledger content>
EOF
For deferred proposals, record the reason so a future run can reassess.
Validate scaffold-review changes before finishing:
python3 "$SCRIPT" --agent-home "$AGENT_HOME" --max-sessions 3 --format json >/tmp/scaffold-review-signals.json
VALIDATOR="$AGENT_HOME/skills/.system/skill-creator/scripts/quick_validate.py"
if [ -f "$VALIDATOR" ]; then
python3 "$VALIDATOR" "$AGENT_HOME/skills/scaffold-review"
fi
Records differ by agent implementation.
For Codex, the common shape is:
User / assistant messages:
{
"type": "response_item",
"payload": {
"type": "message",
"role": "user|assistant|developer",
"content": [
{ "type": "input_text|output_text", "text": "..." }
],
"phase": "commentary|final"
}
}
Tool calls:
{
"type": "response_item",
"payload": {
"type": "function_call",
"name": "exec_command",
"arguments": "{\"cmd\":\"...\"}"
}
}
Claude-style records may still appear in older logs or other agent homes. Prefer the Codex schema when ~/.codex/sessions is the source.