AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Laravel:using Examples In Prompts

skill-jpcaparas-superpowers-laravel-using-examples-in-prompts · by jpcaparas

Provide concrete examples—existing code patterns, style samples, input/output pairs—to guide AI toward your project's conventions

No reviews yet
0 installs
4 views
0.0% view→install

Install

$ agentstack add skill-jpcaparas-superpowers-laravel-using-examples-in-prompts

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-jpcaparas-superpowers-laravel-using-examples-in-prompts)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
8mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Laravel:using Examples In Prompts? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Using Examples in Prompts

Examples clarify intent better than descriptions. Show the AI what you want, don't just tell it.

Reference Existing Code

Abstract

"Create a service similar to the payment service"

Concrete

"Create OrderService following the pattern in app/Services/PaymentService.php:

class PaymentService
{
    public function __construct(
        private PaymentGateway $gateway,
        private PaymentRepository $repository
    ) {}
    
    public function charge(Order $order): Payment
    {
        // Implementation
    }
}

Use constructor injection, return domain objects, keep methods focused."

Why it works: Shows structure, naming, and patterns to follow.

Show Desired Style

Vague

"Use consistent naming"

Specific

"Follow our naming conventions from app/Models/Product.php:

// Relationships: camelCase, descriptive
public function orderItems(): HasMany
public function primaryCategory(): BelongsTo

// Scopes: scope prefix, descriptive
public function scopeActive(Builder $query): void
public function scopePublishedAfter(Builder $query, Carbon $date): void

// Accessors: get prefix, Attribute suffix
public function getFormattedPriceAttribute(): string

Apply same patterns to the new Subscription model."

Why it works: Concrete examples of the conventions in action.

Input/Output Examples

Unclear

"Transform the product data"

Clear

"Transform product data for the API:

Input (from database):

[
    'id' => 1,
    'name' => 'Widget',
    'price_cents' => 2999,
    'created_at' => '2024-01-15 10:30:00',
    'category' => ['id' => 5, 'name' => 'Tools']
]

Expected output:

{
    "id": 1,
    "name": "Widget",
    "price": "29.99",
    "category": "Tools",
    "created_at": "2024-01-15T10:30:00Z"
}

Use ProductResource to handle this transformation."

Why it works: Shows exact input and expected output format.

Concrete vs Abstract

Abstract

"Handle errors properly"

Concrete

"Handle errors like we do in app/Services/PaymentService.php:

try {
    $charge = $this->gateway->charge($amount);
} catch (PaymentGatewayException $e) {
    Log::error('Payment failed', [
        'order_id' => $order->id,
        'amount' => $amount,
        'error' => $e->getMessage(),
    ]);
    
    throw new PaymentFailedException(
        'Unable to process payment: ' . $e->getMessage(),
        previous: $e
    );
}

Use specific exceptions, log context, preserve original exception."

Why it works: Shows the exact error handling pattern to replicate.

Abstract

"Add tests"

Concrete

"Add tests following our pattern in tests/Feature/ProductTest.php:

test('user can create product with valid data', function () {
    $user = User::factory()->create();
    $category = Category::factory()->create();
    
    $response = $this->actingAs($user)
        ->postJson('/api/products', [
            'name' => 'New Product',
            'price' => 29.99,
            'category_id' => $category->id,
        ]);
    
    $response->assertCreated()
        ->assertJsonStructure(['data' => ['id', 'name', 'price']]);
    
    $this->assertDatabaseHas('products', [
        'name' => 'New Product',
    ]);
});

Use factories, test happy path and validation failures, check database state."

Why it works: Shows test structure, assertions, and patterns to follow.

Document Examples

When establishing new patterns, document them:

"Create a new service pattern for external API integrations. Here's the template:

// app/Services/External/BaseApiClient.php
abstract class BaseApiClient
{
    protected string $baseUrl;
    protected int $timeout = 30;
    protected int $retries = 3;
    
    abstract protected function authenticate(): array;
    
    protected function request(string $method, string $endpoint, array $data = []): array
    {
        // Retry logic, error handling, logging
    }
}

// app/Services/External/StripeClient.php
class StripeClient extends BaseApiClient
{
    protected string $baseUrl = 'https://api.stripe.com/v1';
    
    protected function authenticate(): array
    {
        return ['Authorization' => 'Bearer ' . config('services.stripe.secret')];
    }
    
    public function createCharge(int $amount): array
    {
        return $this->request('POST', '/charges', ['amount' => $amount]);
    }
}

Use this pattern for all external API clients. Document in docs/patterns/external-apis.md."

Why it works: Creates a reusable pattern with documentation for future reference.

Quick Reference

Make examples work for you:

  • Show existing code - Reference actual files from your project
  • Demonstrate style - Show naming, structure, patterns in action
  • Provide input/output - Clarify transformations with concrete data
  • Use real code - Snippets from your codebase, not generic examples
  • Document patterns - Turn good examples into reusable templates

Examples > explanations. Show, don't just tell.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.