Token导航 LogoToken导航TokenDH.com
开发external-servicegithub未标认证来源可访问许可证需确认审计未展示

laravel%3ausing-examples-in-promptsLaravel 3ausing examples IN prompts 开发

Agent Skill

用于辅助提示词、系统指令、Agent 行为约束和工作流模板的整理。它适合让 Agent 规范任务边界、统一输出格式、拆分操作步骤或优化提示词可复用性。使用时需要保留真实业务约束,不要把示例当硬规则;涉及自动执行、外部工具或高风险操作时,应在提示词中明确确认步骤、权限边界和失败处理方式。

总安装

1,176

周安装

50

GitHub Stars

131

下载量

412
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:laravel%3ausing-examples-in-prompts(Laravel 3ausing examples IN prompts 开发)
来源仓库:https://github.com/jpcaparas/superpowers-laravel
仓库路径:skills/laravel%3Ausing-examples-in-prompts
安装命令:
npx skills add https://github.com/jpcaparas/superpowers-laravel --skill laravel:using-examples-in-prompts
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/jpcaparas/superpowers-laravel --skill laravel:using-examples-in-prompts

简介

该技能指导在提示词中使用示例提升 AI 理解准确性。

  • 适用于复杂业务逻辑和自然语言交互场景。
  • 支持输入输出对、边界案例和异常处理示范。
  • 使用时需确保示例真实反映业务实际情况。
  • 建议定期更新示例以适应需求变化。laravel%3ausing-examples-in-prompts 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

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.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36%
按下载量换算148

Claude

28.71%
按下载量换算118

Cursor

18.57%
按下载量换算77

Gemini CLI

8.26%
按下载量换算34

安全审计

暂无安全审计结果可展示。

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills