This file guides you, a coding agent, to find the projections that apply to this repository, try them on its recent pull requests, and help the person choose which to keep and add to CI. You work with the Projections tools or the projections CLI, and show the person the projections yourself in the Projections viewer, a page on this machine that you drive and they watch. Nothing is written until they choose.
- Prefer the Projections tools when you have them: in VS Code’s agent the Projections extension offers them, and an MCP client gets them from
projections mcp(an MCP server over standard input and output; add it as a stdio server run in this repository). They do each step below and answer in short text; writes preview first and write only once confirmed (over MCP, call again with the preview’sconfirmtoken after the person agrees). Otherwise use the CLI commands below. - Check the CLI:
projections --version. If it is missing, install it by following https://github.com/githubnext/projections/blob/v0.3.2/docs/agents/install.md. - Propose: the
exploretool, orprojections explore --list --json, lists the projections whose built-in extractors apply here, each with the files that suggested it and what itneedsfirst (configuration, or an install such as the repository's own TypeScript): do that, or leave it out. - Sweep: the
sweeptool, orprojections explore --sweep --json, runs each one on the last 20 merges into this branch (--last Nfor more). Projections that run repository code are skipped unless you pass--trust; ask the person first. - Report, per projection, the pull requests it changed on and how (for example
#12: 3 added, 1 removed), why it failed when it did (the sweep gives the extractor's own words), and itssignal, which ranks the sweep:rare(only on structural work: worth a look),noisy(on nearly every change: likely noise, so don’t recommend it) orquiet(never changed here, or only version updates: a dependency or action bump markedversionOnly); and the pull requests where several changed. Recommend projections that show something characteristic of this codebase (the picture a long-time maintainer would recognize as theirs), not just the ones that change least. Don’t addrepository-maporcode-statistics, which explore no longer proposes: they only show what Projections can draw, not this codebase. To look at one yourself, draw it:projections compare <before>..<after> -p <id> --png FILE(a new file outside the repository). - Ask the person which projections to keep. Never adopt or change CI on your own; a request to set projections up for them is their go-ahead to adopt the few the sweep shows are worth having, so you can show them. Say which you adopted and why.
- Adopt what they chose:
projections adopt <id>... --dry-run, thenprojections adopt <id>.... Built-in projections fit standard systems like Actions workflows, database schemas and package dependencies, but rarely cover what’s distinctive about a codebase. Name the characteristic systems they missed (its own registries, extension points, protocols, pipelines) and offer to build projections for them, usually with custom renderers. To build one, runprojections help agents create-projectionand follow what it prints. - Show them each adopted projection yourself:
projections view show -p <id> --choice bookmark:<bookmark>(or theopen_projectiontool) shows it in the Projections viewer on a pull request it changed on (projections bookmark listlists the ones adopt saved) and prints the viewer’s URL. When the person asks to “open it in the inspector” or to “show” a projection, they mean this viewer. - Open that page for them the first time: in your own browser if you have one (Codex’s, for example), else in the system browser by adding
--open. Give them the bare link only when you can open neither. Laterprojections view showcalls change what the open page shows; to show several projections side by side, give each its own page with--viewer <name>(theviewerinput), and open each. In the GitHub Copilot app, use the Projections canvas instead of a browser tab: runprojections canvas installonce, then open theprojectionscanvas, which shows the same viewer in the app’s theme (one canvas per viewer name). - Talk them through what each one shows, and remove the definitions of any they don’t want. People who want an editor-integrated experience closer to the code can also use the VS Code extension (Projections: Explore Repository, under “Alternate path: the VS Code extension” below).
- When they are happy, offer to add Projections to their CI: run
projections help agents ciand follow what it prints. Commit only if they ask.
Projections maps the systems inside your codebase—dependencies, schemas, infrastructure, workflows, service wiring—without making you wade through lines of code, and shows how a change reshapes them. Because the right projections depend on your repository, setup starts by exploring your repository in five minutes against its own recent pull requests. From there, you keep the ones that actually tell you something useful and wire those into CI.
Estimated time: 5 minutes.
The quickest route is to let your coding agent run the projections CLI and
open the results in the Projections viewer, a local page it drives in your
agent's in-app browser or a standalone browser while you watch. Paste this into
your coding agent, or follow the CLI steps below yourself:
Explore Projections in this repository: run `projections help agents explore` and follow what it prints (if `projections` isn't installed, install it first by following https://github.com/githubnext/projections/blob/main/docs/agents/install.md). Use the projections CLI to find the projections that apply here and try them on our recent pull requests, tell me which are worth keeping, then adopt the ones I pick and show them to me in the Projections viewer. Don't change CI until I say so.
If you'd rather work right beside your code inside an editor, jump to Alternate path: the VS Code extension below.
- A Git repository with some history—merged pull requests, or at least a few commits.
- GitHub CLI (
gh), signed in (gh auth status), so you can download and verify the CLI binary.
Your coding agent, your terminal, and CI all run the same self-contained
projections CLI. Download the release asset for your platform, verify its
attestation, and place it on your PATH:
gh release download --repo githubnext/projections --pattern 'gh-projections-darwin-arm64*'
gh attestation verify gh-projections-darwin-arm64 --repo githubnext/projections
install -m 755 gh-projections-darwin-arm64 ~/.local/bin/projections
projections --versionSee Install the CLI for every platform's asset, installer scripts,
Windows steps, and how to run it as gh projections.
From the root of your repository, ask Projections which built-ins apply:
projections exploreThis inspects your files without writing anything and proposes matching
projections along with why each one fits—workspace dependencies if it finds
package manifests, a database schema if it spots a Prisma schema or a Rails
db/schema.rb, Rails routes, your GitHub Actions job graph, and so on.
Next, test those candidates against real history by sweeping the last 20 merges into your branch (or your most recent commits if you squash or rebase):
projections explore --sweepThe sweep reports how often each projection changed across those pull requests
and distinguishes noisy ones (changing on nearly every pull request) from
structural ones (showing up only when a change reshapes something). Pass
--json if you want structured output for scripts or tools.
Any projection whose extractor executes repository code (including some
built-ins that invoke your toolchain) is listed in the output but skipped until
you pass --trust. Review what those extractors run before trusting them.
Once you've decided which projections are worth keeping, adopt them by ID:
projections adopt prisma-schema workspace-dependenciesAdopting writes each projection's definition into .github/projections/ and
bookmarks the pull requests where it showed the most change, so your team can
revisit them later with projections bookmark run. It never overwrites existing
files, and you can commit the definitions whenever you're ready.
To inspect an adopted projection interactively in the Projections viewer, run:
projections view show -p workspace-dependencies --choice branch --openPassing --open launches the viewer in your system browser. When a coding agent
drives the viewer, omit --open so it can open the printed URL in its in-app
browser (or in the Copilot canvas if you've installed it). You can also view a
saved bookmark with --choice bookmark:<bookmark>—run
projections bookmark list to see the bookmarks adopt created.
Built-in projections cover systems that most repositories share—workflows, schemas, and dependencies. For the systems specific to your codebase, like its registries, extension points, protocols, and pipelines, you'll want dedicated projections, usually with custom renderers built on the renderer kit. Head to Build your first projection, where a coding agent writes an extractor and renderer tailored to your codebase and shows you the result in the viewer.
Adding the Projections GitHub Action runs your adopted projections on every pull request and push. Because the best place for that step depends on how your workflows are structured—usually inside the job that already installs dependencies and builds, so nothing gets installed twice—you can let your coding agent read your workflows, suggest where it belongs, and show you the diff before editing anything:
Add Projections to this repository's CI: run `projections help agents ci` and follow what it prints.
Commit the workflow change and open a pull request. Once the run finishes, the job summary explains step by step how the pull request reshapes your systems and uploads the projection documents as an artifact. For placement tips, reviewing results, permissions, trust, and snapshots, see Add Projections to CI.
If you'd rather work directly beside your code in an editor, the Projections VS
Code extension provides an alternate workflow inside VS Code. It isn't on the
Visual Studio Marketplace yet; instead, each
GitHub release attaches a
per-platform .vsix, projections-vscode-<version>-<platform>.vsix, which
bundles the projections CLI (see
which file to download). Install it via
Extensions: Install from VSIX… in the Command Palette (⇧⌘P / Ctrl+Shift+P),
or run code --install-extension <file>.vsix. To build it from source, follow
the extension's README.
Once it's installed, open your repository in VS Code:
- Run Projections: Explore Repository from the Command Palette to browse the sweep as a visual grid, inspect any pull request cell, and check Adopt (or run Projections: Adopt…). Projections that run repository code wait for VS Code's Workspace Trust.
- Click any projection in the Projections side bar to open it in a tab that updates alongside your uncommitted edits.
- Use Add to CI… in the Explore view (or Projections: Add to CI…) to pass the CI prompt to your agent, and Projections: Open Artifact… to inspect a downloaded CI artifact.