agentleFS
MicrosoftKnown publishermicrosoft/DevSkim/.github/copilot-instructions.md

DevSkim

Copilot instructions1k starsChanged 4 months agoMITView on GitHub

DevSkim is a framework of IDE extensions and language analyzers that provide inline security analysis in the dev environment as the developer writes code. The repository contains: ⚠️ IMPORTANT: This repository uses private Azure DevOps feeds for package management: Rules for agents: 1. You MAY temporarily modify nuget.config or .npmrc files to use public feeds (nuget.org, npmjs.com) when working locally 2. You MUST NOT commit these changes - always revert them before committing 3. Use git restore nuget.config or git…

Trending

Quiet this year.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the microsoft/DevSkim repository that our weekly crawl found: only 2 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

The file

Show its rules and text

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

21 rules. About 0 are common, 10 are distinctive, and 11 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 11

    Very specific

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

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

    Security Rules: Default rules and guidance (./rules/default/, ./guidance/)

    line 11
  2. Very specific:

    Use git restore nuget.config or git restore DevSkim-VSCode-Plugin/.npmrc.pipeline before creating commits

    line 25
  3. Very specific:

    ⚠️ MANDATORY: All pull requests MUST include an update to Changelog.md

    line 30
  4. Very specific:

    Add a new entry at the top of Changelog.md (after the header)

    line 40
  5. Distinctive:

    Run this after committing your change and with your branch rebased on the latest main, since the height includes your own commit.

    line 46
  6. Distinctive:

    Use today's date in YYYY-MM-DD format

    line 47
  7. Distinctive:

    Write clear, actionable descriptions

    line 49
  8. Distinctive:

    Follow standard C# naming conventions

    line 129
  9. Distinctive:

    Use meaningful variable and method names

    line 130
  10. Distinctive:

    Add XML documentation comments for public APIs

    line 131
  11. Very specific:

    Use ESLint configuration in DevSkim-VSCode-Plugin/.eslintrc.js

    line 135
  12. Distinctive:

    Follow TypeScript best practices

    line 136
  13. Very specific:

    Avoid any types when possible

    line 138
  14. Distinctive:

    Follow existing rule patterns when adding new rules

    line 143
  15. Very specific:

    Create JSON rule in ./rules/default/

    line 148
  16. Very specific:

    Create guidance markdown in ./guidance/ with rule ID

    line 149
  17. Very specific:

    Test rule with DevSkim CLI

    line 150
  18. Distinctive:

    Update tests if applicable

    line 151
  19. Very specific:

    Document in Changelog.md under ### Dependencies

    line 157
  20. Distinctive:

    VS Code plugin: Use F5 in VS Code to launch Extension Development Host

    line 160
  21. Very specific:

    .NET projects: Use Visual Studio or dotnet run

    line 161

≈ “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

Copilot Instructions for DevSkim

Repository Overview

DevSkim is a framework of IDE extensions and language analyzers that provide inline security analysis in the dev environment as the developer writes code. The repository contains:

  • DevSkim Library (C#/.NET): Core security analysis engine (./DevSkim-DotNet/)
  • DevSkim CLI (C#/.NET): Command-line tool (./DevSkim-DotNet/Microsoft.DevSkim.CLI/)
  • Visual Studio Extension (C#/.NET): VS extension (./DevSkim-DotNet/Microsoft.DevSkim.VisualStudio/)
  • VS Code Plugin (TypeScript): VSCode extension (./DevSkim-VSCode-Plugin/)
  • Security Rules: Default rules and guidance (./rules/default/, ./guidance/)

Critical Repository-Specific Rules

Package Management Configuration

⚠️ IMPORTANT: This repository uses private Azure DevOps feeds for package management:

  • nuget.config: Contains private feed configuration (PublicRegistriesFeed)
  • .npmrc files: VSCode plugin uses .npmrc.pipeline for private feeds

Rules for agents:

  1. You MAY temporarily modify nuget.config or .npmrc files to use public feeds (nuget.org, npmjs.com) when working locally
  2. You MUST NOT commit these changes - always revert them before committing
  3. Use git restore nuget.config or git restore DevSkim-VSCode-Plugin/.npmrc.pipeline before creating commits
  4. The private feed configuration must remain in the repository commits

Changelog Requirements

⚠️ MANDATORY: All pull requests MUST include an update to Changelog.md

  • This project uses squash merges
  • PR gate checks verify Changelog.md is updated
  • Format follows Keep a Changelog
  • Version headings are [MAJOR.MINOR.PATCH] and must match the version the build actually produces

Versioning: this repo versions with Nerdbank.GitVersioning. version.json pins MAJOR.MINOR (currently 1.0) and the patch number is the git height, which is the commit count since version.json last changed. Do not guess it by incrementing the previous changelog entry: an open PR's height shifts every time another PR merges ahead of it, and blindly incrementing bakes that drift in permanently.

When making changes:

  1. Add a new entry at the top of Changelog.md (after the header)
  2. Determine the version by asking Nerdbank.GitVersioning what this commit produces, rather than incrementing the previous entry:
    dotnet tool install --global nbgv   # once
    nbgv get-version -v SimpleVersion   # e.g. 1.0.95
    Run this after committing your change and with your branch rebased on the latest main, since the height includes your own commit. If your PR sits open while other PRs merge, re-run it and update the heading before merging.
  3. Use today's date in YYYY-MM-DD format
  4. Group changes by type: ### Fix, ### Added, ### Changed, ### Dependencies, ### Pipeline, etc.
  5. Write clear, actionable descriptions

Example (assuming nbgv get-version -v SimpleVersion reported 1.0.72):

## [1.0.72] - 2026-02-04
### Added
- Added Copilot instructions for repository-specific guidance

### Changed
- Updated build documentation

Exception: the gate (tarides/changelog-check-action) is skipped on PRs carrying the no changelog label. That is reserved for changes that are not user-visible, and Dependabot applies it automatically via .github/dependabot.yml. Do not use it to avoid writing an entry for a real change.

Building and Testing

VS Code Plugin (TypeScript)

Location: ./DevSkim-VSCode-Plugin/

Setup:

cd DevSkim-VSCode-Plugin
npm run setup          # Install dependencies and build .NET language server
npm run setup:release  # Release build

Build:

npm run compile        # Compile TypeScript
npm run build          # Full build (setup + compile)
npm run watch          # Watch mode for development

Lint:

npm run lint           # Run ESLint on TypeScript files

Package:

npm run pack-ext       # Package extension for release
npm run pack-ext:debug # Package extension for debug

.NET Projects (C#)

Location: ./DevSkim-DotNet/

Build:

cd DevSkim-DotNet
dotnet build Microsoft.DevSkim.sln
dotnet build -c Release Microsoft.DevSkim.sln

Test:

cd DevSkim-DotNet
dotnet test Microsoft.DevSkim.Tests/Microsoft.DevSkim.Tests.csproj

Run CLI:

cd DevSkim-DotNet/Microsoft.DevSkim.CLI
dotnet run -- analyze --source-code <path>

Language Server

Build:

cd DevSkim-DotNet/Microsoft.DevSkim.LanguageServer
dotnet publish -c Debug -f net8.0 -o ../../DevSkim-VSCode-Plugin/devskimBinaries
dotnet publish -c Release -f net8.0 -o ../../DevSkim-VSCode-Plugin/devskimBinaries

Code Style and Conventions

C# Code

  • Follow standard C# naming conventions
  • Use meaningful variable and method names
  • Add XML documentation comments for public APIs
  • Security-focused: prioritize secure defaults

TypeScript Code

  • Use ESLint configuration in DevSkim-VSCode-Plugin/.eslintrc.js
  • Follow TypeScript best practices
  • Use type annotations
  • Avoid any types when possible

Security Rules

  • Rules are JSON files in ./rules/default/
  • Each rule has corresponding guidance in ./guidance/
  • Follow existing rule patterns when adding new rules

Common Tasks

Adding a New Security Rule

  1. Create JSON rule in ./rules/default/
  2. Create guidance markdown in ./guidance/ with rule ID
  3. Test rule with DevSkim CLI
  4. Update tests if applicable
  5. Update Changelog.md

Updating Dependencies

  • For .NET: Use dotnet add package or edit .csproj files
  • For npm: Use npm install or edit package.json
  • Document in Changelog.md under ### Dependencies

Debugging

  • VS Code plugin: Use F5 in VS Code to launch Extension Development Host
  • .NET projects: Use Visual Studio or dotnet run
  • Language Server: Attach debugger to running process

Git Workflow

  1. Changes are made on feature branches
  2. PRs target the main branch
  3. PRs require:
    • Changelog.md update
    • Passing CI/CD checks
    • Code review approval
  4. Merges use squash merge strategy

Additional Resources

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.