# Add Rulesync File

> Create or update a Rulesync source file (rule, command, subagent, skill, ignore, mcp, permissions, or hooks) with the Rulesync MCP Server. Use when asked to add or modify project configuration under .rulesync.

- Skill: `dyoshikawa/add-rulesync-file` (Agent Skill)
- Install (CLI): `npx skillmds@latest add dyoshikawa/add-rulesync-file`
- Raw SKILL.md: https://api.skillmd.com/api/skills/dyoshikawa/add-rulesync-file/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: dyoshikawa (https://skillmd.com/u/dyoshikawa)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/dyoshikawa/add-rulesync-file

---


# Add Rulesync File

Create or update a Rulesync source file based on the user's request using the Rulesync MCP Server.

## Input

Use the user's current request as input.

## Step 1: Analyze the Request

Parse the user's request to determine:

1. **File type**: rule, command, subagent, skill, ignore, mcp, permissions, or hooks
2. **File name**: The name/path of the file to create
3. **Frontmatter**: Required metadata fields
4. **Body content**: The main content of the file

## Step 2: Clarify Missing Information

If any of the following is unclear or missing, ask the user:

### For rule files:

- `root`: Is this a root rule file? (true/false)
- `targets`: Which tools should this apply to? (e.g., `["*"]`, `["claudecode", "cursor"]`)
- `description`: What is the purpose of this rule?
- `globs`: What file patterns should this rule apply to? (e.g., `["**/*.ts"]`)

### For command files:

- `description`: What does this command do?
- `targets`: Which tools should support this command?

### For subagent files:

- `name`: What is the subagent's name?
- `description`: What is the subagent's purpose?
- `targets`: Which tools should support this subagent?

### For skill files:

- `name`: What is the skill's name?
- `description`: What does this skill do?
- `targets`: Which tools should support this skill?

### For ignore files:

- What patterns should be ignored?

### For mcp files:

- What MCP servers should be configured?
- What are the commands and arguments for each server?

### For permissions or hooks files:

- What permissions or lifecycle hooks should be configured?

## Step 3: Create the File

Use the Rulesync MCP Server's `rulesyncTool` with the following parameters:

- `feature`: The file type (rule, command, subagent, skill, ignore, mcp, permissions, or hooks)
- `operation`: "put"
- `targetPathFromCwd`: The file path
- `frontmatter`: The metadata object (for rule/command/subagent/skill)
- `body`: The content (for rule/command/subagent/skill)
- `content`: The raw content (for ignore/mcp)

## Step 4: Confirm Creation

After creating the file, confirm to the user:

1. The file path that was created
2. A summary of the frontmatter and content
3. Run `pnpm generate` to apply changes to target tools

