{"id":42211471,"url":"https://github.com/formulahendry/agent-skill-code-runner","last_synced_at":"2026-01-27T00:49:43.048Z","repository":{"id":329550856,"uuid":"1119973877","full_name":"formulahendry/agent-skill-code-runner","owner":"formulahendry","description":"An Agent Skill that enables AI agents to run code snippets in multiple programming languages. Works with GitHub Copilot, Claude Code, and other skills-compatible agents.","archived":false,"fork":false,"pushed_at":"2025-12-21T10:50:21.000Z","size":23,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-22T14:59:31.141Z","etag":null,"topics":["agent-skills","code-runner"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/formulahendry.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-20T08:06:01.000Z","updated_at":"2025-12-22T13:32:58.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/formulahendry/agent-skill-code-runner","commit_stats":null,"previous_names":["formulahendry/agent-skill-code-runner"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/formulahendry/agent-skill-code-runner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formulahendry%2Fagent-skill-code-runner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formulahendry%2Fagent-skill-code-runner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formulahendry%2Fagent-skill-code-runner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formulahendry%2Fagent-skill-code-runner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/formulahendry","download_url":"https://codeload.github.com/formulahendry/agent-skill-code-runner/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formulahendry%2Fagent-skill-code-runner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28794013,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T21:49:50.245Z","status":"ssl_error","status_checked_at":"2026-01-26T21:48:29.455Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent-skills","code-runner"],"created_at":"2026-01-27T00:49:42.116Z","updated_at":"2026-01-27T00:49:43.042Z","avatar_url":"https://github.com/formulahendry.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Code Runner Agent Skill\r\n\r\n[![Agent Skills](https://img.shields.io/badge/Agent%20Skills-Compatible-blue)](https://agentskills.io/)\r\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\r\n\r\nAn [Agent Skill](https://agentskills.io/) that enables AI agents to run code snippets in **35+ programming languages**. Works with GitHub Copilot, Claude Code, and other skills-compatible agents.\r\n\r\n## Features\r\n\r\n- 🚀 **35+ Languages**: JavaScript, Python, TypeScript, Java, C/C++, Go, Rust, Ruby, PHP, and many more\r\n- ⚡ **Interpreted \u0026 Compiled**: Supports both interpreted languages and compiled languages (C, C++, Java, Rust)\r\n- ⏱️ **Timeout Handling**: Configurable timeout to prevent infinite loops (default: 30 seconds)\r\n- 🔧 **Cross-Platform**: Works on Windows, macOS, and Linux\r\n- 📦 **Zero Dependencies**: Pure Node.js implementation, no npm install required\r\n\r\n## Supported Languages\r\n\r\n| Category | Languages |\r\n|----------|-----------|\r\n| **Web/Scripting** | JavaScript, TypeScript, PHP, CoffeeScript |\r\n| **General Purpose** | Python, Ruby, Perl, Lua, Julia |\r\n| **Systems** | C, C++, Go, Rust, Nim, Crystal |\r\n| **JVM** | Java, Kotlin, Scala, Groovy, Clojure |\r\n| **Functional** | Haskell, F#, OCaml, Elixir, Racket, Scheme, Lisp |\r\n| **Shell** | Bash, PowerShell, Batch/CMD |\r\n| **.NET** | C# Script, F# Script, VBScript |\r\n| **Other** | R, Swift, Dart, AppleScript, AutoHotkey |\r\n\r\n## Installation\r\n\r\n### Option 1: Copy to Your Project\r\n\r\nCopy the `.github/skills/code-runner` directory to your project:\r\n\r\n```\r\nyour-project/\r\n└── .github/\r\n    └── skills/\r\n        └── code-runner/\r\n            ├── SKILL.md\r\n            ├── scripts/\r\n            │   └── run-code.cjs\r\n            └── references/\r\n                └── LANGUAGES.md\r\n```\r\n\r\n### Option 2: Clone This Repository\r\n\r\n```bash\r\ngit clone https://github.com/user/agent-skill-code-runner.git\r\ncd agent-skill-code-runner\r\n```\r\n\r\n## Usage\r\n\r\n### With AI Agents (GitHub Copilot, Claude, etc.)\r\n\r\nOnce installed, the skill is automatically discovered by compatible AI agents. Simply ask:\r\n\r\n- *\"Run this Python code: print('Hello, World!')\"*\r\n- *\"Execute the JavaScript: console.log(5 + 3)\"*\r\n- *\"Test this Go function...\"*\r\n\r\nThe agent will use the skill's instructions and runner script to execute the code.\r\n\r\n### Direct Script Usage\r\n\r\nYou can also run the script directly:\r\n\r\n**Recommended (stdin - avoids escaping issues):**\r\n```bash\r\necho \"\u003ccode\u003e\" | node .github/skills/code-runner/scripts/run-code.cjs \u003clanguage\u003e\r\n```\r\n\r\n**Alternative (CLI argument - for simple code only):**\r\n```bash\r\nnode .github/skills/code-runner/scripts/run-code.cjs \u003clanguage\u003e \"\u003ccode\u003e\"\r\n```\r\n\r\n**Examples:**\r\n\r\n```bash\r\n# JavaScript (stdin)\r\necho \"console.log('Hello, World!')\" | node scripts/run-code.cjs javascript\r\n\r\n# Python (stdin)\r\necho \"print('Hello, World!')\" | node scripts/run-code.cjs python\r\n\r\n# Go (stdin - handles quotes perfectly)\r\necho 'package main; import \"fmt\"; func main() { fmt.Println(\"Hello!\") }' | node scripts/run-code.cjs go\r\n\r\n# Multi-line Java (PowerShell inline here-string)\r\n@\"\r\npublic class Test {\r\n    public static void main(String[] args) {\r\n        System.out.println(\"Hello from Java!\");\r\n    }\r\n}\r\n\"@ | node scripts/run-code.cjs java\r\n\r\n# Simple code via CLI argument\r\nnode scripts/run-code.cjs javascript \"console.log(5 + 3)\"\r\n\r\n# With custom timeout (in milliseconds)\r\necho \"import time; time.sleep(5); print('Done')\" | node scripts/run-code.cjs python --timeout 10000\r\n```\r\n\r\n## Prerequisites\r\n\r\nThe script requires the appropriate interpreter or compiler for each language to be installed and available in your `PATH`:\r\n\r\n| Language | Required |\r\n|----------|----------|\r\n| JavaScript | [Node.js](https://nodejs.org/) |\r\n| TypeScript | [ts-node](https://typestrong.org/ts-node/) (`npm i -g ts-node typescript`) |\r\n| Python | [Python](https://python.org/) |\r\n| Java | [JDK](https://adoptium.net/) |\r\n| C/C++ | GCC/G++ or Clang |\r\n| Go | [Go](https://go.dev/) |\r\n| Rust | [Rust](https://rustup.rs/) |\r\n| Ruby | [Ruby](https://ruby-lang.org/) |\r\n\r\nSee [references/LANGUAGES.md](.github/skills/code-runner/references/LANGUAGES.md) for the complete list.\r\n\r\n## How It Works\r\n\r\n1. **Skill Discovery**: AI agents read the `SKILL.md` file to understand what the skill does\r\n2. **Activation**: When a user asks to run code, the agent activates the skill\r\n3. **Execution**: The agent uses `scripts/run-code.cjs` to:\r\n   - Create a temporary file with the code\r\n   - Execute it with the appropriate interpreter/compiler\r\n   - Return stdout/stderr to the user\r\n4. **Cleanup**: Temporary files are automatically deleted\r\n\r\n## Security Considerations\r\n\r\n⚠️ **Warning**: Running arbitrary code can be dangerous. The skill includes guidance for agents to:\r\n\r\n- Review code before execution\r\n- Be cautious with file system access, network requests, and system commands\r\n- Confirm execution with users when appropriate\r\n\r\nFor untrusted code, consider running in a sandboxed environment (Docker, VM, etc.).\r\n\r\n## Troubleshooting\r\n\r\n### Escaping Issues (Java, quotes, special characters)\r\n\r\n**Problem**: Code with quotes or special characters fails with \"illegal escape character\" or similar errors.\r\n\r\n**Solution**: Use stdin instead of CLI arguments:\r\n\r\n```bash\r\n# ✓ Good (stdin)\r\necho \"System.out.println(\\\"Hello\\\");\" | node run-code.cjs java\r\n\r\n# ✗ Bad (CLI argument - escaping nightmare)\r\nnode run-code.cjs java \"System.out.println(\\\"Hello\\\");\"\r\n```\r\n\r\n**For AI Agents**: Always use stdin when calling the script to avoid shell escaping issues across different platforms.\r\n\r\n### Language Not Found\r\n\r\n**Problem**: `Command not found` error\r\n\r\n**Solution**: Install the required interpreter/compiler and ensure it's in your PATH:\r\n```bash\r\n# Check if installed\r\npython --version\r\njava -version\r\nnode --version\r\n```\r\n\r\n## Project Structure\r\n\r\n```\r\n.github/skills/code-runner/\r\n├── SKILL.md                 # Skill definition and instructions\r\n├── scripts/\r\n│   └── run-code.cjs          # Code execution script (CommonJS)\r\n└── references/\r\n    └── LANGUAGES.md         # Detailed language reference\r\n```\r\n\r\n## Agent Skills Specification\r\n\r\nThis skill follows the [Agent Skills](https://agentskills.io/) open standard:\r\n\r\n- **name**: `code-runner`\r\n- **description**: Run code snippets in 30+ programming languages\r\n- **location**: `.github/skills/code-runner/`\r\n\r\nCompatible with:\r\n- [GitHub Copilot](https://github.com/features/copilot) (VS Code, CLI, Coding Agent)\r\n- [Claude Code](https://claude.ai/code)\r\n- [Cursor](https://cursor.com/)\r\n- Other skills-compatible agents\r\n\r\n## Contributing\r\n\r\nContributions are welcome! Please feel free to submit a Pull Request.\r\n\r\n### Adding a New Language\r\n\r\n1. Add the language config to `languageConfig` in `scripts/run-code.cjs`\r\n2. Update the language table in `SKILL.md`\r\n3. Add detailed info in `references/LANGUAGES.md`\r\n\r\n## License\r\n\r\nMIT License - see [LICENSE](LICENSE) for details.\r\n\r\n## Related Projects\r\n\r\n- [vscode-code-runner](https://github.com/formulahendry/vscode-code-runner) - VS Code extension for running code\r\n- [mcp-server-code-runner](https://github.com/formulahendry/mcp-server-code-runner) - MCP Server for code execution\r\n- [Agent Skills](https://agentskills.io/) - Open standard for AI agent capabilities\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fformulahendry%2Fagent-skill-code-runner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fformulahendry%2Fagent-skill-code-runner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fformulahendry%2Fagent-skill-code-runner/lists"}