script-execute

Compile and execute C# code dynamically using Roslyn at runtime.

1|Updated Jan 26, 2026
One-click install
npx skills add https://github.com/lightvu25/Echoes --skill script-execute-lightvu25
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: script-execute
Source: https://github.com/lightvu25/Echoes/tree/main/SKILLS/script-execute
Command: npx skills add https://github.com/lightvu25/Echoes --skill script-execute-lightvu25

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enables on-demand compilation and execution of C# code using Roslyn, allowing you to run arbitrary code by supplying a class with a static method and invoking it at runtime.

Core Features & Use Cases

  • Compile and execute C# code dynamically at runtime using Roslyn.
  • Enforce the requirement that code defines a class with a static method, enabling quick testing of logic.
  • Use cases include prototyping algorithms, validating small code blocks, and teaching Roslyn-based code execution.

Quick Start

Provide a C# code snippet that defines a public class with a static method and call it via the tool to obtain the result.

Frequently Asked Questions about script-execute

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I dynamically compile and execute C# code at runtime?

You can dynamically compile and execute C# code at runtime using Roslyn by providing a code snippet wrapped in a public class with a static method, then invoking it with optional parameters.

How do I use Roslyn to run a one-shot C# code block for rapid prototyping?

To run a one-shot C# code block for rapid prototyping with Roslyn, supply your logic inside a public class with a static method, then pass the code, class name, method name, and parameters for execution.

Does Roslyn dynamic execution require a specific class structure for the code?

Yes, Roslyn dynamic execution requires the code to be wrapped in a public class containing a static method to properly compile and invoke the logic at runtime.

Can I pass parameters to a dynamically executed C# method using Roslyn?

Yes, you can pass parameters to a dynamically executed C# method using Roslyn by providing optional className, methodName, and parameters inputs alongside the code block.

What is the best way to validate small C# code blocks during development?

Validating small C# code blocks during development is best done by dynamically compiling and executing the logic with Roslyn, allowing quick testing of algorithms without a full deployment.

When should I not use dynamic C# compilation for code execution?

You should avoid using dynamic C# compilation for code execution in production environments, as it is specifically intended for rapid testing, prototyping, and validating logic in development scenarios.