---
description: Create SmartStack projects and extensions
argument-hint: <type> <name> [description]
---

# SmartStack Creator

Create complete project structures for SmartStack applications and extensions.

## Supported Types

| Type | Command | Description |
|------|---------|-------------|
| **project** | `/create:project` | Full-stack app (.NET + React + Vite + Tailwind) |
| **command** | `/create:command` | Slash command (like /apex, /gitflow) |
| **agent** | `/create:agent` | Specialized execution agent |
| **skill** | `/create:skill` | Multi-phase workflow orchestrator |
| **hook** | `/create:hook` | Git operation validator |
| **plugin** | `/create:plugin` | Full CLI extension with all types |

## Quick Usage

```
/create project MyApp "My awesome full-stack application"
/create command my-feature "Description of my feature command"
/create agent code-reviewer "Agent for reviewing code quality"
/create skill deployment "Multi-phase deployment workflow"
/create hook security-check "Pre-commit security validation"
/create plugin my-toolkit "Complete CLI toolkit extension"
```

## Workflow

### 1. PARSE ARGUMENTS

Extract from `$ARGUMENTS`:
- **type**: command | agent | skill | hook | plugin
- **name**: Extension name (kebab-case)
- **description**: Optional description

If arguments missing, use AskUserQuestion to gather:
- Type of extension
- Name (validate kebab-case)
- Description

### 2. VALIDATE

Check:
- Name is valid kebab-case: `^[a-z][a-z0-9-]*$`
- Type is supported
- Target directory doesn't already exist

### 3. CREATE PROJECT STRUCTURE

Create the following structure:

```
smartstack-{name}/
├── package.json              # npm package configuration
├── tsconfig.json             # TypeScript configuration
├── tsup.config.ts            # Build configuration
├── README.md                 # Documentation
├── .gitignore                # Git ignore rules
├── src/
│   └── index.ts              # Main entry point
└── templates/
    ├── commands/             # Command templates
    │   └── {name}.md
    ├── agents/               # Agent templates
    │   └── {name}.md
    ├── skills/               # Skill templates
    │   └── {name}/
    │       ├── SKILL.md
    │       └── 1-*.md (phases)
    └── hooks/                # Hook templates
        └── {name}.md
```

### 4. GENERATE FILES

Use the Write tool to create each file with proper content.

**File Generation Order:**
1. Create root directory
2. Create package.json
3. Create tsconfig.json
4. Create tsup.config.ts
5. Create src/index.ts
6. Create README.md
7. Create .gitignore
8. Create templates based on type

### 5. SHOW NEXT STEPS

Display instructions for:
- Installing dependencies
- Editing templates
- Building the extension
- Publishing

## Type-Specific Templates

### Command Template Structure

```yaml
---
description: {description}
argument-hint: <task-description>
---

# {PascalCaseName}

{description}

## Workflow
[phases]

## Execution Rules
[rules]

## Priority
[priority statement]

---
User: $ARGUMENTS
```

### Agent Template Structure

```yaml
---
name: {kebab-case-name}
description: {description}
color: yellow
model: haiku
---

# {PascalCaseName} Agent

## Search Strategy
[strategy]

## Output Format
[format]
```

### Skill Template Structure

```yaml
---
name: {kebab-case-name}
description: {description}
---

# {PascalCaseName} Skill

## Phases
[phase table]

## Workflow Diagram
[ASCII diagram]

## Model Strategy
[cost table]
```

### Hook Template Structure

```yaml
---
description: {description}
trigger: pre-commit
blocking: true
---

# {PascalCaseName} Hook

## Patterns to Detect
[patterns]

## Detection Script
[bash script]
```

## Execution Rules

1. **ALWAYS** validate name format before creating files
2. **NEVER** overwrite existing directories
3. Use Write tool for all file creation
4. Generate complete, working templates
5. Include practical examples in generated code

## Output Format

After creation, display:

```
╔═══════════════════════════════════════════════════════════╗
║           SMARTSTACK EXTENSION CREATED                    ║
╠═══════════════════════════════════════════════════════════╣
║  Name:     smartstack-{name}                              ║
║  Type:     {type}                                         ║
║  Location: {full-path}                                    ║
╠═══════════════════════════════════════════════════════════╣
║  Next steps:                                              ║
║  1. cd smartstack-{name}                                  ║
║  2. npm install                                           ║
║  3. Edit templates in templates/ folder                   ║
║  4. npm run build                                         ║
║  5. npm publish (when ready)                              ║
╚═══════════════════════════════════════════════════════════╝
```

## Priority

Completeness > Correctness > Speed

---

User: $ARGUMENTS
