Skip to content

fix: YAML parse error and invalid skill names for pi target#350

Closed
pepegar wants to merge 2 commits intoEveryInc:mainfrom
pepegar:fix/frontend-design-yaml-frontmatter
Closed

fix: YAML parse error and invalid skill names for pi target#350
pepegar wants to merge 2 commits intoEveryInc:mainfrom
pepegar:fix/frontend-design-yaml-frontmatter

Conversation

@pepegar
Copy link
Copy Markdown

@pepegar pepegar commented Mar 23, 2026

Bug 1: YAML parse error in frontend-design SKILL.md

The multi-line description field in plugins/compound-engineering/skills/frontend-design/SKILL.md contains unquoted colons (e.g. any frontend work: landing pages) which js-yaml interprets as a YAML mapping entry rather than a continuation of the scalar value.

This causes a bad indentation of a mapping entry error when running:

bunx @every-env/compound-plugin install compound-engineering --to pi
ERROR  bad indentation of a mapping entry (3:20)

 1 | name: frontend-design
 2 | description: Build web interfaces with genuine desi ...
 3 |   any frontend work: landing pages, web apps, dashb ...
------------------------^

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. The claude-to-pi converter was passing skill names through without normalization, producing invalid directory/skill names like ce:brainstorm and generate_command.

This causes pi to report skill conflicts on startup:

[Skill conflicts]
  auto (user) ~/.pi/agent/skills/ce:brainstorm/SKILL.md
    name contains invalid characters (must be lowercase a-z, 0-9, hyphens only)
  ...

Fix:

  • Apply normalizeName() to skillDirs in convertClaudeToPi (was only applied to agents/commands)
  • Strip underscores in normalizeName (pi doesn't allow them)
  • Normalize the name field in copied SKILL.md frontmatter to match the pi-safe directory name

pepegar added 2 commits March 23, 2026 10:40
…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
@pepegar pepegar changed the title fix: quote YAML description in frontend-design SKILL.md to avoid parse error fix: YAML parse error and invalid skill names for pi target Mar 23, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines 38 to 40
skillDirs: plugin.skills.map((skill) => ({
name: skill.name,
name: normalizeName(skill.name),
sourceDir: skill.sourceDir,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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, "-")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@tmchow
Copy link
Copy Markdown
Collaborator

tmchow commented Mar 23, 2026

Bug #2 is being fixed as a part of a larger PR for Pi compatibility in #288.

For Bug #1, i just opened #350 so we can fast track that for you

@tmchow tmchow closed this Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants