/sap-project:sap-auth-diagnose check --object <OBJ> [--values F=V,F2=V2] [--user <U>] [--ticket <id>] | check --input <tsv> | (su53 | trace = next phase)from sap-project
Diagnoses SAP 'no authorization' failures via RFC, evaluates against user's runtime buffer with faithful AUTHORITY-CHECK semantics, and proposes exact PFCG role fixes. Read-only, deterministic.
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 answer "why can't user <U> do <X>" with a machine check, not prose: decode
the failed authorization object, evaluate it against the user's real runtime buffer,
name the closest role, and hand back an exact, actionable fix — all read-only.
Task: $ARGUMENTS
| File | Token / call | Purpose |
|---|---|---|
<SKILL_DIR>/references/sap_auth_diagnose_rfc.ps1 | -Action check | Buffer read + faithful AUTHORITY-CHECK eval + AGR_* fix correlation |
<SKILL_DIR>/references/auth_check_input_sample.tsv | template | Commented batch-input sample (checkid⇥object⇥field⇥value) |
<SAP_DEV_CORE_SHARED_DIR>/scripts/sap_rfc_lib.ps1 | dot-sourced | NCo 3.1 connect/disconnect (pinned-profile fallback) |
<SAP_DEV_CORE_SHARED_DIR>/scripts/sap_artifact_lib.ps1 | dot-sourced | Diagnosis / fix-proposal artifact registration |
<SAP_DEV_CORE_SHARED_DIR>/tables/required_authorizations.tsv | reference | The capability→object→field grammar this reuses |
/sap-login | sub-skill | Pinned RFC profile |
/sap-su01 | sub-skill | Pointed to in the fix (role assign) — never auto-invoked |
Input grammar — a check is one authorization object plus the field/value set that must ALL be satisfied by a single authorization instance (exactly one AUTHORITY-CHECK):
check --object S_TCODE --values TCD=SU01check --object S_DEVELOP --values "ACTVT=01,OBJTYPE=PROG" (a multi-field group)check --input <tsv> — batch, tab-delimited checkid⇥object⇥field⇥value; rows sharing
a checkid form one group. Empty value = presence-only check.--user defaults to the pinned connection's user. --values empty = "does the user have
this object at all".
Resolve work_dir + {RUN_TEMP} (canonical one-liner — sap_connection_lib.ps1 is dot-sourced
there — with Write-Output ('RUN_TEMP=' + (Get-SapRunTemp)) appended). {RUN_TEMP} = 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). Start logging
(sap_log_helper.ps1, state {RUN_TEMP}\sap_auth_diagnose_run.json). Pure RFC — no GUI session.
Modes: check (v1). su53 / trace → next phase (Scope below): tell the operator
to read the failed object off SU53 / the dump / the app message and pass it to check
(if they paste an SU53 screen or screenshot, YOU decode object + field + value from it and
build the check input — that decoding is the point, and needs no GUI automation). Validate
that at least one object is supplied; else AUTH_INPUT_INVALID, STOP.
Pinned RFC profile required (/sap-login) — missing → RFC_LOGON_FAILED, STOP. No GUI
fallback in v1.
check (the diagnosis)3a. Assemble the check(s). From --object/--values, or --input <tsv>. When the
operator pastes SU53 output/screenshot, extract each failed check into a {RUN_TEMP}
TSV (checkid⇥object⇥field⇥value) — one checkid per SU53 record, one row per field.
3b. Run the engine:
C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "<SKILL_DIR>\references\sap_auth_diagnose_rfc.ps1" -Action check -User "<U>" -InputFile "<tsv>" -SharedDir "<SAP_DEV_CORE_SHARED_DIR>"
(or -Object <O> -Values "F=V;F2=V2" for a single check). Parse the lines:
USER: — existence, lock (UFLAG), validity window (GLTGV/GLTGB), invalid=Y|N.AUTHCHK: — per check: verdict (PASS / MISSING_OBJECT / MISSING_VALUE /
BUFFER_STALE / COULD_NOT_CHECK), fully, the requested values, closest_role, what
that role currently grants, and the object text (otext).ROLE: — only the actionable roles (the fix-target of a failing check + any expired
assignment), with name/validity/text.AUTHSUMMARY: / STATUS: — OK / USER_NOT_FOUND / INPUT_INVALID / RFC_ERROR.3c. Classify + render. For each failing check, the verdict IS the diagnosis:
MISSING_OBJECT — no role or profile the user holds carries the object. Fix: assign a
role that grants it (the request TXT names the object/field/value); if a specific PFCG
role is the intended home, point the operator at it. closest_role=-.MISSING_VALUE — the user has the object but no instance covers the requested value.
Fix: extend closest_role's authorization for <field> to include <value> (the
grants= field shows what it covers today).BUFFER_STALE — a role the user holds DOES grant it, yet the runtime buffer denies it →
the user master was changed without a buffer refresh. Fix: user re-logon / PFCG user
compare (SU01 → Compare), not a role change.USER_LOCKED / USER_EXPIRED (from USER: invalid=Y) or ROLE_EXPIRED (an expired
ROLE: assignment) — surface these first: they mask everything else.Write into the artifact dir (Get-SapArtifactDir -ScopeKey USER_<U> -Skill sap-auth-diagnose):
auth_diagnosis.tsv — one row per check: object, otext, verdict, requested value(s),
closest role, current grant, proposed delta.auth_fix_proposal.md — per failure: closest role, exact missing field/value, the PFCG
action (extend authorization / assign role / user compare).auth_request.txt — ready-to-send to the security team: user, system/client,
--ticket, object, field, value, and the business context.Register each (Register-SapArtifact -Kind auth_diagnosis, coverage tri-state,
verdict DIAGNOSED / NO_FAILURES / COULD_NOT_CHECK). Print a verdict block +
per-check lines.
su53 mode (NEXT PHASE)SU53 has no RFC FM and no submittable report on either system (probed: SUSR_SU53_PARSE_DATA
/ SUSR_GET_SU53_DATA / RSUSR_SU53 all absent), so auto-discovery of the failed objects is a
GUI scrape (release-variant VBS — SAPMS01GNEW on S/4, SAPMS01G on ECC — captured via
/sap-gui-probe with a golden-screen baseline + NEEDS_RECORDING fallback). Until that
recording lands, run SU53 yourself (or paste it) and use check — the correlation, the
verdict, and the fix are identical; only the object-discovery step differs.
trace mode (NEXT PHASE, S/4 only)A confirm-gated STAUTHTRACE bracket (start → reproduce → guaranteed stop → dedupe into an
object/field/value matrix, then the same check correlation). Gated on the S/4-only result
store SUAUTHVALTRC (absent on ECC 6 → refuse loud); the S_ADMI_FCD precheck reuses
SUSR_USER_AUTH_FOR_OBJ_GET. No RFC start/stop FM exists, so it is GUI-driven with
mandatory startup stale-trace detection — deferred until the STAUTHTRACE screens are recorded.
Log end (SUCCESS / FAILED / SKIPPED + error_class): AUTH_INPUT_INVALID /
AUTH_USER_NOT_FOUND / RFC_LOGON_FAILED.
check mode — single (--object/--values)
and batch (--input), against the authoritative buffer via SUSR_USER_AUTH_FOR_OBJ_GET,
with AGR_USERS / AGR_1251 / AGR_TEXTS / USR02 / TOBJT correlation. Verified: PASS
(fully-authorized), MISSING_OBJECT (S_USER_GRP / S_USER_AGR — the real gap behind
/sap-su01 create failures), user lock/validity, object-text resolution, and the
actionable-role surfacing. The per-instance AUTHORITY-CHECK evaluator (the PASS/FAIL and
hence MISSING_VALUE boundary) is proven by an offline truth-table incl. the classic
"fields split across two instances must fail" trap; BUFFER_STALE is proven by the
buffer-vs-AGR_1251 comparison. MISSING_VALUE/BUFFER_STALE were not reproduced live only
because the pinned test user is near-SAP_ALL (no partial grant to provoke) — the logic,
not the wiring, is what's under test there.su53 (GUI auto-scrape of the failed objects — needs the SU53 golden-screen
recording via /sap-gui-probe, and a low-privilege provocation user, since a near-SAP_ALL
user produces no clean SU53 record to capture) and trace (STAUTHTRACE, S/4 only). v2:
cross-user (--user other than self needs S_USER_AUT; refuse loud without it) and the
SUIM SUSR_SUIM_API_RSUSR002 "who has this auth" reverse lookup.COULD_NOT_CHECK, never rendered as "no failures".MISSING_VALUE with the field named; the dedicated
ORG_LEVEL_GAP refinement (AGR_1252 cross-check) is a v2 nicety.What SKILL.md sets; muted values are Claude Code's defaults
40 skills in this plugin
/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).
/sap-bpManages SAP Business Partners via the BP transaction using SAP GUI Scripting.
Creates new partners (Organization type) or updates existing ones.
Existence check, partner creation with role/grouping selection, and
partner update with field values from a definition file.
Prerequisites: Active SAP GUI session (use /sap-login first).
/sap-change-historyAnswers "who changed this object / this data, and when" headlessly over RFC — no more
hand-joining CDHDR/CDPOS in SE16N and decoding cluster rows by eye. Resolves a business
token (PO, customer, vendor, material, sales order, G/L account, cost center …) to its
change-document class, scans CDHDR for the change headers, then pulls the fully DECODED
field-level rows (table · field · old → new, with DDIC field labels) via CHANGEDOCUMENT_READ
through the dev-init RFC wrapper — which sidesteps both the CDPOS 512-byte RFC_READ_TABLE
limit and ECC-6's CDPOS cluster storage in one call. Renders an auditable timeline + an
evidence-grade TSV, and (`--correlate`) time-orders the changes against transport imports
and /sap-diagnose evidence so "TR imported → field changed 5 min later" reads as one story.
Read-only; no writes, no SQL, no GUI. Also does `user <U>` / `window --from/--to` scans and
a `classes` map dump. Prerequisites: pinned RFC profile via /sap-login; the dev-init wrapper
Z_GENERIC_RFC_WRAPPER_TBL (via /sap-dev-init — never deployed by this skill); SAP NCo 3.1 (32-bit).
/sap-config-compareKeyed, row-level RFC diff of ONE customizing table or view across two saved
connection profiles (or two clients of one system) — the shareable answer to
"it works in QAS but not in DEV/PRD". Resolves the object on both sides, computes
the compared-field set (drops the technical client key for client-dependent tables,
excludes unreadable/too-wide columns honestly), guards against an unbounded read,
does a chunked offset-based read of each side, and runs the ONE shared keyed-diff
engine to classify every key LEFT_ONLY / RIGHT_ONLY / CHANGED. Claude then translates
the raw deltas into functional meaning using DDIC texts. Output is a diffable diff.tsv
+ summary, registered for /sap-evidence-pack. Read-only. Prerequisites: two profiles
via /sap-login (pinned LEFT + --against RIGHT); SAP NCo 3.1 (32-bit). No GUI, no
Z-object, no dev-init.
/sap-cutover-runbookTurn a 200-step cutover Excel into a crash-safe, evidence-stamped tracker — the cutover
lead stops doing 3am bookkeeping and answers "are we on the critical path?" instantly.
`init` parses the runbook into a draft ledger behind a mandatory human-curation gate;
`record` stamps start/done/fail events with machine-read RFC evidence (transport import
return code from TPALOG, job status from TBTCO, table row counts) — never a screenshot;
`report` renders the live board with per-phase progress, blockers, and the critical path
over the remaining dependency DAG; `checkpoint --health` composes an advisory go/no-go with
a tri-state system-health snapshot (dumps, update backlog, qRFC/tRFC queues, locks, running
imports). v1 is read-only toward SAP (reads only); `run` auto-execution is v2. Prerequisites:
/sap-login profiles (one per system named in the plan); SAP NCo 3.1 (32-bit). No Z-object,
no dev-init — safe to point at a PRD/QAS cutover target.
/sap-data-volumeRead-only DB growth + archivability evidence over RFC — the table-growth watch nobody
does until the disk is full. `growth` ranks tables by row count (EM_GET_NUMBER_OF_ENTRIES,
fast DB-stat counts that work on cluster tables too), diffs against a persisted local
snapshot for a rows/day trend, and flags known log-table offenders (BALDAT, EDID4, CDPOS,
DBTABLOG) and Z tables that lack housekeeping. `archivability` maps each archiving object
to its tables (ARCH_DEF), pulls its run history (ADMI_RUN/ADMI_STATS), and reports whether
a TAANA age analysis exists. Replaces manual DB02/DB15/SARA spelunking. Prerequisites:
pinned profile via /sap-login (RFC); SAP NCo 3.1 (32-bit). No GUI, no Z-object, no
dev-init — safe to point at production. `analyze` (schedule TAANA) is v1.5; `archive-run`
(SARA write/delete) is v2 and refused in v1.
npx claudepluginhub sapdev-ai/sap-dev --plugin sap-projectOther plugins' skills for the same job