copilot-env
AGENTS.md5 starsChanged 2 months agoMITView on GitHub
Guidance for AI coding agents in this repository. CLAUDE.md, .github/copilot-instructions.md, and .github/agents.md are symlinks to this file, so edit only here. Everything between the BEGIN and END markers is managed by the platform and replaced on every sync. This repository's own guidance goes below the END marker. copilot-env: Points the Codex and Claude CLIs at GitHub Copilot: a managed copilot-api proxy, or Copilot Direct. copilot-env wires the Codex and Claude CLIs to GitHub Copilot, either through a floating @jeffreycao/copilot-api proxy…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,337 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- web-searchSkill
The file
We split this AGENTS.md into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 41
Nothing hidden: every command names every file it writes or deletes outside copilot-env's own homes (~/.copilot-env, …
- Very specific: line 42
A personal utility, not a product: no backwards compatibility except src/migrations/ (one-time fix-ups run after agent update or a …
- Very specific: line 59
The usage index is a pre-index, never a result cache: Every agent cost report folds fresh from the files that exist now and must equal the …
- Very specific: line 61
One env init: every agent/dev environment and fresh worktree runs scripts/setup-env.sh (.ps1 on Windows).
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md 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.
Files
<!-- BEGIN REPO-PLATFORM MANAGED -->AGENTS.md
Guidance for AI coding agents in this repository. CLAUDE.md, .github/copilot-instructions.md, and .github/agents.md are symlinks to this file, so edit only here.
Everything between the BEGIN and END markers is managed by the platform and replaced on every sync. This repository's own guidance goes below the END marker.
Project
copilot-env: Points the Codex and Claude CLIs at GitHub Copilot: a managed copilot-api proxy, or Copilot Direct.
Conventions
- PR titles and commit subjects are Conventional Commits; PRs are squash-merged, so the PR title becomes the commit subject.
- CI gates on the
all-greencheck. This repository's own jobs go in the repo-ownedchecks.yml(tests, lint) andpost-green.yml(green-gated work on main);ci.ymlis managed. - Plain ASCII punctuation only; the check-typography gate enforces it.
Managed by the platform
- A file whose header says "managed by Vivswan/repo-platform" arrives by sync PR. Change it there, never here.
- The two rendered documents,
.github/repo-platform-manifest.jsonand.github/settings.yml, say "Generated by repo-platform - do not edit." and change the same way, never by hand. - Repository settings come from
.github/settings.local.yml(this repository's own) merged with the fleet layers into the rendered.github/settings.yml. Edit the local file, never the rendered one or the GitHub UI. - Module selection is the
moduleslist in.repo-platform.yml; the next sync applies a change. Contracts: the platform's docs/new-repo.md and docs/fleet-guidelines.md.
Toolchain
- bun:
bun install,bun run <script>(scripts inpackage.json) .bun-versionis managed by sync; pin another version in a repo-owned workflow's version input, not in the dotfile.biome.jsonis managed by sync and holds the fleet's lint floor; the repository's own biome settings and per-path exceptions go inbiome.local.jsonc.
Repository-specific guidance
<!-- Add project-specific instructions below the END marker; they are this repository's own and survive every sync. --><!-- END REPO-PLATFORM MANAGED -->copilot-env wires the Codex and Claude CLIs to GitHub Copilot, either through a floating @jeffreycao/copilot-api proxy it manages or to Copilot Direct.
Hard rules
- Cross-platform is non-negotiable: Linux, macOS, and Windows. Every POSIX/PowerShell pair stays feature-matched, and PowerShell must run on Windows PowerShell 5.1 as well as pwsh 7.
- Nothing hidden: every command names every file it writes or deletes outside copilot-env's own homes (
~/.copilot-env,~/.local/share/copilot-env). - A personal utility, not a product: no backwards compatibility except
src/migrations/(one-time fix-ups run afteragent updateor a reinstall); no compatibility shims or legacy-state adoption in read sites; no production hardening. Delete old surfaces outright; a flag removal is a plainfeat:/fix:. - String literals are external contracts (model ids, JSON keys, env var names, log markers): never rename them in a refactor.
- ASCII source: non-ASCII only inside string literal text.
- Layering: command files (
src/commands/) validate, orchestrate, and render; the domain layers never import them.src/scripts/holds only things that run as their own process or as the daemon's--preloadshims, never CLI handlers.
Decisions a reader would otherwise reverse
- A release is a binary, a checkout is a checkout. The same
agent installserves both and can never overwrite a checkout (src/install/installer.ts). - The proxy floats; we never patch it. Runtime needs are preload shims in
src/scripts/, never package edits (src/proxy_float.ts). agent profile envis the only output the shell wrapper evals (shell/), so a new subcommand needs no wrapper change.- One credential, resolved not baked (
src/copilot_api/env_state.ts): Direct configs never store a token copy, and there is no implicitghfallback.static-keyis the one opt-in that bakes the value, resolved once at the write owner (src/agents/configure.ts) and never re-derived by a reader. When auth is none we ask. - Truth lives in
~/.local/share/copilot-env(src/copilot_api/paths.ts): nothing outside it is ever read as truth. Agent files (config.toml,settings.json, the Claude Desktop config) are outputs: a command such asagent initoragent profile syncre-renders them from that state and corrects a stale or hand-edited copy, and nothing rewrites them without a command. - Profiles are atomic units (
src/agents/profile_wiring.ts): one credential + one mode, always both agents. A named profile hard-fails rather than falling back to the default credential. agent configis the typed preference store with a single key registry (src/copilot_api/config_registry.ts). Every read site applies explicit flag/env > stored config > built-in default.agent updateproves origin and fails closed (Sigstore provenance,src/install/provenance.ts). The installer is trust-on-first-use: verifying against the same release it was fetched from would be circular.- Claude Desktop wiring is state driven (
src/agents/claude_desktop.ts): every pass re-derives from theclaude.desktopkey and the ownership ledger, and a sweep never removes an entry it does not own. --dry-runis the same code path on an overlay, never a second one (src/utils/fs_facade.tsis the seam). A raw node:fs call insrc/outside the facade fails lint. docs/dry-run-facade.md owns the mechanism.- The usage index is a pre-index, never a result cache. Every
agent costreport folds fresh from the files that exist now and must equal the full parse. - Migrations (
src/migrations/): one file per from-version. Delete a step once its fix is re-derivable; the format it read goes with it, never into a reader. - One env init: every agent/dev environment and fresh worktree runs
scripts/setup-env.sh(.ps1on Windows). - The release gate holds only the checks required before a release that run nowhere on a PR or a push to main (
release-gate.yml): one job,release-assets, the five-target build with checksums, the release-assets prepare and validate with the installer syntax checks, and the asset presence with the host--help. The managedci.ymlcalls it on the release PR and a dispatch,nightly.ymlon the schedule;checks.ymlnever calls it.
Releases
- Releases only move forward: never re-release or pin back, and leave
release-asabsent. - A release PR's merge commit is tagged and released by its own run. A build broken at release time fails after the tag exists: re-run the failed jobs, never re-cut.
- A release that stalled is abandoned: relabel its PR
autorelease: taggedand let the next release come from a fresh commit.
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
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.

