8000 Support instructions scoped to part of the repository · Issue #47 · dominikbraun/openlune · GitHub
[go: up one dir, main page]

Skip to content

Support instructions scoped to part of the repository #47

Done

Description

@dominikbraun

Problem

instructions is a single source file published as the client's project-wide instructions. A repository with distinct areas (a frontend and a backend, generated code, a docs tree) cannot give guidance that applies only there. Everything goes into one always-loaded file, or maintainers keep hand-written native rule files next to the OpenLune setup, which is the duplication OpenLune exists to remove.

The brief lists scoped instructions as a later possibility.

Proposal

Make instructions a map of named entries, like agents, skills and mcp. An entry without paths applies to the whole repository; an entry with paths applies only there:

instructions:
  project:
    source: instructions.md
  frontend:
    source: instructions/frontend.md
    paths: ["web/**"]
  • Each entry is a resource with an ID, published and owned separately, with literal source bytes preserved. Project instructions no longer need an empty ID as a special case.
  • Scope comes from paths, not from the name. project is a convention, not a reserved ID.
  • At most one entry may omit paths to start, because every client has a single project-wide file. paths: [] is an error, not a synonym for omitted.
  • paths are passed to the client's native matcher unchanged; OpenLune does not evaluate globs.
  • A client that cannot express the scope renders its closest behavior as a deviation naming the outcome, for example "applies to the whole repository".
  • This replaces instructions.source. OpenLune has not been released yet, so breaking existing manifests is fine and needs no migration or compatibility path. The old form gets an error naming the new one.

Native forms, from memory of each client's documentation and not rechecked or run:

Client Scoped instructions
Claude Code .claude/rules/*.md with paths frontmatter
Copilot .github/instructions/*.instructions.md with applyTo
Cursor .cursor/rules/*.mdc with globs
Codex nested AGENTS.md per directory; no glob matching
Antigravity to be checked

Open questions

  • Glob dialects differ between clients. Is passing the pattern through acceptable, or does that break the "declare once" promise for anything beyond simple directory prefixes?
  • Codex scopes by directory only. Is a pattern that is a plain directory prefix published as a nested AGENTS.md, and anything else a deviation? A nested AGENTS.md may already exist and be unmanaged.
  • Native rule files have further modes (always apply, apply on request with a description). Is path scope alone enough to start?

Activity

  1. added
    enhancement
    on Nov 23, 2026
  2. added this to the v0.1.0 milestone on Nov 26, 2026
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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0