frontierai.solutions
Copilot instructions2 starsChanged 13 months agoMITView on GitHub
This is a full-stack AI-powered web application showcasing Frontier AI solutions with voice-first experiences. The application enables real-time voice conversations with an AI avatar agent, powered by Azure AI services.
- Reads credentials
- Installs packages
The file
Show its rules and text
We split this copilot-instructions.md into the rules it gives an agent
36 rules. About 0 are common, 22 are distinctive, and 14 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈22
Distinctive · estimate
This author's own choices. Worth a look.
14
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 56
Use Python 3.12+ type hints for all function signatures
- Distinctive: line 57
Follow PEP 8 style guidelines
- Distinctive: line 58
Use async/await for I/O operations (FastAPI endpoints, WebSocket handlers)
- Very specific: line 64
Use dependency injection for services (FastAPI Depends)
- Distinctive: line 68
Use functional components with React Hooks
- Very specific: line 69
Prefer const over let, avoid var
- Distinctive: line 70
Use TypeScript strict mode - always define interfaces/types
- Very specific: line 72
Place UI components in src/components/
- Very specific: line 73
Use feature-based folders (e.g., avatar/, explore/, inspire/)
- Very specific: line 74
Keep reusable UI components in src/components/ui/
- Distinctive: line 77
Use Framer Motion for animations
- Distinctive: line 78
Follow Tailwind CSS utility-first approach
- Distinctive: line 81
Write clear, descriptive commit messages
- Distinctive: line 82
Add comments for complex business logic
- Distinctive: line 83
Keep functions small and focused (single responsibility)
- Distinctive: line 84
Use meaningful variable and function names
- Distinctive: line 198
Use Azure Key Vault or Managed Identity in production
- Distinctive: line 200
Use RBAC role assignments for service-to-service authentication
- Distinctive: line 213
Write unit tests for business logic
- Distinctive: line 214
Test WebSocket connections thoroughly
- Distinctive: line 216
Test responsive design across different screen sizes
- Distinctive: line 217
Verify Azure service integrations before deployment
- Very specific: line 222
Use azd up for full deployment to Azure (provision + deploy)
- Very specific: line 223
Use azd provision to only provision infrastructure
- Very specific: line 224
Use azd deploy to only deploy application code
- Very specific: line 262
Test infrastructure changes with azd provision before full deployment
- Very specific: line 281
Add route in backend/app/main.py or create new module
- Distinctive: line 282
Use FastAPI dependency injection for services
- Distinctive: line 283
Add proper type hints and response models
- Very specific: line 284
Update frontend API service in frontend/src/services/api.ts
- Very specific: line 287
Create component file in appropriate src/components/ subfolder
- Distinctive: line 289
Use Tailwind CSS for styling
- Distinctive: line 290
Add to parent component imports
- Very specific: line 293
Update relevant Bicep files in infra/
- Very specific: line 294
Test changes with azd provision
- Distinctive: line 295
Document changes in deployment docs
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Copilot Instructions for Frontier AI Solutions
Project Overview
This is a full-stack AI-powered web application showcasing Frontier AI solutions with voice-first experiences. The application enables real-time voice conversations with an AI avatar agent, powered by Azure AI services.
Technology Stack
Backend
- Language: Python 3.12+
- Framework: FastAPI (with standard extras for uvicorn)
- Package Manager: uv
- Key Dependencies:
fastapi[standard]>=0.120.0- Web framework with async supportazure-cognitiveservices-speech>=1.38.0- Azure Speech Services SDKopenai>=1.0.0- OpenAI/Azure OpenAI clientazure-identity>=1.15.0- Azure authenticationwebsockets>=12.0- WebSocket support for real-time voiceredis>=7.0.1- Redis client for cachingaiohttp>=3.9.0- Async HTTP clientbeautifulsoup4>=4.14.2,lxml>=6.0.2- HTML parsingrequests>=2.32.5- HTTP client
- Main Entry:
backend/app/main.py - API Documentation: Available at
/docs(Swagger UI)
Frontend
- Language: TypeScript 5.9+
- Framework: React 19+
- Build Tool: Vite 7+
- Package Manager: pnpm
- Key Dependencies:
react&react-dom- Core React librariesframer-motion- Animation library for smooth transitionslucide-react- Icon libraryreact-markdown&remark-gfm- Markdown rendering with GitHub Flavored Markdown@azure/cosmos- Azure Cosmos DB clientredis- Redis client for frontend scripts
- Dev Dependencies:
@tailwindcss/postcss&tailwindcss- Utility-first CSS framework@tailwindcss/typography- Typography plugin@vitejs/plugin-react- React plugin for Vitetypescript- Type checking
- Main Entry:
frontend/src/main.tsx
Infrastructure
- Cloud Provider: Azure
- Deployment: Azure Container Apps
- IaC: Bicep templates in
infra/ - CLI: Azure Developer CLI (azd)
- Container Registry: Azure Container Registry (ACR)
- Monitoring: Application Insights + Log Analytics Workspace
Code Style and Conventions
Python Backend
- Use Python 3.12+ type hints for all function signatures
- Follow PEP 8 style guidelines
- Use async/await for I/O operations (FastAPI endpoints, WebSocket handlers)
- Organize code in the
app/directory by feature:config.py- Configuration and environment variableswebsocket_handler.py- WebSocket connection managementstory_scraper.py- Data fetching and processingredis_client.py- Redis caching layer
- Use dependency injection for services (FastAPI
Depends) - Handle errors with appropriate HTTP status codes and clear error messages
TypeScript Frontend
- Use functional components with React Hooks
- Prefer
constoverlet, avoidvar - Use TypeScript strict mode - always define interfaces/types
- Component organization:
- Place UI components in
src/components/ - Use feature-based folders (e.g.,
avatar/,explore/,inspire/) - Keep reusable UI components in
src/components/ui/
- Place UI components in
- Custom hooks go in
src/hooks/ - API services in
src/services/ - Use Framer Motion for animations
- Follow Tailwind CSS utility-first approach
General Guidelines
- Write clear, descriptive commit messages
- Add comments for complex business logic
- Keep functions small and focused (single responsibility)
- Use meaningful variable and function names
Development Workflow
Starting Development Servers
Backend:
cd backend
uv sync
uv run fastapi dev app/main.pyFrontend:
cd frontend
pnpm install
pnpm run devAdding Dependencies
Backend:
cd backend
uv add <package-name>Frontend:
cd frontend
pnpm add <package-name>Azure Integration
Services Used
- Azure AI Foundry (Cognitive Services): Multi-service AI resource
- Deployed as
Microsoft.CognitiveServices/accountswith kindAIServices - SKU: S0 (Standard)
- Custom subdomain for API access
- Includes model deployments:
gpt-4o(version 2024-08-06) - Primary conversation modeltext-embedding-ada-002- Text embeddings
- Deployed as
- Azure Speech Services: Dedicated speech resource
- Real-time voice conversations via Voice Live API
- SKU: S0 (Standard)
- Region: eastus2
- Azure OpenAI: Language models via AI Foundry
- Endpoint: Part of AI Foundry resource
- Model: gpt-4o deployment
- Azure Container Apps: Application hosting
- Managed Kubernetes environment
- Separate apps for backend and frontend
- Log Analytics integration for monitoring
- Azure Container Registry (ACR): Docker image storage
- Basic SKU with admin user enabled
- Stores backend and frontend container images
- Azure Redis Cache: Distributed caching
- Host:
frontiersolredis.eastus2.redis.azure.net - Port: 10000 (SSL)
- Used for caching stories and frequently accessed data
- Host:
- Application Insights: Application performance monitoring
- Integrated with Log Analytics
- Tracks requests, dependencies, and exceptions
- Managed Identity: RBAC authentication
- User-assigned identity for backend service
- Roles: Cognitive Services User, Cognitive Services OpenAI User
Environment Variables
Backend (backend/.env)
Required environment variables:
# Server Configuration
PORT=8000
ENVIRONMENT=development
# Azure AI Configuration
AZURE_AI_RESOURCE_NAME=aifoundry-voicelab-xfb4fkemkyfbg
AZURE_AI_REGION=eastus2
AZURE_AI_PROJECT_NAME=default-project
PROJECT_ENDPOINT=https://{resource}.cognitiveservices.azure.com/api/projects/{project}
USE_AZURE_AI_AGENTS=false
# Azure OpenAI Configuration
AZURE_OPENAI_ENDPOINT=https://{resource}.cognitiveservices.azure.com/
AZURE_OPENAI_API_KEY={key} # Use Managed Identity in production
MODEL_DEPLOYMENT_NAME=gpt-4o
# Azure Speech Configuration
AZURE_SPEECH_KEY={key} # Use Managed Identity in production
AZURE_SPEECH_REGION=eastus2
# Azure Subscription Configuration
SUBSCRIPTION_ID={subscription-id}
RESOURCE_GROUP_NAME=rg-avatar-gh-sample
# Avatar Configuration
AZURE_AVATAR_CHARACTER=lori
AZURE_AVATAR_STYLE=graceful
# Redis Configuration
REDIS_HOST={redis-name}.eastus2.redis.azure.net
REDIS_PORT=10000
REDIS_PASSWORD={redis-key}Frontend
- Frontend environment variables should be prefixed with
VITE_ - Typically includes backend API URL
Security Best Practices
- Never commit secrets or API keys to the repository
- Use Azure Key Vault or Managed Identity in production
- The
.envfile should be in.gitignore - Use RBAC role assignments for service-to-service authentication
- Rotate keys regularly and use Key Vault references
Key Features to Maintain
- Real-time Voice Conversations: WebSocket-based bidirectional communication
- Avatar Integration: Visual avatar with synchronized voice responses
- Conversation Transcripts: Real-time display of conversation text
- AI Recommendations: Context-aware suggestions based on conversations
- Catalog System: Dynamic loading of solutions and categories from data files
Testing and Quality
- Write unit tests for business logic
- Test WebSocket connections thoroughly
- Validate API responses and error handling
- Test responsive design across different screen sizes
- Verify Azure service integrations before deployment
Deployment
Azure Developer CLI (azd)
- Use
azd upfor full deployment to Azure (provision + deploy) - Use
azd provisionto only provision infrastructure - Use
azd deployto only deploy application code - Configuration file:
azure.yamlat project root
Infrastructure as Code (Bicep)
Infrastructure is defined in infra/ directory:
main.bicep: Entry point, creates resource group and calls resources module- Parameters: environmentName, location, principalId, principalType
- Outputs: Container registry, OpenAI endpoints, app URIs, managed identity
resources.bicep: Defines all Azure resources- AI Foundry with model deployments (gpt-4o, embeddings)
- Speech Services
- Container Registry (Basic SKU)
- Container Apps Environment with Log Analytics
- Application Insights
- User-assigned Managed Identity for backend
- RBAC role assignments (Cognitive Services User, OpenAI User)
core/host/container-app.bicep: Container App definition templatecore/host/container-apps.bicep: Multiple container apps orchestrationmodules/fetch-container-image.bicep: Helper for container image referencesabbreviations.json: Azure resource naming abbreviationsmain.parameters.json: Parameter values for deployment
Deployment Process
- Build Containers: Docker images built for backend and frontend
- Push to ACR: Images pushed to Azure Container Registry
- Provision Infrastructure: Bicep templates create/update Azure resources
- Deploy Apps: Container Apps pull images from ACR and run
- Configure Networking: CORS, custom domains, SSL certificates
Container Apps Architecture
- Frontend and backend are deployed as separate container apps
- Both run in the same Container Apps Environment
- Log Analytics captures all container logs
- Application Insights monitors performance and errors
- Managed Identity used for secure service-to-service authentication
Important Notes
- Infrastructure changes require updating Bicep templates in
infra/ - Test infrastructure changes with
azd provisionbefore full deployment - Review
DEPLOYMENT.mdand related deployment docs for detailed procedures - Container images are stored in ACR with unique tags
- Health check endpoints should be defined for Container Apps
Data Management
- Data files located in
backend/data/:catalog.json- Solution catalogcategories.json- Category definitionscontent.json- Content metadatasolutions.json- Solution detailssettings.json- Application settings
- Redis used for caching (see
redis_client.py) - Backup scripts available in
backend/scripts/
Common Tasks
Adding a New API Endpoint
- Add route in
backend/app/main.pyor create new module - Use FastAPI dependency injection for services
- Add proper type hints and response models
- Update frontend API service in
frontend/src/services/api.ts
Adding a New Component
- Create component file in appropriate
src/components/subfolder - Define TypeScript interfaces for props
- Use Tailwind CSS for styling
- Add to parent component imports
Modifying Infrastructure
- Update relevant Bicep files in
infra/ - Test changes with
azd provision - Document changes in deployment docs
Helpful Context
- WebSocket connections handle real-time voice streaming
- Avatar state management is in
AvatarModal.tsx - Conversation flow managed through custom hooks (
useWebRTC.tsx,useRecorder.tsx) - Category and role data dynamically loaded from backend API
- Redis caching improves performance for frequently accessed data
Questions to Ask Before Implementation
- Does this change affect both frontend and backend? Consider API contracts.
- Are there environment variables or secrets needed? Use secure storage.
- Does this require Azure service changes? Update infrastructure as code.
- Is this user-facing? Ensure responsive design and accessibility.
- Does this impact WebSocket communication? Test thoroughly with real-time scenarios.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

