Skip missing and unreadable skill libraries and skills by default, add `SkillCatalog.advice`, and search `pax` skill folders nearest directory first
Merged
DO
8d ago+491+491+012345678901234567890123456789-130-130-012345678901234567890123456789
Follow-ups from #10378, which left four questions open. Douwe has decided each one; this PR implements those decisions.
- Refs #10371
What changed, per item
SkippedSkillkeeps its name. It shipped in #10378 (v2.57.0, harness 0.57.0). Its entries describe skills that were left out, and skipping a library path also skips the skills in it, so the name still fits. Its docstring and the docs now say it covers skipped library paths too.paxsearches skill folders nearest directory first. For each directory from the launch directory up to the git root,CoderSettings.skill_libraries()tries every relative folder, in the configured order, before moving up a level. Launched inrepo/src,repo/src/.claude/skillsnow beatsrepo/.agents/skills. Before, it was folder name first: every.agents/skillsup the tree, then every.claude/skills.- Why this order: harness
RepoContextloads instruction files the same way, with the directory as the major key and the filename order breaking ties within one directory. Codex, OpenCode and our ownRepoContextall tell the model that a more deeply nestedAGENTS.mdtakes precedence. OpenCode orders skill folders folder name first, but nearest directory first keeps skills consistent with instruction files. ~/and absolute folders keep their place in the configured list. The default list puts the project folders before the personal ones, so project skills win, as in Codex, OpenCode and Gemini CLI. Consecutive relative folders are searched together, which only matters for custom lists that mix them.- Updated: the
skill_libraries()docstring, theskill_foldersdescription shown in/plugins configure coder, thepaxreference andPLUGINS.md.
- Why this order: harness
- New
SkillCatalog.advice: Sequence[str]. It holds the run-time advice harness otherwise only warns about: descriptions over the 1,024-character limit, and frontmatter fields whose behavior isn't implemented. A run builds its warnings from the same list, so it still warns exactly as before. The field defaults to empty, so code that builds aSkillCatalogkeeps working.paxdoes not show it: #10633 madecoderreport only skipped skills, since fields such asallowed-toolsbelong to other clients sharing the folders. - Skipping is the default.
Skills(missing_directories=...)now defaults to'skip'. A library directory that doesn't exist is left out quietly. A path that is a file, is a skill package, or can't be read (PermissionErrorwhen it is stat'ed or listed) is left out with aSkippedSkilland aUserWarning. Passmissing_directories='error'to fail the run instead.SkipReasongains'unreadable'.- A skill directory or
SKILL.mdinside a readable library that can't be read is now skipped in both modes, withreason='unreadable', like an invalidSKILL.md. Before, it failed the run. - In
pax, an unreadable project skills folder or skill prints one notice, and the other skills still load. Before, skills were turned off at startup, and if a folder became unreadable mid-session every turn failed.
Docs: docs/harness/skills.md and its README twin, the harness agent skill reference (KNOWLEDGE-AND-MEMORY.md), the pax reference and PLUGINS.md.
Behavior changes to be aware of
Skills(...)withoutmissing_directoriesno longer fails the run for a missing, non-library or unreadable library path; it skips it, with a warning for every case except a missing directory. Passmissing_directories='error'to keep failing (item 4).- An unreadable skill directory or
SKILL.mdis skipped with a warning instead of raisingPermissionError, in both modes (item 4). paxlaunched in a subdirectory can pick a different skill when two directories have one with the same name in folders with different names (item 2).SkipReasongains a value, so type checkers will flag an exhaustivematchon it.
This has the compatibility impact label, and API-compatibility waivers against v2.76.0 for the added SkipReason value and the new missing_directories default on Skills.__init__ and Skills.from_spec. Harness and pax are on 0.x.
Verification
- New regression tests in
tests/harness/skills/test_skills.pyandtests/pax/test_coder_skills.pycover the new default, unreadable libraries, skill directories andSKILL.mdfiles, andpax's "Skills are off" guard for an errorSkillsdoesn't catch. The permission tests use the existing skip for root and Windows. tests/harness/skills,tests/pax/test_coder_skills.py,tests/pax/test_coder_plugin.pyand the docs-parity tests pass (269 tests).- Focused branch coverage:
skills/_loader.pyandskills/_capability.py100%. The lines changed incoder.pyare covered. - Pyright on each changed file and Ruff pass.
Checklist
- No breaking changes in accordance with the version policy. (Harness and
paxare 0.x; see "Behavior changes" above.) - Any permitted compatibility impact has a label, warning, migration, release note, and exact API-check waiver. (See "Behavior changes" above.)
- PR title is fit for the release changelog.
(Claude, Douwe's coding agent)