agentleFS
kasukenkasuken/vscode-copilot-insights/.github/copilot-instructions.md

vscode-copilot-insights

Copilot instructions37 starsChanged 5 months agoMITView on GitHub

VS Code extension project guidelines for GitHub Copilot Insights. Covers project shape, code style, VS Code extension rules, build and test, and repository discipline.

The file

Show its rules and text

We split this copilot-instructions.md into the rules it gives an agent

14 rules. About 0 are common, 6 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Keep extension-host logic in src/, with activation and command/view wiring in src/extension.ts, Copilot data access in src/api/, pure …

    line 10
  2. Very specific:

    Prefer pure helpers in src/core/ for behavior that can be unit tested without the VS Code API.

    line 27
  3. Distinctive:

    Keep user-facing strings localizable through the existing package/l10n patterns when they are surfaced by VS Code or the extension UI.

    line 28
  4. Very specific:

    Treat package.json contributions, activation behavior, command registration, status bar items, language model tools, storage, and webviews …

    line 32
  5. Distinctive:

    Do not use proposed VS Code APIs unless the project already opts into them or the user explicitly asks.

    line 33
  6. Very specific:

    Do not assume webview code can access Node.js or the VS Code API directly.

    line 34
  7. Distinctive:

    Keep webview rendering compatible with VS Code themes and offline local assets.

    line 35
  8. Very specific:

    Use npm run compile as the main production validation command after extension changes.

    line 39
  9. Very specific:

    Run npm run compile-tests when changing tests or code imported by tests.

    line 40
  10. Very specific:

    Run npm test only when the Electron extension test harness is needed and practical.

    line 41
  11. Very specific:

    Follow .github/instructions/repo-validation.instructions.md for the detailed validation workflow when it applies.

    line 42
  12. Distinctive:

    Do not publish, package for release, bump versions, commit, or create branches unless the user explicitly asks.

    line 46
  13. Distinctive:

    Do not revert user changes.

    line 47
  14. Distinctive:

    Keep documentation updates close to the behavior being changed.

    line 48

≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

GitHub Copilot Insights

  • This repository is a VS Code extension for showing GitHub Copilot plan, quota, reset, history, and AI credit usage insights inside VS Code.
  • Keep extension-host logic in src/, with activation and command/view wiring in src/extension.ts, Copilot data access in src/api/, pure formatting/history/prediction/quota logic in src/core/, and UI-specific code in src/ui/.
  • The extension is bundled to dist/extension.js with esbuild. Extension tests compile TypeScript to the CommonJS out/ tree.

Tech Stack

  • Runtime: VS Code extension API ^1.107.0, UI extension host, Node.js-compatible extension code, and browser-based webviews.
  • Language: TypeScript targeting ES2022 with module: Node16, strict type checking, and DOM library types for webview code.
  • Extension surfaces: package.json contributions for activity bar views, webviews, commands, settings, walkthroughs, localization, and the insights_getCopilotQuota language model tool.
  • UI: VS Code webview HTML/CSS/JavaScript in src/ui/webview/ and media/, VS Code theme variables, Codicons, and offline local assets.
  • Charts: Chart.js 4.x via the bundled UMD asset at media/chart.umd.min.js.
  • Build tooling: npm scripts, esbuild for dist/extension.js, TypeScript compiler for type checks and test emits, and scripts/copy-codicons.mjs for static assets.
  • Quality and tests: ESLint 9 with typescript-eslint, Mocha-style extension tests through @vscode/test-cli and @vscode/test-electron, plus @types/vscode, @types/node, and @types/mocha.

Code Style

  • Make focused TypeScript changes that match nearby style and avoid broad rewrites or formatting churn.
  • Preserve public command IDs, setting keys, view IDs, contribution IDs, exported types, and storage shapes unless the task explicitly requires a migration or breaking change.
  • Prefer pure helpers in src/core/ for behavior that can be unit tested without the VS Code API.
  • Keep user-facing strings localizable through the existing package/l10n patterns when they are surfaced by VS Code or the extension UI.

VS Code Extension Rules

  • Treat package.json contributions, activation behavior, command registration, status bar items, language model tools, storage, and webviews as public extension surfaces.
  • Do not use proposed VS Code APIs unless the project already opts into them or the user explicitly asks.
  • Do not assume webview code can access Node.js or the VS Code API directly. Use acquireVsCodeApi, message passing, CSP nonces, and asWebviewUri for local assets.
  • Keep webview rendering compatible with VS Code themes and offline local assets.

Build and Test

  • Use npm run compile as the main production validation command after extension changes.
  • Run npm run compile-tests when changing tests or code imported by tests.
  • Run npm test only when the Electron extension test harness is needed and practical; if it is blocked by the VS Code download or environment, report that extension-host behavior remains unverified.
  • Follow .github/instructions/repo-validation.instructions.md for the detailed validation workflow when it applies.

Repository Discipline

  • Do not publish, package for release, bump versions, commit, or create branches unless the user explicitly asks.
  • Do not revert user changes. If existing edits affect the task, work with them and keep the final summary clear about what changed.
  • Keep documentation updates close to the behavior being changed; do not duplicate large sections from README.md.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.