Skip to content

[Bug] CreateDynamicCore.ts generates SKILL.md with frontmatter after HTML comment, breaking GenerateSkillIndex #568

@m4nt0de4

Description

@m4nt0de4

Summary

skills/PAI/Tools/CreateDynamicCore.ts generates skills/PAI/SKILL.md with an HTML build comment before the YAML frontmatter block. This causes GenerateSkillIndex.ts to skip the PAI/CORE entry entirely when building skill-index.json.

Root Cause

CreateDynamicCore.ts outputs:

<!--
  🔨 GENERATED FILE - Do not edit directly
  Edit:   ~/.claude/skills/PAI/Components/
  Build:  bun ~/.claude/skills/PAI/Tools/CreateDynamicCore.ts
  Built:  31 January 2026 20:28:06
-->
---
name: CORE
description: Personal AI Infrastructure core...
---

GenerateSkillIndex.ts line 80 uses:

const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---/);

The ^ anchor requires --- as the first characters in the file. The HTML comment pushes frontmatter down, so the regex never matches.

Secondary issue: The frontmatter says name: CORE but ALWAYS_LOADED_SKILLS (line 38 in GenerateSkillIndex.ts) lists 'PAI', so even if parsed, the tier classification would be wrong.

Impact

  • skill-index.json is missing the PAI/CORE entry
  • 22 skills reference SkillSearch() which queries this index
  • The core system skill is invisible to dynamic skill discovery

Suggested Fix

In CreateDynamicCore.ts, move the HTML build comment after the frontmatter:

---
name: PAI
description: Personal AI Infrastructure core...
---
<!--
  🔨 GENERATED FILE - Do not edit directly
  ...
-->

Or alternatively, update the regex in GenerateSkillIndex.ts to skip leading HTML comments before matching frontmatter.

Also update name: COREname: PAI to match the v2.5 directory rename and ALWAYS_LOADED_SKILLS array.

Related

Environment

  • Linux/WSL2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions