Skip to content

fix(codex-plugin): make every skill's front matter valid YAML - #852

Merged
amiddavid merged 1 commit into
mainfrom
feat/codex-yaml
Nov 2, 2026
Merged

amiddavid merged 1 commit into
mainfrom
feat/codex-yaml

Conversation

@amiddavid

@amiddavid amiddavid commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Behavior change

  • Who: Codex users of the context-guru plugin.
  • Old: the session skill's front matter does not parse in strict YAML. Codex (serde_yaml) may not load the skill.
  • New: the skill parses and loads. Its description text changes only in punctuation.
  • Turn off: revert this PR. Nothing else changes.

Data dependence

None. Nothing new is stored or read.

What changed

  1. codex-marketplace/plugins/context-guru/skills/session/SKILL.md: the description uses parentheses instead of a bare : .
  2. New context-guru-plugin/skill_frontmatter_test.go: TestEverySkillFrontMatterIsValidYAML. It parses the front matter of all 19 Claude Code skills and all 16 Codex skills with gopkg.in/yaml.v3 (already in go.mod). It also checks that each has a name and a description.

#850 (merged) already fixed the same defect in the Claude Code session and timeline skills. The new test is in its own file, apart from #850's skill_listing_test.go.

How it was tested

  • CGO_ENABLED=1 go test -race -count=1 ./context-guru-plugin/... on the eval box: ok (332 s, rebased on main after feat(plugin): keep display-only skills out of the model's skills list #850).
  • Mutation: I put the bare : back in the Codex session description. The test failed with yaml: line 2: mapping values are not allowed in this context. I restored the line, and the test passed.
  • python3 -m pytest codex-marketplace/plugins/context-guru/scripts/test_codex_plugin.py: 35 passed.

🤖 Generated with Claude Code

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 1 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.316 offload-review skill, @amiddavid's session fresh 1 of 2 1 of 2 89362b96b28d approve

Verdict: approve

Findings

None. The fix is correct and the new test guards it.

Non-blocking

  • context-guru-plugin/skill_frontmatter_test.go:16 — the test covers the two shipped skill trees only. The repo's own .claude/skills/*/SKILL.md files carry the same front matter and are parsed by Claude Code, but no test guards them. Both parse today (I checked). A same-class defect could land there unnoticed.
  • context-guru-plugin/skill_frontmatter_test.go:16 — the test reads ../codex-marketplace/... from context-guru-plugin. If that directory is ever copied without the marketplace tree, the test fails on the len(files) < 10 guard. Acceptable as a repo-internal guard; the guard fires rather than passing silently, which is the right direction.
  • context-guru-plugin/skill_frontmatter_test.go:18 — filepath.Glob's error is discarded. Safe: a missing directory yields an empty list, and the len(files) < 10 check catches it.

What I checked

  • The diff in full: 3 description rewrites (codex session, plugin session, plugin timeline) plus one new test file.
  • The defect is real. I parsed the old session front matter with a strict YAML parser. It rejects it: "mapping values are not allowed here" at the session: turns colon. go-yaml v3 rejects a: b: c the same way, so the shipped test fails on the old text — it is a true regression test, not a vacuous one.
  • All 35 SKILL.md files pass the new test today. I replayed the test's exact extraction (CutPrefix("---\n"), then Cut("\n---\n")) and YAML parse over both trees: 19 skills in context-guru-plugin/skills, 16 in the codex marketplace tree. Every file yields front matter, valid YAML, and non-empty name and description strings.
  • No remaining ": " in any plain front-matter value in either tree. I scanned every SKILL.md line by line for the pattern.
  • Coverage is complete for shipped files. Only two other SKILL.md files exist in the repo (.claude/skills/offload-review, .claude/skills/refactor-scan); both parse. No other front-matter markdown ships with either plugin (README.md, hooks.json, scripts only).
  • Build sanity, read only: the test's package (plugin) matches its siblings; readFileString already exists in the package (preset_default_test.go:444); gopkg.in/yaml.v3 is already in go.mod. No new dependency, no import cycle.
  • Repo rules: no pipeline or proxy behavior changes, so the fail-open, data-dependence, and behavior-change-permission rules do not apply. The description text changes what users see in skill listings, which is the fix itself (#851).

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 2 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.316 offload-review skill, @amiddavid's session fresh 2 of 2 1 of 2 89362b96b28d approve

Verdict: approve

Findings

None.

Non-blocking

  • context-guru-plugin/skill_frontmatter_test.go:21 — the test parses front matter with gopkg.in/yaml.v3. Codex uses serde_yaml. The two agree on this defect class (a bare : in a plain scalar fails in both), but they are not the same parser. A future field valid in one and invalid in the other could pass the test and still break Codex.
  • context-guru-plugin/skill_frontmatter_test.go:27 — strings.Cut(fm, "\n---\n") needs a newline after the closing ---. A file that ends at the closing delimiter with no final newline reports "has no front matter". No such file exists today.
  • The test covers only the two plugin trees. The repo's own .claude/skills/*/SKILL.md files are not covered. They parse today, so this is a scope note, not a defect.
  • skill_frontmatter_test.go:19 — the len(files) < 10 guard is a magic number. It works as a path-typo guard (19 and 16 skills found). It would fail wrongly if a tree ever legitimately dropped below 10 skills.

What I checked

  • The full diff (7b682ae5..89362b96) and the code around each change.
  • The defect is real. A plain YAML scalar cannot contain : . I parsed the old session description with a local YAML parser and got "mapping values are not allowed here". The new parenthesized text parses.
  • The fix loses no information. All three rewritten descriptions keep the same items and the same tail ("with a dollar verdict", "plus the three most expensive moments").
  • No other file still has the defect. I read the front matter of all 35 SKILL.md files in both plugin trees. No description contains a bare : . Other YAML hazards (values starting with |, >, %, anchors) are absent. argument-hint and allowed-tools values are quoted or safe plain scalars.
  • The new test is correct. I replicated its exact logic (prefix cut, \n---\n cut, YAML parse, name and description as non-empty strings) over all 35 files with a local parser. All pass.
  • The test compiles in its package. readFileString exists in preset_default_test.go:444 in the same package plugin. gopkg.in/yaml.v3 v3.0.1 is in go.mod. Glob counts are 19 (claude plugin) and 16 (codex plugin), both above the < 10 guard. The ../codex-marketplace/... relative path resolves from the package directory.
  • No other code depends on the changed text. No test asserts on the session or timeline descriptions. Other SKILL.md tests check prose and bash blocks, not these lines.
  • Repo rules. The commit has Signed-off-by and Assisted-By: trailers and a conventional title. No component behavior changes, so the fail-open, data-dependence, and behavior-change rules do not apply.
  • I did not run Go builds or tests. Go is not installed here. The YAML checks above used a local parser on the data files only.

The Codex session skill's description had an unquoted ": ", which is
invalid YAML. Codex parses skill front matter with serde_yaml, so the
skill may not load. Rewrite it with parentheses.

Add a test that parses the front matter of every SKILL.md in both
plugins as YAML and checks for a name and a description. The Claude
Code session and timeline skills already pass since #850.

Fixes #851.

Assisted-By: Claude Opus 5.5
Signed-off-by: DAVID AMID <[email protected]>
@amiddavid

Copy link
Copy Markdown
Collaborator Author

Rebased on main after #850 merged. New head: b5697f30.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 2 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.316 offload-review skill, @amiddavid's session resumed 2 of 2 2 of 2 b5697f305d8d approve

Verdict: approve

Findings

None.

Round-1 findings

Both round-1 reviews (reviewer 1 and mine) had no findings. Only non-blocking notes. The rebase changed none of them: the test file is byte-identical (same blob 40990999), so every note still stands as written. No note was rejected or actioned, and none needed action.

Non-blocking

  • context-guru-plugin/skill_frontmatter_test.go:25-33 — the front-matter extraction (prefix cut, \n---\n cut, YAML parse) is now written twice in the package: once here, once as readSkillFrontMatter in #850's skill_listing_test.go:31. Same logic, two copies. The split is deliberate (skill_listing_test.go:99 says strict Codex parsing is this PR's test), so this is a style note only.
  • My round-1 notes carry over unchanged: yaml.v3 is a proxy for Codex's serde_yaml; the closing --- needs a trailing newline; the repo's own .claude/skills are not covered; the < 10 glob guard is a magic number.

What I checked

  • Last review: round 1, 89362b96b28d4d0e30c64987912f1ebe18e787af, 2026-11-02T12:12:59Z.
  • New commits read: 3 in 89362b96..HEAD. b5697f30 (this PR's new head), 1b946410 (#850, base), 7cf058a6 (#849, base). The last two are merged main commits that entered the range through the rebase. I verified both sit on origin/main. The PR diff against its parent 1b946410 is 2 files.
  • Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files in my folder).
  • New items since my last review, and what I did about each:
    • Author comment at 12:43:13Z (the rebase note). I checked every claim. "The rebase changed no code": git diff 89362b96..b5697f30 on the two PR files is empty; both blobs are byte-identical to round 1. "It only dropped the 2 description lines": the Claude Code session and timeline skills in the new tree carry the same parenthesized text, now delivered by #850 in the base. "The diff is now 2 files": confirmed against 1b946410..b5697f30. "The strict-YAML test passes on top of #850's files": I cannot run Go here, so I replayed the test's exact logic (prefix cut, \n---\n cut, YAML parse, non-empty name and description) with a local parser over all 35 SKILL.md files on the new head. All pass. No description in either tree contains a bare : anymore.
    • New head b5697f30. Reviewed as a first review. It is the round-1 change minus the two lines #850 already carries: the Codex session description fix and the new skill_frontmatter_test.go. I reviewed both in full in round 1 and re-read them now.
    • Base movement through the rebase. I read #850's new skill_listing_test.go in full, because it now sits in the same package as this PR's test and also parses skill front matter. No conflict: #850's test checks listing policy and description length, and reads the Codex description line with a regex; its comment at line 99 says strict Codex parsing is this PR's test. The two tests are complementary, and the PR body says so. The new disable-model-invocation: true key from #850 does not affect the new test: it parses as a bool and the test only checks name and description.
    • PR body. The author said they updated it. I read it from the API. It names the behavior change (who, old, new, how to turn off) per the repo rule, states no data dependence, and describes the tests, including a mutation check whose failure message matches what a strict YAML parser produces for the old line.
  • I did not run Go builds or tests. Go is not installed here. The YAML checks above used a local parser on the data files only.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 1 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.316 offload-review skill, @amiddavid's session resumed 1 of 2 2 of 2 b5697f305d8d approve

Verdict: approve

Findings

None. The rebase is clean and the change is correct.

Earlier findings

  • My round-1 review had no findings (approve, 3 non-blocking notes). Nothing to re-check as fixed or rejected. The author did not reply to the notes; all three still stand as written and none blocks merge.
  • Reviewer 2's round-1 review also had no findings. I checked their note that strings.Cut(fm, "\n---\n") needs a newline after the closing ---: no such file exists. I re-ran the full extraction over all 35 SKILL.md files on the new head; every file yields front matter.

Non-blocking

  • codex-marketplace/plugins/context-guru/skills/*/agents/openai.yaml — #850 added 9 of these. Codex parses them as YAML, and no test covers them. All 9 parse today (I checked each one). Same defect class could land there unnoticed. Extends my round-1 scope note, which covered SKILL.md only.

What I checked

  • Last review: round 1, 89362b96b28d4d0e30c64987912f1ebe18e787af, 2026-11-02T12:12:52Z.
  • New commits read: 3 (b5697f30 fix(codex-plugin): make every skill's front matter valid YAML — the rebased PR commit; 1b946410 feat(plugin): #850, and 7cf058a6 refactor(modelinfo): #849 — both entered the range through the rebase onto new main).
  • Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files).
  • New items since my last review, and what I did about each:
    • Reviewer 2's round-1 review (12:12:59Z). Approve, non-blocking notes only. I verified their \n---\n note myself (see above). Their parser-divergence note (go-yaml vs serde_yaml) I agree with; nothing to act on.
    • Author's rebase comment (12:43:13Z). Claims: rebase changed no code, only dropped the 2 Claude Code description hunks because #850 carries the same text; diff is now 2 files; tests pass on the eval box. I verified each claim:
      • The PR diff vs the new base 1b946410 is 2 files: the Codex session description and the new test. The test file is byte-identical to the round-1 version (same git blob 40990999).
      • The dropped hunks lose nothing. I compared 1b946410's session and timeline descriptions with the text the round-1 commit wrote. They are identical, word for word.
      • The commit message now matches the new reality ("already pass since #850").
      • The author's test runs are their evidence; I did not run Go (not approved, and not installed here).
  • The new test still passes on the rebased tree. #850 rewrote descriptions and added disable-model-invocation: true keys in both trees. I replayed the test's exact extraction and YAML parse over all 35 SKILL.md files on head b5697f30 (19 plugin, 16 codex). Every file yields front matter, valid YAML, and non-empty name and description. The new boolean keys parse fine.
  • Test coexistence. #850's skill_listing_test.go reads the description line with a regex and says strict parsing of the Codex tree is this PR's test. No function-name collision (TestEverySkillFrontMatterIsValidYAML is unique in the package). No test asserts the old Codex description text; I grepped the package for it.
  • The 9 agents/openai.yaml files added by #850 all parse as YAML (checked each).
  • Repo rules: unchanged from round 1. No pipeline or proxy behavior, so the fail-open, data-dependence, and behavior-change-permission rules do not apply. Commit keeps Signed-off-by and Assisted-By: trailers and a conventional title.

@amiddavid
amiddavid merged commit 667a00d into main Nov 2, 2026
5 checks passed
@github-project-automation github-project-automation Bot moved this from New/ToDo to Done in Rossoctl Issue Prioritization Nov 2, 2026
amiddavid added a commit that referenced this pull request Nov 2, 2026
…0.2.9) (#863)

Claude Code plugin 0.6.4 -> 0.6.5:
- #850: 12 display-only skills get disable-model-invocation: true.
- #738: an optional beep when Claude finishes or needs input.
- #848: settings.py still writes head_ttl_min_tokens, so an older proxy loads its config.
- #859: the band and cg.py show "finished" for an agent that ended with a terminal tool call.

Codex plugin 0.2.8 -> 0.2.9:
- #850: 9 display-only skills get allow_implicit_invocation: false.
- #852: the session skill's front matter is valid YAML, so Codex loads it.

Signed-off-by: DAVID AMID <[email protected]>
Assisted-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

fix(codex-plugin): the session skill's frontmatter is invalid YAML

1 participant