methunraj
refactor: restructure project with modular prompts and instructions
90b0a17
# Instructions Directory
This directory contains all agent instructions used by the Data Extractor application in JSON format.
## Structure
```
instructions/
β”œβ”€β”€ README.md (this file)
└── agents/
β”œβ”€β”€ data_extractor.json # Data extraction agent instructions
β”œβ”€β”€ data_arranger.json # Data organization agent instructions
└── code_generator.json # Excel code generation agent instructions
```
## JSON Format
Each instruction file follows this structure:
```json
{
"instructions": [
"First instruction line",
"Second instruction line",
"..."
],
"agent_type": "data_extractor|data_arranger|code_generator",
"description": "Brief description of the agent's role",
"category": "agents or other category"
}
```
## Benefits of JSON Format
1. **Structure**: Clean separation of instructions as array elements
2. **Metadata**: Includes agent type and description for context
3. **No Conversion**: Direct use as lists - no need to split strings
4. **Maintainability**: Easy to add, remove, or reorder instructions
5. **Validation**: JSON schema validation possible
## Usage
```python
from utils.prompt_loader import prompt_loader
# Load as list for agent initialization
instructions_list = prompt_loader.load_instructions_as_list("agents/data_extractor")
# Load as string for other uses
instructions_text = prompt_loader.load_instruction("agents/data_extractor")
```