Skip to content

feat(checks): add effort-unknown check for skill frontmatter - #46

Merged
protosphinx merged 2 commits into
mainfrom
bot/effort-unknown-check
Jul 28, 2026
Merged

feat(checks): add effort-unknown check for skill frontmatter#46
protosphinx merged 2 commits into
mainfrom
bot/effort-unknown-check

Conversation

@protosphinx

Copy link
Copy Markdown
Member

Why

Skill YAML files can include an effort: frontmatter field that controls reasoning effort in the Claude Code runtime. There is currently no validation that the value is one of the recognized levels (low, medium, high, xhigh, max). An unrecognized value silently falls back to default behavior, which can be confusing during authoring.

What

  • Adds KNOWN_EFFORT_LEVELS constant and checkEffortUnknown() function in src/checks.ts
  • Wires the new check into runChecks() after checkModelUnknown()
  • Adds the effort-unknown SARIF rule entry in src/sarif.ts
  • Adds 10 new test cases covering all five valid levels, absent field, empty string, unrecognized values, message content, and invalid frontmatter guard
  • Updates README.md rules table and test count badge (77 -> 87 passing)

src/schema.ts and src/index.ts are not touched; effort is read from the passthrough Record<string, unknown> on v.frontmatter so the public API surface is unchanged.

Tests

10 new tests in test/checks.test.ts inside the existing describe("runChecks") block.

Self-merge gate

  • All CI green
  • LOC delta < 250
  • Does not touch src/index.ts
  • No runtime dependency additions
  • No .github/workflows/* changes
  • At least one test file changed

Generated by Claude Code

Validates the optional effort: field against the five recognized
reasoning effort levels: low, medium, high, xhigh, max. Emits a warn
diagnostic when an unrecognized value is present, matching the style
and gating of the existing model-unknown check.

- src/checks.ts: KNOWN_EFFORT_LEVELS set, checkEffortUnknown function,
  wired into runChecks after checkModelUnknown
- src/sarif.ts: effort-unknown entry in RULES catalog
- test/checks.test.ts: 10 new cases covering all valid levels, absent,
  empty-string, message content, and invalid-frontmatter guard
- README.md: new row in the rules table

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ed46a681d1

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/checks.ts Outdated
function checkEffortUnknown(v: ValidatedSkill): Diagnostic[] {
const effort = v.frontmatter.effort;
if (effort === undefined) return [];
if (typeof effort !== "string" || effort.length === 0) return [];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Report invalid non-string and empty effort values

When otherwise-valid frontmatter contains effort: 123, effort: {}, or effort: "", the passthrough schema accepts it and this guard returns without a diagnostic. These values are not among the five recognized levels and will silently fall back at runtime—the exact authoring error this rule is intended to catch—so only an absent field should bypass the check; present values of the wrong type or an empty string should produce effort-unknown (or a schema error).

Useful? React with 👍 / 👎.

Present but invalid effort values (numbers, objects, empty string) were
silently skipped. Only an absent field should bypass the check; any
present value that is not one of the five recognized levels is an
authoring error and should produce an effort-unknown diagnostic.

Add two new test cases (number, object) and update the empty-string
test to expect a warning. Badge updated: 87 -> 89 passing.
@protosphinx
protosphinx merged commit c2afd69 into main Jul 28, 2026
3 checks passed
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