Load filesystem skills for ``cwd`` and convert them to PromptCommands. Cached by cwd because skill discovery does disk I/O + frontmatter parsing. Builtins are intentionally NOT cached here (they're cheap and their is_enabled gates must stay fresh). Failures degrade to an empty tupl
(cwd: str)
| 51 | |
| 52 | @lru_cache(maxsize=32) |
| 53 | def _load_skill_commands_cached(cwd: str) -> tuple[Command, ...]: |
| 54 | """ |
| 55 | Load filesystem skills for ``cwd`` and convert them to PromptCommands. |
| 56 | |
| 57 | Cached by cwd because skill discovery does disk I/O + frontmatter parsing. |
| 58 | Builtins are intentionally NOT cached here (they're cheap and their is_enabled |
| 59 | gates must stay fresh). Failures degrade to an empty tuple — skills are |
| 60 | non-critical and must never break command listing (mirrors TS). |
| 61 | """ |
| 62 | try: |
| 63 | from ..skills.loader import get_all_skills |
| 64 | skills = get_all_skills(project_root=cwd) |
| 65 | return tuple(skill_to_prompt_command(s) for s in skills) |
| 66 | except Exception as exc: # noqa: BLE001 — skills are non-critical |
| 67 | logger.debug("skill loading failed for %s: %s", cwd, exc) |
| 68 | return () |
| 69 | |
| 70 | |
| 71 | @lru_cache(maxsize=32) |
no test coverage detected