Shopware Dal logo

Shopware Dal

Community
alpham8
shopware-dal

Use when querying or writing Shopware 6 data through the Data Abstraction Layer — entity definitions, criteria, associations, filters, aggregations, EntityExtension, and custom fields. Triggers on EntityRepository, Criteria, EntityDefinition, custom field sets, or extending core entities.

Overview

Publisheralpham8
Repositoryagentic-webdev
Skill nameshopware-dal
Stars
4
Forks
0
Bundled files
Instructions only
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by alpham8 on GitHub. Read the source before you install it.

Installation

Install the Shopware Dal AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/alpham8/agentic-webdev/tree/master/skills/shopware-dal
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/alpham8/agentic-webdev.git /tmp/agentic-webdev
mkdir -p .claude/skills
cp -r /tmp/agentic-webdev/skills/shopware-dal .claude/skills/shopware-dal
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Shopware Dal in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Shopware Dal on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Shopware Dal is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Shopware 6 — Data Abstraction Layer

PHP conventions come from rules/, not from this skill. See the shopware skill for the map of Shopware skills.

Data Abstraction Layer (DAL)

The DAL replaces direct ORM/SQL. Use repositories, not Doctrine EntityManager.

Inject repository (services.xml):

xml
<service id="Swag\Example\Service\ProductService">
    <argument type="service" id="product.repository"/>
</service>

Or with services.php (modern format):

php
$services->set(ProductService::class)
    ->args([service('product.repository')]);

Repository service names follow the pattern: entity_name.repository.

Reading Data
php
use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\EqualsFilter;
use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\RangeFilter;
use Shopware\Core\Framework\DataAbstractionLayer\Search\Sorting\FieldSorting;
use Shopware\Core\Framework\DataAbstractionLayer\Search\Aggregation\Metric\AvgAggregation;

$criteria = new Criteria();
$criteria->addFilter(new EqualsFilter('active', true));
$criteria->addFilter(new RangeFilter('price', ['gte' => 10]));
$criteria->addAssociation('manufacturer');
$criteria->addSorting(new FieldSorting('name', FieldSorting::ASCENDING));
$criteria->setLimit(25)->setOffset(0);

// Standard search — returns EntitySearchResult
$result = $this->productRepository->search($criteria, $context);
$entity = $result->first();

// Get only IDs — more efficient when you don't need the full entity
$ids = $this->productRepository->searchIds($criteria, $context);
$firstId = $ids->firstId();

// Post-filter: applies to result but NOT to aggregations
$criteria->addPostFilter(new EqualsFilter('name', 'Foo'));

// Aggregations — do NOT call ->first() when using aggregations
$criteria->addAggregation(new AvgAggregation('avg-rating', 'productReviews.points'));
$result = $this->productRepository->search($criteria, $context);
$rating = $result->getAggregations()->get('avg-rating');
Writing Data
php
use Shopware\Core\Framework\Uuid\Uuid;

// Create
$this->repository->create([
    ['id' => Uuid::randomHex(), 'name' => 'New', ...]
], $context);

// Update
$this->repository->update([
    ['id' => $id, 'name' => 'Updated']
], $context);

// Delete
$this->repository->delete([['id' => $id]], $context);

// Upsert — always provide ID, otherwise data is always created (never updated)
$this->repository->upsert([
    ['id' => $knownId, 'name' => 'Upserted']
], $context);

ManyToMany pitfall: You cannot update a ManyToMany mapping entity directly (e.g. productCategoryRepository->update()). Assign associations through the owning entity's repository instead.

Custom Entity

Full pattern: EntityDefinition + Entity + EntityCollection + Migration + service registration.

Migration (src/Migration/Migration1611664789Example.php):

php
public function update(Connection $connection): void
{
    $connection->executeStatement(<<<SQL
        CREATE TABLE IF NOT EXISTS `swag_example` (
            `id`          BINARY(16) NOT NULL,
            `name`        VARCHAR(255) COLLATE utf8mb4_unicode_ci,
            `description` VARCHAR(255) COLLATE utf8mb4_unicode_ci,
            `active`      TINYINT(1),
            `custom_fields` JSON NULL,
            `created_at`  DATETIME(3) NOT NULL,
            `updated_at`  DATETIME(3),
            PRIMARY KEY (`id`)
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
    SQL);
}

public function updateDestructive(Connection $connection): void
{
    // DROP TABLE only in destructive migrations
}

Generate skeleton: bin/console database:create-migration -p SwagExample --name ExampleDescription

EntityDefinition (src/Core/Content/Example/ExampleDefinition.php):

php
use Shopware\Core\Framework\DataAbstractionLayer\EntityDefinition;
use Shopware\Core\Framework\DataAbstractionLayer\Field\Flag\ApiAware;
use Shopware\Core\Framework\DataAbstractionLayer\Field\Flag\Required;
use Shopware\Core\Framework\DataAbstractionLayer\Field\{IdField, StringField, BoolField, CustomFields, CreatedAtField, UpdatedAtField};
use Shopware\Core\Framework\DataAbstractionLayer\FieldCollection;

class ExampleDefinition extends EntityDefinition
{
    public const ENTITY_NAME = 'swag_example';

    public function getEntityName(): string { return self::ENTITY_NAME; }
    public function getEntityClass(): string { return ExampleEntity::class; }
    public function getCollectionClass(): string { return ExampleCollection::class; }

    protected function defineFields(): FieldCollection
    {
        return new FieldCollection([
            (new IdField('id', 'id'))->addFlags(new Required(), new ApiAware()),
            (new StringField('name', 'name'))->addFlags(new ApiAware()),
            (new StringField('description', 'description'))->addFlags(new ApiAware()),
            (new BoolField('active', 'active'))->addFlags(new ApiAware()),
            new CustomFields(),
            new CreatedAtField(),
            new UpdatedAtField(),
        ]);
    }
}

Entity (src/Core/Content/Example/ExampleEntity.php):

php
use Shopware\Core\Framework\DataAbstractionLayer\Entity;
use Shopware\Core\Framework\DataAbstractionLayer\EntityCustomFieldsTrait;
use Shopware\Core\Framework\DataAbstractionLayer\EntityIdTrait;

class ExampleEntity extends Entity
{
    use EntityIdTrait;
    use EntityCustomFieldsTrait;

    protected ?string $name = null;
    protected ?bool $active = null;

    public function getName(): ?string { return $this->name; }
    public function setName(?string $name): void { $this->name = $name; }
    public function isActive(): ?bool { return $this->active; }
    public function setActive(?bool $active): void { $this->active = $active; }
}

EntityCollection (src/Core/Content/Example/ExampleCollection.php):

php
use Shopware\Core\Framework\DataAbstractionLayer\EntityCollection;

/** @extends EntityCollection<ExampleEntity> */
class ExampleCollection extends EntityCollection
{
    protected function getExpectedClass(): string { return ExampleEntity::class; }
}

Service registration (services.xml):

xml
<service id="Swag\Example\Core\Content\Example\ExampleDefinition">
    <tag name="shopware.entity.definition" entity="swag_example"/>
</service>

Shopware auto-creates the swag_example.repository service. Inject it by that name.


Custom Fields

Custom fields extend existing entities without a full entity extension. They store scalar values in a JSON column. For associations, use an EntityExtension instead.

Add custom fields via plugin lifecycle:

php
// Inject custom_field_set.repository
$this->customFieldSetRepository->create([[
    'name' => 'swag_example_set',
    'config' => ['label' => ['en-GB' => 'Example Set', 'de-DE' => 'Beispiel Set']],
    'customFields' => [[
        'name' => 'swag_example_field',
        'type' => CustomFieldTypes::TEXT,
        'config' => ['label' => ['en-GB' => 'Example Field', 'de-DE' => 'Beispiel Feld']],
    ]],
    'relations' => [['entityName' => 'product']],
]], $context);

Available CustomFieldTypes constants: TEXT, TEXTAREA, INT, FLOAT, BOOL, DATETIME, COLOR, MEDIA, SELECT, ENTITY_SELECT, HTML, PRICE.


EntityExtension — Version Compatibility

VersionAbstract method
6.4 / 6.5getDefinitionClass(): string → returns FQCN, e.g. CategoryDefinition::class
6.6Both (deprecated getDefinitionClass())
6.7getEntityName(): string → returns entity name, e.g. 'category'

Cross-version plugin (6.4–6.7): implement both — PHP does not complain about extra non-abstract methods.


Frequently asked questions

What does the Shopware Dal AI skill do?

Use when querying or writing Shopware 6 data through the Data Abstraction Layer — entity definitions, criteria, associations, filters, aggregations, EntityExtension, and custom fields. Triggers on EntityRepository, Criteria, EntityDefinition, custom field sets, or extending core entities.

Why use Shopware Dal on TypingMind?

Because you install it once and use it with any model. Shopware Dal is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Shopware Dal in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/alpham8/agentic-webdev/tree/master/skills/shopware-dal. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Shopware Dal?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Shopware Dal?

As many as you like. As long as a model supports skills, you can use Shopware Dal with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Shopware Dal AI skill free?

It is published on GitHub by alpham8. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇