Skip to content

Fix Claude skill markdown warnings#4441

Closed
thomasvan wants to merge 3 commits into
esengine:main-v2from
thomasvan:codex/ignore-nonskill-markdown
Closed

Fix Claude skill markdown warnings#4441
thomasvan wants to merge 3 commits into
esengine:main-v2from
thomasvan:codex/ignore-nonskill-markdown

Conversation

@thomasvan

@thomasvan thomasvan commented Jun 15, 2026

Copy link
Copy Markdown

Summary

  • Require skill frontmatter before treating flat Markdown files in .claude/skills roots as skills.
  • Preserve directory-layout SKILL.md loading and existing non-Claude flat skill behavior.
  • Add regression coverage for plain Claude documentation files being ignored without warnings.

Validation

  • go test ./internal/skill ./internal/config
  • go test ./internal/boot with isolated HOME and XDG_CONFIG_HOME
  • git diff --check -- internal/skill/skill.go internal/skill/skill_test.go

Note: go test ./internal/cli failed in the default environment because configured model credentials made TestModelRefsSkipsUnconfigured see provider refs. A clean-env rerun was started but did not finish after several minutes, so it was stopped.

@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development skills Skill system (internal/skill, internal/tool) labels Jun 15, 2026
@thomasvan thomasvan marked this pull request as ready for review June 15, 2026 05:06
Copilot AI review requested due to automatic review settings June 15, 2026 05:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates skill discovery to treat .claude/skills as a mixed-content directory by requiring “skill-like” frontmatter before flat Markdown files are considered skills, and adds tests to lock in the new behavior.

Changes:

  • Add a Claude-root-specific gate that ignores flat <name>.md files unless they contain recognized skill frontmatter keys
  • Refactor parsing flow (parse/parseFlatparseSkill) and thread a “require flat marker” flag through discovery
  • Add tests asserting non-skill Markdown in .claude/skills is ignored and that missing description emits a warning for skill-like files

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
internal/skill/skill.go Adds Claude-root marker requirement for flat Markdown discovery; refactors parsing and adds marker detection helper
internal/skill/skill_test.go Adds coverage for ignoring non-skill Markdown in .claude/skills and warning on skill-like files missing description

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/skill/skill.go Outdated
Comment on lines +158 to +162
Dir string
Scope Scope
Priority int
Status PathStatus
requireFlatMarker bool
Comment thread internal/skill/skill.go
Comment on lines +453 to +460
func hasSkillMarker(fm map[string]string) bool {
for _, key := range []string{"description", "name", "runas", "context", "agent", "allowed-tools", "model", "effort"} {
if strings.TrimSpace(fm[key]) != "" {
return true
}
}
return false
}
Comment thread internal/skill/skill.go Outdated
}

func hasSkillMarker(fm map[string]string) bool {
for _, key := range []string{"description", "name", "runas", "context", "agent", "allowed-tools", "model", "effort"} {
Comment thread internal/skill/skill_test.go Outdated

func TestNonSkillMarkdownInClaudeSkillRootsIgnored(t *testing.T) {
proj := t.TempDir()
writeSkill(t, proj, ".claude/skills/README.md", "# Skill notes\n\nThis is documentation, not a skill.")
Comment thread internal/skill/skill_test.go Outdated
Comment on lines +170 to +174
for _, name := range []string{"README", "notes"} {
if _, ok := find(list, name); ok {
t.Errorf("non-skill markdown %q should not be listed", name)
}
}
@thomasvan thomasvan changed the title [codex] fix Claude skill markdown warnings Fix Claude skill markdown warnings Jun 15, 2026
@SivanCola

Copy link
Copy Markdown
Collaborator

Thanks @thomasvan for this fix. I integrated the Claude flat-Markdown warning behavior and regression tests into #4510 together with the overlapping Windows linked directory work from #4442, because the two PRs conflict in either merge order.

Authorship note: @SivanCola is the maintainer integrator for #4510. @thomasvan contributed as a repository contributor through this PR, and that contribution is preserved and acknowledged in #4510.

Closing this PR as superseded by #4510 so the repository has one conflict-free merge path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skills Skill system (internal/skill, internal/tool) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants