Skip to main content
rule official · GitHub

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.

Install into GitHub Copilot · Manually: put the files in place All methods and platforms ↓
.github/instructions/genaiscript.instructions.md
Open on GitHub

What 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.ts APIs
  • 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.md

The applyTo field sets which files it applies to

Step 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

Similar IDE rules

Everything for AI and ML →

From the same set732

The whole set →
langchain-python A GitHub Copilot instruction file that steers the agent toward LangChain patterns: Runnable, LCEL, chat models, retrievers and vector stores. Useful when your Python code talks to LangChain. ★ 40,418repo stars java-upgrade A rule that points Copilot at the java-upgrade skill whenever you change the Java version in Maven or Gradle files. Handy for LTS jumps. ★ 40,418repo stars intellij-java-kotlin A rule that keeps Copilot inside the project's build model when working on Java and Kotlin in IntelliJ IDEA, with validation that matches CI. ★ 40,418repo stars github-actions-ci-cd-best-practices A GitHub Copilot rule that guides workflow structure, token permissions, caching and matrix setups whenever you touch files under .github/workflows/. ★ 40,418repo stars draw-io Tells Copilot how to build and edit draw.io diagrams: mxGraph XML structure, a semantic colour palette, grid alignment and a validation script. ★ 40,418repo stars dotnet-maui This rule steers Copilot toward idiomatic .NET MAUI: MVVM, CollectionView over ListView, Shell navigation. Useful once the agent starts editing XAML and C#. ★ 40,418repo stars devops-core-principles Guides GitHub Copilot on CALMS principles, DORA metrics, and delivery automation across CI/CD pipelines and infrastructure as code. ★ 40,418repo stars devbox-image-definition A GitHub Copilot rule that helps you write YAML image definition files for Microsoft Dev Box Team Customizations. Useful when your customizations rely on ~/winget, ~/gitclone and ~/powershell tasks. ★ 40,418repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor