mcpField
B
bagisto-api-develop

bagisto-api-develop

github.com/bagistoDevelopment13219 installsUpdated 2w ago
Repository

About bagisto-api-develop

A development skill for working inside the Bagisto API package. It directs contributors to authoritative specifications and established resource patterns, with particular attention to GraphQL and REST test coverage and admin-panel parity.

Key features

  1. 01Package installation and removal guidance
  2. 02Resource structure and coding conventions
  3. 03Provider, processor, and DTO pattern
  4. 04GraphQL-first testing guidance
  5. 05Admin-panel behavior parity

Use cases

  1. 01Adding or changing an API resource
  2. 02Investigating package behavior or fixing defects
  3. 03Reviewing API changes and their tests

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/bagisto/agent-skills --skill bagisto-api-develop

After installing, type/bagisto-api-developin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

reference/
api-structure.md
conventions.md
install.md
limitations.md
precautions.md
structure.md
testing.md
uninstall.md

Details

From the project README

Developing the Bagisto API package

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.

CRITICAL — install / remove only when asked

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.

Authoritative sources — read these 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:

SourceWhat 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.mdWhat shipped, consumer-facing, under [Unreleased].
PERFORMANCE.mdCaching / IRI / schema-build performance notes.
GitHub bagisto/bagisto-apiThe 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.

Reference map — open the one you need

TopicReference fileUse when
Install the packagereference/install.mdClient asks to install / set up the API
Remove the packagereference/uninstall.mdClient asks to remove / uninstall the package
Where files goreference/structure.mdAdding any file; finding the right directory + base class
Surfaces, transports, declaring a resourcereference/api-structure.mdDesigning a new endpoint; understanding the 5-file pattern + feature surface
Coding standards + checklistreference/conventions.mdWriting/reviewing a resource against the rules
Foot-gunsreference/precautions.mdBefore you ship — the things that silently break
What the API will / won't doreference/limitations.mdScoping a feature; deciding "do we support this?"
Tests + cache cyclereference/testing.mdRunning/adding tests; the cache commands

The 5-file pattern (the spine of every resource)

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.

The two non-negotiables

  1. A REST change can break GraphQL — they share the same Provider/Processor. Always run the resource's GraphQL test before the REST test, and confirm it's green before considering the change done. This is the single most important rule.
  2. Parity with the Bagisto admin panel, not a superset. Mirror what the admin UI does; where core lacks a feature, block the gap with a clear error rather than half-extending. See 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.

Comments

Markdown supported