Skip to content
Ultracite
Esc
↑↓navigate↵open⌘Jpreview

Junie reads AGENTS.md unless .junie has its own

Junie reads Ultracite’s rules from the project-root AGENTS.md, along with .junie/rules/, as long as there’s no .junie/AGENTS.md to take its place. It has no hook that runs after an edit, so Junie runs ultracite fix and ultracite check when the rules tell it to, once you approve the command or allowlist it.

Junie by JetBrainsChecked against Junie CLI 26.10.5

# 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.

…
Ultracite’s rules
Where Junie looks for instructions
  1. 1Guidelines pathA file set in Settings | Tools | Junie | Project Settings (IDE) or guidelines-location (CLI) replaces the defaults below.
  2. 2.junie/AGENTS.mdIf .junie/AGENTS.md exists, Junie uses it on its own and combines nothing else with it.
  3. 3AGENTS.mdUltraciteThe project-root file init writes, read when there’s no .junie/AGENTS.md, together with .junie/playbook.md and every .junie/rules/*.md.
  4. 4.junie/guidelines.mdThe legacy location (or a .junie/guidelines/ folder), still read as the last fallback.
  5. 5~/.junie/AGENTS.mdJunie CLI adds your global AGENTS.md from here to the project’s guidelines; the project wins on conflicts.

How Junie reads the rules

Junie takes one set of project guidelines, found in a fixed order, and Junie CLI adds your global file. The root AGENTS.md counts only when nothing ahead of it in that order exists.

One project file
With no custom path, the IDE uses .junie/AGENTS.md exclusively when it exists, so the root AGENTS.md and .junie/rules/ are skipped.
Imports
The first time Junie CLI opens a project, it looks for other agents’ instruction files and offers to import them into .junie/AGENTS.md, which then comes first.
Global
~/.junie/AGENTS.md (%USERPROFILE%\.junie\AGENTS.md on Windows) applies to every project in Junie CLI. Identical global and project content is used once.
Precedence
When global and project guidelines conflict, the project’s win. Both are included and marked so Junie can tell them apart.
Trust
Junie CLI doesn’t load an untrusted project’s guidelines, skills or hooks. Non-interactive runs are always trusted, since they can’t ask.
Config files
guidelines-location in ~/.junie/config.json, or in a trusted project’s .junie/config.json, points Junie CLI at another file. Command-line flags override both.

Junie runs the checks AGENTS.md lists

Junie has no event that fires after it edits a file: Junie CLI’s hooks, still in Early Access, fire on session start and end, prompts, tool calls before they run, permission requests and task completion. So the loop is the one in AGENTS.md, and an allowlist rule saves you approving each ultracite run.

{
  "defaultBehavior": "ask",
  "rules": {
    "executables": {
      "rules": [
        { "prefix": "npx ultracite", "action": "allow" }
      ]
    }
  }
}
  1. 01Junie edits files as it works through its plan.
  2. 02The rules in AGENTS.md tell it to run npx ultracite fix, which it does in the terminal.
  3. 03Junie asks before running the command unless it’s on the Action Allowlist or Brave mode is on.
  4. 04It reads the output and fixes what ultracite fix couldn’t before handing the task back.

Worth knowing about Junie

  • A Stop hook can hold the task open

    Junie CLI’s Stop hook (Early Access) runs before a task is submitted. Exit with code 2 and Junie feeds your stderr back to the agent and retries, up to 8 times in a row unless JUNIE_STOP_HOOK_BLOCK_CAP says otherwise. Hooks load from ~/.junie/config.json or a --config-location file, never from the project’s own .junie/config.json, and Ultracite doesn’t set one up.

  • Allowlists check every part of a command

    An allowlist rule approves a command only when every command in it is allowed: each side of &&, anything inside $(…) or backticks, and process substitutions. A command spread over several lines always asks. Rules run top to bottom and the first match wins.

  • Review each file before you keep it

    In the IDE, Junie links each change to the diff viewer as it works. When the task is done, the Done panel lists every changed file, so you can revert files one by one before you accept or reject the result.

  • The Ultracite skill

    Junie loads skills from .junie/skills/ and ~/.junie/skills/, and Junie CLI also reads .agents/skills/ in a trusted project. init installs the Ultracite skill into .agents/skills/, and into .junie/skills/ as well when the project has a .junie folder.

Junie questions, answered

Does Junie read AGENTS.md?
Yes. With no custom guidelines path, Junie uses .junie/AGENTS.md if it exists; otherwise it reads the project-root AGENTS.md together with .junie/playbook.md and any .junie/rules/*.md. ultracite init --agents junie writes Ultracite’s rules to the root file.
Why isn’t Junie following my AGENTS.md?
Look for a .junie/AGENTS.md. In the IDE it’s used exclusively, so the root file is skipped; merge the two, or set the Guidelines path. In Junie CLI, also check that you trusted the project, since an untrusted project’s guidelines don’t load.
Does Junie support hooks?
Junie CLI does, in Early Access: SessionStart, UserPromptSubmit, PreToolUse, PermissionRequest, Stop, StopFailure and SessionEnd. There’s no event after a file edit, and Ultracite doesn’t configure Junie hooks.
How do I let Junie run ultracite without asking?
Pick Always allow when Junie CLI asks, or add a prefix rule for npx ultracite under executables in ~/.junie/allowlist.json. The IDE keeps its own list under Settings | Tools | Junie | Action Allowlist.
Can I point Junie CLI at a different guidelines file?
Yes. Set guidelines-location in ~/.junie/config.json, or in the project’s .junie/config.json once you trust the project. A relative path resolves from the folder that holds that config.json.

Ship less slop

One command sets up your linter, formatter, editor and agents. Works with Oxlint, Biome and ESLint.