Error: Invalid frontmatter when importing Claude commands
Ay,
[rulesync 12:04:30 PM] ERROR Error: Invalid frontmatter in /xxx/.claude/commands/save-requirement.md: Zod raw error: [{"expected":"string","code":"invalid_type","path":["argument-hint"],"message":"Invalid input: expected string, received array"}]
When trying to do rulesync import --targets claudecode --features rules,mcp,commands,subage nts
Example in one of my .claude command file :
---
description: Break down a requirement into AI-generated tasks
allowed-tools: >-
Bash(braingrid:*), Bash(git:*), Bash(npm:*), Read, Grep, Glob,
Skill(braingrid-cli)
argument-hint: [requirement-id]
---
Expected : [] format should work when importing commands with rulesync.
@KrustyHack Thank you. It seems a bug.
I looked into this — it's not clearly a bug, but rather a YAML syntax issue.
argument-hint: [requirement-id] is parsed by YAML as an array ["requirement-id"], not a string. Quoting it fixes the issue:
argument-hint: "[requirement-id]"
For reference:
Mind closing this? @dyoshikawa @KrustyHack
Not sure because the frontmatter wasn't generated by me but by rulesync.
So yes, if I modify the front matter myself, it will work.
But in this case, it was generated automatically by rulesync.
I couldn't reproduce this with the current version. Could you share the exact steps to reproduce? Specifically, what files you had and where, and what command you ran. @KrustyHack
Ok maybe it was with the old version then. I don't use rulesync anymore at the moment. But if you validated it then I think this "bug" could be closed. 👍
@saitota Thank you for the handling it!