genaiscript — GitHub Copilot rule: GenAIScript generation
A GitHub Copilot rule that turns the assistant into a GenAIScript expert: it writes scripts and answers questions about the language.
.github/instructions/genaiscript.instructions.mdWhat genaiscript does
The rule applies to files matching **/*.genai.*. It sets an expert role for GenAIScript and points to the project's llms.txt reference, so Copilot works from the language's own documentation instead of guessing.
Code generation targets TypeScript with ESM modules for Node.js. APIs from genaiscript.d.ts come first, Node.js imports are avoided, and the global types need no import because they are already in context. Errors belong at I/O and external API boundaries; unexpected exceptions should reach the caller rather than get swallowed.
Where the rule is unsure, it leaves a TODO for you to review. That is the part worth noticing: Copilot stops inventing calls silently and flags the shaky spots. Without the rule you end up checking every GenAIScript answer against the docs yourself.
What it helps with
- write GenAIScript code without checking the docs each time
- stop Copilot from importing Node.js modules instead of
genaiscript.d.tsAPIs - leave TODOs on parts the model is unsure about
- handle errors at I/O and external API boundaries
- ask GenAIScript syntax questions inside the editor
Example prompts for the agent
- Write a GenAIScript that reads a list of files and summarizes each one
- Rewrite this script using genaiscript.d.ts APIs, no node.js imports
- Explain how to handle external API errors in GenAIScript
How to install genaiscript
Manually: put the files in place
.github/instructions/genaiscript.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.claude/rules/genaiscript.mdThe paths frontmatter field limits the files: move applyTo from the source into paths
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/genaiscript.mdcFrontmatter: description, globs, alwaysApply. Move applyTo from the source into globs, or the rule will not attach on its own
Manually: put the files in place
.devin/rules/genaiscript.mdManually: put the files in place
.clinerules/genaiscript.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about genaiscript
How do I install genaiscript in GitHub Copilot?
Place the rule file at .github/instructions/genaiscript.instructions.md in your repository.
What does genaiscript do?
It gives Copilot an expert role for GenAIScript, so the assistant generates TypeScript scripts with ESM modules and answers language questions.
Which files does the rule apply to?
The **/*.genai.* mask — it only kicks in on files that match it.
Source text
genaiscript.instructions.md · MIT
--- description: 'AI-powered script generation guidelines' applyTo: '**/*.genai.*' --- ## Role You are an expert at the GenAIScript programming language (https://microsoft.github.io/genaiscript). Your task is to generate GenAIScript script or answer questions about GenAIScript. ## Reference - [GenAIScript llms.txt](https://microsoft.github.io/genaiscript/llms.txt) ## Guidance for Code Generation - you always generate TypeScript code using ESM models for Node.JS. - you prefer using APIs from GenAIScript 'genaiscript.d.ts' rather node.js. Avoid node.js imports. - you keep the code simple, but handle errors at I/O and external API boundaries; let unexpected exceptions surface to the caller rather than swallowing them. - you add TODOs where you are unsure so that the user can review them - you use the global types in genaiscript.d.ts are already loaded in the global context, no need to import them.
© github · MIT · github/awesome-copilot