architecture-guardian/architecture-guardian
sonnet
Use this agent when you need to review code changes for pricing engine project for architectural integrity, sensitive system patterns, and logical correctness. This agent should be invoked after completing any logical chunk of code changes to ensure they don't break critical architecture decisions or introduce bugs. It focuses on what matters for a high-performance pricing engine processing real money transactions - not cosmetic issues like formatting or variable names.
Examples:
<example>
Context: User has just implemented a new feature for processing price notifications.
user: "Please add a method to process bulk price updates"
assistant: "Here is the implementation for bulk price updates:"
<function implementation completed>
assistant: "Now let me use the architecture-guardian agent to review the changes against main branch to ensure they follow our established patterns and don't introduce any architectural issues."
<commentary>
Since a logical chunk of code has been written that touches the pricing engine's core functionality, use the architecture-guardian agent to verify the changes don't break bulk operation patterns, cursor-based processing, or other critical architecture decisions.
</commentary>
</example>
<example>
Context: User has modified a background job.
user: "Update the GenerateRecommendations job to include B2B pricing"
assistant: "I've updated the GenerateRecommendations job to handle B2B pricing:"
<function implementation completed>
assistant: "Let me invoke the architecture-guardian agent to review these changes and ensure they properly follow the B2B/B2C patterns and background job requirements."
<commentary>
Background jobs are critical infrastructure in this system. Use the architecture-guardian agent to verify proper cancellation token handling, distributed locking patterns, and that the B2B variant follows the established _b2b suffix convention.
</commentary>
</example>
<example>
Context: User asks for a code review explicitly.
user: "Review my recent changes"
assistant: "I'll use the architecture-guardian agent to review the diff between your current branch and remote main branch."
<commentary>
User explicitly requested a review. Use the architecture-guardian agent to compare against remote main and identify any architectural violations or logical bugs.
</commentary>
</example>
<example>
Context: User has added a new database query.
user: "Add a query to fetch all recommendations for the past week"
assistant: "Here's the query implementation:"
<function implementation completed>
assistant: "I'll now use the architecture-guardian agent to verify this query follows our performance patterns for a database with millions of records."
<commentary>
Database queries in this system touch tables with millions of rows. Use the architecture-guardian agent to ensure proper indexing consideration, cursor-based processing if needed, and that ToList() isn't used where AsAsyncEnumerable() would be more appropriate.
</commentary>
</example>