rules-conflict-resolver

rules-conflict-resolver is a cursor rule for Cursor from wangqiqi/cursor-ai-rules. It costs 0 tokens per session (2,518 once invoked), scanned A, original, MIT.

A rule-management system for resolving conflicts between instructions. It uses priorities, context, user preferences, and recent use to decide which rules should take precedence, while recording those decisions.

In plain words
What is it for?
Use it to prioritize competing rules, monitor conflict handling, and keep a record of the decisions made.
Why use it?
It provides a defined way to handle conflicting rules instead of ignoring them or resolving them inconsistently.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/wangqiqi/cursor-ai-rules/rules-conflict-resolver
Clone the repo
git clone --depth 1 https://github.com/wangqiqi/cursor-ai-rules

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for rules-conflict-resolver

README.md
[![agentmods](https://agentmods.dev/badge/rules/wangqiqi/cursor-ai-rules/rules-conflict-resolver.svg)](https://agentmods.dev/rules/wangqiqi/cursor-ai-rules/rules-conflict-resolver)
Your own site
<a href="https://agentmods.dev/rules/wangqiqi/cursor-ai-rules/rules-conflict-resolver"><img src="https://agentmods.dev/badge/rules/wangqiqi/cursor-ai-rules/rules-conflict-resolver.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 2,518 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.02518
Opus 5 $0.00000 $0.01259
Sonnet 5 $0.00000 $0.00504
Haiku 4.5 $0.00000 $0.00252

Measured 5d ago against content hash 36f337f67562, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

rules-conflict-resolver scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/rules-conflict-resolver.mdc · 365 lines

How it starts

The opening of the file, as written. The whole thing — 365 lines — stays where its author put it; the contents beside it link to each section on GitHub.

⚡ 规则冲突解决和监控 (Rule Conflict Resolver & Monitor)

本文档是从 @rules-router 分割出来的冲突解决和监控部分。

⚠️ 解决原则

MUST 遵循以下冲突解决准则:

  • MUST 基于优先级矩阵解决规则冲突
  • NEVER 随意忽略或禁用冲突的规则
  • ALWAYS 记录冲突解决决策
  • DO NOT 让规则冲突影响系统稳定性
  • MUST 定期审查和优化冲突解决策略
  • ALWAYS 提供冲突解决的透明性

优先级计算模型

interface RulePriority {
  basePriority: number;     // 基础优先级
  contextBoost: number;     // 上下文提升
  userPreference: number;   // 用户偏好
  recencyBonus: number;     // 最近使用奖励
  finalPriority: number;    // 最终优先级
}

class PriorityCalculator {
  calculatePriorities(
    rules: string[],
    context: RuleActivationContext
  ): Record<string, RulePriority> {

    const priorities: Record<string, RulePriority> = {};

    for (const rule of rules) {
      const basePriority = RULE_DEPENDENCIES[rule]?.priority ?? 5;

      // 上下文提升
      let contextBoost = 0;
      if (this.isHighlyRelevant(rule, context)) {
        contextBoost += 3;
      } else if (this.isModeratelyRelevant(rule, context)) {
        contextBoost += 1;
      }

      // 用户偏好
      const userPreference = context.userPreferences?.rule_preferences?.[rule] ?? 0;

      // 最近使用奖励 (模拟)
      const recencyBonus = Math.random() * 2; // 0-2的随机值

      const finalPriority = basePriority + contextBoost + userPreference + recencyBonus;

      priorities[rule] = {
        basePriority,
        contextBoost,
        userPreference,
        recencyBonus,
        finalPriority
      };
    }

    return priorities;
  }

  private isHighlyRelevant(rule: string, context: RuleActivationContext): boolean {
    const highRelevanceMap: Record<string, string[]> = {
      "javascript": ["javascript", "typescript", "react", "vue", "node"],
      "python": ["python", "django", "fastapi", "flask"],
      "collaboration": ["team", "collaboration", "git", "merge"],
      "generator": ["create", "new", "init", "generate"],
      "eslint": ["lint", "quality", "check", "fix"]
    };

    const relevantContexts = highRelevanceMap[rule] ?? [];
    return relevantContexts.some(ctx =>
      context.userIntent.includes(ctx) ||
      context.techStack.includes(ctx) ||
      context.projectType.includes(ctx)
    );
  }

  private isModeratelyRelevant(rule: string, context: RuleActivationContext): boolean {
    // 中等相关性逻辑
    return false; // 简化实现
  }
}

Read the full file on GitHub · 365 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 365 lines · 0 tokens per session scan A 36f337f67562

Subscribe to this mod's changes

rules-conflict-resolver is a cursor rule published in the GitHub repository wangqiqi/cursor-ai-rules (16 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,518 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.