AI Powered Software Development
November 17, 2026 2 min read

Prompt Engineering

HS
HEMANT SINGH
Technical Writer & Educator

Objective: Learn how to communicate effectively with AI models and AI agents to get accurate, useful and predictable results


Prompt Engineering is not just about asking questions. It is about providing clear instructions, context, requirements and constraints so that AI can perform a task correctly.


This module is especially useful for developers working with ChatGPT, Claude, Gemini and Google Antigravity.


What is Prompt Structure?

Prompt Structure means organizing your instructions in a way that makes it easier for an AI model to understand your requirements.


Consider this example.

Without structure:

Create a login page using Laravel and
make it beautiful with validation and
also connect database and use tailwind.

The AI may understand the request, but some requirements are unclear.


With structure:

Role:
Act as an experienced Laravel developer.

Task:
Create a login page.

Technology:
- Laravel 12
- Livewire
- Tailwind CSS v4
- MySQL

Requirements:
1. Email and password fields.
2. Form validation.
3. Authentication.
4. Display appropriate error messages.

Output:
Provide the implementation steps
and complete code.

The second prompt is easier to understand because the instructions are organized.


Six Important Components of Prompt Structure


Component

Meaning

Role

Who should AI act as?

Task

What should AI do?

Context

What information does AI need?

Requirements

What must be included?

Constraints

What rules must AI follow?

Output Format

How should AI present the result?


Not every prompt needs all six components. Use the ones relevant to your task.


A. Role

Defines the expertise or perspective AI should use.

Act as a senior PHP developer
with expertise in Laravel.

Task

Defines the actual work.

Create a REST API for student management.

Context

Provides background information.

I am building a School Management System.

The project uses Laravel 12,
Livewire and MySQL.

Requirements

Defines the features you need.

The API must support:

1. Create student
2. List students
3. View student details
4. Update student
5. Delete student

Constraints

Defines what AI must follow or avoid.

- Use Laravel Form Requests.
- Use API Resources.
- Follow PSR-12.
- Do not install unnecessary packages.

Output Format

Defines the expected response.

Provide:

1. Database migration
2. Model
3. Form Request
4. Controller
5. API routes
6. Example API responses