Phase 2 - Deep Analysis: - Algorithm correctness - Edge case handling - Error handling completeness - Resource management Phase 3 - Context Evaluation: - Breaking changes to public APIs - Side effects on existing functionality - Dependency compatibility Phase 4 - Standards Compliance: - Naming conventions - Documentation requirements - Test coverage </example>
Security: - Input validation - Authentication/authorization - Data sanitization - Secrets handling Performance: - Algorithm efficiency - Resource usage - Memory leaks - N+1 queries Maintainability: - Clear naming - Appropriate comments - Single responsibility - DRY principle Testability: - Test coverage adequate - Tests meaningful - Edge cases tested </example>
Important: Should fix before merge - Logic errors - Missing error handling - Performance issues Suggestion: Nice to have improvements - Code style - Refactoring opportunities - Documentation Positive: What was done well - Good patterns - Clever solutions - Thorough testing </example>
<anti_patterns> <avoid name="nitpicking_style"> <description>Focusing on code style issues when functionality is broken</description> <instead>Address critical and important issues first, style suggestions last</instead> </avoid> <avoid name="rubber_stamping"> <description>Approving changes without thorough review</description> <instead>Systematically review all phases: scan, deep analysis, context, standards</instead> </avoid> <avoid name="only_negatives"> <description>Providing only critical feedback without acknowledging good work</description> <instead>Balance feedback with positive observations of good practices</instead> </avoid> <avoid name="vague_feedback"> <description>Giving feedback without specific, actionable suggestions</description> <instead>Provide file:line references and concrete improvement suggestions</instead> </avoid> <avoid name="sequential_when_parallel"> <description>Executing independent tasks sequentially</description> <instead>Identify and execute independent tasks in parallel for efficiency</instead> </avoid> <avoid name="parallel_when_dependent"> <description>Attempting to parallelize tasks with data dependencies</description> <instead>Analyze dependencies and execute dependent tasks sequentially</instead> </avoid> </anti_patterns>
<best_practices> <practice priority="critical">Analyze task dependencies before execution to determine parallel vs sequential execution model</practice> <practice priority="critical">Provide comprehensive context to sub-agents including file paths, tool usage, and reference implementations</practice> <practice priority="critical">Systematically review all phases: initial scan, deep analysis, context evaluation, standards compliance</practice> <practice priority="high">Balance critical feedback with positive observations of good practices</practice> <practice priority="high">Provide file:line references and concrete improvement suggestions</practice> <practice priority="medium">Check Serena memories for existing patterns before delegating implementation tasks</practice> </best_practices>
<rules priority="critical"> <rule>Execute independent tasks in parallel</rule> <rule>Never parallelize tasks with data dependencies</rule> <rule>Verify sub-agent outputs before integration</rule> <rule>Run quality checks after changes</rule> </rules> <rules priority="standard"> <rule>quality + security: Concurrent checks</rule> <rule>test + docs: Simultaneous creation when independent</rule> <rule>Ensure no regression in existing functionality</rule> <rule>Confirm all acceptance criteria met</rule> </rules><error_escalation> <level severity="low"> <example>Sub-agent returns partial results</example> <action>Note in report, proceed</action> </level> <level severity="medium"> <example>Sub-agent task fails</example> <action>Document issue, use AskUserQuestion for clarification</action> </level> <level severity="high"> <example>Critical task cannot be completed</example> <action>STOP, present options to user</action> </level> <level severity="critical"> <example>Sub-agent introduces breaking change</example> <action>BLOCK operation, require explicit user acknowledgment</action> </level> </error_escalation>
<related_skills> <skill name="serena-usage">Use for memory checks and symbol operations during delegation</skill> <skill name="investigation-patterns">Use when code review reveals unclear implementation details</skill> <skill name="testing-patterns">Use to verify test coverage and quality during review</skill> </related_skills>
<constraints> <must>Delegate detailed work to sub-agents</must> <must>Execute independent tasks in parallel</must> <must>Verify outputs before integration</must> <avoid>Implementing detailed logic directly</avoid> <avoid>Sequential execution of independent tasks</avoid> <avoid>Skipping verification of sub-agent outputs</avoid> </constraints>