L’interface est localisée ; les présentations et documents des Skills sont traduits automatiquement par IA dans votre langue. Le code, les commandes, chemins et termes techniques restent en version originale, et le document de l’auteur fait foi.
Explorer les Skills
Productivité · SKILL.md

superclaude-for-sap

superclaude-for-sap

Superclaude for SAP reference (babamba2/superclaude-for-sap). Includes advanced agent prompts, macros, and shortcut mappings for SAP — power-user macro phrases that expand to full sap-router-orchestrator flows.

Independent GitHub snapshot · Automated classification · Original documentation governs

Documentation de la Skill

GitHub

name: superclaude-for-sap description: Superclaude for SAP reference (babamba2/superclaude-for-sap). Includes advanced agent prompts, macros, and shortcut mappings for SAP — power-user macro phrases that expand to full sap-router-orchestrator flows. trigger: keywords: [superclaude, macro, shortcut, alias, power user, quick command, agent prompt, delegation shortcut, command expansion] intent: Expanding short power-user macro phrases into full orchestrator npm/CLI flows (routing, pipeline, review, fallback, caveman delegation) prerequisites:

  • SAP_ROUTER_ROOT points to the sap-router-skill repository
  • Node.js + npm — all macros run from the sap-router-skill repo root
  • Python 3.11+ (scripts/ directory: sap_router.py, fallback_engine.py, healthcheck.py)
  • .env configured — run npm run hc:prompt once before first macro use
  • Optional for GUI fallback tiers: SAPGUI installed with scripting enabled (npm run gui:check)

Superclaude for SAP — Macro and Shortcut Layer

A macro is a short command phrase the user types (or Codex recognizes) that expands to a full orchestrator flow. Every macro below is grounded in a real npm script from package.json. Adapted from babamba2/superclaude-for-sap for this repo's router, pipeline, and fallback engine.

Runtime root

Before expanding a macro, resolve SAP_ROUTER_ROOT, verify that package.json and scripts/sap_router.py exist there, and change the working directory to that repository. All npm run ... and python scripts/... examples below are relative to that root. Fail closed if the configured root is unavailable.

1. Macro Table

MacroExpands toWhen
probenpm run hcSession start — health of 53 MCPs + .env completeness
probe fixnpm run hc:promptHealthcheck found missing .env vars — interactive fill
route Xnpm run router -- --action XSingle action, ADT-first (e.g. MM_CREATE_MATERIAL)
route gui Xnpm run router:gui -- --action XSkip ADT, go straight to SAP GUI automation
cave <task>npm run router:caveman -- "<task>"Small bounded task — router picks a cavecrew agent
spec scannpm run spec:analyze -- requirements.mdClassify a spec before committing to the pipeline
spec runnpm run pipeline -- requirements.mdFull 8-stage spec-to-transport pipeline
spec fastnpm run pipeline:fast -- requirements.mdTrusted spec — skip optional pipeline stages
reviewnpm run abap:reviewLint + security + Clean ABAP on templates/**/*.abap
ship itnpm run abap:review:transportPre-release transport gate (GO/NO-GO)
zprobenpm run zrouter:probeCheck if ZROUTER RFC handler is installed on SAP
fallback Xnpm run fallback:execute -- XAction failed — cascade 6 tiers (ADT→RFC→GUI→BDC→Offline→Manual)
map Xnpm run fallback:map -- XShow the tier plan for action X without executing anything
gui ok?npm run gui:checkVerify SAPGUI scripting is enabled before GUI-tier macros
all greennpm run validate:allFull gate: healthcheck + abaplint CI + router status

Extended macros: diagram <file> → npm run btp:diagram -- landscape.json (BTP architecture diagram), hdi lint <path> → npm run hana:hdi-lint -- db/src (HDI artifact lint).

2. Caveman Delegation Shortcuts

One entry point — the router decides which cavecrew agent handles the task:

npm run router:caveman -- "find where MATNR conversion exit is called"
Task shapeAgent chosenOutput
Locate code, "where is X", map directorycavecrew-investigatorfile:line table, read-only
1-2 file surgical edit, rename, typo fixcavecrew-buildercaveman diff receipt
Review a diff/branch/filecavecrew-reviewerone line per finding, severity-tagged

Delegate when scope is bounded and obvious; subagent output is caveman-compressed (~60% smaller), so the main context lasts longer. Do NOT delegate new features or 3+ file refactors — builder refuses.

3. Advanced Agent Prompt Patterns

Dry-run first on any non-trivial spec — see stage plan and routing decisions with zero SAP writes:

python scripts/sap_router.py pipeline --mode dry-run --spec req.md

Then commit to a real run:

npm run pipeline -- req.md          # full 8 stages: spec -> code -> lint -> transport
npm run pipeline:fast -- req.md     # fast mode when the dry-run showed no ambiguity

Parallel waves — independent actions belong in one prompt so the orchestrator batches them:

route MM_CREATE_MATERIAL + route FI_POST_DOCUMENT + zprobe   (no shared state -> run as one wave)

Self-learn feedback — teach the router after each macro so future routes improve:

npm run learn:mcp -- --mcp arc-1 --latency 245 --success true
npm run learn:route -- --action MM_CREATE_MATERIAL --success true

4. Data Macros (CSV to BAPI)

# "sheet MM CREATE_MATERIAL" -> generate a CSV template with the right BAPI fields
npm run template -- --module MM --action CREATE_MATERIAL

# "check csv" -> validate field mapping before any conversion
npm run csv:check -- --input data.csv --module MM --action CREATE_MATERIAL

# "load csv" -> convert validated CSV to BAPI JSON for ZROUTER dispatch
npm run convert -- --input data.csv --module MM --action CREATE_MATERIAL

Always run csv:check before convert — the checker catches missing mandatory BAPI fields offline.

Pitfalls

  • Macro fails with connection/auth errors → Cause: macros assume a configured .env; healthcheck was never run. Solution: npm run hc:prompt first — it interactively fills missing vars, then re-run.
  • spec run on an ambiguous spec wastes a full pipeline pass → Cause: 8 stages executed on a spec that needed clarification. Solution: spec scan first, then python scripts/sap_router.py pipeline --mode dry-run --spec req.md before any real run.
  • fallback X dies at Tier 3 (GUI) → Cause: cascade reached GUI/BDC tiers but SAPGUI scripting is not installed/enabled on this machine. Solution: npm run gui:check; if red, enable SAPGUI scripting (RZ11 sapgui/user_scripting = TRUE) or accept Offline tier output.
  • Flags swallowed by npm → Cause: missing -- separator, e.g. npm run router --action X. Solution: always pass args after --: npm run router -- --action X.
  • ship it passes locally but transport is rejected → Cause: only abap:review (lint) was run. Solution: abap:review:transport is the actual release gate; run it before every transport release.

Verification

# Environment sane and every MCP reachable
npm run hc

# Macro expansion works end-to-end without touching SAP
npm run fallback:map -- MM_CREATE_MATERIAL     # prints tier plan, no execution
python scripts/sap_router.py pipeline --mode dry-run --spec req.md

# Full gate — healthcheck + lint CI + router status must all pass
npm run validate:all

Related

  • sap-router-skill — master dispatch table and routing decision tree these macros expand into
  • karpathy-guidelines — mandatory wrapper (Think → Simplify → Surgical → Goal-Verify) around every macro
  • cavecrew-investigator / cavecrew-builder / cavecrew-reviewer — the subagents the delegation shortcuts in section 2 dispatch to
  • run-sap-router-skill — smoke-testing the CLIs behind the macros
  • sap-self-learn — how learn:mcp / learn:route telemetry adapts future routing
Skills enregistrées