/sap-migrate:sap-cc-analyze <prepare|ingest> --campaign <id> [--results <file|dir>] [--limit <n>] [--batch-size <n>] [--variant <NAME>]from sap-migrate
Runs S/4HANA-readiness ATC checks on migration campaign objects and ingests results into a findings ledger. Use after /sap-cc-usage, before /sap-cc-triage.
Ships in sap-migrate. 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 run S/4HANA-readiness ATC across the campaign's REMEDIATE objects and fold
the findings (with their simplification-item context) into the campaign ledger.
The ATC engine is /sap-atc; this skill prepares its worklist and ingests its
results.
Task: $ARGUMENTS
| File | Token | Purpose |
|---|---|---|
<SAP_DEV_CORE_SHARED_DIR>/rules/skill_operating_rules.md | (rule) | Mandatory operating rules. |
<SAP_DEV_CORE_SHARED_DIR>/rules/settings_lookup.md | (rule) | Settings / work_dir resolution. |
<SAP_DEV_CORE_SHARED_DIR>/scripts/sap_settings_lib.ps1 + sap_connection_lib.ps1 | (dot-source) | Get-SapWorkDir. |
<SAP_DEV_CORE_SHARED_DIR>/scripts/sap_log_helper.ps1 | (invoke) | Start/step/end JSONL logging. |
<SKILL_DIR>/references/sap_cc_analyze.ps1 | (invoke) | Offline spine: prepare (scope→worklist) and ingest (ATC results→findings_raw.tsv, state→ANALYZED). |
<SAP_DEV_CORE_SHARED_DIR>/scripts/sap_readiness_probe.ps1 | (invoke, RFC) | Step 1.5 readiness-capability preflight — confirms the connected system HAS S4HANA_READINESS variants before the ATC loop (shared with /sap-doctor). |
/sap-atc | (skill) | The ATC engine. Run per worklist object with --variant=S4HANA_READINESS. Its per-stage VBS are recorded on S/4HANA 1909 — re-record a failing stage via /sap-gui-probe --record (see that skill). |
Workspace contract (findings/findings_raw.tsv columns, the ANALYZED state)
is defined by /sap-cc-campaign. This skill owns findings/findings_raw.tsv
and findings/analyze_worklist.tsv.
This skill ships no GUI VBS — the GUI work is
/sap-atc's. Its own helper is offline (files only), so it carries no session-broker / attach / Tier-3 surface.
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))"
Set {WORK_TEMP} = {work_dir}\temp (create if needed) and
{CAMPAIGN_DIR} = {work_dir}\migrations\{campaign-id}.
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 per-run scratch
(the log state file below) under {RUN_TEMP}, never at a fixed name under the
{WORK_TEMP} root.
State file: {RUN_TEMP}\sap_cc_analyze_run.json. Best-effort.
powershell -ExecutionPolicy Bypass -File "<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_log_helper.ps1" -Action start -StateFile "{RUN_TEMP}\sap_cc_analyze_run.json" -Skill sap-cc-analyze -ParamsJson "{}"
Build the list of REMEDIATE objects that still need analysis (state SCOPED):
powershell -ExecutionPolicy Bypass -File "<SKILL_DIR>\references\sap_cc_analyze.ps1" -Action prepare -CampaignDir "{CAMPAIGN_DIR}"
Add -Limit <n> to cap the batch (useful for a first controlled run). Output:
WORKLIST: total=<n> file=...analyze_worklist.tsv plus
SKIPPED: total=<m> file=...analyze_skipped.tsv -- objects whose type has no
/sap-atc Object-Set category (DEVC, MSAG, bare FUNC) are diverted to the
skipped sidecar and kept OUT of the worklist, so they are not later mis-marked
ANALYZED. Exit 1/STATUS: EMPTY means nothing is in REMEDIATE/SCOPED -- run
/sap-cc-usage first (or all objects are already ANALYZED).
Batched analysis (A5, --batch-size <n>). For large estates, add
-BatchSize <n> so prepare ALSO writes --object-list batch files
(findings\atc_raw\batches\analyze_batch_<nnn>.tsv, <ATC_TYPE> <OBJ_NAME> per
line, ≤ n objects each) and emits BATCHES: total=<k> size=<n> dir=<...>. One
batch = one /sap-atc --object-list run instead of n single runs — the
analyze-phase wall-clock drops by ≈ batch-size. Stale batch files are cleared on
each re-prepare. Omit (or 0) for the legacy per-object worklist. Pick n to fit
the estate and the ATC run timeout (50–100 is a sane starting point; every
object in one batch shares one run series + one poll).
The whole step runs /sap-atc --variant=S4HANA_READINESS in a loop. If the
connected system cannot run that check, EVERY object plan-errors — a run that
reads as "clean" (0 findings) while producing nothing. Catch it once, up front,
instead of grinding the whole worklist. Run the shared readiness probe against
the pinned connection (the same system /sap-atc will target):
C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -NoProfile -ExecutionPolicy Bypass -File "<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_readiness_probe.ps1"
Read the READINESS: verdict=<V> … line and act on it:
| verdict | Meaning | Action |
|---|---|---|
NO_READINESS_VARIANTS | The connected system has no S4HANA_READINESS variants — it cannot run the readiness check at all (e.g. /sap-cc-analyze was pointed at an ECC source system directly, or a non-readiness box). | STOP. Do NOT start the ATC loop. Surface DETAIL: + FIX: — connect to an S/4 check hub that carries the variants (/sap-login --switch <hub>), or check the source remotely FROM a hub (central ATC: SM59 + ATC → Manage System Groupings). |
READINESS_CAPABLE | Variants present — a run is POSSIBLE. This is not a green light — variants present ≠ the run will find things, and target-release variant richness (e.g. _2022) does not predict findings (a live run on S/4HANA 2022 with _2022/_2020 variants still plan-errored, identical to 1909). | Proceed to Step 2, but treat the FIRST object as the real gate: if it returns ERROR: ATC_PLAN_ERRORS (0 findings + planning errors), the readiness checks can't service this system. The usual cause is running readiness locally on an S/4 target (its own code has no source→target delta) — observed on S/4HANA 1909 AND 2022. STOP the loop then — do not grind the whole worklist plan-erroring — and treat it as a run-mode/Basis prerequisite: readiness findings come from the ECC source (readiness add-on there) or a hub checking a source remotely (central ATC), not a local S/4-target run. |
RFC_ERROR | The probe could not connect over RFC (NCo/creds/pin). | This is advisory only — RFC is not required for the GUI ATC run. Note it and proceed; the definitive gate is still /sap-atc's ATC_PLAN_ERRORS. |
This preflight is a fast fail, not the authoritative gate. The reliable catch for "readiness cannot run here" is
/sap-atcreportingATC_PLAN_ERRORS(COUNT_PLNERR > 0) on the run — the probe only spares you a worklist-long loop when the system has no variants at all (the one thing it can predict). It deliberately does NOT gate onSYCM_*tables or on target-variant richness — both are proven false signals (2026-07-03 harvest report):SYCM_*is present on plan-erroring 1909 boxes and absent on a working 2022 box, and S/4HANA 2022 with_2022variants plan-errored just like 1909. Point/sap-cc-analyzeat an S/4 hub checking the source remotely, not at an S/4 target's own code.
/sap-atc)prepare wrote analyze_worklist.tsv with an atc_type column (the value
/sap-atc expects, mapped from the ledger type). For each worklist row, run ATC
on atc_type and pass --drill so /sap-atc exports the per-finding TSV
that ingest consumes:
/sap-atc <atc_type> <obj_name> --variant=S4HANA_READINESS --drill --save-to={CAMPAIGN_DIR}\findings\atc_raw\<obj_name>.txt
This writes <obj_name>.txt.findings.tsv (PRIO/CHECK_ID/CHECK_TITLE/OBJECT/
LINE/MSG_TEXT). Collect every drill export under one folder, e.g.
{CAMPAIGN_DIR}\findings\atc_raw\.
Variant override. The default variant is S4HANA_READINESS (the point of
this skill). A --variant <NAME> argument overrides it for every /sap-atc
call — use it when the connected system cannot service readiness locally and you
only need a generic quality pass (e.g. --variant DEFAULT), or when validating
the batched path (A5) against a variant that produces real findings. When
overridden, the readiness preflight (Step 1.5) is advisory only.
prepare wrote BATCHES:)If Step 1 emitted BATCHES: total=<k> …, prefer the batched loop — it collapses
n single ATC runs into k runs. For each analyze_batch_<nnn>.tsv:
/sap-atc --object-list={CAMPAIGN_DIR}\findings\atc_raw\batches\analyze_batch_<nnn>.tsv \
--object-set=ZCC_<campaign>_B<nnn> \
--variant=S4HANA_READINESS --drill \
--save-to={CAMPAIGN_DIR}\findings\atc_raw\batch_<nnn>.txt
/sap-atc builds ONE SCI object set from the list, runs ONE series, and drills
ONE batch_<nnn>.txt.findings.tsv with an OBJ_NAME column — the per-object
key ingest already consumes. Record clean objects as checked for the whole
batch: after a batch run COMPLETES, append every object in that batch's
list to checked_objects.tsv (Step "Record clean objects as checked" below) —
objects with findings additionally appear in the drill TSV; ingest dedupes
findings and counts the rest as clean coverage. A batch whose /sap-atc run
FAILED / aborted / plan-errored contributes NOTHING (do not append its objects).
Then ingest the whole atc_raw\ folder once (Step 3) — it folds every batch
drill + the checked list together. Everything else (readiness variant, central
hub, fail-loud on ATC_PLAN_ERRORS) is unchanged; batching only changes how
many runs it takes.
Notes:
Readiness variant. Always pass --variant=S4HANA_READINESS — this is
the whole point of the analysis step. /sap-atc sets that variant on the ATC
run series; the connected system must offer it as a GLOBAL variant with the
Simplification Database loaded. Watch the /sap-atc VARIANT: line: it must
read S4HANA_READINESS, not SYSTEM_DEFAULT. /sap-atc fails loud if it
cannot locate the variant config field on this release (rather than running
the default and mislabelling generic findings as readiness) — see that
skill's Step 4 / "Component IDs". If you hit that error and cannot record the
field id immediately, the fallbacks are: (a) set the connected system's
default ATC variant to S4HANA_READINESS and run /sap-atc WITHOUT
--variant=, or (b) run the readiness ATC manually and drop its per-finding
export into atc_raw\ for ingest.
Use the per-finding drill export, NOT the run summary TXT -- the
summary has no per-object column, so ingest skips it.
Record clean objects as checked. A PASS with zero findings leaves no row
in the drill TSV, and ingest advances an object to ANALYZED only on
evidence. After each worklist object whose /sap-atc run completed
with zero findings, append it to a checked-objects export (real TAB bytes via
PowerShell — never the Write-tool literal \t):
powershell -NoProfile -Command "\$p = '{CAMPAIGN_DIR}\findings\atc_raw\checked_objects.tsv'; if (-not (Test-Path -LiteralPath \$p)) { Set-Content -LiteralPath \$p -Value ('obj_name' + [char]9 + 'obj_type') -Encoding UTF8 }; Add-Content -LiteralPath \$p -Value ('<OBJ_NAME>' + [char]9 + '<OBJ_TYPE>') -Encoding UTF8"
ingest counts such rows (all finding columns blank) as coverage evidence
only — they are never appended to findings_raw.tsv. Do NOT add objects
whose ATC run failed, aborted, or never ran.
The connected system must offer the S4HANA_READINESS variant with the
Simplification Database loaded. If your source ECC lacks it, run against a
prepared sandbox/check system (the campaign's sandbox/check_system).
/sap-atc's per-stage recordings capture its SCI/ATC node + grid IDs on
S/4HANA 1909; if a stage fails on your release, re-record it via
/sap-gui-probe --record and patch that stage's VBS — see /sap-atc.
Readiness checks must run on a system that has the S/4 simplification content
— typically NOT the source ECC. Use the campaign's check_system_profile (the
hub). Two modes:
/sap-login --switch <check_system_profile>.
/sap-atc then runs on the hub, which carries the readiness content. The hub
must have the code under test (transported/copied in) and its check content
must be ≥ the target release (version direction: check OLD from NEW).
When campaign.json.systems.check_system_profile is set, prefer this — do NOT
run readiness ATC on the bare source ECC (it lacks the content; the run would
fail-loud on the variant or yield nothing useful)./sap-atc … --object-provider=<DATA_SOURCE_ID> so the hub analyzes the
source in place. /sap-atc fails loud if the provider isn't configured (it
never silently runs a local analysis as remote). Note: the provider field
id is unverified (no configured hub was available to record against) — see
/sap-atc "Central / remote ATC".prepare --batch-size <n>, which emits --object-list batch files that
/sap-atc runs as one object set / one run per batch (see "Batched
analysis (A5)" in Step 1).Fold the exports into the campaign ledger and advance state:
powershell -ExecutionPolicy Bypass -File "<SKILL_DIR>\references\sap_cc_analyze.ps1" -Action ingest -CampaignDir "{CAMPAIGN_DIR}" -ResultsPath "{CAMPAIGN_DIR}\findings\atc_raw"
-ResultsPath accepts a single file or a folder. The parser maps common ATC
export headers (object / type / priority / check / line / message / message id /
simplification item / SAP note) onto the canonical schema; columns it
can't find are left blank. When the export has no object-type column (the
/sap-atc drill TSV has OBJECT but no type), ingest backfills obj_type
from the campaign ledger so triage's per-object rollup matches. Output:
FINDINGS: total=<n> new=<n> objects_with_findings=<n> file=<path>
PRIORITY: <p> | COUNT: <n>
ANALYZED: <n>
INFO: <n> of <m> worklist objects not covered by this ingest
STATUS: OK | EMPTY | ERROR
Objects marked ANALYZED = only those this ingest has evidence for: an
object with at least one finding row, or one listed in a checked-objects export
(rows whose finding columns are all blank count as coverage evidence and are
never written to findings_raw.tsv). The prepared worklist alone is NOT
evidence a run happened — worklist objects with no evidence keep their prior
state (SCOPED) and are counted on the INFO: line, so a partially-run ATC loop
can never record unrun objects as analyzed-clean. When INFO: reports
uncovered objects, run /sap-atc for them (or append their completed clean
runs to checked_objects.tsv — Step 2), then re-ingest. Re-ingest is safe
(findings dedupe on object|check|line|message-id).
| Exit | Meaning |
|---|---|
0 | STATUS: OK — findings appended, state advanced. |
1 | Nothing to do. |
2 | Bad workspace / results path (see ERROR:). |
After ingest, recommend triage: /sap-cc-campaign next (→ /sap-cc-triage).
{CAMPAIGN_DIR}\findings\analyze_worklist.tsv — obj_name · obj_type · atc_type (objects to run, with the mapped /sap-atc type).{CAMPAIGN_DIR}\findings\analyze_skipped.tsv — obj_name · obj_type · reason (in-scope objects with no ATC category; left SCOPED, not analyzed). /sap-cc-campaign next reads this file and treats these objects as non-blocking (excluded from the await-analysis count and the DONE check), so they never wedge the recommender and the pipeline still converges.{CAMPAIGN_DIR}\findings\findings_raw.tsv — obj_name · obj_type · check_id · priority · line · message_id · message_text · simplification_item · sap_note.{CAMPAIGN_DIR}\state.tsv — REMEDIATE objects advanced SCOPED → ANALYZED.prepare --batch-size <n> emits
--object-list batch files that /sap-atc runs as one object set / one run
each (see Step 1 "Batched analysis" + Step 2 "Batched mode"), collapsing n
single runs into ⌈n/BatchSize⌉. The per-object worklist loop remains the
default when --batch-size is omitted. Per-object verdicts are identical
either way (findings are attributed by the drill's OBJ_NAME column, which is
independent of how the object set was populated)./sap-login --switch <check_system>
(recommended), or — when the hub is configured for central ATC — pass
/sap-atc … --object-provider=<id> for a true remote run. The --object-provider
field id is unverified (no configured hub was available to record against);
the fail-loud guard is verified live, so a misconfigured remote run aborts
rather than silently running local. Version direction: hub content ≥ target.simplification_item / sap_note columns are populated only if the ATC
readiness export includes them; /sap-atc's current count-oriented output may
not, in which case a per-finding "Manage Results" export is used. Verify on
first run for your release./sap-atc. This skill adds no GUI code,
but the ATC run it depends on is release-coupled (re-record per release).powershell -ExecutionPolicy Bypass -File "<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_log_helper.ps1" -Action end -StateFile "{RUN_TEMP}\sap_cc_analyze_run.json" -Status SUCCESS -ExitCode 0
For exit 1 use -Status SKIPPED -ExitCode 1 -ErrorClass CC_ANALYZE_EMPTY;
for exit 2 use -Status FAILED -ExitCode 2 -ErrorClass CC_ANALYZE_BAD_INPUT.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
sap, s4hana, atc, migration, custom-code
npx claudepluginhub sapdev-ai/sap-dev --plugin sap-migrate10 skills in this plugin
/sap-cc-campaignOwns the S/4HANA custom-code migration campaign workspace and is the
orchestration entry point for the sap-migrate engine. Five subcommands:
init — create a campaign workspace from the migration Customer Brief
(source/target release, in-scope packages, decommission policy,
connection profiles, human gates) + the empty state ledger.
status — per-state / per-tier counts + headline metrics.
report — render reports/dashboard.md: state/tier/pattern rollup + five KPIs
(decommission savings, ATC-clean rate, auto-fix rate, unmatched-finding
backlog, business sign-off); every percentage honest ("n/a", not 0%,
when the ledger isn't produced yet).
next — recommend the next pipeline skill, honouring the human-approval gates.
signoff— record a business-owner sign-off in campaign.json.
Pure workspace/state/reporting skill — OFFLINE (no SAP GUI, no RFC, no NCo); it
only reads/writes the campaign files the other sap-cc-* skills produce.
Prerequisites: none (the downstream skills it sequences do need SAP access).
/sap-cc-cloud-readinessMeasures each custom (Z/Y) object's DISTANCE FROM ABAP CLOUD — the question
S4HANA_READINESS (/sap-cc-analyze) does not answer. `scan` downloads source over
RFC for a campaign's REMEDIATE scope (or an explicit --objects/--packages set),
matches a versioned forbidden-statement ruleset + a cloudification-repository
snapshot offline, and classifies every object TIER_1_READY / TIER_2_WRAPPABLE
(only blockers are unreleased APIs with a successor) / TIER_3_CLASSIC (a
forbidden statement or an unreleased API with no successor), with a per-blocker
blockers.tsv and an AI summary of the cheapest wins. Honest by construction: an
API absent from the pack is 'unknown' (counted, never a blocker), a source that
can't be read is COULD_NOT_CHECK (never TIER_1), and any dynamic call sets
dynamic_blindspot=YES. S/4-ONLY (hard-refuses a non-S/4 pinned profile —
CC_NOT_S4 — pointing to /sap-cc-analyze). Read-only RFC; no writes, no TR, no
deploy. Prerequisites: /sap-login pinned to the S/4 system; SAP NCo 3.1 (32-bit).
/sap-cc-decommissionEXECUTES the retirement of unused custom objects a campaign flagged for
decommission — turning "40-60% of custom code is unused" into a realized,
audited deletion. /sap-cc-usage only FLAGS; this skill physically deletes,
behind a hard signed gate and a per-object safety chain. Two actions: `plan`
(behind the decommission_signoff gate — build the retirement worklist from
scope.tsv, consumers before providers; nothing deleted) and `record` (after the
delegated deletes, advance state + append the decommissioned.tsv audit ledger).
Per object it re-verifies safety (no inbound callers, still resolves, not locked
in another TR), backs up the source, resolves a TR, deletes via the routed
workbench skill, and CONFIRMS it is physically gone before ledgering. Irreversible
and transported to QA/PROD — never deletes without the sign-off, never ledgers an
object it didn't confirm gone. Run after /sap-cc-usage.
Prerequisites: scope.tsv with DECOMMISSION rows; SAP NCo 3.1 (32-bit); the
source connection.
/sap-cc-inventoryEnumerates and classifies the custom (Z/Y / customer-namespace) repository
objects in scope for an S/4HANA migration campaign. Reads TADIR + TRDIR over
read-only RFC against the campaign's SOURCE system, writes inventory.tsv, and
upserts every object into the state ledger as INVENTORIED (never touching
objects further along, so it is safe to re-run as new custom code appears). No
SAP GUI, no writes, no TR — pure read-only. First SAP-touching step of the
sap-migrate pipeline; run after /sap-cc-campaign init, before /sap-cc-usage.
When RFC is blocked, --source-mode GUI ingests /sap-se16n exports of TADIR
(+ TRDIR) instead (identical output, no NCo). Scope defaults to the brief's
in_scope_packages; override with --namespace / --packages / --types / --exclude.
Prerequisites (RFC): SAP NCo 3.1 (32-bit) + a saved source_profile (or pinned
/sap-login). GUI mode needs only a SAP GUI session for the /sap-se16n export.
/sap-cc-remediateRemediates a migration campaign's TRIAGED R1 (mechanical) objects on the
SANDBOX — the only sap-migrate skill that changes SAP, and only after a
mandatory dry-run review. Four actions:
apply — dry-run the deterministic R1 rule pack over each object's source →
<obj>.after.abap + diff for the operator to review (this is the gate).
assist — R2/R3: assemble a per-object AI context bundle for a recipe-faithful
rewrite (never auto-applied; DRAFT patterns advisory-only).
revert — roll a deployed fix back to its retained before-image (confirmed).
record — after the operator deploys the approved fix + ATC re-check, advance
campaign state (TRIAGED → REMEDIATED → VERIFIED).
R1 is deterministic; R2/R3 and unclassified '?' objects are AI-assisted / human
work, never auto-applied. Run after /sap-cc-triage.
Prerequisites: downloaded source per R1 object; deploy via the workbench skills
on the sandbox.
/sap-cc-triageTwo modes for an S/4HANA migration campaign's readiness findings.
Default — CLASSIFY: joins findings/findings_raw.tsv against the Simplification
Knowledge Pack (catalog.tsv) and writes findings/findings_triaged.tsv with each
finding's pattern + tier (R1 mechanical … R4 redesign) + fixability, then advances
each object to TRIAGED with a rolled-up tier (routing R1 to auto-remediation,
R2+/unclassified to AI/manual). Match precedence: message id > simplification item
> code regex; no match → UNMATCHED (REVIEW). Run after /sap-cc-analyze, before
/sap-cc-remediate.
--learn — the knowledge-pack FLYWHEEL (absorbed from the former /sap-cc-learn):
learns real ATC message ids from the triaged findings back into the pack's
detect_message_ids so future runs leave fewer UNMATCHED (`propose` = read-only,
`apply` merges + operator --assign into catalog.tsv). Offline.
Prerequisites: classify needs findings_raw.tsv (/sap-cc-analyze); --learn needs
findings_triaged.tsv (a prior classify run).
Other plugins' skills for the same job