mirror of
https://github.com/pocketpaw/pocketpaw.git
synced 2026-05-19 16:31:15 +00:00
fix: enable SDK skill auto-discovery and unify skill directories
The Claude Agent SDK backend was not loading skills because `setting_sources` and the `Skill` tool were missing from the options passed to `ClaudeAgentOptions`. - Add `setting_sources=["user", "project"]` so the SDK discovers SKILL.md files from `~/.claude/skills/` and `.claude/skills/` - Add `"Skill"` to `allowed_tools` and the `_SDK_TO_POLICY` mapping - Add `"skill"` to `group:skills` in the policy system - Add `~/.claude/skills/` to SkillLoader search paths - Write agent-created skills to `~/.claude/skills/` (SDK-standard location) instead of `~/.pocketpaw/skills/` Closes #177 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -170,6 +170,7 @@ class ClaudeAgentSDK:
|
||||
"Grep": "shell", # search is shell-adjacent
|
||||
"WebSearch": "browser",
|
||||
"WebFetch": "browser",
|
||||
"Skill": "skill",
|
||||
}
|
||||
|
||||
def __init__(self, settings: Settings, executor: ExecutorProtocol | None = None):
|
||||
@@ -739,6 +740,7 @@ class ClaudeAgentSDK:
|
||||
"Grep",
|
||||
"WebSearch",
|
||||
"WebFetch",
|
||||
"Skill",
|
||||
]
|
||||
allowed_tools = [
|
||||
t
|
||||
@@ -763,6 +765,7 @@ class ClaudeAgentSDK:
|
||||
options_kwargs = {
|
||||
"system_prompt": final_prompt,
|
||||
"allowed_tools": allowed_tools,
|
||||
"setting_sources": ["user", "project"],
|
||||
"hooks": hooks,
|
||||
"cwd": str(self._cwd),
|
||||
"max_turns": 25, # Safety net against runaway tool loops
|
||||
|
||||
@@ -22,6 +22,7 @@ logger = logging.getLogger(__name__)
|
||||
# Skill search paths in priority order (later overrides earlier)
|
||||
SKILL_PATHS = [
|
||||
Path.home() / ".agents" / "skills", # From skills.sh (central)
|
||||
Path.home() / ".claude" / "skills", # Claude Code / SDK standard
|
||||
Path.home() / ".pocketpaw" / "skills", # PocketPaw-specific
|
||||
]
|
||||
|
||||
|
||||
@@ -14,8 +14,13 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def _get_skills_dir() -> Path:
|
||||
"""Get (and create) the PocketPaw skills directory."""
|
||||
d = get_config_dir() / "skills"
|
||||
"""Get (and create) the user skills directory.
|
||||
|
||||
Writes to ``~/.claude/skills/`` — the standard location used by the
|
||||
Claude Agent SDK for auto-discovery. PocketPaw's SkillLoader also
|
||||
scans this directory so skills are available in both systems.
|
||||
"""
|
||||
d = Path.home() / ".claude" / "skills"
|
||||
d.mkdir(parents=True, exist_ok=True)
|
||||
return d
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ TOOL_GROUPS: dict[str, list[str]] = {
|
||||
"group:memory": ["remember", "recall", "forget"],
|
||||
"group:desktop": ["desktop"],
|
||||
"group:search": ["web_search", "url_extract"],
|
||||
"group:skills": ["create_skill"],
|
||||
"group:skills": ["create_skill", "skill"],
|
||||
"group:gmail": ["gmail_search", "gmail_read", "gmail_send"],
|
||||
"group:calendar": ["calendar_list", "calendar_create", "calendar_prep"],
|
||||
"group:voice": ["text_to_speech", "speech_to_text"],
|
||||
|
||||
Reference in New Issue
Block a user