Skip to content

Frontmatter support #10

Open
Open

Description

@jsit

Supporting frontmatter in an AGENTS.md file will allow for more fine-tuned application and UI implementation enhancements.

---
description: RPC Service boilerplate
globs: ["**/*.go", "**/*.proto"]
alwaysApply: false
---

An AGENTS.md file (or other files inside a directory, see #9) will be added to the chat context only when the conditions in its metadata are met.

description

Can be used for display in a UI when users are viewing rules or disabling/enabling them manually.

alwaysApply

  • true: This file gets automatically added to context whenever files matching globs are in context
  • false: This file appears in a menu/list for manual selection
  • Default: true

globs

File patterns that trigger this rules file when matching files are added to context, and alwaysApply is true.

  • Default: **/*

Prior art

Activity

  1. yordis commented on Aug 20, 2025

    @yordis

    The Cursor specification around the topic is quite frustrating to use, primarily because the discrimination union of the Rule Type are based on the combination of the values instead of being just a field, eg:

    kind: always | auto | requested | manual

    That would drive the correctness of the payload, I ended up having to create a complex prompting to correct the LLMs in such trivial matter because the combination of things made up the intent.

    Lastly, althou I agree that we should have some level of agreement around the topic, starting with an spec that isn't intrusive to existing tool will allow those tools to opt-in for the usage of the spec

  2. neilsh commented on Sep 2, 2025

    @neilsh

    Worth noting that Jetbrains' .aiassistant/rules/ .md files also support frontmatter, although with different fieldnames from Cursor:

    ---
    type: always on
    pattern: src/main/**/*.java
    ---
    
  3. yordis commented on Sep 2, 2025

    @yordis

    The spec could be conservative around such feature until there is a proven worth to add to the spec path forward. I rather observe that enforce the spec around the topic. Everything could add their own frontmatter as any other markdown file for the time being

  4. beingminimal commented on Sep 3, 2025

    @beingminimal

    This feature must be supported, we are already using in vs code and it's helping a lot. Thanks

  5. SinOverCos commented on Sep 11, 2025

    @SinOverCos

    I'm working on consolidating Copilot and Cursor configs into AGENTS.md to simplify things for a large team and finding that not having this feels like a regression from .cursor/rules/ + making adoption harder.

  6. karlhorky commented on Sep 12, 2025

    @karlhorky

    Thanks for this proposal and the .agents/*.md proposal in #9 🙌 I came to the repo today to open similar issues.

    An AGENTS.md file (or other files inside a directory, see #9) will be added to the chat context only when the conditions in its metadata are met.

    One minor distinction that comes up for me: it seems like front matter will be most useful in the multiple .agents/*.md files. Front matter will be less useful in AGENTS.md files (even if there are multiple AGENTS.md files in nested folders), since there's a conflict between these usage details:

    • AGENTS.md files will in most cases contain instructions for multiple file types
    • front matter is for specifying globs that all rules in the file apply to

    So it feels like probably the .agents/*.md proposal in #9 should be a prerequisite for front matter support.

  7. shueybubbles commented on Apr 16, 2026

    @shueybubbles

    CONSTITUTION.md having some frontmatter may be useful, and not for "applies to" globs. There may be some data about the entire workspace that is needful for the copilot hosting tool to pick up.

  8. ranger-ross commented on Oct 16, 2026

    @ranger-ross

    Another potential usecase for having frontmatter in AGENTS.md is around helping open source project communicate to new contributors using agents.
    For example, some projects have LLM policies, contibuting guidelines, etc that new contributors sometimes miss and are later disappointed because their contribution is rejected.

    To solve this I'd love to be able do something like:

    ---
    welcomeMessage: "Welcome, be sure to read our AI_POLICY.md"
    ---

    and have all harnesses display this message the user the first time they open the project.

    I could also see usecases were some projects do not want to accept AI contributions and so being able to have a disable: true in the frontmatter to have the harness disable itself with a notice to the user, would save the maintainers time and avoid contributors wasting tokens.

    The reason I think this is valuable in AGENTS.md is that these kinds of things are not exactly top priority for most harnesses and having a single standard would help incentive adoption.

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

Metadata

Metadata

Assignees

No one assigned

    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