home / skills / lambda-curry / devagent / create-slash-command

create-slash-command skill

/.cursor/skills/create-slash-command

This skill creates new DevAgent slash command files in .agents/commands and sets up Cursor IDE symlinks for seamless workflow automation.

npx playbooks add skill lambda-curry/devagent --skill create-slash-command

Review the files below or copy the command above to add this skill to your agents.

Files (5)
SKILL.md
4.3 KB
---
name: create-slash-command
description: Create new slash commands for DevAgent workflows. Use when you need to create a new command file in .agents/commands/ and symlink it to .cursor/commands/ for Cursor IDE integration. This skill handles the complete command creation workflow including file generation, symlink creation, and structure validation.
---

# Create Slash Command

## Overview

This skill automates the creation of DevAgent slash commands, which are standardized command files that provide interfaces for executing workflows. Commands are created in `.agents/commands/` and symlinked to `.cursor/commands/` for Cursor IDE integration.

**Important**: Commands are **snippets/templates** that get inserted into the chat conversation when invoked in Cursor IDE. The entire command file content is inserted, and users fill in placeholder areas (like "Input Context:") with their specific information. Keep commands simple and self-contained—they should be ready to paste into chat.

## Quick Start

To create a new command:

1. **Create the command file**:
   ```bash
   python3 scripts/create_command.py <command-name> [--workflow <workflow-name>]
   ```

2. **Create the symlink**:
   ```bash
   python3 scripts/create_symlink.py <command-name>
   ```

3. **Update README**: Add the new command to `.agents/commands/README.md`

## Command Creation Workflow

### Step 1: Create Command File

Run `scripts/create_command.py` with the command name:

```bash
python3 scripts/create_command.py my-new-command
```

This creates a command file at `.agents/commands/my-new-command.md` following the standard template. The command will reference a workflow file at `.devagent/core/workflows/my-new-command.md` by default.

**Specify a different workflow**:
```bash
python3 scripts/create_command.py my-command --workflow different-workflow
```

### Step 2: Create Symlink

Run `scripts/create_symlink.py` to create the symlink:

```bash
python3 scripts/create_symlink.py my-new-command
```

This creates a symlink from `.cursor/commands/my-new-command.md` to `.agents/commands/my-new-command.md`, making the command available in Cursor IDE.

### Step 3: Update Documentation

Manually add the new command to `.agents/commands/README.md` in the "Available Commands" section.

## Command Structure

Commands follow a standardized structure that functions as a snippet template. See `references/command-structure.md` for complete details. The template includes:

- Command title (Title Case with "(Command)" suffix)
- Instructions section (can include workflow-specific guidance about required inputs)
- Workflow reference to `.devagent/core/workflows/[workflow-name].md`
- Input Context placeholder (simple, single placeholder area for user input)

Since commands are snippets that get inserted into chat, keep the structure simple:
- Provide workflow-specific guidance in the Instructions section
- Use a single "Input Context:" placeholder for user input
- Avoid complex multi-field forms; explain in instructions what information is needed

The command template is available in `assets/command-template.md` for reference.

## Naming Conventions

- **Format**: Kebab-case (lowercase with hyphens)
- **Examples**: `create-plan.md`, `research.md`, `clarify-feature.md`
- **Avoid**: Generic names like `help.md` or `test.md`

## Validation

Before completing command creation, verify:

- [ ] Command file exists in `.agents/commands/[command-name].md`
- [ ] Command structure matches workflow requirements (use template as starting point, keep snippet-friendly)
- [ ] Workflow file is referenced correctly
- [ ] Instructions clearly guide agent and explain required inputs
- [ ] Input placeholder is simple and easy to fill in (commands are snippets)
- [ ] Symlink exists in `.cursor/commands/[command-name].md`
- [ ] Command is listed in `.agents/commands/README.md`

## Resources

### Scripts

- **`scripts/create_command.py`**: Creates a new command file in `.agents/commands/` following the standard template
- **`scripts/create_symlink.py`**: Creates a symlink from `.cursor/commands/` to `.agents/commands/`

### References

- **`references/command-structure.md`**: Complete reference documentation for command structure, naming conventions, and integration requirements

### Assets

- **`assets/command-template.md`**: Template file for command structure (used by create_command.py)

Overview

This skill automates creating DevAgent slash commands and preparing them for Cursor IDE. It generates a standardized command file in .agents/commands/, creates the required symlink in .cursor/commands/, and validates structure and naming. Use it to produce ready-to-insert snippet commands that follow workflow conventions.

How this skill works

The skill runs scripts to create a new command markdown file from a template, optionally referencing a specific workflow. It then creates a symlink pointing the Cursor commands folder to the new file so the command appears in the IDE. Finally, it validates presence, naming, workflow reference, input placeholder, and README listing.

When to use it

  • You need a new slash command snippet for a DevAgent workflow.
  • You want the command available inside Cursor IDE without manual symlink work.
  • You need to enforce name and structure conventions for new commands.
  • You want an automated validation checklist before publishing a command.

Best practices

  • Use kebab-case for command filenames (lowercase with hyphens).
  • Keep commands simple and self-contained: one Input Context placeholder and clear instructions.
  • Reference the appropriate workflow in .devagent/core/workflows/ by name.
  • Avoid generic names like help.md or test.md; pick descriptive command names.
  • After creation, add the command to .agents/commands/README.md and confirm the symlink exists.

Example use cases

  • Create a new research command that inserts a workflow snippet into chat and prompts the user for context.
  • Add a clarify-feature command that references a feature-clarification workflow and includes clear input guidance.
  • Generate a create-plan command tied to a planning workflow and link it into Cursor for easy reuse.
  • Batch-create multiple commands with different workflow references and validate each with the checklist.

FAQ

What scripts does this skill use to create commands and symlinks?

It uses scripts/create_command.py to generate the command file and scripts/create_symlink.py to create a symlink in .cursor/commands/.

How should a command be structured?

Use the standard template: Title (with "(Command)" suffix), an Instructions section with required inputs, a workflow reference to .devagent/core/workflows/[workflow-name].md, and a single "Input Context:" placeholder for user input.