agentleFS
williamcorrea23williamcorrea23/sap-router-skill/AGENTS.md

sap-router-skill

AGENTS.md1 starsChanged 4 months agoMITView on GitHub

Canonical source: .agents/. Karpathy wrapper: mandatory. Caveman compression: default. Do not copy or fork skill bodies here; regenerate from canonical source. Runtime root: - SAP_ROUTER_ROOT must point to the canonical sap-router-skill repository. - change the working directory to SAP_ROUTER_ROOT before relative commands. - fail closed if scripts/source_catalog.py is not present there. Dynamic local discovery: - search skills: python scripts/source_catalog.py search "task description" - search MCPs: python scripts/mcp_launcher.py search --query "task description" - bundled MCPs are disabled candidates until reviewed; no…

  • Reads credentials
  • Installs packages

The file

We split this AGENTS.md into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not copy or fork skill bodies here.

    line 5
  2. Very specific:

    prefer rtk for supported verbose CLI commands.

    line 18
  3. Distinctive:

    use Context Mode for large outputs, indexed fetches, and session checkpoints.

    line 19

≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

SAP Router Skill for Codex

Canonical source: .agents/. Karpathy wrapper: mandatory. Caveman compression: default. Do not copy or fork skill bodies here; regenerate from canonical source.

Runtime root:

  • SAP_ROUTER_ROOT must point to the canonical sap-router-skill repository.
  • change the working directory to SAP_ROUTER_ROOT before relative commands.
  • fail closed if scripts/source_catalog.py is not present there.

Dynamic local discovery:

  • search skills: python scripts/source_catalog.py search "task description"
  • search MCPs: python scripts/mcp_launcher.py search --query "task description"
  • bundled MCPs are disabled candidates until reviewed; no runtime GitHub lookup.

Local optimization:

  • prefer rtk for supported verbose CLI commands.
  • use Context Mode for large outputs, indexed fetches, and session checkpoints.

Parity proof:

  • skills: 203 sha256:046f6d52886520160ec0c76373806fd76f42ea8b489ebbe57b54e61fd29919fd
  • profiles: 38 sha256:e746d5f5374f567c00e178b16645e378521476723efc61383bdc562f25d9c827
  • registries: 14 sha256:e98ac633c7685dfb67cb878c1ae16833b0dcfccac5865035f5862c5fde42caf5

Run: python scripts/generate_ide_assets.py check

--- project-doc ---

SAP Router Skill & Harness — Multi-IDE Agent Instructions

203 canonical skills available across Claude, Codex, Gemini Antigravity, and Cursor.

IDESkill DirectoryEntry Point
Claude Code.claude/skills/ (203 generated skills).claude/skills/run-sap-router-skill/SKILL.md
Antigravity (Gemini).gemini/skills/ (203 generated skills).gemini/skills/run-sap-router-skill/SKILL.md
Codex / OpenAI.codex/AGENTS.md (shared canonical instructions).codex/AGENTS.md
Cursor.cursor/AGENTS.md (shared canonical instructions).cursor/AGENTS.md

All skills auto-trigger by file context and keyword. See SKILL.md for master dispatch. Current (v7.1.0): sap_harness.py (controlled agent execution + eval suite) + ZROUTER Remote FileSystem adapter + Automation Pilot & Skill-Share pipelines.

SAP Harness v7.1 (Controlled Multi-Agent & Eval Engine)

# Autonomous mission execution
python scripts/sap_harness.py run --agent cpi --task "triage failed messages in CPI"

# Evaluation & Benchmark test suite (Offline Hermetic by default)
python scripts/sap_harness.py eval --suite all
python scripts/sap_harness.py benchmark

# Specialized subagent directory
python scripts/sap_harness.py agents

# Test ZROUTER Remote FileSystem integration (for vscode_abap_remote_fs)
python scripts/sap_harness.py test-remote-fs

# Automation Pilot MCP compiler & Skill packager
python scripts/automation_pilot_compiler.py --catalog cf --command ListCfOrgs
python scripts/skill_packager.py sap-cpi-flowpilot --slack-json

Implemented v7 operating model

Canonical source is .agents/skills plus .agents/registries/mcp-capabilities.json. Claude and Gemini skill trees are generated mirrors; Codex and Cursor reuse .agents/skills through AGENTS/rules/agent assets instead of maintaining duplicate skill trees.

Generate/check IDE assets:

python scripts/generate_ide_assets.py generate --targets all
python scripts/generate_ide_assets.py check

Capability routing is fail-closed:

python scripts/validate_catalog.py --strict
python scripts/mcp_launcher.py list --capability sap.cpi.message.read
python scripts/mcp_launcher.py list --capability sap.apim.proxy.read

CPI/APIM/Fiori/UI5/CAP now route through API/CLI/plugin MCPs first and use Web UI MCP fallbacks (integration-suite-ui-mcp, apim-ui-mcp) only when background access is blocked. The Web UI bridge uses the logged-in browser session and does not accept credential values.

apim-ui-mcp carries two API Management channels and reports which one each call used. OAuth client_credentials on an apiportal-apiaccess service key is SAP's documented path and wins whenever it is configured; the logged-in browser session is an undocumented fallback for reads and tests, running fetch() inside the page so cookies never leave the browser. Scope is API lifecycle only — proxies, products, policies, key value maps and their tests — never business data; SAP API Policy v.4.2026a §2.2.2 points agentic business-API access at the Integration Suite MCP Gateway instead, which apim_mcp_gateway_probe checks the tenant for.

Mutating capabilities use plan/approval/commit semantics. Local approval state is handled by:

python scripts/approval_broker.py plan --capability sap.apim.proxy.deploy --target DEV

What this project is

40 Python operational scripts plus Node.js review gates — no live SAP system required credentials required. Everything runs offline:

ScriptPurpose
scripts/sap_router.pyRouting engine: ADT-first; SAP GUI scripting fallback (mcp-sap-gui); sf-mcp; ZROUTER RFC opt-in
scripts/memory_manager.pySession context file (MEMORY.md) lifecycle
scripts/xls_to_bapi.pyCSV/XLSX → BAPI JSON payload converter
scripts/template_repo.pyOffline ABAP template repository with {{placeholders}}
scripts/abap_serializer.pyMulti-format ABAP packer: .nugg, abapGit, ZDOWNLOAD XML
scripts/cpi_iflow_packager.pyCPI iFlow ZIP create/validate/extract
scripts/fallback_engine.py6-tier cascading fallback with retry, verification, 36 mapped actions
scripts/healthcheck.pyProbes 12 configured MCPs (+70 fail-closed planned candidates), validates .env, generates interactive prompts
scripts/self_learn.pyHermes-style context adaptation — tracks MCP latency/reliability, adapts routing
scripts/zrouter_bootstrap.pyZROUTER probe + install (ADT/GUI/Offline) + fallback mapping
scripts/btp_diagram.pyBTP architecture diagram generator from skill references
scripts/check_gui_scripting.pySAP GUI scripting readiness probe (RZ11 + SAPLogon check)
scripts/hdi_lint.pySAP HANA HDI container linting and validation
scripts/cpi_client.pyCPI iFlow HTTP client with OAuth and CSRF support
scripts/rag_ingest.pyRAG ingestion pipeline for SAP documentation indexing

Run / verify

python .claude/skills/run-sap-router-skill/driver.py
# Exit 0 = all 78 checks passed. No project files modified.

Requires Python 3.11+ for the router and controlled harness. No packages needed for CSV; pip install openpyxl for XLSX support only.

Routing rules (v4.2.0 — ADT-first, GUI-fallback, caveman-optimized)

Decision tree:

  1. CAVEMAN DELEGATION? (fix/find/review, 1-2 files) → cavecrew-investigator/builder/reviewer
  2. ADT AVAILABLE? (read_source, search, activate...) → ARC-1 / aibap / mcp-abap-adt
  3. GUI FALLBACK? (SPRO, SM30, SU01, MM01, VA01...) → mcp-sap-gui (25 transactions)
  4. FUNCTIONAL WRITE? (BAPI batch) → needs explicit --functional context (else needs-functional-context, NO BAPI fired); then BAPI-first / SAP GUI dispatch. ZROUTER RFC only if opted in (zrouter accept).
  5. SPEC→PIPELINE? → sap_router.py pipeline (8 stages)
  6. LLM / RAG? (prompt optimization, doc retrieval) → sap-llm-engineering skill + RAG routing (Pinecone, Supabase pgvector, Azure AI Search)
Action containsDestination
fix, edit, rename, typocavecrew-builder (1-2 files only)
find, search, locate, where iscavecrew-investigator (60% token savings)
review, audit, code reviewcavecrew-reviewer (severity-tagged)
code_search, read_source, syntax_check, where_used, get_depsARC-1 ADT
sf_* prefixsf-mcp (OData)
SPRO, SM30, SU01, PFCG, MM01, VA01, FB01, etc.SAP GUI Scripting (mcp-sap-gui)
pipeline, spec, implement specificationsap_router.py pipeline → 8 stages
anything elseSAP GUI scripting (mcp-sap-gui) default

Memory session commands

python scripts/memory_manager.py init   --input MEMORY.md --sys S4H --client 100 --env DEV --usr DEVELOPER
python scripts/memory_manager.py add    --input MEMORY.md --module MM --action-name CreateMaterial --status OK
python scripts/memory_manager.py verify --input MEMORY.md
python scripts/memory_manager.py compact --input MEMORY.md

Caps: 20 active blocks max, 100 lines total. Older blocks auto-archive.

XLS converter commands

python scripts/xls_to_bapi.py template --output tmpl.csv --module MM --action CREATE_MATERIAL
python scripts/xls_to_bapi.py convert  --input data.csv  --module MM --action CREATE_MATERIAL

Action-to-BAPI mapping (29 actions / 9 modules)

ModuleActionBackground BAPI/FMBAPI Params
MMCREATE_MATERIALBAPI_MATERIAL_SAVEDATABAPIMATHEAD + MARA/MARAX + MARC/MARCX + MAKT table
MMGET_MATERIALBAPI_MATERIAL_GETALLMATNR → data + return
MMCREATE_POBAPI_PO_CREATE1BAPIMEPOHEADER/X + ITEM/X + ACCOUNT + COND
MMCHANGE_POBAPI_PO_CHANGEBAPIMEPOHEADER/X + ITEM/X + POSCHEDULE
SDCREATE_ORDERBAPI_SALESORDER_CREATEFROMDAT2BAPISDHD1/X + ORDER_ITEMS_IN + PARTNERS + SCHEDULES
SDCHANGE_ORDERBAPI_SALESORDER_CHANGESALESDOCUMENT + ORDER_HEADER_IN/X + ITEM/X
SDCREATE_INVOICEBAPI_BILLINGDOC_CREATEMULTIPLEBILLINGDATAIN (BAPIVBRK) + CONDITIONDATAIN
SDCREATE_DELIVERYBAPI_OUTB_DELIVERY_CREATE_SLSSALES_ORDER_ITEMS + SHIP_POINT
FIPOST_DOCUMENTBAPI_ACC_DOCUMENT_POSTBAPIACHE09 + ACCOUNTGL + ACCOUNTPAYABLE + ACCOUNTRECEIVABLE + ACCOUNTTAX
FICHECK_ACCOUNTSBAPI_GL_GETACCOUNTSALDOACCOUNT + COMP_CODE + FISCAL_YEAR
FIREVERSE_DOCUMENTBAPI_ACC_DOCUMENT_REV_POSTBAPIACREV (OBJ_KEY + COMP_CODE + REASON_REV)
QMCREATE_INSPECTIONCO_QM_INSPECTION_LOT_CREATEI_MATERIAL + I_WERK + I_INSP_TYPE
QMRECORD_RESULTSBAPI_INSPOPER_RECORDRESULTSINSPLOT + INSPOPER + CHAR_RESULTS table
PPCREATE_ORDERBAPI_PRODORD_CREATEORDERDATA (BAPI_PP_ORDER_CREATE)
PPCONFIRM_ORDERBAPI_PRODORDCONF_CREATE_TTTIMETICKETS table (BAPI_PP_TIMETICKET)
PPREAD_BOMCS_BOM_EXPL_MAT_V2MATNR + WERKS + CAPID → STB table
PPREAD_ROUTINGBAPI_ROUTING_GETDETAILMATERIAL + PLANT + ROUTING_GROUP
WMGOODS_MOVEMENTBAPI_GOODSMVT_CREATEGM_HEAD_01 + GM_CODE + GM_ITEM_CREATE table
WMCREATE_TOL_TO_CREATE_SINGLEI_LGNUM + I_BWLVS + I_MATNR + source/dest bins
COCREATE_INTERNAL_ORDERBAPI_INTERNALORDER_CREATEI_MASTER_DATA (BAPI2075_7)
COACTIVITY_ALLOCBAPI_CO_ALLOCACTUALSCONTROLLINGAREA + sender/receiver
HCMREAD_EMPLOYEEBAPI_EMPLOYEE_GETDATAEMPLOYEE_ID + INFOTYPE
HCMCREATE_INFOTYPEBAPI_EMPLOYEE_ENQUEUE + PA_INFOTYPE_INSERTEMPLOYEE_ID + INFOTYPE + subtype + dates
BASISCREATE_REQUESTTR_INSERT_REQUEST_WITH_TASKSIV_TYPE + IV_TEXT → EV_REQUEST
BASISRELEASE_REQUESTTR_RELEASE_REQUESTIV_TRKORR
BASISST22_SCANSELECT FROM SNAPSNAP.DATUM range filter
BASISCODE_ANALYSISTRINT_INSPECT_OBJECTSIV_MODE + IT_E071 objects table
BASISCODE_SEARCHZCL_ADCOSET_SEARCH_ENGINEquery + mode (STRING/REGEX/PCRE) + object_type + package + max_results
BASISCODE_SEARCH_STATSZCL_ADCOSET_SEARCH_ENGINEpackage + owner → counts per object type
BASISCODE_SEARCH_ADTZCL_ADCOSET_SEARCH_ENGINE + ADT URIsSame as CODE_SEARCH + build_adt_uri for each hit

Functional WRITE actions need explicit --functional context (else needs-functional-context, no BAPI fired); they then dispatch BAPI-first / SAP GUI. ZROUTER RFC is opt-in only (zrouter accept) — never the default. ADT ops and code_search → ARC-1 ADT. sf_* → sf-mcp.

Template repository commands

python scripts/template_repo.py init                                                  # Create blank repo
python scripts/template_repo.py seed                                                  # Populate 12 starter templates
python scripts/template_repo.py list                                                  # List all templates
python scripts/template_repo.py add --file template.abap --module MM --action FOO     # Import from ABAP file
python scripts/template_repo.py resolve --template MM_CREATE_MATERIAL --values '{"HEADER":"h"}'  # Substitute placeholders
python scripts/template_repo.py export --template MM_CREATE_MATERIAL --format json    # Export for abapGit/nugget

ABAP serializer commands

python scripts/abap_serializer.py generate --source file.abap --name ZCL_FOO --type CLAS --format nugg --output out/
python scripts/abap_serializer.py generate --source file.abap --name ZCL_FOO --type CLAS --format abapgit --output out/
python scripts/abap_serializer.py package  --source file.abap --name ZCL_FOO --type CLAS --output out/  # All 3 formats
python scripts/abap_serializer.py extract  --input file.nugg --output out/
python scripts/abap_serializer.py split    --source multi_class.abap --output out/
python scripts/abap_serializer.py list-formats

ZROUTER_DISPATCH v2 additions

  • zcl_zrouter_handler_abstract=>evaluate_expression uses GENERATE SUBROUTINE POOL + PERFORM for dynamic ABAP expression evaluation at runtime. Available in all handler subclasses.
  • templates/ZCL_ABAP_REPL_V2.abap — improved SICF REPL with /UI2/CL_JSON, optional X-API-KEY, CSRF header check, mode: "expr" for lightweight GENERATE SUBROUTINE POOL eval vs mode: "full" for WRITE-capturing SUBMIT.

Key gotchas

  • Template row 2 = field descriptions — not valid data row. Replace before converting.
  • memory_manager add auto-inits a missing MEMORY.md silently with defaults.
  • route is a classifier, not a validator — unknown actions fall to SAP GUI scripting. Functional writes are gated on --functional. ZROUTER is opt-in, never the default.
  • template_repo.py works offline — resolves placeholders via Python string substitution. ABAP runtime eval uses GENERATE SUBROUTINE POOL (see ZROUTER_DISPATCH v2).
  • abap_serializer.py _class_to_type auto-detects from name prefix: ZCL_→CLAS, ZIF_→INTF, ZCX_→CLAS, other Z*→PROG. Use explicit --type to override.

@RTK.md

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.