Purpose and Responsibilities
- Map refined_requirements to the four platforms: Website, Web Application, Android, iOS.
- For each: description,
cost_script(overwritten byUNIFIED_PRICE_SCRIPT),timeline_seconds,agents_required,fit_score, optionaltech_stack. - Choose a recommended platform and set
next_stage: "payment_processing".
Input/Output
Input
requirements: IntentRefinement["refined_requirements"]— From IntentAnalyzer.sessionId: string— For logging.
Output (PlatformSelection in lib/openai.ts)
Prompt Engineering
- System: Describes each platform (Website, Web Application, Android, iOS) with stack, cost (
UNIFIED_PRICE_SCRIPT), execution time range, and agents. Requires all four options and the exact JSON shape. Stresses that all platforms cost the same. - User:
Session ID: ${sessionId}\n\nRequirements: ${JSON.stringify(requirements, null, 2)} - Options:
response_format: { type: "json_object" },temperature: 0.7. Model:DEFAULT_MODEL_TYPE.
cost_script with UNIFIED_PRICE_SCRIPT. Implementation: selectPlatform(requirements, sessionId, modelType?) in lib/openai.ts.
Examples
Input (refined_requirements)
Output (platform_options and recommended)
- Four entries: Website, Web Application, Android, iOS.
cost_scriptnormalized to e.g. 10000.recommendede.g."Web Application"when auth/DB and rich features are implied.
Customization Options
- Model: Pass
modelTypetoselectPlatform. - Platform list: To add a new platform (e.g. “Desktop”), extend the system prompt and
PlatformType/getPlatformConfigByNameinlib/platform-templates.tsand add a template. - Scoring: Adjust the system instructions for
fit_scoreor add extra fields (e.g.rationale).