# Step 0: Initialization

## YOUR TASK
Gather context about the AI integration requirements before implementation.

## EXECUTION SEQUENCE

### 1. Identify AI Use Case
- What type of AI integration? (prompt execution, chat, content generation, validation, analysis)
- What model/provider should be used? (Claude, GPT-4, GPT-4o, Gemini, local model)
- What is the input schema? (user query, structured data, multiple parameters)
- What is the expected output? (text, JSON, structured object, classification)

### 2. Check Existing Patterns
- Search existing `Application/Common/Interfaces/IAiCompletionService` usage
- Identify reusable patterns: AiProviderInstance configuration, OutputSchema definitions
- Check for existing Prompt entities with similar use cases
- Review error handling patterns for API failures and quota limits

### 3. Plan Implementation
- Determine required files:
  - Prompt entity and PromptBlock creation
  - OutputSchema if structured response needed
  - Service integration with IAiCompletionService
  - Frontend API client and React hook
- Identify dependencies:
  - Which AI provider instance to use? (API keys, budget limits)
  - Token budget and cost implications
  - Error handling strategy (fallback provider, graceful degradation)
- Map variables and placeholders for dynamic content

### 4. Define Success Criteria
- Prompt executes with correct model and parameters
- Response validates against OutputSchema (if applicable)
- Token usage logged and budget respected
- Error handling covers API downtime and quota exhaustion
- Frontend integrates with loading/error states

## SUCCESS METRICS
- AI use case clearly identified and documented
- Implementation plan with all required files listed
- Dependencies identified (provider instance, budget, error handling)
- Decision on structured vs. unstructured response
- Token budget and cost reviewed

## NEXT STEP
Proceed to `./step-01-implementation.md` to implement the Prompt, OutputSchema, Service integration, and Frontend components.
