sfcc-backend

Enforce SFCC backend patterns for controllers, models, ISML, hooks, and tests.

Updated Feb 26, 2026
One-click install
npx skills add https://github.com/Trimud/Sheep-Vampires-Yoghurt --skill sfcc-backend
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sfcc-backend
Source: https://github.com/Trimud/Sheep-Vampires-Yoghurt/tree/main/.agents/skills/sfcc-backend
Command: npx skills add https://github.com/Trimud/Sheep-Vampires-Yoghurt --skill sfcc-backend

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

SFCC/SFRA backend development assistant that encapsulates project-specific patterns, conventions, and guardrails for server-side code, helping teams implement controllers, models, ISML templates, hooks, and tests correctly while avoiding common pitfalls.

Core Features & Use Cases

  • Cartridge layering guidance and overlays
  • Middleware and route patterns (server.get/post/append/replace) best practices
  • Next() flow control and module.superModule usage
  • Backend deployment, packaging, and Business Manager integration
  • Unit testing strategies (Mocha/proxyquire) and test structure
  • Cross-cartridge requires and SFCC API patterns (dw.*)

Quick Start

Describe a SFCC backend task you are working on and I will provide best-practice steps to implement it.

Frequently Asked Questions about sfcc-backend

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

FAQPage Schema
How do I use module.superModule and next() correctly in SFRA backend controllers?

SFRA backend controllers use module.superModule to extend base cartridge functionality and next() to pass execution down the middleware chain. Proper flow control ensures cross-cartridge requires and route modifications execute predictably without breaking base storefront behavior.

What is the best way to structure SFCC cartridge layering and overlays for custom storefronts?

SFCC cartridge layering structures customizations by stacking cartridges so overlays override base SFRA templates and models. This approach isolates site-specific logic while maintaining core server patterns, preventing direct modifications to base cartridges during deployment.

How do I write unit tests for SFCC backend cartridges using Mocha and proxyquire?

Unit testing SFCC backend cartridges with Mocha and proxyquire involves mocking the dw.* SFCC API dependencies to isolate server-side code. This strategy validates controllers and models locally without requiring a live Commerce Cloud instance for every test execution.

Can I use server.append and server.replace to modify existing SFRA routes without editing core cartridges?

Yes, server.append and server.replace modify existing SFRA routes within custom cartridges to extend or override middleware. This ensures base cartridge code remains untouched, allowing safe upgrades while applying project-specific server patterns and route guardrails.

What are common pitfalls with cross-cartridge requires in SFCC backend development?

Cross-cartridge requires in SFCC backend development often fail when cartridge paths are misconfigured or circular dependencies exist. Following strict cartridge layering conventions and using module.superModule prevents broken requires and maintains stable deployment packaging.