Community程式設計與開發github.com

Taldres/laravel-waitlist

在正確的位置新增 Laravel 套件功能,並透過服務提供者使用明確的 Laravel API 進行接線,以維持套件名稱、命名空間、設定鍵與發佈標籤的一致性。

laravel-waitlist 是什麼?

此技能旨在幫助開發者將 Laravel 套件功能(如命令、遷移、路由、設定合併、視圖、翻譯、資源、中介軟體、發佈標籤、工作檯檔案或僅限控制台的行為)新增至正確的目錄位置,並透過服務提供者進行接線。它強制使用明確的 Laravel API(例如 `loadRoutesFrom`、`loadViewsFrom`、`mergeConfigFrom`)與發佈標籤慣例(`waitlist-*`),以確保套件結構的一致性與可維護性。支援的平台為任何基於 Laravel 的套件開發環境,並提供詳細的工作流程,包括檢查現有結構、根據請求類型創建對應檔案、在 `register()` 或 `boot()` 方法中正確接線,以及使用 `package-testing`、`package-compatibility`、`package-release` 等工具進行驗證。此外,它還明確列出常見的反模式,例如新增未使用的檔案、混亂的命名空間、未經許可更改依賴項,以及不必要地使用輔助抽象層,幫助開發者避免常見錯誤。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Taldres/laravel-waitlist/tree/HEAD/.agents/skills/package-scaffold

Installed? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

套件建構工具

主要目標

在正確的位置新增套件功能,並透過服務提供者使用明確的 Laravel API 進行接線,以維持套件名稱、命名空間、設定鍵與發佈標籤的一致性。

工作流程

  1. 在建立檔案之前,檢查現有的套件結構、同類範例、README 設定說明以及目前的服務提供者。
  2. 判斷請求是否涉及命令、遷移、路由、設定、視圖、翻譯、資源、中介軟體、測試、README/貢獻文件、相容性或發佈流程。
  3. 在 Laravel 原生套件路徑下建立功能檔案,並一致地使用設定的套件名稱、命名空間、發佈標籤、URL 和徽章。
  4. 使用下方「提供者接線」中的模式,透過服務提供者接線該功能。
  5. 使用 package-testing 進行測試覆蓋率;當使用者面對的行為變更時,更新 README 或貢獻文件;對矩陣敏感的變更使用 package-compatibility;對發佈任務使用 package-release。
  6. 僅新增所請求功能所需的檔案,並先使用最狹窄的相關命令進行驗證,再進行較廣泛的檢查。

提供者接線

  1. 除非提取方法能使重複的問題更清晰,否則將提供者接線保留在 register() 或 boot() 方法中。
  2. 當主機應用程式必須能夠覆蓋設定時,將容器綁定和 mergeConfigFrom 呼叫放在 register() 中。
  3. 在啟動時的方法中放置資源載入,並使用 Laravel 原生 API,例如 loadRoutesFrom、loadViewsFrom 和 loadTranslationsFrom。
  4. 在呼叫 publishes、publishesMigrations 或 commands 之前,使用 runningInConsole() 保護僅限控制台的發佈和命令註冊。
  5. 使用 waitlist-* 慣例命名發佈標籤,以便使用者可以針對個別資源群組進行操作。
  6. 為可觀察的提供者行為新增測試:合併的設定、載入的路由、發佈標籤或命令註冊。

提供者接線反模式:

  • 在提供者註冊期間過早載入主機應用程式狀態。
  • 在設定檔案外部呼叫 env();改用 mergeConfigFrom 後的設定值。
  • 當套件可以在控制台環境中執行時,無條件註冊僅限網頁的功能。
  • 預設使用 spatie/laravel-package-tools 取代明確的提供者方法。

參考資料

  • src/*ServiceProvider.php
  • config/*.php
  • routes/*.php
  • resources/views/
  • lang/
  • database/migrations/
  • public/
  • src/Console/Commands/
  • tests/Feature/ 和 tests/Unit/

範例

  • 新增 Artisan 命令:在 src/Console/Commands 下建立命令類別,在 runningInConsole() 保護內部的 commands 陣列中註冊它,新增一個功能測試來驗證可觀察的控制台輸出,如果該命令是使用者面對的,則記錄該命令。
  • 新增可發佈的遷移:將遷移放在 database/migrations,透過帶有 waitlist-migrations 標籤的控制台保護 publishesMigrations 呼叫進行接線,並使用 Testbench 測試發佈行為。
  • 新增一個新的發佈標籤:在現有的控制台保護發佈方法內部新增一個 publishes 映射,並使用 waitlist-* 命名該標籤。

反模式

  • 新增未使用的檔案,因為套件未來可能需要它們。
  • 混用套件名稱、命名空間、設定鍵或發佈標籤。
  • 未經許可更改依賴項。
  • 當一個功能特定的變更就足夠時,使用輔助抽象層取代明確的 Laravel 套件程式碼。

Individual skills in this repo

This repo contains 13 individual skills — each has its own dedicated page.

Taldres/laravel-waitlist

Use this skill when reviewing Laravel package compatibility across composer constraints, PHP versions, Laravel versions, Testbench versions, dependency stability lanes, Windows CI, or matrix-sensitive code and workflow changes.

Taldres/laravel-waitlist

Use this skill when creating or updating the bundled Laravel Boost skill under resources/boost/skills from the package implementation and package documentation. Trigger after public APIs, commands, config, routes, views, publish tags, README content, or examples change.

Taldres/laravel-waitlist

Use this skill when preparing Laravel package releases: CHANGELOG.md updates, generated release notes, GitHub release workflows, version checks, tags, release validation, or release automation changes. Never publish autonomously.

Taldres/laravel-waitlist

Use this skill when writing, editing, fixing, or reviewing package tests with Pest 4/5 and Orchestra Testbench, including TDD, feature tests, unit tests, type coverage, arch tests, workbench behavior, commands, routes, config, migrations, and publishable resources.

Taldres/laravel-waitlist

Integrate taldres/laravel-waitlist in a Laravel application: define purposes, lists and fields, build the signup form, send the confirmation mail from events, add a preference page, and keep consent, retention and encryption intact.

Taldres/laravel-waitlist

Build the pages of a taldres/laravel-waitlist integration: the signup form with the registered wording, and the confirm, unsubscribe and preference pages, either in Laravel controllers (Blade, Livewire, Inertia) or in an SPA or static site over the package's JSON API, including CORS and bot protection.

Taldres/laravel-waitlist

Turn a taldres/laravel-waitlist waitlist into a launch: invite people in batches in signup order, let invited addresses register, announce the launch to everyone who agreed, and erase the list once its purpose is fulfilled.

Taldres/laravel-waitlist

Send the mails of a taldres/laravel-waitlist integration: the double opt-in confirmation, the preference page link, a welcome mail, launch mails and newsletters to the people who agreed, with the right unsubscribe links, one-click headers and a sender per project.

Taldres/laravel-waitlist

Operate a taldres/laravel-waitlist installation: answer access and erasure requests, withdraw a purpose on request, apply retention, erase a list once its purpose is fulfilled, rotate APP_KEY with waitlist:rekey, export a list, and check the setup before going live.

Taldres/laravel-waitlist

Run the waitlists of several products in one Laravel app with taldres/laravel-waitlist projects: define projects, scope facade calls with project(), resolve the project of HTTP signups, send mail per project, handle requests across all projects, or keep projects in a database for a central waitlist API.

Taldres/laravel-waitlist

Keep a newsletter tool such as Brevo, Mailchimp or Mailcoach in step with a taldres/laravel-waitlist waitlist: add confirmed contacts per purpose, remove them on withdrawal and erasure, and carry unsubscribes made at the provider back into the waitlist via a webhook.

Taldres/laravel-waitlist

Build waitlist statistics with taldres/laravel-waitlist: signups and confirmations per day for charts, totals and confirmation rates for a period, the confirmed count on any past day, and how many people are on a list right now, for dashboards, admin pages and API endpoints.

Taldres/laravel-waitlist

Write feature tests for an application's taldres/laravel-waitlist integration: get the plain tokens from events, assert the confirmation and other mails, test the signup, confirm and unsubscribe flows in PHP and over the package's HTTP routes, and bypass rate limits and bot checks in tests.

相關技能