feat: support global Agent skills#9272
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for global and workspace-scoped Agent skills, allowing the application to load, list, and manage skills from .agent/skills directories. It marks these global skills as read-only in both the backend services and the frontend dashboard, and includes comprehensive unit tests to verify the new resolution logic. The review feedback suggests two robustness improvements: defaulting the maximum character limit when reading skill descriptions to avoid loading excessively large files into memory, and wrapping directory iteration in a try-except block to safely handle potential OS errors when accessing external skill directories.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| return description.strip() | ||
|
|
||
|
|
||
| def _read_skill_description(skill_md: Path, *, max_chars: int | None = None) -> str: |
There was a problem hiding this comment.
To prevent reading unnecessarily large SKILL.md files entirely into memory when only parsing the frontmatter description, consider defaulting max_chars to WORKSPACE_SKILL_FRONTMATTER_MAX_CHARS (64 KB) instead of None.
def _read_skill_description(
skill_md: Path,
*,
max_chars: int | None = WORKSPACE_SKILL_FRONTMATTER_MAX_CHARS,
) -> str:| local_exists=True, | ||
| sandbox_exists=sandbox_exists, | ||
| ) | ||
| for entry in sorted(skills_root.iterdir()): |
There was a problem hiding this comment.
Since global_skills_root (e.g., ~/.agent/skills) is an externally managed directory, calling skills_root.iterdir() directly can raise OSError (such as PermissionError or FileNotFoundError in case of broken symlinks/permissions). It is safer to wrap the directory listing in a try-except OSError block to prevent list_skills from crashing.
try:
entries = sorted(skills_root.iterdir())
except OSError:
continue
for entry in entries:
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
astrbot-docs | b0ab050 | Commit Preview URL Branch Preview URL |
Jul 14 2026, 01:06 AM |
What changed
~/.agent/skillsand workspace.agent/skillsdirectories.Why
Users can have Agent-managed skills outside AstrBot's editable skills directory. AstrBot should display and allow reading those skills without treating them as editable or downloadable local skills.
Impact
Global Agent skills become visible in skill management and can be inspected safely. Delete, edit, and download mutations remain blocked for externally managed sources.
Validation
ruff format .ruff check .pytest tests/test_skill_metadata_enrichment.py(40 passed)pnpm typecheckpnpm buildSummary by Sourcery
Add support for discovering and displaying read-only global Agent skills alongside existing local, plugin, sandbox, and workspace skills.
New Features:
Bug Fixes:
Enhancements:
Tests: