Skip to content

refactor(frontmatter): simplify the root-line check and align custom-field docs - #908

Merged
runkids merged 1 commit into
mainfrom
runkids/frontmatter-followups
Nov 14, 2026
Merged

runkids merged 1 commit into
mainfrom
runkids/frontmatter-followups

Conversation

@runkids

@runkids runkids commented Nov 14, 2026

Copy link
Copy Markdown
Owner

Type

  • Bug fix
  • Small improvement (docs, typo, minor refactor)
  • Feature proposal (proposals/ only — see CONTRIBUTING.md)
  • Approved feature or large change (the linked issue has the approved label)

Linked Issue

Follow-up to #901. No issue.

What changed

  • Helper. utils.IsRootFrontmatterLine no longer takes the caller's trimmed line. It trims the raw line itself to detect blank and comment lines. The six callers pass one argument fewer.
  • Tests. Removed the ParseFrontmatterFields "scalar projection" row and reduced TestParseFrontmatterMap_NestedMetadataPreserved to one case. Both covered code that fix(frontmatter): isolate root identity and hub index tags #901 did not change. The remaining case guards what the skill format page promises: nested metadata mappings and lists are kept.
  • Docs. The "Version tracking" example in creating-skills.md now puts version and author under metadata, matching the "Prefer metadata for custom fields" guidance added in fix(frontmatter): isolate root identity and hub index tags #901. The sentence in skill-format.md about sync preserving last_edited values is shortened to "Sync preserves the SKILL.md content." Both edits are applied to en, ja, ko, zh-Hans and zh-Hant.

Why

  • The callers disagreed on what they passed as trimmed: ParseSkillName trimmed spaces and tabs on the left, the other five trimmed all whitespace. One definition of a blank line removes that difference.
  • skillshare has no last_edited field, and the old sentence read as if it did.
  • The two doc pages contradicted each other on where custom fields go.

Behaviour

No change for realistic files. The one difference is inside ParseSkillName: a frontmatter line holding only unusual whitespace (for example a lone \r or a non-breaking space) is now treated as blank instead of as content. The returned name is the same, because the old path fell back to decoding the whole block.

Validation

In a temporary container from the devcontainer image, mounted on this branch's worktree:

  • make check passed (docs check, format check, lint, unit and integration tests, herdr tests).
  • python3 scripts/ai-context.py check passed on the host.

Not run: the website production build. The doc edits change one YAML example and one sentence per locale.

make check ran before a redundant agent-name test was dropped from the working tree; the committed tree differs from the checked one only by that removed test function. CI covers the final commit.

Not covered

  • hub index reads only root tags, while hub drafts still prefer metadata.tags in list form. Making the two agree needs a decision on direction and is left for a separate change.

Checklist

  • I've read CONTRIBUTING.md, including its AI-assisted contributions section
  • I've reviewed every line of the diff and can explain it
  • Tests included and passing (make check) — for code changes
  • No unrelated changes in the diff
  • Scope is focused — one concern per PR

…field docs

Follow-up to #901.

IsRootFrontmatterLine took the caller's trimmed line only to test for blank
and comment lines, and its callers disagreed on how they trimmed it
(ParseSkillName trimmed spaces and tabs on the left, the rest trimmed all
whitespace). The helper now trims the raw line itself, so there is one
definition of a blank line and one argument fewer to get wrong.

Two tests added in #901 covered behaviour that change did not touch. The
ParseFrontmatterFields row is removed, and the ParseFrontmatterMap test is
reduced to the one case that guards what the skill format page promises:
nested metadata mappings and lists are kept.

Docs: the skill format page now recommends metadata for custom fields, but
the "Version tracking" example in creating-skills still showed top-level
version and author. It now matches. The sentence saying sync preserves
existing last_edited values is shortened, because skillshare has no such
field and the wording suggested it does. Both edits are applied to en, ja,
ko, zh-Hans and zh-Hant.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T15:25:48.298465Z 0af995c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@runkids
runkids merged commit c88fe15 into main Nov 14, 2026
9 checks passed
@runkids
runkids deleted the runkids/frontmatter-followups branch November 14, 2026 15:41
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.

1 participant