# Add Prompt to Collection

Add a new prompt to `src/content/prompts/` with properly generated frontmatter.

## Phase 1: Parse Input

The user will provide raw prompt content. This typically includes:
- A YAML config block with: description, allowed-tools, model, argument-hint
- Markdown instructions/body

Extract:
1. **name**: From the heading or first line (e.g., "# Learn from Conversation" → "learn")
2. **description**: From the YAML `description` field
3. **model**: From the YAML `model` field
4. **allowed-tools**: From the YAML `allowed-tools` field

## Phase 2: Generate Frontmatter

Create the primary frontmatter block for the prompts collection:

```yaml
---
title: "{Title Case Name}: {Brief Purpose}"
pubDatetime: {today's date}T00:00:00Z
tool: "claude"
category: "{skill|instruction|prompt|agent}"  # Infer from content
tags: [{extract relevant keywords}]
description: "{from input description}"
useCase: "{derive from when/how to use}"
modelVersion: "{from model field, formatted nicely}"
expectedOutput: "{infer from the prompt's goal}"
draft: false
---
```

**Category inference:**
- Has `allowed-tools` + specific workflow → "instruction"
- Has `name:` field in YAML → "skill"
- Simple prompt without execution config → "prompt"
- Describes an autonomous agent → "agent"

## Phase 3: Generate Filename

Format: `claude-{kebab-case-name}-command.md`

Examples:
- "Learn" → `claude-learn-command.md`
- "Fix Pipeline" → `claude-fix-pipeline-command.md`
- "Create Skill" → `claude-create-skill.md`

## Phase 4: Present Draft

Show the complete file content:
1. The generated primary frontmatter
2. The original skill config YAML block (preserved as-is)
3. The original prompt body (preserved as-is)

Ask: "Ready to create `{filename}`?"

## Phase 5: Create File

After user approval:
1. Write to `src/content/prompts/{filename}`
2. Confirm creation with path

---

--- title: Conventional Commit description: Slash command to create conventional commit messages and commit staged changes following the conventional commits specification tool: claude category: instruction tags: ['git', 'commit', 'conventional-commits', 'automation', 'workflow'] url: https://alexop.dev/prompts/claude/claude-conventional-commit ---