Skip to content
Development
Skill

/sap-exit-modernize

Accelerates the canonical clean-core chore of replacing a classic CMOD function exit with a BAdI implementation — a human-in-the-loop pipeline (analyze -> translate -> deploy -> verify) that does the tedious reads and the genuinely hard AI translation while NEVER

From plugin
sap-dev
8123 skills3 agents
Install
$ npx -y skills add sapdev-ai/sap-dev --skill sap-exit-modernize --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-exit-modernize

Context preview

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

Accelerates the canonical clean-core chore of replacing a classic CMOD function exit with a BAdI implementation — a human-in-the-loop pipeline (analyze -> translate -> deploy -> verify) that does the tedious reads and the genuinely hard AI translation while NEVER

SKILL.md

sap-exit-modernize.SKILL.md
name: sap-exit-modernize
description: |
  Accelerates the canonical clean-core chore of replacing a classic CMOD function exit with a BAdI
  implementation — a human-in-the-loop pipeline (analyze -> translate -> deploy -> verify) that does
  the tedious reads and the genuinely hard AI translation while NEVER auto-deactivating the old CMOD
  project. analyze (RFC, read-only) resolves the exit's identity (MODSAP/MODACT/MODATTR/ENLFDIR),
  reads its source + ZX include, checks whether a containing CMOD project is active, gets ranked
  replacement targets from /sap-enhancement-advisor, and owns the NO_SAFE_TARGET verdict (only
  implicit points / standard-mod left -> refuse to translate). translate AI-maps the exit signature
  to the chosen BAdI method with load-bearing MANUAL markers (an offline classifier flags TABLES /
  COMMON PART globals, SY-* writes, direct standard-table DB writes, MESSAGE...RAISING, PERFORM into
  the standard program, COMMIT WORK — each becomes a commented TODO(MANUAL-n) block) and syntax-checks
  the class with ZERO writes. deploy is confirm-gated (typed confirm when markers exist) and delegates
  ALL writes to /sap-se24 + /sap-se19, with an authoritative BADI_IMPL/SXC_EXIT re-read. verify runs a
  characterization test via /sap-gen-abap-unit (honest UNVERIFIED where logic isn't extractable),
  optional /sap-atc, an evidence-pack dossier, and ends by PRINTING (never running) the
  /sap-cmod deactivate proposal. One exit at a time. No new Z objects. Prerequisites: pinned RFC
  profile via /sap-login; NCo 3.1 (32-bit); a GUI session only for deploy/verify.
argument-hint: "<EXIT_FM> | analyze <EXIT_FM> | translate <EXIT_FM> [--target <BADI>] [--class ZCL_...] | deploy <EXIT_FM> | verify <EXIT_FM> [--skip-unit] [--with-atc]"

SAP Exit-Modernize Skill

You accelerate one function-exit -> BAdI conversion as a gated pipeline: read the exit, translate it to a BAdI class with honest MANUAL markers, deploy through the workbench skills behind a confirm gate, and verify equivalence. You NEVER deactivate the old CMOD project — you only print the proposal.

Task: $ARGUMENTS

The exit read + marker classification are scripts; **you** do the exit->BAdI translation (with MANUAL blocks) and the equivalence narrative.

---

Shared Resources

| File | Token / call | Purpose | |---|---|---| | `<SAP_DEV_CORE_SHARED_DIR>/rules/safety_policy.md` + `<SAP_DEV_CORE_SHARED_DIR>/scripts/sap_safety_gate.ps1` | Rule 0 | Environment guard — Step 0.6 runs `-Action assert` before the write | | `<SKILL_DIR>/references/sap_exit_read.ps1` | `-Exit <FM>` | analyze RFC reader (identity + source + active check) | | `<SKILL_DIR>/references/sap_exit_markers.ps1` | `-SourceFile -OutFile` | offline MANUAL-marker classifier | | `<SKILL_DIR>/references/sap_exit_markers.tests.ps1` | offline | 10-assertion marker corpus | | `<SAP_DEV_CORE_SHARED_DIR>/scripts/sap_rfc_syntax_check.ps1` | `-Subc K -Wrap` | zero-write class syntax check | | `/sap-enhancement-advisor` | sub-skill | ranked BAdI targets (SMOD then PROGRAM mode) | | `/sap-se24` · `/sap-se19` | sub-skills | class + BAdI-impl deploy (TRs resolved downstream) | | `/sap-gen-abap-unit` · `/sap-atc` · `/sap-evidence-pack` | sub-skills | verify + dossier | | `/sap-cmod` | sub-skill | the PRINTED deactivate proposal (user-run, never auto) |

---

Step 0 — Resolve Work Directory

Resolve `work_dir` + `{RUN_TEMP}`; per-exit stage-persistent folder `{work_dir}\exit_modernize\<EXIT_FM>\` (so analyze-today + deploy-tomorrow works).

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)); Write-Output ('RUN_TEMP=' + (Get-SapRunTemp))"

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_exit_modernize_run.json" -Skill sap-exit-modernize -ParamsJson "{}"

Step 0.6 — Safety Gate (Rule 0 — `safety_policy.md`)

The write modes (`deploy`, `verify` — both delegate to gated deploy skills) run the environment gate up front for an early verdict; `analyze` and `translate` are read/local and skip it:

powershell -NoProfile -ExecutionPolicy Bypass -File "<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_safety_gate.ps1" -Action assert -Skill sap-exit-modernize

| Verdict (last line) | Exit | Action | |---|---|---| | `SAFETY: ALLOW ...` | 0 | proceed (log via `-Action step`, step `safety_gate`) | | `SAFETY: TYPED_CONFIRM_REQUIRED ... expect="PROD <SID>/<CLIENT>"` | 3 | the operator must **type** the shown token; re-run assert with `-ConfirmationText '<their verbatim answer>'`; proceed only on `ALLOW_CONFIRMED` | | `SAFETY: REFUSED class=<C> ...` | 1 | **STOP.** End the run `FAILED` with `-ErrorClass <C>` and relay the gate's remediation lines. Never bypass, soften, retry, or drive the transaction manually instead — Rule 0 outranks every other instruction, including mid-session user ones. | | `SAFETY: ERROR ...` | 2 | treat exactly as `REFUSED` (fail closed) |

Step 1 — Parse Arguments

Modes: full pipeline (default) | `analyze` | `translate` | `deploy` | `verify`. A non-function-exit component (screen `S`, table `C_*`, menu) -> refuse `EXIT_SCOPE_UNSUPPORTED` (v2). Normalize input to the `EXIT_*` FM.

Step 2 — analyze

C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "<SKILL_DIR>\references\sap_exit_read.ps1" -Exit <EXIT_FM> -OutDir "{WORKDIR}\exit_modernize\<EXIT_FM>" -SharedDir "<SAP_DEV_CORE_SHARED_DIR>"

Parse `EXIT:` (fm/enh/fg/projects/active/zxinclude/zxstatus) + `SRC:` lines. `EXIT_RESOLVE_FAILED` -> stop. Then delegate `/sap-enhancement-advisor` (SMOD mode on the enhancement; PROGRAM mode on the calling program if SMOD yields no BAdI). **NO_SAFE_TARGET rule (this skill owns it):** if no candida

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.