sap-activate-object
Activates an inactive SAP repository object via SAP GUI Scripting. Routes to the correct transaction by object type: SE38 for reports/programs/function- group…
Generates ABAP Unit tests for an EXISTING object (global class / function module / report) and closes the loop on a live system: pre-check the generated test, deploy, activate, run with coverage, read failures, fix, repeat until green (bounded). Reads the active source, builds a
$ npx -y skills add sapdev-ai/sap-dev --skill sap-gen-abap-unit --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/sap-gen-abap-unitContext preview
The summary Claude sees to decide when to auto-load this skill.
Generates ABAP Unit tests for an EXISTING object (global class / function module / report) and closes the loop on a live system: pre-check the generated test, deploy, activate, run with coverage, read failures, fix, repeat until green (bounded). Reads the active source, builds a
name: sap-gen-abap-unit description: | Generates ABAP Unit tests for an EXISTING object (global class / function module / report) and closes the loop on a live system: pre-check the generated test, deploy, activate, run with coverage, read failures, fix, repeat until green (bounded). Reads the active source, builds a call/data map, and runs a SEAM ANALYSIS that classifies every DB read and external call into a doubling strategy (OSQL test double for SELECTs, ABAP test double for injected dependencies, or flags untestable-without-refactor), then emits a test class honest about what it could and could not cover. Pairs with /sap-run-abap-unit (which runs the tests). Deploy is GUI (/sap-se24 --test-source CCAU for a class, /sap-se38 for a report test) and gated — asks before writing anything (Rule 2). Prerequisites: pinned /sap-login connection; active GUI session for class download + deploy + run; SAP NCo 3.1 for RFC source read. argument-hint: "<OBJECT_NAME | path-to.abap> [--type class|fm|program|auto] [--target-coverage <n>] [--max-rounds 3] [--doubles auto|osql|none] [--deploy ask|yes|no] [--risk-level harmless|dangerous|critical] [--no-gui]"
You generate an ABAP Unit test class for an existing object, then **close the loop**: pre-check → deploy → activate → run-with-coverage → read failures → fix → repeat until tests pass and coverage meets the target (or you report honestly what is not testable without a refactor). The *generation* is your reasoning; the *deploy / activate / run / coverage* half reuses skills that are already live-tested.
This skill observes `shared/rules/skill_operating_rules.md`. **Rule 2 (no unsolicited deployment) applies**: generation is read-only, but the deploy/run loop writes a test artifact to SAP — it is gated behind `--deploy` (default `ask`).
Task: $ARGUMENTS
> **Vocabulary.** This is the `gen` half of the ABAP-unit pair: > `sap-gen-abap-unit` (you) generates → `/sap-run-abap-unit` runs. Same > "abap-unit" token on purpose.
---
| File / token | Path | Purpose | |---|---|---| | `sap_settings_lib.ps1` | `<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_settings_lib.ps1` | settings merge | | `sap_connection_lib.ps1` | `<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_connection_lib.ps1` | `Get-SapWorkDir`, `Get-SapCurrentSessionPath` | | `sap_object_resolver.ps1` | `<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_object_resolver.ps1` | type + TADIR identity | | `sap_rfc_read_source.ps1` | `<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_rfc_read_source.ps1` | `Read-SapAbapSource` (program/include/FM) | | `sap_explain_parse.ps1` | `<SAP_DEV_CORE_SHARED_DIR>\..\skills\sap-explain-object\references\sap_explain_parse.ps1` | source → `map.json` (units / externals / db reads+writes) — **drives the seam analysis** | | SE24 download VBS | `<SAP_DEV_CORE_SHARED_DIR>\..\skills\sap-se24\references\sap_se24_check_and_download.vbs` | class source (GUI) | | `sap_attach_lib.vbs` (`%%ATTACH_LIB_VBS%%`) | `<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_attach_lib.vbs` | `AttachSapSession` for the download VBS | | `abap_code_quality_rules.md` (§15) | `<SAP_DEV_CORE_SHARED_DIR>\rules\abap_code_quality_rules.md` | the ABAP Unit emission rules (`FOR TESTING DURATION SHORT RISK LEVEL HARMLESS`, `cl_abap_unit_assert=>assert_*`) | | `customer_brief.md` | `{custom_url}\customer_brief_<LANG>.md` → `{custom_url}\customer_brief.md` → built-in `_<LANG>` variant → built-in template (`<LANG>`: `userConfig.template_language` → `userConfig.sap_language` → `EN`) | `MODE_MIN_COVERAGE`, `MODE_OOP`, release, risk level | | `sap_log_helper.ps1` | `<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_log_helper.ps1` | structured logging |
**Skills this one orchestrates** (skills-first, per CLAUDE.md Rule 6 — invoke via the Skill tool, never re-implement): `/sap-check-abap`, `/sap-transport-request`, `/sap-se24` (`--test-source`), `/sap-se38`, `/sap-activate-object`, `/sap-run-abap-unit`.
`<SAP_DEV_CORE_SHARED_DIR>` = `plugins/sap-dev-core/shared` — 3 levels up from `<SKILL_DIR>`, then into `sap-dev-core\shared`.
---
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 ('CUSTOM_URL=' + (Get-SapSettingValue 'custom_url' ((Get-SapWorkDir) + '\custom'))); Write-Output ('RUN_TEMP=' + (Get-SapRunTemp))"Settings reads/writes follow `<SAP_DEV_CORE_SHARED_DIR>/rules/settings_lookup.md`. Set `{WORK_TEMP}` = `{work_dir}\temp`, `{OUT}` = `{WORK_TEMP}\aunit_gen\{OBJECT}`, and `{RUN_TEMP}` = the `RUN_TEMP=` value printed above (`Get-SapRunTemp` mints + creates a fresh per-run dir `{work_dir}\temp\run_<id>` — holds the log state file; mint once here and reuse the same value in Step 0.5 and Final).
cmd /c if not exist "{OUT}" mkdir "{OUT}"---
powershell -ExecutionPolicy Bypass -File "<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_log_helper.ps1" -Action start -StateFile "{RUN_TEMP}\sap_gen_abap_unit_run.json" -Skill sap-gen-abap-unit -ParamsJson "{\"target\":\"<OBJECT>\"}"---
| Arg | Default | Notes | |---|---|---| | positional | — | Object name (uppercase) OR a `.abap` file path (FILE mode = generate from local source, no acquisition). | | `--type` | `auto` | `class` / `fm` / `program`. | | `--target-coverage <n>` | brief `MODE_MIN_COVERAGE` / `0` | Coverage % to drive the fix loop toward. | | `--max-rounds <n>` | `3` | Cap on generate→run→fix iterations. | | `--doubles <m>` | `auto` | `auto` = pick per dependency (Step 4); `osql` = force OSQL DB doubles; `none` = no doubles (pure-function tests only). | | `--deploy <m>` | `ask` | `ask` confirms before each write; `yes` runs the loop unattended; `no` generates + pre-checks only (no SAP write). | | `--risk
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.
Repo: sapdev-ai/sap-dev
Activates an inactive SAP repository object via SAP GUI Scripting. Routes to the correct transaction by object type: SE38 for reports/programs/function- group…
Natural-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,…
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), creates an ATC Run Series bound to…
Executes BDC (Batch Data Communication) sessions in SAP via RFC. Reads SHDB recording files from the bdc/ folder, connects via SAP NCo 3.1, calls…
Changes the package (TADIR-DEVCLASS) assignment of an SAP repository object via the "Object Directory Entry" dialog (Goto > Object Directory Entry). Routes by…
Validates ABAP source (report / program / FM / class / include) before deployment — one skill, dimension-dispatched: naming (variable conventions), type (DDIC…