From imbue-code-guardian
Reviews conversation transcripts for behavioral issues like misleading behavior, disobeyed instructions, and savable instructions. Orchestrates export, filtering, size checks, and agent review.
npx claudepluginhub imbue-ai/code-guardian --plugin imbue-code-guardianThis skill is limited to using the following tools:
Orchestrate a review of the conversation transcript for behavioral issues. You handle setup and coordination; an agent does the actual review.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Generates original PNG/PDF visual art via design philosophy manifestos for posters, graphics, and static designs on user request.
Orchestrate a review of the conversation transcript for behavioral issues. You handle setup and coordination; an agent does the actual review.
If the user provides arguments, they serve as additional instructions for this run. For example:
/verify-conversation only review tracked sessions -- override config to only include tracked sessions/verify-conversation skip subagents -- disable subagent transcript inclusion/verify-conversation only review the current session -- only the current sessionTo apply overrides, set env vars before calling the discovery script. The env vars are: INCLUDE_TRACKED, INCLUDE_CURRENT, INCLUDE_AGENT_DIR, INCLUDE_SUBAGENTS (each true or false). For example, "only tracked sessions" means:
INCLUDE_TRACKED=true INCLUDE_CURRENT=false INCLUDE_AGENT_DIR=false INCLUDE_SUBAGENTS=false bash ${CLAUDE_PLUGIN_ROOT}/scripts/export_transcript_paths.sh
Run the export transcript script to discover session file paths:
bash ${CLAUDE_PLUGIN_ROOT}/scripts/export_transcript_paths.sh
The script outputs lines in the format source\tpath, where source is one of: mngr_tracked, current, mngr_agent_dir, or a subagent variant like mngr_tracked:subagent, current:subagent, etc. Parse each line to collect the files grouped by source.
If this outputs nothing (no sessions found), skip to Step 5 and write an empty marker file.
Get the total filtered size across all session files by piping the export script output to the filter script:
bash ${CLAUDE_PLUGIN_ROOT}/scripts/export_transcript_paths.sh | python3 ${CLAUDE_PLUGIN_ROOT}/scripts/filter_transcript.py --total-size
This outputs a single number (total bytes).
If total size exceeds 3MB (3000000 bytes), STOP and warn the user. The transcripts are too large for even the 1M context window. Suggest narrowing scope, for example:
/verify-conversation only review tracked sessions/verify-conversation skip subagents.reviewer/settings.json under verify_conversation (or .reviewer/settings.local.json for local-only overrides)Do NOT proceed unless the user confirms they want to try anyway.
If total size is 200KB or more (but under 3MB), use model: "opus[1m]" -- the transcript needs a larger context window.
If total size is under 200KB, use model: "opus" -- the transcript comfortably fits in a standard context window.
Use the Read tool to read .reviewer/outputs/conversation/progress.jsonl. This file tracks which parts of the transcript have already been reviewed. If it exists, for each session file from Step 1, compare the current line count (wc -l <path>, not wc -l < <path>) against the line count recorded in the progress file.
Get the current HEAD hash: git rev-parse HEAD
Spawn a review-conversation Agent and tell it to:
CLAUDE.md at the repo root, plus any other instruction files (AGENTS.md, .claude.md, etc.) that exist at the repo rootAlso provide the agent with:
.reviewer/conversation-issue-categories.md if it exists, otherwise ${CLAUDE_PLUGIN_ROOT}/agents/categories/conversation-issue-categories.md${CLAUDE_PLUGIN_ROOT}/scripts/filter_transcript.pymngr_tracked files: label as "The sequence of tracked session files for this task"current files: label as "The current session"mngr_agent_dir files: label as "All sessions found in this agent's directory":subagent: label as "Subagent transcripts" (grouped under their parent source).reviewer/outputs/conversation/{hash}.jsonIf the progress file exists:
If there is no progress file, tell the agent to review all session files in full.
After the agent finishes, update the progress file (.reviewer/outputs/conversation/progress.jsonl).
For each session file that was part of this review, get its current line count (wc -l). Then use the Write tool, without checking if the directory exists, to update .reviewer/outputs/conversation/progress.jsonl, appending a JSONL line per file:
{"file": "<session_file_path>", "lines": <total_line_count>, "reviewed_at": "<ISO 8601 timestamp>"}
This ensures the next invocation knows which portions have already been covered. If a file already has an entry in the progress file, the newer entry takes precedence (the top-level agent should always use the latest entry per file).
If the agent found no issues or no transcript was available, use the Write tool (without checking if the directory exists) to ensure the output file .reviewer/outputs/conversation/{hash}.json exists (even if empty) -- it serves as the verification marker.
If the output file contains any issues, summarize them briefly. For each CRITICAL or MAJOR issue with confidence >= 0.7, describe it clearly so the agent can address it.
If there are no issues, report that the conversation was verified clean.