/sap-migrate:sap-cc-triage --campaign <id> [--knowledge <dir>] | --learn <propose|apply> --campaign <id> [--knowledge <dir>] [--assign <file>] [--top-unmatched <n>]from sap-migrate
Classifies S/4HANA migration findings against a knowledge pack to assign tiers (R1-R4) and routes objects to auto-remediation, AI, or manual review. Also learns new message IDs from triaged findings to improve future matching.
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 turn raw ATC readiness findings into a routed remediation plan: every
finding gets a pattern and tier, and every analyzed object gets a
rolled-up tier so /sap-cc-remediate knows whether it can auto-fix (R1), needs
AI help (R2/R3), or needs a human (R4 / unclassified).
With --learn you run the knowledge-pack flywheel instead: learn the real
ATC message ids observed in this campaign's triaged findings back into the pack so
the next campaign matches more and leaves fewer UNMATCHED. That mode (folded in
from the former /sap-cc-learn) is documented in "Flywheel mode (--learn)"
below.
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>/../../shared/knowledge/catalog.tsv | (read; --learn apply updates) | The Simplification Knowledge Pack index — the join source (pattern / tier / detect_* / confidence). Classify reads it; --learn apply updates its detect_message_ids. Customer override at {custom_url}\knowledge\catalog.tsv. |
<SKILL_DIR>/references/sap_cc_triage.ps1 | (invoke) | The classifier: joins findings to the catalog, writes findings_triaged.tsv, advances state. |
<SKILL_DIR>/references/sap_cc_learn.ps1 | (invoke, --learn) | The flywheel engine: propose (read-only) / apply (updates the pack's detect_message_ids). |
Workspace contract (findings/findings_triaged.tsv pattern column, the
TRIAGED state) is defined by /sap-cc-campaign; the knowledge-pack join
contract is defined in shared/knowledge/README.md. This skill owns
findings/findings_triaged.tsv.
Offline skill — no SAP GUI / broker / attach / RFC / TR. It reads the per-campaign findings + the plugin-shared knowledge pack and writes files.
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')))"
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.
Knowledge pack resolution: default is the plugin pack at
<SKILL_DIR>\..\..\shared\knowledge. If {custom_url}\knowledge\catalog.tsv
exists, pass that folder via --knowledge to use the customer's extended pack.
State file: {RUN_TEMP}\sap_cc_triage_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_triage_run.json" -Skill sap-cc-triage -ParamsJson "{}"
Mode dispatch. If --learn <propose|apply> is present, skip the classify
steps (2–4) and jump to "Flywheel mode (--learn)" below. Otherwise run the
default CLASSIFY flow (Steps 2–4).
CLASSIFY inputs:
--campaign <id> — required. Needs {CAMPAIGN_DIR}\findings\findings_raw.tsv
(from /sap-cc-analyze). If missing, stop and run analyze first.--knowledge <dir> — optional knowledge-pack override (default: the plugin
pack; or {custom_url}\knowledge).powershell -ExecutionPolicy Bypass -File "<SKILL_DIR>\references\sap_cc_triage.ps1" -CampaignDir "{CAMPAIGN_DIR}"
Add -KnowledgeDir "{custom_url}\knowledge" to use a customer-extended pack.
(Plain powershell — offline, no NCo.)
Join contract (from shared/knowledge/README.md): each finding matches a
catalog pattern by message id, else simplification item, else
code regex (coarse fallback against the message text); ties prefer
status=ACTIVE. The chosen pattern supplies pattern / tier / category /
fixability (= confidence_default) / recipe_ref. No match →
pattern=UNMATCHED, fixability=REVIEW.
Object tier rollup (written to state.tsv): clean object (no findings) →
-; any unclassified finding → ? (forces human triage, never
auto-remediated); all findings matched → max severity (R4>R3>R2>R1).
TRIAGE: findings=<n> matched=<n> unmatched=<n> objects=<n> file=<path>
CLEAN: ... # only when analyze produced 0 findings
PATTERN: <pattern_id> | COUNT: <n>
TIER: <R1|R2|R3|R4> | COUNT: <n>
STATUS: OK | EMPTY | ERROR
| Exit | Meaning |
|---|---|
0 | STATUS: OK — findings_triaged.tsv written, state advanced to TRIAGED. A clean campaign (analyze produced 0 findings) also exits 0 — every analyzed object is triaged clean (tier -) and a CLEAN: line is emitted. |
1 | findings_raw.tsv missing — /sap-cc-analyze has not run yet. |
2 | Bad workspace, missing knowledge catalog, or unreadable findings (see ERROR:). |
Report the pattern + tier breakdown and the unmatched count (a high unmatched
count means the pack needs new detect_message_ids from this release's ATC run —
feed them back with --learn; see "Flywheel mode" below). Then recommend:
powershell -ExecutionPolicy Bypass -File "<SKILL_DIR>\..\sap-cc-campaign\references\sap_cc_campaign.ps1" -Action report -CampaignDir "{CAMPAIGN_DIR}"
/sap-cc-campaign report rolls findings_triaged.tsv up by pattern; then
/sap-cc-campaign next routes to /sap-cc-remediate for the R1 work.
{CAMPAIGN_DIR}\findings\findings_triaged.tsv — per-finding:
…the 9 raw columns… · pattern · tier · category · fixability · est_effort · recipe_ref · match_basis · status.{CAMPAIGN_DIR}\state.tsv — analyzed objects advanced ANALYZED → TRIAGED with
the rolled-up tier.--learn) — knowledge-pack feedbackRun only when --learn <propose|apply> is passed. This is the knowledge-pack
flywheel (folded in from the former /sap-cc-learn): it binds the real ATC message
ids observed in this campaign's findings/findings_triaged.tsv to their patterns so
the next campaign matches more by message id and leaves fewer UNMATCHED. Offline —
reads the triaged findings + the pack; apply rewrites catalog.tsv (real TABs,
UTF-8 no BOM). Requires a prior classify run (findings/findings_triaged.tsv).
--learn propose (read-only)powershell -ExecutionPolicy Bypass -File "<SKILL_DIR>\references\sap_cc_learn.ps1" -Action propose -CampaignDir "{CAMPAIGN_DIR}"
Output:
ADD: pattern=<P> message_id=<M> # safe: id -> single matched pattern
AMBIGUOUS: message_id=<M> patterns=<...> # id seen on >1 pattern; skipped
UNMATCHED: message_id=<M> count=<n> sample=<text>
LEARN: add=<n> ambiguous=<n> unmatched_ids=<n> proposal=<path>
STATUS: OK | EMPTY | ERROR
It also writes findings\learn_proposal.md — a human-readable table with an
assign_to_pattern column on the UNMATCHED list. Fill that column to classify
the high-count unmatched ids, then turn it into the assign file.
--learn apply (updates the pack)powershell -ExecutionPolicy Bypass -File "<SKILL_DIR>\references\sap_cc_learn.ps1" -Action apply -CampaignDir "{CAMPAIGN_DIR}" -KnowledgeDir "{custom_url}\knowledge" [-AssignFile "<assign.tsv>"]
detect_message_ids.-AssignFile (TSV message_id<TAB>pattern_id, header optional), also binds
the operator-classified UNMATCHED ids — this is what actually cuts the UNMATCHED
ratio next run.{custom_url}\knowledge) so learned ids survive plugin
updates; applying to the shipped pack is a maintainer action (the helper prints a
NOTE saying which you hit). Copy the seed catalog.tsv to the override first if it
doesn't exist yet.Output: APPLIED: patterns_updated=<n> message_ids_added=<n> file=<path>.
| Exit (learn) | Meaning |
|---|---|
0 | proposal written (propose) / catalog updated (apply). |
1 | No triaged findings — run the default classify first. |
2 | Bad workspace / catalog / assign file (see ERROR:). |
Only AUTO single-pattern ids are auto-bound. An id seen across multiple patterns
is AMBIGUOUS and never auto-bound; only the operator (via -AssignFile) can bind
such ids or classify UNMATCHED ones — deciding which pattern each belongs to (or that
a NEW pattern/recipe is needed) is human judgment. Prefer {custom_url}\knowledge
for apply so learned data is yours and update-safe. After apply, a re-run of the
default classify on the next campaign matches more findings by message id.
shared/knowledge/catalog.tsv / manifest.json). Findings outside
those patterns come back UNMATCHED (→ REVIEW) — expected
early; the pack grows via its flywheel (real detect_message_ids + new
recipes). A high unmatched ratio is a signal to extend the pack, not a bug.detect_code_regex fallback
runs against the finding's message text + check id (what findings_raw has),
not the live source line. Message-id / simplification-item matching is the
reliable path; populate detect_message_ids from real runs to reduce regex
reliance.DRAFT); /sap-cc-remediate
must exclude DRAFT from auto-apply (advisory only) per the pack rules.? — so an object is
only auto-remediable (R1) when every finding is a matched R1.powershell -ExecutionPolicy Bypass -File "<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_log_helper.ps1" -Action end -StateFile "{RUN_TEMP}\sap_cc_triage_run.json" -Status SUCCESS -ExitCode 0
For exit 1 use -Status SKIPPED -ExitCode 1 -ErrorClass CC_TRIAGE_NO_FINDINGS;
for exit 2 use -Status FAILED -ExitCode 2 -ErrorClass CC_TRIAGE_BAD_INPUT.
In --learn mode use CC_LEARN_NO_FINDINGS (exit 1) / CC_LEARN_BAD_INPUT (exit 2).
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub sapdev-ai/sap-dev --plugin sap-migrate10 skills in this plugin
/sap-cc-analyzeRuns the S/4HANA-readiness ATC over a migration campaign's REMEDIATE objects and
captures per-finding results into findings/findings_raw.tsv, advancing each
object to ANALYZED. The ATC run is delegated to /sap-atc
--variant=S4HANA_READINESS (so this skill ships no new GUI scripting; /sap-atc
fails loud if that variant can't be located on the release, so a non-readiness
run is never passed off as readiness). Two actions: `prepare` builds the
worklist from scope.tsv; `ingest` parses ATC result exports (from /sap-atc or a
manual "Manage Results" export — header-tolerant) into the findings ledger and
advances state. Run after /sap-cc-usage, before /sap-cc-triage.
Prerequisites: the connected system offers the S4HANA_READINESS variant with the
Simplification Database loaded; /sap-atc working (its per-stage recordings
target the S/4HANA 1909 ATC layout — re-record a failing stage with
/sap-gui-probe --record).
/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.
Other plugins' skills for the same job