vsadov/satori/add-new-jit-ee-api
Claude Code and agent skill by vsadov/satori
- community
Checking that the SKILL.md file is still in the repository.
Add a new API to the JIT-VM (aka JIT-EE) interface in the codebase.
Install
npx vskill@latest install vsadov/satori/add-new-jit-ee-apiSKILL.md
JIT-EE Interface extension
1 — Goal
Implement one new JIT-VM (also known as JIT-EE) API and all supporting glue. The JIT-VM interface defines the APIs through which the JIT compiler communicates with the runtime (VM).
2 — Required user inputs
Ask the user for a C-like signature of the new API if it's not provided. Suggest <repo_root>/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt file as a reference. Example:
3 — Implementation steps (must be completed in order)
NOTE: When inserting new entries/methods into any of the files below, their position and ordering does not matter. Any suggested placement (e.g. "at the end" or "near similar signatures") is just a convenient default, not a requirement.
- Update the
ThunkInput.txtfile with the new API definition. Example:
Insert the new API definition without removing any existing entries, placing it near similar signatures.
- Invoke
<repo_root>/src/coreclr/tools/Common/JitInterface/ThunkGenerator/gen.shscript
(or <repo_root>/src/coreclr/tools/Common/JitInterface/ThunkGenerator/gen.bat on Windows) to update auto-generated files. Use the correct directory for the script to run.
- Open
<repo_root>/src/coreclr/inc/corinfo.hand add the new API insideclass ICorStaticInfoclass as the last member. Example:
- Open
<repo_root>/src/coreclr/tools/Common/JitInterface/CorInfoImpl.csand add the new API in the end ofclass CorInfoImplclass declaration. Use<repo_root>/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.csto inspect how type parameters look like for C# for the newly added API since it is expected to be auto-generated there by the gen.sh(bat) script. Example:
Implement the API if asked, leave the NotImplementedException() otherwise.
- Open
<repo_root>/src/coreclr/vm/jitinterface.cppand add a dummy implementation at the file's end. Example:
Implement the API if asked, leave the UNREACHABLE() otherwise.
- Now implement the most complex part - SuperPMI. SuperPMI acts as a (de)serializer for JIT-VM queries in order
to then replay them without the actual VM to speed up jit-diffs and other scenarios. All parameters and return values recorded/restored using special primitve types and helpers. We need to update the following files:
<repo_root>/src/coreclr/tools/superpmi/superpmi-shared/agnostic.h:<repo_root>/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h:<repo_root>/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h:<repo_root>/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp:
Go through each of them one by one.
<repo_root>/src/coreclr/tools/superpmi/superpmi-shared/agnostic.h:
Define two Agnostic_* types for input arguments and another one for output parameters (return value, output arguments). Do not create them if one of the generics ones can be re-used such as DLD, DD, DLDL, etc. Use DWORD* like types for integers. Inspect the whole file to see how other APIs are defined.
<repo_root>/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h:
Add a new entry to the LWM list. Example:
NOTE: Use upper-case for the first letter of the API name here. Add the new record after the very last LWM one.
<repo_root>/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h:
Define 3 methods in this header file inside class MethodContext class (at the end of its definition).
The methods are prefixed with rec* (record), dmp* (dump to console) and rep* (replay). Example
Now add a new element to enum mcPackets enum in the same file. Example:
<repo_root>/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp:
Add the implementation of the 3 methods to methodcontext.cpp at the end of it. Consider other similar methods in the file for reference. Do not change implementations of other methods in the file. Example:
- Add a new function to
<repo_root>/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cppthat calls therep*method. Example:
- Add a new function to
<repo_root>/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cppthat calls therec*method. Example:
4 — Definition of Done (self-check list)
- [ ] New API present in all layers.
- [ ] Each source file changed exactly once; no unrelated edits. The following files must be changed:
<repo_root>/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt<repo_root>/src/coreclr/inc/corinfo.h<repo_root>/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs<repo_root>/src/coreclr/vm/jitinterface.cpp<repo_root>/src/coreclr/tools/superpmi/superpmi-shared/agnostic.h[optional - only if new types are needed]<repo_root>/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h<repo_root>/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h<repo_root>/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp<repo_root>/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp<repo_root>/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp- [ ] All TODO/UNREACHABLE markers remain for future functional implementation.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/add-new-jit-ee-api/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/vsadov/satori/add-new-jit-ee-api)