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.
- Dec 2, 2026OpenAI Opens Dots Agent to ChatGPT Plus Subscribers With 10,000+ Plugins
- Dec 2, 2026MyLLM moves Claude Code, Grok and GPT to a server: a laptop needs only one token
- Dec 2, 2026T-Decision-1 9B scores 71.6 points and beats a model six times its size
- Dec 2, 2026ETH Zurich's Sensor Behind the Cheek Reads Silent Commands: 91.5% Accuracy at Rest, 47.6% While Walking
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.
Daily 60-sec AI Voice Brief + Weekly Production AI Agent Playbook
Listen to a 60-second AI news brief every morning and get a weekly hands-on playbook for shipping AI agents to production — tools, MCP servers and patterns that work. Curated by Jemal Hamidun, Head of AI at Alpina Digital.
