Create, modify, review, or test the Vendra Attribute API package in packages/vendra-attribute-api. Use for the Attribute and AttributeValue API Platform resources (`ApiResource` DTOs), State providers, active-resource filtering, provider-neutral product API relationships, query parameters, operations, response fields, read-only behavior, API tests, and AttributeApiServiceProvider wiring.
php artisan boost:add-skill misaf/vendra
Save this content to: .claude/skills/vendra-attribute-api-development/SKILL.md
# Vendra Attribute API
## Workflow
- Inspect `composer.json`, sibling files, and existing tests before changing the package.
- Use Laravel Boost `application-info` and `search-docs` before code changes.
- Apply `laravel-best-practices` to Laravel PHP and `pest-testing` whenever tests change.
- Apply `tailwindcss-development` only when changing Blade markup or Tailwind classes.
- Keep changes inside this package's boundary and preserve its public contracts.
- Add or update focused Pest coverage, then run `php artisan test --compact --testsuite=vendra-attribute-api` and `composer stan`.
## Translatable Persistence
- Making a persisted model field translatable is an explicit domain choice unless this package already requires it.
- Every field listed in a model's `$translatable` array must definitely use a JSON database column. Keep its model traits/casts, factories, validation, Filament locale UI, API serialization, and tests translation-aware.
- A field not listed in `$translatable` must use the appropriate scalar database type and must not use Spatie Translatable, translatable slug traits, locale switchers, translated callbacks, or translation-shaped array data.
## Vendra Transitive API Policy
- Treat a Vendra dependency intentionally exposed through the public API of a directly required Vendra platform package as part of the supported public contract of that package.
- Do not add a redundant direct Composer requirement solely because source code imports a type from that exposed dependency.
- Apply this only to Vendra platform packages listed under `require`; never extend it to `require-dev`, `suggest`, incidental implementation dependencies, or third-party packages. Removing or replacing an exposed dependency is a breaking change; keep `self.version` alignment across the Vendra package graph.
Use `vendra-api-development` for shared API Platform infrastructure, `laravel-best-practices` for Laravel PHP and `pest-testing` when tests change. Before editing, use Laravel Boost to inspect installed versions and search documentation for affected API Platform behavior.
## Boundary And Contract
- Work inside `packages/vendra-attribute-api` with namespace `Misaf\VendraAttributeApi`.
- Reuse `Misaf\VendraAttribute\Models\Attribute` and `AttributeValue`; do not duplicate attribute persistence or polymorphic relationships.
- Expose both the `AttributeResource` (`Attribute`) and `AttributeValueResource` (`AttributeValue`) `ApiResource` DTOs. Preserve the attribute shape (`name`, `description`, `unit`, `position`, `active`) and attribute-value shape (`attribute_id`, `value`, read-only `position`). List/show only active attributes and values belonging to active attributes. Keep raw `attributable_type` and `attributable_id` private.
- Keep the API read-only and non-authorizable; do not add generic mutations.
- Bind the Support `AttributeApiResolver` to `AttributeApiServiceResolver`. Product API integration must consume that provider-neutral contract: product categories expose `attributeValues`, while products expose `attributeValues` and `selectedAttributeValues`; neither API package imports the other.
- Inherit tenant scoping from the domain model and keep the production `Misaf\VendraAttributeApi` namespace free of `Misaf\VendraTenant`. Feature tests may use a concrete tenant factory solely to establish tenant context.
## Change Checklist
- Update both `ApiResource` DTOs, State providers, query parameters, service-provider registration, and tests together.
- Add focused Pest coverage for both resource types, active-resource filtering, fields, filters, pagination, read-only behavior, and resource registration.
- Preserve the architecture expectation that `Misaf\VendraAttributeApi` does not use `Misaf\VendraTenant`.
- Run `php artisan test --compact --testsuite=vendra-attribute-api` and `composer stan`; run Pint when PHP changes.
composer.json, sibling files, and existing tests before changing the package.application-info and search-docs before code changes.laravel-best-practices to Laravel PHP and pest-testing whenever tests change.tailwindcss-development only when changing Blade markup or Tailwind classes.php artisan test --compact --testsuite=vendra-attribute-api and composer stan.$translatable array must definitely use a JSON database column. Keep its model traits/casts, factories, validation, Filament locale UI, API serialization, and tests translation-aware.$translatable must use the appropriate scalar database type and must not use Spatie Translatable, translatable slug traits, locale switchers, translated callbacks, or translation-shaped array data.require; never extend it to require-dev, suggest, incidental implementation dependencies, or third-party packages. Removing or replacing an exposed dependency is a breaking change; keep self.version alignment across the Vendra package graph.Use vendra-api-development for shared API Platform infrastructure, laravel-best-practices for Laravel PHP and pest-testing when tests change. Before editing, use Laravel Boost to inspect installed versions and search documentation for affected API Platform behavior.
packages/vendra-attribute-api with namespace Misaf\VendraAttributeApi.Misaf\VendraAttribute\Models\Attribute and AttributeValue; do not duplicate attribute persistence or polymorphic relationships.AttributeResource (Attribute) and AttributeValueResource (AttributeValue) ApiResource DTOs. Preserve the attribute shape (name, description, unit, position, active) and attribute-value shape (attribute_id, value, read-only position). List/show only active attributes and values belonging to active attributes. Keep raw attributable_type and attributable_id private.AttributeApiResolver to AttributeApiServiceResolver. Product API integration must consume that provider-neutral contract: product categories expose attributeValues, while products expose attributeValues and selectedAttributeValues; neither API package imports the other.Misaf\VendraAttributeApi namespace free of Misaf\VendraTenant. Feature tests may use a concrete tenant factory solely to establish tenant context.ApiResource DTOs, State providers, query parameters, service-provider registration, and tests together.Misaf\VendraAttributeApi does not use Misaf\VendraTenant.php artisan test --compact --testsuite=vendra-attribute-api and composer stan; run Pint when PHP changes.How can I help you explore Laravel packages today?