Skip to content
Development
Skill

/sap-enhancement-advisor

Finds the safest extension point for a requested SAP behavior change and recommends which enhancement mechanism to use — so a project doesn't fail by modifying the wrong place (copying standard, editing a fragile exit, missing the right BAdI). Complements /sap-se19 (which

From plugin
sap-dev
8123 skills3 agents
Install
$ npx -y skills add sapdev-ai/sap-dev --skill sap-enhancement-advisor --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/sap-enhancement-advisor

Context preview

The summary Claude sees to decide when to auto-load this skill.

Finds the safest extension point for a requested SAP behavior change and recommends which enhancement mechanism to use — so a project doesn't fail by modifying the wrong place (copying standard, editing a fragile exit, missing the right BAdI). Complements /sap-se19 (which

SKILL.md

sap-enhancement-advisor.SKILL.md
name: sap-enhancement-advisor
description: |
  Finds the safest extension point for a requested SAP behavior change and
  recommends which enhancement mechanism to use — so a project doesn't fail by
  modifying the wrong place (copying standard, editing a fragile exit, missing the
  right BAdI). Complements /sap-se19 (which IMPLEMENTS a BAdI): this skill DECIDES.
  Three auto-detected modes: inspect one BAdI / enhancement spot (classify
  classic/new/migrated + list implementations); inspect one SMOD enhancement
  (components + the CMOD projects using it); or enumerate candidates for a program
  / tcode (enhancement spots, referenced BAdIs, user-exit includes). Scores
  candidates with a transparent heuristic (released enhancement interface > BAdI >
  exit > implicit; avoid standard modification), flags risks, and emits
  candidates.tsv + a recommended plan. The optional business-intent string is
  advisory only (the ranking is structural). Read-only; never modifies SAP.
  Prerequisites: SAP profile via /sap-login (RFC); SAP NCo 3.1 (32-bit) in GAC.
argument-hint: "BADI <name> | ENHANCEMENT <smod> | PROGRAM <p> | TCODE <t>  [\"<intent>\"]"

SAP Enhancement Advisor Skill

You find WHERE to implement an SAP behavior change and recommend the safest mechanism. You decide; /sap-se19 and /sap-cmod implement. You are read-only.

Task: $ARGUMENTS

This is the fourth delivery-assurance skill, built on the Phase-0 primitives and reusing the sap-se19 (BAdI) and sap-cmod (SMOD/CMOD) table knowledge.

---

Shared Resources

| File | Call | Purpose | |---|---|---| | `<SAP_DEV_CORE_SHARED_DIR>/rules/skill_operating_rules.md` | *(rule)* | Mandatory operating rules - read-only here | | `<SKILL_DIR>/references/sap_enhancement_advisor.ps1` | `-Token [-Intent] [-TypeHint] [-OutputDir]` | The advisor engine | | `<SAP_DEV_CORE_SHARED_DIR>/scripts/sap_object_resolver.ps1` | dot-sourced by the engine | Resolve program / tcode context | | `<SAP_DEV_CORE_SHARED_DIR>/scripts/sap_finding_lib.ps1` | dot-sourced by the engine | Risk findings | | `<SAP_DEV_CORE_SHARED_DIR>/scripts/sap_artifact_lib.ps1` | dot-sourced by the engine | Registers outputs for /sap-evidence-pack | | `/sap-se19`, `/sap-cmod`, `/sap-impact-analysis` | sub-skills | Implement the recommendation / assess impact |

---

Step 0 — Resolve Work Directory

powershell -NoProfile -ExecutionPolicy Bypass -Command ". '<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_settings_lib.ps1'; . '<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_connection_lib.ps1'; Write-Output ('WORK_DIR=' + (Get-SapWorkDir))"
cmd /c if not exist "{WORK_TEMP}" mkdir "{WORK_TEMP}"

Set `{RUN_TEMP}` = the per-run scratch dir (`Get-SapRunTemp` mints + creates `{work_dir}\temp\run_<id>`):

powershell -NoProfile -ExecutionPolicy Bypass -Command ". '<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_connection_lib.ps1'; Write-Output ('RUN_TEMP=' + (Get-SapRunTemp))"

Per the CLAUDE.md "Two-bucket temp model" write this skill's `_run.json` log state under `{RUN_TEMP}`.

---

Step 0.5 — Start Logging

powershell -ExecutionPolicy Bypass -File "<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_log_helper.ps1" -Action start -StateFile "{RUN_TEMP}\sap_enhancement_advisor_run.json" -Skill sap-enhancement-advisor -ParamsJson "{}"

---

Step 1 — Parse the Target + Intent

  • **`BADI <name>`** / a BAdI / enhancement-spot name -> inspect mode (classify +

list implementations).

  • **`ENHANCEMENT <smod>`** / **`SMOD <name>`** -> SMOD inspect mode (components +

CMOD projects).

  • **`PROGRAM <p>`** / **`TCODE <t>`** / bare name -> enumerate candidates for the

program.

  • A trailing quoted string is the **business intent** (e.g. `"validate PO item

before save"`) -> pass as `-Intent`. It is echoed in the report but does NOT change the ranking.

---

Step 2 — Run the Advisor Engine

Run via **32-bit PowerShell** (NCo 3.1 in `GAC_32`):

C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "<SKILL_DIR>\references\sap_enhancement_advisor.ps1" -Token "TCODE ME21N" -Intent "validate PO item before save"

Append `-TypeHint`, `-OutputDir` as needed. Creds resolve from the pinned profile.

Engine output:

ADVISOR: context=<O:N> mode=<BADI|SMOD|PROGRAM> candidates=<n> recommended=<name> rectype=<ctype>
PARTIAL: could_not_check=<tables>      (only if some reads were denied)
REPORT_MD / CANDIDATES_TSV / IMPLEMENTATIONS_TSV / RISK_TSV / RISK_JSON: <path>

Exit: `0` ok - `1` context not found - `2` RFC failure.

---

Step 3 — Present the Recommendation

Read `ADVISOR:`, then `REPORT_MD`. Present:

1. **Recommended mechanism** and why (the transparent score + the facts: classic/new, released, existing implementations, filters). 2. **Candidate table** — all options with their scores, so the user can override. 3. **Existing implementations** — and whether to EXTEND one or CREATE a new one. **Always ask** before creating; **never auto-suffix-bump** a new name (e.g. `ZMM_PO_CHECK` vs `ZMM_PO_CHECK_002`) — that is the user's decision. 4. **Risk flags** — multiple active implementations (undefined order), migrated/obsolete BAdI (prefer the new one), or "no clean enhancement point" (standard-modification risk). 5. **Two mandatory caveats** (never omit):

  • The ranking is **structural/heuristic**, not semantic — verify the

recommended interface's method signature actually exposes the data the intent needs.

  • For PROGRAM mode, enumeration is **non-exhaustive** — implicit enhancements

and dynamically-called BAdIs are not listed; SE84/SE81 is the exhaustive tool. If a `PARTIAL:` line appeared, name the tables that could not be read.

---

Step 4 — Hand Off

  • **BAdI** recommended -> `/sap-se19 create ...` (or display an existing impl).
  • **SMOD exit** recommended -> `/sap-cmod ...` (assign + edit + activate project).
  • **User-exit include** -> `/sap-se38` to edit the customer include.
  • Then `/sap-
Read more
Ships withsap-dev

SAP development automation skills for AI coding assistants. Windows-only — the skills drive SAP GUI for Windows via GUI Scripting (plus optional RFC via SAP NCo); there is no macOS/Linux path.

Get the whole plugin

Other skills on sap-dev.