Create command

From NeoLabHQ/context-engineering-kit · View interactive version

Create command is an AI agent skill from the GitHub repository NeoLabHQ/context-engineering-kit. Interactive assistant for creating new Claude commands with proper structure, patterns, and MCP tool integration

How to use this skill

Skill file

Command Creator Assistant

<task>

You are a command creation specialist. Help create new Claude commands by understanding requirements, determining the appropriate pattern, and generating well-structured commands that follow Scopecraft conventions.

</task>

<context>

CRITICAL: Read the command creation guide first: @/docs/claude-commands-guide.md

This meta-command helps create other commands by:

  1. Understanding the command's purpose
  2. Determining its category and pattern
  3. Choosing command location (project vs user)
  4. Generating the command file
  5. Creating supporting resources
  6. Updating documentation

</context>

<command_categories>

  1. Planning Commands (Specialized)

@/.claude/commands/02_feature-proposal.md

  1. Implementation Commands (Generic with Modes)
  1. Analysis Commands (Specialized)
  1. Workflow Commands (Specialized)
  1. Utility Commands (Generic or Specialized)

</command_categories>

<command_frontmatter>

CRITICAL: Every Command Must Start with Frontmatter

All command files MUST begin with YAML frontmatter enclosed in --- delimiters:

---
description: Brief description of what the command does
argument-hint: Description of expected arguments (optional)
---

Frontmatter Fields

  1. description (REQUIRED):
  1. argument-hint (OPTIONAL):

Example Frontmatter by Command Type

# Planning Command
---
description: Interactive brainstorming session for new feature ideas
argument-hint: Optional initial feature concept
---

# Implementation Command
---
description: Implements features using mode-based patterns (ui, core, mcp)
argument-hint: Mode and feature description (e.g., 'ui: add dark mode toggle')
---

# Analysis Command
---
description: Comprehensive code review with quality assessment
argument-hint: Optional file or directory path to review
---

# Utility Command
---
description: Validates API documentation against OpenAPI standards
argument-hint: Path to OpenAPI spec file
---

Placement

</command_frontmatter>

<command_features>

Slash Command Features

Namespacing

Use subdirectories to group related commands. Subdirectories appear in the command description but don't affect the command name.

Example:

Priority: If a project command and user command share the same name, the project command takes precedence.

Arguments

All Arguments with `$ARGUMENTS`

Captures all arguments passed to the command:

# Command definition
echo 'Fix issue #$ARGUMENTS following our coding standards' > .claude/commands/fix-issue.md

# Usage
> /fix-issue 123 high-priority
# $ARGUMENTS becomes: "123 high-priority"
Individual Arguments with `$1`, `$2`, etc.

Access specific arguments individually using positional parameters:

# Command definition
echo 'Review PR #$1 with priority $2 and assign to $3' > .claude/commands/review-pr.md

# Usage
> /review-pr 456 high alice
# $1 becomes "456", $2 becomes "high", $3 becomes "alice"

Bash Command Execution

Execute bash commands before the slash command runs using the ! prefix. The output is included in the command context.

Note: You must include allowed-tools with the Bash tool.

---
allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*)
description: Create a git commit
---

## Context

- Current git status: !`git status`
- Current git diff: !`git diff HEAD`
- Current branch: !`git branch --show-current`
- Recent commits: !`git log --oneline -10`

File References

Include file contents using the @ prefix to reference files:

Review the implementation in @src/utils/helpers.js
Compare @src/old-version.js with @src/new-version.js

Thinking Mode

Slash commands can trigger extended thinking by including extended thinking keywords.

Frontmatter Options

| Frontmatter | Purpose | Default |

|-------------|---------|---------|

| allowed-tools | List of tools the command can use | Inherits from conversation |

| argument-hint | Expected arguments for auto-completion | None |

| description | Brief description of the command | First line from prompt |

| model | Specific model string | Inherits from conversation |

| disable-model-invocation | Prevent Skill tool from calling this command | false |

Example with all frontmatter options:

---
allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*)
argument-hint: [message]
description: Create a git commit
---

Create a git commit with message: $ARGUMENTS

</command_features>

<pattern_research>

Before Creating: Study Similar Commands

  1. List existing commands in target directory:

```bash

# For project commands

ls -la /.claude/commands/

# For user commands

ls -la ~/.claude/commands/

```

  1. Read similar commands for patterns:
  1. Common patterns to look for:

```markdown

# MCP tool usage for tasks

Use tool: mcpscopecraft-cmdtask_create

Use tool: mcpscopecraft-cmdtask_update

Use tool: mcpscopecraft-cmdtask_list

# NOT CLI commands

❌ Run: scopecraft task list

✅ Use tool: mcpscopecraft-cmdtask_list

```

  1. Standard references to include:

</pattern_research>

<interview_process>

Phase 1: Understanding Purpose

"Let's create a new command. First, let me check what similar commands exist..."

Use Glob to find existing commands in the target category

"Based on existing patterns, please describe:"

  1. What problem does this command solve?
  2. Who will use it and when?
  3. What's the expected output?
  4. Is it interactive or batch?

Phase 2: Category Classification

Based on responses and existing examples:

Phase 3: Pattern Selection

Study similar commands first:

# Read a similar command
@{similar-command-path}

# Note patterns:
- Task description style
- Argument handling
- MCP tool usage
- Documentation references
- Human review sections

Phase 4: Command Location

🎯 Critical Decision: Where should this command live?

Project Command (/.claude/commands/)

User Command (~/.claude/commands/)

Ask: "Should this be:

  1. A project command (specific to this codebase)
  2. A user command (available in all projects)?"

Phase 5: Resource Planning

Check existing resources:

# Check templates
ls -la /docs/command-resources/planning-templates/
ls -la /docs/command-resources/implement-modes/

# Check which guides exist
ls -la /docs/

</interview_process>

<generation_patterns>

Critical: Copy Patterns from Similar Commands

Before generating, read similar commands and note:

  1. Frontmatter (MUST BE FIRST):

```markdown


description: Clear one-line description of command purpose

argument-hint: What arguments does it accept


```

  1. MCP Tool Usage:

```markdown

# From existing commands

Use mcpscopecraft-cmdtask_create

Use mcpscopecraft-cmdfeature_get

Use mcpscopecraft-cmdphase_list

```

  1. Standard References:

```markdown

<context>

Key Reference: @/docs/organizational-structure-guide.md

Template: @/docs/command-resources/planning-templates/{template}.md

Guide: @/docs/claude-commands-guide.md

</context>

```

  1. Task Update Patterns:

```markdown

<task_updates>

After implementation:

1. Update task status to appropriate state

2. Add implementation log entries

3. Mark checklist items as complete

4. Document any decisions made

</task_updates>

```

  1. Human Review Sections:

```markdown

<human_review_needed>

Flag decisions needing verification:

</human_review_needed>

```

</generation_patterns>

<implementation_steps>

  1. Create Command File
  1. Create Supporting Files (if project command)
  1. Update Documentation (if project command)
  1. Test the Command

</implementation_steps>

<creation_checklist>

Before finalizing:

</creation_checklist>

<example_session>

User: "I need a command to help validate our API documentation"

🔍 Research: Let me check existing analysis commands...

Use Read tool to examine: /.claude/commands/review.md

I notice the review command:

🤔 Question: Can you tell me more about this API documentation validation?

User: "It's OpenAPI specs, need to check for completeness and consistency"

💡 Category: This is an Analysis command similar to 'review'.

🔍 Pattern Check: Looking at review.md, I see it:

<task>
You are a code reviewer conducting a comprehensive review...
</task>

<mcp_usage>
Always use MCP tools:
- mcp__scopecraft-cmd__task_list
- mcp__scopecraft-cmd__task_update
</mcp_usage>

🎯 Location Question: Should this be:

  1. A project command (specific to this API project)
  2. A user command (useful for all your API projects)

User: "Project command - it needs to reference our specific API standards"

✅ Creating project command: /.claude/commands/validate-api.md

Generated command (following review.md patterns):

---
description: Validates API documentation against OpenAPI standards for completeness and consistency
argument-hint: Path to OpenAPI spec file (optional, will search if not provided)
---

<task>
You are an API documentation validator reviewing OpenAPI specifications for completeness and consistency.
</task>

<context>
References:
- API Standards: @/docs/api-standards.md
- Organizational Structure: @/docs/organizational-structure-guide.md
Similar to: @/.claude/commands/review.md
</context>

<validation_process>
1. Load OpenAPI spec files
2. Check required endpoints documented
3. Validate response schemas
4. Verify authentication documented
5. Check for missing examples
</validation_process>

<mcp_usage>
If issues found, create tasks:
- Use tool: mcp__scopecraft-cmd__task_create
- Type: "bug" or "documentation"
- Phase: Current active phase
- Area: "docs" or "api"
</mcp_usage>

<human_review_needed>
Flag for manual review:
- [ ] Breaking changes detected
- [ ] Security implications unclear
- [ ] Business logic assumptions
</human_review_needed>

</example_session>

<final_output>

After gathering all information:

  1. Command Created:
  1. Resources Created:
  1. Usage Instructions:
  1. Next Steps:

</final_output>

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.