- name
- add-rulesync-file
- description
- 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.
- targets
- ["*"]
# 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
Voir sur GitHub