Source of truth: crates/core/src/workspace/mod.rs.
find_project_root(start) walks upward and stops at first match:
.quavil/directory.claude/directory.gitmarker- fallback to start path
ConfigSource is assigned in this priority:
Quavilwhen.quavil/existsClaudeCodewhen.claude/existsCursorwhen.cursorrulesexistsGitOnlywhen.gitexistsNone
load_rules selects first non-empty primary file:
AGENTS.md.quavil/rules.md.quavil/instructions.mdCLAUDE.md.cursorrules
Then optional local preferences:
QUAVIL.local.md.quavil/local.md
Then modular rules from .quavil/rules/*.md:
- sorted by filename
- unconditional rule bodies appended
- conditional rules (
paths:frontmatter) skipped in general load path
load_conditional_rules(root, file_path):
- scans
.quavil/rules/*.md - extracts
paths:patterns from frontmatter - applies lightweight glob matching
- returns bodies whose pattern matches target file path
Supported matching helpers:
simple_glob(*wildcard)- partial
**handling inglob_matches
scaffold_quavil_dir(root) creates:
.quavil/config.toml.quavil/rules.md.quavil/rules/directory.quavil/commands/directory.quavil/commands/review.mdQUAVIL.local.md
It also appends to .gitignore when needed:
QUAVIL.local.md.quavil/local.md
Rule and workspace resolution directly affects:
- system prompt construction
- agent behavior consistency across tools/editors
- local-vs-committed preference separation