# Modular Installation Guide

MyAIDev Method v0.2.19 introduces modular workflow installation, allowing you to install only the components you need.

## Quick Start

### Content Creation Only
```bash
npx myaidev-method@latest content --claude
```

### Development Workflow Only (SPARC)
```bash
npx myaidev-method@latest dev --claude
```

### Visual Content Generation
```bash
npx myaidev-method@latest visual --claude
```

### WordPress Publishing
```bash
npx myaidev-method@latest publish --wordpress
```

### Complete Installation (All Workflows)
```bash
npx myaidev-method@latest init --claude
```

## Available Workflows

### Content Creation (`content`)
Professional content writing with SEO optimization

**Includes:**
- `content-writer` skill
- `proprietary-content-verifier` skill
- `/content-writer` skill
- Content generation scripts and libraries

**Dependencies:** `core` (automatically installed)

**Use Case:** Writers, bloggers, content marketers

### Visual Content Generation (`visual`)
AI-powered image and video generation

**Includes:**
- `visual-content-generator` skill
- `/myai-visual-generator` skill
- Image and video generation scripts
- Support for Gemini, Imagen, DALL-E, Veo

**Dependencies:** `core` (automatically installed)

**Required Environment Variables:**
- `GOOGLE_AI_API_KEY`
- `OPENAI_API_KEY`
- `FAL_AI_API_KEY`

**Use Case:** Content creators needing visual assets

### Development Workflow (`dev`)
SPARC methodology for systematic software development

**Includes:**
- 24 SuperClaude commands (sc:git, sc:implement, sc:test, etc.)
- Complete SPARC workflow integration
- Development methodology documentation

**Dependencies:** `core` (automatically installed)

**Use Case:** Software developers, development teams

### Publishing Workflows (`publish`)
Multi-platform content publishing

**WordPress Publishing (`publish-wordpress`):**
- `wordpress-admin` skill
- `/wordpress-publisher` skill
- WordPress health check and security scripts
- Enhanced MCP server integration

**PayloadCMS Publishing (`publish-payloadcms`):**
- `/payloadcms-publisher` skill
- PayloadCMS utilities with Lexical format support
- Health check scripts

**Static Site Publishing (`publish-static`):**
- `/static-publisher` skill
- Support for Hugo, Jekyll, 11ty
- Static site generation scripts

**Install all publishing workflows:**
```bash
npx myaidev-method@latest publish --all
```

**Dependencies:** `core`, `content` (automatically installed)

**Required Environment Variables:**
- WordPress: `WORDPRESS_URL`, `WORDPRESS_USERNAME`, `WORDPRESS_APP_PASSWORD`
- PayloadCMS: `PAYLOADCMS_URL`, `PAYLOADCMS_API_KEY`

### Deployment Workflows (`deploy`)

**General Deployment (`deployment`):**
- `/deploy` skill
- Docker, Vercel, Netlify deployment scripts
- Deployment management library

**Coolify Deployment (`coolify`):**
- `/coolify-deployer` skill
- Coolify health check scripts
- Self-hosted PaaS deployment

**Install all deployment workflows:**
```bash
npx myaidev-method@latest deploy --all
```

**Dependencies:** `core` (deployment base), `deployment` (for coolify)

**Required Environment Variables:**
- Vercel: `VERCEL_TOKEN`
- Netlify: `NETLIFY_TOKEN`
- Coolify: `COOLIFY_URL`, `COOLIFY_API_KEY`

### Core Framework (`core`)
Essential framework components (automatically installed with any workflow)

**Includes:**
- `content-production-coordinator` skill
- `/content-production-coordinator` skill
- `/configure` skill
- Configuration management
- File utilities and logger

## Workflow Management Commands

### List Installed Workflows
```bash
npx myaidev-method@latest list
```

Shows all currently installed workflows.

### Check Installation Status
```bash
npx myaidev-method@latest status
```

Shows detailed installation status including:
- Number of installed workflows
- Last modification date
- Available workflows

### Add a Workflow
```bash
npx myaidev-method@latest add <workflow-name>
```

Examples:
```bash
npx myaidev-method@latest add visual
npx myaidev-method@latest add publish-wordpress
npx myaidev-method@latest add coolify
```

Dependencies are automatically resolved and installed.

### Remove a Workflow
```bash
npx myaidev-method@latest remove <workflow-name>
```

Examples:
```bash
npx myaidev-method@latest remove visual
npx myaidev-method@latest remove publish-wordpress
```

**Note:** Cannot remove workflows that other installed workflows depend on.

## Command Options

### Dry Run Mode
Preview what would be installed without making changes:

```bash
npx myaidev-method@latest content --dry-run
npx myaidev-method@latest publish --wordpress --dry-run
```

### Verbose Mode
Show detailed installation progress:

```bash
npx myaidev-method@latest content --verbose
npx myaidev-method@latest dev --verbose
```

### Combined Options
```bash
npx myaidev-method@latest publish --all --dry-run --verbose
```

## Installation Manifest

MyAIDev Method tracks installed workflows in `.myaidev-manifest.json`:

```json
{
  "version": "1.0.0",
  "installedWorkflows": [
    "core",
    "content",
    "publish-wordpress"
  ],
  "installedAt": "2025-11-20T12:00:00.000Z",
  "lastModified": "2025-11-20T12:05:00.000Z"
}
```

This file enables:
- Avoiding duplicate installations
- Dependency tracking
- Update management
- Installation history

## Workflow Dependencies

The system automatically resolves and installs dependencies:

```
content
└── core (auto-installed)

publish-wordpress
├── core (auto-installed)
└── content (auto-installed)

publish-payloadcms
├── core (auto-installed)
└── content (auto-installed)

coolify
├── core (auto-installed)
└── deployment (auto-installed)

development
└── core (auto-installed)

visual
└── core (auto-installed)
```

## Use Cases

### Content Creator (WordPress)
```bash
npx myaidev-method@latest content --claude
npx myaidev-method@latest add publish-wordpress
```

Installs: `core`, `content`, `publish-wordpress`

### Software Developer
```bash
npx myaidev-method@latest dev --claude
```

Installs: `core`, `development` (24 SPARC commands)

### Content Creator (Multi-Platform)
```bash
npx myaidev-method@latest content --claude
npx myaidev-method@latest publish --all
```

Installs: `core`, `content`, `publish-wordpress`, `publish-payloadcms`, `publish-static`

### Full-Stack Developer + Deployment
```bash
npx myaidev-method@latest dev --claude
npx myaidev-method@latest deploy --all
```

Installs: `core`, `development`, `deployment`, `coolify`

### Visual Content Creator
```bash
npx myaidev-method@latest content --claude
npx myaidev-method@latest visual --claude
npx myaidev-method@latest add publish-wordpress
```

Installs: `core`, `content`, `visual`, `publish-wordpress`

### Everything (Backward Compatible)
```bash
npx myaidev-method@latest init --claude
```

Installs all available workflows (same as previous versions)

## Migration from Previous Versions

If you have an existing installation from v0.2.18 or earlier:

### Option 1: Continue Using Full Installation
Your existing installation continues to work. Use `npx myaidev-method@latest update --claude` to update all components.

### Option 2: Migrate to Modular System
1. **Backup your customizations** (custom agents, commands, scripts)
2. **Remove old installation**:
   ```bash
   rm -rf .claude
   rm -rf .myaidev-method
   ```
3. **Install only what you need**:
   ```bash
   npx myaidev-method@latest content --claude
   npx myaidev-method@latest add publish-wordpress
   ```
4. **Restore your customizations** to the new structure

### Legacy Compatibility
The `init --claude` command still works exactly as before, installing all workflows for backward compatibility.

## Troubleshooting

### "Unknown workflow" Error
```bash
npx myaidev-method@latest add unknown-workflow
# Error: Unknown workflow: unknown-workflow
```

**Solution:** Use `npx myaidev-method@latest --help` to see available workflows.

### "Cannot remove" Error
```bash
npx myaidev-method@latest remove core
# Error: Cannot remove core: Required by content, development
```

**Solution:** Remove dependent workflows first, or use `status` to see dependencies.

### Check Installation
```bash
npx myaidev-method@latest list
npx myaidev-method@latest status
```

### Verify Files Were Installed
```bash
# Check skills structure
ls -la .claude/skills/

# Check scripts and libraries
ls -la scripts/
ls -la src/lib/
```

### Environment Variables Not Set
After installing workflows that require environment variables:

```bash
npx myaidev-method configure

# Or manually edit .env:
cp .env.example .env
nano .env
```

## Best Practices

### Start Small
Install only what you need initially:
```bash
npx myaidev-method@latest content --claude
```

Add more workflows as needed:
```bash
npx myaidev-method@latest add publish-wordpress
npx myaidev-method@latest add visual
```

### Use Dry Run First
Preview installations before committing:
```bash
npx myaidev-method@latest dev --dry-run --verbose
```

### Check Dependencies
Use `status` to understand your installation:
```bash
npx myaidev-method@latest status
```

### Keep Track of Workflows
List installed workflows regularly:
```bash
npx myaidev-method@latest list
```

### Version Control
Add to `.gitignore`:
```
.myaidev-manifest.json
.claude/
scripts/
src/lib/
```

Commit workflow choices in your README:
```markdown
## MyAIDev Method Workflows

Installed workflows:
- Content creation
- WordPress publishing
- Visual content generation
```

## Future Roadmap

### v0.3.0 (Planned)
- Workflow templates for common combinations
- Interactive workflow selection wizard
- Workflow marketplace for community extensions
- Export/import workflow configurations

### v0.4.0 (Planned)
- Custom workflow creation
- Workflow versioning
- Dependency conflict resolution
- Plugin system for workflow extensions

## Support

For issues or questions:
- GitHub Issues: https://github.com/myaione/myaidev-method/issues
- Documentation: https://github.com/myaione/myaidev-method

## Changelog

### v0.2.19
- ✨ Initial modular workflow system
- ✨ 9 distinct workflows with dependency resolution
- ✨ Installation manifest tracking
- ✨ Workflow management commands (add, remove, list, status)
- ✅ Backward compatible with `init --claude`
