# Expansion Discovery Task

## Task Metadata
```yaml
id: expansion-discovery
title: VCSYS Expansion Package Discovery and Installation
description: Discover new VCSYS expansion packages and install them conversationally
category: package-management
complexity: moderate
estimated_time: 5-15 minutes
dependencies: []
outputs:
  - Available expansion packages
  - Installation status
  - Package recommendations
elicit: true
```

## Task Overview

This task helps users discover and install new VCSYS expansion packages that have been released since their last check. The orchestrator uses this task to check changelogs, compare with installed packages, and facilitate conversational installation.

## Execution Steps

### Step 1: Check Current Installation Status
**Objective**: Understand what the user currently has installed

**Actions**:
1. Execute `vcsys status` to see current installed blocks
2. Check the user's configuration to see last expansion check date
3. Assess what types of blocks they're using most

**Questions to ask user**:
- "Let me check what you currently have installed..."

### Step 2: Discover New Releases
**Objective**: Find new expansion packages released since last check

**Actions**:
1. Check expansion changelog for new releases
2. Compare with user's installed packages
3. Identify new packages they don't have
4. Categorize by type (agents, templates, tasks, workflows, kits)

**Output Format**:
```
📦 Found [X] new expansions:

🧩 New Agents ([count])
  • agent-name        v1.2.0    Release Date
    Description of what this agent does
    ★ Key improvement or new capability

🎨 New Templates ([count])
  • template-name     v1.1.0    Release Date
    Description and use case

⚙️ New Tasks ([count])
  • task-name         v1.0.5    Release Date
    Workflow automation capability

📦 New Kits ([count])
  • kit-name          v2.0.0    Release Date
    Bundle description and included components
```

### Step 3: Present Options
**Objective**: Show user what's available and get their preferences

**Questions to ask user**:
1. "Here's what's new since your last check. What interests you?"
2. "Would you like me to install any of these expansions?"
3. "Are you working on any specific type of project that might benefit from these?"

**Interaction Format**:
- Present numbered list of categories
- Allow user to explore specific types
- Provide installation examples

### Step 4: Conversational Installation
**Objective**: Install requested packages based on natural language

**User Experience Flow**:
- User: "what new packages have been released that I don't have?"
- Orchestrator: Shows available new packages by category
- User: "install the new marketing kit"
- Orchestrator: Executes npm installation with progress feedback

**Installation Commands**:
```bash
# For individual packages
npm install -g @vcsys/agent-[name]
npm install -g @vcsys/template-[name]
npm install -g @vcsys/task-[name]

# For kits (bundles)
npm install -g @vcsys/[kit-name]-kit
```

### Step 5: Verify Installation
**Objective**: Confirm successful installation and show next steps

**Actions**:
1. Verify package was installed correctly
2. Update user's configuration with installation date
3. Show user how to use their new capabilities
4. Suggest complementary packages if relevant

**Success Output**:
```
✅ Successfully installed [package-name]!

🎯 Next Steps:
  • Run: vcsys status - to see your new capabilities
  • Use: vcsys [command] - to try it out
  • Explore: [related functionality]
```

## Conversation Patterns

### Discovery Patterns
User asks any of:
- "What new packages have been released?"
- "Check for new expansions"
- "What's available that I don't have?"
- "Show me new agents/templates/etc"

### Installation Patterns  
User requests like:
- "Install the marketing kit"
- "Add the new content creator agent"
- "Get the lifestyle coaching package"
- "Install agent X"

### Package Type Recognition
- **Kits**: "marketing kit", "dev kit", "enterprise kit"
- **Agents**: "agent [name]", "[name] agent", "install [role]"
- **Templates**: "template [name]", "[name] template"
- **Tasks**: "task [name]", "[workflow] task"

## Error Handling

### Common Issues
1. **No new packages**: Inform user they're up to date
2. **Installation failures**: Show error and suggest alternatives
3. **Unclear requests**: Ask for clarification with examples
4. **Network issues**: Suggest trying later or checking connection

### Recovery Actions
- Provide clear error messages
- Suggest alternative installation methods
- Offer manual installation instructions
- Show available offline options

## Integration Notes

**For Orchestrator Agent**:
- This task integrates with the expansion discovery commands
- Use when user asks about new packages or expansions
- Can be triggered automatically or on user request
- Maintains conversation context for follow-up installations

**CLI Integration**:
- Works with existing `vcsys` CLI commands
- Uses npm for actual package installation
- Updates configuration automatically
- Provides status feedback throughout process

## Example Interaction

```
User: "What new packages have been released that I don't have?"

Orchestrator: Let me check what's new since your last update...

📦 Found 3 new expansions:

🧩 New Agents (2)
  1. lifestyle-coach     v1.0.0    Aug 11, 2025
     Personal development and wellness coaching
     ★ Habit tracking and goal setting capabilities
  
  2. content-creator     v1.1.0    Aug 10, 2025  
     Social media and content strategy
     ★ Multi-platform content planning

🎨 New Templates (1)
  3. personal-brand      v1.0.0    Aug 11, 2025
     Personal branding and portfolio templates

Would you like me to install any of these? Just say something like "install the lifestyle coach" or "get the content creator agent".

User: "install the lifestyle coach"

Orchestrator: 📦 Installing lifestyle-coach agent...
📥 Running: npm install -g @vcsys/agent-lifestyle-coach

✅ Successfully installed @vcsys/agent-lifestyle-coach!

🎯 Next Steps:
  • Run: vcsys status - to see your new capabilities  
  • Use: vcsys lifestyle-coach - to start a coaching session
  • The agent can help with habit tracking, goal setting, and wellness planning

Anything else you'd like to install?
```