dotfiles / constants
AGENTS.md16 starsChanged 48 days agoMITView on GitHub
Every value true about this machine — paths, browser of the day, chat ids, proxies — so nothing hardcodes them again. KEY=value, no quotes, no export; the value is the rest of the line verbatim. # only at line start — inline it lands inside the value. $HOME is the one expansion every reader does; ${HOME} is not. NONE means this Mac has no such thing (no work proxy on m1pro): check.py skips its type, and render writes it as…
- Reads credentials
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 33,398 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 repository50 other files it gives its agents.
- ableton/AGENTS.mdAGENTS.md
- AGENTS.mdAGENTS.md
- aichat/AGENTS.mdAGENTS.md
- aider/AGENTS.mdAGENTS.md
- annepro2/AGENTS.mdAGENTS.md
- applesauce/AGENTS.mdAGENTS.md
- atuin/AGENTS.mdAGENTS.md
- btop/AGENTS.mdAGENTS.md
- chromium-vimium-extension/AGENTS.mdAGENTS.md
- claude-code/AGENTS.mdAGENTS.md
- codex/AGENTS.mdAGENTS.md
- contextMenu/AGENTS.mdAGENTS.md
- cron/AGENTS.mdAGENTS.md
- docker/AGENTS.mdAGENTS.md
- docker-logger/AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- dotfiles_tests/AGENTS.mdAGENTS.md
- eza/AGENTS.mdAGENTS.md
- firefox-vimium-addon/AGENTS.mdAGENTS.md
- fork/AGENTS.mdAGENTS.md
- git/AGENTS.mdAGENTS.md
- hammerspoon/AGENTS.mdAGENTS.md
- heroic/AGENTS.mdAGENTS.md
- homebrew/AGENTS.mdAGENTS.md
- iina/AGENTS.mdAGENTS.md
- install/AGENTS.mdAGENTS.md
- iterm/AGENTS.mdAGENTS.md
- jetbrains rider/AGENTS.mdAGENTS.md
- karabiner/AGENTS.mdAGENTS.md
- lazydocker/AGENTS.mdAGENTS.md
- lazygit/AGENTS.mdAGENTS.md
- macos/AGENTS.mdAGENTS.md
- macos_cleanup/AGENTS.mdAGENTS.md
- macos_shortcuts/AGENTS.mdAGENTS.md
- macos_update/AGENTS.mdAGENTS.md
- marta/AGENTS.mdAGENTS.md
- noti/AGENTS.mdAGENTS.md
- npm/AGENTS.mdAGENTS.md
- opencode/AGENTS.mdAGENTS.md
- python/AGENTS.mdAGENTS.md
- qdrant/AGENTS.mdAGENTS.md
- rtk/AGENTS.mdAGENTS.md
- tmux/AGENTS.mdAGENTS.md
- uv/AGENTS.mdAGENTS.md
- voiceink/AGENTS.mdAGENTS.md
- vscode/AGENTS.mdAGENTS.md
- xcode/AGENTS.mdAGENTS.md
- zap/AGENTS.mdAGENTS.md
- zsh/AGENTS.mdAGENTS.md
- claude-code/CLAUDE.mdCLAUDE.md
The file
We split this AGENTS.md into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 3
Every value true about this machine — paths, browser of the day, chat ids, proxies — so nothing hardcodes them again.
- Very specific: line 41
Every $ expands, comments included — a literal one needs \$.
≈ “Common” is an estimate: at least 1 in 5 of the 43,423 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
constants/
Every value true about this machine — paths, browser of the day, chat ids, proxies — so nothing hardcodes them again.
| File | Role |
../constants.env | This Mac's values. Not in git: each Mac keeps its own. |
../constants.example.env | Generated from schema.toml (every key's about and example); install.sh copies it to constants.env on a new Mac. Never edit it by hand. |
load.zsh | Exports them, via zsh/exports.sh → every shell, service, cron job. |
constants.py | from constants import K, where there is no shell. |
../hammerspoon/constants.lua | require("constants") — in hammerspoon/, the only path its require sees. |
render-all.zsh | Runs every */render.zsh. Called by const sync, install/07-config-links.sh, up. |
template.zsh | render <config> → ~/.local/state/dotfiles/generated/<same name>. |
../<app>/render.zsh | Two lines: source template.zsh, render that config. Today git/, nuget/. |
../zsh/bin/const | The CLI — how an AI agent reads a value. |
schema.toml | One line per key: type, about, example, and the flags below. A private key's example is a placeholder, never the real value. |
check.py | Holds the file, the schema and the consumers to each other. Runs on every commit; const check adds the checks that need this machine. |
KEY=value, no quotes, no export; the value is the rest of the line verbatim.
# only at line start — inline it lands inside the value. $HOME is the one
expansion every reader does; ${HOME} is not. NONE means this Mac has no
such thing (no work proxy on m1pro): check.py skips its type, and render
writes it as empty, which git and NuGet read as "off".
$APP_BROWSER # already exported in any shell
const app.browser # dots and case normalise to APP_BROWSER
const list DIR_ # namespaces: ME_ APP_ DIR_ DIRS_ FILE_ TG_ PROXY_ HOST_ MODEL_Generated consumers
git config and NuGet XML expand nothing, so their configs are templates: the repo
file keeps its ordinary name (git/identity.gitconfig, nuget/NuGet.Config) and
holds ${CONSTANT} — edit that one, then const sync. <app>/render.zsh
expands it into ~/.local/state/dotfiles/generated/, where the ~/.nuget
symlink and the git/gitconfig include point. A new consumer is one two-line
render.zsh, registered nowhere.
Every $ expands, comments included — a literal one needs \$; an unknown name
aborts the render instead of writing empty. Nothing generated is in the repo: if
git asks who you are, the render never ran.
Schema and checks
A key exists in constants.env and in schema.toml, or in neither. Types:
text email timezone app bundle cli dir file chat_id url host. Flags:
private = true— the value identifies the owner or the employer. It decides which keys leave the public half of the file when the repo is published, and it makes the value a forbidden literal everywhere else.unread = true— nothing reads the key yet. A baseline, not a permission: a new key without a reader fails, and the flag fails once a reader appears.removable = true— a path that is allowed to be absent (an external drive).
check.py fails a commit on:
- a value that does not fit its type, or a line the four loaders (
load.zsh,const,constants.py,constants.lua) would read differently — it runs all four on the real file and compares; - a key nobody reads, and a reference to a key that does not exist (
K["X"],constants.X,"@APP_X",const x.y,$Xin a constants namespace); - a staged line that hardcodes a private value or the home path. Only added
lines count, so the existing ones do not block;
const literalslists them all. A format that can expand nothing goes into[literals] allow.
const check adds: paths exist, apps are installed, CLIs are on PATH.
Tests: python3 constants/test-check.py.
Rules
- A value belongs here when a second consumer needs it — not every string.
- Secrets stay in
constants.env, which is not committed. - Adding a key is two lines — its schema entry with an
example, and its value in yourconstants.env. The commit hook (check.py) rewritesconstants.example.envwhen the schema changed and asks you to stage it. Other Macs get the key from the example only on a fresh install: add it to theirconstants.envby hand. - Consumers read the constant, never copy it.
hammerspoon/browsers.lua:APP_BROWSERpicksM.main, unknown name fails loudly. app = "@APP_BROWSER"in a keyboard chord resolves in three places that must stay in step:HotKeys.spoon/init.lua,docs/keyboard/parse_active.py,docs/keyboard/app_constants.py.APP_*is the role vocabulary of the keyboard layout: a chord binds@APP_IDE, notRider. Adding a role means a chord (or another consumer) exists for it;_BUNDLEand_CLIsuffixes are companions of the same role, not roles.
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.

