aix
CLAUDE.md22 starsChanged 4 days agoMITView on GitHub
This file provides instructions and context for AI coding agents working on this project. This project uses bd (beads) for issue tracking. Run bd prime to see full workflow context and commands. When ending a work session, you MUST complete ALL steps below. Work is NOT complete until git push succeeds. MANDATORY WORKFLOW: Do NOT run bd dolt push. Beads has no dolt remote, on purpose. Pushing the beads database into this repo writes a __dolt_remote_info__ branch and a refs/dolt/data…
- Reads credentials
- Installs packages
- Commits and pushes
In this repository3 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- editor-release-researchSkill
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
14 rules. About 0 are common, 7 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 22
Use bd for ALL task tracking — do NOT use TodoWrite, TaskCreate, or markdown TODO lists
- Very specific: line 23
Run bd prime for detailed command reference and session close protocol
- Very specific: line 24
Use bd remember for persistent knowledge — do NOT use MEMORY.md files
- Distinctive: line 32
File issues for remaining work: - Create issues for anything that needs follow-up
- Very specific: line 41
Do NOT run bd dolt push. Beads has no dolt remote, on purpose.
- Distinctive: line 46
Verify: - All changes committed AND pushed
- Distinctive: line 52
NEVER stop before pushing - that leaves work stranded locally
- Distinctive: line 53
NEVER say "ready to push when you are" - YOU must push
- Distinctive: line 54
If push fails, resolve and retry until it succeeds
- Distinctive: line 67
Run the tests of one package, or one test file in it:
- Very specific: line 96
Do this for anything that can touch global config: ~/.claude.json, ~/.claude/settings.json, ~/.gemini/settings.json, …
- Distinctive: line 107
Write to the real user config only when explicitly asked to
- Very specific: line 148
Delete with safeRm, which refuses paths outside .aix and the editor config directories
- Very specific: line 152
Every CLI command extends BaseCommand.
≈ “Common” is an estimate: at least 1 in 5 of the 28,633 CLAUDE.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
Project Instructions for AI Agents
This file provides instructions and context for AI coding agents working on this project.
<!-- BEGIN BEADS INTEGRATION v:1 profile:minimal hash:ca08a54f -->Beads Issue Tracker
This project uses bd (beads) for issue tracking. Run bd prime to see full workflow context and commands.
Quick Reference
bd ready # Find available work
bd show <id> # View issue details
bd update <id> --claim # Claim work
bd close <id> # Complete workRules
- Use
bdfor ALL task tracking — do NOT use TodoWrite, TaskCreate, or markdown TODO lists - Run
bd primefor detailed command reference and session close protocol - Use
bd rememberfor persistent knowledge — do NOT use MEMORY.md files
Session Completion
When ending a work session, you MUST complete ALL steps below. Work is NOT complete until git push succeeds.
MANDATORY WORKFLOW:
- File issues for remaining work - Create issues for anything that needs follow-up
- Run quality gates (if code changed) - Tests, linters, builds
- Update issue status - Close finished work, update in-progress items
- PUSH TO REMOTE - This is MANDATORY:
Do NOT rungit pull --rebase git push git status # MUST show "up to date with origin"bd dolt push. Beads has no dolt remote, on purpose. Pushing the beads database into this repo writes a__dolt_remote_info__branch and arefs/dolt/dataref, and Vercel then tries to deploy a tree with nopackage.json, so every such deployment fails. Beads data stays local. - Clean up - Clear stashes, prune remote branches
- Verify - All changes committed AND pushed
- Hand off - Provide context for next session
CRITICAL RULES:
- Work is NOT complete until
git pushsucceeds - NEVER stop before pushing - that leaves work stranded locally
- NEVER say "ready to push when you are" - YOU must push
- If push fails, resolve and retry until it succeeds
<!-- END BEADS INTEGRATION -->Build & Test
npm install # Install dependencies for every workspace
npm run build:lib # Build the schema, core, mcp-registry-client, and cli packages
npm run standards # Lint, check formatting, and typecheck
npm test # Build what each package depends on, then run every package's testsRun the tests of one package, or one test file in it:
npm test --workspace @a1st/aix-core
npm test --workspace @a1st/aix-core -- src/__tests__/<file>Tests must go through these scripts. Each package's test script runs Vitest through
scripts/test-runner.mjs, which gives the run a temporary home directory and, on macOS, an
OS sandbox that denies writes outside it. The runner refuses to start anywhere else except a
GitHub-hosted CI runner. On Linux, AIX_TEST_DISPOSABLE=1 starts it with the temporary home
directory and no sandbox; set it only inside a container or another throwaway machine, never
on a workstation that has editor config. Do not run Vitest directly.
Manual testing
Manual testing must never write to the real user config. aix resolves the home directory from
$AIX_USER_HOME first, then $HOME, then %USERPROFILE%, and only then falls back to
os.homedir(). Point both AIX_USER_HOME and HOME at a throwaway directory to isolate a run:
SANDBOX_HOME="$(mktemp -d)"
AIX_USER_HOME="$SANDBOX_HOME" HOME="$SANDBOX_HOME" node packages/cli/bin/aixd.mjs installAIX_USER_HOMEredirects every user-scope path aix reads or writes.HOMEalso keeps the CLI's own cache and the git and npm processes aix spawns out of the real home--user-home <dir>is the per-command form ofAIX_USER_HOME. Each command prints the directory it is using, so check for that line before trusting a run- Do this for anything that can touch global config:
~/.claude.json,~/.claude/settings.json,~/.gemini/settings.json,~/.config/zed/settings.json,~/.config/github-copilot/,~/.codeium/windsurf/mcp_config.json,~/.codex/config.toml, and the~/.aix/backups/store, where aix copies every file before it changes or deletes it - User scope is the default for
install,add,remove, andsync. Running them from this repository without the override installs the rootai.jsoninto the real editor config npm run qa:sandboxgives you a scratch project and setsAIX_USER_HOME,HOME,USERPROFILE, and XDG directories to its temporary home, including for the generatedaixwrapper- Automated tests must run through the package
testortest:watchscripts, which usescripts/test-runner.mjs; do not run Vitest directly and do not add per-suite home isolation - Write to the real user config only when explicitly asked to
Architecture Overview
An npm workspace with five packages, built with turbo:
packages/schema(@a1st/aix-schema): the Zod schemas forai.json,ai.local.json, andai.lock.json, the list of editor names, and the editor support data that the docs site renders.schema.jsonis generated from the Zod schemas bynpm run generate-schemain that packagepackages/core(@a1st/aix-core): everything that reads config and writes editor filespackages/cli(@a1st/aix): the oclif CLI.bin/aixd.mjsruns the TypeScript source anddist/cli.jsis the built CLI that the tests runpackages/mcp-registry-client: a client for the official MCP Registry APIpackages/site: the Astro and Starlight docs site, deployed by Vercel
An install moves through core in this order:
discovery.tsfindsai.json, andloader.tsloads it:inheritance.tsresolvesextends, the local overrides inai.local.jsonare merged, andlockfile.tschecksai.lock.jsoneditors/install.tsasks each editor's adapter ineditors/adapters/for a list ofFileChangeobjects. An adapter delegates each section (rules, MCP, skills, prompts, hooks, agents, plugins) to a strategy ineditors/strategies/<editor>/editors/apply-file-changes.tswrites the changes. It backs up each file withbackup.ts, replaces it atomically withfs/replace-file.ts, and restores every file if one write failseditors/install-receipts.tsandstate/tracker.tsrecord what was installed, so a later install or remove deletes only what aix created
editors/import.ts reads config out of an editor for aix init --from, aix list, and
aix sync. editors/remove.ts removes one item and uses the same importer to find it.
Conventions & Patterns
- Core reaches the file system, the environment, and the home directory only through
getRuntimeAdapter()inpackages/core/src/runtime/. Do not callos.homedir()or readprocess.env.HOMEanywhere else: the adapter is what makesAIX_USER_HOMEand the test sandbox work - A change to an editor file is a
FileChangeapplied byapplyFileChanges. Do not write editor files withwriteFile. Anything else that overwrites or deletes a user's file callscreateBackupfirst and writes withreplaceFile - Delete with
safeRm, which refuses paths outside.aixand the editor config directories - Change JSON, JSONC, and TOML files by patching the existing text, so comments and unrelated
keys stay:
applyJsoncDifffrom the schema package forai.json,planJsonFileChangeineditors/adapters/base.tsfor editor JSON, andupdateTomlintoml.tsfor TOML - Every CLI command extends
BaseCommand. Reuse the flag definitions inpackages/cli/src/flags/, and resolve the scope withresolveTargetScopeso every command gives the same answer for the same project - A command that works through several editors reports each failure and calls
markFailed()so the process exits non-zero - Editor names come from
editorNamesinpackages/schema/src/editors.ts. Do not keep a second list - A change that a user can see gets an entry under
## [Unreleased]in the changed package'sCHANGELOG.md, and an update to the page inpackages/site/src/content/docs/that describes the behavior
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.

