sfcc-sfra-models

Transform SFCC API data into JSON-ready SFRA models using decorators and factories.

27|9|Updated Aug 8, 2025
One-click install
npx skills add https://github.com/taurgis/sfcc-dev-mcp --skill sfcc-sfra-models
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sfcc-sfra-models
Source: https://github.com/taurgis/sfcc-dev-mcp/tree/main/ai-instructions/skills/sfcc-sfra-models
Command: npx skills add https://github.com/taurgis/sfcc-dev-mcp --skill sfcc-sfra-models

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Creating and maintaining SFRA models is complex and error-prone, leading to inconsistent data transformations and hard-to-maintain code. This skill provides a structured approach to building, extending, and validating SFRA models using decorators, factories, and composition to ensure JSON-ready outputs.

Core Features & Use Cases

  • Provides a catalog of model patterns (decorator, composite, factory) for SFRA to promote code reuse and maintainability.
  • Demonstrates how to extend base SFRA models safely without replacing core logic, enabling custom attributes and business rules.
  • Serves as a reference for performance, security, and testing practices in SFRA model development with practical examples.

Quick Start

Ask me to scaffold or extend an SFRA model using the decorators and factory patterns described.

Frequently Asked Questions about sfcc-sfra-models

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure SFRA models in SFCC to output JSON-ready data?

Structure SFRA models using decorators, factories, and composite patterns to transform SFCC API data into JSON-ready objects. This approach enforces consistent data transformation, promotes code reuse, and keeps model logic maintainable across product, cart, and account domains.

What is the best way to extend base SFRA models without replacing core SFCC logic?

Extend base SFRA models safely by applying decorator patterns that add custom attributes and business rules without replacing core SFCC logic. This composition approach preserves base functionality while allowing domain-specific extensions for scalable storefront architectures.

Can I use decorator patterns for SFRA product and cart transformations?

Yes, decorator patterns apply to SFRA product, cart, account, and other domains. They wrap base SFCC API objects to add computed attributes, format fields, and enforce business rules, producing consistent JSON-ready outputs across multiple storefront model types.

How do I scaffold a new SFRA model using factory patterns in SFCC?

Scaffold a new SFRA model by defining a factory that instantiates the correct model type based on SFCC API input. The factory applies relevant decorators and composition logic, transforming raw SFCC data into structured, JSON-ready objects with consistent attribute mapping.

What testing and performance practices should I follow for SFRA model development?

Follow SFRA model best practices by validating decorator outputs, profiling transformation performance, and isolating business logic for unit testing. Enforce security checks on SFCC API inputs and ensure JSON-ready outputs are consistent and maintainable across model extensions.