docs(skills): document SKILL.md runtime field + AST coverage gate (#119 PR-4) - #2553
Merged
Merged
Conversation
…119 PR-4) Closes the documentation + audit gap for declarative skill-compat. The plumbing has been live since PR #117 (RuntimeCapabilities) and skill_loader's `_normalize_runtime_field` has been emitting filter decisions for weeks, but: - No public doc explained the `runtime` frontmatter field, so skill authors didn't know how to opt in / opt out. - No structural gate ensured every load_skills() call site threads current_runtime — a future caller forgetting the kwarg silently force-loads runtime-incompatible skills (no AttributeError, just a delayed crash on first tool invocation). Two changes: 1. docs/agent-runtime/skills.md - Adds `runtime`, `tags`, `examples` to the Frontmatter Fields table. - Adds a Runtime Compatibility section with example, accepted shapes (universal default, list, string sugar), and the "logged + omitted, not crashed" failure mode. Notes that match values come from each adapter's name() (the same string in config.yaml's runtime: field). 2. workspace/tests/test_load_skills_call_sites.py - Static AST gate: walks every workspace/*.py (excluding tests), finds load_skills(...) Call nodes, fails if any lacks current_runtime= as a keyword. - Defense-in-depth `test_known_call_sites_present` — pins that the scan actually sees the two known callers (adapter_base, skill_loader.watcher) so a refactor that moves them is loud. - Sanity-checked the matcher against a synthetic violating module. Same-shape pattern as PR #2358 (tenant_resources audit-coverage AST gate, #150) — pin the contract structurally, not just behaviorally. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
HongmingWang-Rabbit
requested a review
from hongmingwang-moleculeai
as a code owner
May 3, 2026 08:22
HongmingWang-Rabbit
enabled auto-merge
May 3, 2026 08:24
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the documentation + audit gap for declarative skill-compat. The plumbing has been live since PR #117 (RuntimeCapabilities) and
skill_loader._normalize_runtime_fieldhas been emitting filter decisions for weeks, but:runtimefrontmatter field, so skill authors didn't know how to opt in / opt out.load_skills()call site threadscurrent_runtime— a future caller forgetting the kwarg silently force-loads runtime-incompatible skills (no AttributeError, just a delayed crash on first tool invocation).This is the fourth (and final structural) slice of #119 — see #2548 (event_log module), #2551 (heartbeat + uvicorn wiring), #2552 (EventLog into adapter base).
Two changes
1.
docs/agent-runtime/skills.mdruntime,tags,examplesto the Frontmatter Fields table.name()method (the same string inconfig.yaml'sruntime:field).2.
workspace/tests/test_load_skills_call_sites.pyworkspace/*.py(excludingtests/), findsload_skills(...)Call nodes, fails if any lackscurrent_runtime=as a keyword.test_known_call_sites_present— pins that the scan actually sees the two known callers (adapter_base.py,skill_loader/watcher.py) so a refactor that moves them is loud.Same-shape pattern as PR #2358 (tenant_resources audit-coverage AST gate, task #150) — pin the contract structurally, not just behaviorally.
Why this matters now
Hermes-style skill packages start landing in shared catalogs as soon as they're worth sharing. Without a public doc, every skill author hits the loader's silent filter decision the same way — by reading source. Without the AST gate, every refactor that moves a
load_skillscall site risks dropping the kwarg and reintroducing the silent force-load bug.Test plan
test_load_skills_call_sites.py(2 new tests) passestest_skills_loader.pystill passload_skills('/x', ['y'])and approvesload_skills('/x', ['y'], current_runtime='claude-code')🤖 Generated with Claude Code