Droid loads your lint rules up to the git root
Droid loads Ultracite’s rules from AGENTS.md at startup, searching from your working directory up to the git root. After an edit it runs the checks the rules list, as far as its autonomy level allows, and a permission rule lets npx ultracite run without a command prompt.
Droid by FactoryChecked against Droid 0.238.0
# Ultracite Code Standards
This project uses **Ultracite**, a zero-config preset that enforces strict code quality standards through automated formatting and linting.
## Quick Reference
- **Format code**: `npx ultracite fix`
- **Check for issues**: `npx ultracite check`
- **Diagnose setup**: `npx ultracite doctor`
Oxlint + Oxfmt (the underlying engine) provides robust linting and formatting. Most issues are automatically fixable.
…- 1
AGENTS.mdUltraciteIn each folder from the working directory up to the git root, loaded at startup. - 2
.factory/AGENTS.mdEach of those folders’.factory/,.agents/and.agent/directories is checked too. - 3
apps/web/AGENTS.mdA nested file, found when Droid reads files in that tree; it refines the root file there. - 4
~/.factory/Personal instructions, also from~/.agents/or~/.agent/. Project files should override them.
How Droid reads the rules
Droid walks from your working directory to the git root, checking each folder and its .factory/, .agents/ and .agent/ directories for AGENTS.md or a compatible name. Nested files join later, when Droid reads files under them.
- Startup cap
- 80,000 characters for the instructions Droid loads when a session starts.
- Read-path cap
- 40,000 characters for files found later, as Droid reads deeper paths.
- Precedence
- Your current request beats standing instructions, nested files refine the root, and project files override personal ones.
- Other names
agents.md,Agents.md,CLAUDE.mdandClaude.mdare read too. Keep one copy; duplicates cost context.- Design rules
DESIGN.mdloads separately, as design guidelines, so UI conventions don’t need to crowdAGENTS.md.- Late discovery
- Start a session higher in the repo and a nested
AGENTS.mdloads only once Droid reads files in its tree.
Droid runs the checks, within its autonomy
Ultracite doesn’t install a Droid hook, so after an edit Droid runs the commands in AGENTS.md. Droid’s own PostToolUse hooks in .factory/hooks.json can match Create|Edit|ApplyPatch and send stderr back to Droid on exit code 2, but Ultracite doesn’t configure one yet.
{
"permissionRules": {
"version": 1,
"rules": [
{
"id": "project/ultracite",
"decision": "allow",
"reason": "Lint and format without a prompt.",
"match": { "prefix": ["npx", "ultracite", ["check", "fix"]] },
"tests": {
"match": ["npx ultracite check", "npx ultracite fix src/index.ts"],
"noMatch": ["npx ultracite init", "npx eslint ."]
}
}
]
}
}- 01Droid edits a file with
Edit,CreateorApplyPatch; at Low autonomy or above it doesn’t ask first. - 02Following
AGENTS.md, it runsnpx ultracite fixthroughExecute. - 03An
allowrule skips the command prompt; without one, Droid weighs the command’s risk against your autonomy level. - 04Droid reads what
ultracite fixcouldn’t settle and edits again.
Worth knowing about Droid
Autonomy decides what runs unasked
At Low, Droid edits files and runs low-risk commands without asking; Medium adds installs, builds and local commits; High adds riskier steps such as
git pushand migrations. Anaskrule prompts even at High, and ablockrule can’t be approved at all.Headless runs start read-only
droid execcan only read until you pass--auto low,mediumorhigh. A run that needs more than its level stops with a non-zero exit code and makes no partial changes, so CI fails clearly instead of half-fixing.Permission rules carry their own tests
Each permission rule lists commands it must and mustn’t match, and a rule whose examples fail is skipped, never turned into a block-all.
droid rules checkvalidates them without running anything.The Ultracite skill
Droid discovers skills in
.factory/skills/and in.agents/skills/, so it finds the Ultracite skill thatinitinstalls there. Run/skillsand check the Effective tab to see it.
Droid questions, answered
- Does Droid read AGENTS.md?
- Yes. At startup Droid searches from your working directory up to the git root, checking each folder and its
.factory/,.agents/and.agent/directories.ultracite init --agents droidwrites Ultracite’s rules to the rootAGENTS.md, which that search finds. - Does Droid read CLAUDE.md?
- Yes, as a compatible name, along with
agents.md,Agents.mdandClaude.md. Factory recommendsAGENTS.mdfor new guidance and warns that repeating rules under several names spends context without adding anything. - Does Droid support hooks?
- Yes. Hooks live in
.factory/hooks.jsonor~/.factory/hooks.json, and aPostToolUsehook matchingCreate|Edit|ApplyPatchruns after each edit; exit code 2 feeds its stderr back to Droid. Ultracite doesn’t set one up for Droid yet. - How do I stop Droid asking before it runs Ultracite?
- Add an
allowpermission rule fornpx ultraciteto.factory/settings.json, as above, and preview it withdroid rules check --command 'npx ultracite fix'. Project rules need workspace trust, and permission rules have to be enabled for your organization. - Can Droid fix lint errors in CI?
- Yes, with
droid execand an--autolevel; without one, a run is read-only. If a step needs more than the level you gave, the run stops with a non-zero exit code and no partial changes, so pick the lowest level that lets the job finish.
Keep going
- AgentAmpCoding agent that runs in your terminal or on per-thread cloud machines.
- AgentCodexOpenAI’s coding agent for the terminal, IDEs, the ChatGPT desktop app and cloud tasks.
- AgentGrok BuildxAI’s open-source terminal coding agent, with Claude Code-compatible rules and hooks.
- DocsAgent rulesWhat
initwrites for every agent, and how to keep it current.
Ship less slop
One command sets up your linter, formatter, editor and agents. Works with Oxlint, Biome and ESLint.