/sap-migrate:sap-exit-modernize <EXIT_FM> | analyze <EXIT_FM> | translate <EXIT_FM> [--target <BADI>] [--class ZCL_...] | deploy <EXIT_FM> | verify <EXIT_FM> [--skip-unit] [--with-atc]from sap-migrate
Accelerates replacing classic CMOD function exits with BAdI implementations via a human-in-the-loop pipeline (analyze, translate, deploy, verify). Uses RFC reads, AI translation with manual markers, and never auto-deactivates old CMOD.
Ships in sap-migrate. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
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.
| 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) |
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))"
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 "{}"
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) |
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.
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 candidate
is a released enhancement interface / new BAdI / classic BAdI, the verdict is EXIT_NO_SAFE_TARGET and
translate/deploy refuse. Write exit_analysis.md + copy the advisor candidates.tsv. STOP here in
analyze mode. (active=COULD_NOT_CHECK when the project status can't be read — never silently active.)
Run the marker classifier on the ZX include source:
powershell -ExecutionPolicy Bypass -File "<SKILL_DIR>\references\sap_exit_markers.ps1" -SourceFile "{WORKDIR}\exit_modernize\<EXIT_FM>\exit_source\<zxinclude>.abap" -OutFile "{WORKDIR}\exit_modernize\<EXIT_FM>\manual_markers.tsv"
Then you translate: map the exit signature (from the FM source interface) to the chosen BAdI
method; every data flow with a marker (or otherwise no BAdI counterpart) becomes a
" TODO(MANUAL-<n>) block preserving the original statements as comments. Emit
translation\ZCL_<...>.abap, mapping.tsv, before_after.diff. Syntax-check with ZERO writes:
C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_rfc_syntax_check.ps1" -SourceFile "...\ZCL_<...>.abap" -ProgramName "ZCL_<...>" -Subc K -Wrap
A signature too complex to model -> COULD_NOT_CHECK, never a false-fail. STOP in translate mode.
Refuse if the analyze verdict was EXIT_NO_SAFE_TARGET (EXIT_TRANSLATE_BLOCKED).
Show the before/after diff, target BAdI, and MANUAL marker count. Gate: marker_count=0 -> a normal
yes/no; marker_count>0 -> TYPED confirmation DEPLOY <class> acknowledging "<n> MANUAL sections
ship commented-out / inert". Then /sap-se24 <class> + /sap-se19 create <BADI_DEF|SPOT> (they resolve
the TR via /sap-transport-request). Authoritative re-read: BADI_IMPL / ENHHEADER (new) or SXC_EXIT
(classic) to confirm the implementation row exists. No answer / wrong typed phrase -> log SKIPPED.
/sap-gen-abap-unit <class> --type class for the characterization test where logic is extractable;
where the seam is untestable-without-refactor, the equivalence verdict is UNVERIFIED (never
rendered passed). Optional /sap-atc CLASS <class>. Register artifacts + /sap-evidence-pack CLASS <class>. Always end by PRINTING (never running): "old CMOD project <P> remains ACTIVE — after
human sign-off run /sap-cmod deactivate <P>".
powershell -ExecutionPolicy Bypass -File "<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_log_helper.ps1" -Action end -StateFile "{RUN_TEMP}\sap_exit_modernize_run.json" -Status SUCCESS -ExitCode 0
Classes: EXIT_RESOLVE_FAILED, EXIT_NO_SAFE_TARGET, EXIT_TRANSLATE_BLOCKED,
EXIT_SCOPE_UNSUPPORTED, RFC_LOGON_FAILED.
EXIT_SAPMV45A_920 resolved enhancement
OIKICL01, function group XOIK, parsed the ZX customer include name ZXOIKU55 from the FM source,
reported it EMPTY_OR_MISSING (no customer implementation) and active=NO (in no active CMOD
project) — the full MODSAP->MODACT->MODATTR->ENLFDIR + RPY source chain. The marker classifier passes
a 10-assertion offline corpus: each of the 6 marker kinds fires once, a comment mentioning
UPDATE VBAK does NOT fire (comments stripped), and MODIFY zcust_tab (Z table) is NOT flagged while
UPDATE vbak (standard table) IS — the Z-namespace allow is load-bearing.active=COULD_NOT_CHECK when project status is unreadable (never silently
active); translate/deploy refuse after NO_SAFE_TARGET; equivalence defaults to UNVERIFIED unless a
characterization test passes; every MANUAL marker is a finding, never dropped.MODX_FUNCTION_ACTIVE_CHECK precise per-exit active check via the wrapper (v1.5 — its
exception result collapses through the wrapper's single OTHERS handler, so v1 uses the reliable
MODATTR project-status signal); ZX-include-as-input resolution (v1.5); batch --project analyze
(v1.5); screen/table/menu exits (v2). ECC 6 shares the identical read path (all 19 objects probed
identical); divergence is advisor ranking content (classic vs new BAdI), not tables. EC2 was
unavailable this session for the ECC re-confirm.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
sap-exit-modernize, cmod, badi, function-exit, clean-core, abap-modernization
10 skills in this plugin
/sap-cc-analyzeRuns the S/4HANA-readiness ATC over a migration campaign's REMEDIATE objects and
captures per-finding results into findings/findings_raw.tsv, advancing each
object to ANALYZED. The ATC run is delegated to /sap-atc
--variant=S4HANA_READINESS (so this skill ships no new GUI scripting; /sap-atc
fails loud if that variant can't be located on the release, so a non-readiness
run is never passed off as readiness). Two actions: `prepare` builds the
worklist from scope.tsv; `ingest` parses ATC result exports (from /sap-atc or a
manual "Manage Results" export — header-tolerant) into the findings ledger and
advances state. Run after /sap-cc-usage, before /sap-cc-triage.
Prerequisites: the connected system offers the S4HANA_READINESS variant with the
Simplification Database loaded; /sap-atc working (its per-stage recordings
target the S/4HANA 1909 ATC layout — re-record a failing stage with
/sap-gui-probe --record).
/sap-cc-campaignOwns the S/4HANA custom-code migration campaign workspace and is the
orchestration entry point for the sap-migrate engine. Five subcommands:
init — create a campaign workspace from the migration Customer Brief
(source/target release, in-scope packages, decommission policy,
connection profiles, human gates) + the empty state ledger.
status — per-state / per-tier counts + headline metrics.
report — render reports/dashboard.md: state/tier/pattern rollup + five KPIs
(decommission savings, ATC-clean rate, auto-fix rate, unmatched-finding
backlog, business sign-off); every percentage honest ("n/a", not 0%,
when the ledger isn't produced yet).
next — recommend the next pipeline skill, honouring the human-approval gates.
signoff— record a business-owner sign-off in campaign.json.
Pure workspace/state/reporting skill — OFFLINE (no SAP GUI, no RFC, no NCo); it
only reads/writes the campaign files the other sap-cc-* skills produce.
Prerequisites: none (the downstream skills it sequences do need SAP access).
npx claudepluginhub sapdev-ai/sap-dev --plugin sap-migrateOther plugins' skills for the same job