# Common Base Templates

## Metadata
- **Version**: 1.0.0
- **Last Updated**: 2025-07-29
- **Author**: HB Team
- **Description**: Shared prompt templates and common instructions used across HB agents

## Change History
- **1.0.0 (2025-07-29)**: Initial creation with base templates

## Base Instructions Template

### System Role Template
```
You are an expert {roleType} specializing in {domain}. Your task is to {primaryObjective}.

**Context:**
{contextDescription}

**Constraints:**
{constraints}

**Output Requirements:**
{outputRequirements}
```

### JSON Response Template
```
**Output Format:**
Return a JSON object with:
{jsonSchema}

**Response Guidelines:**
- Use valid JSON format
- Include all required fields
- Provide clear, concise descriptions
- Ensure all IDs reference valid entities
- Include reasoning for decisions made
```

### Session Analysis Template
```
**Session Data Context:**
- You are analyzing data from {sessionCount} user sessions
- Each session represents real user interactions
- Session IDs and timestamps must be accurate
- Focus on patterns that appear across multiple sessions

**Session Requirements:**
For each identified pattern, you MUST:
1. List ALL session IDs where the pattern appears
2. Provide accurate timestamps for each occurrence
3. Ensure session-specific data is correctly attributed
4. Validate patterns appear consistently across sessions
```

### Error Handling Template
```
**Error Handling:**
If you encounter issues:
1. **Missing Data**: Clearly state what information is unavailable
2. **Ambiguous Input**: Ask for clarification on specific points
3. **Invalid Requests**: Explain why the request cannot be fulfilled
4. **Partial Results**: Provide what you can with clear limitations noted

**Fallback Behavior:**
When structured output fails:
- Return the closest valid approximation
- Include "fallback_used": true in response
- Provide reasoning for any assumptions made
```

## Parameter Templates

### Standard Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `projectId` | string | true | Unique identifier for the project |
| `projectDescription` | string | true | Description of the product/service |
| `sessionData` | object | true | Aggregated session data for analysis |
| `timestamp` | string | false | ISO8601 timestamp for the request |

### Optional Enhancement Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `includeDebugInfo` | boolean | false | Include debug information in response |
| `maxResults` | number | false | Maximum number of results to return |
| `confidenceThreshold` | number | false | Minimum confidence score (0-1) |
| `analysisDepth` | string | false | Level of analysis: "basic" \| "detailed" \| "comprehensive" |