AI skills
If you use an AI coding agent (like OpenCode, Claude Code, Codex or Cursor) in a Magento 2 project with the Loki Checkout, you can give that agent Loki-specific knowledge through agent skills. We maintain a set of these skills in the repository loki-checkout-ai-skills.
What is an agent skill?
An agent skill is a small set of instructions, stored in a SKILL.md file, that gives an AI agent knowledge and conventions for one specific area. The Loki Checkout has its own architecture, frontend patterns and extension points on top of Magento 2. The skills help an agent to:
- Understand the Loki Checkout architecture;
- Pick the right extension point before changing checkout behaviour;
- Follow existing Loki Checkout frontend patterns (Loki Components, Alpine.js, Tailwind CSS);
- Not assume things based on the default Magento (Knockout) checkout;
- Make smaller changes that are easier to maintain;
- Review and debug existing Loki Checkout implementations.
The skills don't replace this documentation or the Magento 2 documentation. And the Magento 2 project itself is still the source of truth for the installed Loki versions, the PHP and JavaScript APIs that are available, the configuration, existing customizations and third-party integrations.
Getting the skills
Clone the repository:
git clone https://gitlab.loki-extensions.com/loki-checkout/loki-checkout-ai-skills.git
The repository is laid out as follows, with one folder per skill:
. ├── skills/ │ ├── loki-component-xml/ │ │ └── SKILL.md │ ├── loki-checkout-payment-component/ │ │ └── SKILL.md │ └── ... └── README.md
Making the skills available to your agent
Each AI agent has its own way of finding skills. Most agents read skill folders (each containing a SKILL.md) from a project-specific folder or a global folder in your home folder. You can copy or symlink the folders from skills/ into that location. A symlink is handy, because a git pull in the cloned repository then updates the skills right away.
Some examples:
- OpenCode:
.opencode/skills/in your project, or~/.config/opencode/skills/globally; - Claude Code:
.claude/skills/in your project, or~/.claude/skills/globally; - Other agents: check the documentation of your agent.
For example, to make all skills available globally to OpenCode:
mkdir -p ~/.config/opencode/skills for skill in /path/to/loki-checkout-ai-skills/skills/*; do ln -s "$skill" ~/.config/opencode/skills/ done
Some skills refer to other skills (for example /loki-checkout-component-xml builds on /loki-component-xml). So it's best to install the whole set, not just a few of them.
Available skills
Loki Components (generic)
These skills cover the Loki Components technology that the Loki Checkout is built on.
loki-component-xml: Define a Loki Component via XML layout andetc/loki_components.xml;loki-component-viewmodel: The component ViewModel, the presentation layer between data and template;loki-component-repository: The component repository, which loads (getValue()) and saves (saveValue()) data;loki-component-context: The component context, for adding dependencies without injecting them into the ViewModel or repository;loki-component-alpine: The generic Alpine.js componentLokiComponent;loki-component-type: Loki Component types, which extend the generic Alpine.js component;loki-component-partial: Reusable partials within Loki Component templates;loki-component-template-variables: Variables that are available in Loki Component templates (loaded by other skills only);loki-css-util: Wrapping CSS classes with$css()so they can be changed via XML layout or PHP;
Loki Checkout components
loki-checkout-create-loki-component: Create a new Loki Component (or customize an existing one) for the checkout;loki-checkout-component-xml: The XML layout handles that the Loki Checkout uses;loki-checkout-component-viewmodel: ViewModels based onCheckoutViewModelandAddressFieldViewModel;loki-checkout-component-repository: Repositories that save data to the quote;loki-checkout-component-context: Contexts based onCheckoutContext;loki-checkout-component-alpine: The Alpine.js storeLokiCheckoutand thestepproperty of components;loki-checkout-theme: Define a Loki Checkout theme viaetc/loki_checkout.xml;loki-checkout-environment: Describe the local Magento 2 environment, for example for browsing the checkout with Chrome MCP;
Payment integrations
These skills help with creating a compatibility module (LokiCheckout_<Psp>) for a Magento 2 payment module.
loki-checkout-payment-component: Create a Loki Component for a payment method that uses the JavaScript API of the payment provider;loki-checkout-payment-loki-component: Build the Context, ViewModel and Repository of a payment method form;loki-checkout-alpine-component: The Alpine.js side of a payment method: component types,Alpine.data(), SDK loaders;loki-checkout-payment-icon-resolver: Show the icon of a payment method via anIconResolverInterface;loki-checkout-payment-redirect-resolver: Redirect the customer after placing the order via aRedirectResolverInterface;loki-checkout-fast-checkout-button: Add an express checkout button to the blockloki-checkout.fast_checkout;
Shipping integrations
These skills help with creating a compatibility module (LokiCheckout_<Carrier>) for a Magento 2 shipping module.
loki-checkout-shipping-module: The structure of a shipping compatibility module and which extension point to use;loki-checkout-shipping-method-form: Add a custom form below a selected shipping method;loki-checkout-shipping-icon-resolver: Show the carrier icon of a shipping method;loki-checkout-shipping-pickup-address-resolver: Replace the shipping address with a pickup location address;loki-checkout-shipping-pickup-location-template: Reuse theLokiCheckout_ShippingMapspickup location UI (dropdown and map);
Using the skills
Most agents load a skill automatically when its description matches your task. But it often helps to point the agent to the skills yourself. For example:
Add a checkout component to the Loki Checkout that asks for a delivery date. Read the relevant Loki Checkout skills before analysing the existing implementation or writing code.
Or call a specific skill directly (depending on your agent), for example /loki-checkout-payment-component.
Some tips:
- Give the agent a concrete task. Skills help the agent make better decisions; they are not meant as a big pile of knowledge;
- Let the agent load only the skills that matter for the current task;
- Make sure the agent can read the Loki modules in
vendor/(or your cloned git repositories), so that it can check APIs against the installed source code.
Principles
The skills ask the agent to follow these principles:
- Inspect before implementing: find the relevant files, modules, configuration and existing extension patterns first;
- Use Loki Checkout patterns: don't reuse patterns from the default Knockout checkout or Luma if a Loki Checkout extension point exists;
- Verify APIs: don't invent class names, events, configuration keys, JavaScript APIs or XML structures;
- Prefer focused changes: checkout changes can affect conversion and order placement;
- Keep Magento conventions: DI, plugins, observers, layout XML, escaping, translations, CSP and caching still matter;
- State uncertainty: if a version or API can't be verified, the agent should say so and inspect the project first.
Contributing
Contributions are welcome. A good skill focuses on one concrete development concern, is specific to the Loki Checkout, is based on behaviour that can be verified, and is short enough to load as working context. When you add a skill, create a dedicated folder with a SKILL.md that clearly describes when the skill applies, the recommended workflow, and common mistakes.
Disclaimer
The skills help AI coding agents, but generated code and decisions must still be reviewed and tested by an experienced Magento 2 developer before going to production. See also our AI policy.
Also see the recommended development tools.