Pattern: What auto-correction rules are needed to make LLM-generated ...

Documentation for Sessions

🎨 Pattern: What auto-correction rules are needed to make LLM-generated ...

Date: 2026-02-25
Time: 14:47:53 UTC
Session: gspace1-138.9
Agent: angular
Confidence: 95%
Status: ✅ Documented


📋 Decision Context

Question:

What auto-correction rules are needed to make LLM-generated Angular code production-ready?

Task: Code generation quality strategy


🎯 Decision Made

Chosen:

Both: improved prompt (AI-RULES, golden examples) + 27 auto-correction rules

Options Considered:

  1. Fix issues in the prompt only
  2. Fix issues via post-generation auto-correction only
  3. Both prompt improvements AND auto-correction

💭 Reasoning

The prompt provides guardrails (AI-RULES banning Angular Material, requiring takeUntilDestroyed, etc.) but the LLM still produces edge-case issues. Auto-correction catches what the prompt misses: (1) changeDetection:0 → enum + import, (2) String/Number/Boolean → primitives, (3) Enum → string, (4) missing HTML/SCSS templates, (5) missing route components, (6) space-in-identifiers, (7) bare .subscribe() without cleanup, (8) .patch → .put, (9) duplicate model fields, (10) Angular Material imports, (11) null services detection, (12) template-TS consistency, (13) HttpClient → UniverseDataService rewrite with query param preservation. The two layers complement each other: prompt reduces the volume of issues, auto-correction catches the remainder mechanically.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation