fix: YAML parse error and invalid skill names for pi target#350
fix: YAML parse error and invalid skill names for pi target#350pepegar wants to merge 2 commits intoEveryInc:mainfrom
Conversation
…e error The multi-line description contained unquoted colons (e.g. 'any frontend work: landing pages') which js-yaml interprets as a mapping entry, causing a 'bad indentation of a mapping entry' error during plugin installation.
Pi requires skill names to contain only lowercase a-z, 0-9, and hyphens. The converter was passing skill names through without normalization, causing names like 'ce:brainstorm' and 'generate_command' to produce invalid skill directories. Changes: - Apply normalizeName() to skillDirs in convertClaudeToPi - Strip underscores in normalizeName (pi doesn't allow them) - Update writePiBundle to also normalize the name field in copied SKILL.md frontmatter to match the directory name - Update test expectation for the stricter normalization
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ff1a8e8313
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| skillDirs: plugin.skills.map((skill) => ({ | ||
| name: skill.name, | ||
| name: normalizeName(skill.name), | ||
| sourceDir: skill.sourceDir, |
There was a problem hiding this comment.
Deduplicate normalized Pi skill names
skillDirs now normalizes pass-through skill names, but unlike prompts and generated skills those names never go through uniqueName(). If a plugin ships both foo_bar and foo-bar (or ce:plan and ce-plan), both entries collapse to the same Pi directory name and writePiBundle() copies the second one over the first. That silently drops a skill for any plugin with colliding normalized names.
Useful? React with 👍 / 👎.
| .replace(/[\\/]+/g, "-") | ||
| .replace(/[:\s]+/g, "-") | ||
| .replace(/[^a-z0-9_-]+/g, "-") | ||
| .replace(/[^a-z0-9-]+/g, "-") |
There was a problem hiding this comment.
Align Pi subagent normalization with converted skill names
This change starts converting underscore-containing skill names to hyphens, but the shipped Pi compatibility extension still preserves underscores when resolving subagent inputs (src/templates/pi/compat-extension.ts:38-45). In practice, a direct subagent(agent: "generate_command") call now tries /skill:generate_command even though the converter installs that skill as generate-command, so underscore-named skills become unreachable unless every caller knows about the rename.
Useful? React with 👍 / 👎.
Bug 1: YAML parse error in frontend-design SKILL.md
The multi-line
descriptionfield inplugins/compound-engineering/skills/frontend-design/SKILL.mdcontains unquoted colons (e.g.any frontend work: landing pages) whichjs-yamlinterprets as a YAML mapping entry rather than a continuation of the scalar value.This causes a
bad indentation of a mapping entryerror when running:Fix: Quote the description string so colons are treated as literal characters.
Bug 2: Invalid skill names for pi target
Pi requires skill names to contain only lowercase
a-z,0-9, and hyphens. Theclaude-to-piconverter was passing skill names through without normalization, producing invalid directory/skill names likece:brainstormandgenerate_command.This causes pi to report skill conflicts on startup:
Fix:
normalizeName()toskillDirsinconvertClaudeToPi(was only applied to agents/commands)normalizeName(pi doesn't allow them)namefield in copied SKILL.md frontmatter to match the pi-safe directory name