Awesome-omni-skill fetch-rules
Fetch and apply Cursor-style workspace rules supporting all rule formats (.cursor/rules/*.md, *.mdc, AGENTS.md, and legacy .cursorrules).
install
source · Clone the upstream repo
git clone https://github.com/diegosouzapw/awesome-omni-skill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/diegosouzapw/awesome-omni-skill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/backend/fetch-rules" ~/.claude/skills/diegosouzapw-awesome-omni-skill-fetch-rules && rm -rf "$T"
manifest:
skills/backend/fetch-rules/SKILL.mdsource content
Fetch Rules
Purpose
This skill emulates Cursor's rule selection behavior for AI agents.
It discovers and selects rules from:
- Project Rules (
).cursor/rules/
files with frontmatter (.mdc
,description
,globs
)alwaysApply
files without frontmatter (treated as always-apply).md
- AGENTS.md files (root and nested subdirectories)
- Legacy
at repo root (deprecated but still supported).cursorrules
Rule Selection Semantics
| Rule Type | Selection Behavior |
|---|---|
| Always included |
Simple (no frontmatter) | Always included |
| Included when any candidate file matches |
| Included when prompt overlaps with description keywords |
No metadata ( only) | Included only when explicitly referenced |
| Always included when in scope (directory hierarchy) |
Candidate files come from
--files, --use-git-diff, and file-like paths found in --prompt.
Requirements
(macOS / Linux default)bash
optional (only if you usegit
)--use-git-diff
No Python, Node, or jq required.
Usage
Run commands from this skill directory (the directory containing this
SKILL.md). Do not hardcode agent install paths.
bash scripts/fetch_rules.sh --prompt "<your request>"
Optional file hints:
bash scripts/fetch_rules.sh --prompt "<request>" --files path/to/a.ts path/to/b.sql bash scripts/fetch_rules.sh --prompt "<request>" --use-git-diff
Force-include a rule by filename:
bash scripts/fetch_rules.sh --prompt "<request>" --explicit global.mdc bash scripts/fetch_rules.sh --prompt "<request>" --explicit react-patterns.md
Supported Formats
| Format | Location | Description |
|---|---|---|
| | Rules with YAML frontmatter for fine-grained control |
| | Simple markdown rules (always applied) |
| Root or subdirs | Simple agent instructions (always applied in scope) |
| Root only | Legacy format (deprecated, will be removed) |
Notes
- If multiple rules share the same filename, the rule in the closest scoped directory wins (deepest scope).
- Glob matching uses bash pattern matching (
). Cursor-style[[ file == pattern ]]
works effectively as**
in this matcher.*
files are combined hierarchically—parent directories' instructions apply alongside more specific subdirectory instructions.AGENTS.md