rulesync icon indicating copy to clipboard operation
rulesync copied to clipboard

Should check if the frontmatter of a rulesync file exists

Open Piyushhbhutoria opened this issue 1 year ago • 4 comments

In the latest release cursor now supports custom commands but rulesync doesn't generate command files for cursor. cursor changelog

Piyushhbhutoria avatar Sep 23 '25 12:09 Piyushhbhutoria

Rulesync had already supported the cursor commands.

Please try npx -y rulesync@latest generate -t cursor -f commands.

cm-dyoshikawa avatar Sep 23 '25 12:09 cm-dyoshikawa

Got it, I added commands to .rulesync/commands as plain markdown files. And so the rulesync generate was not generating the files for cursor or any ai agent. I just added header attributes i.e. description and targets like below

---
root: true
targets: ["*"]
description: "Explain the selected code"
globs: ["**/*"]
cursor:
  alwaysApply: true
---

And now it works fine.

If the header data is missing rulesync silently fails internally without giving any error to user.

This is not the case when i added feature - ignore and the ignore file was missing it gave me an error something related to frontmatter.

Piyushhbhutoria avatar Sep 23 '25 12:09 Piyushhbhutoria

Your point is exactly. I will implement validation or other solutions.

By the way, your command file's frontmatter is incorrect, so I will be happy if you check this section.

cm-dyoshikawa avatar Sep 24 '25 01:09 cm-dyoshikawa

@dyoshikawa

Rulesync's frontmatter requirements seem stricter than target tools:

Feature Rulesync required Claude Code Cursor OpenCode
Commands description all optional all optional all optional
Skills name, description all optional N/A all optional
Subagents name, description all optional all optional description only

Refs: Claude Code / Cursor / OpenCode skills / OpenCode agents

Also, commands-processor.ts and skills-processor.ts use Promise.all, so one bad file fails the entire batch silently. subagents-processor.ts already handles this with try-catch + logger.warn.

I'd like to clarify the intended direction before working on this. Which approach do you prefer?

  • A: Keep current schema, fix error handling only (try-catch per file, warn and continue)
  • B: Also make all frontmatter fields optional

saitota avatar Feb 28 '26 05:02 saitota