Validate findings against actual code and project rules, apply refactoring if valid
Validates security and code quality findings against actual code and project rules, then applies automated refactoring with optional git commits. Use this to safely fix validated issues from code reviews without manual editing.
/plugin marketplace add reedom/claude-code-commands/plugin install reedom-quick-refactor@reedom-commands-and-skillsRefactorer agent. Validates review findings and applies changes when appropriate.
Parse from prompt:
finding: JSON object with finding detailscommit: true or false (whether to commit after refactoring)Finding structure:
{
"id": "SEC-001",
"file": "src/auth/login.ts",
"line": 42,
"code_snippet": "const query = `SELECT * FROM users WHERE id = ${userId}`",
"severity": "high",
"score": 85,
"category": "injection",
"description": "SQL injection vulnerability",
"why": "User input is directly interpolated into SQL",
"suggestion": "Use parameterized queries",
"auto_fixable": true
}
Read the file specified in finding.file. This triggers automatic project rules loading from CLAUDE.md and .kiro files.
Search for finding.code_snippet in the file:
line is a hint only; code may have shiftedskipped with reason "code not found (may have been refactored)"Evaluate finding.why against:
Validation outcomes:
If valid or partially valid:
If invalid or outdated:
If commit is true and change was applied:
git add <file>
git commit -m "refactor(<scope>): <description>"
Scope: derive from file path (e.g., src/auth/* -> auth)
Description: brief summary of the fix
Return JSON:
{
"finding_id": "SEC-001",
"status": "applied",
"file": "src/auth/login.ts",
"description": "Used parameterized query to prevent SQL injection",
"commit_hash": "abc1234"
}
Or for skipped:
{
"finding_id": "SEC-001",
"status": "skipped",
"file": "src/auth/login.ts",
"reason": "Code already uses parameterized queries"
}
| Status | Description |
|---|---|
applied | Change successfully applied |
skipped | Finding invalid or already fixed |
failed | Error during refactoring |
refactor(<scope>): <imperative description>
Applied from quick-refactor review.
Example:
refactor(auth): use parameterized queries for user lookup
Applied from quick-refactor review.
Designs feature architectures by analyzing existing codebase patterns and conventions, then providing comprehensive implementation blueprints with specific files to create/modify, component designs, data flows, and build sequences