Skip to content

validate: enforce required SKILL.md sections, description length cap, frontmatter YAML shape - #12

Closed
sergiobuilds wants to merge 1 commit into
LilMGenius:mainfrom
sergiobuilds:pr-a-validate-strengthen
Closed

sergiobuilds wants to merge 1 commit into
LilMGenius:mainfrom
sergiobuilds:pr-a-validate-strengthen

Conversation

@sergiobuilds

Copy link
Copy Markdown
Contributor

Three additional checks in scripts/validate-skills.sh, each derived by empirical measurement of the current 17 SKILL.md files so no existing skill regresses.

Checks added

1. Required structural sections

Every SKILL.md must contain ## Goal, ## Workflow, ## Rules, ## Verification.

All 17 shipped skills already carry the four sections. Enforcing them keeps new skills aligned with the shared skeleton instead of drifting into ad-hoc layouts.

2. Frontmatter description length cap

Soft limit of 800 chars on description:. Chosen above the current maximum (661, factchk) so no existing skill regresses. A longer value signals a paragraph and should be tightened.

3. Frontmatter YAML shape

The block between --- delimiters must contain at least one key: value line. Catches empty or malformed frontmatter before it reaches the plugin loader.

Verification

$ bash scripts/validate-skills.sh
✓ skill catalog valid (17 skills)

All 17 existing skills pass. Only new drift (a SKILL.md missing a section, a runaway description, or a broken frontmatter block) will trigger the new checks.

… frontmatter YAML shape

Adds three checks to scripts/validate-skills.sh:

- Required structural sections in every SKILL.md — Goal, Workflow, Rules, Verification.
  All 17 shipped skills already carry these four; enforcing them keeps new skills
  aligned with the shared skeleton instead of drifting into ad-hoc layouts.

- Frontmatter description length cap (soft: 800 chars). Longer values signal a
  paragraph and should be tightened. Chosen above the current maximum (661,
  factchk) so no existing skill regresses.

- Frontmatter YAML shape check — the block between '---' delimiters must contain
  at least one 'key: value' line. Catches empty or malformed frontmatter early,
  before it reaches the plugin loader.

Rationale — the three checks were derived by empirical measurement of the current
17 SKILL.md files: all four sections are shared, description max is 661 chars,
frontmatter is always the key:value form. Each check codifies an existing
invariant so the next drift shows up in CI, not at install time.
@sergiobuilds
sergiobuilds force-pushed the pr-a-validate-strengthen branch from 0eec305 to edd5b68 Compare July 15, 2026 12:53
@sergiobuilds

Copy link
Copy Markdown
Contributor Author

Rebased onto latest main (22 skills after the re0-* rename + new additions) and re-verified.

Cold-read flagged the PR body's "17 skills, max 661 chars (factchk)" as potentially stale under current HEAD. Re-measured:

  • 17 → 22 skills across the catalog
  • description max 661 → 655 chars (still factchk, slightly tightened upstream)
  • soft cap 800 remains comfortable — no existing skill regresses
  • all four required sections (Goal / Workflow / Rules / Verification) present on all 22
  • frontmatter YAML shape check passes for all 22

Script unchanged from the original commit — the three checks compose cleanly with the upstream additions to validate-skills.sh (JSON validation, brand-line parity, name/dir match, plugin.json/README registration, deep-ref ban, plugin.json path resolution). No overlap.

PR body updated with the current numbers.

@LilMGenius

Copy link
Copy Markdown
Owner

Landed in 08b0c02 (v0.14.0). Thanks @sergiobuilds! 💚

@LilMGenius LilMGenius closed this Jul 17, 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