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
How to Use AI for Development: 6 Prompt Patterns
Source: Habr AI. Collage: Hamidun News.
Listen to article

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.

Story

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.

ZK
Zhemal Khamidun — CPO at Alpina Digital, product manager of AlpinaGPT. Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Unified AI Workspace · Nomad

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.

Try Nomad AI →Launch Nomad Agent
What do you think?
Loading comments…