Introduces a detailed .github/copilot-instructions.md to guide AI agents on repository conventions, workflows, and validation rules. Updates .vscode/settings.json to enable and configure VS Code inline chat features for improved developer experience.
5.8 KiB
.github/copilot-instructions.md — repo-specific guidance for AI agents
Purpose: give an AI coding agent the minimal, high-value facts to be immediately productive in this repository.
Key locations (what to read first)
README.md— project overview and MCP server notes (README is generated byupdate-readme.js).prompts/,instructions/,chatmodes/,collections/— primary content types and their file patterns.update-readme.js— script that builds README tables and badges; it shows how titles/descriptions are extracted from frontmatter or headings.validate-collections.jsandyaml-parser.js— collection manifest rules and validation logic (see file-kind checks, ID/tag constraints, and item path checks).
Big picture
- This repo is a curated library of Copilot artifacts: prompts (
.prompt.md), instructions (.instructions.md), and chat modes (.chatmode.md). Collections (.collection.yml) reference those files and are validated byvalidate-collections.js. - README content is regenerated from source files by running
node update-readme.js(ornpm run build), which expects predictable frontmatter and filename patterns.
Developer workflows (explicit commands)
- Generate README:
npm run build(runsnode update-readme.js). - Validate collections:
node validate-collections.js(script exits non‑zero on failure). - Contributor tasks: all-contributors commands are available (
npm run contributors:generate, etc.). - VS Code tasks are present for
generate-readme,validate-collections, andcreate-collection(see workspace tasks in the README).
Project-specific conventions (discoverable and enforced)
- File extensions map to kinds: prompts →
.prompt.md; instructions →.instructions.md; chat modes →.chatmode.md.validate-collections.jsenforces this. - Collection
items[].kindmust be one ofprompt,instruction,chat-modeand thepathmust point to an existing file with the correct extension. - Collection IDs and tags: lowercase, hyphen-separated; length and character checks are enforced in
validate-collections.js. - Frontmatter usage:
update-readme.jsprefers frontmattertitleanddescription. If missing, it falls back to the first#heading or a formatted filename. - Description handling: single-line
description:or multi-linedescription: |blocks are supported byupdate-readme.js.
Patterns & examples (copyable references)
- Title extraction:
update-readme.jslooks fortitle:in frontmatter, then#heading after frontmatter, then falls back to filename formatting. - Description extraction: accepts single-line
description: '...'(single quotes supported) or multilinedescription: |and two-space indented lines. - Collection validation:
validate-collections.jschecks structure (id/name/description/tags/items/display), enforcesMAX_COLLECTION_ITEMS, and verifies that eachitems[].pathexists.
Actionable checklist for AI agents (use before committing)
- New
.prompt.md,.instructions.md, or.chatmode.mdinclude frontmatter withtitleanddescription(use single quotes for description when needed). - Filenames are lower-case, words separated by hyphens, and extensions match their kind.
- If you want the artifact listed in README tables, either include frontmatter title/description or ensure a top-level
#heading is present. - If adding a collection
.collection.yml: set validid,name,description,tags, anditemsmatching the validator rules. Runnode validate-collections.jslocally. - Run
npm run buildlocally to regenerate the README and confirm the new entries appear as expected.
Notes and cautions
- Avoid changing
update-readme.jsbehavior unless necessary; many repo tools and badge URLs (aka.ms mapping) depend on its link-generation logic. validate-collections.jsis the authoritative enforcement for collection manifests. Fix validation errors rather than bypassing them.
If you want examples added to this file (sample frontmatter templates, CI snippet to run these checks, or a helper script to lint frontmatter), tell me which example and I'll add it. The following instructions are only to be applied when performing a code review.
README updates
- The new file should be added to the
README.md.
Prompt file guide
Only apply to files that end in .prompt.md
- The prompt has markdown front matter.
- The prompt has a
modefield specified of eitheragentorask. - The prompt has a
descriptionfield. - The
descriptionfield is not empty. - The
descriptionfield value is wrapped in single quotes. - The file name is lower case, with words separated by hyphens.
- Encourage the use of
tools, but it's not required. - Strongly encourage the use of
modelto specify the model that the prompt is optimised for.
Instruction file guide
Only apply to files that end in .instructions.md
- The instruction has markdown front matter.
- The instruction has a
descriptionfield. - The
descriptionfield is not empty. - The
descriptionfield value is wrapped in single quotes. - The file name is lower case, with words separated by hyphens.
- The instruction has an
applyTofield that specifies the file or files to which the instructions apply. If they wish to specify multiple file paths they should formated like'**.js, **.ts'.
Chat Mode file guide
Only apply to files that end in .chatmode.md
- The chat mode has markdown front matter.
- The chat mode has a
descriptionfield. - The
descriptionfield is not empty. - The
descriptionfield value is wrapped in single quotes. - The file name is lower case, with words separated by hyphens.
- Encourage the use of
tools, but it's not required. - Strongly encourage the use of
modelto specify the model that the chat mode is optimised for.