Skip to content
Development
Skill

/sap-gen-test-plan

Turns a design-spec work folder (_process.txt / _golden.txt / _errorMsgs.txt from /sap-docs-extract) or an /sap-explain-object dossier into a reviewer-ready FUNCTIONAL test plan — cases per process step, exactly one negative case per validation rule wired to its error message,

From plugin
sap-dev
8123 skills3 agents
Install
$ npx -y skills add sapdev-ai/sap-dev --skill sap-gen-test-plan --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-gen-test-plan

Context preview

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

Turns a design-spec work folder (_process.txt / _golden.txt / _errorMsgs.txt from /sap-docs-extract) or an /sap-explain-object dossier into a reviewer-ready FUNCTIONAL test plan — cases per process step, exactly one negative case per validation rule wired to its error message,

SKILL.md

sap-gen-test-plan.SKILL.md
name: sap-gen-test-plan
description: |
  Turns a design-spec work folder (_process.txt / _golden.txt / _errorMsgs.txt from
  /sap-docs-extract) or an /sap-explain-object dossier into a reviewer-ready FUNCTIONAL
  test plan — cases per process step, exactly one negative case per validation rule wired
  to its error message, boundary cases per selection field, and a case<->step<->rule<->message
  traceability matrix — closing the gap where the spec's Golden Tests sheet feeds ONLY ABAP
  Unit generation and nobody derives the functional plan, so QA re-derives cases by hand and
  error paths go untested. Offline-first: pure derivation + rendering (md, or xlsx via
  anthropic-skills:xlsx). An optional --validate flag adds a read-only RFC pass that confirms
  every referenced message (T100/T100A), table (DD02L), tcode (TSTC), and FM (TFDIR), pulls
  DD03L key fields into test-data templates, and upgrades provenance INFERRED->VERIFIED (with
  MISMATCH/NOT_FOUND surfaced as findings, tri-state COULD_NOT_CHECK honesty). Every message is
  mapped to a provoking case or lands in UNMAPPED (verdict WARN, never dropped); a case is
  CONFIRMED (spec-traceable) or INFERRED (model-derived) and no path flips that without a live
  read. Read-only; no SAP writes, no confirm gates. Prerequisites: a spec work folder or an
  object dossier; for --validate a pinned RFC profile via /sap-login + NCo 3.1 (32-bit).
argument-hint: "<work_folder | OBJECT | dossier_dir> [--format md|xlsx|both] [--validate] [--out <dir>]"

SAP Generate Test Plan Skill

You derive a functional test plan from a spec or an object dossier: a case per process step, one negative case per validation rule mapped to its message, boundary cases per selection field, and a full traceability matrix — with honest coverage (UNMAPPED / UNCOVERED are shown, never hidden) and an optional live-RFC grounding pass. You never write to SAP.

Task: $ARGUMENTS

The derivation is **yours** (steered by `references/test_case_derivation_rules.md`); the `--validate` RFC pass and the rendering helpers are scripts.

---

Shared Resources

| File | Token / call | Purpose | |---|---|---| | `<SKILL_DIR>/references/test_case_derivation_rules.md` | read by Claude | Case-derivation checklist + provenance rules | | `<SKILL_DIR>/references/test_plan_template.md` | read by Claude | Canonical section/sheet layout | | `<SKILL_DIR>/references/sap_testplan_validate.ps1` | `-InFile -OutTsv` | The --validate RFC backend (Layer 2) | | `<SAP_DEV_CORE_SHARED_DIR>/scripts/sap_object_resolver.ps1` | dot-sourced / CLI | Object resolution (dossier mode + validate connect) | | `<SAP_DEV_CORE_SHARED_DIR>/scripts/sap_artifact_lib.ps1` | dot-sourced | `Register-SapArtifact`, scope key | | `<SAP_DEV_CORE_SHARED_DIR>/scripts/sap_finding_lib.ps1` | dot-sourced | `New-SapFinding` for MISMATCH/NOT_FOUND | | `/sap-explain-object` | sub-skill | Dossier acquisition (`--spec`) in from-dossier mode | | `anthropic-skills:xlsx` | sub-skill | `--format xlsx\|both` rendering | | `/sap-login` | sub-skill | Pinned RFC profile (only for `--validate`) |

---

Step 0 — Resolve Work Directory

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

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_gen_test_plan_run.json" -Skill sap-gen-test-plan -ParamsJson "{}"

---

Step 1 — Parse Arguments & Detect Mode

  • Arg is a directory containing `*_process.txt` -> **from-spec**.
  • Arg is a directory containing a dossier / `map.json` -> **from-dossier**.
  • Arg is a bare object name -> resolve via `sap_object_resolver.ps1`; if no dossier exists,

offer `/sap-explain-object <OBJ> --spec` (read-only) and consume its output (v1.5 auto-invoke).

  • Else abort `INPUT_NOT_FOUND`.

Flags: `--format md|xlsx|both` (default md), `--validate`, `--out <dir>`.

Step 2 — Load Inputs

  • **from-spec:** read the TSVs. Split `_process.txt` on its `# === VALIDATION ===` /

`# === PROCESS ===` banners (a banner-less file = one PROCESS block, degraded, WARN). `_process.txt` is MANDATORY (abort `TESTPLAN_INPUT_INCOMPLETE` if absent/empty); WARN on missing `_golden.txt` / `_errorMsgs.txt`. Optional enrichers: `_interface.txt`, `_selection_definition.txt`, `_tables.txt` + `table_data_*.txt`, `_deps.txt`.

  • **from-dossier:** read the dossier + `map.json` (units, call edges, db_reads/db_writes,

selection screen, message usages).

Build the internal model: `steps[]`, `validation_rules[]`, `messages[]`, `golden_rows[]`, `selection_fields[]`, `tables[]`.

Step 3 — Derive Cases

Follow `references/test_case_derivation_rules.md` exactly: import golden rows (CONFIRMED); one positive case per step (CONFIRMED); one negative case per validation rule wired to its `ERR_MSG_REF` (CONFIRMED); boundary cases per selection field + defensible edge cases (INFERRED). Assign `TC-###` ids.

Step 4 — Message Mapping + Traceability

Map every message to >=1 provoking case; build the case<->step<->rule<->message matrix; collect `UNMAPPED` messages and `UNCOVERED` steps. Never drop either — they downgrade the verdict to WARN.

Step 5 — Test-Data Prerequisites

From golden INPUTS + `_tables.txt` + `table_data_*.txt` (+ map.json db_reads) list per-table prerequisites (table, purpose, key template, rows needed, source).

Step 6 — Validate (only with `--validate`)

Write the facts to check into `{RUN_TEMP}\validate_in.tsv` (one `<kind>\t<name>\t<sub>` per line: `msg`+MSGID+MSGNO for every referenced message, `table`/`tcode`/`fm` for prerequisites, `keyfields`+TABNAME for every test-data table), then run via **32-bit PowerShell**:

C:\Windows\SysWOW64\WindowsPowerShell\v1.0\p
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.