Skip to content
Development
Skill

/sap-trace

Analyzes an already-recorded SAP performance trace and ranks the hotspots. Two sources: --import <file> reads a trace you exported yourself (fully offline, no SAP needed); --source st05|sat drives the GUI to display the latest recorded SQL trace (ST05, "Summarized SQL

From plugin
sap-dev
10123 skills3 agents

Claude Code

$ npx -y skills add sapdev-ai/sap-dev --skill sap-trace --agent claude-code

SKILL.md

sap-trace.SKILL.md
name: sap-trace
description: |
  Analyzes an already-recorded SAP performance trace and ranks the hotspots.
  Two sources: --import <file> reads a trace you exported yourself (fully
  offline, no SAP needed); --source st05|sat drives the GUI to display the
  latest recorded SQL trace (ST05, "Summarized SQL Statements") or runtime-
  analysis hit list (SAT) and exports it as a tab file. The analyzer
  normalizes either shape into a ranked hotspot list, flags anti-patterns
  (SELECT in loop, SELECT *, full-scan, unguarded FOR ALL ENTRIES, many
  executions, ABAP-side hotspots), maps each to a rule in
  abap_code_quality_rules.md and to the object's volume band, and proposes a
  fix. This v1 reads a trace that ALREADY EXISTS — it does not activate/
  deactivate ST05 or start a SAT measurement (capture orchestration is a later
  phase), and does not read SQL Monitor (SQLM).
  Pure read-only — never modifies the SAP system.
  Prerequisites: for --source, an active SAP GUI session (use /sap-login
  first); for --import, none.
argument-hint: "[--import <file>] [--source st05|sat] [--kind st05|sat|auto] [--user <u>] [--top N] [--threshold-ms N] [--perf-band small|medium|large] [--with-source] [--output <path>]"

SAP Performance / SQL-Trace Analysis Skill

You take a recorded SAP performance trace (ST05 SQL trace or SAT runtime analysis), rank the most expensive statements / units, map each to a known ABAP performance anti-pattern, and suggest a concrete fix calibrated to the object's volume band. The trace either already exists as an exported file (`--import`) or is displayed-and-exported from the live GUI (`--source`).

Task: $ARGUMENTS

---

Shared Resources

| File | Token | Purpose | |---|---|---| | `<SAP_DEV_CORE_SHARED_DIR>/rules/skill_operating_rules.md` | *(rule)* | Mandatory operating rules — read-only skill | | `<SAP_DEV_CORE_SHARED_DIR>/rules/language_independence_rules.md` | *(rule)* | GUI-scripting language independence — identify by component ID + DDIC field name, status-bar via `MessageType` codes (S/W/E/I/A), VKey over menu-text, no branching on `.Text`/`.Tooltip`/window titles | | `<SAP_DEV_CORE_SHARED_DIR>/rules/abap_code_quality_rules.md` | *(rule)* | Performance gates (§12) the analyzer maps findings back to | | `<SAP_DEV_CORE_SHARED_DIR>/templates/customer_brief.md` | *(template)* | Source of the object's volume band (small/medium/large) when `--perf-band` is not given | | `<SAP_DEV_CORE_SHARED_DIR>/tables/perf_antipattern_map.tsv` | *(table)* | Maps a detected trace signal → §12 rule → fix template | | `<SKILL_DIR>/references/sap_trace.ps1` | *(script)* | Offline analyzer: normalize → rank → map → render report | | `<SKILL_DIR>/references/sap_trace_st05.vbs` | many | GUI: display latest ST05 trace, switch to summarized view, export tab file | | `<SKILL_DIR>/references/sap_trace_sat.vbs` | many | GUI: open a SAT measurement, display hit list, export tab file | | `<SAP_DEV_CORE_SHARED_DIR>/scripts/sap_attach_lib.vbs` | `%%ATTACH_LIB_VBS%%` | Parallel-safe session attach (GUI path) | | `<SAP_DEV_CORE_SHARED_DIR>/scripts/sap_log_helper.ps1` | *(script)* | Structured run logging |

---

Step 0 — Resolve Work Directory

**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))"

**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:

| Setting | Default if blank | |---|---| | `trace_threshold_ms` | `100` | | `trace_top_n` | `20` |

Set `{WORK_TEMP}` = `{work_dir}\temp` and `{TRACE_OUT}` = `{work_dir}\trace`. Ensure both exist:

cmd /c if not exist "{WORK_TEMP}" mkdir "{WORK_TEMP}"
cmd /c if not exist "{TRACE_OUT}" mkdir "{TRACE_OUT}"

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`) under `{RUN_TEMP}`; keep `{WORK_TEMP}` / `{TRACE_OUT}` (base) for outputs, log state, and `Get-SapCurrentSessionPath -WorkTemp`.

---

Step 0.5 — Start Logging

Start a structured log run. State file: `{RUN_TEMP}\sap_trace_run.json`. Best-effort.

powershell -ExecutionPolicy Bypass -File "<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_log_helper.ps1" -Action start -StateFile "{RUN_TEMP}\sap_trace_run.json" -Skill sap-trace -ParamsJson "{\"source\":\"<SOURCE>\"}"

---

Step 1 — Parse Arguments

| Flag | Meaning | Default | |---|---|---| | `--import <file>` | Analyze an already-exported trace file (offline; no SAP) | — | | `--source st05\|sat` | Drive the GUI to display + export the latest recorded trace | — | | `--kind st05\|sat\|auto` | Format of the `--import` file when auto-detection is ambiguous | `auto` | | `--user <u>` | ST05 display filter (whose trace to show) | pinned SAP user | | `--from <HH:MM> --to <HH:MM>` | ST05 display time window | last 10 min | | `--measurement <id>` | SAT: which saved measurement to open | latest | | `--top N` | Max hotspots reported | `trace_top_n` (20) | | `--threshold-ms N` | Surface statements whose total time ≥ N ms | `trace_threshold_ms` (100) | | `--perf-band small\|medium\|large` | Volume band override | from customer brief | | `--with-source` | Best-effort: annotate the offending program/include/line | off | | `--output <pa

Read more
@sapdev-ai
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.

10123 skills3 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
10
Star history of sapdev-ai/sap-dev on GitHub, a chart by star-history.com

Other skills on sap-dev.

sap-activate-object

sap-activate-object

Activates an inactive SAP repository object via SAP GUI Scripting. Routes to the correct transaction by object type: SE38 for…

@sapdev-ai@sapdev-aiInstall Skill
sap-api-advisor

sap-api-advisor

Natural-language SAP API discovery over RFC (no GUI): turn a goal like "create a sales order" or "post a goods movement" into a…

@sapdev-ai@sapdev-aiInstall Skill
sap-atc

sap-atc

Runs the SAP ABAP Test Cockpit (ATC) end-to-end as a quality gate: builds an SCI Object Set scoped to the target object(s),…

@sapdev-ai@sapdev-aiInstall Skill
sap-call-bdc

sap-call-bdc

Executes BDC (Batch Data Communication) sessions in SAP via RFC. Reads SHDB recording files from the bdc/ folder, connects via…

@sapdev-ai@sapdev-aiInstall Skill
sap-change-package

sap-change-package

Changes the package (TADIR-DEVCLASS) assignment of an SAP repository object via the "Object Directory Entry" dialog (Goto >…

@sapdev-ai@sapdev-aiInstall Skill
sap-check-abap

sap-check-abap

Validates ABAP source (report / program / FM / class / include) before deployment — one skill, dimension-dispatched: naming…

@sapdev-ai@sapdev-aiInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills2w309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react5d252k
@facebook@facebookInstall Skill

Questions about sap-trace.

Which coding agents can use sap-trace?
sap-trace installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.