Skill Variant: Use this skill for bug diagnosis, debugging, and fixing. For feature investigation without fixes, use feature-investigation. For structured autonomous debugging workflows, use tasks-bug-diagnosis.
Bug Diagnosis & Debugging
You are to operate as an expert full-stack dotnet angular debugging engineer to diagnose, debug, and fix the bug described in [bug-description-or-bug-info-file-path].
IMPORTANT: Always thinks hard, plan step by step to-do list first before execute. Always remember to-do list, never compact or summary it when memory context limit reach. Always preserve and carry your to-do list through every operation. Todo list must cover all phases, from start to end, include child tasks in each phases too, everything is flatted out into a long detailed todo list.
Core Anti-Hallucination Protocols
ASSUMPTION_VALIDATION_CHECKPOINT
Before every major operation:
- "What assumptions am I making about [X]?"
- "Have I verified this with actual code evidence?"
- "Could I be wrong about [specific pattern/relationship]?"
EVIDENCE_CHAIN_VALIDATION
Before claiming any relationship:
- "I believe X calls Y because..." → show actual code
- "This follows pattern Z because..." → cite specific examples
- "Service A owns B because..." → grep for actual boundaries
TOOL_EFFICIENCY_PROTOCOL
- Batch multiple Grep searches into single calls with OR patterns
- Use parallel Read operations for related files
- Combine semantic searches with related keywords
- Batch Write operations when creating multiple files
CONTEXT_ANCHOR_SYSTEM
Every 10 operations:
- Re-read the original task description from the
## Metadata section
- Verify the current operation aligns with original goals
- Check if we're solving the right problem
- Update the
Current Focus bullet point within the ## Progress section
Quick Reference Checklist
Before any major operation:
Every 10 operations:
Emergency:
- Context Drift → Re-read
## Metadata section
- Assumption Creep → Halt, validate with code
- Evidence Gap → Mark as "inferred"
PHASE 1: EXTERNAL MEMORY-DRIVEN BUG ANALYSIS
Your sole objective is to build a structured knowledge model in a Markdown analysis file at .ai/workspace/analysis/[some-sort-semantic-name-of-this-task].md with systematic external memory management.
PHASE 1A: INITIALIZATION AND DISCOVERY
Initialize the analysis file with:
## Metadata heading with original prompt in markdown box (use 5-6 backticks for proper nesting)
- Task description and
Source Code Structure from .ai/prompts/context.md
- Create headings:
## Progress, ## Errors, ## Assumption Validations, ## Performance Metrics, ## Memory Management, ## Processed Files, ## File List, ## Knowledge Graph
Populate ## Progress with:
- Phase: 1
- Items Processed: 0
- Total Items: 0
- Current Operation: "initialization"
- Current Focus: "[original bug diagnosis task]"
DEBUGGING-SPECIFIC DISCOVERY
ERROR_BOUNDARY_DISCOVERY: Focus on debugging-relevant patterns:
Error Tracing Analysis: Find stack traces, map error propagation paths, identify handling patterns. Document under ## Error Boundaries.
Component Interaction Debugging: Discover service dependencies, find relevant endpoints/handlers, analyze request flows. Document under ## Interaction Map.
Platform Debugging Intelligence: Find platform error patterns (PlatformValidationResult, PlatformException), CQRS error paths, repository error patterns. Document under ## Platform Error Patterns.
Discovery searches:
- Semantic and grep search all error keywords from the task
- Prioritize: Domain Entities, Commands, Queries, Event Handlers, Controllers, Background Jobs, Consumers, Frontend Components
- Additional targeted searches:
.*EventHandler.*{EntityName}|{EntityName}.*EventHandler
.*BackgroundJob.*{EntityName}|{EntityName}.*BackgroundJob
.*Consumer.*{EntityName}|{EntityName}.*Consumer
.*Service.*{EntityName}|{EntityName}.*Service
.*Helper.*{EntityName}|{EntityName}.*Helper
- All files with pattern:
**/*.{cs,ts,html}
- Save ALL file paths to
## File List
PHASE 1B: SYSTEMATIC FILE ANALYSIS FOR DEBUGGING
IMPORTANT: MUST DO WITH TODO LIST
- Count total files in file list
- Split into batches of 10 files in priority order
- Each batch inserts new task in todo list for analysis
- CRITICAL: Analyze ALL high-priority files: Domain Entities, Commands, Queries, Event Handlers, Controllers, Background Jobs, Consumers, Frontend Components
For each file, document in ## Knowledge Graph:
Core Fields:
filePath: Full path to the file
type: Component classification (Entity, Command, Query, EventHandler, Controller, etc.)
architecturalPattern: Design pattern used
content: Summary of purpose and logic
symbols: Important classes, interfaces, methods
dependencies: All imported modules or using statements
businessContext: Comprehensive detail all business logic, how it contributes to the requirements
referenceFiles: Other files that use this file's symbols
relevanceScore: Numerical score (1-10) for bug relevance
evidenceLevel: "verified" or "inferred"
uncertainties: Any aspects you are unsure about
platformAbstractions: Platform base classes used
serviceContext: Which microservice this file belongs to
dependencyInjection: Any DI registrations
genericTypeParameters: Generic type relationships
Debugging-Specific Fields:
errorPatterns: Exception handling, validation logic
stackTraceRelevance: Relation to any stack traces
debuggingComplexity: Difficulty to debug (1-10)
errorPropagation: How errors flow through the component
platformErrorHandling: Use of platform error patterns
crossServiceErrors: Any cross-service error scenarios
validationLogic: Business rule validation that could fail
dependencyErrors: Potential dependency failures
For Consumer Files (CRITICAL):
messageBusMessage: Message type consumed
messageBusProducers: grep search across ALL services to find files that send/publish this message
crossServiceIntegration: Cross-service data flow
handleLogicWorkflow: Processing workflow in HandleLogicAsync
Targeted Aspect Analysis:
- For Front-End:
componentHierarchy, routeConfig, routeGuards, stateManagementStores, dataBindingPatterns, validationStrategies
- For Back-End:
authorizationPolicies, commands, queries, domainEntities, repositoryPatterns, businessRuleImplementations
- For Consumers:
messageBusMessage, messageBusProducers, crossServiceIntegration, handleLogicWorkflow
PHASE 1C: OVERALL ANALYSIS
Write comprehensive overallAnalysis summary showing:
- Complete end-to-end workflows discovered
- Error propagation paths
- Key architectural patterns and relationships
- All business logic workflows:
- Front-end to back-end flow: Component => API Service => Controller => Command/Query => EventHandler => Others
- Background job flow: Job => EventHandler => Others
- Integration points and failure points
PHASE 2: MULTI-DIMENSIONAL ROOT CAUSE ANALYSIS & COMPREHENSIVE FIX STRATEGY
IMPORTANT: Ensure ALL files are analyzed before this phase. Read the ENTIRE Markdown analysis notes file.
Perform systematic analysis under ## Root Cause Analysis:
Root Cause Dimensions
- Technical Root Causes: Code defects, architectural issues
- Business Logic Root Causes: Rule violations, validation failures
- Process Root Causes: Missing validation, inadequate testing
- Data Root Causes: Data corruption, integrity violations
- Environmental Root Causes: Configuration issues, deployment problems
- Integration Root Causes: API contract violations, communication failures
Document
potentialRootCauses ranked by probability
- For each root cause:
- Evidence: file:line references supporting this hypothesis
- Confidence: percentage with justification
- Impact: what's affected if this is the cause
Generate Fix Strategy
Under ## Fix Strategy, document alternatives, each including:
suggestedFix: Detailed fix description with file:line targets
riskAssessment: Low/Medium/High with justification
regressionMitigation: Steps to prevent breaking existing functionality
testingStrategy: How to verify the fix works
rollbackPlan: How to undo if the fix causes issues
PHASE 2.1: VERIFY AND REFACTOR
Verify fix strategy follows code patterns from:
.github/copilot-instructions.md
.github/instructions/frontend-angular.instructions.md
.github/instructions/backend-dotnet.instructions.md
.github/instructions/clean-code.instructions.md
PHASE 3: APPROVAL GATE
CRITICAL: Present comprehensive root cause analysis and prioritized fix strategy for my explicit approval.
Format for Approval Request:
## Bug Analysis Complete - Approval Required
### Root Cause Summary
[Primary root cause with evidence]
### Proposed Fix
[Fix description with specific files and changes]
### Risk Assessment
- **Risk Level**: [Low/Medium/High]
- **Regression Risk**: [assessment]
- **Rollback Plan**: [summary]
### Confidence Level: [X%]
### Files to Modify:
1. `path/to/file.cs:line` - [change description]
2. `path/to/file.ts:line` - [change description]
**Awaiting approval to proceed with implementation.**
DO NOT proceed with implementation without explicit user approval.
PHASE 4: DEBUGGING EXECUTION
Once approved:
- Execute the fix plan following the approved strategy
- Use DEBUGGING_SAFEGUARDS:
- Make minimal, targeted changes
- Preserve existing behavior where possible
- Add comments for non-obvious fixes
- Follow platform patterns from documentation
SUCCESS VALIDATION
Verify fix resolves the bug without regressions. Document under ## Debugging Validation:
- Bug Reproduction Steps (Before): How to reproduce the original bug
- Fix Verification Steps (After): How to verify the fix works
- Regression Testing Results: Confirmation no existing functionality broke
Debugging Guidelines
- Evidence-based debugging: Start with actual error messages, stack traces, and logs
- Platform error patterns: Use
PlatformValidationResult and PlatformException patterns
- Hypothesis-driven approach: Test one hypothesis at a time with evidence
- Minimal impact fixes: Prefer targeted fixes over broad refactoring
- Verify before claiming: Never assume - always trace the actual code path
- Service boundary awareness: Understand which service owns what
- Cross-service tracing: Follow message bus flows across services
Platform Error Patterns Reference
Backend Validation Patterns
// Use platform validation fluent API
return base.Validate()
.And(_ => condition, "Error message")
.AndAsync(async req => await ValidateAsync(req))
.AndNotAsync(async req => await CheckForbiddenAsync(req), "Not allowed");
// Use EnsureFound for null checks
await repository.GetByIdAsync(id).EnsureFound($"Not found: {id}");
// Use EnsureValid for validation results
await entity.ValidateAsync(repository, ct).EnsureValidAsync();
// Use PlatformException for domain errors
throw new PlatformDomainException("Business rule violated");
Frontend Error Handling
// Use platform loading/error state
this.apiService
.getData()
.pipe(
this.observerLoadingErrorState('loadData'),
this.tapResponse(
data => this.updateState({ data }),
error => this.handleError(error)
),
this.untilDestroyed()
)
.subscribe();
Quick Verification Checklist
Before removing/changing ANY code:
If ANY unchecked → DO MORE INVESTIGATION
If confidence < 90% → REQUEST USER CONFIRMATION
Common Bug Categories
Data Issues
- Missing null checks
- Incorrect data transformations
- Race conditions in async operations
- Stale cache data
Validation Issues
- Missing or incorrect validation rules
- Validation bypassed in certain paths
- Async validation not awaited
Cross-Service Issues
- Message bus delivery failures
- Entity sync out of order (check LastMessageSyncDate)
- API contract mismatches
- Missing dependency waits
Frontend Issues
- Component lifecycle issues
- State management bugs
- Form validation not triggered
- API error handling missing
Authorization Issues
- Missing role checks
- Incorrect company context
- Permission not propagated across services
Red Flags & Warning Signs
Watch For
- "Looks like..." or "Probably..." - These are assumptions, not facts
- "Should be straightforward" - Famous last words
- "Only used in one place" - Verify that place isn't critical
- "Template doesn't use it" - Check for dynamic property access
Danger Zones
- Modifying platform base classes
- Changing cross-service contracts
- Database schema changes
- Entity event handlers (side effects)
- Background job scheduling
See Also
.github/AI-DEBUGGING-PROTOCOL.md - Comprehensive debugging protocol
.ai/prompts/context.md - Platform patterns and context
CLEAN-CODE-RULES.md - Coding standards
1---2name: bug-diagnosis3description: Use when the user asks to debug, diagnose, fix a bug, troubleshoot errors, investigate issues, or pastes error messages/stack traces. Triggers on keywords like "bug", "error", "fix", "not working", "broken", "debug", "stack trace", "exception", "crash", "issue".4---56> **Skill Variant:** Use this skill for **bug diagnosis, debugging, and fixing**. For feature investigation without fixes, use `feature-investigation`. For structured autonomous debugging workflows, use `tasks-bug-diagnosis`.78# Bug Diagnosis & Debugging910You are to operate as an expert full-stack dotnet angular debugging engineer to diagnose, debug, and fix the bug described in `[bug-description-or-bug-info-file-path]`.1112**IMPORTANT**: Always thinks hard, plan step by step to-do list first before execute. Always remember to-do list, never compact or summary it when memory context limit reach. Always preserve and carry your to-do list through every operation. Todo list must cover all phases, from start to end, include child tasks in each phases too, everything is flatted out into a long detailed todo list.1314---1516## Core Anti-Hallucination Protocols1718### ASSUMPTION_VALIDATION_CHECKPOINT1920Before every major operation:21221. "What assumptions am I making about [X]?"232. "Have I verified this with actual code evidence?"243. "Could I be wrong about [specific pattern/relationship]?"2526### EVIDENCE_CHAIN_VALIDATION2728Before claiming any relationship:2930- "I believe X calls Y because..." → show actual code31- "This follows pattern Z because..." → cite specific examples32- "Service A owns B because..." → grep for actual boundaries3334### TOOL_EFFICIENCY_PROTOCOL3536- Batch multiple Grep searches into single calls with OR patterns37- Use parallel Read operations for related files38- Combine semantic searches with related keywords39- Batch Write operations when creating multiple files4041### CONTEXT_ANCHOR_SYSTEM4243Every 10 operations:44451. Re-read the original task description from the `## Metadata` section462. Verify the current operation aligns with original goals473. Check if we're solving the right problem484. Update the `Current Focus` bullet point within the `## Progress` section4950---5152## Quick Reference Checklist5354Before any major operation:5556- [ ] ASSUMPTION_VALIDATION_CHECKPOINT57- [ ] EVIDENCE_CHAIN_VALIDATION58- [ ] TOOL_EFFICIENCY_PROTOCOL5960Every 10 operations:6162- [ ] CONTEXT_ANCHOR_CHECK63- [ ] Update 'Current Focus' in `## Progress` section6465Emergency:6667- **Context Drift** → Re-read `## Metadata` section68- **Assumption Creep** → Halt, validate with code69- **Evidence Gap** → Mark as "inferred"7071---7273## PHASE 1: EXTERNAL MEMORY-DRIVEN BUG ANALYSIS7475Your sole objective is to build a structured knowledge model in a Markdown analysis file at `.ai/workspace/analysis/[some-sort-semantic-name-of-this-task].md` with systematic external memory management.7677### PHASE 1A: INITIALIZATION AND DISCOVERY78791. **Initialize** the analysis file with:80 - `## Metadata` heading with original prompt in markdown box (use 5-6 backticks for proper nesting)81 - Task description and `Source Code Structure` from `.ai/prompts/context.md`82 - Create headings: `## Progress`, `## Errors`, `## Assumption Validations`, `## Performance Metrics`, `## Memory Management`, `## Processed Files`, `## File List`, `## Knowledge Graph`83842. **Populate `## Progress`** with:85 - **Phase**: 186 - **Items Processed**: 087 - **Total Items**: 088 - **Current Operation**: "initialization"89 - **Current Focus**: "[original bug diagnosis task]"9091### DEBUGGING-SPECIFIC DISCOVERY9293**ERROR_BOUNDARY_DISCOVERY**: Focus on debugging-relevant patterns:94951. **Error Tracing Analysis**: Find stack traces, map error propagation paths, identify handling patterns. Document under `## Error Boundaries`.96972. **Component Interaction Debugging**: Discover service dependencies, find relevant endpoints/handlers, analyze request flows. Document under `## Interaction Map`.98993. **Platform Debugging Intelligence**: Find platform error patterns (`PlatformValidationResult`, `PlatformException`), CQRS error paths, repository error patterns. Document under `## Platform Error Patterns`.1001014. **Discovery searches**:102 - Semantic and grep search all error keywords from the task103 - Prioritize: **Domain Entities, Commands, Queries, Event Handlers, Controllers, Background Jobs, Consumers, Frontend Components**104 - Additional targeted searches:105 - `.*EventHandler.*{EntityName}|{EntityName}.*EventHandler`106 - `.*BackgroundJob.*{EntityName}|{EntityName}.*BackgroundJob`107 - `.*Consumer.*{EntityName}|{EntityName}.*Consumer`108 - `.*Service.*{EntityName}|{EntityName}.*Service`109 - `.*Helper.*{EntityName}|{EntityName}.*Helper`110 - All files with pattern: `**/*.{cs,ts,html}`111 - Save ALL file paths to `## File List`112113### PHASE 1B: SYSTEMATIC FILE ANALYSIS FOR DEBUGGING114115**IMPORTANT: MUST DO WITH TODO LIST**1161171. Count total files in file list1182. Split into batches of 10 files in priority order1193. Each batch inserts new task in todo list for analysis1204. **CRITICAL**: Analyze ALL high-priority files: Domain Entities, Commands, Queries, Event Handlers, Controllers, Background Jobs, Consumers, Frontend Components121122For each file, document in `## Knowledge Graph`:123124**Core Fields:**125126- `filePath`: Full path to the file127- `type`: Component classification (Entity, Command, Query, EventHandler, Controller, etc.)128- `architecturalPattern`: Design pattern used129- `content`: Summary of purpose and logic130- `symbols`: Important classes, interfaces, methods131- `dependencies`: All imported modules or using statements132- `businessContext`: Comprehensive detail all business logic, how it contributes to the requirements133- `referenceFiles`: Other files that use this file's symbols134- `relevanceScore`: Numerical score (1-10) for bug relevance135- `evidenceLevel`: "verified" or "inferred"136- `uncertainties`: Any aspects you are unsure about137- `platformAbstractions`: Platform base classes used138- `serviceContext`: Which microservice this file belongs to139- `dependencyInjection`: Any DI registrations140- `genericTypeParameters`: Generic type relationships141142**Debugging-Specific Fields:**143144- `errorPatterns`: Exception handling, validation logic145- `stackTraceRelevance`: Relation to any stack traces146- `debuggingComplexity`: Difficulty to debug (1-10)147- `errorPropagation`: How errors flow through the component148- `platformErrorHandling`: Use of platform error patterns149- `crossServiceErrors`: Any cross-service error scenarios150- `validationLogic`: Business rule validation that could fail151- `dependencyErrors`: Potential dependency failures152153**For Consumer Files (CRITICAL):**154155- `messageBusMessage`: Message type consumed156- `messageBusProducers`: grep search across ALL services to find files that send/publish this message157- `crossServiceIntegration`: Cross-service data flow158- `handleLogicWorkflow`: Processing workflow in HandleLogicAsync159160**Targeted Aspect Analysis:**161162- **For Front-End:** `componentHierarchy`, `routeConfig`, `routeGuards`, `stateManagementStores`, `dataBindingPatterns`, `validationStrategies`163- **For Back-End:** `authorizationPolicies`, `commands`, `queries`, `domainEntities`, `repositoryPatterns`, `businessRuleImplementations`164- **For Consumers:** `messageBusMessage`, `messageBusProducers`, `crossServiceIntegration`, `handleLogicWorkflow`165166### PHASE 1C: OVERALL ANALYSIS167168Write comprehensive `overallAnalysis` summary showing:169170- Complete end-to-end workflows discovered171- Error propagation paths172- Key architectural patterns and relationships173- All business logic workflows:174 - Front-end to back-end flow: Component => API Service => Controller => Command/Query => EventHandler => Others175 - Background job flow: Job => EventHandler => Others176- Integration points and failure points177178---179180## PHASE 2: MULTI-DIMENSIONAL ROOT CAUSE ANALYSIS & COMPREHENSIVE FIX STRATEGY181182**IMPORTANT**: Ensure ALL files are analyzed before this phase. Read the ENTIRE Markdown analysis notes file.183184Perform systematic analysis under `## Root Cause Analysis`:185186### Root Cause Dimensions1871881. **Technical Root Causes**: Code defects, architectural issues1892. **Business Logic Root Causes**: Rule violations, validation failures1903. **Process Root Causes**: Missing validation, inadequate testing1914. **Data Root Causes**: Data corruption, integrity violations1925. **Environmental Root Causes**: Configuration issues, deployment problems1936. **Integration Root Causes**: API contract violations, communication failures194195### Document196197- `potentialRootCauses` ranked by probability198- For each root cause:199 - **Evidence**: file:line references supporting this hypothesis200 - **Confidence**: percentage with justification201 - **Impact**: what's affected if this is the cause202203### Generate Fix Strategy204205Under `## Fix Strategy`, document alternatives, each including:206207- `suggestedFix`: Detailed fix description with file:line targets208- `riskAssessment`: Low/Medium/High with justification209- `regressionMitigation`: Steps to prevent breaking existing functionality210- `testingStrategy`: How to verify the fix works211- `rollbackPlan`: How to undo if the fix causes issues212213### PHASE 2.1: VERIFY AND REFACTOR214215Verify fix strategy follows code patterns from:216217- `.github/copilot-instructions.md`218- `.github/instructions/frontend-angular.instructions.md`219- `.github/instructions/backend-dotnet.instructions.md`220- `.github/instructions/clean-code.instructions.md`221222---223224## PHASE 3: APPROVAL GATE225226**CRITICAL**: Present comprehensive root cause analysis and prioritized fix strategy for my explicit approval.227228**Format for Approval Request:**229230```markdown231## Bug Analysis Complete - Approval Required232233### Root Cause Summary234235[Primary root cause with evidence]236237### Proposed Fix238239[Fix description with specific files and changes]240241### Risk Assessment242243- **Risk Level**: [Low/Medium/High]244- **Regression Risk**: [assessment]245- **Rollback Plan**: [summary]246247### Confidence Level: [X%]248249### Files to Modify:2502511. `path/to/file.cs:line` - [change description]2522. `path/to/file.ts:line` - [change description]253254**Awaiting approval to proceed with implementation.**255```256257**DO NOT** proceed with implementation without explicit user approval.258259---260261## PHASE 4: DEBUGGING EXECUTION262263Once approved:2642651. **Execute the fix plan** following the approved strategy2662. **Use DEBUGGING_SAFEGUARDS**:267 - Make minimal, targeted changes268 - Preserve existing behavior where possible269 - Add comments for non-obvious fixes2703. **Follow platform patterns** from documentation271272---273274## SUCCESS VALIDATION275276Verify fix resolves the bug without regressions. Document under `## Debugging Validation`:277278- **Bug Reproduction Steps (Before)**: How to reproduce the original bug279- **Fix Verification Steps (After)**: How to verify the fix works280- **Regression Testing Results**: Confirmation no existing functionality broke281282---283284## Debugging Guidelines285286- **Evidence-based debugging**: Start with actual error messages, stack traces, and logs287- **Platform error patterns**: Use `PlatformValidationResult` and `PlatformException` patterns288- **Hypothesis-driven approach**: Test one hypothesis at a time with evidence289- **Minimal impact fixes**: Prefer targeted fixes over broad refactoring290- **Verify before claiming**: Never assume - always trace the actual code path291- **Service boundary awareness**: Understand which service owns what292- **Cross-service tracing**: Follow message bus flows across services293294---295296## Platform Error Patterns Reference297298### Backend Validation Patterns299300```csharp301// Use platform validation fluent API302return base.Validate()303 .And(_ => condition, "Error message")304 .AndAsync(async req => await ValidateAsync(req))305 .AndNotAsync(async req => await CheckForbiddenAsync(req), "Not allowed");306307// Use EnsureFound for null checks308await repository.GetByIdAsync(id).EnsureFound($"Not found: {id}");309310// Use EnsureValid for validation results311await entity.ValidateAsync(repository, ct).EnsureValidAsync();312313// Use PlatformException for domain errors314throw new PlatformDomainException("Business rule violated");315```316317### Frontend Error Handling318319```typescript320// Use platform loading/error state321this.apiService322 .getData()323 .pipe(324 this.observerLoadingErrorState('loadData'),325 this.tapResponse(326 data => this.updateState({ data }),327 error => this.handleError(error)328 ),329 this.untilDestroyed()330 )331 .subscribe();332```333334---335336## Quick Verification Checklist337338Before removing/changing ANY code:339340- [ ] Searched static imports?341- [ ] Searched string literals in code?342- [ ] Checked dynamic invocations (attr, prop, runtime)?343- [ ] Read actual implementations?344- [ ] Traced who depends on this?345- [ ] Assessed what breaks if removed?346- [ ] Documented evidence clearly?347- [ ] Declared confidence level?348349**If ANY unchecked → DO MORE INVESTIGATION**350**If confidence < 90% → REQUEST USER CONFIRMATION**351352---353354## Common Bug Categories355356### Data Issues357358- Missing null checks359- Incorrect data transformations360- Race conditions in async operations361- Stale cache data362363### Validation Issues364365- Missing or incorrect validation rules366- Validation bypassed in certain paths367- Async validation not awaited368369### Cross-Service Issues370371- Message bus delivery failures372- Entity sync out of order (check LastMessageSyncDate)373- API contract mismatches374- Missing dependency waits375376### Frontend Issues377378- Component lifecycle issues379- State management bugs380- Form validation not triggered381- API error handling missing382383### Authorization Issues384385- Missing role checks386- Incorrect company context387- Permission not propagated across services388389---390391## Red Flags & Warning Signs392393### Watch For394395- "Looks like..." or "Probably..." - These are assumptions, not facts396- "Should be straightforward" - Famous last words397- "Only used in one place" - Verify that place isn't critical398- "Template doesn't use it" - Check for dynamic property access399400### Danger Zones401402- Modifying platform base classes403- Changing cross-service contracts404- Database schema changes405- Entity event handlers (side effects)406- Background job scheduling407408---409410## See Also411412- `.github/AI-DEBUGGING-PROTOCOL.md` - Comprehensive debugging protocol413- `.ai/prompts/context.md` - Platform patterns and context414- `CLEAN-CODE-RULES.md` - Coding standards