How to Use AI for Development: 6 Prompt Patterns
BotHub has published a practical guide to prompts for developers on Habr. The article collects six templates: deep Python refactoring, untangling legacy TypeScript, generating tests for React, migrating from PHP to Python, a security audit in Go, and PostgreSQL optimization with EXPLAIN ANALYZE. The core idea is simple: a good prompt defines a role, constraints, and an output format.
AI-processed from Habr AI; edited by Hamidun News
BotHub has released a large practical piece on Habr about using AI for development through well-built prompts, rather than simply asking it to "fix the code."
Which AI roles work for refactoring?
For Python, the "surgeon-architect" role fits: it splits a FastAPI router into layers. For TypeScript, the role is a "patient mentor." The point is to give the model a specific professional role instead of a generic request to "fix the code."
Can ChatGPT be used to find errors in SQL?
Yes. One of the six patterns helps developers find bottlenecks in SQL queries using properly worded prompts.
What roles can a neural network play during refactoring?
For Python code, the model takes the role of a "surgeon-architect" that splits a bloated FastAPI router into router, service, and repository layers. For TypeScript, it takes the role of a "patient mentor."
What developer tasks do the prompt patterns solve?
The patterns help with untangling legacy code, refactoring services, writing tests, and finding bottlenecks in SQL.
How do you use AI for development?
BotHub described six ready-made prompt patterns in which the model gets a specific professional role instead of a generic request. This helps with untangling legacy code, refactoring services, writing tests, and finding bottlenecks in SQL.
What prompt should you write for code refactoring?
For Python code, the "surgeon-architect" pattern is used. It splits a bloated FastAPI router into router, service, and repository layers, helping the model understand the structure and produce a concrete result.
- Nov 1, 2026Local models lose to Opus and Codex: 0.21 on a MacBook versus 1.00 for Codex
- Nov 1, 2026Kimi scores 96.2% on a 1C database analytics test and emerges as a fallback if Claude access is blocked
- Nov 1, 2026OpenAI Rewrites GPT Behavior Rules: Five Values and a Chain of Command
- Nov 1, 2026Google admits AI Mode cuts search revenue, shares fall 15%
Key Questions Answered
Which AI roles work for refactoring?
For Python, the "surgeon-architect" role fits: it splits a FastAPI router into layers. For TypeScript, the role is a "patient mentor." The point is to give the model a specific professional role instead of a generic request to "fix the code."
Can ChatGPT be used to find errors in SQL?
Yes. One of the six patterns helps developers find bottlenecks in SQL queries using properly worded prompts.
What roles can a neural network play during refactoring?
For Python code, the model takes the role of a "surgeon-architect" that splits a bloated FastAPI router into router, service, and repository layers. For TypeScript, it takes the role of a "patient mentor."
What developer tasks do the prompt patterns solve?
The patterns help with untangling legacy code, refactoring services, writing tests, and finding bottlenecks in SQL.
Test Frontier LLMs & Autonomous Agents in One Workspace
Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.
The AI world, distilled — once a week
Seven stories that actually mattered, hand-picked. No noise, no reposts, no press releases.
Done! Check your inbox for a confirmation.