Agent Instructor
Agent Instructor for VS Code
A powerful VS Code extension designed to help developers create, analyze, and refine instructions for declarative AI agents.
Features
1. Analyze Instructions
Evaluates existing agent instructions for clarity and potential improvements:
- Generates a clarity score (0-100)
- Identifies ambiguous phrases
- Provides specific improvement suggestions
- Offers one-click corrections
- Visualizes analysis results with charts

2. Generate Instructions
Creates comprehensive instructions for new agents:
- Interactive agent description input
- AI-powered instruction generation
- Automatic formatting and organization
- Maintains existing content when adding new instructions
- Supports multiple instruction sets per file

Installation
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "Agent Instructor"
- Click Install
Configuration
Configure the extension in VS Code settings (File > Preferences > Settings > Extensions > Agent Instructor):
Setting |
Description |
Default |
apiKey |
Your LLM service API key |
"" |
endpointType |
Choose openai or azure |
"openai" |
endpointUrl |
LLM API endpoint URL |
"" |
maxTokens |
Maximum tokens in response (1-4096) |
1000 |

Endpoint Configuration Examples
OpenAI
{
"agentInstructor.endpointType": "openai",
"agentInstructor.endpointUrl": "",
"agentInstructor.apiKey": "your-openai-api-key"
}
Azure OpenAI
{
"agentInstructor.endpointType": "azure",
"agentInstructor.endpointUrl": "https://your-resource.openai.azure.com/deployments/your-deployment/chat/completions?api-version=2023-07-01-preview",
"agentInstructor.apiKey": "your-azure-api-key"
}
Usage
Analyzing Instructions
- Open your
instruction.txt
file
- Command Palette (Ctrl+Shift+P)
- Select "Agent Instructor: Analyze Instructions"
- Review the analysis in the sidebar:
- Clarity Score
- Identified Issues
- Suggested Improvements
- Click "Apply Correction" to implement suggestions
Generating Instructions
- Create or open an
instruction.txt
file
- Command Palette (Ctrl+Shift+P)
- Select "Agent Instructor: Generate Instructions"
- Enter your agent description
- Review and edit generated instructions
Best Practices
- Keep instruction files named as
instruction.txt
- Use clear, specific agent descriptions
- Review and customize generated instructions
- Regularly analyze existing instructions
- Apply suggested improvements selectively
Troubleshooting
Common issues and solutions:
API Connection Failed
- Verify API key is correct
- Check endpoint URL format
- Ensure internet connectivity
Invalid File Type
- Ensure file is named
instruction.txt
- Open file in editor before running commands
Generation/Analysis Timeout
- Try reducing
maxTokens
setting
- Check internet connection stability
Development
Building from Source
git clone https://github.com/stephanbisser/agent-instructor.git
cd agent-instructor
npm install
npm run compile
Running Tests
npm run test
Release Notes
0.0.6
- Added maxTokens configuration
- Improved error handling
- Enhanced UI responsiveness
0.0.1
- Initial preview release
- Basic analysis features
- Instruction generation support
Contributing
- Fork the repository
- Create a feature branch
- Submit a pull request
License
This project is licensed under the MIT License.
Support
For issues and feature requests, please use the GitHub Issues page.