Add repo-specific Copilot instructions and VS Code inline chat settings

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.
This commit is contained in:
ins dar 2025-10-12 10:44:20 +02:00
parent 91ee38775c
commit f98ede0bd6
2 changed files with 50 additions and 1 deletions

View File

@ -1,3 +1,47 @@
## .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 by `update-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.js` and `yaml-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 by `validate-collections.js`.
- README content is regenerated from source files by running `node update-readme.js` (or `npm run build`), which expects predictable frontmatter and filename patterns.
Developer workflows (explicit commands)
- Generate README: `npm run build` (runs `node update-readme.js`).
- Validate collections: `node validate-collections.js` (script exits nonzero on failure).
- Contributor tasks: all-contributors commands are available (`npm run contributors:generate`, etc.).
- VS Code tasks are present for `generate-readme`, `validate-collections`, and `create-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.js` enforces this.
- Collection `items[].kind` must be one of `prompt`, `instruction`, `chat-mode` and the `path` must 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.js` prefers frontmatter `title` and `description`. If missing, it falls back to the first `# ` heading or a formatted filename.
- Description handling: single-line `description:` or multi-line `description: |` blocks are supported by `update-readme.js`.
Patterns & examples (copyable references)
- Title extraction: `update-readme.js` looks for `title:` in frontmatter, then `# ` heading after frontmatter, then falls back to filename formatting.
- Description extraction: accepts single-line `description: '...'` (single quotes supported) or multiline `description: |` and two-space indented lines.
- Collection validation: `validate-collections.js` checks structure (id/name/description/tags/items/display), enforces `MAX_COLLECTION_ITEMS`, and verifies that each `items[].path` exists.
Actionable checklist for AI agents (use before committing)
- [ ] New `.prompt.md`, `.instructions.md`, or `.chatmode.md` include frontmatter with `title` and `description` (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 valid `id`, `name`, `description`, `tags`, and `items` matching the validator rules. Run `node validate-collections.js` locally.
- [ ] Run `npm run build` locally to regenerate the README and confirm the new entries appear as expected.
Notes and cautions
- Avoid changing `update-readme.js` behavior unless necessary; many repo tools and badge URLs (aka.ms mapping) depend on its link-generation logic.
- `validate-collections.js` is 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. The following instructions are only to be applied when performing a code review.
## README updates ## README updates

View File

@ -22,5 +22,10 @@
"*.chatmode.md": "markdown", "*.chatmode.md": "markdown",
"*.instructions.md": "markdown", "*.instructions.md": "markdown",
"*.prompt.md": "markdown" "*.prompt.md": "markdown"
} },
"inlineChat.enableV2": true,
"inlineChat.finishOnType": true,
"inlineChat.hideOnRequest": true,
"inlineChat.lineEmptyHint": true,
"inlineChat.notebookAgent": true
} }