fetch-rules

Fetch and apply Cursor-style workspace rules supporting all rule formats (.cursor/rules/*.md, *.mdc, AGENTS.md, and legacy .cursorrules).

16 stars

Best use case

fetch-rules is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Fetch and apply Cursor-style workspace rules supporting all rule formats (.cursor/rules/*.md, *.mdc, AGENTS.md, and legacy .cursorrules).

Teams using fetch-rules should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/fetch-rules/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/backend/fetch-rules/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/fetch-rules/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How fetch-rules Compares

Feature / Agentfetch-rulesStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Fetch and apply Cursor-style workspace rules supporting all rule formats (.cursor/rules/*.md, *.mdc, AGENTS.md, and legacy .cursorrules).

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Fetch Rules 

## Purpose

This skill emulates Cursor's rule selection behavior for AI agents.

It discovers and selects rules from:

- **Project Rules** (`.cursor/rules/`)
  - `.mdc` files with frontmatter (`description`, `globs`, `alwaysApply`)
  - `.md` files without frontmatter (treated as always-apply)
- **AGENTS.md** files (root and nested subdirectories)
- **Legacy `.cursorrules`** at repo root (deprecated but still supported)

### Rule Selection Semantics

| Rule Type | Selection Behavior |
|---|---|
| `alwaysApply: true` | Always included |
| Simple `.md` (no frontmatter) | Always included |
| `globs: ...` | Included when any candidate file matches |
| `description: ...` | Included when prompt overlaps with description keywords |
| No metadata (`.mdc` only) | Included only when explicitly referenced |
| `AGENTS.md` | Always included when in scope (directory hierarchy) |

Candidate files come from `--files`, `--use-git-diff`, and file-like paths found in `--prompt`.

## Requirements

- `bash` (macOS / Linux default)
- `git` optional (only if you use `--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
bash scripts/fetch_rules.sh --prompt "<your request>"
```

Optional file hints:

```bash
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
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 |
|---|---|---|
| `.mdc` | `.cursor/rules/` | Rules with YAML frontmatter for fine-grained control |
| `.md` | `.cursor/rules/` | Simple markdown rules (always applied) |
| `AGENTS.md` | Root or subdirs | Simple agent instructions (always applied in scope) |
| `.cursorrules` | 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 (`[[ file == pattern ]]`). Cursor-style `**` works effectively as `*` in this matcher.
- `AGENTS.md` files are combined hierarchically—parent directories' instructions apply alongside more specific subdirectory instructions.

Related Skills

langsmith-fetch

16
from diegosouzapw/awesome-omni-skill

Debug LangChain and LangGraph agents by fetching execution traces from LangSmith Studio. Use when debugging agent behavior, investigating errors, analyzing tool calls, checking memory operations, or examining agent performance. Automatically fetches recent traces and analyzes execution patterns. Requires langsmith-fetch CLI installed.

framer-motion-rules

16
from diegosouzapw/awesome-omni-skill

Defines framer motion is being used for animations

economic-calendar-fetcher

16
from diegosouzapw/awesome-omni-skill

Fetch upcoming economic events and data releases using FMP API. Retrieve scheduled central bank decisions, employment reports, inflation data, GDP releases, and other market-moving economic indicators for specified date ranges (default: next 7 days). Output chronological markdown reports with impact assessment.

data-fetching

16
from diegosouzapw/awesome-omni-skill

Data fetching architecture guide using Service layer + Zustand Store + SWR. Use when implementing data fetching, creating services, working with store hooks, or migrating from useEffect. Triggers on data loading, API calls, service creation, or store data fetching tasks.

data-fetching-patterns

16
from diegosouzapw/awesome-omni-skill

Explains data fetching strategies including fetch on render, fetch then render, render as you fetch, and server-side data fetching. Use when implementing data loading, optimizing loading performance, or choosing between client and server data fetching.

cursor-rules-synchronizer

16
from diegosouzapw/awesome-omni-skill

Synchronizes Cursor Rules (.mdc files in .cursor/rules/) to CLAUDE.md by generating a Rules section with context-efficient descriptions and usage instructions. Use when setting up Cursor Rules for the first time, after adding or modifying rules, or when the Rules section in CLAUDE.md is missing or outdated.

cursor-rules-review

16
from diegosouzapw/awesome-omni-skill

Audit Cursor IDE rules (.mdc files) against quality standards using a 5-gate review process. Validates frontmatter (YAML syntax, required fields, description quality, triggering configuration), glob patterns (specificity, performance, correctness), content quality (focus, organization, examples, cross-references), file length (under 500 lines recommended), and functionality (triggering, cross-references, maintainability). Use when reviewing pull requests with Cursor rule changes, conducting periodic rule quality audits, validating new rules before committing, identifying improvement opportunities, preparing rules for team sharing, or debugging why rules aren't working as expected.

metadata-and-seo-rules

16
from diegosouzapw/awesome-omni-skill

Focuses on optimizing metadata and SEO to improve discoverability of the documentation.

vercel-kv-database-rules

16
from diegosouzapw/awesome-omni-skill

Defines how to interact with Vercel's KV database for storing and retrieving session and application data.

python-fastapi-scalable-api-cursorrules-prompt-fil

16
from diegosouzapw/awesome-omni-skill

Apply for python-fastapi-scalable-api-cursorrules-prompt-fil. --- description: Defines conventions specific to FastAPI usage in the backend. globs: backend/src/**/*.py

python-django-best-practices-cursorrules-prompt-fi

16
from diegosouzapw/awesome-omni-skill

Apply for python-django-best-practices-cursorrules-prompt-fi. --- description: Configurations for Django settings file with the list of dependencies and conventions. globs: **/settings.py

pre-configured-apis-rules

16
from diegosouzapw/awesome-omni-skill

Rules for using pre-configured APIs in the project, using them only if they are required by the project.