skills/api-platform-development/bagisto-api-develop/SKILL.md
Use when working INSIDE the bagisto-api package — installing or removing it, adding/changing a REST or GraphQL endpoint or resource, building an admin menu's API, or fixing package behaviour. Also when the user mentions ApiResource, Provider, Processor, DTO, resolver, 'install/remove the bagisto-api package', or 'add/extend an endpoint'. Install/remove happen only on explicit request, never automatically. Reference files live in reference/: install, uninstall, structure, api-structure, conventions, precautions, limitations, testing.
npx skillsauth add bagisto/agent-skills bagisto-api-developInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this when you are working inside the bagisto-api package (packages/Webkul/BagistoApi, namespace Webkul\BagistoApi) — installing it, removing it, adding or changing an endpoint/resource, or fixing package behaviour. This is the guide rails: it tells you where the authoritative spec is, the rules you must not break, and points you at the detailed references.
Installing or removing the package is NEVER an automatic action. Detecting the package files, a composer.json, or a Bagisto project does not mean you should install, reinstall, optimise, or uninstall anything. Only perform install (reference/install.md) or removal (reference/uninstall.md) when the client explicitly asks for it, and for install, ask whether they want the Composer (stable) or Manual (newest) method first.
The package ships its own complete documentation. Read the relevant part before writing code — almost every menu/resource is already specified with its exact behaviour, validation, events, and quirks:
| Source | What it gives you |
|--------|-------------------|
| CLAUDE.md (package root) | The authoritative conventions + a coverage table for every endpoint, with the per-resource decisions and quirks. Read this first for the resource you're touching. |
| docs/superpowers/specs/ | Design specs for larger features. |
| CHANGELOG.md | What shipped, consumer-facing, under [Unreleased]. |
| PERFORMANCE.md | Caching / IRI / schema-build performance notes. |
| GitHub bagisto/bagisto-api | The canonical code — copy the closest existing resource rather than writing the pattern from scratch. |
| https://api-docs.bagisto.com (+ /llms.txt) | The consumer-facing request/response shapes + the full endpoint index. |
Rule: don't improvise behaviour that CLAUDE.md already specifies. Search it for the resource/menu first.
| Topic | Reference file | Use when |
|-------|----------------|----------|
| Install the package | reference/install.md | Client asks to install / set up the API |
| Remove the package | reference/uninstall.md | Client asks to remove / uninstall the package |
| Where files go | reference/structure.md | Adding any file; finding the right directory + base class |
| Surfaces, transports, declaring a resource | reference/api-structure.md | Designing a new endpoint; understanding the 5-file pattern + feature surface |
| Coding standards + checklist | reference/conventions.md | Writing/reviewing a resource against the rules |
| Foot-guns | reference/precautions.md | Before you ship — the things that silently break |
| What the API will / won't do | reference/limitations.md | Scoping a feature; deciding "do we support this?" |
| Tests + cache cycle | reference/testing.md | Running/adding tests; the cache commands |
Model (#[ApiResource] — REST + GraphQL ops + OpenAPI block) → DTO (typed input) → Provider (read path) → Processor (write path) → lang (src/Resources/lang/en/app.php). Storefront resources live under src/; admin resources under src/Admin/. Tag every Provider/Processor in BagistoApiServiceProvider::register() — an untagged one is silently bypassed (404 / wrong data). Full detail in reference/api-structure.md and reference/structure.md.
reference/limitations.md.Everything else — the full checklist, the ranked foot-guns, and the test/cache commands — is in the references above. Open them rather than guessing.
development
Shop theme development in Bagisto. Activates when creating custom storefront themes, modifying shop layouts, building theme packages, or working with Vite-powered assets for the customer-facing side of the application.
development
Shipping method development in Bagisto. Activates when creating shipping methods, integrating shipping carriers like FedEx, UPS, DHL, or any third-party shipping provider; or when the user mentions shipping, shipping method, shipping carrier, delivery, or needs to add a new shipping option to checkout.
development
Product type development in Bagisto. Activates when creating custom product types, defining product behaviors, or implementing specialized product logic. Use references: @config (product type configuration), @abstract (AbstractType methods), @build (complete subscription implementation).
development
Tests applications using the Pest 3 PHP framework in Bagisto. Activates when writing tests, creating unit or feature tests, adding assertions, testing Livewire components, architecture testing, debugging test failures, working with datasets or mocking; or when the user mentions test, spec, TDD, expects, assertion, coverage, or needs to verify functionality works.