Skip to content
Development
Skill

/sap-retrofit

Retrofit maintenance-line fixes into the project line without Solution Manager ChaRM — the detect/classify loop that a rotting spreadsheet can't do. `harvest` reads released maintenance TRs (E070/E071/E07T over RFC); `classify` diffs each object maint-vs-project via /sap-compare

From plugin
sap-dev
8123 skills3 agents
Install
$ npx -y skills add sapdev-ai/sap-dev --skill sap-retrofit --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/sap-retrofit

Context preview

The summary Claude sees to decide when to auto-load this skill.

Retrofit maintenance-line fixes into the project line without Solution Manager ChaRM — the detect/classify loop that a rotting spreadsheet can't do. `harvest` reads released maintenance TRs (E070/E071/E07T over RFC); `classify` diffs each object maint-vs-project via /sap-compare

SKILL.md

sap-retrofit.SKILL.md
name: sap-retrofit
description: |
  Retrofit maintenance-line fixes into the project line without Solution Manager ChaRM — the
  detect/classify loop that a rotting spreadsheet can't do. `harvest` reads released
  maintenance TRs (E070/E071/E07T over RFC); `classify` diffs each object maint-vs-project via
  /sap-compare and gathers project-line change evidence (VRSD versions + E071 dev-TR hits) to
  label it IN_SYNC / GREEN (project untouched — safe to auto-apply) / YELLOW (project also
  changed — needs a merge) / RED (can't diff reliably); `status` rolls up the persistent
  ledger; `draft` writes a reviewable two-way diff + AI merge draft (never deploys); `apply`
  deploys GREEN objects to the project line behind /sap-transport-request with a post-deploy
  re-compare, confirm-gated. The maintenance system is read-only forever. Prerequisites:
  /sap-login profiles (pinned = project line, --maint hint = maintenance line); SAP NCo 3.1
  (32-bit). No Z-object, no dev-init.
argument-hint: "init --project <id> --maint <hint> [--since YYYYMMDD] [--packages Z*,Y*]  |  harvest  |  classify [--max-objects N]  |  status [--report]  |  draft <OBJ>  |  apply --green-only"

SAP Retrofit — Dual-Track Detect / Classify / Apply (no ChaRM)

Re-apply production (maintenance-line) fixes into the project line as a tracked, evidence-based loop instead of a rotting spreadsheet. **The maintenance line is read-only forever**; the only SAP writes are confirm-gated GREEN deploys to the project line, delegated to the workbench skills.

Task: $ARGUMENTS

**Connection roles:** pinned profile (via /sap-login) = **project line** (the write target). `--maint <hint>` = **maintenance line** (read-only), resolved like /sap-compare's `--against`. `apply` **hard-refuses** if a write would resolve to the maintenance profile.

---

Shared Resources

| File | Token / call | Purpose | |---|---|---| | `<SAP_DEV_CORE_SHARED_DIR>/rules/safety_policy.md` | *(rule)* | **Rule 0 (highest priority)** — environment guard; enforced by Step 7 via `sap_safety_gate.ps1` | | `<SAP_DEV_CORE_SHARED_DIR>/rules/skill_operating_rules.md` | *(rule)* | Mandatory operating rules | | `<SKILL_DIR>/references/sap_retrofit_ledger.ps1` | `-Action init\|append\|set-state\|watermark\|list` | Local workspace + state-machine ledger | | `<SKILL_DIR>/references/sap_retrofit_harvest.ps1` | `-MaintHint … [-Since -Packages -MaxTrs]` | Released maintenance TRs → per-object rows (RFC, read-only) | | `<SKILL_DIR>/references/sap_retrofit_evidence.ps1` | `-Objects "TYPE:NAME,…" -Baseline` | Project-line VRSD/E071/TADIR evidence (RFC, read-only) | | `/sap-compare` (Skill tool) | `<OBJ> --against <maint-hint>` | The maint-vs-project source/DDIC diff (its class-source limit applies) | | `/sap-se38` · `/sap-se37` (Skill tool) | deploy | `apply` deploy delegates (TR via /sap-transport-request inside them) | | `/sap-transport-request` (Skill tool) | TR | Never prompt for a TR — always delegate | | `<SAP_DEV_CORE_SHARED_DIR>/scripts/sap_rfc_read_source.ps1` | `Read-SapAbapSource` | `apply` maintenance-source fetch | | `<SAP_DEV_CORE_SHARED_DIR>/scripts/sap_finding_lib.ps1` / `sap_artifact_lib.ps1` | Step 8 | Findings + artifact index |

The workspace `{work_dir}\retrofit\<project>\` is a durable Bucket-A path (a later session must find the ledger) — never under `{RUN_TEMP}`.

Step 0 — Resolve Work Dir + Workspace

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 ('RUN_TEMP=' + (Get-SapRunTemp))"

`{WS}` = `{work_dir}\retrofit\<project>`. Set `{RUN_TEMP}` = the `RUN_TEMP=` value printed above (`Get-SapRunTemp` mints + creates the per-run scratch dir holding the log state file) — for logging state; mint it once here and reuse (re-minting breaks the `-Action end` state-file lookup).

Step 0.5 — Start Logging

powershell -ExecutionPolicy Bypass -File "<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_log_helper.ps1" -Action start -StateFile "{RUN_TEMP}\sap_retrofit_run.json" -Skill sap-retrofit -ParamsJson "{}"

Step 1 — Mode Dispatch

`init` | `harvest` | `classify` | `status` | `draft` | `apply`. Except `init`, load `{WS}\project.json` (absent → `RETRO_LEDGER_IO`). Resolve `--maint` via the profile store. **For `apply`: if the maintenance profile resolves to the SAME SID+client as the pinned project profile, hard-refuse** (a retrofit that writes back to maintenance is a bug).

Step 2 — init

C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "<SKILL_DIR>\references\sap_retrofit_ledger.ps1" -Action init -Workspace "{WS}" -MaintHint "<hint>" -Packages "<Z*,Y*>" -Since "<YYYYMMDD>"

Writes `project.json` (maint hint, packages, watermark=since) + empty `ledger.tsv` + `diffs/`, `drafts/`, `reports/`.

Step 3 — harvest (read-only)

C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "<SKILL_DIR>\references\sap_retrofit_harvest.ps1" -MaintHint "<hint>" -Since "<watermark>" -Packages "<Z*,Y*>" -MaxTrs 500 -SharedDir "<SAP_DEV_CORE_SHARED_DIR>"

Parse `TR:` and `OBJ: pgmid=… object=… obj_name=… tr=… released=… devclass=…`; append each object via the ledger (`-Action append`, dedupes across TRs, latest TR wins, all recorded). On `STATUS: OK`, advance the watermark (`-Action watermark -Since <today>`); `NO_NEW` → nothing to do. Never advance the watermark on `RFC_ERROR`.

Step 4 — classify (read-only)

For each HARVESTED object (cap `--max-objects`, default 50): 1. **Diff** — invoke `/sap-compare <OBJ> --against <maint-hint>` via the **Skill tool**; read its `diff.json` + unified diff; copy the bundle into `{WS}\diffs\<OBJ>\`. 2. **Evidence** — run `sap_retrofit_evidence.ps1 -Objects "TYPE:NAME" -Baseline <since>`; parse `EVIDENCE: … tadir=… vrsd=… e071=…`.

Read more
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.

Get the whole plugin

Other skills on sap-dev.