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

BuildXL

Copilot instructions1k starsChanged 3 months agoMITView on GitHub

BuildXL is a distributed, cached, incremental build engine. Frontends construct a pip graph, then the scheduler executes it. Pips declare inputs and outputs, and sandboxed file-access monitoring enforces those declarations. Build correctness and caching are content-based rather than timestamp-based. Important concepts: - A pip is a node in the build DAG, such as a process, copy, write, service, or IPC operation. - Frontends include DScript, MSBuild, JavaScript, Ninja, NuGet, and Download. - Qualifiers parameterize builds, commonly by configuration and platform.…

Trending

Quiet since September.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: 1 mentionOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the microsoft/BuildXL repository that our weekly crawl found: only 7 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

The file

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

12 rules. About 0 are common, 6 are distinctive, and 6 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.

  • 6

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Follow nearby .dsc patterns rather than assuming TypeScript syntax.

    line 52
  2. Very specific:

    When adding a source file, check whether its project uses a glob or an explicit file list.

    line 60
  3. Very specific:

    Run builds from the repository root.

    line 73
  4. Distinctive:

    Use the smallest relevant validation first:

    line 103
  5. Distinctive:

    Use a Release qualifier when validating performance-sensitive changes.

    line 113
  6. Very specific:

    Follow .editorconfig and nearby code.

    line 126
  7. Distinctive:

    Always use braces for control statements.

    line 133
  8. Very specific:

    Use var when the type is apparent from the right-hand side.

    line 134
  9. Distinctive:

    Every new C# file starts with:

    line 137
  10. Distinctive:

    Do not amend, rebase, force-push, or otherwise rewrite history unless the user explicitly requests it.

    line 147
  11. Distinctive:

    Do not push unless the user explicitly requests it.

    line 149
  12. Very specific:

    Place parallel worktrees under the sibling ../BuildXL.Internal.worktrees/<feature> directory.

    line 154

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

BuildXL context

BuildXL is a distributed, cached, incremental build engine. Frontends construct a pip graph, then the scheduler executes it. Pips declare inputs and outputs, and sandboxed file-access monitoring enforces those declarations. Build correctness and caching are content-based rather than timestamp-based.

Important concepts:

  • A pip is a node in the build DAG, such as a process, copy, write, service, or IPC operation.
  • Frontends include DScript, MSBuild, JavaScript, Ninja, NuGet, and Download.
  • Qualifiers parameterize builds, commonly by configuration and platform.
  • Sealed directories declare directory contents in advance so directory dependencies can be cached safely.

Primary references:

  • Developer guide
  • Core concepts
  • DScript guide
  • Module system

Build definitions and DScript

.dsc files define the build and are the source of truth. .csproj and .sln files are generated for IDE support; never edit them. Generate them with bxl -vs, bxl -vs -cache, or bxl -vsall.

DScript is TypeScript-derived but is not TypeScript:

  • Top-level values can only be const declarations or functions and are therefore immutable. let values are allowed inside functions; var values are disallowed.
  • The qualifier keyword exposes build parametrization.
  • export makes values accessible to other specs under the same module; @@public makes an export visible to other modules.
  • Dependencies are declared with import or importFrom.

DScript path literals are typed:

f`path/to/file.cs`       // File
d`path/to/directory`     // Directory
p`path/to/output`        // Output path
a`name`                  // Path atom
r`relative/path`         // Relative path

Follow nearby .dsc patterns rather than assuming TypeScript syntax. Common source patterns are:

const recursiveSources = globR(d`.`, "*.cs");
const directFiles = [f`First.cs`, f`Second.cs`];

When adding a source file, check whether its project uses a glob or an explicit file list. Add the file to the .dsc list when needed. Do not update a generated project.

Modules use module.config.bm or module.config.dsc. Module names are globally unique and normally hierarchical. Respect allowedDependencies; add imports rather than bypassing the module dependency graph.

BuildXL sandbox correctness depends on observing inputs and outputs. Unobserved file accesses can fail a build or make it uncacheable.

Building and testing

Run builds from the repository root. On Windows, invoke the batch file through cmd /c "call ..." and pass /server- so agents do not leave a BuildXL server running:

cmd /c "call bxl.cmd -minimal /server-"
cmd /c "call bxl.cmd Test.BuildXL.Utilities.Collections.dsc /server-"
cmd /c "call bxl.cmd Test.BuildXL.Utilities.Collections.dsc -TestClass Test.BuildXL.Utilities.Collections.BitSetTests /server-"
cmd /c "call bxl.cmd Test.BuildXL.Utilities.Collections.dsc -TestMethod Test.BuildXL.Utilities.Collections.BitSetTests.RoundToValidBitCount /server-"
cmd /c "call bxl.cmd /q:ReleaseNet10 /server-"

On Linux, use ./bxl.sh. Microsoft internal developers need --internal for internal dependencies; external contributors must omit it. The first run may require sudo.

./bxl.sh --internal --minimal /server-
./bxl.sh --internal --test-class Test.BuildXL.Utilities.Collections.BitSetTests /server-
./bxl.sh --internal --test-method Test.BuildXL.Utilities.Collections.BitSetTests.RoundToValidBitCount /server-

The first build may restore the LKG and credential provider, so allow at least five minutes. Build output ends with Build Succeeded or Build FAILED. On failure, use the printed log directory and inspect BuildXL.err for the authoritative errors.

-TestClass and -TestMethod succeed when they match no tests. Verify the fully qualified name exists and confirm the expected tests actually ran.

Use the smallest relevant validation first:

cmd /c "call bxl.cmd <target-test-project>.dsc /server-"
cmd /c "call bxl.cmd -minimal /server-"
cmd /c "call bxl.cmd /server-"

The standard build and test suite is slow. RunCheckInTests.cmd performs multiple configurations and fingerprint checks and is normally left to PR CI. Use a Release qualifier when validating performance-sensitive changes.

Manually invoked benchmarks should remain BuildXLSdk.test projects, with the entire test run gated by skipTestRun and an Environment.getFlag build parameter. This keeps benchmarks compiled but prevents automation from scheduling them. Run the utilities benchmarks with:

cmd /c "call bxl.cmd Test.BuildXL.Utilities.Benchmarks.dsc /p:[Sdk.BuildXL]runBenchmarks=1 /q:ReleaseNet10 /server-"

Code conventions

Follow .editorconfig and nearby code. In C#:

  • Private instance, static, and thread-static fields use m_, s_, and t_ prefixes respectively.
  • Constants and public members use PascalCase; parameters and locals use camelCase.
  • Method and test names use PascalCase without underscores.
  • Always use braces for control statements.
  • Use var when the type is apparent from the right-hand side; use an explicit type for built-ins or when the type is not obvious.

Every new C# file starts with:

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

Git

  • Name branches dev/[username]/[short-kebab-case-description].
  • Do not amend, rebase, force-push, or otherwise rewrite history unless the user explicitly requests it. Add a new commit instead.
  • Do not push unless the user explicitly requests it. Make local commits only when instructed by the user.

Worktrees

Place parallel worktrees under the sibling ../BuildXL.Internal.worktrees/<feature> directory. Worktrees share the main worktree's Out\Cache, so builds can reuse cache entries.

On Windows, bxl.cmd wraps the build with RunInSubst.exe, which serializes access via .SubstLock: start the build normally (bxl.cmd -minimal /server-, with no extra flags) and let it queue behind the worktree currently using the drive. A queued build may appear hung — that is expected; wait it out or ask the user, do not "fix" it.

On Windows, never run the subst command yourself, for any drive letter, for any reason. Do not remap, unmap, or create a subst drive; do not pass -NoSubst or any other flag to route around RunInSubst.exe; do not modify or delete .SubstLock; do not terminate processes to bypass the queue. This applies even when a build fails with a path-length, "invalid parameter", or other subst-looking error — that failure is a signal to stop and ask the user, not to invent a drive-letter or -NoSubst workaround. When diagnosing which worktree owns the subst mapping, use the absolute path of the running RunInSubst.exe, and report it rather than acting on it.

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.