Launch offer: use code LAUNCH20 for 20% off any single pack. See the packs

Junie Guidelines Examples (.junie/AGENTS.md, rules, playbook)

Published 2026-11-22 · 5 min read · by AgentKit Co

JetBrains Junie reads project guidelines from Markdown files and adds them to every task. The file names changed in 2026: .junie/guidelines.md is now the legacy location, and the docs point you to AGENTS.md. Most guides still show the old file, and almost none explain that Junie picks one location and ignores the rest.

We checked the lookup order on 2026-11-22 against Junie's IDE plugin docs, the CLI guidelines docs and the project settings page.

Download free-junie-guidelines.zip (MIT: junie-check.py shows which files Junie will load and which it skips, plus AGENTS.md, playbook and rules templates and a 41-test test.sh)

python3 junie-check.py .

Where Junie looks, in order

# Location What happens
1 Guidelines path in Settings / Tools / Junie / Project Settings (IDE) Used if you set it. The docs say to always set it for monorepos.
2 .junie/AGENTS.md "Used exclusively and no other guidelines files are combined with it."
3 AGENTS.md in the project root Combined with .junie/playbook.md and every .junie/rules/*.md file
4 .junie/guidelines.md or .junie/guidelines/ (all .md inside) Legacy, deprecated, still supported

Junie CLI also reads a global ~/.junie/AGENTS.md (%USERPROFILE%\.junie\AGENTS.md on Windows). When both exist it includes both, and project guidelines win on conflict.

The traps

  • .junie/AGENTS.md switches off everything else. Add a short Junie-only .junie/AGENTS.md to a repo that already has a root AGENTS.md and .junie/rules/, and Junie stops reading the root file and the rules. Nothing warns you. Pick one layout.
  • The legacy file is a fallback, not an add-on. Some team guides say to keep shared rules in AGENTS.md and Junie-only lines in .junie/guidelines.md. Going by the documented order, once a root AGENTS.md exists Junie never gets to step 4, so those Junie-only lines are skipped. Put them in .junie/playbook.md or .junie/rules/ instead.
  • Only rules/*.md counts. The docs say "every .junie/rules/*.md file". Files in subfolders or with a .txt extension aren't mentioned, so don't count on them. (The legacy .junie/guidelines/ folder is different: it collects every .md inside.)
  • Nested AGENTS.md files aren't listed. Every location in the docs is at the project root. For a monorepo, set the Guidelines path or open each package as its own project.
  • Other agents' files aren't guidelines. Junie doesn't list CLAUDE.md, .cursor/rules or .github/copilot-instructions.md as guideline locations. Junie CLI offers to import them into .junie/AGENTS.md the first time it opens a project, which brings you back to the first trap if you also keep a root AGENTS.md.

junie-check.py flags all five.

Layout A: shared repo (recommended)

Use this when Junie is one of several agents in the repo. Shared rules live in the root AGENTS.md, which Codex, Copilot, Cursor and others also read. Junie-only extras go in .junie/.

AGENTS.md
.junie/
  playbook.md
  rules/
    01-testing.md
    02-no-deploy.md
.aiignore

AGENTS.md

## Commands
| Task | Command |
|---|---|
| Install | `pnpm install` |
| Test | `pnpm test` |
| Lint | `pnpm lint` |

## Rules
- Make small, targeted changes. No drive-by refactors or renames.
- Add or update tests for new behavior and run `pnpm test` before you finish.
- Never log tokens, passwords or personal data.
- Do not change the database schema without a migration file.

## Done means
- Tests and lint pass, and you list what you changed and how you checked it.

.junie/playbook.md (Junie-only)

- Start in Ask mode for anything touching more than 3 files: write the plan, then switch to Code mode.
- Run only commands from the Commands table in AGENTS.md; ask before anything else.
- When a task is done, list changed files and the exact test command you ran.

Ask and Code are Junie's two modes: Ask mode is read-only, Code mode edits and runs commands.

.junie/rules/02-no-deploy.md

- Do not edit CI workflows, deploy scripts, infrastructure or `.env*` files unless the task says so.
- Do not run deploy, publish or migration commands.

Layout B: Junie only

If only Junie works in the repo, one .junie/AGENTS.md is simplest. Just don't add a root AGENTS.md or .junie/rules/ later and expect them to load.

Guidelines aren't permissions

Guidelines are text in the prompt. To actually control what Junie can do, use the IDE settings the docs describe:

  • Action Allowlist (Settings / Tools / Junie / Action Allowlist): commands Junie may run without asking. Everything else asks first, unless you turn on Brave Mode, which JetBrains doesn't recommend.
  • .aiignore in the project root: same syntax as .gitignore. Junie asks before reading or editing those files. The docs note it still sees file names, and Brave Mode or an allowlisted command can still reach them.
.env*
secrets/
*.pem

Migrating from .junie/guidelines.md

  1. If no other agent uses the repo, rename it: git mv .junie/guidelines.md .junie/AGENTS.md.
  2. Otherwise move the shared parts to a root AGENTS.md and the Junie-only parts to .junie/playbook.md, then delete the old file.
  3. Run python3 junie-check.py . and check that nothing you care about shows up as "NOT loaded" or "ignored".

FAQ

Is .junie/guidelines.md still supported? Yes, as a deprecated fallback. It's used only when none of the newer locations exist.

Does Junie read CLAUDE.md or .cursorrules? They aren't in its guideline lookup order. Copy the shared rules into AGENTS.md.

Where do I find good starting rules? JetBrains keeps a junie-guidelines catalog for Java, Spring Boot, Nuxt, Django and Gin. Copy the parts that match your stack, then cut anything your linter already enforces.

Do guidelines apply in JetBrains AI Assistant chat? AI Assistant has its own rules feature. This page covers Junie only.

Get matching files for every tool

The free AGENTS.md generator builds a root AGENTS.md (which Junie reads) plus Cursor, Copilot, CLAUDE.md, GEMINI.md and Kiro files. The AI Coding Agent Config Kit adds 12 stack templates and prompts that audit them. More: AGENTS.md examples, AGENTS.md not working? and How to write AGENTS.md.

AgentKit Co is not affiliated with JetBrains.

AI Coding Agent Config Kit

Instruction-file templates for 12 stacks and 12 prompts that write and audit them. 34-page PDF, $14.

Not ready to buy? Start with the free PDF.

Get 10 of our most-used prompts as a free PDF from Gumroad. You will be asked for your email so Gumroad can deliver it.

Keep reading

Agent Skills (SKILL.md) Explained: Formats, Folders and SafetyWhat an Agent Skill is, how SKILL.md works, which folders Claude Code, Codex, Cursor and Copilot read, and how to write and vet one. Checked on 2026-10-17.4 min readAGENTS.md Examples: 7 Copy-Paste Files for Real Projects (2026)Seven AGENTS.md examples to copy: Next.js, Python API, Go, a monorepo with nested files, a global ~/.codex file, an override and review rules.7 min readWhat Is an AI Agent? Plain-English Guide for BeginnersWhat an AI agent is, how it differs from a chatbot or automation, and the four building blocks every agent has. No jargon.4 min read