SC4SAP Package → End-to-End Business Process
Reads ONE CBO package via MCP, classifies its programs/FMs into business document flows (PR → PO → GR → IR, SO → DN → Billing, etc.), and renders a Markdown narrative for functional consultants. Unlike analyze-cbo-obj (static inventory of reusable elements) or program-to-spec (single-object spec), this skill produces a process-level story spanning multiple programs with Mermaid diagrams + per-step tables.
Step X/7 · <label> [██████░░░░░░░░░░░░░░] 29%
- Bar width = 20 chars, filled =
█, empty = ░
- Percentage =
floor(step_id × 100 / 7) at entry (Step 0 = 0%, Done = 100%)
- Authoritative mapping table:
workflow.md § Progress Reporting
The bar is the only progress feedback for the user during long Steps 4–6 (multi-minute analyst dispatches), so it MUST be printed before each Step starts.
Invoke /sc4sap:trust-session with parent_skill=sc4sap:package-to-process to pre-grant MCP tool + file-op permissions (eliminates per-tool prompts during package walk + where-used graph + analyst/writer dispatches).
- If
.sc4sap/session-trust.log already has a line within the last 24h, skip silently.
- Otherwise run it and surface the one-line confirmation.
Full spec: see ../trust-session/SKILL.md.
| Companion |
Scope |
workflow.md |
7-step execution flow + Progress Reporting (bar template + step→% table) |
grouping-heuristics.md |
Auto-grouping algorithm: shared-table clustering + module-specific document-flow dictionary (MM/SD/PP/PM/QM/FI/CO) |
document-template.md |
Master .md skeleton: frontmatter + auto-TOC + per-process section + Mermaid (flowchart + sequenceDiagram) + tables |
dispatch-stocker.md |
Step 2 — sap-stocker auto-chain (conditional, inventory missing) |
dispatch-analyst.md |
Steps 4 & 5 — sap-analyst grouping + per-process narrative |
dispatch-writer.md |
Step 6 — sap-writer master .md render |
bpml-render.md |
Step 6b — BPML deliverable: spec-JSON contract + build-bpml.mjs CLI (xlsx / md / html, one run per format) + language rules |
|
|
- Main orchestrator (Sonnet 4.6) — Steps 0, 1, 2 (gate), 3, 7: trust-session, intake, inventory gate, entry-point detection, validation/handoff. Sonnet provides enough headroom for the intake state machine and entry-point matching across PROG × TCode.
sap-stocker (Sonnet 4.6, conditional) — Step 2 dispatch only when .sc4sap/cbo/<MODULE>/<PACKAGE>/inventory.json is missing. Runs the full Investigation_Protocol per ../../agents/sap-stocker.md.
sap-analyst (Opus 4.7, frontmatter) — Step 4 (auto process grouping w/ rationale) + Step 5 (per-process narrative + 1-hop boundary + sequenceDiagram). Opus is required: novel cross-program reasoning + business-flow inference, not template-fill.
sap-writer (Sonnet 4.6 via model: "sonnet" override) — Step 6 render. Master Markdown is L3-grade depth (TOC + multiple Mermaid blocks + per-process tables + cross-module gap section); Haiku is insufficient.
- Module consultant (optional, conditional) — if Step 5 narrative discovers a strong cross-module integration (e.g., MM ↔ FI through
BAPI_ACC_DOC_POST), the analyst MAY annotate via sap-{module}-consultant (Opus 4.7) for the boundary section only. NOT a default dispatch — costs additional context only when warranted.
SAP MCP permission prompts are auto-approved by the sc4sap permission-approver PreToolUse hook.
.sc4sap/processes/<MODULE>/<PACKAGE>/process-<YYYYMMDD>-<lang>.md and/or .html (the process document has no Excel form — an Excel-only selection keeps its .md)
.sc4sap/processes/<MODULE>/<PACKAGE>/bpml-<YYYYMMDD>-<lang>.xlsx / .md / .html (one per selected format)
HTML = the matching .md converted by scripts/spec/md-to-html.mjs (images inlined; Mermaid via CDN when opened online).
<MODULE> = uppercase module key (SD, MM, FI, CO, PP, PM, QM, WM, TM, TR, HCM, BW, PS, Ariba)
<PACKAGE> = uppercase package name
<YYYYMMDD> = generation date
<lang> = ISO 639-1 selected at Step 1 (ko / en / ja / other)
- Existing file at the same path → overwrite WITH a one-line
> Regenerated from <old-date> note at the top (md, carried into html; xlsx overwrites silently).
Do not skip the companion-file reads — the step order, grouping dictionary, output skeleton, and dispatch prompts all live there.
Task: {{ARGUMENTS}}
1---2name: sc4sap-package-to-process3description: Reverse-engineer a CBO package into an End-to-End Business Process document plus BPML (Markdown, HTML, and/or Excel — user picks any combination). Walks the package programs/FMs, infers business-document flow (PR→PO→GR→IR style), and emits a consultant-facing narrative with Mermaid flowchart + sequenceDiagram + per-step tables. CBO inventory auto-chain via sap-stocker if missing.4---56# SC4SAP Package → End-to-End Business Process78Reads ONE CBO package via MCP, classifies its programs/FMs into **business document flows** (`PR → PO → GR → IR`, `SO → DN → Billing`, etc.), and renders a Markdown narrative for **functional consultants**. Unlike `analyze-cbo-obj` (static inventory of reusable elements) or `program-to-spec` (single-object spec), this skill produces a **process-level story** spanning multiple programs with Mermaid diagrams + per-step tables.910<Purpose>11After a project accumulates dozens of CBO programs, no single document explains how they cooperate to implement the end-to-end business flow. AMS engineers, consultants taking over a module, and Fit/Gap reviewers all need a process-level map: *"Which programs form the PR→PO→GR→IR backbone? Which one fires which? Where does it cross into FI/CO?"* This skill answers that — once per package — and writes a reviewable Markdown artifact.12</Purpose>1314<Response_Prefix>15Every response triggered by this skill MUST begin with `[Model: <main-model> · Dispatched: <sub-summary>]` per [`../../common/model-routing-rule.md`](../../common/model-routing-rule.md) § Response Prefix Convention.16</Response_Prefix>1718<Phase_Banner>19Multi-phase skill. Before each `Agent(...)` dispatch, emit `▶ phase=<id> (<label>) · agent=<name> · model=<Opus 4.7|Sonnet 4.6|Haiku 4.5>` per [`../../common/model-routing-rule.md`](../../common/model-routing-rule.md) § Phase Banner Convention.20</Phase_Banner>2122<Progress_Bar>23Every Step entry MUST print a one-line progress indicator in this exact form (no ANSI colors, 20-char bar, right-aligned percentage):2425```26Step X/7 · <label> [██████░░░░░░░░░░░░░░] 29%27```2829- Bar width = 20 chars, filled = `█`, empty = `░`30- Percentage = `floor(step_id × 100 / 7)` at entry (Step 0 = 0%, Done = 100%)31- Authoritative mapping table: [`workflow.md`](workflow.md) § Progress Reporting3233The bar is the **only** progress feedback for the user during long Steps 4–6 (multi-minute analyst dispatches), so it MUST be printed before each Step starts.34</Progress_Bar>3536<Use_When>37- User says: "package to process", "패키지 프로세스 분석", "E2E 비즈니스 흐름 문서화", "패키지 분석해서 process flow", "reverse-engineer process from package"38- AMS / handover preparation: need a process-level map of an unfamiliar Z-package39- Fit/Gap review: need to see how the customer's CBO implements a business process before judging gaps40- Onboarding new consultants/developers onto an existing module41</Use_When>4243<Do_Not_Use_When>44- User wants only the **reusable-object catalog** → `/sc4sap:analyze-cbo-obj`45- User wants a **single program** spec → `/sc4sap:program-to-spec`46- User wants to **compare 2–5 programs** side-by-side → `/sc4sap:compare-programs`47- User wants **code quality** review → `/sc4sap:analyze-code`48- Package has zero PROG/FUGR (process narrative is meaningless without entry points)49</Do_Not_Use_When>5051<Session_Trust_Bootstrap>52**MANDATORY — runs as Step 0 before any MCP call or user interaction.**5354Invoke `/sc4sap:trust-session` with `parent_skill=sc4sap:package-to-process` to pre-grant MCP tool + file-op permissions (eliminates per-tool prompts during package walk + where-used graph + analyst/writer dispatches).5556- If `.sc4sap/session-trust.log` already has a line within the last 24h, skip silently.57- Otherwise run it and surface the one-line confirmation.5859Full spec: see [`../trust-session/SKILL.md`](../trust-session/SKILL.md).60</Session_Trust_Bootstrap>6162<Companion_Files>63**MANDATORY**: Read the companion files below before executing. Each covers a self-contained section:6465| Companion | Scope |66|-----------|-------|67| [`workflow.md`](workflow.md) | 7-step execution flow + Progress Reporting (bar template + step→% table) |68| [`grouping-heuristics.md`](grouping-heuristics.md) | Auto-grouping algorithm: shared-table clustering + module-specific document-flow dictionary (MM/SD/PP/PM/QM/FI/CO) |69| [`document-template.md`](document-template.md) | Master `.md` skeleton: frontmatter + auto-TOC + per-process section + Mermaid (flowchart + sequenceDiagram) + tables |70| [`dispatch-stocker.md`](dispatch-stocker.md) | Step 2 — `sap-stocker` auto-chain (conditional, inventory missing) |71| [`dispatch-analyst.md`](dispatch-analyst.md) | Steps 4 & 5 — `sap-analyst` grouping + per-process narrative |72| [`dispatch-writer.md`](dispatch-writer.md) | Step 6 — `sap-writer` master `.md` render |73| [`bpml-render.md`](bpml-render.md) | Step 6b — BPML deliverable: spec-JSON contract + `build-bpml.mjs` CLI (xlsx / md / html, one run per format) + language rules |74</Companion_Files>7576<Agent_Composition>77Per-step model allocation. Skill frontmatter pins the main thread to Sonnet; each `Agent(...)` carries its own model (frontmatter or explicit override).7879- **Main orchestrator (Sonnet 4.6)** — Steps 0, 1, 2 (gate), 3, 7: trust-session, intake, inventory gate, entry-point detection, validation/handoff. Sonnet provides enough headroom for the intake state machine and entry-point matching across PROG × TCode.80- **`sap-stocker` (Sonnet 4.6, conditional)** — Step 2 dispatch only when `.sc4sap/cbo/<MODULE>/<PACKAGE>/inventory.json` is missing. Runs the full Investigation_Protocol per [`../../agents/sap-stocker.md`](../../agents/sap-stocker.md).81- **`sap-analyst` (Opus 4.7, frontmatter)** — Step 4 (auto process grouping w/ rationale) + Step 5 (per-process narrative + 1-hop boundary + sequenceDiagram). Opus is required: novel cross-program reasoning + business-flow inference, not template-fill.82- **`sap-writer` (Sonnet 4.6 via `model: "sonnet"` override)** — Step 6 render. Master Markdown is L3-grade depth (TOC + multiple Mermaid blocks + per-process tables + cross-module gap section); Haiku is insufficient.83- **Module consultant (optional, conditional)** — if Step 5 narrative discovers a strong cross-module integration (e.g., MM ↔ FI through `BAPI_ACC_DOC_POST`), the analyst MAY annotate via `sap-{module}-consultant` (Opus 4.7) for the boundary section only. NOT a default dispatch — costs additional context only when warranted.8485SAP MCP permission prompts are auto-approved by the sc4sap permission-approver PreToolUse hook.86</Agent_Composition>8788<Language_Policy>89**Output language is user-selected at Step 1** (bundled `AskUserQuestion`, see `workflow.md` Step 1-6b): 한국어(ko) / English(en) / 日本語(ja) / Other. The first option = detected conversation language, labeled `(Recommended)` — so one Enter keeps today's behavior.90- The selection applies to the process document AND the BPML (labels + row content), in every output format.91- BPML sheet naming: sheet 1 (overview) is localized (개요/Overview/概要); **sheet 2 is always English `BPML`** — never localized.92- Languages outside ko/en/ja: builder falls back to en labels unless `meta.labels` overrides are supplied (see `bpml-render.md`).93</Language_Policy>9495<Output_Location>96Output formats are a Step 1 multi-select (`formats` ⊆ Markdown / HTML / Excel):9798`.sc4sap/processes/<MODULE>/<PACKAGE>/process-<YYYYMMDD>-<lang>.md` and/or `.html` (the process document has no Excel form — an Excel-only selection keeps its `.md`)99`.sc4sap/processes/<MODULE>/<PACKAGE>/bpml-<YYYYMMDD>-<lang>.xlsx` / `.md` / `.html` (one per selected format)100101HTML = the matching `.md` converted by `scripts/spec/md-to-html.mjs` (images inlined; Mermaid via CDN when opened online).102103- `<MODULE>` = uppercase module key (SD, MM, FI, CO, PP, PM, QM, WM, TM, TR, HCM, BW, PS, Ariba)104- `<PACKAGE>` = uppercase package name105- `<YYYYMMDD>` = generation date106- `<lang>` = ISO 639-1 selected at Step 1 (`ko` / `en` / `ja` / other)107- Existing file at the same path → overwrite WITH a one-line `> Regenerated from <old-date>` note at the top (md, carried into html; xlsx overwrites silently).108</Output_Location>109110<MCP_Tools_Used>111- Discovery: `GetPackage`, `GetPackageContents`, `GetPackageTree`, `GetObjectsByType`, `SearchObject`112- Entry-point detection: `SearchObject(objectType='TRAN')`, `GetTransaction`113- Object detail: `GetProgram`, `GetProgFullCode`, `GetFunctionGroup`, `GetFunctionModule`, `GetClass`, `GetInterface`, `GetInclude`114- Structural metadata: `GetIncludesList`, `GetScreensList`, `GetGuiStatusList`115- Reference graph: `GetWhereUsed`116- DDIC (read-only): `GetTable`, `GetStructure`, `GetDataElement`, `GetDomain`, `GetView`117- Semantic / AST: `GetAbapSemanticAnalysis`, `GetAbapAST` (Step 5 only, on demand)118- Object info: `GetObjectInfo`, `GetObjectStructure`119- **NEVER used by this skill**: `GetTableContents`, `GetSqlQuery` (no row data — DDIC + source + relations only)120</MCP_Tools_Used>121122<Data_Extraction_Safety>123This skill reads **source code + DDIC metadata + where-used + transaction metadata** only. It MUST NOT call `GetTableContents` or `GetSqlQuery`. If the user asks for sample row data to illustrate a flow, refuse per [`../../common/data-extraction-policy.md`](../../common/data-extraction-policy.md) and document the request in the report's `Open Questions` section instead.124</Data_Extraction_Safety>125126<Related_Skills>127- `/sc4sap:analyze-cbo-obj` — produces the `inventory.json` this skill consumes (auto-chained in Step 2 if missing)128- `/sc4sap:program-to-spec` — drill into ONE program inside the process (vertical depth)129- `/sc4sap:compare-programs` — when 2+ programs in the same process look similar, compare side-by-side130- `/sc4sap:ask-consultant` — open follow-ups documented in the `Open Questions` section131</Related_Skills>132133<Execution_Summary>1341. Load companion files (`workflow.md`, `grouping-heuristics.md`, `document-template.md`, `dispatch-stocker.md`, `dispatch-analyst.md`, `dispatch-writer.md`).1352. Execute the 7 steps in `workflow.md` in order; print the progress bar at each Step entry per § Progress Reporting.1363. Render the artifact using `document-template.md`.137138Do not skip the companion-file reads — the step order, grouping dictionary, output skeleton, and dispatch prompts all live there.139</Execution_Summary>140141Task: {{ARGUMENTS}}