Skip to content

feat(checks): add deprecated-tools-field rule for legacy tools: migration - #44

Merged
protosphinx merged 1 commit into
mainfrom
bot/deprecated-tools-field
Jul 19, 2026
Merged

feat(checks): add deprecated-tools-field rule for legacy tools: migration#44
protosphinx merged 1 commit into
mainfrom
bot/deprecated-tools-field

Conversation

@protosphinx

Copy link
Copy Markdown
Member

Why

Skills that use the legacy tools: field instead of the spec-supported allowed-tools: field will continue to work today, but the README already documents tools: as the legacy field and recommends allowed-tools:. Authors who only see tool-fields-ambiguous (fired when both fields are present) get no signal if they never added allowed-tools: in the first place. The new deprecated-tools-field rule closes that gap: it fires when tools: is the only tool field declared and guides the author to migrate.

This PR also documents tools-duplicate and the new deprecated-tools-field in the README rules table; both were implemented but missing from the documented rule list.

What

  • src/checks.ts: add checkDeprecatedToolsField function; call it in runChecks between checkToolFieldsAmbiguous and checkToolsDuplicate so the two sibling rules never overlap (ambiguous fires when both present, deprecated fires when only legacy is present).
  • test/checks.test.ts: update the "clean skill produces no diagnostics" baseline to use allowed-tools: (best practice); add 7 tests covering the new rule.
  • README.md: add rows for deprecated-tools-field and tools-duplicate to the rules table.

Tests

  • npm run lint - clean (TypeScript noEmit)
  • npm run build - clean
  • npm test - 186 tests pass (179 existing + 7 new)
  • New tests cover: fires on tools: only, no-op on allowed-tools: only, no-op when both fields present, no-op when no tool field, severity is warn, message mentions allowed-tools:, no-op on invalid frontmatter.

Self-merge gate

  • all CI checks pass
  • LOC delta < 250 (137 lines: 91 added + 1 removed in source/test, 2 added in docs)
  • no public-API surface change (src/index.ts not modified)
  • no runtime-dependency additions
  • no workflow file changes
  • tests added or extended (test/checks.test.ts, 7 new tests)

Generated by Claude Code

…tion

Warn when a skill uses only the legacy tools: field without allowed-tools:.
The allowed-tools: field is the spec-supported tool allowlist; tools: is
kept for backwards compatibility but new skills should use allowed-tools:.

The new rule fires after tool-fields-ambiguous is checked so the two
rules never overlap: tool-fields-ambiguous fires when both fields are
present, deprecated-tools-field fires when only the legacy tools: field
is present.

Also documents tools-duplicate and deprecated-tools-field in the README
rules table (both were implemented but not listed there).

Update the "clean skill" baseline test to use allowed-tools: so it
reflects current best practice and does not trigger the new warning.
@protosphinx protosphinx added the automated Opened by the daily bot label Jul 19, 2026 — with Claude
@protosphinx
protosphinx merged commit a7f7f23 into main Jul 19, 2026
3 checks passed

@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: 50b80a4c1f

ℹ️ 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
return [
{
severity: "warn",
rule: "deprecated-tools-field",

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 Register the new rule in SARIF metadata

When a skill uses only tools: and users run --format sarif, this emitted deprecated-tools-field rule is absent from src/sarif.ts's static RULES catalog, so the reporter falls back to a synthetic rule whose name/description are just the id and clean SARIF catalogs omit the rule entirely. Please add SARIF metadata/tests for the new diagnostic so code-scanning consumers get the same stable catalog as other built-in rules.

Useful? React with 👍 / 👎.

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

Labels

automated Opened by the daily bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant