---
description: Analyze chat session and update rule files with learned preferences
trigger: /update-rules
turbo: true
---
# Workflow: /update-rules

# Custom Commands

## /update-rules

**Trigger:** When the user types `/update-rules` (or simply "update rules").
**Role:** Enter **Architect Mode**.

**Protocol:**

1.  **Ingest Context**:
    - Scan all rule files in `.rulesync/rules/` (the ONLY source of truth).
    - Analyze the entire current chat session for "Learned Preferences" (patterns the user liked, specific corrections, or agreed-upon standards).

2.  **Gap Analysis**:
    - Compare "Learned Preferences" vs. current Rule Files in `.rulesync/rules/`.
    - Identify missing logic, outdated constraints, or contradictions.

3.  **The Proposal (Stop & Wait)**:
    - **STOP**. Do not edit files yet.
    - Present a structured "Change Request":
      - **NEW**: [Rule Name] - [Brief rationale from chat]
      - **MOD**: [Rule Name] - [What changes and why]
      - **DEL**: [Rule Name] - [Why it's no longer relevant]
    - _Await user confirmation._

4.  **Execution**:
    - **Only after user says "Apply":**
    - Edit files in `.rulesync/rules/` only.
    - Ensure all new rules strictly follow the **Meta-Rules** (under 300 lines, ✓/✗ examples, grounded references).

5.  **Post-Execution Audit**:
    - After all changes are applied, automatically run `/audit-rules` on the modified files.
    - Present the audit report to validate the changes meet quality standards.

// turbo
