Token导航 LogoToken导航

Agent Skill · 研究检索

spatie-package-skeleton(spatie 包骨架)

spatie-package-skeleton 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

spatie-package-skeleton 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证信息还不明确,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 62,001。

总安装 343周安装 14GitHub Stars 937下载 110核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:spatie-package-skeleton(spatie 包骨架)
来源仓库:https://github.com/freekmurze/dotfiles
仓库路径:skills/spatie-package-skeleton
安装命令:
npx skills add https://github.com/freekmurze/dotfiles --skill spatie-package-skeleton
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/freekmurze/dotfiles --skill spatie-package-skeleton

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于查找、检索和筛选相关信息,支持包骨架相关的知识获取。适合在 Codex、Claude、Cursor、Gemini CLI 中需要基于关键词定位候选结果时使用。通过 GitHub 安装,建议结合原始 README 了解具体用法。使用前应确认权限范围、维护状态及是否触发联网或文件读写行为。

spatie-package-skeleton 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/spatie-package-skeleton

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/freekmurze/dotfiles --skill spatie-package-ske…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

spatie-package-skeleton 怎么安装?

在终端执行 npx skills add https://github.com/freekmurze/dotfiles --skill spatie-package-skeleton。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

spatie-package-skeleton 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

spatie-package-skeleton 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

spatie-package-skeleton 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

spatie-package-skeleton 用的人多吗?

公开数据是累计安装 343 次,近一周安装 14 次,下载 110 次,GitHub 937 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

spatie-package-skeleton 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
spatie-package-skeleton

spatie 包骨架 · 本页

343937操作浏览器未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Creating a Laravel Package with Spatie's Skeleton

Prerequisites

  • gh CLI installed and authenticated
  • php available in PATH
  • composer available in PATH

Workflow

1. Gather Package Details

Ask the user for:

  • Vendor name (e.g. spatie) — the GitHub org or username
  • Package name (e.g. laravel-cool-feature) — the repo/package name
  • Package description — one-liner for composer.json
  • Visibility — public or private (default: public)

Use defaults where sensible:

  • Author name: from git config user.name
  • Author email: from git config user.email
  • Author username: from gh auth status
  • Vendor namespace: PascalCase of vendor name (e.g. Spatie)
  • Class name: TitleCase of package name without laravel- prefix (e.g. CoolFeature)

2. Create the Repository from Template

gh repo create <vendor>/<package-name> --template spatie/package-skeleton-laravel --public --clone
cd <package-name>

If the user wants a private repo, use --private instead of --public.

3. Configure the Package (Manual Replacement)

WARNING: Do NOT pipe stdin to configure.php. The script's child processes (gh auth status, git log, git config) consume lines from the piped stdin, causing inputs to shift and produce garbled results. Instead, do the replacements manually:

  1. Run sed to replace all placeholder strings across the repo:
find . -type f -not -path './.git/*' -not -path './vendor/*' -not -name 'configure.php' -exec sed -i '' \
  -e 's/:author_name/Author Name/g' \
  -e 's/:author_username/authorusername/g' \
  -e 's/author@domain\.com/author@email.com/g' \
  -e 's/:vendor_name/Vendor Name/g' \
  -e 's/:vendor_slug/vendorslug/g' \
  -e 's/VendorName/VendorNamespace/g' \
  -e 's/:package_slug_without_prefix/package-without-prefix/g' \
  -e 's/:package_slug/package-name/g' \
  -e 's/:package_name/package-name/g' \
  -e 's/:package_description/Package description here/g' \
  -e 's/Skeleton/ClassName/g' \
  -e 's/skeleton/package-name/g' \
  -e 's/migration_table_name/package_without_prefix/g' \
  -e 's/variable/variableName/g' \
  {} +

Important: The order of -e flags matters. Replace :package_slug_without_prefix before :package_slug to avoid partial matches. Replace Skeleton (PascalCase) before skeleton (lowercase).

  1. Rename the skeleton files:
mv src/Skeleton.php src/ClassName.php
mv src/SkeletonServiceProvider.php src/ClassNameServiceProvider.php
mv src/Facades/Skeleton.php src/Facades/ClassName.php
mv src/Commands/SkeletonCommand.php src/Commands/ClassNameCommand.php
mv config/skeleton.php config/package-without-prefix.php
mv database/migrations/create_skeleton_table.php.stub database/migrations/create_package_without_prefix_table.php.stub
  1. Delete configure.php and run composer install:
rm configure.php
composer install

Use a longer timeout (5 minutes) for composer install.

4. Verify Setup

After the script completes:

# Check the directory structure
ls -la src/
# Verify composer.json looks correct
cat composer.json | head -20
# Check tests passed during setup

5. Initial Commit and Push

The configure script modifies all files but doesn't commit. Create the initial commit:

git add -A
git commit -m "Configure package skeleton"
git push -u origin main

6. Report to User

Tell the user:

  • The repo URL (e.g. https://github.com/<vendor>/<package-name>)
  • The namespace (e.g. VendorNamespace\ClassName)
  • Key files to start editing:

- src/<ClassName>.php — main package class - src/<ClassName>ServiceProvider.php — service provider - config/<package-slug>.php — configuration - tests/ — test directory

Post-Setup Reference

Directory Structure

src/
  YourClass.php                    # Main package class
  YourClassServiceProvider.php     # Service provider (uses spatie/laravel-package-tools)
  Facades/YourClass.php            # Facade
  Commands/YourClassCommand.php    # Artisan command stub
config/
  your-package.php                 # Published config file
database/
  factories/ModelFactory.php       # Factory template (commented out)
  migrations/create_table.php.stub # Migration stub
resources/views/                   # Blade views
tests/
  TestCase.php                     # Extends Orchestra\Testbench\TestCase
  ArchTest.php                     # Architecture tests (no dd/dump/ray)
  ExampleTest.php                  # Starter test
  Pest.php                         # Pest config binding TestCase

Service Provider Configuration

Uses spatie/laravel-package-tools:

public function configurePackage(Package $package): void
{
    $package
        ->name('your-package')
        ->hasConfigFile()
        ->hasViews()
        ->hasMigration('create_your_package_table')
        ->hasCommand(YourClassCommand::class);
}

Remove methods you don't need. Delete corresponding directories/files too:

  • No database? Delete database/ and remove ->hasMigration()
  • No commands? Delete src/Commands/ and remove ->hasCommand()
  • No views? Delete resources/views/ and remove ->hasViews()
  • No facade? Delete src/Facades/ and remove facade alias from composer.json extra.laravel.aliases
  • No config? Delete config/ and remove ->hasConfigFile()

Testing

composer test       # Run tests
composer format     # Run code style fixer
composer analyse    # Run static analysis

Adding an Install Command

use Spatie\LaravelPackageTools\Commands\InstallCommand;

$package->hasInstallCommand(function (InstallCommand $command) {
    $command
        ->publishConfigFile()
        ->publishMigrations()
        ->askToRunMigrations()
        ->askToStarRepoOnGitHub('vendor/package-name');
});

API Design Principles

  • Optimize for easy usage. The API exposed to users should be as simple as possible. Every public method, facade call, and middleware should feel obvious and require minimal setup.
  • Use well-named methods. Method names should be intuitive and self-documenting. Prefer descriptive names over terse ones — the user should understand what a method does without reading its implementation. Use verb-first method names (clear(), forget(), save()).
  • Follow Spatie PHP/Laravel guidelines. All code must follow the conventions described in the php-guidelines-from-spatie skill.

Package patters

Fluent/Chainable APIs

Builder-style classes where every setter returns $this. Users should be able to chain configuration calls naturally.

Pdf::view('invoice', $data)->format('a4')->landscape()->save('invoice.pdf');

Sensible Defaults

The package should work well out of the box with zero configuration. Only require explicit setup for non-standard use cases. Provide safe defaults in the config file and apply them when values aren't explicitly set.

Facade + Factory for Clean State

Back facades with a factory that creates a fresh builder per call to prevent state bleed between requests.

// Factory intercepts calls via __call() to create fresh builder instances
class PdfFactory {
    public function __call($method, $parameters) {
        return (clone $this->builder)->$method(...$parameters);
    }
}

Enums Over Strings

Use PHP enums for any fixed set of options instead of string constants. This gives type safety and IDE support.

Value Objects for Options

Group related settings into small readonly classes (like PdfOptions, ScreenshotOptions) rather than passing many loose parameters between layers.

Descriptive Exception Classes

Name exceptions after what went wrong and provide static factory methods for specific scenarios with helpful error messages:

class CouldNotGeneratePdf extends Exception
{
    public static function browsershotNotInstalled(): static
    {
        return new static('To use Browsershot, install it via `composer require spatie/browsershot`.');
    }
}

Traits for Cross-Cutting Concerns

Use Conditionable (for when()/unless() chaining), Macroable (for runtime extension), and Dumpable (for debugging) on builder classes.

Small Interfaces for Extensibility

Define interfaces for components users might want to swap. Keep them small — one or two methods is ideal:

interface PdfDriver {
    public function generatePdf(string $html, ...): string;
    public function savePdf(string $html, ..., string $path): void;
}

Config-Driven Class Bindings

Let users swap implementations via config rather than requiring service provider overrides:

// config/your-package.php
'driver' => env('LARAVEL_PDF_DRIVER', 'browsershot'),
'cache_profile' => App\CacheProfiles\CustomCacheProfile::class,
'hasher' => App\Hashers\CustomHasher::class,

Testing Fakes with Rich Assertions

Provide a ::fake() method on the facade that swaps in a fake builder. Track calls and offer assertion methods:

Pdf::fake();
// ... code that generates PDFs ...
Pdf::assertSaved(fn ($pdf, $path) => $path === 'invoice.pdf');
Pdf::assertQueued();
Pdf::assertNotQueued();

Events at Key Moments

Fire events for important lifecycle moments so users can hook into the workflow without modifying package code.

Anti-Pattern: Config Option Creep

Don't add small config options for every customization request. Instead, give users full control via class extension.

Pattern: Events Instead of Hook Config Options

Fire events and let users listen:

event(new TransformerStarting($transformer, $url));
$transformer->transform();
event(new TransformerEnded($transformer, $url, $result));

Pattern: Configurable Models

Let users specify their own model class in config:

// config
'model' => Spatie\Package\Models\Result::class,

// In package code — always resolve from config:
$model = config('your-package.model');
$model::find($id);

Pattern: Configurable Jobs

Let users specify their own job class in config:

'process_job' => Spatie\Package\Jobs\ProcessJob::class,

Pattern: Action Classes

Wrap small pieces of functionality in action classes registered in config:

'actions' => [
    'fetch_content' => Spatie\Package\Actions\FetchContentAction::class,
],

Users override by extending and registering their custom action.

Queued Operations with Callbacks

For expensive operations, provide saveQueued() that returns a wrapper around PendingDispatch with then()/catch() callbacks:

Pdf::view('invoice', $data)
    ->saveQueued('invoice.pdf')
    ->then(fn ($path) => /* success */)
    ->catch(fn ($e) => /* failure */)
    ->onQueue('pdfs');

Consistent Naming Conventions

  • Suffix event classes with Event
  • Suffix notification classes with Notification
  • Suffix config data classes with Config
  • Use {Service}Driver for driver implementations
  • Use Could Not... for exception classes
  • Use Fake prefix for test doubles

Config File Comments

Always add block comments above each config key or group explaining what it does:

return [
    /*
     * When disabled, the middleware will not convert any responses.
     */
    'enabled' => env('PACKAGE_ENABLED', true),

    /*
     * The driver used to perform the operation.
     * Supported: "local", "cloud"
     */
    'driver' => env('PACKAGE_DRIVER', 'local'),

    'cache' => [
        /*
         * How long results should be cached, in seconds.
         */
        'ttl' => (int) env('PACKAGE_CACHE_TTL', 3600),
    ],
];

Use /* */ block comments (not //). Mention supported values, defaults, and any non-obvious behavior. Keep comments concise — one to three lines.

Miscellaneous

  • do not add down methods to migration
  • do not use else statements — return early instead
  • do not use compound if statements — split into multiple ifs or use guard clauses
  • use protected visibility over private

平台分布

Codex

36.5%
按下载量换算40

Claude

30.15%
按下载量换算33

Cursor

16.35%
按下载量换算18

Gemini CLI

9.12%
按下载量换算10

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills