Skip to content

[FIX] Skill Capability Registry Derived-Field Immunity#3680

Merged
Trecek merged 8 commits into
developfrom
skill-capability-registry-incorrectly-classifies-all-capabil/3675
Jun 3, 2026
Merged

[FIX] Skill Capability Registry Derived-Field Immunity#3680
Trecek merged 8 commits into
developfrom
skill-capability-registry-incorrectly-classifies-all-capabil/3675

Conversation

@Trecek

@Trecek Trecek commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

The SKILL_CAPABILITY_REGISTRY has a hand-coded required_backends field on each SkillCapabilityDef that contradicts the registry's own codex_status field. All 6 non-claude_dir capabilities are marked required_backends=frozenset({"claude-code"}) even though Codex natively supports them all. This causes _skill_requires_claude to force every run_skill dispatch to Claude Code, _should_inject_skill to silently exclude all skills from Codex sessions, and rules_backend_compat to emit spurious warnings for Codex recipes.

The fix converts required_backends from a stored field to a @property derived from codex_status, making contradictions structurally impossible: only "not-applicable" capabilities (MCP-specific tools like open_kitchen, run_skill, test_check) map to frozenset({"claude-code"}); all others ("works-as-is", "degraded", "fix-required") map to frozenset(). Additionally, _skill_info_from_frontmatter is updated to derive SkillInfo.backend_requirements from uses_capabilities via the registry rather than reading it from SKILL.md YAML.

Part B will cover test infrastructure updates (rewriting/deleting affected test cases across 6 test files) and template documentation cleanup — implement as a separate task.

Implementation Plan

Plan file: /home/talon/projects/autoskillit-runs/remediation-20260603-135240-162480/.autoskillit/temp/rectify/rectify_skill_capability_registry_part_a_2026-06-03_140000.md

Closes #3675

🤖 Generated with Claude Code via AutoSkillit

Token Usage Summary

Step Model count uncached output cache_read peak_ctx turns cache_write time
rectify* opus[1m] 1 62 32.6k 2.1M 128.2k 57 111.4k 27m 5s
review_approach* opus[1m] 1 3.0k 5.3k 283.2k 46.8k 14 33.5k 4m 9s
dry_walkthrough* opus 2 3.0k 25.0k 2.3M 115.7k 92 174.5k 11m 50s
implement* opus[1m] 2 117 23.6k 2.2M 70.9k 126 94.7k 8m 53s
audit_impl* opus[1m] 2 71 39.4k 687.5k 88.3k 49 146.6k 23m 50s
prepare_pr* MiniMax-M3 1 49.8k 4.0k 173.1k 53.1k 12 0 60s
compose_pr* MiniMax-M3 1 39.4k 1.3k 284.1k 42.5k 13 0 47s
review_pr* opus[1m] 1 2.1k 25.9k 1.8M 169.4k 38 153.8k 12m 4s
resolve_review* opus[1m] 1 57 13.3k 1.5M 88.0k 48 71.8k 8m 28s
Total 97.5k 170.5k 11.3M 169.4k 786.2k 1h 38m

* Step used a non-Anthropic provider; caching behavior may differ.

Token Efficiency

Step LoC Changed cache_read/LoC cache_write/LoC output/LoC
rectify 0
review_approach 0
dry_walkthrough 0
implement 321 6931.6 295.0 73.4
audit_impl 0
prepare_pr 0
compose_pr 0
review_pr 0
resolve_review 38 38244.6 1889.6 350.8
Total 359 31372.8 2190.0 474.9

Model Usage Breakdown

Model steps uncached output cache_read cache_write time
opus[1m] 6 5.4k 140.2k 8.5M 611.7k 1h 24m
opus 1 3.0k 25.0k 2.3M 174.5k 11m 50s
MiniMax-M3 2 89.1k 5.3k 457.2k 0 1m 47s

Trecek and others added 8 commits June 3, 2026 16:24
… contradictions

Convert SkillCapabilityDef.required_backends from a stored field to a
@Property derived from codex_status. Only "not-applicable" capabilities
(MCP-specific tools) map to frozenset({"claude-code"}); all others map
to frozenset(). Remove _skill_requires_claude from tools_execution.py,
derive backend_requirements in _skill_info_from_frontmatter from
uses_capabilities via registry, and strip backend_requirements from
all 108 SKILL.md frontmatters.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…requirement override

Tests now match Part A behavior:
- backend_requirements derived from uses_capabilities via registry @Property
- _skill_requires_claude removed; incompatible skills hit _is_backend_incompatible gate
- SKILL.md no longer declares backend_requirements (runtime derivation only)
- MCP tools (open_kitchen, run_skill, test_check) correctly derive claude-code requirement

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…rtions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…equirements

- Add regression guard test_backend_requirements_derived_not_read_from_yaml
- Delete test_skill_without_backend_requirement_no_override (mock-only path)
- Rewrite incompatible-backend routing test to use real SkillInfo dataclass
- Remove stale tools_execution.py from _EXEMPT_FILES in bypass test
- Remove backend_requirements: [claude-code] from 3 write-recipe templates

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… leakage in backend tests

- test_backend_requirements_derived_not_read_from_yaml used nonexistent
  SkillSource.PROJECT; replaced with SkillSource.BUNDLED
- Three backend-config tests failed when AUTOSKILLIT_AGENT_BACKEND__BACKEND
  env var was set (Dynaconf double-underscore override); added delenv calls

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Exact duplicate of test_derivation_backend_requirements_match_capabilities
(both iterate skill dirs, read frontmatter, assert no backend_requirements).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ude_logic

Relative Path("src/...") fails if pytest CWD is not project root.
Use Path(__file__).parents[2] for robust path resolution.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…_required_backends

The old test checked codex_status != not-applicable AND required_backends
== {claude-code}, which the @Property makes structurally impossible.
Rewrite to verify both directions of the derivation invariant.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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