跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
开发与测试

abap-code-review

Performs structured pre-release security and quality review of SAP ABAP programs across 9 dimensions (SEC, AUTH, DATA, PERF, STD, INTERFACE, CHANGE, COMP, FUNC), producing a formal sign-off-ready Markdown assessment report. Trigger when the user asks to review, audit, assess, or check ABAP code before release — phrases include: 'security review', 'risk check', 'release audit', 'code review', 'check before transport', 'safe to release', or 'can this go to production'; also when a program name (e.g. ZMMR0002) appears alongside 'review', 'check', or 'ready for transport'. Do not use for general ABAP syntax questions, runtime debugging, or performance tuning unrelated to a transport release gate.

shrek-abaper · 已有静态检查记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add shrek-abaper/sap-engineering-skill --skill abap-code-review

技能说明


name: abap-code-review description: "Performs structured pre-release security and quality review of SAP ABAP programs across 9 dimensions (SEC, AUTH, DATA, PERF, STD, INTERFACE, CHANGE, COMP, FUNC), producing a formal sign-off-ready Markdown assessment report. Trigger when the user asks to review, audit, assess, or check ABAP code before release — phrases include: 'security review', 'risk check', 'release audit', 'code review', 'check before transport', 'safe to release', or 'can this go to production'; also when a program name (e.g. ZMMR0002) appears alongside 'review', 'check', or 'ready for transport'. Do not use for general ABAP syntax questions, runtime debugging, or performance tuning unrelated to a transport release gate." metadata: version: "1.0.0" type: docs valid_until: "evergreen" source_urls: - "https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md" - "https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm" output_schema: format: text description: "Markdown report; filename ABAP_REVIEW_[PROGRAM_NAME]_[YYYYMMDD].md saved to user-specified reports/ directory, or output inline if file write is unavailable" permissions: read_paths: ["<skill_dir>/references/"] write_paths: [""] network_endpoints: [] requires_elevation: false accesses_env_vars: []

ABAP Code Review Skill

Performs pre-release security and quality assessment of SAP ABAP programs, producing a formal Markdown report ready for sign-off and circulation.

Invocation

Any message matching the description above will load this skill. A complete invocation with full context:

Review program [PROGRAM_NAME] for release.
Transport: [DEVKXXXXXX], Change description: [one-line business purpose].
Save the report to the reports/ directory.

To include functional completeness checks ([FUNC] dimension), provide the requirements document path or describe the requirements in the conversation.


Step 0 — Load References First

Before reading any ABAP source code, load the following two files in order. Do not load any other files from the references/ directory:

  1. references/REF_ABAP_SECURITY.md — Authority reference for [SEC], [AUTH], and [INTERFACE] dimensions
  2. references/REF_CLEAN_ABAP.md — Authority reference for the [STD] dimension

Every [SEC] / [AUTH] / [STD] finding must cite the corresponding rule ID (e.g. SEC-SQL-1, [E-2]). Findings without a rule ID citation are invalid and must be removed.

If reference files are not accessible (e.g., the agent cannot read from the skill directory): proceed using built-in ABAP knowledge. Record under Scope Limitations that reference files were unavailable; rule IDs must still be cited in findings.


Step 1 — Read Source Code

Retrieve the complete source code of the target program using the appropriate method for your environment:

  • Tool-equipped agents: Use the available ABAP source-reading capability (ABAP CLI tool, ADT API, MCP tool, or equivalent) to programmatically read the main program and all INCLUDEs.
  • Conversation-based agents / manual sessions: Ask the user to paste the source code directly into the conversation, specifying which INCLUDEs, class methods, or function modules are in scope.
Object TypeScope to Read
REPORTMain program + all INCLUDEs
Global ClassClass definition + all METHOD implementations
Function ModuleTarget FM + other FMs in the same function group
Enhancement / BAdIEnhancement Spot definition + all active implementations

Reading order: main program / class definition → INCLUDEs (in order of appearance) → METHODs (one by one).

Objects that cannot be retrieved: record in the report under Scope Limitations, mark as "unreviewed", and do not assume they are safe.


Step 2 — Analyze (9 Dimensions)

Complete all 9 dimensions in the order listed below. No dimension may be skipped (if no issues are found, state "No issues found").

[SEC] Security Vulnerabilities

Reference: REF_ABAP_SECURITY.md. Scan by priority:

Priority 1 (scan immediately):
  EXEC SQL                    → SEC-SQL-2
  GENERATE SUBROUTINE POOL    → SEC-CODE-1
  INSERT REPORT               → SEC-CODE-2
  CALL 'SYSTEM' / SXPG_*     → SEC-OS-1/2/3
  WHERE ( <variable> )        → SEC-SQL-1
  DESTINATION ( <variable> )  → SEC-RFC-1

Priority 2 (important checks):
  cl_sql_statement            → verify set_param parameterization is used
  OPEN DATASET                → path source + SY-SUBRC check
  CALL FUNCTION DESTINATION   → RFC destination source
  literals containing password/key/token → SEC-CRED-1

[AUTH] Authorization & Access Control

Reference: REF_ABAP_SECURITY.md → AUTH-MISS-, AUTH-BYP-

High-risk tables (AUTHORITY-CHECK required before read/write): BKPF/BSEG, MKPF/MSEG, VBAK/VBAP, EKKO/EKPO, PA*/HRP*

Check: ① AUTHORITY-CHECK present before sensitive table operations → ② SY-SUBRC checked immediately after → ③ no SY-UNAME hardcoded bypass → ④ RFC FMs have authorization checks

Special rule: Any HIGH finding in [SEC] or [AUTH] is treated as CRITICAL for the release decision (NO-GO).

[DATA] Data Integrity & Exception Handling

Reference: REF_CLEAN_ABAP.md [E-2] [E-3]

Check: SY-SUBRC after CALL FUNCTION → SY-SUBRC after READ TABLE / SELECT SINGLE → SY-SUBRC after OPEN DATASET → ENQUEUE lock before write operations → COMMIT WORK not inside a loop → ROLLBACK WORK on error paths → no empty CATCH blocks that swallow exceptions

[PERF] Performance Risks

Reference: REF_CLEAN_ABAP.md [T-1] [T-2] [T-3]

Check: SELECT inside LOOP (→ [T-2], CRITICAL for large tables) → SELECT * without projection (→ [T-3]) → full table scan (no WHERE clause) → READ TABLE WITH KEY inside LOOP (→ [T-1], switch to SORTED/HASHED) → high-volume tables (BKPF/BSEG/MKPF/MSEG) without row-count protection

[STD] ABAP Code Standards

Reference:

阅读完整来源 ↗