# Sync Rules

> Synchronize shared rules into agent context files and headers. Use when this capability is needed.

- Skill: `tomevault-io/sync-rules` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/sync-rules`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/sync-rules/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/sync-rules

---


# Sync Rules Skill

Synchronize shared rules from `shared-rules/` to all agent context files.

## Overview

This skill propagates rules from the central `shared-rules/` directory to:
- `CLAUDE.md` (this file)
- Project-level context files
- Agent-specific overrides

## Usage

```
/sync-rules
```

## Prerequisites

- Python environment available to run `scripts/sync-rules.py`.

## How It Works

1. **Read shared rules**:
   ```
   shared-rules/
   ├── core-rules.md
   ├── coding-standards.md
   ├── guardrails.md
   ├── cli-reference.md
   ├── lessons-learned.md
   └── agent-overrides/
       └── claude.md
   ```

2. **Assemble CLAUDE.md**:
   - Start with claude-specific header
   - Append shared rules in order
   - Add lessons learned at end

3. **Update timestamp**:
   ```markdown
   <!-- AUTO-GENERATED from shared-rules/ -->
   <!-- Last synced: 2026-01-22 12:00:00 -->
   ```

## Execution

```bash
python scripts/sync-rules.py
```

Or manually:
1. Read all files from `shared-rules/`
2. Concatenate in order
3. Write to `CLAUDE.md`

## File Order

1. `agent-overrides/claude.md` - Claude-specific rules (header)
2. `core-rules.md` - Core workflow rules
3. `coding-standards.md` - Coding guidelines
4. `guardrails.md` - Safety guardrails
5. `cli-reference.md` - CLI tool reference
6. `lessons-learned.md` - Lessons from past issues

## Validation

After sync, verify:
- [ ] CLAUDE.md updated
- [ ] Timestamp current
- [ ] No merge conflicts
- [ ] Rules are complete

## Outputs

- Updated `CLAUDE.md` and any derived context files.

## Error Handling

- If sync fails, stop and fix the script or inputs before continuing.
- If timestamps are stale, rerun the sync to avoid mismatched rules.

## Examples

```
/sync-rules
```

## Related Skills

- `/add-lesson` - Add a lesson before syncing rules

## When to Sync

Run sync after:
- Adding a new lesson learned
- Updating shared rules
- Before starting a new workflow
- After pulling changes from git

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/etroxtaran) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-16 -->

