4.7 KiB
4.7 KiB
PHASE 8: UNIVERSAL CONTENT TYPES
Detailed Implementation Plan
Goal: Extend content system to support products, services, taxonomies.
Timeline: 2-3 weeks
Priority: LOW
Dependencies: Phase 4
TABLE OF CONTENTS
- Overview
- Content Model Extensions
- Content Type Prompts
- Content Service Extensions
- Linker & Optimizer Extensions
- Testing & Validation
- Implementation Checklist
OVERVIEW
Objectives
- ✅ Support product content generation
- ✅ Support service page generation
- ✅ Support taxonomy generation
- ✅ Extend linker for all content types
- ✅ Extend optimizer for all content types
Key Principles
- Unified Model: All content types use same Content model
- Type-Specific Prompts: Different prompts per content type
- Universal Processing: Linker and Optimizer work on all types
CONTENT MODEL EXTENSIONS
8.1 Content Model Extensions
| Task | File | Dependencies | Implementation |
|---|---|---|---|
| Add entity_type field | business/content/models.py |
Phase 1 | Content type field |
| Add json_blocks field | business/content/models.py |
Phase 1 | Structured content blocks |
| Add structure_data field | business/content/models.py |
Phase 1 | Content structure data |
Content Model Extensions:
# business/content/models.py
class Content(SiteSectorBaseModel):
# Existing fields...
# NEW: Entity type
entity_type = models.CharField(
max_length=50,
choices=[
('blog_post', 'Blog Post'),
('article', 'Article'),
('product', 'Product'),
('service', 'Service Page'),
('taxonomy', 'Taxonomy Page'),
('page', 'Page'),
],
default='blog_post'
)
# NEW: Structured content
json_blocks = models.JSONField(default=list)
structure_data = models.JSONField(default=dict)
CONTENT TYPE PROMPTS
8.2 Content Type Prompts
| Task | File | Dependencies | Implementation |
|---|---|---|---|
| Product Prompts | infrastructure/ai/prompts.py |
Existing prompt system | Product generation prompts |
| Service Page Prompts | infrastructure/ai/prompts.py |
Existing prompt system | Service page prompts |
| Taxonomy Prompts | infrastructure/ai/prompts.py |
Existing prompt system | Taxonomy prompts |
CONTENT SERVICE EXTENSIONS
8.3 Content Service Extensions
| Task | File | Dependencies | Implementation |
|---|---|---|---|
| Product Content Generation | business/content/services/content_generation_service.py |
Phase 1 | Generate product content |
| Service Page Generation | business/content/services/content_generation_service.py |
Phase 1 | Generate service pages |
| Taxonomy Generation | business/content/services/content_generation_service.py |
Phase 1 | Generate taxonomy pages |
LINKER & OPTIMIZER EXTENSIONS
8.4 Linker & Optimizer Extensions
| Task | File | Dependencies | Implementation |
|---|---|---|---|
| Product Linking | business/linking/services/linker_service.py |
Phase 4 | Link products |
| Taxonomy Linking | business/linking/services/linker_service.py |
Phase 4 | Link taxonomies |
| Product Optimization | business/optimization/services/optimizer_service.py |
Phase 4 | Optimize products |
| Taxonomy Optimization | business/optimization/services/optimizer_service.py |
Phase 4 | Optimize taxonomies |
TESTING & VALIDATION
8.5 Testing
Test Cases:
- ✅ Product content generates correctly
- ✅ Service pages work
- ✅ Taxonomy pages work
- ✅ Linking works for all types
- ✅ Optimization works for all types
IMPLEMENTATION CHECKLIST
Backend Tasks
- Extend Content model with entity_type, json_blocks, structure_data
- Add product prompts
- Add service page prompts
- Add taxonomy prompts
- Extend ContentService for product generation
- Extend ContentService for service page generation
- Extend ContentService for taxonomy generation
- Extend LinkerService for products
- Extend LinkerService for taxonomies
- Extend OptimizerService for products
- Extend OptimizerService for taxonomies
SUCCESS CRITERIA
- ✅ Product content generates correctly
- ✅ Service pages work
- ✅ Taxonomy pages work
- ✅ Linking works for all types
- ✅ Optimization works for all types
END OF PHASE 8 DOCUMENT