Skip to content

docs(skills): document SKILL.md runtime field + AST coverage gate (#119 PR-4) - #2553

Merged
HongmingWang-Rabbit merged 1 commit into
stagingfrom
feat/skill-compat-audit
May 3, 2026
Merged

docs(skills): document SKILL.md runtime field + AST coverage gate (#119 PR-4)#2553
HongmingWang-Rabbit merged 1 commit into
stagingfrom
feat/skill-compat-audit

Conversation

@HongmingWang-Rabbit

Copy link
Copy Markdown
Contributor

Summary

Closes the documentation + audit gap for declarative skill-compat. The plumbing has been live since PR #117 (RuntimeCapabilities) and skill_loader._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).

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.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() method (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.py, skill_loader/watcher.py) 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, 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_skills call site risks dropping the kwarg and reintroducing the silent force-load bug.

Test plan

  • test_load_skills_call_sites.py (2 new tests) passes
  • Existing 7 runtime-compat unit tests in test_skills_loader.py still pass
  • AST matcher sanity-check confirmed it correctly flags load_skills('/x', ['y']) and approves load_skills('/x', ['y'], current_runtime='claude-code')
  • Wheel build + boot smoke pass on this PR's CI

🤖 Generated with Claude Code

…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
HongmingWang-Rabbit added this pull request to the merge queue May 3, 2026
Merged via the queue into staging with commit 3c0f7de May 3, 2026
20 checks passed
@HongmingWang-Rabbit
HongmingWang-Rabbit deleted the feat/skill-compat-audit branch May 3, 2026 08:28
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