AICHE +CopilotGithub Copilot Integration

Voice commands for AI coding

Speak detailed context to Copilot. Get better AI-generated code with voice.

Download AICHE
Works on:
macOSWindowsLinux

The short answer: open your editor with Copilot, start a comment block, press ⌃+⌥+R (Mac) or Ctrl+Alt+R (Windows/Linux), speak your detailed requirements for 60-120 seconds, and AICHE inserts a comprehensive prompt that produces better Copilot code.

GitHub Copilot generates better code with detailed context, but typing comprehensive prompts as comments takes 5-8 minutes and interrupts flow state. Voice captures requirements faster while maintaining specificity.

  1. Open your code editor (VS Code, Cursor, etc.) with Copilot enabled.
  2. Position your cursor where you need code generated.
  3. Start a comment block for your language (//, #, """, etc.).
  4. Press your AICHE hotkey to start recording.
  5. Speak your complete requirement with edge cases and context.
  6. Press the hotkey again-AICHE transcribes and inserts the detailed prompt.
  7. Let Copilot read the context and generate code based on your verbal specification.

Detailed Prompt Engineering

API Endpoint Specifications

For backend code generation, speak complete requirements. Example: "Create prompt for Copilot to generate authentication API endpoint. Need POST endpoint at slash api slash auth slash login accepting JSON body with email and password fields. Validate email format using regex, check password minimum 8 characters. Query PostgreSQL users table for matching email using parameterized query to prevent SQL injection. Compare password with stored bcrypt hash using constant time comparison. If valid generate JWT access token with 15 minute expiration containing user id and role in payload, generate refresh token with 7 day expiration stored in HTTP only cookie. Return JSON response with access token, user object containing id, email, and name, exclude password hash. If invalid return 401 status with generic error message to prevent user enumeration. Include rate limiting to 5 attempts per IP per minute. Log authentication attempts with timestamp and IP address. Handle database connection errors with 500 status and proper error logging without exposing internal details to client."

The comprehensive prompt guides Copilot to generate production-ready code with security considerations.

React Component Generation

For frontend components, dictate detailed UI behavior. Example: "Generate React component for shopping cart sidebar. Component accepts cart items array, onUpdateQuantity callback, onRemoveItem callback, and onCheckout callback. Renders slide-out panel from right side using Framer Motion with spring animation. Shows cart items list with product image, name, price, quantity stepper with plus and minus buttons disabled at min 1 and max 10, and remove button with trash icon. Cart header displays total item count and close button. Cart footer shows subtotal, shipping estimate, tax calculation at 8 percent, and total price with currency formatting. Checkout button disabled when cart empty with gray styling, enabled state shows primary color. Empty cart state displays centered message and shop now button. Loading state during price calculations shows skeleton placeholders. Mobile responsive collapses to full screen overlay below 768px breakpoint. Keyboard accessible with focus trap, escape key closes panel, tab navigation works. Includes TypeScript props interface and CSS modules for styling."

Detailed component specifications produce better Copilot suggestions that need less editing.

Database Query Generation

For data access code, speak query requirements explicitly. Example: "Generate TypeScript function for user search with pagination. Function accepts search term string, page number, page size, and optional filters for user role and account status. Returns paginated results with users array, total count, current page, and page count. Query searches across username, email, and full name fields using PostgreSQL full-text search with ts_vector. Uses parameterized queries to prevent SQL injection. Implements OFFSET and LIMIT for pagination. Adds WHERE clauses for role and status filters when provided. Sorts by relevance score descending for search results, falls back to created_at descending for empty search. Includes LEFT JOIN to user_profiles for additional user data. Query uses index on username_search ts_vector column. Function returns typed result with Prisma or TypeORM. Handles empty search returning all users with filters applied. Validates page number greater than zero and page size between 10 and 100."

Speaking database requirements produces queries with proper indexing and security considerations.

Context-Rich Prompts

Error Handling Specifications

When generating error handling, provide comprehensive context. Example: "Add error handling to file upload API endpoint. Handle file size validation rejecting files over 10 MB with 413 Payload Too Large status. Validate file type allowing only JPEG, PNG, and PDF with MIME type checking not just extension. Generate unique filename using UUID to prevent conflicts and path traversal attacks. Upload to AWS S3 using AWS SDK with streaming to handle large files efficiently. Implement retry logic with exponential backoff for network failures up to 3 attempts. Handle S3 errors including bucket access denied returning 500, quota exceeded returning 507, and network timeout returning 504. Clean up temporary files on both success and failure using try-finally block. Log upload attempts with user ID, file size, and outcome for monitoring. Return JSON response with file URL, S3 key, and upload timestamp on success. Include correlation ID in error responses for debugging."

Comprehensive error scenarios guide Copilot to generate robust code.

Test Generation

For test code, speak test scenarios explicitly. Example: "Generate integration tests for user registration endpoint using Jest and Supertest. Test happy path: valid email and password returns 201 status with user object and auth token. Test validation errors: missing email returns 400, invalid email format returns 400, weak password under 8 characters returns 400, password without number returns 400. Test duplicate email: attempting to register existing email returns 409 with appropriate error message. Test database errors: mock database failure returns 500 without exposing internals. Test security: verify password is hashed with bcrypt not stored in plain text, check auth token is valid JWT with correct expiration. Test rate limiting: 5 successful registrations followed by 6th returns 429 Too Many Requests. Test cleanup: each test creates fresh database state, cleanup runs after each test. Include test fixtures for valid and invalid user data. Mock external services like email verification. Use test database separate from development."

Detailed test scenarios produce comprehensive test suites from Copilot.

Algorithm Specifications

Data Structure Implementation

For algorithms, specify requirements completely. Example: "Implement LRU cache class in TypeScript with generic key and value types. Constructor accepts maximum capacity. Get method accepts key, returns value if exists and moves item to front of access order, returns undefined if not found. Put method accepts key and value, adds new item at front, updates existing item and moves to front, evicts least recently used item when capacity exceeded. Delete method removes key if exists. Clear method removes all entries. Has method returns boolean for key existence. Size property returns current item count. Implementation uses Map for O of 1 lookup and doubly linked list for O of 1 reordering. All operations thread safe for concurrent access. Includes TypeScript generics for type safety. Add comprehensive JSDoc comments. Include example usage in comments showing cache initialization, adding items, accessing causing reordering, and capacity overflow triggering eviction."

Algorithmic specifications with complexity requirements guide Copilot to efficient implementations.

Result: Copilot prompts with detailed security requirements, edge case handling, and type specifications that took 10 minutes to type now take 2 minutes to speak, and speaking requirements out loud often reveals missing cases before code generation, producing better initial suggestions.

Do this now: open your editor with Copilot, start a comment block, press your hotkey, and spend 90 seconds dictating the most complex feature you need to implement with every edge case, security consideration, and data validation requirement you can think of. Watch Copilot generate significantly better code from your comprehensive verbal context.

#ai-coding#development#productivity