---
name: tool-discovery-agent
description: Automatically searches for and installs helpful Claude Code tools/plugins from code.claude.com based on current task context. Use when starting any complex task to ensure optimal tooling is available.
---

# Tool Discovery Agent Skill

This skill autonomously discovers and installs Claude Code plugins/tools to optimize task completion.

## When to Use

**Trigger this skill when:**
- Starting a complex multi-step task
- User asks "what tools can help with this?"
- Encountering limitations in current capabilities
- Task could benefit from specialized plugins
- Need for automation, testing, or advanced features

## Discovery Process

### Step 1: Analyze Task Context

Identify task requirements:
```bash
# What type of task?
- Development/coding → Check for language-specific tools
- Design/UI → Search for design plugins
- Testing → Find testing/automation tools
- Documentation → Look for doc generators
- Deployment → Search for DevOps tools
- Data processing → Find data analysis plugins
```

### Step 2: Search Claude Plugin Registry

Use web-search or fetch Claude's plugin documentation:
```
https://code.claude.com/docs/en/discover-plugins
https://github.com/anthropics/claude-plugins-official
```

**Search Query Pattern:**
```
"Claude Code plugin for [task_type]"
"[language/framework] Claude Code tool"
"Claude Code [feature] automation"
```

### Step 3: Evaluate Plugin Options

For each discovered plugin, assess:
- **Relevance**: Does it solve current need? (0-10 score)
- **Popularity**: Stars, downloads, community usage
- **Maintenance**: Last updated, active development
- **Compatibility**: Works with current Claude Code version
- **Dependencies**: Required tools/languages installed?

**Priority Matrix:**
```
HIGH PRIORITY (install immediately):
- Score 8-10 relevance
- Official Anthropic plugins
- >1000 stars/active maintenance

MEDIUM PRIORITY (ask user):
- Score 5-7 relevance
- Community plugins with good reviews
- Specific use case matches

LOW PRIORITY (note for future):
- Score <5 relevance
- Experimental/alpha plugins
- Heavy dependencies
```

### Step 4: Install Plugin

**Installation Methods:**

1. **Marketplace Plugin:**
```bash
/plugin marketplace add [repo]
/plugin install [plugin-name]
```

2. **Git Clone:**
```bash
cd ~/.claude/plugins/
git clone [repo-url]
```

3. **Skill Installation:**
```bash
mkdir -p ~/.claude/skills/[skill-name]
# Copy skill files
```

4. **NPM Package:**
```bash
npm install -g [package-name]
# Link to Claude Code
```

### Step 5: Verify Installation

```bash
# Check plugin loaded
ls -la ~/.claude/plugins/ | grep [plugin-name]

# Test plugin functionality
# Run simple command to verify

# Update auto-trigger config if needed
```

### Step 6: Configure Auto-Triggers

Add to `~/.claude/hooks/auto-trigger-integration.json`:
```json
{
  "triggers": {
    "[task_category]": {
      "keywords": ["keyword1", "keyword2"],
      "plugins": ["plugin-name"],
      "skills": ["skill-name"],
      "priority": "high"
    }
  }
}
```

## Tool Categories

### Development Tools
- **Languages**: Python, JavaScript, TypeScript, Go, Rust
- **Frameworks**: React, Next.js, Vue, Django, Rails
- **Databases**: PostgreSQL, MongoDB, Redis
- **APIs**: REST, GraphQL, gRPC

### Design Tools
- **UI/UX**: Design systems, component libraries
- **Prototyping**: Wireframing, mockups
- **Assets**: Image optimization, icons

### Testing Tools
- **Unit**: Jest, PyTest, Go tests
- **E2E**: Playwright, Cypress, Puppeteer
- **Performance**: Lighthouse, benchmarks

### DevOps Tools
- **CI/CD**: GitHub Actions, GitLab CI
- **Deployment**: Docker, Kubernetes, Vercel
- **Monitoring**: Logging, metrics, alerts

### Documentation Tools
- **Generators**: JSDoc, Sphinx, Docusaurus
- **API Docs**: OpenAPI, Swagger
- **Wikis**: Notion, Confluence integrations

### Automation Tools
- **Workflows**: n8n, Zapier
- **Scripts**: Shell, Python automation
- **Tasks**: Task runners, Make

## Example Workflow

**User Request:** "I need to test this React app"

**Tool Discovery Process:**
1. **Analyze**: React app + testing = Playwright/Cypress
2. **Search**: "Claude Code plugin playwright testing"
3. **Find**: playwright-skill (https://github.com/lackeyjb/playwright-skill)
4. **Evaluate**: 10/10 relevance, official plugin
5. **Install**: 
   ```bash
   cd /tmp && git clone https://github.com/lackeyjb/playwright-skill.git
   mkdir -p ~/.claude/skills/playwright-skill
   cp -r /tmp/playwright-skill/* ~/.claude/skills/playwright-skill/
   ```
6. **Configure**: Add browser_automation trigger
7. **Verify**: Test basic Playwright command
8. **Report**: "✅ Installed playwright-skill for React testing"

## Safety Checks

**Before Installing:**
- ✅ Verify plugin source (official GitHub/org)
- ✅ Check for malicious code (review files)
- ✅ Confirm no conflicts with existing plugins
- ✅ Ensure system dependencies met
- ✅ Ask user for permission on high-impact installs

**Red Flags:**
- ❌ Unofficial sources
- ❌ Excessive permissions
- ❌ Suspicious file operations
- ❌ Outdated dependencies
- ❌ Poor maintenance history

## Output Format

**After discovery, report:**

```
=== TOOL DISCOVERY RESULTS ===

Task: [user_task_description]

🔍 Found [N] relevant tools:

[1] TOOL_NAME (HIGH PRIORITY)
    Description: [what it does]
    Repository: [url]
    Relevance: [X]/10
    Status: ✅ INSTALLED

[2] TOOL_NAME (MEDIUM PRIORITY)
    Description: [what it does]
    Repository: [url]
    Relevance: [X]/10
    Status: ⏸️  AWAITING USER APPROVAL

Configuration:
• Auto-triggers updated for: [categories]
• Plugin directory: [path]
• Next steps: [recommendations]

===
```

## Best Practices

1. **Be Proactive**: Don't wait for user to ask
2. **Be Selective**: Only install high-value tools
3. **Be Transparent**: Always explain what you're installing
4. **Be Safe**: Verify sources before installation
5. **Be Efficient**: Batch related installations
6. **Document**: Keep record of installed tools

## Common Plugins to Install

**Essential:**
- claude-hud (monitoring)
- claude-code-safety-net (safety)
- playwright-skill (testing)
- dev-browser (web automation)

**Development:**
- Language-specific plugins (Python, JS, Go, etc.)
- Framework tools (React, Next.js, Django)
- Database tools (PostgreSQL, MongoDB)

**Productivity:**
- planning-with-files (project planning)
- repomix (code context packaging)
- claude-mem (session memory)
