From imbue-code-guardian
Automatically find and fix code issues in the current branch. Iteratively verifies, plans fixes, and implements them with separate commits. Defers all review to the end.
How this skill is triggered — by the user, by Claude, or both
Slash command
/imbue-code-guardian:autofixThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Iteratively verify the current branch for code issues, plan and implement fixes (each in a separate commit), and repeat until clean. At the end, present each fix for user review and revert any the user does not want.
Iteratively verify the current branch for code issues, plan and implement fixes (each in a separate commit), and repeat until clean. At the end, present each fix for user review and revert any the user does not want.
Autofix requires a clean git state. Before proceeding, check for uncommitted changes:
git status --porcelain
If there are any untracked, staged, or unstaged changes, commit them first (or add them to .gitignore if they should not be tracked). Do NOT proceed until git status --porcelain produces no output.
initial_head): !git rev-parse HEADbase_branch): !echo "${GIT_BASE_BRANCH:-main}"If you do not already know what the changes on this branch are supposed to accomplish, STOP and ask the user before continuing.
Write a brief description of what the branch is trying to do. This helps the diff validation and fix agents distinguish intentional changes from issues.
Spawn a validate-diff Agent. Provide the base branch name and the problem description.
Based on the agent's response:
Repeat up to 10 times:
pre_iteration_head..reviewer/outputs/autofix/issues/{pre_iteration_head}.jsonlverify-and-fix Agent, providing the base branch ({base_branch}), the full current HEAD hash ({pre_iteration_head}), and the issue categories path: .reviewer/code-issue-categories.md if it exists, otherwise ${CLAUDE_PLUGIN_ROOT}/agents/categories/code-issue-categories.md.git rev-parse HEAD to pre_iteration_head.Important:
verify-and-fix agent task to finish--do not simply finish your response!After the loop ends:
git log --reverse --format="%H %s" {initial_head}..HEAD.reviewer/autofix/auto-accept.md exists. If it does, read it. This file contains free-text rules describing which kinds of fixes should be automatically accepted without prompting the user (e.g. "accept all naming fixes", "auto-accept anything in test files").AskUserQuestion call. Use one question per commit (up to 4 per call; if there are more than 4 commits, use multiple calls but still gather all answers before doing any git operations). Each question should:
git revert --no-edit {hash} for each, in reverse chronological order (newest first) to avoid conflicts..reviewer/outputs/autofix/issues/*.jsonl files).For this particular run of the autofix command, follow these adjustments from the user to the normal process:
$ARGUMENTS
npx claudepluginhub imbue-ai/code-guardian --plugin imbue-code-guardianIterative review-fix loop for the current branch — reviews via daemon, fixes inline, re-reviews until passing or max iterations reached.
Iteratively reviews code for critical issues with code-reviewer, auto-fixes via fixer agent, verifies tests pass, repeats up to 5 cycles until clean.
Reviews code changes for bugs with P0-P2 priority, using parallel subagents for thorough analysis and creating fix plans. Use when reviewing code before merging.