Skip to content

fix(skills): declare run_shell_command in the coding skill - #4295

Merged
kovtcharov-amd merged 3 commits into
amd:mainfrom
kovtcharov:claude/skill-shell-tool-declared
Sep 25, 2026
Merged

kovtcharov-amd merged 3 commits into
amd:mainfrom
kovtcharov:claude/skill-shell-tool-declared

Conversation

@kovtcharov

Copy link
Copy Markdown
Contributor

The coding skill grants pytest and tells the model to run the tests, but it didn't list the one tool that can run a shell command. Once loading a skill brings in the tools it declares, the model got every coding tool except the one that runs tests. The skill now declares that tool. A new starter-pack check fails any skill whose shell grant has no tool to use it. Coding was the only skill that broke the rule; github-triage already declared the tool.

Overlaps #3390 and #4174, which both edit the same pytest paragraph and neither adds the tool. Whichever merges second needs a one-line rebase.

Test plan

  • python -m pytest tests/unit/test_starter_skills.py -q -k shell_grant: the new check fails for coding before the fix and passes for all 16 skills after it
  • python -m pytest tests/unit/test_starter_skills.py tests/unit/test_skill_binary_grants.py hub/agents/gaia/python/tests/test_gaia_agent.py -q: 489 passed. The one failure, test_manifest_tools_count_matches_real_registry (81 vs 80), counts the agent's tool registry, which this change doesn't touch
  • black --check / isort --check-only on the changed test file
  • gaia eval agent: the loaded coding skill now gives the model an extra tool

Fixes #4222

The coding skill grants pytest and tells the model to run it, but never declared the one tool that runs a shell command, so a loaded coding skill could not run the tests it asks for.

A new starter-pack guard fails any skill that carries a shell:execute grant without declaring run_shell_command; coding was the only one.

Fixes amd#4222
@github-actions github-actions Bot added the tests Test changes label Sep 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Approve

The coding skill could tell the model to run pytest but never handed it the tool that runs a command — so the one skill whose whole point is "prove it by running the tests" couldn't. This PR adds that tool to the skill's manifest and adds a guard so the next skill with a shell grant can't ship the same gap.

I checked the claims in the description and they hold: the coding skill is the only shipped skill that broke the rule, github-triage already declared the tool, and the flagship agent really does register that tool, so the fix takes effect rather than just looking correct. The grant stays scoped to pytest — nothing widens what the skill may run. Nothing here blocks merge; the three notes below are small.

Real-world evidence

No evidence bundle was produced for this PR, so the verdict rests on static review plus the unit tests the description reports. That is proportionate for a manifest line plus a test — there's no CLI, API, or UI surface whose output would differ. The one gap worth closing before this is called done is the description's own unchecked box: an agent run with the coding skill loaded, showing the model actually reaching for the test-runner tool, is the only thing that proves the reported bug is gone rather than merely explained.

🔍 Technical details

🟢 The guard's stated rationale doesn't match the runtime (tests/unit/test_starter_skills.py:273)

The docstring says loading a skill "brings the tools it declares", but the loader treats tools_required as advisory — agent.py:2257 only logs names the agent doesn't have, and hub/agents/gaia/python/tests/test_gaia_agent.py:113 says so explicitly. The guard is still right (the tool-loader unions tools_required into per-turn selection, per docs/plans/skill-format.mdx:145); only the reason is overstated.

    """A ``shell:execute:*`` grant is only usable through ``run_shell_command``.

    ``tools_required`` is the recipe contract the tool-loader unions into the
    turn's tool selection, so a shell grant without the one tool that consumes
    it leaves the model unable to run the command.
    """

🟢 The rule is enforced only for the shipped pack (tests/unit/test_starter_skills.py:270)

A third-party skill with shell:execute:<bin> and no run_shell_command still installs silently and fails the same way at runtime. refuse_unbridged_permissions in src/gaia/skills/permissions.py is the chokepoint every install/publish/load path funnels through, and gaia skill audit is the natural place to warn. Comment only — it's a scope call, not something to bolt onto this PR.

🟢 Document the new authoring rule (docs/spec/agent-skills.mdx:413)

That paragraph explains the binary grant but not that a skill must also declare run_shell_command to use it. One sentence there keeps the invariant discoverable to authors who never run the starter-pack suite.

🟢 Vacuous pass vs. skip (tests/unit/test_starter_skills.py:281)

Skills with no shell grant return (reported as passed) where the scratchpad guard in the same file uses pytest.skip("not a scratchpad skill"). Matching that makes the report say what was actually checked.

Strengths

  • The test derives shell grants from parsed_permissions() rather than string-matching the frontmatter, so it survives grammar changes, and the assertion message names both the grant and the missing tool.
  • Checked the interactions that could have broken: test_the_guide_consumes_lists_match_the_manifests doesn't cover coding (no section in starter-skills.mdx), run_shell_command is registered unconditionally by ShellToolsMixin.register_shell_tools, and ChatAgent._register_tools registers shell tools on every profile — so both the honesty guard and the new guard pass for real reasons.
  • The tools_count failure named in the description is genuinely unrelated: it compares gaia-agent.yaml against the agent's registry, which this diff doesn't touch.

main independently reworded the pytest-invocation paragraph (favoring
python -m over bare pytest) after this branch's own base -- kept that
rewrite but restored the explicit run_shell_command mention the
starter-skill coverage guard requires (test_starter_skill_body_
mentions_the_tools_it_declares), which main's version had dropped.
@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Sep 25, 2026
Merged via the queue into amd:main with commit 3e82b2b Sep 25, 2026
18 of 21 checks passed
@kovtcharov-amd
kovtcharov-amd deleted the claude/skill-shell-tool-declared branch September 25, 2026 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(skills): coding skill relies on the pytest grant but doesn't declare run_shell_command

2 participants