Purpose and Responsibilities
- Combine the original idea and answers to clarifying questions.
- Produce structured refined_requirements: title, description, features, target_audience, technical_requirements.
- Output must be ready for PlatformSelector and Execution.
Input/Output
Input
idea: string— FromWorkflowContext(or fallback in request).answers: string[]— User answers toclarifying_questions.sessionId: string— For logging.
Output (IntentRefinement in lib/openai.ts)
Prompt Engineering
- System: Defines the “expert requirements analyst (IntentAnalyzer)” and the exact JSON shape. No extra fields.
- User:
Session ID: ${sessionId}\nOriginal Idea: ${idea}\nUser Answers: ${answers.join("\n")} - Options:
response_format: { type: "json_object" },temperature: 0.7. Model:DEFAULT_MODEL_TYPE.
refineIntent(idea, answers, sessionId, modelType?) in lib/openai.ts.
Examples
Input (conceptual)
- Idea: “A habit tracker with streaks and reminders.”
- Answers:
["Web first, mobile later", "No social", "Push and in-app reminders"]
Output (refined_requirements)
Customization Options
- Model: Pass
modelTypetorefineIntent. - System prompt: Adjust in
lib/openai.tsto enforce different structure (e.g. more fields, stricter technical_requirements). - Stricter parsing: Add a schema/validator on the parsed JSON before returning.