/sc4sap:ask-consultantfrom sc4sap
Routes operational SAP questions to the correct module consultant (SD, MM, FI, CO, etc.) and returns configuration advice, SPRO guidance, or business-process answers without code generation.
Ships in sc4sap. 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.
Offline profile (
common/offline-mode.md): degraded — no system lookups; local knowledge order and the notice line from there.
Single entrypoint for asking a SAP module consultant agent an operational question. The skill auto-selects the right consultant(s) from the question text + project config, honors the configured SAP environment, and returns a faithful answer — no code generation, no object creation, just the consultant's judgment.
`/sc4sap:ask-consultant` is the "ask a human consultant" button inside Claude. Users hit it when they need SPRO guidance, business-process advice, configuration walkthroughs, integration touchpoints, localization rules, or BAdI / CMOD / append decisions — the kind of question normally answered by an SD / MM / FI / CO / PP / PS / PM / QM / TR / HCM / WM / TM / BW / Ariba / Basis consultant. The skill does NOT write code or change the SAP system; it reads config + consults the agent + returns the answer.<Response_Prefix>
Every response triggered by this skill MUST begin with [Model: <main-model> · Dispatched: <sub-summary>] per ../../common/model-routing-rule.md § Response Prefix Convention.
</Response_Prefix>
<Phase_Banner>
Multi-phase skill. Before each Agent(...) dispatch (including every parallel consultant spawn and the optional synthesis pass), emit ▶ phase=<id> (<label>) · agent=<name> · model=<Opus|Sonnet|Haiku> per ../../common/model-routing-rule.md § Phase Banner Convention. Resolve the dispatch mode first per ../../common/model-dispatch-mode.md: auto (default) uses the model below/in the rule; user-defined asks the user Opus / Sonnet / Haiku (recommended one first) before each dispatch group.
</Phase_Banner>
<Team_Mode>
When module routing produces ≥ 2 consultants, Step 4 doubles as teamMode Round 1 (POSITION block requested inline — no team files, no team docs read). If Round 1 POSITIONs diverge (Step 4 § Divergence check), only then read team-mode.md + team-rounds.md, persist Round 1, run Rounds 2-3 and the teamMode synthesis. Single-consultant questions and aligned Round 1 → legacy synthesis (Step 5). Base protocol: ../../common/team-consultation-protocol.md.
</Team_Mode>
<Use_When>
/sc4sap:create-program.
</Use_When><Do_Not_Use_When>
/sc4sap:create-program or /sc4sap:create-object./sc4sap:analyze-symptom./sc4sap:analyze-code.common/data-extraction-policy.md./sc4sap:assist (§ Assist_Handoff).
</Do_Not_Use_When><Assist_Handoff>
Classify the request first with ../../common/intent-router.md. Class lookup or action → say one line ("This is a document action — handing over to assist") and continue with the /sc4sap:assist workflow in the same turn, reusing the user's sentence; never ask the user to retype it. Mixed requests: answer the how / why part here, then hand the document part over. When assist dispatches a module consultant to explain a blocked preview, that answer follows this skill's environment rules but is returned to assist.
</Assist_Handoff>
<Session_Trust_Bootstrap> MANDATORY — runs as Step 0 before the consultant dispatch.
Invoke /sc4sap:trust-session with parent_skill=sc4sap:ask-consultant so the consultant agent's read-only MCP calls (SearchObject, GetTable, GetPackage, GetWhereUsed, etc.) proceed without prompting.
.sc4sap/session-trust.log already has a line within the last 24h, skip silently.Full spec: see ../trust-session/SKILL.md.
</Session_Trust_Bootstrap>
<Environment_Context> MANDATORY — the consultant answers against the project's configured SAP environment, not generic best-practice. Before dispatching, load:
.sc4sap/config.json → sapVersion (ECC / S4 On-Prem / S4 Cloud Public / S4 Cloud Private), abapRelease, industry, country, activeModules.sc4sap/sap.env → SAP_URL, SAP_CLIENT, SAP_LANGUAGE, SAP_INDUSTRY, SAP_COUNTRY, SAP_ACTIVE_MODULES (as fallback)Pass these to the consultant via the dispatch prompt so its answer reflects the actual landscape. If any key is missing, ask the user before dispatching — do NOT let the consultant invent assumptions.
The consultant agent's Mandatory_Baseline (Tier 1 + Tier 2 per ../../common/context-loading-protocol.md) ensures it loads spro-lookup.md, customization-lookup.md, active-modules.md at session start and reads only the configs/{MODULE}/*.md file(s) the question needs.
</Environment_Context>
<Module_Routing> Map the user's question to the target module(s). Priority:
Supported consultants (15 total):
sap-sd-consultant, sap-mm-consultant, sap-fi-consultant, sap-co-consultant, sap-pp-consultant, sap-ps-consultant, sap-pm-consultant, sap-qm-consultant, sap-tr-consultant, sap-hcm-consultant, sap-wm-consultant, sap-tm-consultant, sap-bw-consultant, sap-ariba-consultantsap-bc-consultant
</Module_Routing><Workflow_Steps>
Per-step model allocation (the main thread follows the session model — frontmatter model: inherit, because it judges divergence and reviews the synthesis; Agent dispatches carry their own model):
<Session_Trust_Bootstrap>. (main · skill-to-skill)node "${CLAUDE_PLUGIN_ROOT}/scripts/spro-query.mjs" --status <routed modules> first: line 1 gives the config= and env= paths (the active profile under ~/.sc4sap/profiles/<alias>/, not .sc4sap/ of the workspace), then the exact SPRO cache file and customizations dir per module, or none. Read the two files at those paths and copy the module lines into the context kit verbatim; config=none → ask the user per § Environment_Context; surface resolved values on the FIRST turn only (one line: SAP: <version> · <industry> · <country> · active: <modules>). (main thread)<Module_Routing>. If ambiguous, ask one question and stop. (main thread)Agent(...) per resolved module (parallel in a single message when 2–3 modules match). Every prompt carries the context kit below so the consultant never searches the file system for the plugin or re-parses caches:
Environment: <sapVersion> · <abapRelease> · <industry> · <country> · active: <modules> (resolved — do not re-read config.json / sap.env)
Plugin root: ${CLAUDE_PLUGIN_ROOT} — rules common/, module docs configs/<M>/, industry/, country/. Use only this root.
SPRO cache: <yes: file | no>. Query it only with
node "${CLAUDE_PLUGIN_ROOT}/scripts/spro-query.mjs" --module <M> [--find FIELD | --table T [--where F=v1|v2,G~txt] [--fields A,B]]
(list → find → filtered rows; no ad-hoc scripts, no full reads of the cache file). Cache present and the answer
depends on this system's configuration → check the relevant tables with it before answering.
Customizations cache: <path | none> — grep it for customer exits / BAdIs / BTEs on the process asked about (they can
change standard behaviour) and name any hit in the answer (common/customization-lookup.md).
configs/<M>/*.md: grep the TCodes / tables / BAPIs you cite (ECC/S4 column) — no whole-file reads.
Answer size follows the question; drop Output_Format sections that do not apply.
Emit phase banner per dispatch:
▶ phase=4 (consultant-<MODULE>) · agent=sap-<module>-consultant · model=Opus
Dispatch shape:
Agent({
subagent_type: "sc4sap:sap-<module>-consultant", // frontmatter alias `opus` (tracks the newest Opus)
description: "<MODULE> consultation — <topic>",
prompt: <user question + environment context + expected format>
})
N ≥ 2 (teamMode Round 1): append to each prompt — teamMode=true, round=1, member=sap-<module>-consultant. Do NOT write any file and do not read the team protocol. Start your reply with this block, then your answer: followed by POSITION / assumption: … / recommendation: … / confidence: high|med|low / rule-cites: … (one field: value per line, ≤ 5 lines of reasoning). Banner phase id 4.R1.
Divergence check (main, no agent call): aligned = every recommendation names the same core action on the same object and no assumption contradicts another; fast path: same primary TCode / IMG node in every recommendation with confidence ≥ med. One low that does not contradict the rest = aligned. Aligned → append <UTC timestamp> aligned R1 <members> to ~/.claude/tasks/ask-consultant-r1.log (round statistics) and go to Step 5. Divergent → read team-rounds.md, write 00-charter.md + the R1 10-*-position.md files from the returns, continue at Round 2.sap-writer with model: "sonnet" override. Writer's base model is Haiku (pure formatting); Sonnet override gives the light cross-domain reasoning needed to detect agreement / disagreement between consultant answers without jumping to Opus.
Emit banner:
▶ phase=5 (synthesis) · agent=sap-writer · model=Sonnet
Dispatch shape:
Agent({
subagent_type: "sc4sap:sap-writer",
model: "sonnet", // override base Haiku — synthesis needs light reasoning
description: "Cross-module synthesis — <modules>",
prompt: """
Synthesize the following consultant answers for the user question.
Identify shared points, flag disagreements (with a one-line "WHY they differ" note),
and produce a cross-module summary. Do NOT re-answer the question — only compose
from the supplied consultant outputs.
User question: <question>
Environment: <sapVersion> · <industry> · <country> · modules: <list>
Consultant answers:
<MODULE_A>: <answer_a>
<MODULE_B>: <answer_b>
[...]
"""
})
teamMode variant: if Round 1 POSITIONs diverged (per team-rounds.md § Divergence check), do NOT run the legacy synthesis above — follow team-rounds.md Rounds 2-3 then team-mode.md § Synthesis (task-list–driven writer dispatch).
On single-consultant case: SKIP Step 5 entirely — main thread just forwards the consultant's answer to Step 6./sc4sap:create-program (if the answer leads to a new build), /sc4sap:program-to-spec (if user wants the existing asset documented), /sc4sap:analyze-code (if quality review needed). (main thread)No writes: this skill never calls Create* / Update* / Delete* / Activate* / CreateTransport. If the consultant's answer suggests a change, the user must run a separate creation / modification skill.
No row extraction: GetTableContents and GetSqlQuery are NOT used. Schema / DDIC reads are fine (GetTable, GetStructure, GetDataElement, GetDomain, SearchObject).
</Workflow_Steps>
<Output_Format> Return the consultant's answer verbatim, prefixed with the consultant identity and the environment context it used:
[Model: <main-model> · Dispatched: Opus×<n> (<consultant names>)]
🧭 Consultant: sap-<module>-consultant
🌐 Environment: <sapVersion> · <industry or "—"> · <country or "—"> · active modules: <list>
<consultant's faithful answer>
---
💡 Next steps (optional):
- /sc4sap:create-program — if this leads to a new build
- /sc4sap:program-to-spec — to document an existing asset
- /sc4sap:analyze-code — to review existing code
For multi-module dispatches, the 🧭 Consultant line lists all names, the body leads with the sap-writer synthesis (Sonnet) — shared points, disagreements, cross-module summary — followed by a 3–5 line summary per consultant (full answers on request, not repeated by default).
Dispatch-summary examples in the prefix:
[Model: <main> · Dispatched: Opus×1 (sap-mm-consultant)][Model: <main> · Dispatched: Opus×2 (sap-mm-consultant, sap-fi-consultant), Sonnet×1 (sap-writer synthesis)][Model: <main> · Dispatched: Opus×2 (sap-mm-consultant, sap-fi-consultant), Sonnet×1 (sap-writer team-synthesis) · Team: 2 members × 2 rounds]
</Output_Format><Related_Skills>
/sc4sap:compare-programs — complementary when the consultant's answer references existing variants./sc4sap:stock-cbo — complementary when the consultant's answer depends on knowing what custom assets already exist.
</Related_Skills><MCP_Tools_Used>
SearchObject, GetObjectInfo — existence checks as the consultant worksGetPackage, GetPackageContents — CBO scope confirmationGetTable, GetStructure, GetDataElement, GetDomain, GetView — DDIC metadataGetWhereUsed — call-graph queriesGetTableContents, GetSqlQuery, any Create* / Update* / Delete* / Activate*
</MCP_Tools_Used>Task: $ARGUMENTS
What SKILL.md sets; muted values are Claude Code's defaults
inheritThree short reads, in order
sap-consultant, sap-module, sap-configuration, spro, cross-module
npx claudepluginhub babamba2/superclaude-for-sap --plugin sc4sap31 skills in this plugin
/adobe-from-pdfBuild an Adobe form (SFP — interface, context and XDP layout) from a PDF of the printed form, the way smartform-from-pdf builds a SmartForm, upload it to the DEV system, print it there and score the print against the source page. Awaiting approval — not runnable yet./adobe-previewDraw the expected print of an Adobe form (SFP, S/4HANA) as HTML pages in mm (plus JPG / PDF with a local browser) — the XFA layout with its master pages, flowed tables with repeated headers, page breaks, captions, pictures (dates, numbers, currency shifts), rich text with embedded fields, rounded boxes and images — filled with invented sample values sized to the interface's DDIC types. On a development system it can print SAP's example forms through ADS and score the preview against SAP's own PDF./Other plugins' skills for the same job