/sap-dev-core:sap-dev-status [--quiet]from sap-dev-core
Read-only health check for SAP dev artefacts (transport request, package, function group, RFC wrapper, DDIC structures) via RFC queries. Returns exit codes for pre-flight gating.
Ships in sap-dev-core. 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 report on the health of the artefacts /sap-dev-init is responsible
for. Designed to run in well under a second over RFC, so other skills
can call it as a pre-flight.
Task: $ARGUMENTS
| File | Token | Purpose |
|---|---|---|
<SAP_DEV_CORE_SHARED_DIR>/rules/skill_operating_rules.md | (rule) | Mandatory operating rules |
<SAP_DEV_CORE_SHARED_DIR>/rules/language_independence_rules.md | (rule) | GUI-scripting language independence — RFC-only skill, but rule applies to any downstream skill this is invoked from |
<SAP_DEV_CORE_SHARED_DIR>/scripts/sap_dev_artefacts.ps1 | many | RFC artefact checker (also used by /sap-dev-clean and /sap-dev-init). |
Resolve work_dir via the env-aware helper — do NOT take work_dir from a direct settings.json read (that ignores the SAPDEV_AI_WORK_DIR env var and userconfig.json). Use the WORK_DIR= value printed by:
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))"
The settings note below still applies to the OTHER keys.
Settings reads/writes follow shared/rules/settings_lookup.md — merge per-key on the .value field (env var → settings.local.json → userconfig.json → settings.json); non-per-connection writes go to userconfig.json. Read sap_dev_transport_request, sap_dev_package, sap_dev_function_group, plus the standard SAP RFC connection keys.
Per-connection keys (Phase 4.4): sap_dev_transport_request, sap_dev_package, sap_dev_function_group are SAP-system-specific. Per settings_lookup.md § Per-connection exception, read them from connections.json[pinned-profile].dev_defaults FIRST (resolve the pin via {work_dir}\runtime\session_registry.json ai_sessions[<id>]); only fall back to the two-file merge when dev_defaults is empty.
Target the connection named in the Task argument. If the Task argument names a SAP connection (SID / description substring / UUID), resolve it and pin this AI session to it so the RFC checker (and the per-connection dev_defaults read above) target the named system, not whatever is currently pinned (the default). This skill is read-only, so a mismatch only mis-reports the wrong system — but /sap-dev-clean calls this as its pre-flight, where targeting the wrong system is a safety issue.
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'; $m=@(Resolve-SapProfileHint -Hint '<TASK_ARG>'); if($m.Count -ne 1){ Write-Output ('TARGET=NEEDS_USER count='+$m.Count); return }; $rt=Join-Path (Get-SapWorkDir) 'runtime'; $aid=Get-SapAiSessionId -RuntimeDir $rt; & '<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_session_broker.ps1' -Action pin -WorkTemp ((Get-SapWorkDir)+'\temp') -AiSessionId $aid -ConnectionId $m[0].id -PinReason user_switched | Out-Null; Write-Output ('TARGET='+$m[0].system_name+'/'+$m[0].client)"
If TARGET=NEEDS_USER, ask the user which connection (the hint matched 0 or several profiles).
Set {WORK_TEMP} = {work_dir}\temp. Ensure it exists:
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 generated scratch (*_run.ps1 / *_run.vbs and the _run.json state) under {RUN_TEMP}; keep {WORK_TEMP} (base) only for Get-SapCurrentSessionPath -WorkTemp.
powershell -ExecutionPolicy Bypass -File "<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_log_helper.ps1" -Action start -StateFile "{RUN_TEMP}\sap_dev_status_run.json" -Skill sap-dev-status -ParamsJson "{}"
Fill the shared artefacts script:
$shared = '<SAP_DEV_CORE_SHARED_DIR>'
$ps = Get-Content "$shared\scripts\sap_dev_artefacts.ps1" -Raw -Encoding UTF8
$ps = $ps.Replace('%%SAP_SERVER%%', '')
$ps = $ps.Replace('%%SAP_SYSNR%%', '')
$ps = $ps.Replace('%%SAP_CLIENT%%', '')
$ps = $ps.Replace('%%SAP_USER%%', '')
$ps = $ps.Replace('%%SAP_PASSWORD%%', '')
$ps = $ps.Replace('%%SAP_LANGUAGE%%', '')
$ps = $ps.Replace('%%RFC_LIB_PS1%%', "$shared\scripts\sap_rfc_lib.ps1")
$ps = $ps.Replace('%%TR%%', 'THE_TR')
$ps = $ps.Replace('%%PACKAGE%%', 'THE_PKG')
$ps = $ps.Replace('%%FUGR%%', 'THE_FG')
$ps = $ps.Replace('%%WRAPPER_FM%%', '')
$ps = $ps.Replace('%%WRAPPER_STRUCT%%', '')
$ps = $ps.Replace('%%WRAPPER_TT%%', '')
$ps = $ps.Replace('%%UTIL_PROGRAM%%', '')
[System.IO.File]::WriteAllText('{RUN_TEMP}\sap_dev_status_run.ps1', $ps, [System.Text.Encoding]::UTF8)
Write-Host 'Done'
Empty WRAPPER_* / UTIL_PROGRAM tokens fall back to the canonical
defaults built into the shared script (Z_GENERIC_RFC_WRAPPER_TBL,
ZCMST_RFC_PARAM, ZCMCT_RFC_PARAM, ZCMRUPDATE_ADDON_TABLE).
Run via 32-bit PowerShell (NCo 3.1 is in GAC_32):
C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "{RUN_TEMP}\sap_dev_status_run.ps1"
The shared script emits one line per artefact, then anchor-validation lines, then a summary:
ARTEFACT: <NAME> | KIND: <TR|PKG|FG|FM|STRUCT|TT|PGM> | STATE: <state> | DETAIL: <free text>
...
ANCHOR: wrapper_fm=<FM> | package=<actual> | fugr=<actual>
CONFIG_MISMATCH: <key> | configured=<X> | anchor=<Y> | <why>
CONFIG_HINT: <key> is blank | anchor=<Y>
CONFIG: OK | CONFIG: MISMATCH=<M>
STATUS: ALL_OK
STATUS: GAPS=<N>
STATUS: CONFIG_MISMATCH
STATUS: ERROR
Anchor validation (emitted when the wrapper FM exists): the FM is the
immovable anchor of the toolset, so the script resolves where it actually
lives — its function group (TFDIR.PNAME) and that FG's package (TADIR) — and
prints that as ANCHOR:. It then cross-checks the configured sap_dev_package
/ sap_dev_function_group:
CONFIG_MISMATCH: — a non-blank but different value. This is the
dangerous case (a destructive clean/reset would aim at the configured object,
not the real toolset). <Y> is the correct value to fix the config to.CONFIG_HINT: — a blank value. Clean safely skips it, but it should be
<Y>.<state> values:
| State | Meaning |
|---|---|
ACTIVE | Artefact exists and is in the expected ready-to-use state |
INACTIVE | Exists but its active version is missing (run the relevant --activate-only) |
MISSING | Not in the system (run /sap-dev-init to create) |
MODIFIABLE (TR only) | Transport request can accept new objects |
RELEASED (TR only) | Transport request is closed; resolve a new TR |
EMPTY (PKG only) | Package exists but has no TADIR children |
NON_EMPTY (PKG only) | Package exists with TADIR children |
NOT_CONFIGURED | The corresponding sap_dev_* setting is blank in settings.json |
ERROR | RFC call failed for this artefact |
Exit code:
| Code | Meaning |
|---|---|
0 | Everything healthy (STATUS: ALL_OK) |
1 | One or more gaps; STATUS: GAPS=<N> |
2 | RFC connection failed; STATUS: ERROR |
3 | Config mismatch; STATUS: CONFIG_MISMATCH — the configured sap_dev_package / sap_dev_function_group does not match where the wrapper FM actually lives. Destructive skills (/sap-dev-clean) must refuse until the config is corrected to the ANCHOR: values. |
Format the output as a small table in your reply:
┌──────────────────────────────────┬────────┬────────────────┬──────────────────────────────────────────┐
│ Artefact │ Kind │ State │ Detail │
├──────────────────────────────────┼────────┼────────────────┼──────────────────────────────────────────┤
│ S4DK941132 │ TR │ MODIFIABLE │ TRSTATUS=D │
│ ZCMPKG018 │ PKG │ NON_EMPTY │ TDEVC ok, TADIR children=12 │
│ ZFG018 │ FG │ ACTIVE │ TLIBG ok, PROGDIR.STATE=A for SAPLZFG018 │
│ Z_GENERIC_RFC_WRAPPER_TBL │ FM │ ACTIVE │ TFDIR ok │
│ ZCMST_RFC_PARAM │ STRUCT │ ACTIVE │ DD02L AS4LOCAL=A │
│ ZCMCT_RFC_PARAM │ TT │ ACTIVE │ DD40L AS4LOCAL=A │
│ ZCMRUPDATE_ADDON_TABLE │ PGM │ ACTIVE │ PROGDIR.STATE=A │
└──────────────────────────────────┴────────┴────────────────┴──────────────────────────────────────────┘
STATUS: ALL_OK
If STATUS: CONFIG_MISMATCH (a CONFIG_MISMATCH: line is present), lead
with it — it outranks the per-artefact states. The configured dev defaults
point at the wrong objects (a frequent cause: an application build wrote its own
package/TR into the connection's dev_defaults). Show the ANCHOR: line (the
real home of the toolset) and tell the operator to correct the connection's
dev_defaults to the anchor values before running /sap-dev-clean, e.g.:
powershell -NoProfile -ExecutionPolicy Bypass -Command ". '<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_dev_default.ps1'" # see below
# Per mismatched key (Connection scope = the standing default for this system):
<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_dev_default.ps1 -Action set -Scope Connection -Key sap_dev_package -Value <anchor-package>
<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_dev_default.ps1 -Action set -Scope Connection -Key sap_dev_function_group -Value <anchor-fugr>
(CONFIG_HINT: lines are advisory — a blank key that clean skips; fill it to
the anchor value for completeness.)
If any state is not ACTIVE / MODIFIABLE, recommend the matching
remediation:
| Bad state | Recommend |
|---|---|
MISSING (any) | /sap-dev-init |
INACTIVE for FG | /sap-function-group --activate-only |
RELEASED TR | /sap-transport-request (resolve fresh TR) |
NOT_CONFIGURED | Run /update-config to set the missing key, then /sap-dev-init |
CONFIG_MISMATCH | Correct the connection dev_defaults to the ANCHOR: values (commands above) |
cmd /c del "{RUN_TEMP}\sap_dev_status_run.ps1"
powershell -ExecutionPolicy Bypass -File "<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_log_helper.ps1" -Action end -StateFile "{RUN_TEMP}\sap_dev_status_run.json" -Status SUCCESS -ExitCode 0
(For exit codes 1/2/3, set -Status FAILED -ExitCode <code> with
-ErrorClass DEV_STATUS_GAPS (exit 1 and 3 — the config-mismatch anchor
gate is reported under the same class) or RFC_LOGON_FAILED (exit 2).)
Other sap-dev skills MAY call /sap-dev-status as a pre-flight when
their flow assumes the dev env is set up — for example,
/sap-rfc-wrapper fm could fail fast with a clear "wrapper FM not
deployed; run /sap-dev-init" message instead of running the wrapper
script and getting a vague FM_NOT_FOUND from RFC. Status is RFC-only
and read-only, so this is safe to chain liberally.
The skill is idempotent and fast (<1s typical). Don't worry about calling it twice.
/sap-dev-init artefact list (wrapper FM + DDIC + utility
program). If the customer has forked init to add their own
artefacts, extend sap_dev_artefacts.ps1 accordingly.SAP* instead of Z*/Y* is reported as-is; this skill
does not enforce naming conventions.TADIR
children only — does not recurse into sub-packages.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub sapdev-ai/sap-dev --plugin sap-dev-core61 skills in this plugin
/sap-activate-objectActivates an inactive SAP repository object via SAP GUI Scripting. Routes to
the correct transaction by object type: SE38 for reports/programs/function-
group main programs, SE37 for function modules, SE24 for classes/interfaces
/methods, SE11 for DDIC objects (table, view, dataelement, structure,
tabletype, typegroup, domain, searchhelp, lockobject). Handles the
"inactive objects worklist" popup that SAP shows when there are multiple
inactive objects of the same locality (transportable vs. local — SAP filters
the popup by package locality of the triggering object). Verifies activation
via PROGDIR (programs/FMs include) and DWINACTIV.
Prerequisites: Active SAP GUI session (use /sap-login first).
/sap-api-advisorNatural-language SAP API discovery over RFC (no GUI): turn a goal like "create
a sales order" or "post a goods movement" into a ranked, trap-annotated,
paste-ready shortlist of BAPIs / function modules / classes — with released
state (S/4), interface + documentation for the top candidates, the team's known
traps inlined, and a ready-to-paste CALL FUNCTION snippet. Reads the BAPI
catalog (BAPI_MONITOR_GETLIST), TFDIR/TFTIT name+text, SEOCLASS, ARS_W_API_STATE
(S/4 released state), FUPARAREF/FUNCT + DOCU_GET. HARD rule: it never test-calls
a candidate — snippets are text only. Read-only; deploys nothing.
Use for: "which BAPI/FM for X", find an API, is this BAPI released, API to
create/read/post <object>, discover function module, released API S/4.
`successor` (released→sanctioned replacement) is phase 2; `scan` is phase 3.
Prerequisites: an RFC-capable connection profile (/sap-login). No dev-init, no GUI.
/sap-atcRuns the SAP ABAP Test Cockpit (ATC) end-to-end as a quality gate:
builds an SCI Object Set scoped to the target object(s), creates an
ATC Run Series bound to that set, polls the ATC Run Monitor until the
run completes, then reads the Priority 1 / Priority 2 / Priority 3
finding counts from the Manage Results screen and (best-effort)
downloads the result text file. Applies the customer brief's
MAX_PRIORITY threshold to decide pass / fail.
Replaces the legacy SCI-results-tree implementation that lacked a
Priority column. Per-stage VBS references are recorded against the
S/4HANA 1909 ATC layout — re-record on first failure with
/sap-gui-probe --record if your release uses different tree node IDs / grid
column IDs.
Prerequisites: Active SAP GUI session (use /sap-login first).
/sap-call-bdcExecutes BDC (Batch Data Communication) sessions in SAP via RFC.
Reads SHDB recording files from the bdc/ folder, connects via
SAP NCo 3.1, calls ABAP4_CALL_TRANSACTION, and outputs
full BDCMSGCOLL messages to a result file.
Connection parameters resolved from the AI session's pinned profile in
connections.json (saved via /sap-login).
Prerequisites: SAP profile saved via /sap-login (RFC password required).
SAP NCo 3.1 (32-bit, .NET 4.0) in GAC.
/sap-change-packageChanges the package (TADIR-DEVCLASS) assignment of an SAP repository object
via the "Object Directory Entry" dialog (Goto > Object Directory Entry).
Routes by object type to SE38 / SE37 / SE24 / SE11 / SE91 / CMOD (the last
for enhancement projects — used by /sap-cmod). Handles three
flows automatically based on current vs new package locality:
(a) $TMP → transportable (Z*/Y*): resolves a modifiable TR via
/sap-transport-request, then enters the new package + TR.
(b) transportable A → transportable B: pre-checks E071/E070 to ensure
the object is NOT linked to a modifiable TR (would block the move).
(c) transportable → $TMP: confirms the move and presses "Local object".
Verifies via TADIR re-query.
Prerequisites: Active SAP GUI session (use /sap-login first).
/sap-check-abapValidates ABAP source (report / program / FM / class / include) before
deployment — one skill, dimension-dispatched: naming (variable conventions),
type (DDIC type validity), unused (dead variables), sql (SELECT/UPDATE/DELETE
fields vs table defs), contract (offline generation rules), spec (offline: code
covers every dependency / message / text / selection field in the design spec),
fm (CALL FUNCTION params / sections / types vs the live FM over RFC — absorbed
from the former sap-check-fm), syntax (compiler-level EDITOR_SYNTAX_CHECK via
RFC, catching real errors offline before any GUI upload). Writes tab-delimited
result files with fix advice; feed findings to /sap-fix-abap. SAP connection
optional — offline skips type/sql/fm/syntax; live dimensions that can't run
report COULD_NOT_CHECK, never a silent pass.
Prerequisites: SAP GUI (SAP.Functions COM); SAP NCo 3.1 (32-bit) + the dev-init
wrapper Z_GENERIC_RFC_WRAPPER_TBL for the syntax dimension.
Other plugins' skills for the same job