Prompt structure

From jpcaparas/superpowers-laravel · View interactive version

Prompt structure is an AI agent skill from the GitHub repository jpcaparas/superpowers-laravel. Structure prompts for clarity—separate concerns, prioritize requests, specify acceptance criteria, and break work into testable increments

How to use this skill

Skill file

Prompt Structure

Well-structured prompts get complete, actionable responses. Poor structure leads to back-and-forth clarifications and incomplete solutions.

Separate Concerns

Ineffective

"Update the User model to add email verification and also create an API endpoint for password reset and add validation for the profile update form"

Effective

Break into focused requests:

  1. "Add email verification to User model using Laravel's MustVerifyEmail trait"
  2. "Create password reset API endpoint at POST /api/password/reset"
  3. "Add validation to ProfileUpdateRequest for name, email, and bio fields"

Each request has one clear goal. Easier to review, test, and iterate.

Prioritize and Sequence

Ineffective

"Need authentication, user dashboard, admin panel, and email notifications"

Effective

"Let's build authentication first:

  1. Set up Sanctum for API authentication
  2. Create login/register endpoints
  3. Add middleware to protect routes

Once auth works, we'll add the user dashboard, then admin features, then notifications."

Sequence matters. Build foundation first, then features that depend on it.

Specify Acceptance Criteria

Vague

"Make the checkout process work"

Specific

"Implement checkout process with these requirements:

Clear criteria = clear implementation.

Break Down Work

Too Large

"Build a complete blog system with posts, comments, categories, tags, and search"

Right-Sized

"Let's start with core post functionality:

Phase 1: Basic Posts

Phase 2: Categories

Phase 3: Comments (and so on...)

Each phase is testable and deliverable."

Refactoring Requests

Unclear

"This code is messy, clean it up"

Clear

"Refactor UserController@store:

Current problem:

Desired improvements:

Explain the problem and the desired state.

Planning Features

Ineffective

"Add social login"

Effective

"Add GitHub OAuth login:

Acceptance criteria:

Testable increments:

  1. Set up Socialite with GitHub provider
  2. Add github_id and github_token columns to users
  3. Create OAuth controller with redirect and callback methods
  4. Write feature test for full OAuth flow
  5. Add 'Login with GitHub' button to login page"

Break it down. Make it testable.

Quick Reference

Structure your prompts:

Clear structure = clear results.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.