BeClaude

sapcc-hac-skill

New
1GitHub TrendingGeneralby eljoujat

SAP Commerce Cloud HAC interaction via Groovy scripts or FlexibleSearch queries. Use this skill when the user asks to query, inspect, modify or administrate a SAP Commerce Cloud (Hybris / CCv2) instance – e.g. find products, orders, customers, run ImpEx, check cronjobs, execute business logic, or retrieve platform data. Automatically selects Groovy or FlexSearch based on request complexity.

Community PluginView Source

Overview

SAP Commerce Cloud HAC Skill

Interact with a SAP Commerce Cloud (Hybris/CCv2) instance through the Hybris Administration Console (HAC) using `sapcc-hac-client`.

The skill automatically decides whether to use:

  • FlexibleSearch – for data queries (SELECT/WHERE on SAP CC types)
  • Groovy script – for complex logic, service calls, multi-step operations, or writes

Works with Claude Code, Cursor, Copilot, Codex, Pi and any agent compatible with the Agent Skills format.


Setup

Run once after installation:

bash
cd <skill-dir> && npm install

Create a .env file in your project root (or in the skill directory as fallback):

bash
cp <skill-dir>/.env.example .env
# Then fill in your values

Required .env variables:

code
HAC_URL=https://backoffice.<your-instance>.commerce.ondemand.com
HAC_USERNAME=admin
HAC_PASSWORD=your_password
HAC_IGNORE_SSL=false     # set true for self-signed certs
HAC_TIMEOUT=30000

Verify setup:

bash
node <skill-dir>/scripts/setup.js
node <skill-dir>/scripts/execute.js --health-check

Decision Guide: FlexSearch vs Groovy

Read references/decision-guide.md for the full matrix.

Quick rule:

Use FlexSearch when…Use Groovy when…
Pure data retrieval (SELECT)Business service calls (ProductService, OrderService…)
Simple WHERE conditionsMulti-step / conditional logic
Counting / listing itemsWrites, creates, updates, deletes
Joining SAP CC typesRunning ImpEx programmatically
Checking attribute valuesTriggering cronjobs / business processes
Fast explorationComplex calculations or transformations

Workflow

Step 1 – Assess the request

Classify the user's intent into one of:

  • flexsearch – data query, no side effects, can be expressed as a SELECT statement
  • groovy – business logic, writes, service access, multi-type joins with business rules

If in doubt, prefer FlexSearch first; escalate to Groovy if the query returns insufficient data or requires logic.

Step 2 – Compose the script or query

For FlexSearch: write a valid FlexibleSearch query.

  • Always qualify attributes: {product:pk}, {p:code}, etc.
  • Use JOIN syntax for related types
  • Apply WHERE clauses with proper escaping
  • Read references/flexsearch-guide.md for syntax and common patterns

For Groovy: write a Groovy script.

  • Use Spring beans via the spring variable: spring.getBean('productService')
  • Use catalogVersionService, userService, orderService, etc.
  • Return a value or use println for output
  • Set --commit only when writing data
  • Read references/groovy-patterns.md for patterns and Spring bean names

Step 3 – Execute

bash
# FlexibleSearch
node <skill-dir>/scripts/execute.js \
  --type flexsearch \
  --query "SELECT {pk},{code},{name[en]} FROM {Product} WHERE {code} LIKE '%LAPTOP%' ORDER BY {code} ASC" \
  --max-count 50

# Groovy (read-only)
node <skill-dir>/scripts/execute.js \
  --type groovy \
  --script "
    def ps = spring.getBean('productService')
    def cv = spring.getBean('catalogVersionService').getCatalogVersion('electronicsProductCatalog','Online')
    def p = ps.getProductForCode(cv, 'LAPTOP_001')
    return p?.name
  "

# Groovy (write – commit=true)
node <skill-dir>/scripts/execute.js \
  --type groovy \
  --commit \
  --script "
    def product = new de.hybris.platform.core.model.product.ProductModel()
    product.code = 'TEST_001'
    modelService.save(product)
    return 'saved'
  "

# From a .groovy file
node <skill-dir>/scripts/execute.js --type groovy --file /tmp/my-script.groovy

# JSON output (for programmatic use)
node <skill-dir>/scripts/execute.js --type flexsearch --query "..." --json

Step 4 – Interpret and present results

FlexSearch result (JSON):

json
{
  "success": true,
  "resultCount": 42,
  "executionTime": 123,
  "headers": ["pk","code","name[en]"],
  "rows": [["8796093055058","LAPTOP_001","Laptop Pro"]]
}

Groovy result (JSON):

json
{
  "success": true,
  "executionResult": "Laptop Pro",
  "outputText": "",
  "stacktrace": ""
}
  • Present tabular data as a Markdown table when headers and rows are available
  • Highlight success: false with the error or stacktrace message
  • When resultCount is 0, suggest query refinements

Step 5 – Error handling

ErrorAction
Missing required environment variablesAsk user to fill .env (HAC_URL, HAC_USERNAME, HAC_PASSWORD)
Authentification échouéeCheck credentials; try --health-check
HTTP 403Check user permissions in HAC
FlexSearch syntax errorFix query; check type names and attribute aliases
Groovy MissingMethodExceptionCheck Spring bean name in references/groovy-patterns.md
ECONNREFUSED / ETIMEDOUTCheck HAC_URL reachability; try HAC_IGNORE_SSL=true for dev

Reference Files

Load these on-demand when needed:

FileWhen to load
references/decision-guide.mdComplex cases where you're unsure of FlexSearch vs Groovy
references/flexsearch-guide.mdComposing FlexibleSearch queries (syntax, types, joins, caveats)
references/groovy-patterns.mdCommon Groovy patterns, Spring bean names, service examples
references/sap-cc-types.mdCommon SAP CC type names, attributes and catalog structure

Install & Usage

1
Create the skills directory
mkdir -p .claude/skills
2
Download the skill file
mkdir -p .claude/skills && curl -o .claude/skills/sapcc-hac-skill.md https://raw.githubusercontent.com/eljoujat/sapcc-hac-skill/main/SKILL.md
3
Invoke in Claude Code
/sapcc-hac-skill
View source on GitHub

Frequently Asked Questions

What is sapcc-hac-skill?

SAP Commerce Cloud HAC interaction via Groovy scripts or FlexibleSearch queries. Use this skill when the user asks to query, inspect, modify or administrate a SAP Commerce Cloud (Hybris / CCv2) instance – e.g. find products, orders, customers, run ImpEx, check cronjobs, execute business logic, or retrieve platform data. Automatically selects Groovy or FlexSearch based on request complexity.

How to install sapcc-hac-skill?

To install sapcc-hac-skill, create the .claude/skills directory in your project, then run the curl command to download the skill file. Once installed, invoke it in Claude Code with /sapcc-hac-skill.

What is sapcc-hac-skill best for?

sapcc-hac-skill is a community categorized under General. Created by eljoujat.