fetch-rules

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

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "fetch-rules" with this command: npx skills add dolesshq/self-obsolescence/dolesshq-self-obsolescence-fetch-rules

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 TypeSelection Behavior
alwaysApply: trueAlways 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.mdAlways 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 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

FormatLocationDescription
.mdc.cursor/rules/Rules with YAML frontmatter for fine-grained control
.md.cursor/rules/Simple markdown rules (always applied)
AGENTS.mdRoot or subdirsSimple agent instructions (always applied in scope)
.cursorrulesRoot onlyLegacy 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.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

review-plan-implementation

No summary provided by upstream source.

Repository SourceNeeds Review
General

lint-build-loop

No summary provided by upstream source.

Repository SourceNeeds Review
General

execute-plan

No summary provided by upstream source.

Repository SourceNeeds Review
General

supabase-reset-test-gen-loop

No summary provided by upstream source.

Repository SourceNeeds Review