---
name: tools
description: "Use when: importing skills/agents from GitHub, managing registry resources, or searching for tools to solve a problem"
---

# Tool Import

Import skills and agents from GitHub repositories into the resource registry for intelligent dispatch.

## Commands

- `/mem:tools <github-url>` — Import all skills/agents from a GitHub repo
- `/mem:tools <github-url> <instructions>` — Import with specific instructions (add/remove specific items)
- `/mem:tools <instructions>` — Directly add/remove/modify tools by prompt (no URL needed)
- `/mem:tools` (no args) — Show current registry stats and import help

## Instructions

When the user invokes `/mem:tools`:

### With GitHub URL

1. Call `mem_registry(action="import_url", url="<github-url>", enrich=true)` to import all skills/agents
2. The import pipeline automatically:
   - Fetches repo file tree via GitHub API
   - Discovers SKILL.md/AGENT.md files
   - Parses frontmatter and extracts metadata
   - Downloads files to managed/ directory
   - Runs LLM enrichment for semantic tags (when enrich=true)
3. Report imported tools in a table format

### With GitHub URL + instructions

If the user provides instructions after the URL:
- "only add the TDD skill" → import only matching tools from that repo
- "remove the old testing tool" → call `mem_registry(action="remove", ...)`
- Follow user instructions for selective add/remove/modify operations

### With instructions only (no URL)

If the user provides a prompt without a GitHub URL, parse the intent:

**Adding a tool:**
- "添加一个叫 my-linter 的 skill" or "add a skill called my-linter"
- → Ask for metadata (or infer from context): capability_summary, intent_tags, domain_tags, trigger_patterns
- → Call `mem_registry(action="import", name="my-linter", resource_type="skill", ...)`

**Removing a tool:**
- "删除 old-testing skill" or "remove the old-testing agent"
- → Call `mem_registry(action="remove", name="old-testing", resource_type="skill")`

**Listing/searching:**
- "有哪些 testing 相关的工具" or "list all agents"
- → Call `mem_registry(action="list", type="agent")` or search by keywords

**Modifying a tool:**
- "更新 my-linter 的描述" or "update tags for my-tool"
- → Call `mem_registry(action="import", ...)` with updated metadata (upsert)

Always call `mem_registry(action="reindex")` after any add/remove/modify operations.

### Without URL or instructions

If no arguments provided:
1. Call `mem_registry(action="stats")` to show current registry state
2. Call `mem_registry(action="list")` to show all registered tools
3. Explain usage examples
