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

sap-router-skill

AGENTS.md1 starsChanged 4 months agoMITView on GitHub

89 skills mirrored across 4 IDEs — same SKILL.md content in each. All skills auto-trigger by file context and keyword. See SKILL.md for master dispatch. 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: Capability routing is fail-closed: Before selecting an SAP skill or MCP for a task that is not an exact static route, query the repository-owned…

The file

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

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before selecting an SAP skill or MCP for a task that is not an exact static route, query the repository-owned catalog.

    line 30
  2. Very specific:

    Use the highest relevant enabled/reviewed result.

    line 39
  3. Very specific:

    All bundled code lives under bundled/.

    line 41
  4. Very specific:

    Do NOT prefix commands that are interactive, or those specified in exclude_commands (e.g., curl, playwright).

    line 140
  5. Very specific:

    Use rtk gain to check token savings and rtk discover to find optimization opportunities.

    line 141
  6. Very specific:

    Think in Code: Always write short scripts to analyze large outputs instead of reading raw files into context.

    line 144
  7. Very specific:

    Sandbox Execution: Use ctx_execute or ctx_batch_execute to execute any tool calls that generate large outputs (like python …

    line 145
  8. Very specific:

    Fetch Hardening: Use ctx_fetch_and_index instead of curl/wget to index URLs into SQLite and search them via ctx_search.

    line 146
  9. Very specific:

    Session Continuity: Use ctx_checkpoint to save session state, and ctx_restore to restore the state when the conversation is compacted.

    line 147

≈ “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 — Multi-IDE Agent Instructions

89 skills mirrored across 4 IDEs — same SKILL.md content in each.

All skills auto-trigger by file context and keyword. See SKILL.md for master dispatch.

Implemented v6 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

Dynamic local asset discovery

Before selecting an SAP skill or MCP for a task that is not an exact static route, query the repository-owned catalog. The search ranks canonical skills, reviewed MCPs, and bundled snapshots together:

python scripts/source_catalog.py search "task description"
python scripts/mcp_launcher.py search --query "task description"

Use the highest relevant enabled/reviewed result. A bundled MCP with status disabled_candidate is evidence for review, never authorization to execute it. All bundled code lives under bundled/; routing does not fetch GitHub at runtime.

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.

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.

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.

RTK and Context Mode Optimization Rules (MANDATORY)

To keep token consumption low (saving 60-90% on terminal commands and 98% on tool outputs):

RTK (Rust Token Killer) Rules

  1. Always prefix CLI/shell commands with rtk in powershell/bash sessions (e.g., rtk git status, rtk cargo test, rtk npm install).
  2. Do NOT prefix commands that are interactive, or those specified in exclude_commands (e.g., curl, playwright).
  3. Use rtk gain to check token savings and rtk discover to find optimization opportunities.

Context Mode Rules

  1. Think in Code: Always write short scripts to analyze large outputs instead of reading raw files into context. Use ctx_execute (or ctx_execute_file) to execute scripts and print only the final answer.
  2. Sandbox Execution: Use ctx_execute or ctx_batch_execute to execute any tool calls that generate large outputs (like python scripts/healthcheck.py or ADT/RAG searches) to reduce raw output size by 98%.
  3. Fetch Hardening: Use ctx_fetch_and_index instead of curl/wget to index URLs into SQLite and search them via ctx_search.
  4. Session Continuity: Use ctx_checkpoint to save session state, and ctx_restore to restore the state when the conversation is compacted.

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.