ABAP AI Kit: make Claude, Copilot and Codex write ABAP like a senior SAP developer
Ask an AI assistant for an ABAP method and you get code that compiles. Then the review starts. A SELECT on MARA in a classic package activates without a warning, and quietly makes your extension clean core level C. There is no AUTHORITY-CHECK, sy-subrc is read after a functional call, there is no unit test, and the syntax does not exist on the 7.40 system the code has to run on. In an ABAP Cloud package the compiler stops the worst of it, and the assistant spends rounds guessing which released API to use instead. The model knows ABAP. It does not know your standards, your release, or when to stop and ask.
We wrote those standards down once, in a form the assistants actually follow, and published them as open source: the ABAP AI Kit. It works with Claude Code, GitHub Copilot and Codex.
What changes when the kit is installed
| Situation | What the assistant does with the kit |
|---|---|
| New code on S/4HANA 2022 or newer | Writes ABAP for Cloud Development and checks every SAP object it uses against SAP's list of released APIs; classic objects only through a documented wrapper |
It wants to read MARA |
Finds out that MARA is clean core level C and uses the released successor I_PRODUCT |
| The target system is 7.40 | Writes 7.40 syntax: no ENUM, no RAISE EXCEPTION NEW |
| A change is "done" | Only with ABAP Unit tests, test doubles for database, RFC and HTTP, checks green with real counts, and an independent review |
| You ask for a review | Findings ranked blocker, should fix and nit, each with file, line and a concrete failure scenario |
| You build a Fiori app | Fiori elements first, annotations in the backend, legacy-free UI5, UI5 linter at zero, QUnit and OPA5 tests |
| It is about to change a read-only system or release a transport | Blocked, or it asks you first, whatever the model decides |
| It is about to push a password or an internal name | Blocked before the push |
Clean core levels, looked up, not guessed
The question "can I use this object in ABAP Cloud?" has an exact answer, and SAP publishes it in the Cloudification Repository. In a classic package nobody tells you while you write the code: the syntax check and the activation pass, and the finding only shows up if you run ATC with the clean core or cloud readiness variant. The kit has a small script that reads the same data, and the assistant runs it before it uses an SAP object:
$ python scripts/abap/released-api.py MARA BAPI_USER_GET_DETAIL RFC_READ_TABLE CL_ABAP_RANDOM_INT
MARA [TABL] state=notToBeReleased -> level C (S4CORE LO-MD-MM); successor: I_PRODUCT, I_PRODUCTPROCUREMENT, ...
BAPI_USER_GET_DETAIL [FUNC] state=classicAPI -> level B (SAP_BASIS BC-SEC-USR-ADM)
RFC_READ_TABLE [FUNC] state=noAPI -> level D (SAP_BASIS BC-SEC-AIS-TOO)
CL_ABAP_RANDOM_INT [CLAS] state=released -> level A (SAP_BASIS BC-ABA-LA)
Level A is released, level D is the code you will rewrite at the next upgrade. In a classic package the assistant may still use MARA, because level C is allowed under conditions, but it does so knowingly and documents it, instead of you finding out at the upgrade or the readiness check.
"It compiles" is not done
The part that makes the biggest difference is the definition of done. When you ask for new or changed ABAP, the assistant goes through the same steps a careful developer does:
- Design behind an interface, cloud first, with released APIs.
- Code for the release of the project.
- ABAP Unit tests with test doubles: the happy path, the negative cases, and for a bug, a failing test that reproduces it first.
- Checks: syntax, ATC, abaplint, with the real counts, not "looks fine".
- Independent review: in Claude Code a separate read-only reviewer agent reads the change; in Copilot and Codex the assistant runs the same checklist itself. Blockers are fixed and the checks run again.
- Notes: what was learned and where the ticket stands.
If a step cannot be done, for example because there is no system access or the legacy code has no seams for a test double, the assistant says which step and why. It does not skip it quietly.
You talk to your assistant as usual
You do not call the kit. You write the prompt you would write anyway, and the kit decides which rules and skills apply:
- "Fix: the export dumps when the table is empty" writes a failing test first, fixes the code, shows the test passing and reviews the change.
- "Review my transport" collects the change and its goal, checks facts on the system, gets a second opinion from the reviewer agent and reports the findings by severity.
- "Make this report ABAP Cloud ready" finds the unreleased objects and proposes released replacements or a wrapper.
- "Write unit tests for ZCL_ORDER_SERVICE" extracts the seams it needs, such as an interface and constructor injection, and writes tests with
cl_abap_testdouble, or local fakes on 7.40. - "Read this spec and tell me what to build", with a Word document, converts it without the struck-through text and with the reviewers' comments, lists the objects and the open questions and maps them to tickets.
- "Write the technical documentation for this development" collects sources, transport and test results and builds the Word document on your company template.
Skills load only when the prompt matches them, so the long references, such as the full Clean ABAP guide and 37 SAP cheat sheets, cost nothing until they are needed.
Guardrails the model cannot skip
A rule in a prompt is a request. A model under pressure can decide that this one time the rule does not apply. So the sharp edges are not left to the model: in Claude Code they are hooks, small scripts that run before every tool call and can refuse it.
- Read-only SAP systems stay read-only. If a project marks the quality or production system as read-only, a write to it is blocked. Releasing a transport always asks you first.
- No secrets in Git. gitleaks runs before every push, also as a plain Git pre-push hook for Copilot and Codex. You can add the names of your employer and your customers, so they can never be pushed either.
- No
rm -rf, no edits of.envfiles, and a check for injected instructions, the realistic threat when an assistant reads web pages and tickets.
Built on SAP's own material
The rules are ours; the knowledge behind them is not invented. The kit carries SAP's Clean ABAP style guide and its code review guide in full, the SAP ABAP cheat sheets, the Cloudification Repository for clean core levels, the official UI5 documentation for legacy-free UI5, and abaplint configurations for 7.40, ABAP Cloud and Clean ABAP. Every source, its licence and the pinned version are listed in the repository, and one script shows what changed upstream.
It also works with the tools around the code: GitHub, Azure Repos and GitLab, Jira, Azure Boards and GitHub Issues, Confluence, and ADT for VS Code or an ADT-based MCP server for the SAP system itself. You log in yourself; no token goes into a file.
Install it
On Windows, two commands:
git clone https://github.com/catafeidi/abap-ai-kit D:\ai-kit
powershell -ExecutionPolicy Bypass -File D:\ai-kit\scripts\install.ps1
The script links the rules, skills, agents and hooks into Claude Code and writes the instructions for GitHub Copilot and Codex. Run it again after every git pull. If you already work with Claude Code or Copilot in agent mode, the README has prompts you can paste to install the kit and bring your existing project folder into it, without moving or deleting anything.
Then open an ABAP project and ask: "review this class", "write a unit test with a test double for this method", or "can I use MARA in ABAP Cloud?".
Where it works, and where it does not
- The installer is for Windows. A macOS and Linux installer is the first contribution we would like to see.
- The hooks that block are a Claude Code feature. Copilot and Codex get the same rules and the secret scan before a push, but not the read-only guard.
- The kit makes an assistant follow standards; it does not replace the review by a person. It makes that review shorter, because the obvious findings are gone before a colleague opens the change.
The kit fits well with our code review for SAP transports: the assistant reviews before the release, a colleague approves the pull request, and only then does the transport leave.
Try it, and help improve it
Everything is on GitHub: catafeidi/abap-ai-kit, MIT licensed, with third-party material under its own licence. Ideas, fixes and new skills are welcome: open an issue, or fork the repository and send a pull request. Good first contributions are an installer for macOS and Linux, a tested Azure DevOps or GitLab adapter, and before/after examples from real reviews.
If you want AI-assisted ABAP development set up in your own team, or need experienced ABAP developers for a project, get in touch.