/sap-project:sap-health-check [--profile morning] [--connection PROFILE] [--window-hours N] [--no-gui] [--json] | baseline <accept|show|reset>from sap-project
SAP morning health sweep: runs six probe families (stuck IDocs, tRFC, qRFC, spool, jobs, dumps), classifies findings as NEW vs RECURRING against a baseline. Read-only, safe for production.
Ships in sap-project. 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 do the morning "are the interfaces healthy?" walk as ONE command, and — unlike a manual walk judged from memory — classify every finding NEW vs known-recurring against a persisted per-system baseline. Read-only; safe to point at production.
Task: $ARGUMENTS
Pure read-only on SAP in every v1 mode. The only GUI touch is an optional
/sap-st22 dump-detail leg (skipped without a live GUI session). baseline accept
writes only local state but changes future verdicts → plain confirm first.
| File | Token / call | Purpose |
|---|---|---|
<SAP_DEV_CORE_SHARED_DIR>/rules/skill_operating_rules.md | (rule) | Mandatory operating rules — read-only here |
<SKILL_DIR>/references/sap_health_rfc_probes.ps1 | -WindowHours [-Max -IdocMap] -OutDir | The six RFC probe families → findings.tsv |
<SKILL_DIR>/references/sap_health_baseline.ps1 | -Action classify|accept|show|reset -BaselineFile [-FindingsTsv -Stamp] -OutDir | Baseline NEW/RECURRING/RESOLVED delta |
<SKILL_DIR>/references/health_probe_matrix.tsv | matrix | Per-area source/thresholds/enable; override at {custom_url}\health_probe_matrix.tsv |
<SKILL_DIR>/references/health_idoc_status_map.tsv | map | IDoc status → ERROR/WAITING class (direction-aware); same override path |
/sap-diagnose (Skill tool) | --reader sm13|sm12|slg1 | Delegated update-failure / stale-lock / app-log readers |
/sap-st22 (Skill tool) | dump detail | Optional GUI leg (liveness-checked; --no-gui skips) |
<SAP_DEV_CORE_SHARED_DIR>/scripts/sap_artifact_lib.ps1 | Step 7 | Artifact index for /sap-evidence-pack |
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 ('STAMP=' + (Get-Date -Format 'yyyyMMddHHmmss')); Write-Output ('RUN_TEMP=' + (Get-SapRunTemp))"
Resolve the pinned connection's SID+client (from the profile / an IDENT line). Set
{RUN_TEMP} = the RUN_TEMP= value printed above (Get-SapRunTemp mints + creates the
per-run scratch dir holding the log state file; mint it once here and reuse — re-minting
breaks the -Action end state-file lookup); {OUT} = Get-SapArtifactDir -ScopeKey SYS_<SID>_<CLIENT> -Skill sap-health-check. Baseline file (Bucket A, durable — NOT temp):
{work_dir}\runtime\health\<SID>_<CLIENT>_baseline.json.
powershell -ExecutionPolicy Bypass -File "<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_log_helper.ps1" -Action start -StateFile "{RUN_TEMP}\sap_health_check_run.json" -Skill sap-health-check -ParamsJson "{}"
Default --profile morning. baseline accept|show|reset → Step 8. --connection PROFILE (else pinned), --window-hours N (default 24), --no-gui, --json.
--trend is v1.5 (ships dark — needs ≥2 weeks of snapshots; HC_NO_HISTORY under 2);
--profile close and --compare are v2 → say NOT_YET_IMPLEMENTED and STOP.
C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "<SKILL_DIR>\references\sap_health_rfc_probes.ps1" -WindowHours <N> -IdocMap "<SKILL_DIR>\references\health_idoc_status_map.tsv" -SharedDir "<SAP_DEV_CORE_SHARED_DIR>" -OutDir "{OUT}"
Parse HC: / HC_AREA: lines + STATUS:. A connect failure → exit 2, RFC_LOGON_FAILED,
no verdict emitted. A HC_AREA: coverage=COULD_NOT_CHECK area (auth/RFC failure) is
carried as such — never a silent healthy. The engine writes findings.tsv.
Invoke /sap-diagnose --reader sm13, sm12, slg1 via the Skill tool (skill→skill,
never the reference *.ps1 directly). Fold their evidence into the finding stream
(update failures, stale locks, app-log errors) as extra HC:-shaped rows. SM37 is NOT
delegated — the windowed aborted-job count lives in the probe engine (cheaper).
Only if not --no-gui AND a GUI session is live: run
sap_check_gui_login_status.vbs (32-bit cscript); on LOGGED_IN invoke /sap-st22 for
top-N dump detail and enrich the dump fingerprints. Anything but LOGGED_IN skips the
leg (SNAP counts remain the authoritative dump signal — coverage stays CHECKED) and is
noted in the report.
C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "<SKILL_DIR>\references\sap_health_baseline.ps1" -Action classify -BaselineFile "{work_dir}\runtime\health\<SID>_<CLIENT>_baseline.json" -FindingsTsv "{OUT}\findings.tsv" -Stamp <STAMP> -OutDir "{OUT}"
Parse DELTA: class=NEW|RECURRING|RESOLVED … + STATUS: OK new=.. recurring=.. resolved=...
A corrupt baseline → HC_BASELINE_CORRUPT (fail loud, STOP). Writes health_snapshot.json
and updates the baseline last-seen.
Write health_report.md into {OUT}. Per-area table: area / count / new / recurring /
worst severity. Grounding rule: every row traces to findings.tsv. For each finding give
a ready-to-paste /sap-diagnose anchor command to drill in (e.g.
/sap-diagnose --object VBELN:… --reader sm13 for an update failure; /sap-idoc find --status <n> for an IDoc cluster; /sap-rfc-monitor --dest <d> for a tRFC cluster).
Verdict HEALTH: HEALTHY|DEGRADED|CRITICAL (GO/GO_WITH_WARNINGS/NO_GO): any HIGH →
CRITICAL, any MEDIUM or any COULD_NOT_CHECK → at least DEGRADED, NEW findings raise a notch.
A clean sweep with any COULD_NOT_CHECK caps at DEGRADED (never HEALTHY).
Register health_snapshot.json (kind health_snapshot), health_report.md (kind
health_report), findings.tsv (kind findings) via Register-SapArtifact under scope
SYS_<SID>_<CLIENT> with Coverage + Verdict. Echo:
HEALTH: <verdict> areas=<n> new=<x> recurring=<y> could_not_check=<z>
powershell -ExecutionPolicy Bypass -File "<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_log_helper.ps1" -Action end -StateFile "{RUN_TEMP}\sap_health_check_run.json" -Status SUCCESS -ExitCode 0
baseline show → print the baseline. baseline reset → clear it (confirm first). baseline accept → run the probes first (Step 2), then list exactly which NEW fingerprints will be
marked recurring and ask a plain confirm (it changes future verdicts — no typed
confirmation, no SAP write), then -Action accept.
morning sweep (6 RFC probe families + /sap-diagnose sm13/sm12/slg1
delegation + optional /sap-st22 dump leg) with a persisted per-system baseline
(NEW/RECURRING/RESOLVED), and baseline accept/show/reset. Read-only on SAP.COULD_NOT_CHECK, never a silent
healthy; any COULD_NOT_CHECK caps the verdict at DEGRADED. Window is date-granularity
(workstation clock; both systems are China time) — stated in the report; row caps
(default 5000) surface honestly. The baseline is coarse-fingerprinted by design.--trend month/week rollups (v1.5 — ships dark; HC_NO_HISTORY under 2
snapshots); --profile close (posting periods / held docs / blocked billing) and
--compare hypercare snapshot diff (v2); watch mode (v3).What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
sap-health-check, monitoring, baseline, rfc-probes, daily-sweep, production-safe
40 skills in this plugin
/sap-auth-diagnoseDiagnoses "no authorization" failures deterministically over RFC and proposes the
exact PFCG fix — no more pasting an SU53 screenshot and hand-searching SUIM. Given
the failed authorization object (+ optional field values, read off SU53 / an ST22
dump / an application-log message), it evaluates the target user against the
AUTHORITATIVE runtime user buffer (`SUSR_USER_AUTH_FOR_OBJ_GET`, remote-enabled on
S/4HANA 1909 + ECC 6) with faithful AUTHORITY-CHECK semantics — one authorization
instance must satisfy every field, '*' matches anything, VON..BIS ranges honoured —
so the verdict can never disagree with the real kernel check the way a hand-rolled
AGR_1251/UST12 join can. It then classifies each failure (`MISSING_OBJECT` /
`MISSING_VALUE` / `BUFFER_STALE`) plus user-level `USER_LOCKED` / `USER_EXPIRED` /
`ROLE_EXPIRED`, names the closest role the user already has (with what it currently
grants), and writes a diagnosis TSV + fix-proposal + ready-to-send security request.
Read-only toward roles and users — the fix is always a proposal, never a write.
Prerequisites: SAP profile via /sap-login (RFC); SAP NCo 3.1 (32-bit). su53 (GUI
auto-scrape of the failed objects) and trace (STAUTHTRACE) modes are the documented
next phase — until then the operator supplies the failed object (Claude decodes a
pasted SU53 into the check input).
/sap-auth-requirementsDerives the SAP authorization requirements a custom development actually needs — the
deliverable Z-transactions never hand the security team. derive reads a program/FM source over
RFC, extracts the EXPLICIT AUTHORITY-CHECK surface plus the IMPLICIT one (CALL TRANSACTION ->
S_TCODE, SUBMIT -> S_PROGRAM, OPEN/DELETE DATASET/TRANSFER -> S_DATASET, CALL FUNCTION
DESTINATION -> S_RFC, DDIC table writes -> S_TABU_DIS incl. dynamic MODIFY (var)), traces each
value to its nearest literal, and validates every object/field/activity against the live
catalog (TOBJ / TACTZ) — emitting a required-auth matrix with per-row CONFIRMED / INFERRED
honesty plus an SU24 proposal draft. su24-audit lists Z/Y tcodes against USOBX_C / USOBT_C and
flags the real gap: NO_PROPOSAL / CHECK_DISABLED / ONLY_S_TCODE / PROPOSAL_PRESENT with a
staleness date. Pure RFC + offline extraction (no wrapper FM, no dev-init, runs on a bare
security profile); a static value that cannot be resolved is INFERRED, never silently
CONFIRMED. Class/interface source needs an SE24 GUI download (pass --source-files) or degrades
to COULD_NOT_CHECK. Owns the AUTHREQ_* finding namespace so it never double-reports with
/sap-review-abap's security dimension. v2: su24-maintain / su21-create (confirm-gated GUI).
Prerequisites: pinned /sap-login RFC profile; NCo 3.1 (32-bit).
npx claudepluginhub sapdev-ai/sap-dev --plugin sap-projectOther plugins' skills for the same job