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:
- Fix issues in the prompt only
- Fix issues via post-generation auto-correction only
- 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
apis/backend-vitto-api/src/app/module-generation/validation/auto-correction.service.tsapis/backend-vitto-api/src/prompts/module-gen/implement.prompt.md
🔗 Related
- Decision ID:
dev_1772030872296_zprg4hc - Session: 138
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation