Validates file revisions using git diff instead of manual file comparison
Validates file revisions using git diff instead of manual file comparison. Compares file versions across commits, understands change intent from the commit message, runs CRAFT-specific structural checks, classifies severity, and supports three review modes including a blocking mode that halts commits with critical issues.
Cowork Git-Aware File Reviewer
TL;DR
How To Start
STEP 1Specify the Review Scope
-
commit_ref
· string · optional · default: HEAD~1
Git ref to compare against HEAD. Can be a commit hash, branch name, or relative ref like HEAD~3. -
review_mode
· string · optional · default: auto
Review thoroughness. Options: “auto” (abbreviated, CWK-005 integration — silent on clean commits), “full” (comprehensive with approval workflow), “blocking” (halts on CRITICAL findings in critical files). -
craft_mode
· boolean · optional · default: true
Enable CRAFT-specific validation checks: recipe structure, version alignment, master index consistency, cross-reference integrity, recipe ID format. Set false for non-CRAFT files.
Usage Examples
How AI Reads This Recipe
- RETRIEVE the git diff: run git log for commit hash and message (the message serves as intent context), git diff –stat for summary, and git diff for full content. If no changes exist, return silently in auto mode or report “no changes” in other modes.
- ANALYZE structure: for each changed CRAFT file, compare section headers between the before and after versions. Flag removed sections as CRITICAL. Track added sections as informational.
- CLASSIFY changes against commit intent: parse the commit message for action verbs and targets. Classify each diff hunk as ALIGNED (matches intent), UNALIGNED (not in stated scope — potentially accidental), or COLLATERAL (reasonable side effect like updating counts). Flag unaligned changes for review.
- RUN CRAFT-specific checks when craft_mode is true: version alignment (header vs. metadata — CRITICAL if mismatched), recipe structure (required fields — WARNING if missing), master index consistency (counts match actuals — CRITICAL if off), cross-reference integrity (dependency_map and used_by reciprocal — WARNING if broken), recipe ID format (RCP-CWK-NNN pattern — WARNING if non-compliant), section completeness (all required sections present — CRITICAL if missing).
- CLASSIFY severity: aggregate findings into CRITICAL (must fix), WARNING (review needed), and INFO (neutral observations).
- REPORT based on review mode. AUTO: silent on clean, report only CRITICAL and WARNING. BLOCKING: return BLOCK status on CRITICAL findings — the commit must be reverted or fixed. FULL: produce comprehensive report with all severity levels, intent alignment analysis, and four approval options (approve, approve with notes, fix forward, revert).
When to Use This Recipe
- Want automatic post-commit validation of CRAFT file changes integrated with your git workflow.
- Need to verify that commit changes align with stated intent and no accidental modifications slipped in.
- Are modifying critical files (cookbooks, CLAUDE.md, roadmap) and want blocking validation before the commit proceeds.
- Want CRAFT-specific structural checks (version alignment, index consistency, cross-references) run automatically on every commit.
Recipe FAQ
Q.What are the three review modes?
Q.What CRAFT-specific checks does this recipe run?
Q.What change classifications does the intent analysis use?
Q.Which files trigger blocking mode?
Q.What happens with large diffs?
Q.How does this recipe differ from the Core SMART File Reviewer?
Version History
Get this recipe with CRAFT for Claude Cowork
Cowork recipes ship bundled with CRAFT for Claude Cowork — there’s no separate download. Clone the framework once, and your AI runs every recipe automatically when invoked.
Pull anytime to stay on the latest version — free to clone, no login or email required.
Then start your session
Once CRAFT is in your project folder, open a new Cowork session and ask Claude to initialize. For example:
You
Claude
Not familiar with Git? Download as a ZIP
No command line needed. Just download, move, and unzip:
- Open the CRAFT framework repo on GitHub.
- Click the green Code button, then choose Download ZIP.
- Move the downloaded ZIP into your Claude Cowork project folder.
- Unzip it: double-click on Mac, or right-click → Extract All on Windows.
