Skip to content

[FEATURE]: Setting Glob-based rules #4716

Closed as not planned
Closed as not planned

Description

@EasyDevv

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Image

I discovered an interesting feature in Google Antigravity IDE.

Users can specify when rules should be triggered, and the glob functionality looks particularly useful.

The rules are stored in Markdown format, and when you specify glob patterns, the rules are only included for matching file types.

The general structure is as follows:

.agent/rules/frontend.md

---
trigger: glob
globs: *.svelte, *.ts
---

frontend rules

.agent/rules/AGENTS.md

---
trigger: always_on
---

main rules

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Nov 25, 2025
  2. github-actions commented on Nov 25, 2025

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  3. ljosephpratt commented on Jan 13, 2026

    @ljosephpratt

    I second this suggestion. Copilot in VS Code has something similar. It uses the folder structure .github/instructions/*.md where the markdown file has an "applyTo" frontmatter section that uses glob matching, then targeted instructions.

    Example:

    ---
    applyTo: "internal/**/service/**/*.go"
    ---
    
    Business logic services MUST:
    - depend on interfaces for all external effects
    - return concrete result structs + error

    The way I understand it works is when a file under edit matches the glob pattern, the custom instructions are automatically injected into the agent instructions that is currently running.

  4. doodhout commented on Feb 9, 2026

    @doodhout

    I don't really know if this feature has already been included in opencode yet, but I have found this opencode plugin that does something really similar: https://github.com/frap129/opencode-rules

    I would like this functionality to be included into vanilla opencode nonetheless!

  5. DerGernTod commented on Mar 13, 2026

    @DerGernTod

    this would especially be interesting for monorepos with cascading AGENTS.md (one in the root, one in each package). gh copilot automatically applies cascading agents.md, but making them accessible via instructions on glob-basis would also be a good step forward

  6. removed
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on May 3, 2026
  7. aosama commented on Jun 1, 2026

    @aosama

    Hope we can get this capability to reduce barrier to transition from Github Copilot CLI or Claude Code to OpenCode

  8. Lingxi-Li commented on Jun 20, 2026

    @Lingxi-Li

    Claude Code also provides this feature under the name path specific rules.

    For now, the closest workaround I found is to instruct the agent to lazy-load the rules using @ references in AGENTS.md (example).
    Note that this is model-driven, not a deterministic extension matcher.

  9. github-actions commented on Aug 20, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions