Skip to content

Conversation

@m4nt0de4
Copy link

@m4nt0de4 m4nt0de4 commented Feb 3, 2026

Summary

  • Moves YAML frontmatter before the HTML build comment in 00-frontmatter.md — the parseFrontmatter() regex in GenerateSkillIndex.ts uses ^--- which requires frontmatter at the very start of the file
  • Renames name: CORE to name: PAI to match the ALWAYS_LOADED_SKILLS array in GenerateSkillIndex.ts
  • Applies the same fix to the pre-built SKILL.md

Problem

CreateDynamicCore.ts assembles SKILL.md from numbered components in Components/. The first component (00-frontmatter.md) places an HTML comment before the YAML --- delimiter:

<!--
  🔨 GENERATED FILE - Do not edit directly
  ...
-->
---
name: CORE
description: ...
---

GenerateSkillIndex.ts line 80 uses:

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

The ^ anchor means this regex only matches if --- is the first content in the file. The HTML comment breaks this, causing PAI/SKILL.md to be silently skipped during index generation.

Additionally, name: CORE doesn't match ALWAYS_LOADED_SKILLS: ['PAI', ...] (line 38-44), so even if parsed, the skill wouldn't be recognized as always-loaded.

Fix

Reorder so frontmatter comes first, HTML comment second. Rename COREPAI. The CreateDynamicCore.ts timestamp injection (lines 104-108) works regardless of comment position.

Test plan

  • Run bun ~/.claude/skills/PAI/Tools/GenerateSkillIndex.ts — PAI/SKILL.md should now appear in skill-index.json
  • Run bun ~/.claude/skills/PAI/Tools/CreateDynamicCore.ts — verify the rebuilt SKILL.md has frontmatter first
  • Confirm skill-index.json lists PAI with correct name: PAI and alwaysLoaded: true

Fixes #568

🤖 Generated with Claude Code

The HTML build comment was placed before the YAML frontmatter delimiter
in 00-frontmatter.md, causing GenerateSkillIndex.ts to skip PAI/SKILL.md
entirely. The parseFrontmatter() regex uses ^--- which requires frontmatter
at the very start of the file.

Also renames `name: CORE` to `name: PAI` to match ALWAYS_LOADED_SKILLS.

Fixes danielmiessler#568

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

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

1 participant