How to use directory paths and multiple glob patterns in YML rules?

All questions below are related to yml rules.

If I write a path with a directory in globs, the rule is not activated. For example:

  • “tmp/tmp.md” is not activated
  • “tmp.md”, “**/tmp.md” is activated

Can I use multiple patterns in globs? If so, how?

OS: Windows 11
Software: Antigravity

Hi @Darlene_Keltner ,

Thank you for reaching out.

Here is how directory paths and multiple glob patterns work in .agents/rules/*.md YAML frontmatter:

  1. Using Directory Paths in globs (**/tmp/tmp.md):

    • Because the glob matcher evaluates patterns against the resolved file path (and normalizes Windows \ separators), a bare relative path like tmp/tmp.md without a leading globstar (**/) will not match the full path.
    • To target a specific folder, prefix the directory path with **/ using forward slashes (for example, **/tmp/tmp.md or **/tmp/**/*.md).
    • Alternative for Folder-Specific Rules: You can also place a GEMINI.md or AGENTS.md file directly inside the tmp/ directory—Antigravity automatically loads directory-level GEMINI.md / AGENTS.md files whenever the agent works in that folder or its subdirectories.
  2. Using Multiple Glob Patterns in globs:

    • Yes, you can specify multiple patterns by passing a comma-separated string in the globs field alongside trigger: glob:
      
      trigger: glob
      globs: "**/tmp/*.md, src/**/*.ts, *.py"
      
      
      

For more details on rule activation modes and file locations, please refer to the official Rules & Workflows documentation.