Load global AGENTS.md into native agent system prompt#56757
Conversation
Watches a user-global AGENTS.md alongside settings.json and includes its trimmed contents in the native agent's system prompt, rendered before project-level rules so per-project guidance can override personal defaults. Missing, empty, or whitespace-only files are treated as no AGENTS.md. Read errors surface through the same notification UI as settings errors.
Collapses the previous struct (Option<content>, Option<error>) into a three-variant enum so that loaded/empty/error states are mutually exclusive, and removes the redundant UserAgentsMdStatus type since the enum now serves both as in-memory state and as the value passed to the on-change callback.
Matches the SettingsStore pattern: one wrapper struct (UserAgentsMd) holds the data plus a _watcher: Task<()> field, and the enum (now UserAgentsMdState) describes only the data variants. The watcher's lifetime is tied to the data it produces, so replacing the global cancels the watcher.
|
Rule library is removed. Where can I find my existing rules? |
This! I had custom adjustments in the commit generation prompt which was included by Zed. Where am I going to tweak it now that the rules library has been removed? |
@xybr-dev Check in
@failable Besides the Default Rules (see my response earlier in this comment), if you had any non-default Rules, those should be Skills now (in Let me know if you don't find them in those places! |
Watches a user-global
AGENTS.mdfile alongsidesettings.json(at~/.config/zed/AGENTS.mdon macOS/Linux,%APPDATA%\Zed\AGENTS.mdon Windows) and includes its trimmed contents in the native agent's system prompt.This matches the pattern used by Codex (
CODEX_HOME/AGENTS.md, defaulting to~/.codex/AGENTS.md) and OpenCode (~/.config/opencode/AGENTS.md): personal instructions live next to other app config and apply across every project the user opens.Behavior
AGENTS.md(project rules continue to come from the remote workspace).AGENTS.md.AGENTS.mdfiles are loaded today.System prompt rendering
In the system prompt, the user-global
AGENTS.mdappears as### Personal AGENTS.mdimmediately before### Project Rules, so the model sees personal defaults first and project guidance later (project rules take precedence on conflicts).Tests
user_agents_mdwatcher: initial load, empty/whitespace ignored, reacts to file edits.SystemPromptTemplate: renders personalAGENTS.mdbefore project rules; omits the section when no userAGENTS.mdis present.Closes AI-231
Release Notes:
AGENTS.mdfile alongsidesettings.json, which is included in all projects' system prompts in the Zed Agent